Changeset 445 in svn
- Timestamp:
- Jun 19, 2009, 6:59:40 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Resolutions.cpp
r443 r445 32 32 ***********************************************************************/ 33 33 34 /// \file Smearing.cpp35 /// \brief executable for the FastSim34 /// \file Resolution.cpp 35 /// \brief Prepares the resolution calculation 36 36 37 37 #include "TChain.h" … … 111 111 112 112 113 void PairingJet(TLorentzVector &JETSm, const TLorentzVector &JET, const TClonesArray *branchJet )113 void PairingJet(TLorentzVector &JETSm, const TLorentzVector &JET, const TClonesArray *branchJet, const float dR=0.25) 114 114 { 115 115 JETSm.SetPxPyPzE(0,0,0,0); … … 125 125 { 126 126 deltaRtest = DeltaR(JET.Phi(),JET.Eta(),Att.Phi(),Att.Eta()); 127 if(deltaRtest < 0.25)127 if(deltaRtest < dR) 128 128 { 129 129 JETSm = Att; … … 203 203 if(argc != 3) { 204 204 cout << " Usage: " << argv[0] << " input_file" << " output_file" << endl; 205 cout << " input_ list - list of files inroot format," << endl;205 cout << " input_file - input file in Delphes-root format," << endl; 206 206 cout << " output_file - output file." << endl; 207 207 exit(1); … … 220 220 221 221 222 TFile *outputFile = TFile::Open(outputfilename.c_str(), "RECREATE"); 222 TFile *outputFile = TFile::Open(outputfilename.c_str(), "RECREATE");// Creates the file, but should be closed just after 223 223 outputFile->Close(); 224 224 … … 257 257 258 258 RESOLution *DET = new RESOLution(); 259 DET->ReadDataCard("data/DetectorCard_CMS.dat"); 259 /* 260 string detectorcard = "data/DetectorCard_CMS.dat"; 261 const float dR_jetpairing = 0.25; 262 const float jet_pt_cut = 1; 263 */ 264 string detectorcard = "data/DetectorCard_ATLAS.dat"; 265 const float dR_jetpairing = 0.2; 266 const float jet_pt_cut = 7; 267 DET->ReadDataCard(detectorcard); 260 268 261 269 262 270 //Jet information 263 JetsUtil *JETRUN = new JetsUtil( "data/DetectorCard_CMS.dat");271 JetsUtil *JETRUN = new JetsUtil(detectorcard); 264 272 265 273 TLorentzVector genMomentum(0,0,0,0);//TLorentzVector containing generator level information … … 269 277 vector<fastjet::PseudoJet> input_particlesGEN;//for FastJet algorithm 270 278 vector<fastjet::PseudoJet> sorted_jetsGEN; 271 272 279 vector<int> NTrackJet; 273 274 280 vector<TLorentzVector> towers; 275 281 … … 309 315 //Calculate ETMIS from generated particles 310 316 if((pid == pNU1) || (pid == pNU2) || (pid == pNU3))PTmisGEN = PTmisGEN + genMomentum; 311 317 318 //Electrons and muons 312 319 if( (particle->Status == 1) && 313 320 ((pid != pNU1) && (pid != pNU2) && (pid != pNU3)) && … … 328 335 case pMU: // all muons with eta < DET->MAX_MU 329 336 PairingMuon(recoMomentum,genMomentum,branchMuon); 330 if(recoMomentum.E() 337 if(recoMomentum.E()!=0){ 331 338 elementMuon = (RESOLMUON*) branchmuon->NewEntry(); 332 elementMuon->OverPT = (1/genMomentum.Pt());333 elementMuon->OverSmearedPT = (1/recoMomentum.Pt());}339 elementMuon->OverPT = 1./genMomentum.Pt(); 340 elementMuon->OverSmearedPT = 1./recoMomentum.Pt();} 334 341 break; // case pMU 335 342 default: … … 362 369 elementEtmis->Ex = (-PTmisGEN).Px(); 363 370 elementEtmis->SEt = ScalarEt; 364 365 371 elementEtmis->EtSmeare = (PTmisReco).Pt()-(PTmisGEN).Pt(); 366 372 elementEtmis->ExSmeare = (-PTmisReco).Px()-(PTmisGEN).Px(); … … 370 376 371 377 TSimpleArray<TRootGenParticle> TausHadr = TauHadr(branchGen); 372 373 378 TLorentzVector JETreco(0,0,0,0); 374 379 for (unsigned int i = 0; i < sorted_jetsGEN.size(); i++) { … … 376 381 JETgen.SetPxPyPzE(sorted_jetsGEN[i].px(),sorted_jetsGEN[i].py(),sorted_jetsGEN[i].pz(),sorted_jetsGEN[i].E()); 377 382 PairingJet(JETreco,JETgen,branchJet); 378 if(JETreco.Pt()> 1)383 if(JETreco.Pt()>jet_pt_cut) 379 384 { 380 385 elementJet= (RESOLJET*) branchjet->NewEntry(); 381 386 elementJet->PT = JETgen.Et(); 382 387 elementJet->SmearedPT = JETreco.Et()/JETgen.Et(); 388 elementJet->E = JETgen.E(); 389 elementJet->dE = (JETreco.E()-JETgen.E())/JETgen.E() ; 390 elementJet->dE2 = pow( (JETreco.E()-JETgen.E())/JETgen.E() , 2.) ; 383 391 } 384 392 } … … 399 407 { 400 408 elementTaujet= (TAUHAD*) branchtaujet->NewEntry(); 401 elementTaujet->EnergieCen = (EnergySmallCone(towers,JETT.Eta(),JETT.Phi(),DET->TAU_energy_scone,DET->JET_seed)/JETT.E());409 elementTaujet->EnergieCen = EnergySmallCone(towers,JETT.Eta(),JETT.Phi(),DET->TAU_energy_scone,DET->JET_seed)/JETT.E(); 402 410 elementTaujet->NumTrack = NumTracks(branchTracks,DET->TAU_track_pt,JETT.Eta(),JETT.Phi(),DET->TAU_track_scone); 403 411 if( (EnergySmallCone(towers,JETT.Eta(),JETT.Phi(),DET->TAU_energy_scone,DET->JET_seed)/JETT.E()) > 0.95 … … 409 417 410 418 } // for itJet : loop on all jets 411 //cout<<"i"<<endl;412 419 413 420 treeWriter->Fill(); 414 421 } // Loop over all events 415 422 treeWriter->Write(); 416 float frac = numTauRec/numTau; 417 cout<<numTauRec<<endl; 418 cout<<numTau<<endl; 419 423 424 cout << detectorcard << " has been used.\n"; 420 425 cout << "** Exiting..." << endl; 421 cout<<frac<<endl;422 423 426 424 427 delete treeWriter;
Note:
See TracChangeset
for help on using the changeset viewer.