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