Changeset 71 in svn for trunk/Delphes.cpp
- Timestamp:
- Dec 3, 2008, 2:47:52 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Delphes.cpp
r70 r71 55 55 char *appargv[] = {appName, "-b"}; 56 56 TApplication app(appName, &appargc, appargv); 57 58 if(argc != 4 && argc != 3 ) {59 cout << " Usage: " << argv[0] << " input_file " << " output_file" << " data_card" << endl;57 58 if(argc != 4 && argc != 3 && argc != 5) { 59 cout << " Usage: " << argv[0] << " input_file output_file [detector_card] [trigger_card] " << endl; 60 60 cout << " input_list - list of files in Ntpl, StdHep of LHEF format," << endl; 61 61 cout << " output_file - output file." << endl; 62 cout << " data_card - Datacard containing resolution variables for the detector simulation (optional) "<<endl; 62 cout << " detector_card - Datacard containing resolution variables for the detector simulation (optional) "<<endl; 63 cout << " trigger_card - Datacard containing the trigger algorithms (optional) "<<endl; 63 64 exit(1); 64 65 } … … 93 94 DET->Logfile(LogName); 94 95 95 96 96 //Trigger information 97 TriggerTable *TRIGT = new TriggerTable(); 98 TRIGT->TriggerCardReader("data/trigger.dat"); 99 TRIGT->PrintTriggerTable(LogName); 100 //outputFile->Close(); 101 97 //Trigger *TRIG = new Trigger(); 98 //TRIG->TriggerReader("data/trigger.dat"); 102 99 103 100 //Propagation of tracks in the B field … … 231 228 { 232 229 genMomentum.SetPxPyPzE(particle->Px, particle->Py, particle->Pz, particle->E); 233 //TRACP->Propagation(particle,genMomentum);230 TRACP->Propagation(particle,genMomentum); 234 231 float eta=fabs(genMomentum.Eta()); 235 232 switch(pid) { … … 271 268 // back of the input_particles vector 272 269 input_particles.push_back(fastjet::PseudoJet(genMomentum.Px(),genMomentum.Py(),genMomentum.Pz(), genMomentum.E())); 273 270 274 271 genMomentumCalo.SetPxPyPzE(CaloTower.fourVector.px,CaloTower.fourVector.py,CaloTower.fourVector.pz,CaloTower.fourVector.E); 275 272 elementCalo = (TRootCalo*) branchCalo->NewEntry(); 276 273 elementCalo->Set(genMomentumCalo); 274 DET->BinEtaPhi(genMomentumCalo.Phi(), genMomentumCalo.Eta(), elementCalo->Phi, elementCalo->Eta); 277 275 } 278 276 } … … 304 302 305 303 } // while 306 307 // computes the Missing Transverse Momentum 308 TLorentzVector Att(0.,0.,0.,0.); 309 for(unsigned int i=0; i < towers.size(); i++) 310 { 311 Att.SetPxPyPzE(towers[i].fourVector.px,towers[i].fourVector.py,towers[i].fourVector.pz,towers[i].fourVector.E); 312 PTmis = PTmis + Att; 313 } 314 elementEtmis = (TRootETmis*) branchETmis->NewEntry(); 315 elementEtmis->ET = (PTmis).Pt(); 316 elementEtmis->Phi = (-PTmis).Phi(); 317 elementEtmis->Px = (-PTmis).Px(); 318 elementEtmis->Py = (-PTmis).Py(); 319 //***************************** 320 304 321 305 for(unsigned int i=0; i < electron.size(); i++) { 322 306 if(electron[i].E()!=0 && fabs(electron[i].Eta()) < DET->MAX_TRACKER && electron[i].Pt() > DET->ELEC_pt) … … 338 322 } 339 323 324 // computes the Missing Transverse Momentum 325 TLorentzVector Att(0.,0.,0.,0.); 326 for(unsigned int i=0; i < towers.size(); i++) 327 { 328 Att.SetPxPyPzE(towers[i].fourVector.px,towers[i].fourVector.py,towers[i].fourVector.pz,towers[i].fourVector.E); 329 PTmis = PTmis + Att; 330 } 331 elementEtmis = (TRootETmis*) branchETmis->NewEntry(); 332 elementEtmis->ET = (PTmis).Pt(); 333 elementEtmis->Phi = (-PTmis).Phi(); 334 elementEtmis->Px = (-PTmis).Px(); 335 elementEtmis->Py = (-PTmis).Py(); 336 337 //***************************** 338 treeWriter->Fill(); 339 340 340 sorted_jets=JETRUN->RunJets(input_particles); 341 341 JETRUN->RunJetBtagging(treeWriter, branchJet,sorted_jets,NFCentralQ); … … 344 344 // Add here the trigger 345 345 // Should test all the trigger table on the event, based on reconstructed objects 346 treeWriter->Fill(); 347 346 348 347 } // Loop over all events 349 348 350 349 treeWriter->Write(); 350 351 cout << "** Exiting..." << endl; 352 351 353 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 const TClonesArray *branchElecTrig = treeReaderT->UseBranch("Electron");360 const TClonesArray *branchMuonTrig = treeReaderT->UseBranch("Muon");361 const TClonesArray *branchJetTrig = treeReaderT->UseBranch("Jet");362 const TClonesArray *branchTauJetTrig = treeReaderT->UseBranch("TauJet");363 const TClonesArray *branchPhotonTrig = treeReaderT->UseBranch("Photon");364 const TClonesArray *branchETmisTrig = treeReaderT->UseBranch("ETmis");365 366 ExRootTreeWriter *treeWriterT = new ExRootTreeWriter(outputfilename, "Trigger");367 ExRootTreeBranch *branchTrigger = treeWriterT->NewBranch("TrigResult", TRootTrigger::Class());368 369 TRootTrigger *elementTrigger;370 371 Long64_t entryT, allEntriesT = treeReaderT->GetEntries();372 cout << "** Chain contains " << allEntriesT << " events" << endl;373 for(entryT = 0; entryT < allEntriesT; ++entryT)374 {375 treeWriterT->Clear();376 treeReaderT->ReadEntry(entry);377 elementTrigger = (TRootTrigger*) branchTrigger->NewEntry();378 elementTrigger->Accepted=1;379 treeWriterT->Fill();380 }381 382 treeWriterT->Write();383 delete treeWriterT;384 }385 386 cout << "** Exiting..." << endl;387 388 354 delete treeReader; 389 355 delete DET; 390 356 if(converter) delete converter; 391 357 392 358 todo("TODO"); 393 359 }
Note:
See TracChangeset
for help on using the changeset viewer.