Changeset e5767b57 in git
- Timestamp:
- Dec 21, 2014, 1:33:49 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- a5bbe8a, d870fc5
- Parents:
- f10999a
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cards/delphes_card_FCC_basic.tcl
rf10999a re5767b57 226 226 set EFlowTowerOutputArray eflowPhotons 227 227 228 set TowerMinEnergy0.5229 set TowerMinSignificance1.0228 set EnergyMin 0.5 229 set EnergySignificanceMin 1.0 230 230 231 231 set pi [expr {acos(-1)}] … … 288 288 set EFlowTowerOutputArray eflowNeutralHadrons 289 289 290 set TowerMinEnergy1.0291 set TowerMinSignificance1.0290 set EnergyMin 1.0 291 set EnergySignificanceMin 1.0 292 292 293 293 set pi [expr {acos(-1)}] -
modules/SimpleCalorimeter.cc
rf10999a re5767b57 60 60 { 61 61 fResolutionFormula = new DelphesFormula; 62 62 63 63 fTowerTrackArray = new TObjArray; 64 64 fItTowerTrackArray = fTowerTrackArray->MakeIterator(); … … 70 70 { 71 71 if(fResolutionFormula) delete fResolutionFormula; 72 72 73 73 if(fTowerTrackArray) delete fTowerTrackArray; 74 74 if(fItTowerTrackArray) delete fItTowerTrackArray; … … 136 136 fFractionMap[param[i*2].GetInt()] = fraction; 137 137 } 138 138 139 /* 139 140 TFractionMap::iterator itFractionMap; … … 145 146 146 147 // read min E value for towers to be saved 147 fEnergyMin = GetDouble("TowerMinEnergy", 0.0); 148 fSigmaMin = GetDouble("TowerMinSignificance", 0.0); 149 148 fEnergyMin = GetDouble("EnergyMin", 0.0); 149 150 fEnergySignificanceMin = GetDouble("EnergySignificanceMin", 0.0); 151 152 // switch on or off the dithering of the center of calorimeter towers 153 fDitherTowerCenter = GetBool("DitherTowerCenter", true); 154 150 155 // read resolution formulas 151 156 fResolutionFormula->Compile(GetString("ResolutionFormula", "0")); 152 157 153 158 // import array with output from other modules 154 159 fParticleInputArray = ImportArray(GetString("ParticleInputArray", "ParticlePropagator/particles")); … … 161 166 fTowerOutputArray = ExportArray(GetString("TowerOutputArray", "towers")); 162 167 fEFlowTowerOutputArray = ExportArray(GetString("EFlowTowerOutputArray", "eflowTowers")); 163 164 168 } 165 169 … … 202 206 fTowerFractions.clear(); 203 207 fTrackFractions.clear(); 204 208 205 209 // loop over all particles 206 210 fItParticleInputArray->Reset(); … … 221 225 fraction = itFractionMap->second; 222 226 fTowerFractions.push_back(fraction); 223 227 224 228 if(fraction < 1.0E-9) continue; 225 229 … … 263 267 264 268 fraction = itFractionMap->second; 265 269 266 270 fTrackFractions.push_back(fraction); 267 271 268 272 // find eta bin [1, fEtaBins.size - 1] 269 273 itEtaBin = lower_bound(fEtaBins.begin(), fEtaBins.end(), trackPosition.Eta()); … … 329 333 fTowerEnergy = 0.0; 330 334 fTrackEnergy = 0.0; 331 335 332 336 fTowerTime = 0.0; 333 337 fTrackTime = 0.0; 334 335 fTower WeightTime = 0.0;336 338 339 fTowerTimeWeight = 0.0; 340 337 341 fTowerTrackHits = 0; 338 342 fTowerPhotonHits = 0; 339 343 340 344 fTowerTrackArray->Clear(); 341 345 } … … 349 353 momentum = track->Momentum; 350 354 position = track->Position; 351 355 352 356 energy = momentum.E() * fTrackFractions[number]; 353 357 354 358 fTrackEnergy += energy; 355 359 356 360 fTrackTime += TMath::Sqrt(energy)*position.T(); 357 fTrack WeightTime+= TMath::Sqrt(energy);358 361 fTrackTimeWeight += TMath::Sqrt(energy); 362 359 363 fTowerTrackArray->Add(track); 360 364 361 365 continue; 362 366 } 363 367 364 368 // check for photon and electron hits in current tower 365 369 if(flags & 2) ++fTowerPhotonHits; 366 370 367 371 particle = static_cast<Candidate*>(fParticleInputArray->At(number)); 368 372 momentum = particle->Momentum; … … 371 375 // fill current tower 372 376 energy = momentum.E() * fTowerFractions[number]; 373 377 374 378 fTowerEnergy += energy; 375 379 376 380 fTowerTime += TMath::Sqrt(energy)*position.T(); 377 fTower WeightTime+= TMath::Sqrt(energy);378 381 fTowerTimeWeight += TMath::Sqrt(energy); 382 379 383 fTower->AddCandidate(particle); 380 384 } … … 397 401 sigma = fResolutionFormula->Eval(0.0, fTowerEta, 0.0, fTowerEnergy); 398 402 399 // energy = gRandom->Gaus(fTowerEnergy, sigma);400 // if(energy < 0.0) energy = 0.0;401 402 403 energy = LogNormal(fTowerEnergy, sigma); 403 time = (fTowerWeightTime < 1.0E-09 ) ? 0 : fTowerTime/fTowerWeightTime; 404 405 time = (fTowerTimeWeight < 1.0E-09 ) ? 0.0 : fTowerTime/fTowerTimeWeight; 404 406 405 407 sigma = fResolutionFormula->Eval(0.0, fTowerEta, 0.0, energy); 406 407 energy = (energy < fEnergyMin || energy < fSigmaMin*sigma) ? 0 : energy; 408 409 eta = gRandom->Uniform(fTowerEdges[0], fTowerEdges[1]); 410 phi = gRandom->Uniform(fTowerEdges[2], fTowerEdges[3]); 408 409 if(energy < fEnergyMin || energy < fEnergySignificanceMin*sigma) energy = 0.0; 410 411 if(fDitherTowerCenter) 412 { 413 eta = gRandom->Uniform(fTowerEdges[0], fTowerEdges[1]); 414 phi = gRandom->Uniform(fTowerEdges[2], fTowerEdges[3]); 415 } 416 else 417 { 418 eta = fTowerEta; 419 phi = fTowerPhi; 420 } 411 421 412 422 pt = energy / TMath::CosH(eta); 413 423 414 // fTower->Position.SetXYZT(-time, 0.0, 0.0, time);415 424 fTower->Position.SetPtEtaPhiE(1.0, eta, phi, time); 416 425 fTower->Momentum.SetPtEtaPhiE(pt, eta, phi, energy); 417 426 418 427 fTower->Edges[0] = fTowerEdges[0]; 419 428 fTower->Edges[1] = fTowerEdges[1]; … … 421 430 fTower->Edges[3] = fTowerEdges[3]; 422 431 423 424 432 // fill SimpleCalorimeter towers 425 433 if(energy > 0.0) fTowerOutputArray->Add(fTower); 426 434 427 428 435 // fill energy flow candidates 429 436 energy -= fTrackEnergy; 430 if(energy < fEnergyMin || energy < fSigmaMin*fResolutionFormula->Eval(0.0, fTowerEta, 0.0, energy)) energy = 0.0; 431 437 438 sigma = fResolutionFormula->Eval(0.0, fTowerEta, 0.0, energy); 439 440 if(energy < fEnergyMin || energy < fEnergySignificanceMin*sigma) energy = 0.0; 441 432 442 // save energy excess as an energy flow tower 433 443 if(energy > 0.0) … … 440 450 fEFlowTowerOutputArray->Add(tower); 441 451 } 442 443 452 } 444 453 … … 454 463 a = TMath::Log(mean) - 0.5*b*b; 455 464 456 return TMath::Exp(a + b*gRandom->Gaus(0 , 1));465 return TMath::Exp(a + b*gRandom->Gaus(0.0, 1.0)); 457 466 } 458 467 else -
modules/SimpleCalorimeter.h
rf10999a re5767b57 59 59 Double_t fTowerEnergy; 60 60 Double_t fTrackEnergy; 61 61 62 62 Double_t fTowerTime; 63 63 Double_t fTrackTime; 64 65 Double_t fTower WeightTime;66 Double_t fTrack WeightTime;67 64 65 Double_t fTowerTimeWeight; 66 Double_t fTrackTimeWeight; 67 68 68 Int_t fTowerTrackHits, fTowerPhotonHits; 69 69 70 70 Double_t fEnergyMin; 71 Double_t fSigmaMin; 71 72 Double_t fEnergySignificanceMin; 73 74 Bool_t fDitherTowerCenter; 72 75 73 76 TFractionMap fFractionMap; //! … … 80 83 81 84 std::vector < Double_t > fTowerFractions; 82 85 83 86 std::vector < Double_t > fTrackFractions; 84 87 85 88 DelphesFormula *fResolutionFormula; //! 86 89 87 90 TIterator *fItParticleInputArray; //! 88 91 TIterator *fItTrackInputArray; //! … … 92 95 93 96 TObjArray *fTowerOutputArray; //! 94 97 95 98 TObjArray *fEFlowTowerOutputArray; //! 96 99 97 100 TObjArray *fTowerTrackArray; //! 98 101 TIterator *fItTowerTrackArray; //!
Note:
See TracChangeset
for help on using the changeset viewer.