- Timestamp:
- Jun 29, 2015, 10:27:47 PM (9 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- c1ce3fe
- Parents:
- 5d2481f
- Location:
- modules
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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.