Changeset 270 in svn
- Timestamp:
- Feb 14, 2009, 2:06:20 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Delphes.cpp
r268 r270 385 385 // 2.1a Loop over all particles in event, to fill the towers 386 386 itGen.Reset(); 387 TRootGenParticle *particle; 388 while( (particle = (TRootGenParticle*) itGen.Next()) ) { 389 int pid = abs(particle->PID); 390 particle->Charge=Charge(pid); 391 particle->setFractions(); // init 387 GenParticle *particleG; 388 while( (particleG = (GenParticle*) itGen.Next()) ) { 389 390 TRootGenParticle *particle = new TRootGenParticle(particleG); 391 int pid = abs(particle->PID); 392 particle->Charge=ChargeVal(particle->PID); 393 particle->setFractions(); // init 392 394 393 395 … … 407 409 // 2.1a.2.1 Central solenoidal magnetic field 408 410 TRACP->bfield(particle); // fills in particle->EtaCalo et particle->PhiCalo 409 410 411 // 2.1a.2.2 Filling the calorimetric towers -- includes also forward detectors ? 411 412 // first checks if the charged particles reach the calo! 412 413 if( DET->FLAG_bfield || 413 particle-> getCharge()==0 ||414 (!DET->FLAG_bfield && particle-> getCharge()!=0 && particle->PT > DET->TRACK_ptmin))414 particle->Charge==0 || 415 (!DET->FLAG_bfield && particle->Charge!=0 && particle->PT > DET->TRACK_ptmin)) 415 416 if( 416 417 (particle->EtaCalo > list_of_calorimeters.getEtamin() ) && … … 434 435 // if bfield not simulated, pt should be high enough to be taken into account 435 436 // it is supposed here that DET->MAX_calo > DET->CEN_max_tracker > DET->CEN_max_mu > 0 436 if( particle-> getCharge()!=0 &&437 if( particle->Charge !=0 && 437 438 fabs(particle->EtaCalo)< DET->CEN_max_tracker && // stays in the tracker -> track available 438 439 ( DET->FLAG_bfield || … … 447 448 448 449 // 2.1a.2.3.2 Muons 449 if (pid == pMU && fabs(particle->EtaCalo)< DET->CEN_max_mu && particle->PT > DET->PTCUT_muon) {450 if (pid == pMU && fabs(particle->EtaCalo)< DET->CEN_max_mu) { 450 451 TLorentzVector p; 451 452 float sPT = gRandom->Gaus(particle->PT, DET->MU_SmearPt*particle->PT ); … … 518 519 519 520 } // 2.1a.2 : if visible particle 521 delete particle; 520 522 } // loop on all particles 2.1a 521 523 … … 589 591 elementPhoton = (TRootPhoton*) branchPhoton->NewEntry(); 590 592 elementPhoton->Set(gamma[i].Px(),gamma[i].Py(),gamma[i].Pz(),gamma[i].E()); 591 elementPhoton->EtaCalo = gamma[i].EtaCalo();592 elementPhoton->PhiCalo = gamma[i].PhiCalo();593 593 } 594 594 -
trunk/Examples/src/Analysis_Ex.cc
r264 r270 145 145 //***************************************************** 146 146 TIter itGen((TCollection*)GEN); 147 TRootGenParticle *gen;147 GenParticle *gen; 148 148 itGen.Reset(); 149 while( (gen = ( TRootGenParticle*) itGen.Next()) )149 while( (gen = (GenParticle*) itGen.Next()) ) 150 150 { 151 151 PID = gen->PID; // particle HEP ID number … … 155 155 D1 = gen->D1; // particle 1st daughter 156 156 D2 = gen->D2; // particle 2nd daughter 157 Charge = gen-> getCharge(); // electrical charge157 Charge = gen->Charge; // electrical charge 158 158 159 159 T = gen->T; // particle vertex position (t component) -
trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h
r268 r270 164 164 float Phi; // particle azimuthal angle in rad 165 165 166 float EtaCalo; // particle pseudorapidity when entering the calo,167 float PhiCalo; // particle azimuthal angle in rad when entering the calo168 169 166 void Set(const TLorentzVector& momentum); 170 167 void Set(const float px, const float py, const float pz, const float e); 171 168 void SetEtaPhi(const float eta, const float phi) {Eta=eta; Phi=phi;}; 172 void SetEtaPhiCalo(const float eta, const float phi) {EtaCalo=eta; PhiCalo=phi;};173 169 void SetEtaPhiEET(const float eta, const float phi, const float e, const float et); 174 170 static TCompare *fgCompare; //! … … 179 175 }; 180 176 181 182 //--------------------------------------------------------------------------- 183 184 class TRootGenParticle: public TRootParticle { 185 186 public: 187 TRootGenParticle() {_initialised=false;} 177 //-------------------------------------------------------------------------- 178 179 class GenParticle: public TRootParticle { 180 181 public: 182 GenParticle() {}; 188 183 int PID; // particle HEP ID number [RawHepEventParticle::pid()] 189 184 int Status; // particle status [RawHepEventParticle::status()] … … 193 188 int D2; // particle 2nd daughter [RawHepEventParticle::daughter2() - 1] 194 189 190 float Charge; 191 192 float T; // particle vertex position (t component) [RawHepEventParticle::t()] 193 float X; // particle vertex position (x component) [RawHepEventParticle::x()] 194 float Y; // particle vertex position (y component) [RawHepEventParticle::y()] 195 float Z; // particle vertex position (z component) [RawHepEventParticle::z()] 196 float M; 197 198 199 static TCompare *fgCompare; //! 200 201 ClassDef(GenParticle, 1) 202 }; 203 204 //--------------------------------------------------------------------------- 205 206 class TRootGenParticle: public TRootParticle { 207 208 public: 209 TRootGenParticle() {_initialised=false;} 210 TRootGenParticle(GenParticle* part); 211 212 int PID; // particle HEP ID number [RawHepEventParticle::pid()] 213 int Status; // particle status [RawHepEventParticle::status()] 214 int M1; // particle 1st mother [RawHepEventParticle::mother1() - 1] 215 int M2; // particle 2nd mother [RawHepEventParticle::mother2() - 1] 216 int D1; // particle 1st daughter [RawHepEventParticle::daughter1() - 1] 217 int D2; // particle 2nd daughter [RawHepEventParticle::daughter2() - 1] 218 195 219 float T; // particle vertex position (t component) [RawHepEventParticle::t()] 196 220 float X; // particle vertex position (x component) [RawHepEventParticle::x()] … … 199 223 float M; 200 224 void setFractions(); 201 const float getCharge() const {return Charge;};202 225 const float getFem() {if(!_initialised) setFractions(); return _Fem;} 203 226 const float getFhad() {if(!_initialised) setFractions(); return _Fhad;} 204 227 228 float EtaCalo; // particle pseudorapidity when entering the calo, 229 float PhiCalo; // particle azimuthal angle in rad when entering the calo 230 void SetEtaPhiCalo(const float eta, const float phi) {EtaCalo=eta; PhiCalo=phi;}; 231 232 static TCompare *fgCompare; //! 233 205 234 float Charge; // electrical charge 206 207 static TCompare *fgCompare; //!208 235 protected: 209 236 float _Fem, _Fhad; // fractions of energy deposit … … 222 249 static TCompare *fgCompare; //! 223 250 251 float EtaCalo; // particle pseudorapidity when entering the calo, 252 float PhiCalo; // particle azimuthal angle in rad when entering the calo 253 void SetEtaPhiCalo(const float eta, const float phi) {EtaCalo=eta; PhiCalo=phi;}; 254 224 255 bool IsolFlag; 225 256 … … 247 278 int Charge; // particle Charge [RawHepEventParticle::pid()] 248 279 bool IsolFlag; 280 float EtaCalo; // particle pseudorapidity when entering the calo, 281 float PhiCalo; // particle azimuthal angle in rad when entering the calo 282 void SetEtaPhiCalo(const float eta, const float phi) {EtaCalo=eta; PhiCalo=phi;}; 283 249 284 static TCompare *fgCompare; //! 250 285 -
trunk/Utilities/ExRootAnalysis/src/BlockClasses.cc
r268 r270 36 36 37 37 TCompare *TRootGenParticle::fgCompare = 0; 38 TCompare *GenParticle::fgCompare = 0; 38 39 TCompare *TRootElectron::fgCompare = TComparePT<TRootElectron>::Instance(); 39 40 TCompare *TRootMuon::fgCompare = TComparePT<TRootMuon>::Instance(); … … 90 91 Px = PT*cos(Phi); 91 92 Py = PT*sin(Phi); 93 } 94 95 TRootGenParticle::TRootGenParticle(GenParticle* part) : 96 PID(part->PID),Status(part->Status),M1(part->M1),M2(part->M2),D1(part->D1),D2(part->D2), 97 T(part->T),X(part->X),Y(part->Y),Z(part->Z),M(part->M){ 98 E=part->E; 99 Px=part->Px; 100 Py=part->Py; 101 Pz=part->Pz; 102 Eta=part->Eta; 103 Phi=part->Phi; 104 PT=part->PT; 105 _initialised=false; 92 106 } 93 107 -
trunk/Utilities/ExRootAnalysis/src/BlockClassesLinkDef.h
r268 r270 42 42 #pragma link C++ class TRootSelectorInfo; 43 43 #pragma link C++ class TRootGenParticle; 44 #pragma link C++ class GenParticle; 44 45 #pragma link C++ class TRootElectron; 45 46 #pragma link C++ class TRootMuon; -
trunk/interface/SmearUtil.h
r264 r270 244 244 245 245 //************* Returns an array of the quarks sitting within the tracker acceptance *************** 246 int Charge (const int pid);246 int ChargeVal(const int pid); 247 247 248 248 #endif -
trunk/src/BFieldProp.cc
r264 r270 118 118 void TrackPropagation::Propagation(const TRootGenParticle *Part,TLorentzVector &momentum) { 119 119 120 q = Charge (Part->PID);120 q = ChargeVal(Part->PID); 121 121 if(q==0) return; 122 122 … … 324 324 if (!DET->FLAG_bfield ) return; 325 325 326 q = Charge (Part->PID);326 q = ChargeVal(Part->PID); 327 327 if(q==0) return; 328 328 if(R_max ==0) { cout << "ERROR: magnetic field has no lateral extention\n"; return;} -
trunk/src/HEPEVTConverter.cc
r264 r270 176 176 177 177 ExRootTreeWriter *treeWriter = new ExRootTreeWriter(outputFileName, "GEN"); 178 ExRootTreeBranch *branchGen = treeWriter->NewBranch("Particle", TRootGenParticle::Class());178 ExRootTreeBranch *branchGen = treeWriter->NewBranch("Particle", GenParticle::Class()); 179 179 180 180 ifstream infile(inputFileList.c_str()); … … 211 211 Float_t signEta; 212 212 213 TRootGenParticle *element;213 GenParticle *element; 214 214 215 215 // Loop over all events … … 222 222 for(particle = 0; particle < event.Nhep; ++particle) 223 223 { 224 element = ( TRootGenParticle*) branchGen->NewEntry();224 element = (GenParticle*) branchGen->NewEntry(); 225 225 226 226 element->PID = event.Idhep[particle]; -
trunk/src/STDHEPConverter.cc
r264 r270 58 58 void STDHEPConverter::AnalyseParticles(ExRootTreeBranch *branch) 59 59 { 60 TRootGenParticle *element;60 GenParticle *element; 61 61 62 62 Double_t signPz; … … 66 66 for(number = 0; number < myhepevt.nhep; ++number) 67 67 { 68 element = static_cast< TRootGenParticle*>(branch->NewEntry());68 element = static_cast<GenParticle*>(branch->NewEntry()); 69 69 70 70 element->PID = myhepevt.idhep[number]; … … 116 116 ExRootTreeBranch *branchGenEvent = treeWriter->NewBranch("Event", TRootGenEvent::Class()); 117 117 // generated particles from HEPEVT 118 ExRootTreeBranch *branchGenParticle = treeWriter->NewBranch("Particle", TRootGenParticle::Class());118 ExRootTreeBranch *branchGenParticle = treeWriter->NewBranch("Particle", GenParticle::Class()); 119 119 120 120 // Open a stream connected to an event file: -
trunk/src/SmearUtil.cc
r264 r270 1105 1105 } 1106 1106 1107 int Charge (const int pid)1107 int ChargeVal(const int pid) 1108 1108 { 1109 1109 int charge;
Note:
See TracChangeset
for help on using the changeset viewer.