Changeset 39 in svn for trunk/Resolutions.cpp
- Timestamp:
- Nov 18, 2008, 10:30:58 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Resolutions.cpp
r26 r39 52 52 //------------------------------------------------------------------------------ 53 53 54 55 56 void PairingJet(TLorentzVector &JETSm, TLorentzVector JET, vector<fastjet::PseudoJet> sorted_jetsS) 54 // //********************************** PYTHIA INFORMATION********************************* 55 56 TSimpleArray<TRootGenParticle> TauHadr(const TClonesArray *GEN) 57 { 58 TIter it((TCollection*)GEN); 59 it.Reset(); 60 TRootGenParticle *gen1; 61 TSimpleArray<TRootGenParticle> array,array2; 62 63 while((gen1 = (TRootGenParticle*) it.Next())) 64 { 65 array.Add(gen1); 66 } 67 it.Reset(); 68 bool tauhad; 69 while((gen1 = (TRootGenParticle*) it.Next())) 70 { 71 tauhad=false; 72 if(abs(gen1->PID)==15) 73 { 74 int d1=gen1->D1; 75 int d2=gen1->D2; 76 77 if((d1 < array.GetEntries()) && (d1 > 0) && (d2 < array.GetEntries()) && (d2 > 0)) 78 { 79 tauhad=true; 80 for(int d=d1; d < d2+1; d++) 81 { 82 if(abs(array[d]->PID)== pE || abs(array[d]->PID)== pMU)tauhad=false; 83 } 84 } 85 } 86 if(tauhad)array2.Add(gen1); 87 } 88 return array2; 89 } 90 91 92 93 void PairingJet(TLorentzVector &JETSm, const TLorentzVector &JET, vector<fastjet::PseudoJet> sorted_jetsS) 57 94 { 58 95 JETSm.SetPxPyPzE(0,0,0,0); … … 146 183 147 184 TRootGenParticle *particle; 148 TRootETmis *etmisc; 149 150 RESOLELEC *elementElec; 185 186 RESOLELEC * elementElec; 151 187 RESOLMUON *elementMuon; 152 188 RESOLJET *elementJet; … … 172 208 vector<fastjet::PseudoJet> inclusive_jetsS; 173 209 vector<fastjet::PseudoJet> sorted_jetsS; 210 211 vector<fastjet::PseudoJet> input_particlesT;//for FastJet algorithm 212 vector<fastjet::PseudoJet> inclusive_jetsT; 213 vector<fastjet::PseudoJet> sorted_jetsT; 214 174 215 vector<PhysicsTower> towers; 175 216 176 217 fastjet::JetDefinition jet_def; 177 218 fastjet::JetDefinition jet_defS; 219 fastjet::JetDefinition jet_defT; 178 220 fastjet::JetDefinition::Plugin * plugins; 179 221 fastjet::JetDefinition::Plugin * pluginsS; 222 fastjet::JetDefinition::Plugin * pluginsT; 180 223 181 224 // set up a CDF midpoint jet definition … … 195 238 #endif 196 239 240 // set up a CDF midpoint jet definition 241 #ifdef ENABLE_PLUGIN_CDFCONES 242 pluginsT = new fastjet::CDFJetCluPlugin(0,DET->CONERADIUS,DET->C_ADJACENCYCUT,DET->C_MAXITERATIONS,DET->C_IRATCH,DET->C_OVERLAPTHRESHOLD); 243 jet_defT = fastjet::JetDefinition(pluginsT); 244 #else 245 pluginsT = NULL; 246 #endif 247 197 248 198 249 // Loop over all events … … 212 263 TrackCentral.clear(); 213 264 TSimpleArray<TRootGenParticle> NFCentralQ; 265 266 sorted_jetsS.clear(); 267 input_particlesS.clear(); 268 inclusive_jetsS.clear(); 269 270 sorted_jetsT.clear(); 271 input_particlesT.clear(); 272 inclusive_jetsT.clear(); 273 274 sorted_jets.clear(); 214 275 input_particles.clear(); 215 276 inclusive_jets.clear(); 216 sorted_jets.clear();217 input_particlesS.clear();218 inclusive_jetsS.clear();219 sorted_jetsS.clear();220 277 towers.clear(); 221 278 … … 228 285 float eta = fabs(particle->Eta); 229 286 230 if(particle->Status == 1 )287 if(particle->Status == 1 && eta < DET->MAX_CALO_FWD) 231 288 { 232 289 input_particles.push_back(fastjet::PseudoJet(genMomentum.Px(),genMomentum.Py(),genMomentum.Pz(), genMomentum.E())); 233 290 } 234 291 292 if((pid == pNU1) || (pid == pNU2) || (pid == pNU3))PTmis = PTmis + genMomentum; 235 293 // keeps only final particles, visible by the central detector, including the fiducial volume 236 294 // the ordering of conditions have been optimised for speed : put first the STATUS condition … … 241 299 ) 242 300 { 243 PTmis = PTmis + genMomentum;//ptmis 301 //if((pid != pNU1) && (pid != pNU2) && (pid != pNU3))PTmis = PTmis + genMomentum;//ptmis 302 303 Float_t nonS=0; 244 304 switch(pid) { 245 246 305 case pE: // all electrons with eta < DET->MAX_CALO_FWD 247 DET->SmearElectron(genMomentum); 306 nonS = genMomentum.E(); 307 DET->SmearElectron(genMomentum); 308 if(eta < DET->MAX_TRACKER){ 309 elementElec=(RESOLELEC*) branchelec->NewEntry(); 310 elementElec->NonSmeareE = nonS; 311 elementElec->SmeareE = genMomentum.E();} 248 312 break; // case pE 249 313 case pGAMMA: // all photons with eta < DET->MAX_CALO_FWD … … 251 315 break; // case pGAMMA 252 316 case pMU: // all muons with eta < DET->MAX_MU 317 elementMuon = (RESOLMUON*) branchmuon->NewEntry(); 318 elementMuon->OneoverNonSmearePT = (1/genMomentum.Pt()); 253 319 DET->SmearMu(genMomentum); 320 elementMuon->OneoverSmearePT = (1/genMomentum.Pt()); 254 321 break; // case pMU 255 322 case pLAMBDA: // all lambdas with eta < DET->MAX_CALO_FWD … … 264 331 if(pid != pMU) 265 332 { 266 // PTmisS = PTmisS + genMomentum;267 333 towers.push_back(PhysicsTower(LorentzVector(genMomentum.Px(),genMomentum.Py(),genMomentum.Pz(), genMomentum.E()))); 268 i f(genMomentum.Et()>0.5)input_particlesS.push_back(fastjet::PseudoJet(genMomentum.Px(),genMomentum.Py(),genMomentum.Pz(), genMomentum.E()));334 input_particlesS.push_back(fastjet::PseudoJet(genMomentum.Px(),genMomentum.Py(),genMomentum.Pz(), genMomentum.E())); 269 335 } 270 336 … … 286 352 } // switch 287 353 } // while 288 289 TLorentzVector TowerTLV(0.,0.,0.,0.); 354 355 TLorentzVector Att(0.,0.,0.,0.); 356 float ScalarEt=0; 290 357 for(unsigned int i=0; i < towers.size(); i++) 291 358 { 292 TowerTLV.SetPxPyPzE(towers[i].fourVector.px,towers[i].fourVector.py,towers[i].fourVector.pz,towers[i].fourVector.E); 293 if(TowerTLV.Et()>0.5)PTmisS = PTmisS + TowerTLV; 294 } 295 296 359 Att.SetPxPyPzE(towers[i].fourVector.px,towers[i].fourVector.py,towers[i].fourVector.pz,towers[i].fourVector.E); 360 ScalarEt = ScalarEt + Att.Et(); 361 PTmisS = PTmisS + Att; 362 } 363 //cout<<"non smeare "<<PTmis.Pt()<<" "<<PTmisS.Pt()<<endl; 364 //cout<<"smeare "<<PTmis.Px()<<" "<<PTmisS.Px()<<endl; 365 //cout<<"**********"<<endl; 366 297 367 elementEtmis= (ETMIS*) branchetmis->NewEntry(); 298 elementEtmis->Et = (PTmis).Et(); 299 elementEtmis->EtSmeare = (PTmisS).Et()-(PTmis).Et(); 368 elementEtmis->Et = (PTmis).Pt(); 369 elementEtmis->Ex = (-PTmis).Px(); 370 elementEtmis->SEt = ScalarEt; 371 372 elementEtmis->EtSmeare = (PTmisS).Pt()-(PTmis).Pt(); 373 elementEtmis->ExSmeare = (-PTmisS).Px()-(PTmis).Px(); 300 374 301 375 //***************************** … … 316 390 } 317 391 392 TSimpleArray<TRootGenParticle> TausHadr = TauHadr(branchGen); 393 318 394 TLorentzVector JETSm(0,0,0,0); 319 395 for (unsigned int i = 0; i < sorted_jets.size(); i++) { … … 326 402 elementJet->NonSmearePT = JET.Et(); 327 403 elementJet->SmearePT = JETSm.Et()/JET.Et(); 328 329 404 } 405 } 406 for (unsigned int i = 0; i < sorted_jetsS.size(); i++) { 407 TLorentzVector JETT(0,0,0,0); 408 JETT.SetPxPyPzE(sorted_jetsS[i].px(),sorted_jetsS[i].py(),sorted_jetsS[i].pz(),sorted_jetsS[i].E()); 409 if(fabs(JETT.Eta()) < (DET->MAX_TRACKER - DET->TAU_CONE_TRACKS)) 410 { 411 for(Int_t i=0; i<TausHadr.GetEntries();i++) 412 { 413 if(DeltaR(TausHadr[i]->Phi,TausHadr[i]->Eta,JETT.Phi(),JETT.Eta())<0.1) 414 { 415 elementTaujet= (TAUHAD*) branchtaujet->NewEntry(); 416 elementTaujet->EnergieCen = (DET->EnergySmallCone(towers,JETT.Eta(),JETT.Phi())/JETT.E()); 417 elementTaujet->NumTrack = DET->NumTracks(TrackCentral,DET->PT_TRACK_TAU,JETT.Eta(),JETT.Phi()); 418 } 419 } 420 } 421 330 422 331 423 } // for itJet : loop on all jets
Note:
See TracChangeset
for help on using the changeset viewer.