Changeset 839deb7 in git
- Timestamp:
- Jun 29, 2015, 10:27:47 PM (9 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- c1ce3fe
- Parents:
- 5d2481f
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
classes/DelphesClasses.cc
r5d2481f r839deb7 131 131 NCharged(0), 132 132 NNeutrals(0), 133 NSubJetsTrimmed(0),134 NSubJetsPruned(0),135 NSubJetsSoftDropped(0),136 133 Beta(0), 137 134 BetaStar(0), 138 135 MeanSqDeltaR(0), 139 136 PTD(0), 140 N times(-1),137 NTimeHits(-1), 141 138 IsolationVar(-999), 142 139 IsolationVarRhoCorr(-999), … … 145 142 SumPtChargedPU(-999), 146 143 SumPt(-999), 144 NSubJetsTrimmed(0), 145 NSubJetsPruned(0), 146 NSubJetsSoftDropped(0), 147 147 fFactory(0), 148 148 fArray(0) … … 274 274 object.MeanSqDeltaR = MeanSqDeltaR; 275 275 object.PTD = PTD; 276 object.N times = Ntimes;276 object.NTimeHits = NTimeHits; 277 277 object.IsolationVar = IsolationVar; 278 278 object.IsolationVarRhoCorr = IsolationVarRhoCorr; … … 292 292 object.Tau[3] = Tau[3]; 293 293 object.Tau[4] = Tau[4]; 294 294 295 295 object.TrimmedP4[0] = TrimmedP4[0]; 296 296 object.TrimmedP4[1] = TrimmedP4[1]; … … 316 316 object.fArray = 0; 317 317 318 // Copy cluster timing info319 copy(E cal_E_t.begin(),Ecal_E_t.end(),back_inserter(object.Ecal_E_t));318 // copy cluster timing info 319 copy(ECalEnergyTimePairs.begin(), ECalEnergyTimePairs.end(), back_inserter(object.ECalEnergyTimePairs)); 320 320 321 321 if(fArray && fArray->GetEntriesFast() > 0) … … 374 374 MeanSqDeltaR = 0.0; 375 375 PTD = 0.0; 376 377 N times = 0;378 E cal_E_t.clear();379 376 377 NTimeHits = 0; 378 ECalEnergyTimePairs.clear(); 379 380 380 IsolationVar = -999; 381 381 IsolationVarRhoCorr = -999; … … 384 384 SumPtChargedPU = -999; 385 385 SumPt = -999; 386 386 387 387 FracPt[0] = 0.0; 388 388 FracPt[1] = 0.0; … … 395 395 Tau[3] = 0.0; 396 396 Tau[4] = 0.0; 397 397 398 398 for(i = 0; i < 5; ++i) 399 399 { 400 400 TrimmedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0); 401 PrunedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0); 401 PrunedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0); 402 402 SoftDroppedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0); 403 403 } … … 406 406 NSubJetsPruned = 0; 407 407 NSubJetsSoftDropped = 0; 408 408 409 409 fArray = 0; 410 410 } -
classes/DelphesClasses.h
r5d2481f r839deb7 443 443 444 444 Float_t T; // ecal deposit time, averaged by sqrt(EM energy) over all particles, not smeared 445 Int_t Ntimes; // number of hits contributing to time measurement445 Int_t NTimeHits; // number of hits contributing to time measurement 446 446 447 447 Float_t Eem; // calorimeter tower electromagnetic energy … … 506 506 507 507 Int_t IsConstituent; 508 508 509 509 Int_t IsFromConversion; 510 510 511 511 UInt_t Flavor; 512 512 UInt_t FlavorAlgo; … … 528 528 TLorentzVector Momentum, Position, Area; 529 529 530 Float_t 531 Float_t 532 Float_t 533 Float_t 534 Float_t 530 Float_t Dxy; 531 Float_t SDxy; 532 Float_t Xd; 533 Float_t Yd; 534 Float_t Zd; 535 535 536 536 // PileUpJetID variables 537 537 538 Int_t 539 Int_t 540 Float_t 541 Float_t 542 Float_t 543 Float_t 544 Float_t 545 546 // Timing information547 548 Int_t Ntimes;549 std::vector< std::pair<Float_t,Float_t> > Ecal_E_t;538 Int_t NCharged; 539 Int_t NNeutrals; 540 Float_t Beta; 541 Float_t BetaStar; 542 Float_t MeanSqDeltaR; 543 Float_t PTD; 544 Float_t FracPt[5]; 545 546 // Timing information 547 548 Int_t NTimeHits; 549 std::vector< std::pair< Float_t, Float_t > > ECalEnergyTimePairs; 550 550 551 551 // Isolation variables -
modules/Calorimeter.cc
r5d2481f r839deb7 142 142 } 143 143 144 /*145 TFractionMap::iterator itFractionMap;146 for(itFractionMap = fFractionMap.begin(); itFractionMap != fFractionMap.end(); ++itFractionMap)147 {148 cout << itFractionMap->first << " " << itFractionMap->second.first << " " << itFractionMap->second.second << endl;149 }150 */151 152 144 // read min E value for timing measurement in ECAL 153 fTimingE Min = GetDouble("TimingEMin",4.);145 fTimingEnergyMin = GetDouble("TimingEnergyMin",4.); 154 146 // For timing 155 147 // So far this flag needs to be false … … 157 149 fElectronsFromTrack = false; 158 150 159 160 151 // read min E value for towers to be saved 161 152 fECalEnergyMin = GetDouble("ECalEnergyMin", 0.0); … … 385 376 fTrackHCalEnergy += hcalEnergy; 386 377 387 bool dbg_scz = false; 388 if (dbg_scz) { 389 cout << " Calorimeter input track has x y z t " << track->Position.X() << " " << track->Position.Y() << " " << track->Position.Z() << " " << track->Position.T() 390 << endl; 391 Candidate *prt = static_cast<Candidate*>(track->GetCandidates()->Last()); 392 const TLorentzVector &ini = prt->Position; 393 394 cout << " and parent has x y z t " << ini.X() << " " << ini.Y() << " " << ini.Z() << " " << ini.T(); 395 378 if(ecalEnergy > fTimingEnergyMin && fTower) 379 { 380 if(fElectronsFromTrack) 381 { 382 fTower->ECalEnergyTimePairs.push_back(make_pair<Float_t, Float_t>(ecalEnergy, track->Position.T())); 383 } 396 384 } 397 398 if (ecalEnergy > fTimingEMin && fTower) {399 if (fElectronsFromTrack) {400 // cout << " SCZ Debug pushing back track hit E=" << ecalEnergy << " T=" << track->Position.T() << " isPU=" << track->IsPU << " isRecoPU=" << track->IsRecoPU401 // << " PID=" << track->PID << endl;402 fTower->Ecal_E_t.push_back(std::make_pair<float,float>(ecalEnergy,track->Position.T()));403 } else {404 // cout << " Skipping track hit E=" << ecalEnergy << " T=" << track->Position.T() << " isPU=" << track->IsPU << " isRecoPU=" << track->IsRecoPU405 // << " PID=" << track->PID << endl;406 }407 }408 409 385 410 386 fTowerTrackArray->Add(track); … … 412 388 continue; 413 389 } 414 390 415 391 // check for photon and electron hits in current tower 416 392 if(flags & 2) ++fTowerPhotonHits; … … 427 403 fTowerHCalEnergy += hcalEnergy; 428 404 429 if (ecalEnergy > fTimingEMin && fTower) { 430 if (abs(particle->PID) != 11 || !fElectronsFromTrack) { 431 // cout << " SCZ Debug About to push back particle hit E=" << ecalEnergy << " T=" << particle->Position.T() << " isPU=" << particle->IsPU 432 // << " PID=" << particle->PID << endl; 433 fTower->Ecal_E_t.push_back(std::make_pair<Float_t,Float_t>(ecalEnergy,particle->Position.T())); 434 } else { 435 436 // N.B. Only charged particle set to leave ecal energy is the electrons 437 // cout << " SCZ Debug To avoid double-counting, skipping particle hit E=" << ecalEnergy << " T=" << particle->Position.T() << " isPU=" << particle->IsPU 438 // << " PID=" << particle->PID << endl; 439 405 if(ecalEnergy > fTimingEnergyMin && fTower) 406 { 407 if (abs(particle->PID) != 11 || !fElectronsFromTrack) 408 { 409 fTower->ECalEnergyTimePairs.push_back(make_pair<Float_t, Float_t>(ecalEnergy, particle->Position.T())); 440 410 } 441 411 } … … 456 426 Double_t ecalEnergy, hcalEnergy; 457 427 Double_t ecalSigma, hcalSigma; 458 428 Float_t weight, sumWeightedTime, sumWeight; 429 459 430 if(!fTower) return; 460 431 … … 472 443 473 444 energy = ecalEnergy + hcalEnergy; 474 445 475 446 if(fSmearTowerCenter) 476 447 { … … 487 458 488 459 // Time calculation for tower 489 fTower->Ntimes = 0; 490 Float_t tow_sumT = 0; 491 Float_t tow_sumW = 0; 492 493 for (Int_t i = 0 ; i < fTower->Ecal_E_t.size() ; i++) 494 { 495 Float_t w = TMath::Sqrt(fTower->Ecal_E_t[i].first); 496 tow_sumT += w*fTower->Ecal_E_t[i].second; 497 tow_sumW += w; 498 fTower->Ntimes++; 499 } 500 501 if (tow_sumW > 0.) { 502 fTower->Position.SetPtEtaPhiE(1.0, eta, phi,tow_sumT/tow_sumW); 503 } else { 504 fTower->Position.SetPtEtaPhiE(1.0,eta,phi,999999.); 460 fTower->NTimeHits = 0; 461 sumWeightedTime = 0.0; 462 sumWeight = 0.0; 463 464 for(size_t i = 0; i < fTower->ECalEnergyTimePairs.size(); ++i) 465 { 466 weight = TMath::Sqrt(fTower->ECalEnergyTimePairs[i].first); 467 sumWeightedTime += weight * fTower->ECalEnergyTimePairs[i].second; 468 sumWeight += weight; 469 fTower->NTimeHits++; 470 } 471 472 if(sumWeight > 0.0) 473 { 474 fTower->Position.SetPtEtaPhiE(1.0, eta, phi, sumWeightedTime/sumWeight); 475 } 476 else 477 { 478 fTower->Position.SetPtEtaPhiE(1.0, eta, phi, 999999.9); 505 479 } 506 480 -
modules/Calorimeter.h
r5d2481f r839deb7 60 60 Double_t fTrackECalEnergy, fTrackHCalEnergy; 61 61 62 Double_t fTimingE Min;63 Bool_t fElectronsFromTrack; // for timing64 62 Double_t fTimingEnergyMin; 63 Bool_t fElectronsFromTrack; 64 65 65 Int_t fTowerTrackHits, fTowerPhotonHits; 66 66 -
modules/PileUpJetID.cc
r5d2481f r839deb7 154 154 float sumT40 = 0.; 155 155 float sumWeightsForT = 0.; 156 candidate->N times = 0;156 candidate->NTimeHits = 0; 157 157 158 158 float sumpt = 0.; … … 197 197 float tow_sumT = 0; 198 198 float tow_sumW = 0; 199 for (int i = 0 ; i < constituent->E cal_E_t.size() ; i++) {200 float w = TMath::Sqrt(constituent->E cal_E_t[i].first);199 for (int i = 0 ; i < constituent->ECalEnergyTimePairs.size() ; i++) { 200 float w = TMath::Sqrt(constituent->ECalEnergyTimePairs[i].first); 201 201 if (fAverageEachTower) { 202 tow_sumT += w*constituent->E cal_E_t[i].second;202 tow_sumT += w*constituent->ECalEnergyTimePairs[i].second; 203 203 tow_sumW += w; 204 204 } else { 205 sumT0 += w*constituent->E cal_E_t[i].second;206 sumT1 += w*gRandom->Gaus(constituent->E cal_E_t[i].second,0.001);207 sumT10 += w*gRandom->Gaus(constituent->E cal_E_t[i].second,0.010);208 sumT20 += w*gRandom->Gaus(constituent->E cal_E_t[i].second,0.020);209 sumT30 += w*gRandom->Gaus(constituent->E cal_E_t[i].second,0.030);210 sumT40 += w*gRandom->Gaus(constituent->E cal_E_t[i].second,0.040);205 sumT0 += w*constituent->ECalEnergyTimePairs[i].second; 206 sumT1 += w*gRandom->Gaus(constituent->ECalEnergyTimePairs[i].second,0.001); 207 sumT10 += w*gRandom->Gaus(constituent->ECalEnergyTimePairs[i].second,0.010); 208 sumT20 += w*gRandom->Gaus(constituent->ECalEnergyTimePairs[i].second,0.020); 209 sumT30 += w*gRandom->Gaus(constituent->ECalEnergyTimePairs[i].second,0.030); 210 sumT40 += w*gRandom->Gaus(constituent->ECalEnergyTimePairs[i].second,0.040); 211 211 sumWeightsForT += w; 212 candidate->N times++;212 candidate->NTimeHits++; 213 213 } 214 214 } … … 221 221 sumT40 += tow_sumW*gRandom->Gaus(tow_sumT/tow_sumW,0.0040); 222 222 sumWeightsForT += tow_sumW; 223 candidate->N times++;223 candidate->NTimeHits++; 224 224 } 225 225 } -
modules/TreeWriter.cc
r5d2481f r839deb7 362 362 363 363 entry->T = position.T()*1.0E-3/c_light; 364 entry->N times = candidate->Ntimes;364 entry->NTimeHits = candidate->NTimeHits; 365 365 366 366 FillParticles(candidate, &entry->Particles);
Note:
See TracChangeset
for help on using the changeset viewer.