Report problems to ATLAS LXR Team (with time and IP address indicated)

The LXR Cross Referencer

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Architecture: linux ]
Version: head ] [ nightly ] [ GaudiDev ]
  Links to LXR source navigation pages for stable releases [ 12.*.* ]   [ 13.*.* ]   [ 14.*.* ]   [ 15.*.* ] 

001 // ElectronReconstructor.cxx
002 //
003 // Implementation of the Electron Reconstructor class
004 //
005 // Only the reconstruct() method is overridden
006 //
007 //
008 // Authors: H.T. Phillips, P.Clarke, E.Richter-Was, P.Sherwood, R.Steward
009 // Update:  Sabine Elles, Simon Dean
010 //
011 // Smearer - Reconstructor Conversion: Alexander Richards (UCL)
012 //
013 #include "AtlfastAlgs/ElectronReconstructor.h"
014 #include "AtlfastAlgs/CorrectionFactorElectron.h"
015 
016 #include <cmath>
017 
018 #include "CLHEP/Vector/LorentzVector.h"
019 
020 
021 #include "CLHEP/Random/JamesRandom.h"
022 #include "CLHEP/Random/RandGauss.h"
023 #include "CLHEP/Units/SystemOfUnits.h"
024 
025 /** @brief Electron implementation of the IDefaultReconstructor interface.
026 *
027 * Privately inherits from the DefaultReconstructor class to use its implementation of
028 * random number services etc.
029 * ElectronReconstructor can run with TDR parameterisation (m_smearParamSchema==1)
030 * or with CSC parameterisation (m_smearParamSchema==2)
031 */
032 
033 namespace Atlfast {
034 
035   ReconstructedParticle ElectronReconstructor::reconstruct( const ReconstructedParticle &particle )const{
036     double rpilup = 0.0;
037     double aa, bb, sigph1, sigph, sigpu;
038     //Make sure momentum, aenergy units are Gev
039     double ene     = particle.e()/GeV ;
040     double sqrtene = sqrt(ene);
041     double pt      = particle.pt()/GeV ;
042     double vEta    = fabs(particle.eta());
043     HepLorentzVector bvec(0,0,0,0);
044     
045     if(m_smearParamSchema==1){ // TDR-style smearing
046       
047       // do the smearing, copied verbatim (except for ROOT dependencies)
048       // from electronmaker codein Atlfast++
049       //
050       // This code has not otherwise been altered which is why it is all very
051       // procedural
052       //
053       // Parametrisation was by L.Poggioli
054       
055       while (1) {
056         aa=m_randGauss->fire();
057         //bb=m_randGauss-->fire();
058         sigph1 = aa*m_smearParams[0]/sqrtene;
059         if (1.0 + sigph1 <= 0.0) continue;
060         sigph = sigph1;
061         if (vEta < 1.4) {
062           while (1) {
063             aa=m_randGauss->fire();
064             bb=m_randGauss->fire();
065             sigph1 = aa*m_smearParams[1]/pt + bb*m_smearParams[2];
066             if (1.0+sigph1 > 0) break;
067           }
068         } else {
069           while (1) {
070             aa=m_randGauss->fire();
071             bb=m_randGauss->fire();
072             sigph1 = aa*m_smearParams[3]*((m_smearParams[4]-vEta)+m_smearParams[5])/ene + bb*m_smearParams[6];
073             //    sigph1 = aa*0.306*((2.4-vEta)+0.228)/ene + bb*0.007;
074             if (1.0+sigph1 > 0) break;
075           }
076         }
077         sigph += sigph1;
078         if (m_lumi == 2) {
079           if (vEta < 0.6) rpilup = 0.32;
080           if (vEta > 0.6 && vEta < 1.4) rpilup = 0.295;
081           if (vEta > 1.4) rpilup = 0.27;
082           while (1) {
083             aa=m_randGauss->fire();
084             //bb=m_randGauss-->fire();
085             sigpu = aa*rpilup/pt;
086             if (1.0+sigpu > 0) break;
087           }
088           sigph += sigpu;
089         }
090         if (1.0 + sigph > 0) break;
091       }
092       
093       //now sigph is the electron "sigma" and we do the following a la Atlfast++ electron maker:
094       bvec.set(particle.px()*(1.0+sigph), particle.py()*(1.0+sigph), particle.pz()*(1.0+sigph), particle.e() *(1.0+sigph));
095       
096     } else if (m_smearParamSchema==2){ // Smearing based on CSC sample tuning - data in CorrectionFactorElectron.h
097 
098         
099     
100       double vE = particle.e();
101 
102       double vLimEta=EtaElectron[NbEtaElectron-1]+(EtaElectron[NbEtaElectron-1]-EtaElectron[NbEtaElectron-2])*0.5;
103     
104       if( vEta>vLimEta )
105         {
106           m_log<<MSG::DEBUG<<"No calibration : "<<vEta<<endreq;
107           return particle;
108         }
109     
110       int iEnergy=0;
111       m_log<<MSG::DEBUG<<vE<<" > "<<vEnergiesElectron[iEnergy]<<" ";
112       while(iEnergy<NbEnergiesElectron&&vE>vEnergiesElectron[iEnergy]*1000)
113         {
114           m_log<<MSG::DEBUG<<vEnergiesElectron[iEnergy]<<" ";
115           iEnergy++;
116         }
117       m_log<<MSG::DEBUG<<endreq;
118       if(iEnergy==0)iEnergy++;
119       double ratioEnergy=(vE*0.001-vEnergiesElectron[iEnergy-1])/
120              (vEnergiesElectron[iEnergy]-vEnergiesElectron[iEnergy-1]);
121 
122       int iEta=0;
123       m_log<<MSG::DEBUG<<vEta<<" > "<<EtaElectron[iEta]<<" ";
124       while(iEta<NbEtaElectron&&vEta>EtaElectron[iEta])
125         {
126           m_log<<MSG::DEBUG<<EtaElectron[iEta]<<" ";
127           iEta++;
128         }
129       m_log<<MSG::DEBUG<<endreq;
130 
131       if(iEta==0)iEta++;
132       double ratioEta=(vEta-EtaElectron[iEta-1])/(EtaElectron[iEta]-EtaElectron[iEta-1]);
133 
134       int iPos;
135       double sigma,sigma1,sigma2;
136 
137       iPos=iEnergy-1;
138       sigma1=CorrFactorElectronSigma[iPos][iEta-1]+ratioEta*
139   (CorrFactorElectronSigma[iPos][iEta]-CorrFactorElectronSigma[iPos][iEta-1]);
140       iPos=iEnergy;
141       sigma2=CorrFactorElectronSigma[iPos][iEta-1]+ratioEta*
142   (CorrFactorElectronSigma[iPos][iEta]-CorrFactorElectronSigma[iPos][iEta-1]);
143 
144       sigma=sigma1+ratioEnergy*(sigma2-sigma1);
145 
146       m_log<<MSG::DEBUG<<" -> interpolation sigma "<<sigma1<<" "<<sigma2<<" "<<sigma<<endreq;
147 
148       double alpha=1.0;
149       double vrandom=alpha;
150 
151       int iCmpt=int(m_randFlat->fire()*20);
152       for(int i=0; i<iCmpt; i++)
153         vrandom=m_randGauss->fire(1.0,sigma);
154     
155       m_log<<MSG::DEBUG<<" -> Energie : "<<vEnergiesElectron[iEnergy]<<
156         "   Eta : "<<vEnergiesElectron[iEnergy-1]<<" < "<<vE<<" < "<<
157          vEnergiesElectron[iEnergy]<<endreq;
158       m_log<<MSG::DEBUG<<" -> Energie : "<<vEnergiesElectron[iEnergy]<<
159         "   Eta : "<<EtaElectron[iEta-1]<<" < "<<vEta<<" < "<< 
160          EtaElectron[iEta]<<endreq;
161       m_log<<MSG::DEBUG<<"       calib mean-sigma  "<<alpha<<" "<<sigma<<" -> "<<vrandom<<endreq;
162 
163       bvec.set(particle.px()*vrandom, particle.py()*vrandom, particle.pz()*vrandom, vE*vrandom);
164     
165       m_log<<MSG::DEBUG<<"-> HepLorentzVector calibration "<<vEta<<" "<<particle<<"  ->  "<<bvec<<endreq;
166 
167     }
168 
169     ReconstructedParticle return_particle(particle);
170     return_particle.set_momentum(bvec);
171     return return_particle;
172   } //end of smear method
173   
174   //cct: implement the setSmearParameters method
175   int ElectronReconstructor::setSmearParameters (const std::vector<double>& smearValues){
176     m_smearParams=smearValues;
177     return 0;
178   }
179   
180   //cct: implement the setSmearParamSchema method
181   int ElectronReconstructor::setSmearParamSchema ( const int smearSchema){
182     m_smearParamSchema=smearSchema;
183     return 0;
184   }
185   
186 } // end of namespace bracket
187 

source navigation ] diff markup ] identifier search ] general search ]

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. Valid HTML 4.01!