Changeset 72 in svn
- Timestamp:
- Dec 3, 2008, 12:01:04 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Delphes.cpp
r71 r72 95 95 96 96 //Trigger information 97 //Trigger *TRIG = new Trigger(); 98 //TRIG->TriggerReader("data/trigger.dat"); 97 TriggerTable *TRIGT = new TriggerTable(); 98 TRIGT->TriggerCardReader("data/trigger.dat"); 99 TRIGT->PrintTriggerTable(LogName); 99 100 100 101 //Propagation of tracks in the B field … … 336 337 337 338 //***************************** 338 treeWriter->Fill();339 339 340 340 sorted_jets=JETRUN->RunJets(input_particles); … … 344 344 // Add here the trigger 345 345 // Should test all the trigger table on the event, based on reconstructed objects 346 346 treeWriter->Fill(); 347 347 348 } // Loop over all events 348 349 349 350 treeWriter->Write(); 350 351 delete treeWriter; 352 353 if(DET->DOTRIGGER == 1) 354 { 355 TChain chainT("Analysis"); 356 chainT.Add(outputfilename.c_str()); 357 ExRootTreeReader *treeReaderT = new ExRootTreeReader(&chainT); 358 359 TClonesArray *branchElecTrig = treeReaderT->UseBranch("Electron"); 360 TClonesArray *branchMuonTrig = treeReaderT->UseBranch("Muon"); 361 TClonesArray *branchJetTrig = treeReaderT->UseBranch("Jet"); 362 TClonesArray *branchTauJetTrig = treeReaderT->UseBranch("TauJet"); 363 TClonesArray *branchPhotonTrig = treeReaderT->UseBranch("Photon"); 364 TClonesArray *branchETmisTrig = treeReaderT->UseBranch("ETmis"); 365 366 ExRootTreeWriter *treeWriterT = new ExRootTreeWriter(outputfilename, "Trigger"); 367 ExRootTreeBranch *branchTrigger = treeWriterT->NewBranch("TrigResult", TRootTrigger::Class()); 368 369 Long64_t entryT, allEntriesT = treeReaderT->GetEntries(); 370 cout << "** Chain contains " << allEntriesT << " events" << endl; 371 for(entryT = 0; entryT < allEntriesT; ++entryT) 372 { 373 treeWriterT->Clear(); 374 treeReaderT->ReadEntry(entryT); 375 TRIGT->GetGlobalResult(branchElecTrig, branchMuonTrig,branchJetTrig, branchTauJetTrig,branchPhotonTrig, branchETmisTrig,branchTrigger); 376 treeWriterT->Fill(); 377 } 378 379 treeWriterT->Write(); 380 delete treeWriterT; 381 } 382 351 383 cout << "** Exiting..." << endl; 352 384 353 delete treeWriter;354 385 delete treeReader; 355 386 delete DET; -
trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h
r70 r72 13 13 * present in the data members of the Block TRoot class. 14 14 * 15 * $Date: 2008-12-0 2 19:50:30$16 * $Revision: 1. 5$15 * $Date: 2008-12-03 11:01:04 $ 16 * $Revision: 1.6 $ 17 17 * 18 18 * … … 292 292 TRootTrigger() {}; 293 293 294 bool Accepted; // -1 or 1294 int Accepted; 295 295 296 296 static TCompare *fgCompare; //! -
trunk/data/DataCardDet.dat
r71 r72 62 62 MISTAGGING_L 1 63 63 64 #Trigger flag 65 DOTRIGGER 1 //1 to run the trigger else 0 66 64 67 #DeltaR cone definition 65 68 CONERADIUS 0.7 -
trunk/data/trigger.dat
r52 r72 1 1 # list of trigger algorithms 2 2 # trigger_name algorithm comments 3 SingleElec >> ELEC1_PT: '20' & ELEC2_PT: '10' & ELEC3_PT: '3' & MUON1_PT '10' # requires at least 1 muon with p_t > 3 3 SingleElec >> ELEC1_PT: '10' # requires at least 1 muon with p_t > 3 4 SingleJet >> JET1_PT: '10' # requires at least 1 muon with p_t > 3 5 DoubleElec >> ELEC1_PT: '10' && ELEC2_PT: '10' # requires at least 1 muon with p_t > 3 -
trunk/interface/SmearUtil.h
r71 r72 98 98 int MISTAGGING_L; 99 99 100 //trigger flag 101 int DOTRIGGER; 102 100 103 double CONERADIUS; 101 104 int JETALGO; -
trunk/interface/TriggerUtil.h
r63 r72 14 14 #include <vector> 15 15 #include "TLorentzVector.h" 16 #include "TClonesArray.h" 16 17 17 18 #include "Utilities/ExRootAnalysis/interface/BlockClasses.h" 18 19 #include "Utilities/ExRootAnalysis/interface/TSimpleArray.h" 20 #include "Utilities/ExRootAnalysis/interface/ExRootTreeBranch.h" 19 21 20 22 using namespace std; … … 31 33 void PrintTrigCondition(string LogName,int i); 32 34 33 bool GetResult() { 34 if(!has_been_evaluated) Evaluate(event_i); 35 return Result; 36 }; 35 bool GetResult(TClonesArray *branchElecTrig, TClonesArray *branchMuonTrig, 36 TClonesArray *branchJetTrig, TClonesArray *branchTauJetTrig, 37 TClonesArray *branchPhotonTrig, TClonesArray *branchETmisTrig); 37 38 38 39 private: 39 bool Evaluate(int event_i); // <- à la fin, mettre has_been_evaluated=true; 40 40 41 41 vector<float> GetCuts(const vector<string> &Sequences); 42 42 vector<float> ElecValues; … … 47 47 vector<float> GammaValues; 48 48 bool Result; 49 int event_i;50 bool has_been_evaluated;51 49 }; 52 50 … … 68 66 // appelle la méthode TriggerBit::PriniTrigCondition 69 67 70 71 bool GetGlobalResult() { 72 if (! has_been_evaluated) Evaluate(event_i); 73 return GlobalResult; 74 } 68 bool GetGlobalResult(TClonesArray *branchElecTrig, TClonesArray *branchMuonTrig, 69 TClonesArray *branchJetTrig, TClonesArray *branchTauJetTrig, 70 TClonesArray *branchPhotonTrig, TClonesArray *branchETmisTrig,ExRootTreeBranch *branchTrigger); 75 71 76 72 void WriteResult(); -
trunk/src/SmearUtil.cc
r71 r72 86 86 MISTAGGING_L = 1; 87 87 88 //Trigger flag 89 DOTRIGGER = 1; 88 90 89 91 CONERADIUS = 0.7; // generic jet radius ; not for tau's !!! … … 178 180 else if(strstr(temp_string.c_str(),"TAUJET_pt")){curstring >> varname >> value; TAUJET_pt = value;} 179 181 else if(strstr(temp_string.c_str(),"NTOWERS")){curstring >> varname >> ivalue; NTOWERS = ivalue;} 182 else if(strstr(temp_string.c_str(),"DOTRIGGER")){curstring >> varname >> ivalue; DOTRIGGER = ivalue;} 180 183 else if(strstr(temp_string.c_str(),"TOWER_ETA_EDGES")){ 181 184 curstring >> varname; for(unsigned int i=0; i<NTOWERS+1; i++) {curstring >> value; TOWER_ETA_EDGES[i] = value;} } -
trunk/src/TriggerUtil.cc
r63 r72 65 65 } 66 66 67 bool TriggerTable::GetGlobalResult(TClonesArray *branchElecTrig, TClonesArray *branchMuonTrig, 68 TClonesArray *branchJetTrig, TClonesArray *branchTauJetTrig, 69 TClonesArray *branchPhotonTrig, TClonesArray *branchETmisTrig, ExRootTreeBranch *branchTrigger) { 70 71 TRootTrigger *elementTrigger; 72 GlobalResult=false; 73 for(unsigned int i=0; i < list_of_trigger_bits.size(); i++) { 74 if(list_of_trigger_bits[i].GetResult(branchElecTrig, branchMuonTrig, branchJetTrig, branchTauJetTrig, branchPhotonTrig, branchETmisTrig)) 75 { 76 GlobalResult=true; 77 int flag=i+1; 78 elementTrigger = (TRootTrigger*) branchTrigger->NewEntry(); 79 elementTrigger->Accepted=flag; 80 } 81 } 82 if(GlobalResult) 83 { 84 elementTrigger = (TRootTrigger*) branchTrigger->NewEntry(); 85 elementTrigger->Accepted=0; 86 } 87 return GlobalResult; 88 89 } 90 67 91 //************************************************************************* 68 69 92 TriggerBit::TriggerBit() { 70 has_been_evaluated=false; 93 } 94 95 bool TriggerBit::GetResult(TClonesArray *branchElecTrig, TClonesArray *branchMuonTrig, 96 TClonesArray *branchJetTrig, TClonesArray *branchTauJetTrig, 97 TClonesArray *branchPhotonTrig, TClonesArray *branchETmisTrig) 98 { 99 int elec_size = ElecValues.size(); 100 int muon_size = MuonValues.size(); 101 int jet_size = JetValues.size(); 102 int taujet_size = TauJetValues.size(); 103 int gamma_size = GammaValues.size(); 104 int etmis_size = EtmisValues.size(); 105 106 Result=false; 107 if( 108 (branchElecTrig->GetEntries() >= elec_size ) 109 && (branchMuonTrig->GetEntries() >= muon_size ) 110 && (branchJetTrig->GetEntries() >= jet_size ) 111 && (branchTauJetTrig->GetEntries() >= taujet_size ) 112 && (branchPhotonTrig->GetEntries() >= gamma_size ) 113 ) 114 { 115 Result=true; 116 if(elec_size!=0){ 117 TRootElectron *electron; 118 for(int i=0;i<elec_size;i++){ 119 electron = (TRootElectron*)branchElecTrig->At(i); 120 if(electron->PT < ElecValues[i])Result=false;}} 121 122 if(muon_size!=0){ 123 TRootMuon *muon; 124 for(int i=0;i<muon_size;i++){ 125 muon = (TRootMuon*)branchMuonTrig->At(i); 126 if(muon->PT < MuonValues[i])Result=false;}} 127 128 if(jet_size!=0){ 129 TRootJet *jet; 130 for(int i=0;i<jet_size;i++){ 131 jet = (TRootJet*)branchJetTrig->At(i); 132 if(jet->PT < JetValues[i])Result=false;}} 133 134 if(taujet_size!=0){ 135 TRootTauJet *taujet; 136 for(int i=0;i<taujet_size;i++){ 137 taujet = (TRootTauJet*)branchTauJetTrig->At(i); 138 if(taujet->PT < TauJetValues[i])Result=false;}} 139 140 if(gamma_size!=0){ 141 TRootPhoton *gamma; 142 for(int i=0;i<gamma_size;i++){ 143 gamma = (TRootPhoton*)branchPhotonTrig->At(i); 144 if(gamma->PT < GammaValues[i])Result=false;}} 145 146 147 if(etmis_size!=0){ 148 TRootETmis *etmis = (TRootETmis*)branchETmisTrig->At(0); 149 if(etmis->ET < EtmisValues[0])Result=false;} 150 151 } 152 return Result; 71 153 } 72 154
Note:
See TracChangeset
for help on using the changeset viewer.