Changeset a221d1f in git for modules/Calorimeter.cc
- Timestamp:
- Dec 19, 2014, 2:52:00 AM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- c04eb8a
- Parents:
- 1c6dd69
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/Calorimeter.cc
r1c6dd69 ra221d1f 86 86 { 87 87 ExRootConfParam param, paramEtaBins, paramPhiBins, paramFractions; 88 Long_t i, j, k, size, sizeEtaBins, sizePhiBins , sizeFractions;88 Long_t i, j, k, size, sizeEtaBins, sizePhiBins; 89 89 Double_t ecalFraction, hcalFraction; 90 90 TBinMap::iterator itEtaBin; … … 139 139 { 140 140 paramFractions = param[i*2 + 1]; 141 sizeFractions = paramFractions.GetSize();142 141 143 142 ecalFraction = paramFractions[0].GetDouble(); … … 155 154 156 155 // read min E value for towers to be saved 157 fEcalEnergyMin = GetDouble("EcalTowerMinEnergy", 0.0); 158 fHcalEnergyMin = GetDouble("HcalTowerMinEnergy", 0.0); 159 160 fEcalSigmaMin = GetDouble("EcalTowerMinSignificance", 0.0); 161 fHcalSigmaMin = GetDouble("HcalTowerMinSignificance", 0.0); 162 163 156 fEcalEnergyMin = GetDouble("EcalTowerMinEnergy", 0.0); 157 fHcalEnergyMin = GetDouble("HcalTowerMinEnergy", 0.0); 158 159 fEcalSigmaMin = GetDouble("EcalTowerMinSignificance", 0.0); 160 fHcalSigmaMin = GetDouble("HcalTowerMinSignificance", 0.0); 161 162 164 163 // read resolution formulas 165 164 fECalResolutionFormula->Compile(GetString("ECalResolutionFormula", "0")); … … 176 175 fTowerOutputArray = ExportArray(GetString("TowerOutputArray", "towers")); 177 176 fPhotonOutputArray = ExportArray(GetString("PhotonOutputArray", "photons")); 178 177 179 178 fEFlowTrackOutputArray = ExportArray(GetString("EFlowTrackOutputArray", "eflowTracks")); 180 179 fEFlowPhotonOutputArray = ExportArray(GetString("EFlowPhotonOutputArray", "eflowPhotons")); 181 180 fEFlowNeutralHadronOutputArray = ExportArray(GetString("EFlowNeutralHadronOutputArray", "eflowNeutralHadrons")); 182 181 183 182 fDitherTowerCenter = GetBool("DitherTowerCenters", true); 184 183 } 185 184 … … 366 365 fTrackHCalTime = 0.0; 367 366 368 fTowerECalWeightTime = 0.0; 367 fTowerECalWeightTime = 0.0; 369 368 fTowerHCalWeightTime = 0.0; 370 369 371 370 fTowerTrackHits = 0; 372 371 fTowerPhotonHits = 0; 373 372 374 373 fTowerTrackArray->Clear(); 375 374 } … … 384 383 position = track->Position; 385 384 386 385 387 386 ecalEnergy = momentum.E() * fTrackECalFractions[number]; 388 387 hcalEnergy = momentum.E() * fTrackHCalFractions[number]; … … 390 389 fTrackECalEnergy += ecalEnergy; 391 390 fTrackHCalEnergy += hcalEnergy; 392 391 393 392 fTrackECalTime += TMath::Sqrt(ecalEnergy)*position.T(); 394 393 fTrackHCalTime += TMath::Sqrt(hcalEnergy)*position.T(); 395 394 396 395 fTrackECalWeightTime += TMath::Sqrt(ecalEnergy); 397 396 fTrackHCalWeightTime += TMath::Sqrt(hcalEnergy); … … 401 400 continue; 402 401 } 403 402 404 403 // check for photon and electron hits in current tower 405 404 if(flags & 2) ++fTowerPhotonHits; 406 405 407 406 particle = static_cast<Candidate*>(fParticleInputArray->At(number)); 408 407 momentum = particle->Momentum; … … 421 420 fTowerECalWeightTime += TMath::Sqrt(ecalEnergy); 422 421 fTowerHCalWeightTime += TMath::Sqrt(hcalEnergy); 423 422 424 423 425 424 fTower->AddCandidate(particle); … … 462 461 hcalTime = (fTowerHCalWeightTime < 1.0E-09 ) ? 0 : fTowerHCalTime/fTowerHCalWeightTime; 463 462 464 463 465 464 ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, ecalEnergy); 466 465 hcalSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, hcalEnergy); … … 470 469 471 470 energy = ecalEnergy + hcalEnergy; 472 time = (TMath::Sqrt(ecalEnergy)*ecalTime + TMath::Sqrt(hcalEnergy)*hcalTime)/(TMath::Sqrt(ecalEnergy) + TMath::Sqrt(hcalEnergy)); 473 474 // eta = fTowerEta; 475 // phi = fTowerPhi; 476 477 eta = gRandom->Uniform(fTowerEdges[0], fTowerEdges[1]); 478 phi = gRandom->Uniform(fTowerEdges[2], fTowerEdges[3]); 471 time = (TMath::Sqrt(ecalEnergy)*ecalTime + TMath::Sqrt(hcalEnergy)*hcalTime)/(TMath::Sqrt(ecalEnergy) + TMath::Sqrt(hcalEnergy)); 472 473 if(fDitherTowerCenter) 474 { 475 eta = gRandom->Uniform(fTowerEdges[0], fTowerEdges[1]); 476 phi = gRandom->Uniform(fTowerEdges[2], fTowerEdges[3]); 477 } 478 else 479 { 480 eta = fTowerEta; 481 phi = fTowerPhi; 482 } 479 483 480 484 pt = energy / TMath::CosH(eta); … … 497 501 fPhotonOutputArray->Add(fTower); 498 502 } 499 503 500 504 fTowerOutputArray->Add(fTower); 501 505 }
Note:
See TracChangeset
for help on using the changeset viewer.