Changeset 74 in svn
- Timestamp:
- Dec 3, 2008, 6:55:46 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Delphes.cpp
r73 r74 179 179 vector<ParticleUtil> electron; 180 180 vector<ParticleUtil> muon; 181 vector<ParticleUtil> gamma; 182 181 183 TSimpleArray<TRootGenParticle> NFCentralQ; 182 184 … … 195 197 electron.clear(); 196 198 muon.clear(); 199 gamma.clear(); 197 200 NFCentralQ.Clear(); 198 201 199 itGen.Reset();200 202 TrackCentral.clear(); 201 203 towers.clear(); … … 203 205 204 206 // Loop over all particles in event 207 itGen.Reset(); 205 208 while( (particle = (TRootGenParticle*) itGen.Next()) ) 206 209 { … … 232 235 case pE: // all electrons with eta < DET->MAX_CALO_FWD 233 236 DET->SmearElectron(genMomentum); 237 if(genMomentum.E()!=0 && eta < DET->MAX_TRACKER && genMomentum.Pt() > DET->ELEC_pt){ 238 electron.push_back(ParticleUtil(genMomentum,particle->PID)); 239 } 234 240 electron.push_back(ParticleUtil(genMomentum,particle->PID)); 235 241 break; // case pE 236 242 case pGAMMA: // all photons with eta < DET->MAX_CALO_FWD 237 243 DET->SmearElectron(genMomentum); 238 if(genMomentum.E()!=0 && eta < DET->MAX_TRACKER) { 239 elementPhoton = (TRootPhoton*) branchPhoton->NewEntry(); 240 elementPhoton->Set(genMomentum); 244 if(genMomentum.E()!=0 && eta < DET->MAX_TRACKER && genMomentum.Pt() > DET->GAMMA_pt) { 245 gamma.push_back(ParticleUtil(genMomentum,particle->PID)); 241 246 } 242 247 break; // case pGAMMA 243 248 case pMU: // all muons with eta < DET->MAX_MU 244 249 DET->SmearMu(genMomentum); 250 if(genMomentum.E()!=0 && eta < DET->MAX_MU && genMomentum.Pt() > DET->MUON_pt){ 251 muon.push_back(ParticleUtil(genMomentum,particle->PID)); 252 } 245 253 muon.push_back(ParticleUtil(genMomentum,particle->PID)); 246 254 break; // case pMU … … 253 261 break; 254 262 } // switch (pid) 255 263 256 264 // all final particles but muons and neutrinos 257 265 // for calorimetric towers and mission PT 258 259 if(genMomentum.E() !=0 ) {260 if( pid !=pMU){266 int charge=Charge(pid); 267 if(genMomentum.E() !=0 && pid != pMU) { 268 if(charge == 0 || (charge !=0 && genMomentum.Pt() >= DET->PT_TRACKS_MIN)){ 261 269 PhysicsTower CaloTower = PhysicsTower(LorentzVector(genMomentum.Px(),genMomentum.Py(),genMomentum.Pz(), genMomentum.E())); 262 270 towers.push_back(CaloTower); … … 266 274 267 275 genMomentumCalo.SetPxPyPzE(CaloTower.fourVector.px,CaloTower.fourVector.py,CaloTower.fourVector.pz,CaloTower.fourVector.E); 276 268 277 elementCalo = (TRootCalo*) branchCalo->NewEntry(); 269 278 elementCalo->Set(genMomentumCalo); … … 274 283 // all final charged particles 275 284 if( 276 ((rand()%100) < DET->TRACKING_EFF) &&277 285 (genMomentum.E()!=0) && 278 286 (fabs(genMomentum.Eta()) < DET->MAX_TRACKER) && 279 (genMomentum.Pt() > DET->PT_TRACKS_MIN ) && // pt too small to be taken into account 280 (pid != pGAMMA) && 281 (pid != pPI0) && 282 (pid != pK0L) && 283 (pid != pN) && 284 (pid != pSIGMA0) && 285 (pid != pDELTA0) && 286 (pid != pK0S) // not charged particles : invisible by tracker 287 (genMomentum.Pt() > DET->PT_TRACKS_MIN ) && // pt too small to be taken into account 288 ((rand()%100) < DET->TRACKING_EFF) && 289 (charge!=0) 287 290 ) 288 291 { … … 291 294 TrackCentral.push_back(genMomentum); 292 295 } 293 294 } // switch296 297 } // switch 295 298 296 299 VFD->ZDC(treeWriter,branchZDC,particle); … … 299 302 } // while 300 303 301 for(unsigned int i=0; i < electron.size(); i++) { 302 if(electron[i].E()!=0 && fabs(electron[i].Eta()) < DET->MAX_TRACKER && electron[i].Pt() > DET->ELEC_pt) 303 { 304 elementElec = (TRootElectron*) branchElectron->NewEntry(); 305 elementElec->Set(electron[i].Px(),electron[i].Py(),electron[i].Pz(),electron[i].E()); 306 elementElec->Charge = sign(electron[i].PID()); 307 elementElec->IsolFlag = DET->Isolation(electron[i].Phi(),electron[i].Eta(),TrackCentral,2.0); 308 } 304 DET->SortedVector(electron); 305 for(unsigned int i=0; i < electron.size(); i++) { 306 elementElec = (TRootElectron*) branchElectron->NewEntry(); 307 elementElec->Set(electron[i].Px(),electron[i].Py(),electron[i].Pz(),electron[i].E()); 308 elementElec->Charge = sign(electron[i].PID()); 309 elementElec->IsolFlag = DET->Isolation(electron[i].Phi(),electron[i].Eta(),TrackCentral,2.0); 309 310 } 311 DET->SortedVector(muon); 310 312 for(unsigned int i=0; i < muon.size(); i++) { 311 if(muon[i].E()!=0 && fabs(muon[i].Eta()) < DET->MAX_MU && muon[i].Pt() > DET->MUON_pt) 312 { 313 elementMu = (TRootMuon*) branchMuon->NewEntry(); 314 elementMu->Charge = sign(muon[i].PID()); 315 elementMu->Set(muon[i].Px(),muon[i].Py(),muon[i].Pz(),muon[i].E()); 316 elementMu->IsolFlag = DET->Isolation(muon[i].Phi(),muon[i].Eta(),TrackCentral,2.0); 317 } 313 elementMu = (TRootMuon*) branchMuon->NewEntry(); 314 elementMu->Charge = sign(muon[i].PID()); 315 elementMu->Set(muon[i].Px(),muon[i].Py(),muon[i].Pz(),muon[i].E()); 316 elementMu->IsolFlag = DET->Isolation(muon[i].Phi(),muon[i].Eta(),TrackCentral,2.0); 317 } 318 DET->SortedVector(gamma); 319 for(unsigned int i=0; i < gamma.size(); i++) { 320 elementPhoton = (TRootPhoton*) branchPhoton->NewEntry(); 321 elementPhoton->Set(gamma[i].Px(),gamma[i].Py(),gamma[i].Pz(),gamma[i].E()); 318 322 } 319 323 … … 330 334 elementEtmis->Px = (-PTmis).Px(); 331 335 elementEtmis->Py = (-PTmis).Py(); 332 336 333 337 //***************************** 334 338 … … 336 340 JETRUN->RunJetBtagging(treeWriter, branchJet,sorted_jets,NFCentralQ); 337 341 JETRUN->RunTauJets(treeWriter,branchTauJet,sorted_jets,towers, TrackCentral); 338 342 339 343 // Add here the trigger 340 344 // Should test all the trigger table on the event, based on reconstructed objects 341 345 treeWriter->Fill(); 342 346 343 347 } // Loop over all events 344 348 345 349 treeWriter->Write(); 346 delete treeWriter; 347 350 351 //running the trigger in case the FLAG trigger is put to 1 in the datacard 352 348 353 if(DET->DOTRIGGER == 1) 349 354 { … … 351 356 chainT.Add(outputfilename.c_str()); 352 357 ExRootTreeReader *treeReaderT = new ExRootTreeReader(&chainT); 353 358 354 359 TClonesArray *branchElecTrig = treeReaderT->UseBranch("Electron"); 355 360 TClonesArray *branchMuonTrig = treeReaderT->UseBranch("Muon"); … … 358 363 TClonesArray *branchPhotonTrig = treeReaderT->UseBranch("Photon"); 359 364 TClonesArray *branchETmisTrig = treeReaderT->UseBranch("ETmis"); 360 365 361 366 ExRootTreeWriter *treeWriterT = new ExRootTreeWriter(outputfilename, "Trigger"); 362 367 ExRootTreeBranch *branchTrigger = treeWriterT->NewBranch("TrigResult", TRootTrigger::Class()); 363 368 364 369 Long64_t entryT, allEntriesT = treeReaderT->GetEntries(); 365 370 cout << "** Chain contains " << allEntriesT << " events" << endl; … … 379 384 380 385 delete treeReader; 386 delete treeWriter; 381 387 delete DET; 388 delete TRIGT; 389 delete TRACP; 390 delete JETRUN; 391 delete VFD; 392 382 393 if(converter) delete converter; 383 394 -
trunk/interface/SmearUtil.h
r73 r74 108 108 float MUON_pt; 109 109 float JET_pt; 110 float GAMMA_pt; 110 111 float TAUJET_pt; 111 112 … … 156 157 float * TOWER_DPHI; 157 158 159 // to sort a vector 160 void SortedVector(vector<ParticleUtil> &vect); 158 161 159 162 /// Reads the data card for the initialisation of the parameters -
trunk/src/SmearUtil.cc
r73 r74 68 68 MUON_pt = 10.0; 69 69 JET_pt = 20.0; 70 GAMMA_pt = 10.0; 70 71 TAUJET_pt = 10.0; 71 72 … … 178 179 else if(strstr(temp_string.c_str(),"MUON_pt")){curstring >> varname >> value; MUON_pt = value;} 179 180 else if(strstr(temp_string.c_str(),"JET_pt")){curstring >> varname >> value; JET_pt = value;} 181 else if(strstr(temp_string.c_str(),"GAMMA_pt")){curstring >> varname >> value; GAMMA_pt = value;} 180 182 else if(strstr(temp_string.c_str(),"TAUJET_pt")){curstring >> varname >> value; TAUJET_pt = value;} 181 183 else if(strstr(temp_string.c_str(),"NTOWERS")){curstring >> varname >> ivalue; NTOWERS = ivalue;} … … 392 394 f_out << left << setw(40) <<"* Minimum pT for Tau-jets: "<<"" 393 395 << left << setw(20) <<TAUJET_pt <<""<< right << setw(10)<<"*"<<"\n"; 396 f_out << left << setw(40) <<"* Minimum pT for photons: "<<"" 397 << left << setw(20) <<GAMMA_pt <<""<< right << setw(10)<<"*"<<"\n"; 394 398 f_out<<"* *"<<"\n"; 395 399 f_out<<"#*************************** *"<<"\n"; … … 595 599 596 600 }*/ 601 602 //****************************************************************************************** 603 604 void RESOLution::SortedVector(vector<ParticleUtil> &vect) 605 { 606 int i,j = 0; 607 TLorentzVector tmp; 608 bool en_desordre = true; 609 int entries=vect.size(); 610 for(i = 0 ; (i < entries) && en_desordre; i++) 611 { 612 en_desordre = false; 613 for(j = 1 ; j < entries - i ; j++) 614 { 615 if ( vect[j].Pt() > vect[j-1].Pt() ) 616 { 617 ParticleUtil tmp = vect[j-1]; 618 vect[j-1] = vect[j]; 619 vect[j] = tmp; 620 en_desordre = true; 621 } 622 } 623 } 624 } 597 625 598 626 // **********Provides the energy in the cone of radius TAU_CONE_ENERGY for the tau identification******** … … 706 734 if (phi > PI-dphi) iPhi = PI-dphi; 707 735 } 708 /*709 ParticleUtil::ParticleUtil(const TLorentzVector genMomentum,int pid){710 E=genMomentum.E();711 Px=genMomentum.Px();712 Py=genMomentum.Py();713 Pz=genMomentum.Pz();714 PT=genMomentum.Pt();715 Phi=genMomentum.Phi();716 Eta=genMomentum.Eta();717 PID=pid;718 719 }720 */721 /*722 void ParticleUtil::GetInfo()723 {724 725 }726 */727 736 728 737 //**************************** Returns the delta Phi **************************** -
trunk/src/TriggerUtil.cc
r72 r74 63 63 list_of_trigger_bits[i].PrintTrigCondition(LogName,i+1); 64 64 } 65 f_out<<"* *"<<"\n"; 66 f_out<<"#*********************************************************************"<<"\n"; 67 65 68 } 66 69
Note:
See TracChangeset
for help on using the changeset viewer.