001 #include "AtlfastAlgs/ElectronBinData.h"
002
003 namespace Atlfast
004 {
005
006
007
008
009
010
011
012
013
014
015
016
017
018 ElectronBinData::ElectronBinData( BinID& id,
019 vector< ParameterResolutions* > core,
020 vector< ParameterResolutions* > tails,
021 vector< ParameterResolutions* > fractions,
022 vector< ParameterResolutions* > correlations,
023 int randSeed
024 ) :
025 m_id(id),
026 m_cores(core),
027 m_tails(tails),
028 m_fractions(fractions),
029 m_correlations(correlations)
030 {
031 m_randomEngine = new HepJamesRandom(randSeed);
032 }
033
034 ElectronBinData::~ElectronBinData()
035 {
036 for (size_t i = 0; i < m_cores.size(); i++)
037 delete m_cores[i];
038 for (size_t i = 0; i < m_tails.size(); i++)
039 delete m_tails[i];
040 for (size_t i = 0; i < m_fractions.size(); i++)
041 delete m_fractions[i];
042 for (size_t i = 0; i < m_correlations.size(); i++)
043 delete m_correlations[i];
044 delete m_randomEngine;
045 }
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067 HepSymMatrix ElectronBinData::getMatrix( const TrackTrajectory& traj ) const
068 {
069 HepSymMatrix Sigma(5,0);
070
071 double fraction, random[5];
072
073
074 random[0] = m_randomEngine->flat();
075 random[1] = m_randomEngine->flat();
076 random[2] = m_randomEngine->flat();
077 random[3] = m_randomEngine->flat();
078 random[4] = m_randomEngine->flat();
079
080
081 for ( int param = 0; param < 5; param++ )
082 {
083 fraction = m_fractions[param]->resolution(traj);
084 if ( fraction > 1.0 ) fraction = 1.0;
085 Sigma[param][param] = ( random[param] < fraction ) ?
086 std::pow( m_cores[param]->resolution(traj), 2 ) :
087 std::pow( m_tails[param]->resolution(traj), 2 );
088 }
089
090
091
092
093
094
095
096 double rho13 = m_correlations[0]->resolution(traj);
097 double rho15 = m_correlations[1]->resolution(traj);
098 double rho35 = m_correlations[2]->resolution(traj);
099
100
101
102 double det3 = 1 - rho13 * rho13 - rho15 * rho15 - rho35 * rho35 - 2 * rho13 * rho15 * rho35;
103 if ( det3 < 0 ) rho13 = rho15 = rho35 = 0;
104
105
106 if ( std::abs(rho13) > 1 ) rho13 *= 0.99 / std::abs(rho13);
107 if ( std::abs(rho15) > 1 ) rho15 *= 0.99 / std::abs(rho15);
108 if ( std::abs(rho35) > 1 ) rho35 *= 0.99 / std::abs(rho35);
109
110 Sigma(1,3) = Sigma(3,1) = rho13 * std::sqrt( Sigma(1,1) * Sigma(3,3) );
111 Sigma(1,5) = Sigma(5,1) = rho15 * std::sqrt( Sigma(1,1) * Sigma(5,5) );
112 Sigma(3,5) = Sigma(5,3) = rho35 * std::sqrt( Sigma(3,3) * Sigma(5,5) );
113
114
115 double rho24 = m_correlations[3]->resolution(traj);
116
117 if ( std::abs(rho24) > 1 ) rho24 *= 0.99 / std::abs(rho24);
118 Sigma(2,4) = Sigma(4,2) = rho24 * std::sqrt( Sigma(2,2) * Sigma(4,4) );
119
120
121 return Sigma;
122
123 }
124
125 }
126
| Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems |
|
This page was automatically generated by the
LXR engine.
|
|