CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
CalorimetryManager Class Reference

#include <CalorimetryManager.h>

Public Member Functions

 CalorimetryManager ()
 
 CalorimetryManager (FSimEvent *aSimEvent, const edm::ParameterSet &fastCalo, const edm::ParameterSet &MuonECALPars, const edm::ParameterSet &MuonHCALPars, const edm::ParameterSet &fastGflash)
 
CaloGeometryHelpergetCalorimeter () const
 
FastHFShowerLibrarygetHFShowerLibrary () const
 
void loadFromEcalBarrel (edm::PCaloHitContainer &c) const
 
void loadFromEcalEndcap (edm::PCaloHitContainer &c) const
 
void loadFromHcal (edm::PCaloHitContainer &c) const
 
void loadFromPreshower (edm::PCaloHitContainer &c) const
 
void loadMuonSimTracks (edm::SimTrackContainer &m) const
 
void reconstruct (RandomEngineAndDistribution const *)
 
 ~CalorimetryManager ()
 

Private Member Functions

void clean ()
 
void EMShowerSimulation (const FSimTrack &myTrack, RandomEngineAndDistribution const *)
 
void HDShowerSimulation (const FSimTrack &myTrack, RandomEngineAndDistribution const *)
 Hadronic Shower Simulation. More...
 
void MuonMipSimulation (const FSimTrack &myTrack, RandomEngineAndDistribution const *)
 
void readParameters (const edm::ParameterSet &fastCalo)
 
void reconstructHCAL (const FSimTrack &myTrack, RandomEngineAndDistribution const *)
 
void respCorr (double)
 
void updateECAL (const std::map< CaloHitID, float > &hitMap, int onEcal, int trackID=0, float corr=1.0)
 
void updateHCAL (const std::map< CaloHitID, float > &hitMap, int trackID=0, float corr=1.0)
 
void updatePreshower (const std::map< CaloHitID, float > &hitMap, int trackID=0, float corr=1.0)
 

Private Attributes

GammaFunctionGeneratoraGammaGenerator
 
const LandauFluctuationGeneratoraLandauGenerator
 
double aTerm
 
bool bFixedLength_
 
double bTerm
 
double crackPadSurvivalProbability_
 
bool debug_
 
std::vector< std::pair
< CaloHitID, float > > 
EBMapping_
 
std::unique_ptr
< KKCorrectionFactors
ecalCorrection
 
bool EcalDigitizer_
 
double ecorr
 
std::vector< std::pair
< CaloHitID, float > > 
EEMapping_
 
std::vector< std::pair
< CaloHitID, float > > 
ESMapping_
 
std::vector< unsigned int > evtsToDebug_
 
int gridSize_
 
bool HcalDigitizer_
 
double hcorr
 
int hdGridSize_
 
int hdSimMethod_
 
std::vector< std::pair
< CaloHitID, float > > 
HMapping_
 
int ietaShiftHB_
 
int ietaShiftHE_
 
int ietaShiftHF_
 
int ietaShiftHO_
 
bool initialized_
 
std::vector< double > k_e
 
std::vector< double > k_h
 
std::vector< double > mipValues_
 
std::vector< FSimTrackmuonSimTracks
 
CaloGeometryHelpermyCalorimeter_
 
RawParticle myElec
 A few pointers to save time. More...
 
HCALResponsemyHDResponse_
 
HistosmyHistos
 
HSParametersmyHSParameters_
 
RawParticle myPart
 
RawParticle myPosi
 
FSimEventmySimEvent
 
int optionHDSim_
 
std::vector< double > p_knots
 
double pulledPadSurvivalProbability_
 
double radiusFactorEB_
 
double radiusFactorEE_
 
std::vector< double > radiusPreshowerCorrections_
 
double RCFactor_
 
std::vector< double > rsp
 
double RTFactor_
 
std::vector< double > samplingHBHE_
 
std::vector< double > samplingHF_
 
std::vector< double > samplingHO_
 
bool simulatePreshower_
 
double spotFraction_
 
GflashAntiProtonShowerProfiletheAntiProtonProfile
 
std::vector< double > theCoreIntervals_
 
FastHFShowerLibrarytheHFShowerLibrary
 
MaterialEffectstheMuonEcalEffects
 
MaterialEffectstheMuonHcalEffects
 
GflashPiKShowerProfilethePiKProfile
 
GflashHadronShowerProfiletheProfile
 
GflashProtonShowerProfiletheProtonProfile
 
std::vector< double > theTailIntervals_
 
std::vector< double > timeShiftHB_
 
std::vector< double > timeShiftHE_
 
std::vector< double > timeShiftHF_
 
std::vector< double > timeShiftHO_
 
bool unfoldedMode_
 
bool useCorrectionSL
 
bool useShowerLibrary
 

Static Private Attributes

static std::vector< std::pair
< int, float > > 
myZero_
 

Detailed Description

Definition at line 46 of file CalorimetryManager.h.

Constructor & Destructor Documentation

CalorimetryManager::CalorimetryManager ( )

Definition at line 70 of file CalorimetryManager.cc.

70  :
71  myCalorimeter_(0),
72  // myHistos(0),
73  initialized_(false)
74 {;}
CaloGeometryHelper * myCalorimeter_
CalorimetryManager::CalorimetryManager ( FSimEvent aSimEvent,
const edm::ParameterSet fastCalo,
const edm::ParameterSet MuonECALPars,
const edm::ParameterSet MuonHCALPars,
const edm::ParameterSet fastGflash 
)

Definition at line 76 of file CalorimetryManager.cc.

References aGammaGenerator, aLandauGenerator, ecalCorrection, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), myCalorimeter_, myHDResponse_, myHSParameters_, readParameters(), theAntiProtonProfile, theHFShowerLibrary, theMuonEcalEffects, theMuonHcalEffects, thePiKProfile, theProfile, and theProtonProfile.

81  :
82  mySimEvent(aSimEvent),
83  initialized_(false),
85 {
86 
89 
90  //Gflash
91  theProfile = new GflashHadronShowerProfile(parGflash);
92  thePiKProfile = new GflashPiKShowerProfile(parGflash);
95 
96  // FastHFShowerLibrary
98 
99  readParameters(fastCalo);
100 
101  // myHistos = 0;
102 
103  // myHistos = Histos::instance();
104  // myHistos->book("h10",140,-3.5,3.5,100,-0.5,99.5);
105  // myHistos->book("h20",150,0,150.,100,-0.5,99.5);
106  // myHistos->book("h100",140,-3.5,3.5,100,0,0.1);
107  // myHistos->book("h110",140,-3.5,3.5,100,0,10.);
108  // myHistos->book("h120",200,-5.,5.,100,0,0.5);
109 
110  // myHistos->book("h200",300,0,3.,100,0.,35.);
111  // myHistos->book("h210",720,-M_PI,M_PI,100,0,35.);
112  // myHistos->book("h212",720,-M_PI,M_PI,100,0,35.);
113 
114  // myHistos->bookByNumber("h30",0,7,300,-3.,3.,100,0.,35.);
115  // myHistos->book("h310",75,-3.,3.,"");
116  // myHistos->book("h400",100,-10.,10.,100,0.,35.);
117  // myHistos->book("h410",720,-M_PI,M_PI);
118 
119  myCalorimeter_ =
120  new CaloGeometryHelper(fastCalo);
121  myHDResponse_ =
122  new HCALResponse(fastCalo.getParameter<edm::ParameterSet>("HCALResponse"));
123  myHSParameters_ =
124  new HSParameters(fastCalo.getParameter<edm::ParameterSet>("HSParameters"));
125 
126  // Material Effects for Muons in ECAL (only EnergyLoss implemented so far)
127 
128  if ( fastMuECAL.getParameter<bool>("PairProduction") ||
129  fastMuECAL.getParameter<bool>("Bremsstrahlung") ||
130  fastMuECAL.getParameter<bool>("MuonBremsstrahlung") ||
131  fastMuECAL.getParameter<bool>("EnergyLoss") ||
132  fastMuECAL.getParameter<bool>("MultipleScattering") )
133  theMuonEcalEffects = new MaterialEffects(fastMuECAL);
134 
135  // Material Effects for Muons in HCAL (only EnergyLoss implemented so far)
136 
137  if ( fastMuHCAL.getParameter<bool>("PairProduction") ||
138  fastMuHCAL.getParameter<bool>("Bremsstrahlung") ||
139  fastMuHCAL.getParameter<bool>("MuonBremsstrahlung") ||
140  fastMuHCAL.getParameter<bool>("EnergyLoss") ||
141  fastMuHCAL.getParameter<bool>("MultipleScattering") )
142  theMuonHcalEffects = new MaterialEffects(fastMuHCAL);
143 
144  if( fastCalo.exists("ECALResponseScaling") ) {
145  ecalCorrection = std::unique_ptr<KKCorrectionFactors>( new KKCorrectionFactors( fastCalo.getParameter<edm::ParameterSet>("ECALResponseScaling") ) );
146  }
147 
148 }
T getParameter(std::string const &) const
GflashPiKShowerProfile * thePiKProfile
MaterialEffects * theMuonEcalEffects
MaterialEffects * theMuonHcalEffects
GflashHadronShowerProfile * theProfile
bool exists(std::string const &parameterName) const
checks if a parameter exists
void readParameters(const edm::ParameterSet &fastCalo)
const LandauFluctuationGenerator * aLandauGenerator
GflashAntiProtonShowerProfile * theAntiProtonProfile
GflashProtonShowerProfile * theProtonProfile
HCALResponse * myHDResponse_
CaloGeometryHelper * myCalorimeter_
GammaFunctionGenerator * aGammaGenerator
FastHFShowerLibrary * theHFShowerLibrary
std::unique_ptr< KKCorrectionFactors > ecalCorrection
HSParameters * myHSParameters_
CalorimetryManager::~CalorimetryManager ( )

Definition at line 159 of file CalorimetryManager.cc.

References myCalorimeter_, myHDResponse_, theHFShowerLibrary, theMuonEcalEffects, theMuonHcalEffects, and theProfile.

160 {
161  if(myCalorimeter_) delete myCalorimeter_;
162  if(myHDResponse_) delete myHDResponse_;
163 
166 
167  if ( theProfile ) delete theProfile;
168 
170 }
MaterialEffects * theMuonEcalEffects
MaterialEffects * theMuonHcalEffects
GflashHadronShowerProfile * theProfile
HCALResponse * myHDResponse_
CaloGeometryHelper * myCalorimeter_
FastHFShowerLibrary * theHFShowerLibrary

Member Function Documentation

void CalorimetryManager::clean ( )
private

Definition at line 150 of file CalorimetryManager.cc.

References EBMapping_, EEMapping_, ESMapping_, HMapping_, and muonSimTracks.

Referenced by reconstruct().

151 {
152  EBMapping_.clear();
153  EEMapping_.clear();
154  HMapping_.clear();
155  ESMapping_.clear();
156  muonSimTracks.clear();
157 }
std::vector< std::pair< CaloHitID, float > > ESMapping_
std::vector< std::pair< CaloHitID, float > > EBMapping_
std::vector< FSimTrack > muonSimTracks
std::vector< std::pair< CaloHitID, float > > EEMapping_
std::vector< std::pair< CaloHitID, float > > HMapping_
void CalorimetryManager::EMShowerSimulation ( const FSimTrack myTrack,
RandomEngineAndDistribution const *  random 
)
private

Definition at line 249 of file CalorimetryManager.cc.

References funct::abs(), aGammaGenerator, aLandauGenerator, aTerm, bFixedLength_, bTerm, EMShower::compute(), crackPadSurvivalProbability_, debug_, HLT_25ns14e33_v1_cff::depth, GetRecoTauVFromDQM_MC_cff::dir2, alignCSCRings::e, ecalCorrection, FSimTrack::ecalEntrance(), Calorimeter::ecalProperties(), RawParticle::eta(), RandomEngineAndDistribution::flatShoot(), CaloGeometryHelper::getClosestCell(), PreshowerHitMaker::getHits(), HcalHitMaker::getHits(), EcalHitMaker::getHits(), EMShower::getMaximumOfShower(), gridSize_, FSimTrack::hcalEntrance(), Calorimeter::hcalProperties(), FSimTrack::id(), FSimTrack::layer1Entrance(), Calorimeter::layer1Properties(), FSimTrack::layer2Entrance(), Calorimeter::layer2Properties(), create_public_lumi_plots::log, mipValues_, myCalorimeter_, myElec, myPart, myPosi, NULL, FSimTrack::onEcal(), FSimTrack::onHcal(), FSimTrack::onLayer1(), FSimTrack::onLayer2(), pulledPadSurvivalProbability_, radiusFactorEB_, radiusFactorEE_, ECALProperties::radLenIncm(), RCFactor_, RTFactor_, pileupReCalc_HLTpaths::scale, EcalHitMaker::setCrackPadSurvivalProbability(), EMShower::setGrid(), EMShower::setHcal(), PreshowerHitMaker::setMipEnergy(), EMShower::setPreshower(), EcalHitMaker::setPreshowerPresent(), EcalHitMaker::setPulledPadSurvivalProbability(), EcalHitMaker::setRadiusFactor(), EcalHitMaker::setTrackParameters(), RawParticle::setVertex(), simulatePreshower_, findQualityFiles::size, theCoreIntervals_, theTailIntervals_, CoreSimTrack::type(), updateECAL(), updateHCAL(), updatePreshower(), RawParticle::vertex(), and histoStyle::weight.

Referenced by reconstruct().

250  {
251  std::vector<const RawParticle*> thePart;
252  double X0depth;
253 
254  if (debug_) {
255  LogInfo("FastCalorimetry") << " EMShowerSimulation " <<myTrack << std::endl;
256  }
257 
258  // std::cout << " Simulating " << myTrack << std::endl;
259 
260  // The Particle at ECAL entrance
261  // std::cout << " Before ecalEntrance " << std::endl;
262  myPart = myTrack.ecalEntrance();
263 
264  // protection against infinite loop.
265  if ( myTrack.type() == 22 && myPart.e()<0.055) return;
266 
267 
268  // Barrel or Endcap ?
269  int onEcal = myTrack.onEcal();
270  int onHcal = myTrack.onHcal();
271  int onLayer1 = myTrack.onLayer1();
272  int onLayer2 = myTrack.onLayer2();
273 
274  // The entrance in ECAL
275  XYZPoint ecalentrance = myPart.vertex().Vect();
276 
277  // std::cout << " Ecal entrance " << ecalentrance << std::endl;
278 
279  // The preshower
280  PreshowerHitMaker * myPreshower = NULL ;
281  if(simulatePreshower_ && (onLayer1 || onLayer2))
282  {
283  XYZPoint layer1entrance,layer2entrance;
284  XYZVector dir1,dir2;
285  if(onLayer1)
286  {
287  layer1entrance = XYZPoint(myTrack.layer1Entrance().vertex().Vect());
288  dir1 = XYZVector(myTrack.layer1Entrance().Vect().Unit());
289  }
290  if(onLayer2)
291  {
292  layer2entrance = XYZPoint(myTrack.layer2Entrance().vertex().Vect());
293  dir2 = XYZVector(myTrack.layer2Entrance().Vect().Unit());
294  }
295  // std::cout << " Layer1entrance " << layer1entrance << std::endl;
296  // std::cout << " Layer2entrance " << layer2entrance << std::endl;
297  myPreshower = new PreshowerHitMaker(myCalorimeter_,
298  layer1entrance,
299  dir1,
300  layer2entrance,
301  dir2,
303  random);
304  myPreshower->setMipEnergy(mipValues_[0],mipValues_[1]);
305  }
306 
307  // The ECAL Properties
309  showerparam(myCalorimeter_->ecalProperties(onEcal),
310  myCalorimeter_->hcalProperties(onHcal),
311  myCalorimeter_->layer1Properties(onLayer1),
312  myCalorimeter_->layer2Properties(onLayer2),
315  RCFactor_,
316  RTFactor_);
317 
318  // Photons : create an e+e- pair
319  if ( myTrack.type() == 22 ) {
320 
321  // Depth for the first e+e- pair creation (in X0)
322  X0depth = -log(random->flatShoot()) * (9./7.);
323 
324  // Initialization
325  double eMass = 0.000510998902;
326  double xe=0;
327  double xm=eMass/myPart.e();
328  double weight = 0.;
329 
330  // Generate electron energy between emass and eGamma-emass
331  do {
332  xe = random->flatShoot()*(1.-2.*xm) + xm;
333  weight = 1. - 4./3.*xe*(1.-xe);
334  } while ( weight < random->flatShoot() );
335 
336  // Protection agains infinite loop in Famos Shower
337  if ( myPart.e()*xe < 0.055 || myPart.e()*(1.-xe) < 0.055 ) {
338 
339  if ( myPart.e() > 0.055 ) thePart.push_back(&myPart);
340 
341  } else {
342 
343  myElec = (myPart) * xe;
344  myPosi = (myPart) * (1.-xe);
347  thePart.push_back(&myElec);
348  thePart.push_back(&myPosi);
349  }
350  // Electrons
351  } else {
352 
353  X0depth = 0.;
354  if ( myPart.e() > 0.055 ) thePart.push_back(&myPart);
355 
356  }
357 
358  // After the different protections, this shouldn't happen.
359  if(thePart.size()==0)
360  {
361  if(myPreshower==NULL) return;
362  delete myPreshower;
363  return;
364  }
365 
366  // find the most energetic particle
367  double maxEnergy=-1.;
368  for(unsigned ip=0;ip < thePart.size();++ip)
369  if(thePart[ip]->e() > maxEnergy) maxEnergy = thePart[ip]->e();
370 
371  // Initialize the Grid in ECAL
372  int size = gridSize_;
373  if(maxEnergy>100) size=11;
374  // if ( maxEnergy < threshold5x5 ) size = 5;
375  // if ( maxEnergy < threshold3x3 ) size = 3;
376 
377 
378  EMShower theShower(random,aGammaGenerator,&showerparam,&thePart, NULL, NULL, bFixedLength_);
379 
380 
381  double maxShower = theShower.getMaximumOfShower();
382  if (maxShower > 20.) maxShower = 2.; // simple pivot-searching protection
383 
384  double depth((X0depth + maxShower) *
386  XYZPoint meanShower = ecalentrance + myPart.Vect().Unit()*depth;
387 
388  // if(onEcal!=1) return ;
389 
390  // The closest crystal
391  DetId pivot(myCalorimeter_->getClosestCell(meanShower, true, onEcal==1));
392 
393  if(pivot.subdetId() == 0) { // further protection against avbsence of pivot
394  edm::LogWarning("CalorimetryManager") << "Pivot for egamma e = " << myTrack.hcalEntrance().e() << " is not found at depth " << depth << " and meanShower coordinates = " << meanShower << std::endl;
395  if(myPreshower) delete myPreshower;
396  return;
397  }
398 
399  EcalHitMaker myGrid(myCalorimeter_,ecalentrance,pivot,onEcal,size,0,random);
400  // ^^^^
401  // for EM showers
402  myGrid.setPulledPadSurvivalProbability(pulledPadSurvivalProbability_);
403  myGrid.setCrackPadSurvivalProbability(crackPadSurvivalProbability_);
404 
405  //maximumdepth dependence of the radiusfactorbehindpreshower
406  //First tuning: Shilpi Jain (Mar-Apr 2010); changed after tuning - Feb-July - Shilpi Jain
407  /* **************
408  myGrid.setRadiusFactor(radiusFactor_);
409  if(onLayer1 || onLayer2)
410  {
411  float b = radiusPreshowerCorrections_[0];
412  float a = radiusFactor_*( 1.+radiusPreshowerCorrections_[1]*radiusPreshowerCorrections_[0] );
413  float maxdepth = X0depth+theShower.getMaximumOfShower();
414  float newRadiusFactor = radiusFactor_;
415  if(myPart.e()<=250.)
416  {
417  newRadiusFactor = a/(1.+b*maxdepth);
418  }
419  myGrid.setRadiusFactor(newRadiusFactor);
420  }
421  else // otherwise use the normal radius factor
422  {
423  myGrid.setRadiusFactor(radiusFactor_);
424  }
425  ************** */
426  if(myTrack.onEcal() == 2) // if on EE
427  {
428  if( (onLayer1 || onLayer2) && myPart.e()<=250.)
429  {
430  double maxdepth = X0depth+theShower.getMaximumOfShower();
431  double newRadiusFactor = radiusFactorEE_ * aTerm/(1.+bTerm*maxdepth);
432  myGrid.setRadiusFactor(newRadiusFactor);
433  }
434  else // otherwise use the normal radius factor
435  {
436  myGrid.setRadiusFactor(radiusFactorEE_);
437  }
438  }//if(myTrack.onEcal() == 2)
439  else // else if on EB
440  {
441  myGrid.setRadiusFactor(radiusFactorEB_);
442  }
443  //(end of) changed after tuning - Feb-July - Shilpi Jain
444 
445  myGrid.setPreshowerPresent(simulatePreshower_);
446 
447  // The shower simulation
448  myGrid.setTrackParameters(myPart.Vect().Unit(),X0depth,myTrack);
449 
450  // std::cout << " PS ECAL GAP HCAL X0 " << myGrid.ps1TotalX0()+myGrid.ps2TotalX0() << " " << myGrid.ecalTotalX0();
451  // std::cout << " " << myGrid.ecalHcalGapTotalX0() << " " << myGrid.hcalTotalX0() << std::endl;
452  // std::cout << " PS ECAL GAP HCAL L0 " << myGrid.ps1TotalL0()+myGrid.ps2TotalL0() << " " << myGrid.ecalTotalL0();
453  // std::cout << " " << myGrid.ecalHcalGapTotalL0() << " " << myGrid.hcalTotalL0() << std::endl;
454  // std::cout << "ECAL-HCAL " << myTrack.momentum().eta() << " " << myGrid.ecalHcalGapTotalL0() << std::endl;
455  //
456  // std::cout << " Grid created " << std::endl;
457  if(myPreshower) theShower.setPreshower(myPreshower);
458 
459  HcalHitMaker myHcalHitMaker(myGrid,(unsigned)0);
460 
461  theShower.setGrid(&myGrid);
462  theShower.setHcal(&myHcalHitMaker);
463  theShower.compute();
464  //myHistos->fill("h502", myPart->eta(),myGrid.totalX0());
465 
466  // calculate the total simulated energy for this particle
467  float simE = 0;
468  for( const auto& mapIterator : myGrid.getHits() ) {
469  simE += mapIterator.second;
470  }
471 
472  auto scale = ecalCorrection ? ecalCorrection->getScale( myTrack.ecalEntrance().e(),
473  std::abs( myTrack.ecalEntrance().eta() ), simE ) : 1.;
474 
475  // Save the hits !
476  updateECAL( myGrid.getHits(), onEcal,myTrack.id(), scale );
477 
478  // Now fill the HCAL hits
479  updateHCAL(myHcalHitMaker.getHits(),myTrack.id());
480 
481  // delete the preshower
482  if(myPreshower!=0) {
483  updatePreshower(myPreshower->getHits(),myTrack.id());
484  delete myPreshower;
485  // std::cout << " Deleting myPreshower " << std::endl;
486  }
487 
488 }
RawParticle myElec
A few pointers to save time.
const ECALProperties * ecalProperties(int onEcal) const
ECAL properties.
Definition: Calorimeter.cc:76
void updateHCAL(const std::map< CaloHitID, float > &hitMap, int trackID=0, float corr=1.0)
int onLayer2() const
Definition: FSimTrack.h:96
void updatePreshower(const std::map< CaloHitID, float > &hitMap, int trackID=0, float corr=1.0)
double radLenIncm() const
Radiation length in cm.
const RawParticle & layer1Entrance() const
The particle at Preshower Layer 1.
Definition: FSimTrack.h:127
#define NULL
Definition: scimark2.h:8
void updateECAL(const std::map< CaloHitID, float > &hitMap, int onEcal, int trackID=0, float corr=1.0)
TRandom random
Definition: MVATrainer.cc:138
const std::map< CaloHitID, float > & getHits()
const PreshowerLayer1Properties * layer1Properties(int onLayer1) const
Preshower Layer1 properties.
Definition: Calorimeter.cc:103
int onEcal() const
Definition: FSimTrack.h:101
const LandauFluctuationGenerator * aLandauGenerator
math::XYZVector XYZVector
const PreshowerLayer2Properties * layer2Properties(int onLayer2) const
Preshower Layer2 properties.
Definition: Calorimeter.cc:111
const HCALProperties * hcalProperties(int onHcal) const
HCAL properties.
Definition: Calorimeter.cc:87
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const RawParticle & ecalEntrance() const
The particle at ECAL entrance.
Definition: FSimTrack.h:133
std::vector< double > theTailIntervals_
CaloGeometryHelper * myCalorimeter_
std::vector< double > theCoreIntervals_
const XYZTLorentzVector & vertex() const
the vertex fourvector
Definition: RawParticle.h:285
Definition: DetId.h:18
GammaFunctionGenerator * aGammaGenerator
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
std::vector< double > mipValues_
math::XYZVector XYZPoint
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:25
int id() const
the index in FBaseSimEvent and other vectors
Definition: FSimTrack.h:86
const RawParticle & layer2Entrance() const
The particle at Preshower Layer 2.
Definition: FSimTrack.h:130
int onLayer1() const
Definition: FSimTrack.h:91
int onHcal() const
Definition: FSimTrack.h:106
double eta() const
Definition: RawParticle.h:267
const RawParticle & hcalEntrance() const
The particle at HCAL entrance.
Definition: FSimTrack.h:136
void setMipEnergy(double e1, double e2)
DetId getClosestCell(const XYZPoint &point, bool ecal, bool central) const
int weight
Definition: histoStyle.py:50
std::unique_ptr< KKCorrectionFactors > ecalCorrection
tuple size
Write out results.
void setVertex(const XYZTLorentzVector &vtx)
set the vertex
Definition: RawParticle.h:288
CaloGeometryHelper* CalorimetryManager::getCalorimeter ( ) const
inline

Definition at line 61 of file CalorimetryManager.h.

References myCalorimeter_.

Referenced by FamosManager::setupGeometryAndField().

61 {return myCalorimeter_;}
CaloGeometryHelper * myCalorimeter_
FastHFShowerLibrary* CalorimetryManager::getHFShowerLibrary ( ) const
inline

Definition at line 64 of file CalorimetryManager.h.

References theHFShowerLibrary.

Referenced by FamosManager::setupGeometryAndField().

64 {return theHFShowerLibrary;}
FastHFShowerLibrary * theHFShowerLibrary
void CalorimetryManager::HDShowerSimulation ( const FSimTrack myTrack,
RandomEngineAndDistribution const *  random 
)
private

Hadronic Shower Simulation.

Definition at line 554 of file CalorimetryManager.cc.

References funct::abs(), HcalHitMaker::addHit(), RecoTauCleanerPlugins::charge, FSimTrack::charge(), HFShower::compute(), HDShower::compute(), HDRShower::computeShower(), HCALResponse::correctHF(), debug_, FSimTrack::ecalEntrance(), Calorimeter::ecalProperties(), ecorr, Gflash::getCalorimeterNumber(), CaloGeometryHelper::getClosestCell(), CaloSubdetectorGeometry::getGeometry(), GflashHadronShowerProfile::getGflashHitList(), GflashHadronShowerProfile::getGflashShowino(), GflashTrajectory::getGflashTrajectoryPoint(), HCALResponse::getHCALEnergyResponse(), Calorimeter::getHcalGeometry(), GflashShowino::getHelix(), HcalHitMaker::getHits(), FastHFShowerLibrary::getHitsMap(), HDShower::getmip(), HCALResponse::getMIPfraction(), GflashShowino::getPathLengthAtShower(), GflashShowino::getPathLengthOnEcal(), CaloCellGeometry::getPosition(), GeV, GflashHadronShowerProfile::hadronicParameterization(), FSimTrack::hcalEntrance(), Calorimeter::hcalProperties(), hcorr, hdGridSize_, hdSimMethod_, FSimTrack::id(), GflashHadronShowerProfile::initialize(), Gflash::intLength, Gflash::kENCA, Gflash::kESPM, Gflash::kHB, Gflash::kHE, Gflash::kNULL, GflashHadronShowerProfile::loadParameters(), PV3DBase< T, PVType, FrameType >::mag(), bookConverter::max, FSimTrack::momentum(), myCalorimeter_, myHDResponse_, myHSParameters_, myPart, DetId::null(), FSimTrack::onEcal(), FSimTrack::onHcal(), FSimTrack::onVFcal(), optionHDSim_, HLT_25ns14e33_v1_cff::particleType, random, DetId::rawId(), FastHFShowerLibrary::recoHFShowerLibrary(), respCorr(), HCALResponse::responseHCAL(), HcalHitMaker::setDepth(), HcalHitMaker::setSpotEnergy(), EcalHitMaker::setTrackParameters(), ntuplemaker::status, theAntiProtonProfile, theHFShowerLibrary, thePiKProfile, theProfile, theProtonProfile, CoreSimTrack::type(), updateECAL(), updateHCAL(), useShowerLibrary, RawParticle::vertex(), and FSimTrack::vfcalEntrance().

Referenced by reconstruct().

554  {//,
555  // const edm::ParameterSet& fastCalo){
556 
557  // TimeMe t(" FASTEnergyReconstructor::HDShower");
558  XYZTLorentzVector moment = myTrack.momentum();
559 
560  if(debug_)
561  LogInfo("FastCalorimetry")
562  << "CalorimetryManager::HDShowerSimulation - track param."
563  << std::endl
564  << " eta = " << moment.eta() << std::endl
565  << " phi = " << moment.phi() << std::endl
566  << " et = " << moment.Et() << std::endl
567  << " e = " << myTrack.hcalEntrance().e() << std::endl;
568 
569  if (debug_) {
570  LogInfo("FastCalorimetry") << " HDShowerSimulation " << myTrack << std::endl;
571  }
572 
573 
574  int hit;
575  // int pid = abs(myTrack.type());
576 
577  XYZTLorentzVector trackPosition;
578  if ( myTrack.onEcal() ) {
579  trackPosition=myTrack.ecalEntrance().vertex();
580  hit = myTrack.onEcal()-1; //
581  myPart = myTrack.ecalEntrance();
582  } else if ( myTrack.onVFcal()) {
583  trackPosition=myTrack.vfcalEntrance().vertex();
584  hit = 2;
585  myPart = myTrack.vfcalEntrance();
586  }
587  else
588  {
589  LogInfo("FastCalorimetry") << " The particle is not in the acceptance " << std::endl;
590  return;
591  }
592 
593  // int onHCAL = hit + 1; - specially for myCalorimeter->hcalProperties(onHCAL)
594  // (below) to get VFcal properties ...
595  int onHCAL = hit + 1;
596  int onECAL = myTrack.onEcal();
597 
598  double pathEta = trackPosition.eta();
599  double pathPhi = trackPosition.phi();
600  // double pathTheta = trackPosition.theta();
601 
602  double eint = moment.e();
603  double eGen = myTrack.hcalEntrance().e();
604 
605  double emeas = 0.;
606  double pmip= myHDResponse_->getMIPfraction(eGen, pathEta);
607  // std::cout << " CalorimetryManager onHcal " << pmip << std::endl;
608 
609 
610  //double emeas = -0.000001;
611 
612  //===========================================================================
613  if(eGen > 0.) {
614 
615  // ECAL and HCAL properties to get
617  theHDShowerparam(myCalorimeter_->ecalProperties(onECAL),
620 
621  //Making ECAL Grid (and segments calculation)
622  XYZPoint caloentrance;
623  XYZVector direction;
624  if(myTrack.onEcal())
625  {
626  caloentrance = myTrack.ecalEntrance().vertex().Vect();
627  direction = myTrack.ecalEntrance().Vect().Unit();
628  }
629  else if(myTrack.onHcal())
630  {
631  caloentrance = myTrack.hcalEntrance().vertex().Vect();
632  direction = myTrack.hcalEntrance().Vect().Unit();
633  }
634  else
635  {
636  caloentrance = myTrack.vfcalEntrance().vertex().Vect();
637  direction = myTrack.vfcalEntrance().Vect().Unit();
638  }
639 
640  if(debug_)
641  LogInfo("FastCalorimetry")
642  << "CalorimetryManager::HDShowerSimulation - on-calo 1 "
643  << std::endl
644  << " onEcal = " << myTrack.onEcal() << std::endl
645  << " onHcal = " << myTrack.onHcal() << std::endl
646  << " onVFcal = " << myTrack.onVFcal() << std::endl
647  << " position = " << caloentrance << std::endl;
648 
649 
650  DetId pivot;
651  if(myTrack.onEcal())
652  {
653  pivot=myCalorimeter_->getClosestCell(caloentrance,
654  true, myTrack.onEcal()==1);
655  }
656  else if(myTrack.onHcal())
657  {
658  // std::cout << " CalorimetryManager onHcal " << myTrack.onHcal() << " caloentrance" << caloentrance << std::endl;
659  pivot=myCalorimeter_->getClosestCell(caloentrance,
660  false, false);
661  }
662 
663  EcalHitMaker myGrid(myCalorimeter_,caloentrance,pivot,
664  pivot.null()? 0 : myTrack.onEcal(),hdGridSize_,1,
665  random);
666  // 1=HAD shower
667 
668  myGrid.setTrackParameters(direction,0,myTrack);
669  // Build the FAMOS HCAL
670  HcalHitMaker myHcalHitMaker(myGrid,(unsigned)1);
671 
672  // Shower simulation
673  bool status = false;
674  int mip = 2;
675  // Use HFShower for HF
676  if ( !myTrack.onEcal() && !myTrack.onHcal() ) {
677  // std::cout << "CalorimetryManager::HDShowerSimulation(): track entrance = "
678  // << myTrack.vfcalEntrance().vertex().X() << " "
679  // << myTrack.vfcalEntrance().vertex().Y() << " "
680  // << myTrack.vfcalEntrance().vertex().Z() << " "
681  // << " , Energy (Gen/Scale) = " << eGen << " " << e << std::endl;
682 
683  // Warning : We give here the particle energy with the response
684  // but without the resolution/gaussian smearing
685  // For HF, the resolution is due to the PE statistic
686 
687  if(useShowerLibrary) {
689  status = true;
690  } else {
691  HFShower theShower(random,
692  &theHDShowerparam,
693  &myGrid,
694  &myHcalHitMaker,
695  onECAL,
696  eGen);
697  // eGen);
698  // e); // PV Warning : temporarly set the energy to the generated E
699 
700  status = theShower.compute();
701  }
702  } else {
703  if(hdSimMethod_ == 0) {
704  HDShower theShower(random,
705  &theHDShowerparam,
706  &myGrid,
707  &myHcalHitMaker,
708  onECAL,
709  eGen,
710  pmip);
711  status = theShower.compute();
712  mip = theShower.getmip();
713  }
714  else if (hdSimMethod_ == 1) {
715  HDRShower theShower(random,
716  &theHDShowerparam,
717  &myGrid,
718  &myHcalHitMaker,
719  onECAL,
720  eGen);
721  status = theShower.computeShower();
722  mip = 2;
723  }
724  else if (hdSimMethod_ == 2 ) {
725  // std::cout << "Using GflashHadronShowerProfile hdSimMethod_ == 2" << std::endl;
726 
727  //dynamically loading a corresponding profile by the particle type
728  int particleType = myTrack.type();
730  if(particleType == -2212) theProfile = theAntiProtonProfile;
731  else if(particleType == 2212) theProfile = theProtonProfile;
732 
733  //input variables for GflashHadronShowerProfile
734  int showerType = 99 + myTrack.onEcal();
735  double globalTime = 150.0; // a temporary reference hit time in nanosecond
736  float charge = (float)(myTrack.charge());
737  Gflash3Vector gfpos(trackPosition.X(),trackPosition.Y(),trackPosition.Z());
738  Gflash3Vector gfmom(moment.X(),moment.Y(),moment.Z());
739 
740  theProfile->initialize(showerType,eGen,globalTime,charge,gfpos,gfmom);
743 
744  //make hits
745  std::vector<GflashHit>& gflashHitList = theProfile->getGflashHitList();
746  std::vector<GflashHit>::const_iterator spotIter = gflashHitList.begin();
747  std::vector<GflashHit>::const_iterator spotIterEnd = gflashHitList.end();
748 
750 
751  for( ; spotIter != spotIterEnd; spotIter++){
752 
753  double pathLength = theProfile->getGflashShowino()->getPathLengthAtShower()
754  + (30*100/eGen)*(spotIter->getTime() - globalTime);
755 
756  double currentDepth = std::max(0.0,pathLength - theProfile->getGflashShowino()->getPathLengthOnEcal());
757 
758  //find the the showino position at the currentDepth
759  GflashTrajectoryPoint trajectoryPoint;
760  theProfile->getGflashShowino()->getHelix()->getGflashTrajectoryPoint(trajectoryPoint,pathLength);
761  Gflash3Vector positionAtCurrentDepth = trajectoryPoint.getPosition();
762  //find radial distrance
763  Gflash3Vector lateralDisplacement = positionAtCurrentDepth - spotIter->getPosition()/CLHEP::cm;
764  double rShower = lateralDisplacement.r();
765  double azimuthalAngle = lateralDisplacement.phi();
766 
767  whichCalor = Gflash::getCalorimeterNumber(positionAtCurrentDepth);
768 
769  if(whichCalor==Gflash::kESPM || whichCalor==Gflash::kENCA) {
770  bool statusPad = myGrid.getPads(currentDepth,true);
771  if(!statusPad) continue;
772  myGrid.setSpotEnergy(1.2*spotIter->getEnergy()/CLHEP::GeV);
773  myGrid.addHit(rShower/Gflash::intLength[Gflash::kESPM],azimuthalAngle,0);
774  }
775  else if(whichCalor==Gflash::kHB || whichCalor==Gflash::kHE) {
776  bool setHDdepth = myHcalHitMaker.setDepth(currentDepth,true);
777  if(!setHDdepth) continue;
778  myHcalHitMaker.setSpotEnergy(1.4*spotIter->getEnergy()/CLHEP::GeV);
779  myHcalHitMaker.addHit(rShower/Gflash::intLength[Gflash::kHB],azimuthalAngle,0);
780  }
781  }
782  status = true;
783  }
784  else {
785  edm::LogInfo("FastSimulationCalorimetry") << " SimMethod " << hdSimMethod_ <<" is NOT available ";
786  }
787  }
788 
789 
790  if(status) {
791 
792  // Here to switch between simple formulae and parameterized response
793  if(optionHDSim_ == 1) {
794  emeas = myHDResponse_->getHCALEnergyResponse(eGen, hit, random);
795  }
796  else { // optionHDsim == 2
797  emeas = myHDResponse_->responseHCAL(mip, eGen, pathEta, 1, random); // 1=hadron
798  }
799 
800  double correction = emeas / eGen;
801 
802  // RespCorrP factors (ECAL and HCAL separately) calculation
803  respCorr(eint);
804 
805  if(debug_)
806  LogInfo("FastCalorimetry")
807  << "CalorimetryManager::HDShowerSimulation - on-calo 2" << std::endl
808  << " eta = " << pathEta << std::endl
809  << " phi = " << pathPhi << std::endl
810  << " Egen = " << eGen << std::endl
811  << " Emeas = " << emeas << std::endl
812  << " corr = " << correction << std::endl
813  << " mip = " << mip << std::endl;
814 
815  if(myTrack.onEcal() > 0) {
816  // Save ECAL hits
817  updateECAL(myGrid.getHits(),onECAL,myTrack.id(),correction*ecorr);
818  }
819 
820  // Save HCAL hits
821  if(myTrack.onVFcal() && useShowerLibrary) {
822  myHDResponse_->correctHF(eGen,abs(myTrack.type()));
824  }
825  else
826  updateHCAL(myHcalHitMaker.getHits(),myTrack.id(),correction*hcorr);
827 
828  }
829  else { // shower simulation failed
830  // std::cout << " Shower simulation failed " << trackPosition.Vect() << std::endl;
831  // std::cout << " The FSimTrack " << myTrack << std::endl;
832  // std::cout << " HF entrance on VFcal" << myTrack.onVFcal() << std::endl;
833  // std::cout << " trackPosition.eta() " << trackPosition.eta() << std::endl;
834  if(myTrack.onHcal() || myTrack.onVFcal())
835  {
836  DetId cell = myCalorimeter_->getClosestCell(trackPosition.Vect(),false,false);
837  double tof = (myCalorimeter_->getHcalGeometry()->getGeometry(cell)->getPosition().mag())/29.98;//speed of light
838  CaloHitID current_id(cell.rawId(),tof,myTrack.id());
839  std::map<CaloHitID,float> hitMap;
840  hitMap[current_id] = emeas;
841  updateHCAL(hitMap,myTrack.id());
842  if(debug_)
843  LogInfo("FastCalorimetry") << " HCAL simple cell "
844  << cell.rawId() << " added E = "
845  << emeas << std::endl;
846  }
847  }
848 
849  } // e > 0. ...
850 
851  if(debug_)
852  LogInfo("FastCalorimetry") << std::endl << " FASTEnergyReconstructor::HDShowerSimulation finished "
853  << std::endl;
854 }
float charge() const
charge
Definition: FSimTrack.h:47
const double GeV
Definition: MathUtil.h:16
const ECALProperties * ecalProperties(int onEcal) const
ECAL properties.
Definition: Calorimeter.cc:76
double responseHCAL(int _mip, double energy, double eta, int partype, RandomEngineAndDistribution const *)
const RawParticle & vfcalEntrance() const
The particle at VFCAL entrance.
Definition: FSimTrack.h:139
void updateHCAL(const std::map< CaloHitID, float > &hitMap, int trackID=0, float corr=1.0)
GflashPiKShowerProfile * thePiKProfile
GflashTrajectory * getHelix()
Definition: GflashShowino.h:30
void recoHFShowerLibrary(const FSimTrack &myTrack)
const XYZTLorentzVector & momentum() const
Temporary (until move of SimTrack to Mathcore) - No! Actually very useful.
Definition: FSimTrack.h:190
double getHCALEnergyResponse(double e, int hit, RandomEngineAndDistribution const *)
GflashHadronShowerProfile * theProfile
void correctHF(double e, int type)
void updateECAL(const std::map< CaloHitID, float > &hitMap, int onEcal, int trackID=0, float corr=1.0)
const CaloSubdetectorGeometry * getHcalGeometry() const
Definition: Calorimeter.h:57
TRandom random
Definition: MVATrainer.cc:138
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
int onEcal() const
Definition: FSimTrack.h:101
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
T mag() const
Definition: PV3DBase.h:67
CalorimeterNumber getCalorimeterNumber(const Gflash3Vector &position)
GflashAntiProtonShowerProfile * theAntiProtonProfile
math::XYZVector XYZVector
GflashProtonShowerProfile * theProtonProfile
double getPathLengthAtShower()
Definition: GflashShowino.h:26
void setTrackParameters(const XYZNormal &normal, double X0depthoffset, const FSimTrack &theTrack)
const HCALProperties * hcalProperties(int onHcal) const
HCAL properties.
Definition: Calorimeter.cc:87
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double getMIPfraction(double energy, double eta)
const RawParticle & ecalEntrance() const
The particle at ECAL entrance.
Definition: FSimTrack.h:133
int onVFcal() const
Definition: FSimTrack.h:111
HCALResponse * myHDResponse_
CaloGeometryHelper * myCalorimeter_
const double intLength[kNumberCalorimeter]
void getGflashTrajectoryPoint(GflashTrajectoryPoint &point, double s) const
const XYZTLorentzVector & vertex() const
the vertex fourvector
Definition: RawParticle.h:285
Definition: DetId.h:18
CLHEP::Hep3Vector Gflash3Vector
Definition: Gflash3Vector.h:6
bool null() const
is this a null id ?
Definition: DetId.h:45
double getPathLengthOnEcal()
Definition: GflashShowino.h:25
math::XYZVector XYZPoint
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:25
int id() const
the index in FBaseSimEvent and other vectors
Definition: FSimTrack.h:86
const std::map< CaloHitID, float > & getHitsMap()
std::vector< GflashHit > & getGflashHitList()
int onHcal() const
Definition: FSimTrack.h:106
const RawParticle & hcalEntrance() const
The particle at HCAL entrance.
Definition: FSimTrack.h:136
FastHFShowerLibrary * theHFShowerLibrary
DetId getClosestCell(const XYZPoint &point, bool ecal, bool central) const
tuple status
Definition: ntuplemaker.py:245
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
HSParameters * myHSParameters_
void initialize(int showerType, double energy, double globalTime, double charge, Gflash3Vector &position, Gflash3Vector &momentum)
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:15
void CalorimetryManager::loadFromEcalBarrel ( edm::PCaloHitContainer c) const

Definition at line 1355 of file CalorimetryManager.cc.

References EBMapping_, plotBeamSpotDB::first, i, edm::second(), and EBDetId::unhashIndex().

1356 {
1357  c.reserve(c.size()+EBMapping_.size());
1358  for(unsigned i=0; i<EBMapping_.size(); i++) {
1359  c.push_back(PCaloHit(EBDetId::unhashIndex(EBMapping_[i].first.unitID()),EBMapping_[i].second,EBMapping_[i].first.timeSlice(),EBMapping_[i].first.trackID()));
1360  }
1361 }
int i
Definition: DBlmapReader.cc:9
std::vector< std::pair< CaloHitID, float > > EBMapping_
U second(std::pair< T, U > const &p)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:114
void CalorimetryManager::loadFromEcalEndcap ( edm::PCaloHitContainer c) const

Definition at line 1363 of file CalorimetryManager.cc.

References EEMapping_, plotBeamSpotDB::first, i, edm::second(), and EEDetId::unhashIndex().

1364 {
1365  c.reserve(c.size()+EEMapping_.size());
1366  for(unsigned i=0; i<EEMapping_.size(); i++) {
1367  c.push_back(PCaloHit(EEDetId::unhashIndex(EEMapping_[i].first.unitID()),EEMapping_[i].second,EEMapping_[i].first.timeSlice(),EEMapping_[i].first.trackID()));
1368  }
1369 }
int i
Definition: DBlmapReader.cc:9
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:99
U second(std::pair< T, U > const &p)
std::vector< std::pair< CaloHitID, float > > EEMapping_
void CalorimetryManager::loadFromHcal ( edm::PCaloHitContainer c) const

Definition at line 1371 of file CalorimetryManager.cc.

References plotBeamSpotDB::first, HMapping_, i, and edm::second().

1372 {
1373  c.reserve(c.size()+HMapping_.size());
1374  for(unsigned i=0; i<HMapping_.size(); i++) {
1375  c.push_back(PCaloHit(DetId(HMapping_[i].first.unitID()),HMapping_[i].second,HMapping_[i].first.timeSlice(),HMapping_[i].first.trackID()));
1376  }
1377 }
int i
Definition: DBlmapReader.cc:9
U second(std::pair< T, U > const &p)
Definition: DetId.h:18
std::vector< std::pair< CaloHitID, float > > HMapping_
void CalorimetryManager::loadFromPreshower ( edm::PCaloHitContainer c) const

Definition at line 1380 of file CalorimetryManager.cc.

References ESMapping_, plotBeamSpotDB::first, and i.

1381 {
1382  c.reserve(c.size()+ESMapping_.size());
1383  for(unsigned i=0; i<ESMapping_.size(); i++) {
1384  c.push_back(PCaloHit(ESMapping_[i].first.unitID(),ESMapping_[i].second,ESMapping_[i].first.timeSlice(),ESMapping_[i].first.trackID()));
1385  }
1386 }
int i
Definition: DBlmapReader.cc:9
std::vector< std::pair< CaloHitID, float > > ESMapping_
void CalorimetryManager::loadMuonSimTracks ( edm::SimTrackContainer m) const

Definition at line 1390 of file CalorimetryManager.cc.

References funct::abs(), i, muonSimTracks, and findQualityFiles::size.

1391 {
1392  unsigned size=muons.size();
1393  for(unsigned i=0; i<size;++i)
1394  {
1395  int id=muons[i].trackId();
1396  if(abs(muons[i].type())!=13) continue;
1397  // identify the corresponding muon in the local collection
1398 
1399  std::vector<FSimTrack>::const_iterator itcheck=find_if(muonSimTracks.begin(),muonSimTracks.end(),FSimTrackEqual(id));
1400  if(itcheck!=muonSimTracks.end())
1401  {
1402  muons[i].setTkPosition(itcheck->trackerSurfacePosition());
1403  muons[i].setTkMomentum(itcheck->trackerSurfaceMomentum());
1404  // std::cout << " Found the SimTrack " << std::endl;
1405  // std::cout << *itcheck << std::endl;
1406  // std::cout << "SimTrack Id "<< id << " " << muons[i] << " " << std::endl;
1407  }
1408  // else
1409  // {
1410  // std::cout << " Calorimetery Manager : this should really not happen " << std::endl;
1411  // std::cout << " Was looking for " << id << " " << muons[i] << std::endl;
1412  // for(unsigned i=0;i<muonSimTracks.size();++i)
1413  // std::cout << muonSimTracks[i] << std::endl;
1414  // }
1415  }
1416 
1417 }
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
std::vector< FSimTrack > muonSimTracks
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
tuple muons
Definition: patZpeak.py:38
tuple size
Write out results.
void CalorimetryManager::MuonMipSimulation ( const FSimTrack myTrack,
RandomEngineAndDistribution const *  random 
)
private

// /// TEMPORARY First attempt to include HCAL (with straight-line extrapolation):

Definition at line 857 of file CalorimetryManager.cc.

References HcalHitMaker::addHit(), RecoTauCleanerPlugins::charge, FSimTrack::charge(), debug_, EnergyLossSimulator::deltaMom(), FSimTrack::ecalEntrance(), relval_parameters_module::energy, MaterialEffects::energyLossSimulator(), CaloGeometryHelper::getClosestCell(), HcalHitMaker::getHits(), CaloSegment::HCAL, FSimTrack::hcalEntrance(), hdGridSize_, FSimTrack::id(), FSimTrack::momentum(), muonSimTracks, myCalorimeter_, myPart, DetId::null(), FSimTrack::onEcal(), FSimTrack::onHcal(), FSimTrack::onVFcal(), CaloSegment::PbWO4, random, reconstructHCAL(), RawParticle::setID(), HcalHitMaker::setSpotEnergy(), SimTrack::setTkMomentum(), SimTrack::setTkPosition(), EcalHitMaker::setTrackParameters(), theMuonEcalEffects, theMuonHcalEffects, updateECAL(), updateHCAL(), MaterialEffectsSimulator::updateState(), RawParticle::vertex(), and FSimTrack::vfcalEntrance().

Referenced by reconstruct().

858 {
859  // TimeMe t(" FASTEnergyReconstructor::HDShower");
860  XYZTLorentzVector moment = myTrack.momentum();
861 
862  // Backward compatibility behaviour
863  if(!theMuonHcalEffects)
864  {
865  if(myTrack.onHcal() || myTrack.onVFcal() )
866  reconstructHCAL(myTrack, random);
867 
868  return;
869  }
870 
871  if(debug_)
872  LogInfo("FastCalorimetry") << "CalorimetryManager::MuonMipSimulation - track param."
873  << std::endl
874  << " eta = " << moment.eta() << std::endl
875  << " phi = " << moment.phi() << std::endl
876  << " et = " << moment.Et() << std::endl;
877 
878  // int hit;
879  // int pid = abs(myTrack.type());
880 
881  XYZTLorentzVector trackPosition;
882  if ( myTrack.onEcal() ) {
883  trackPosition=myTrack.ecalEntrance().vertex();
884  // hit = myTrack.onEcal()-1; //
885  myPart = myTrack.ecalEntrance();
886  } else if ( myTrack.onVFcal()) {
887  trackPosition=myTrack.vfcalEntrance().vertex();
888  // hit = 2;
889  myPart = myTrack.vfcalEntrance();
890  }
891  else
892  {
893  LogInfo("FastCalorimetry") << " The particle is not in the acceptance " << std::endl;
894  return;
895  }
896 
897  // int onHCAL = hit + 1; - specially for myCalorimeter->hcalProperties(onHCAL)
898  // (below) to get VFcal properties ...
899  // not needed ?
900  // int onHCAL = hit + 1;
901  int onECAL = myTrack.onEcal();
902 
903  // double pathEta = trackPosition.eta();
904  // double pathPhi = trackPosition.phi();
905  // double pathTheta = trackPosition.theta();
906 
907  //===========================================================================
908 
909  // ECAL and HCAL properties to get
910 
911  //Making ECAL Grid (and segments calculation)
912  XYZPoint caloentrance;
913  XYZVector direction;
914  if(myTrack.onEcal())
915  {
916  caloentrance = myTrack.ecalEntrance().vertex().Vect();
917  direction = myTrack.ecalEntrance().Vect().Unit();
918  }
919  else if(myTrack.onHcal())
920  {
921  caloentrance = myTrack.hcalEntrance().vertex().Vect();
922  direction = myTrack.hcalEntrance().Vect().Unit();
923  }
924  else
925  {
926  caloentrance = myTrack.vfcalEntrance().vertex().Vect();
927  direction = myTrack.vfcalEntrance().Vect().Unit();
928  }
929 
930  DetId pivot;
931  if(myTrack.onEcal())
932  {
933  pivot=myCalorimeter_->getClosestCell(caloentrance,
934  true, myTrack.onEcal()==1);
935  }
936  else if(myTrack.onHcal())
937  {
938  // std::cout << " CalorimetryManager onHcal " << myTrack.onHcal() << " caloentrance" << caloentrance << std::endl;
939  pivot=myCalorimeter_->getClosestCell(caloentrance,
940  false, false);
941  }
942 
943  EcalHitMaker myGrid(myCalorimeter_,caloentrance,pivot,
944  pivot.null()? 0 : myTrack.onEcal(),hdGridSize_,0,
945  random);
946  // 0 =EM shower -> Unit = X0
947 
948  myGrid.setTrackParameters(direction,0,myTrack);
949 
950  // Now get the path in the Preshower, ECAL and HCAL along a straight line extrapolation
951  // but only those in the ECAL are used
952 
953  const std::vector<CaloSegment>& segments=myGrid.getSegments();
954  unsigned nsegments=segments.size();
955 
956  int ifirstHcal=-1;
957  int ilastEcal=-1;
958 
959  EnergyLossSimulator* energyLossECAL = 0;
961  // // Muon brem in ECAL
962  // MuonBremsstrahlungSimulator* muonBremECAL = 0;
963  // if (theMuonEcalEffects) muonBremECAL = theMuonEcalEffects->muonBremsstrahlungSimulator();
964 
965  for(unsigned iseg=0;iseg<nsegments&&ifirstHcal<0;++iseg)
966  {
967 
968  // in the ECAL, there are two types of segments: PbWO4 and GAP
969  float segmentSizeinX0=segments[iseg].X0length();
970 
971  // Martijn - insert your computations here
972  float energy=0.0;
973  if (segmentSizeinX0>0.001 && segments[iseg].material()==CaloSegment::PbWO4 ) {
974  // The energy loss simulator
975  float charge = (float)(myTrack.charge());
976  ParticlePropagator theMuon(moment,trackPosition,charge,0);
977  theMuon.setID(-(int)charge*13);
978  if ( energyLossECAL ) {
979  energyLossECAL->updateState(theMuon, segmentSizeinX0, random);
980  energy = energyLossECAL->deltaMom().E();
981  moment -= energyLossECAL->deltaMom();
982  }
983  }
984  // that's all for ECAL, Florian
985  // Save the hit only if it is a crystal
986  if(segments[iseg].material()==CaloSegment::PbWO4)
987  {
988  myGrid.getPads(segments[iseg].sX0Entrance()+segmentSizeinX0*0.5);
989  myGrid.setSpotEnergy(energy);
990  myGrid.addHit(0.,0.);
991  ilastEcal=iseg;
992  }
993  // Check for end of loop:
994  if(segments[iseg].material()==CaloSegment::HCAL)
995  {
996  ifirstHcal=iseg;
997  }
998  }
999 
1000 
1001  // Build the FAMOS HCAL
1002  HcalHitMaker myHcalHitMaker(myGrid,(unsigned)2);
1003  // float mipenergy=0.1;
1004  // Create the helix with the stepping helix propagator
1005  // to add a hit, just do
1006  // myHcalHitMaker.setSpotEnergy(mipenergy);
1007  // math::XYZVector hcalEntrance;
1008  // if(ifirstHcal>=0) hcalEntrance=segments[ifirstHcal].entrance();
1009  // myHcalHitMaker.addHit(hcalEntrance);
1013  int ilastHcal=-1;
1014  float mipenergy=0.0;
1015 
1016  EnergyLossSimulator* energyLossHCAL = 0;
1018  // // Muon Brem effect
1019  // MuonBremsstrahlungSimulator* muonBremHCAL = 0;
1020  // if (theMuonHcalEffects) muonBremHCAL = theMuonHcalEffects->muonBremsstrahlungSimulator();
1021 
1022  if(ifirstHcal>0 && energyLossHCAL){
1023  for(unsigned iseg=ifirstHcal;iseg<nsegments;++iseg)
1024  {
1025  float segmentSizeinX0=segments[iseg].X0length();
1026  if(segments[iseg].material()==CaloSegment::HCAL) {
1027  ilastHcal=iseg;
1028  if (segmentSizeinX0>0.001) {
1029  // The energy loss simulator
1030  float charge = (float)(myTrack.charge());
1031  ParticlePropagator theMuon(moment,trackPosition,charge,0);
1032  theMuon.setID(-(int)charge*13);
1033  energyLossHCAL->updateState(theMuon, segmentSizeinX0, random);
1034  mipenergy = energyLossHCAL->deltaMom().E();
1035  moment -= energyLossHCAL->deltaMom();
1036  myHcalHitMaker.setSpotEnergy(mipenergy);
1037  myHcalHitMaker.addHit(segments[iseg].entrance());
1038  }
1039  }
1040  }
1041  }
1042 
1047  //
1048 
1049 
1050 
1051  // Copy the muon SimTrack (Only for Energy loss)
1052  FSimTrack muonTrack(myTrack);
1053  if(energyLossHCAL && ilastHcal>=0) {
1054  math::XYZVector hcalExit=segments[ilastHcal].exit();
1055  muonTrack.setTkPosition(hcalExit);
1056  muonTrack.setTkMomentum(moment);
1057  } else if(energyLossECAL && ilastEcal>=0) {
1058  math::XYZVector ecalExit=segments[ilastEcal].exit();
1059  muonTrack.setTkPosition(ecalExit);
1060  muonTrack.setTkMomentum(moment);
1061  } // else just leave tracker surface position and momentum...
1062 
1063  muonSimTracks.push_back(muonTrack);
1064 
1065 
1066  // no need to change below this line
1067  std::map<CaloHitID,float>::const_iterator mapitr;
1068  std::map<CaloHitID,float>::const_iterator endmapitr;
1069  if(myTrack.onEcal() > 0) {
1070  // Save ECAL hits
1071  updateECAL(myGrid.getHits(),onECAL,myTrack.id());
1072  }
1073 
1074  // Save HCAL hits
1075  updateHCAL(myHcalHitMaker.getHits(),myTrack.id());
1076 
1077  if(debug_)
1078  LogInfo("FastCalorimetry") << std::endl << " FASTEnergyReconstructor::MipShowerSimulation finished "
1079  << std::endl;
1080 }
float charge() const
charge
Definition: FSimTrack.h:47
void reconstructHCAL(const FSimTrack &myTrack, RandomEngineAndDistribution const *)
const RawParticle & vfcalEntrance() const
The particle at VFCAL entrance.
Definition: FSimTrack.h:139
void updateHCAL(const std::map< CaloHitID, float > &hitMap, int trackID=0, float corr=1.0)
MaterialEffects * theMuonEcalEffects
MaterialEffects * theMuonHcalEffects
const XYZTLorentzVector & momentum() const
Temporary (until move of SimTrack to Mathcore) - No! Actually very useful.
Definition: FSimTrack.h:190
void updateState(ParticlePropagator &myTrack, double radlen, RandomEngineAndDistribution const *)
Compute the material effect (calls the sub class)
void updateECAL(const std::map< CaloHitID, float > &hitMap, int onEcal, int trackID=0, float corr=1.0)
TRandom random
Definition: MVATrainer.cc:138
int onEcal() const
Definition: FSimTrack.h:101
std::vector< FSimTrack > muonSimTracks
math::XYZVector XYZVector
void setTrackParameters(const XYZNormal &normal, double X0depthoffset, const FSimTrack &theTrack)
const XYZTLorentzVector & deltaMom() const
Returns the actual energy lost.
const RawParticle & ecalEntrance() const
The particle at ECAL entrance.
Definition: FSimTrack.h:133
int onVFcal() const
Definition: FSimTrack.h:111
CaloGeometryHelper * myCalorimeter_
const XYZTLorentzVector & vertex() const
the vertex fourvector
Definition: RawParticle.h:285
Definition: DetId.h:18
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
bool null() const
is this a null id ?
Definition: DetId.h:45
math::XYZVector XYZPoint
int id() const
the index in FBaseSimEvent and other vectors
Definition: FSimTrack.h:86
int onHcal() const
Definition: FSimTrack.h:106
const RawParticle & hcalEntrance() const
The particle at HCAL entrance.
Definition: FSimTrack.h:136
DetId getClosestCell(const XYZPoint &point, bool ecal, bool central) const
EnergyLossSimulator * energyLossSimulator() const
Return the Energy Loss engine.
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:15
void CalorimetryManager::readParameters ( const edm::ParameterSet fastCalo)
private

Definition at line 1083 of file CalorimetryManager.cc.

References aTerm, bFixedLength_, bTerm, crackPadSurvivalProbability_, debug_, EcalDigitizer_, evtsToDebug_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), gridSize_, HcalDigitizer_, hdGridSize_, hdSimMethod_, i, ietaShiftHB_, ietaShiftHE_, ietaShiftHF_, ietaShiftHO_, k_e, k_h, mipValues_, optionHDSim_, p_knots, pulledPadSurvivalProbability_, radiusFactorEB_, radiusFactorEE_, radiusPreshowerCorrections_, RCFactor_, rsp, RTFactor_, samplingHBHE_, samplingHF_, samplingHO_, simulatePreshower_, spotFraction_, theCoreIntervals_, theTailIntervals_, timeShiftHB_, timeShiftHE_, timeShiftHF_, timeShiftHO_, useCorrectionSL, and useShowerLibrary.

Referenced by CalorimetryManager().

1083  {
1084 
1085  edm::ParameterSet ECALparameters = fastCalo.getParameter<edm::ParameterSet>("ECAL");
1086 
1087  evtsToDebug_ = fastCalo.getUntrackedParameter<std::vector<unsigned int> >("EvtsToDebug",std::vector<unsigned>());
1088  debug_ = fastCalo.getUntrackedParameter<bool>("Debug");
1089 
1090  bFixedLength_ = ECALparameters.getParameter<bool>("bFixedLength");
1091  // std::cout << "bFixedLength_ = " << bFixedLength_ << std::endl;
1092 
1093  gridSize_ = ECALparameters.getParameter<int>("GridSize");
1094  spotFraction_ = ECALparameters.getParameter<double>("SpotFraction");
1095  pulledPadSurvivalProbability_ = ECALparameters.getParameter<double>("FrontLeakageProbability");
1096  crackPadSurvivalProbability_ = ECALparameters.getParameter<double>("GapLossProbability");
1097  theCoreIntervals_ = ECALparameters.getParameter<std::vector<double> >("CoreIntervals");
1098  theTailIntervals_ = ECALparameters.getParameter<std::vector<double> >("TailIntervals");
1099 
1100  RCFactor_ = ECALparameters.getParameter<double>("RCFactor");
1101  RTFactor_ = ECALparameters.getParameter<double>("RTFactor");
1102  //changed after tuning - Feb-July - Shilpi Jain
1103  // radiusFactor_ = ECALparameters.getParameter<double>("RadiusFactor");
1104  radiusFactorEE_ = ECALparameters.getParameter<double>("RadiusFactorEE");
1105  radiusFactorEB_ = ECALparameters.getParameter<double>("RadiusFactorEB");
1106  //(end of) changed after tuning - Feb-July - Shilpi Jain
1107  radiusPreshowerCorrections_ = ECALparameters.getParameter<std::vector<double> >("RadiusPreshowerCorrections");
1110  mipValues_ = ECALparameters.getParameter<std::vector<double> >("MipsinGeV");
1111  simulatePreshower_ = ECALparameters.getParameter<bool>("SimulatePreshower");
1112 
1113  if(gridSize_ <1) gridSize_= 7;
1114  if(pulledPadSurvivalProbability_ <0. || pulledPadSurvivalProbability_>1 ) pulledPadSurvivalProbability_= 1.;
1115  if(crackPadSurvivalProbability_ <0. || crackPadSurvivalProbability_>1 ) crackPadSurvivalProbability_= 0.9;
1116 
1117  LogInfo("FastCalorimetry") << " Fast ECAL simulation parameters " << std::endl;
1118  LogInfo("FastCalorimetry") << " =============================== " << std::endl;
1119  if(simulatePreshower_)
1120  LogInfo("FastCalorimetry") << " The preshower is present " << std::endl;
1121  else
1122  LogInfo("FastCalorimetry") << " The preshower is NOT present " << std::endl;
1123  LogInfo("FastCalorimetry") << " Grid Size : " << gridSize_ << std::endl;
1124  if(spotFraction_>0.)
1125  LogInfo("FastCalorimetry") << " Spot Fraction : " << spotFraction_ << std::endl;
1126  else
1127  {
1128  LogInfo("FastCalorimetry") << " Core of the shower " << std::endl;
1129  for(unsigned ir=0; ir < theCoreIntervals_.size()/2;++ir)
1130  {
1131  LogInfo("FastCalorimetry") << " r < " << theCoreIntervals_[ir*2] << " R_M : " << theCoreIntervals_[ir*2+1] << " ";
1132  }
1133  LogInfo("FastCalorimetry") << std::endl;
1134 
1135  LogInfo("FastCalorimetry") << " Tail of the shower " << std::endl;
1136  for(unsigned ir=0; ir < theTailIntervals_.size()/2;++ir)
1137  {
1138  LogInfo("FastCalorimetry") << " r < " << theTailIntervals_[ir*2] << " R_M : " << theTailIntervals_[ir*2+1] << " ";
1139  }
1140  //changed after tuning - Feb-July - Shilpi Jain
1141  // LogInfo("FastCalorimetry") << "Radius correction factor " << radiusFactor_ << std::endl;
1142  LogInfo("FastCalorimetry") << "Radius correction factors: EB & EE " << radiusFactorEB_ << " : "<< radiusFactorEE_ << std::endl;
1143  //(end of) changed after tuning - Feb-July - Shilpi Jain
1144  LogInfo("FastCalorimetry") << std::endl;
1145  if(mipValues_.size()>2) {
1146  LogInfo("FastCalorimetry") << "Improper number of parameters for the preshower ; using 95keV" << std::endl;
1147  mipValues_.clear();
1148  mipValues_.resize(2,0.000095);
1149  }
1150  }
1151 
1152  LogInfo("FastCalorimetry") << " FrontLeakageProbability : " << pulledPadSurvivalProbability_ << std::endl;
1153  LogInfo("FastCalorimetry") << " GapLossProbability : " << crackPadSurvivalProbability_ << std::endl;
1154 
1155 
1156  // RespCorrP: p (momentum), ECAL and HCAL corrections = f(p)
1157  edm::ParameterSet CalorimeterParam = fastCalo.getParameter<edm::ParameterSet>("CalorimeterProperties");
1158 
1159  rsp = CalorimeterParam.getParameter<std::vector<double> >("RespCorrP");
1160  LogInfo("FastCalorimetry") << " RespCorrP (rsp) size " << rsp.size() << std::endl;
1161 
1162  if( rsp.size()%3 !=0 ) {
1163  LogInfo("FastCalorimetry")
1164  << " RespCorrP size is wrong -> no corrections applied !!!"
1165  << std::endl;
1166 
1167  p_knots.push_back(14000.);
1168  k_e.push_back (1.);
1169  k_h.push_back (1.);
1170  }
1171  else {
1172  for(unsigned i = 0; i < rsp.size(); i += 3) {
1173  LogInfo("FastCalorimetry") << "i = " << i/3 << " p = " << rsp [i]
1174  << " k_e(p) = " << rsp[i+1]
1175  << " k_e(p) = " << rsp[i+2] << std::endl;
1176 
1177  p_knots.push_back(rsp[i]);
1178  k_e.push_back (rsp[i+1]);
1179  k_h.push_back (rsp[i+2]);
1180  }
1181  }
1182 
1183 
1184  //FR
1185  edm::ParameterSet HCALparameters = fastCalo.getParameter<edm::ParameterSet>("HCAL");
1186  optionHDSim_ = HCALparameters.getParameter<int>("SimOption");
1187  hdGridSize_ = HCALparameters.getParameter<int>("GridSize");
1188  hdSimMethod_ = HCALparameters.getParameter<int>("SimMethod");
1189  //RF
1190 
1191  EcalDigitizer_ = ECALparameters.getUntrackedParameter<bool>("Digitizer",false);
1192  HcalDigitizer_ = HCALparameters.getUntrackedParameter<bool>("Digitizer",false);
1193  samplingHBHE_ = HCALparameters.getParameter< std::vector<double> >("samplingHBHE");
1194  samplingHF_ = HCALparameters.getParameter< std::vector<double> >("samplingHF");
1195  samplingHO_ = HCALparameters.getParameter< std::vector<double> >("samplingHO");
1196  ietaShiftHB_ = HCALparameters.getParameter< int >("ietaShiftHB");
1197  ietaShiftHE_ = HCALparameters.getParameter< int >("ietaShiftHE");
1198  ietaShiftHF_ = HCALparameters.getParameter< int >("ietaShiftHF");
1199  ietaShiftHO_ = HCALparameters.getParameter< int >("ietaShiftHO");
1200  timeShiftHB_ = HCALparameters.getParameter< std::vector<double> >("timeShiftHB");
1201  timeShiftHE_ = HCALparameters.getParameter< std::vector<double> >("timeShiftHE");
1202  timeShiftHF_ = HCALparameters.getParameter< std::vector<double> >("timeShiftHF");
1203  timeShiftHO_ = HCALparameters.getParameter< std::vector<double> >("timeShiftHO");
1204 
1205  // FastHFShowerLibrary
1206  edm::ParameterSet m_HS = fastCalo.getParameter<edm::ParameterSet>("HFShowerLibrary");
1207  useShowerLibrary = m_HS.getUntrackedParameter<bool>("useShowerLibrary",false);
1208  useCorrectionSL = m_HS.getUntrackedParameter<bool>("useCorrectionSL",false);
1209 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< double > rsp
std::vector< double > k_h
std::vector< double > timeShiftHO_
std::vector< double > timeShiftHF_
std::vector< double > p_knots
std::vector< double > samplingHF_
std::vector< double > radiusPreshowerCorrections_
std::vector< double > theTailIntervals_
std::vector< double > samplingHBHE_
std::vector< double > timeShiftHB_
std::vector< double > theCoreIntervals_
std::vector< double > mipValues_
std::vector< unsigned int > evtsToDebug_
std::vector< double > k_e
std::vector< double > samplingHO_
std::vector< double > timeShiftHE_
void CalorimetryManager::reconstruct ( RandomEngineAndDistribution const *  random)

Definition at line 172 of file CalorimetryManager.cc.

References funct::abs(), clean(), HCALResponse::correctHF(), gather_cfg::cout, debug_, EMShowerSimulation(), edm::EventID::event(), evtsToDebug_, spr::find(), FastHFShowerLibrary::getHitsMap(), FSimTrack::hcalEntrance(), HDShowerSimulation(), FSimEvent::id(), FSimTrack::id(), initialized_, MuonMipSimulation(), myCalorimeter_, myHDResponse_, mySimEvent, FSimTrack::noEndVertex(), FSimEvent::nTracks(), FSimTrack::onEcal(), FSimTrack::onHcal(), FSimTrack::onVFcal(), optionHDSim_, sysUtil::pid, CaloGeometryHelper::preshowerPresent(), FBaseSimEvent::print(), FastHFShowerLibrary::recoHFShowerLibrary(), reconstructHCAL(), simulatePreshower_, theHFShowerLibrary, FBaseSimEvent::track(), CoreSimTrack::type(), updateHCAL(), and useShowerLibrary.

Referenced by FamosManager::reconstruct().

173 {
174 
175  if(evtsToDebug_.size())
176  {
177  std::vector<unsigned int>::const_iterator itcheck=find(evtsToDebug_.begin(),evtsToDebug_.end(),mySimEvent->id().event());
178  debug_=(itcheck!=evtsToDebug_.end());
179  if(debug_)
180  mySimEvent->print();
181  }
182  // Clear the content of the calorimeters
183  if(!initialized_)
184  {
185 
186  // Check if the preshower is really available
188  {
189  std::cout << " WARNING " << std::endl;
190  std::cout << " The preshower simulation has been turned on; but no preshower geometry is available " << std::endl;
191  std::cout << " Disabling the preshower simulation " << std::endl;
192  simulatePreshower_ = false;
193  }
194 
195  initialized_=true;
196  }
197  clean();
198 
199  LogInfo("FastCalorimetry") << "Reconstructing " << (int) mySimEvent->nTracks() << " tracks." << std::endl;
200  for( int fsimi=0; fsimi < (int) mySimEvent->nTracks() ; ++fsimi) {
201 
202  FSimTrack& myTrack = mySimEvent->track(fsimi);
203 
204  int pid = abs(myTrack.type());
205 
206  if (debug_) {
207  LogInfo("FastCalorimetry") << " ===> pid = " << pid << std::endl;
208  }
209 
210 
211  // Check that the particle hasn't decayed
212  if(myTrack.noEndVertex()) {
213  // Simulate energy smearing for photon and electrons
214  if ( pid == 11 || pid == 22 ) {
215 
216  if ( myTrack.onEcal() )
217  EMShowerSimulation(myTrack, random);
218  else if ( myTrack.onVFcal() ) {
219  if(useShowerLibrary) {
221  myHDResponse_->correctHF(myTrack.hcalEntrance().e(),abs(myTrack.type()));
223  }
224  else reconstructHCAL(myTrack, random);
225  }
226  } // electron or photon
227  else if (pid==13)
228  {
229  MuonMipSimulation(myTrack, random);
230  }
231  // Simulate energy smearing for hadrons (i.e., everything
232  // but muons... and SUSY particles that deserve a special
233  // treatment.
234  else if ( pid < 1000000 ) {
235  if ( myTrack.onHcal() || myTrack.onVFcal() ) {
236  if(optionHDSim_ == 0 ) reconstructHCAL(myTrack, random);
237  else HDShowerSimulation(myTrack, random);
238  }
239  } // pid < 1000000
240  } // myTrack.noEndVertex()
241  } // particle loop
242  // LogInfo("FastCalorimetry") << " Number of hits (barrel)" << EBMapping_.size() << std::endl;
243  // LogInfo("FastCalorimetry") << " Number of hits (Hcal)" << HMapping_.size() << std::endl;
244  // std::cout << " Nombre de hit (endcap)" << EEMapping_.size() << std::endl;
245 
246 } // reconstruct
EventNumber_t event() const
Definition: EventID.h:41
bool noEndVertex() const
no end vertex
void reconstructHCAL(const FSimTrack &myTrack, RandomEngineAndDistribution const *)
void updateHCAL(const std::map< CaloHitID, float > &hitMap, int trackID=0, float corr=1.0)
void recoHFShowerLibrary(const FSimTrack &myTrack)
void correctHF(double e, int type)
void MuonMipSimulation(const FSimTrack &myTrack, RandomEngineAndDistribution const *)
TRandom random
Definition: MVATrainer.cc:138
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
int onEcal() const
Definition: FSimTrack.h:101
void HDShowerSimulation(const FSimTrack &myTrack, RandomEngineAndDistribution const *)
Hadronic Shower Simulation.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int onVFcal() const
Definition: FSimTrack.h:111
unsigned int nTracks() const
Number of tracks.
Definition: FSimEvent.cc:36
HCALResponse * myHDResponse_
CaloGeometryHelper * myCalorimeter_
edm::EventID id() const
Method to return the EventId.
Definition: FSimEvent.cc:27
tuple pid
Definition: sysUtil.py:22
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:25
std::vector< unsigned int > evtsToDebug_
int id() const
the index in FBaseSimEvent and other vectors
Definition: FSimTrack.h:86
bool preshowerPresent() const
const std::map< CaloHitID, float > & getHitsMap()
int onHcal() const
Definition: FSimTrack.h:106
const RawParticle & hcalEntrance() const
The particle at HCAL entrance.
Definition: FSimTrack.h:136
tuple cout
Definition: gather_cfg.py:121
FastHFShowerLibrary * theHFShowerLibrary
void print() const
print the FBaseSimEvent in an intelligible way
void EMShowerSimulation(const FSimTrack &myTrack, RandomEngineAndDistribution const *)
FSimTrack & track(int id) const
Return track with given Id.
void CalorimetryManager::reconstructHCAL ( const FSimTrack myTrack,
RandomEngineAndDistribution const *  random 
)
private

Definition at line 490 of file CalorimetryManager.cc.

References funct::abs(), debug_, CaloGeometryHelper::getClosestCell(), CaloSubdetectorGeometry::getGeometry(), HCALResponse::getHCALEnergyResponse(), Calorimeter::getHcalGeometry(), CaloCellGeometry::getPosition(), FSimTrack::hcalEntrance(), FSimTrack::id(), PV3DBase< T, PVType, FrameType >::mag(), myCalorimeter_, myHDResponse_, FSimTrack::onHcal(), sysUtil::pid, DetId::rawId(), HCALResponse::responseHCAL(), CoreSimTrack::type(), updateHCAL(), RawParticle::vertex(), and FSimTrack::vfcalEntrance().

Referenced by MuonMipSimulation(), and reconstruct().

492 {
493  int hit;
494  int pid = abs(myTrack.type());
495  if (debug_) {
496  LogInfo("FastCalorimetry") << " reconstructHCAL " << myTrack << std::endl;
497  }
498 
499  // FSimTrack myTrack = mySimEvent.track(fsimi);
500 
501  // int pid=abs(myTrack.type());
502  // std::cout << "reconstructHCAL " << std::endl;
503 
504  XYZTLorentzVector trackPosition;
505  if (myTrack.onHcal()) {
506  trackPosition=myTrack.hcalEntrance().vertex();
507  hit = myTrack.onHcal()-1;
508  } else {
509  trackPosition=myTrack.vfcalEntrance().vertex();
510  hit = 2;
511  }
512 
513  double pathEta = trackPosition.eta();
514  double pathPhi = trackPosition.phi();
515  // double pathTheta = trackPosition.theta();
516 
517  double EGen = myTrack.hcalEntrance().e();
518  double emeas = 0.;
519  //double emeas = -0.0001;
520 
521  if(pid == 13) {
522  // std::cout << " We should not be here " << std::endl;
523  emeas = myHDResponse_->responseHCAL(0, EGen, pathEta, 2, random); // 2=muon
524  if(debug_)
525  LogInfo("FastCalorimetry") << "CalorimetryManager::reconstructHCAL - MUON !!!" << std::endl;
526  }
527  else if( pid == 22 || pid == 11) {
528  emeas = myHDResponse_->responseHCAL(0, EGen, pathEta, 0, random); // last par. = 0 = e/gamma
529  // cout << "CalorimetryManager::reconstructHCAL - e/gamma !!!" << std::endl;
530  if(debug_)
531  LogInfo("FastCalorimetry") << "CalorimetryManager::reconstructHCAL - e/gamma !!!" << std::endl;
532  }
533  else {
534  emeas = myHDResponse_->getHCALEnergyResponse(EGen, hit, random);
535  }
536 
537  if(debug_)
538  LogInfo("FastCalorimetry") << "CalorimetryManager::reconstructHCAL - on-calo "
539  << " eta = " << pathEta
540  << " phi = " << pathPhi
541  << " Egen = " << EGen
542  << " Emeas = " << emeas << std::endl;
543 
544  if(emeas > 0.) {
545  DetId cell = myCalorimeter_->getClosestCell(trackPosition.Vect(),false,false);
546  double tof = (myCalorimeter_->getHcalGeometry()->getGeometry(cell)->getPosition().mag())/29.98;//speed of light
547  CaloHitID current_id(cell.rawId(),tof,myTrack.id());
548  std::map<CaloHitID,float> hitMap;
549  hitMap[current_id] = emeas;
550  updateHCAL(hitMap,myTrack.id());
551  }
552 }
double responseHCAL(int _mip, double energy, double eta, int partype, RandomEngineAndDistribution const *)
const RawParticle & vfcalEntrance() const
The particle at VFCAL entrance.
Definition: FSimTrack.h:139
void updateHCAL(const std::map< CaloHitID, float > &hitMap, int trackID=0, float corr=1.0)
double getHCALEnergyResponse(double e, int hit, RandomEngineAndDistribution const *)
const CaloSubdetectorGeometry * getHcalGeometry() const
Definition: Calorimeter.h:57
TRandom random
Definition: MVATrainer.cc:138
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
T mag() const
Definition: PV3DBase.h:67
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HCALResponse * myHDResponse_
CaloGeometryHelper * myCalorimeter_
const XYZTLorentzVector & vertex() const
the vertex fourvector
Definition: RawParticle.h:285
Definition: DetId.h:18
tuple pid
Definition: sysUtil.py:22
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:25
int id() const
the index in FBaseSimEvent and other vectors
Definition: FSimTrack.h:86
int onHcal() const
Definition: FSimTrack.h:106
const RawParticle & hcalEntrance() const
The particle at HCAL entrance.
Definition: FSimTrack.h:136
DetId getClosestCell(const XYZPoint &point, bool ecal, bool central) const
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:15
void CalorimetryManager::respCorr ( double  p)
private

Definition at line 1211 of file CalorimetryManager.cc.

References debug_, ecorr, hcorr, i, k_e, k_h, and p_knots.

Referenced by HDShowerSimulation().

1211  {
1212 
1213  int sizeP = p_knots.size();
1214 
1215  if(sizeP <= 1) {
1216  ecorr = 1.;
1217  hcorr = 1.;
1218  }
1219  else {
1220  int ip = -1;
1221  for (int i = 0; i < sizeP; i++) {
1222  if (p < p_knots[i]) { ip = i; break;}
1223  }
1224  if (ip == 0) {
1225  ecorr = k_e[0];
1226  hcorr = k_h[0];
1227  }
1228  else {
1229  if(ip == -1) {
1230  ecorr = k_e[sizeP-1];
1231  hcorr = k_h[sizeP-1];
1232  }
1233  else {
1234  double x1 = p_knots[ip-1];
1235  double x2 = p_knots[ip];
1236  double y1 = k_e[ip-1];
1237  double y2 = k_e[ip];
1238 
1239  if(x1 == x2) {
1240  // std::cout << " equal p_knots values!!! " << std::endl;
1241  }
1242 
1243  ecorr = (y1 + (y2 - y1) * (p - x1)/(x2 - x1));
1244 
1245  y1 = k_h[ip-1];
1246  y2 = k_h[ip];
1247  hcorr = (y1 + (y2 - y1) * (p - x1)/(x2 - x1));
1248 
1249  }
1250  }
1251  }
1252 
1253  if(debug_)
1254  LogInfo("FastCalorimetry") << " p, ecorr, hcorr = " << p << " "
1255  << ecorr << " " << hcorr << std::endl;
1256 
1257 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > k_h
std::vector< double > p_knots
std::vector< double > k_e
void CalorimetryManager::updateECAL ( const std::map< CaloHitID, float > &  hitMap,
int  onEcal,
int  trackID = 0,
float  corr = 1.0 
)
private

Definition at line 1259 of file CalorimetryManager.cc.

References corr, EBMapping_, EEMapping_, and relval_parameters_module::energy.

Referenced by EMShowerSimulation(), HDShowerSimulation(), and MuonMipSimulation().

1260 {
1261  std::map<CaloHitID,float>::const_iterator mapitr;
1262  std::map<CaloHitID,float>::const_iterator endmapitr=hitMap.end();
1263  if(onEcal==1) {
1264  EBMapping_.reserve(EBMapping_.size()+hitMap.size());
1265  endmapitr=hitMap.end();
1266  for(mapitr=hitMap.begin();mapitr!=endmapitr;++mapitr) {
1267  //correct energy
1268  float energy = mapitr->second;
1269  energy *= corr;
1270 
1271  //make finalized CaloHitID
1272  CaloHitID current_id(mapitr->first.unitID(),mapitr->first.timeSlice(),trackID);
1273 
1274  EBMapping_.push_back(std::pair<CaloHitID,float>(current_id,energy));
1275  }
1276  }
1277  else if(onEcal==2) {
1278  EEMapping_.reserve(EEMapping_.size()+hitMap.size());
1279  endmapitr=hitMap.end();
1280  for(mapitr=hitMap.begin();mapitr!=endmapitr;++mapitr) {
1281  //correct energy
1282  float energy = mapitr->second;
1283  energy *= corr;
1284 
1285  //make finalized CaloHitID
1286  CaloHitID current_id(mapitr->first.unitID(),mapitr->first.timeSlice(),trackID);
1287 
1288  EEMapping_.push_back(std::pair<CaloHitID,float>(current_id,energy));
1289  }
1290  }
1291 
1292 }
std::vector< std::pair< CaloHitID, float > > EBMapping_
JetCorrectorParameters corr
Definition: classes.h:5
std::vector< std::pair< CaloHitID, float > > EEMapping_
void CalorimetryManager::updateHCAL ( const std::map< CaloHitID, float > &  hitMap,
int  trackID = 0,
float  corr = 1.0 
)
private

Definition at line 1294 of file CalorimetryManager.cc.

References corr, HcalDetId::depth(), relval_parameters_module::energy, HCALResponse::getCorrHF(), HcalBarrel, HcalDigitizer_, HcalEndcap, HcalForward, HcalOuter, HMapping_, HcalDetId::ietaAbs(), ietaShiftHB_, ietaShiftHE_, ietaShiftHF_, ietaShiftHO_, myHDResponse_, samplingHBHE_, samplingHF_, samplingHO_, DetId::subdetId(), cond::rpcobgas::time, timeShiftHB_, timeShiftHE_, timeShiftHF_, timeShiftHO_, useCorrectionSL, and useShowerLibrary.

Referenced by EMShowerSimulation(), HDShowerSimulation(), MuonMipSimulation(), reconstruct(), and reconstructHCAL().

1295 {
1296  std::vector<double> hfcorr = myHDResponse_->getCorrHF();
1297  std::map<CaloHitID,float>::const_iterator mapitr;
1298  std::map<CaloHitID,float>::const_iterator endmapitr=hitMap.end();
1299  HMapping_.reserve(HMapping_.size()+hitMap.size());
1300  for(mapitr=hitMap.begin(); mapitr!=endmapitr; ++mapitr) {
1301  //correct energy
1302  float energy = mapitr->second;
1303  energy *= corr;
1304 
1305  float time = mapitr->first.timeSlice();
1306  //put energy into uncalibrated state for digitizer && correct timing
1307  if(HcalDigitizer_){
1308  HcalDetId hdetid = HcalDetId(mapitr->first.unitID());
1309  if (hdetid.subdetId()== HcalBarrel){
1310  energy /= samplingHBHE_[hdetid.ietaAbs()-1]; //re-convert to GeV
1311  time = timeShiftHB_[hdetid.ietaAbs()-ietaShiftHB_];
1312  }
1313  else if (hdetid.subdetId()== HcalEndcap){
1314  energy /= samplingHBHE_[hdetid.ietaAbs()-1]; //re-convert to GeV
1315  time = timeShiftHE_[hdetid.ietaAbs()-ietaShiftHE_];
1316  }
1317  else if (hdetid.subdetId()== HcalForward){
1318  if(useShowerLibrary) {
1319  if(useCorrectionSL) energy *= hfcorr[hdetid.ietaAbs()-29];
1320  } else {
1321  if(hdetid.depth()== 1) energy *= samplingHF_[0];
1322  if(hdetid.depth()== 2) energy *= samplingHF_[1];
1323  }
1324  time = timeShiftHF_[hdetid.ietaAbs()-ietaShiftHF_];
1325  }
1326  else if (hdetid.subdetId()== HcalOuter){
1327  energy /= samplingHO_[hdetid.ietaAbs()-1];
1328  time = timeShiftHO_[hdetid.ietaAbs()-ietaShiftHO_];
1329  }
1330  }
1331 
1332  //make finalized CaloHitID
1333  CaloHitID current_id(mapitr->first.unitID(),time,trackID);
1334  HMapping_.push_back(std::pair<CaloHitID,float>(current_id,energy));
1335  }
1336 }
std::vector< double > timeShiftHO_
std::vector< double > timeShiftHF_
std::vector< double > samplingHF_
int depth() const
get the tower depth
Definition: HcalDetId.h:55
vec1 & getCorrHF()
Definition: HCALResponse.h:48
std::vector< double > samplingHBHE_
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
JetCorrectorParameters corr
Definition: classes.h:5
HCALResponse * myHDResponse_
std::vector< double > timeShiftHB_
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:49
std::vector< std::pair< CaloHitID, float > > HMapping_
std::vector< double > samplingHO_
std::vector< double > timeShiftHE_
void CalorimetryManager::updatePreshower ( const std::map< CaloHitID, float > &  hitMap,
int  trackID = 0,
float  corr = 1.0 
)
private

Definition at line 1338 of file CalorimetryManager.cc.

References corr, relval_parameters_module::energy, and ESMapping_.

Referenced by EMShowerSimulation().

1339 {
1340  std::map<CaloHitID,float>::const_iterator mapitr;
1341  std::map<CaloHitID,float>::const_iterator endmapitr=hitMap.end();
1342  ESMapping_.reserve(ESMapping_.size()+hitMap.size());
1343  for(mapitr=hitMap.begin();mapitr!=endmapitr;++mapitr) {
1344  //correct energy
1345  float energy = mapitr->second;
1346  energy *= corr;
1347 
1348  //make finalized CaloHitID
1349  CaloHitID current_id(mapitr->first.unitID(),mapitr->first.timeSlice(),trackID);
1350 
1351  ESMapping_.push_back(std::pair<CaloHitID,float>(current_id,energy));
1352  }
1353 }
std::vector< std::pair< CaloHitID, float > > ESMapping_
JetCorrectorParameters corr
Definition: classes.h:5

Member Data Documentation

GammaFunctionGenerator* CalorimetryManager::aGammaGenerator
private

Definition at line 154 of file CalorimetryManager.h.

Referenced by CalorimetryManager(), and EMShowerSimulation().

const LandauFluctuationGenerator* CalorimetryManager::aLandauGenerator
private

Definition at line 153 of file CalorimetryManager.h.

Referenced by CalorimetryManager(), and EMShowerSimulation().

double CalorimetryManager::aTerm
private

Definition at line 143 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), and readParameters().

bool CalorimetryManager::bFixedLength_
private

Definition at line 179 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), and readParameters().

double CalorimetryManager::bTerm
private

Definition at line 143 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), and readParameters().

double CalorimetryManager::crackPadSurvivalProbability_
private

Definition at line 138 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), and readParameters().

bool CalorimetryManager::debug_
private
std::vector<std::pair<CaloHitID,float> > CalorimetryManager::EBMapping_
private

Definition at line 109 of file CalorimetryManager.h.

Referenced by clean(), loadFromEcalBarrel(), and updateECAL().

std::unique_ptr<KKCorrectionFactors> CalorimetryManager::ecalCorrection
private

Definition at line 192 of file CalorimetryManager.h.

Referenced by CalorimetryManager(), and EMShowerSimulation().

bool CalorimetryManager::EcalDigitizer_
private

Definition at line 120 of file CalorimetryManager.h.

Referenced by readParameters().

double CalorimetryManager::ecorr
private

Definition at line 164 of file CalorimetryManager.h.

Referenced by HDShowerSimulation(), and respCorr().

std::vector<std::pair<CaloHitID,float> > CalorimetryManager::EEMapping_
private

Definition at line 110 of file CalorimetryManager.h.

Referenced by clean(), loadFromEcalEndcap(), and updateECAL().

std::vector<std::pair<CaloHitID,float> > CalorimetryManager::ESMapping_
private

Definition at line 112 of file CalorimetryManager.h.

Referenced by clean(), loadFromPreshower(), and updatePreshower().

std::vector<unsigned int> CalorimetryManager::evtsToDebug_
private

Definition at line 115 of file CalorimetryManager.h.

Referenced by readParameters(), and reconstruct().

int CalorimetryManager::gridSize_
private

Definition at line 145 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), and readParameters().

bool CalorimetryManager::HcalDigitizer_
private

Definition at line 121 of file CalorimetryManager.h.

Referenced by readParameters(), and updateHCAL().

double CalorimetryManager::hcorr
private

Definition at line 165 of file CalorimetryManager.h.

Referenced by HDShowerSimulation(), and respCorr().

int CalorimetryManager::hdGridSize_
private

Definition at line 149 of file CalorimetryManager.h.

Referenced by HDShowerSimulation(), MuonMipSimulation(), and readParameters().

int CalorimetryManager::hdSimMethod_
private

Definition at line 149 of file CalorimetryManager.h.

Referenced by HDShowerSimulation(), and readParameters().

std::vector<std::pair<CaloHitID,float> > CalorimetryManager::HMapping_
private

Definition at line 111 of file CalorimetryManager.h.

Referenced by clean(), loadFromHcal(), and updateHCAL().

int CalorimetryManager::ietaShiftHB_
private

Definition at line 125 of file CalorimetryManager.h.

Referenced by readParameters(), and updateHCAL().

int CalorimetryManager::ietaShiftHE_
private

Definition at line 125 of file CalorimetryManager.h.

Referenced by readParameters(), and updateHCAL().

int CalorimetryManager::ietaShiftHF_
private

Definition at line 125 of file CalorimetryManager.h.

Referenced by readParameters(), and updateHCAL().

int CalorimetryManager::ietaShiftHO_
private

Definition at line 125 of file CalorimetryManager.h.

Referenced by readParameters(), and updateHCAL().

bool CalorimetryManager::initialized_
private

Definition at line 168 of file CalorimetryManager.h.

Referenced by reconstruct().

std::vector<double> CalorimetryManager::k_e
private

Definition at line 162 of file CalorimetryManager.h.

Referenced by readParameters(), and respCorr().

std::vector<double> CalorimetryManager::k_h
private

Definition at line 163 of file CalorimetryManager.h.

Referenced by readParameters(), and respCorr().

std::vector<double> CalorimetryManager::mipValues_
private

Definition at line 144 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), and readParameters().

std::vector<FSimTrack> CalorimetryManager::muonSimTracks
private

Definition at line 170 of file CalorimetryManager.h.

Referenced by clean(), loadMuonSimTracks(), and MuonMipSimulation().

CaloGeometryHelper* CalorimetryManager::myCalorimeter_
private
RawParticle CalorimetryManager::myElec
private

A few pointers to save time.

Definition at line 132 of file CalorimetryManager.h.

Referenced by EMShowerSimulation().

HCALResponse* CalorimetryManager::myHDResponse_
private
Histos* CalorimetryManager::myHistos
private

Definition at line 104 of file CalorimetryManager.h.

HSParameters* CalorimetryManager::myHSParameters_
private

Definition at line 107 of file CalorimetryManager.h.

Referenced by CalorimetryManager(), and HDShowerSimulation().

RawParticle CalorimetryManager::myPart
private

Definition at line 134 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), HDShowerSimulation(), and MuonMipSimulation().

RawParticle CalorimetryManager::myPosi
private

Definition at line 133 of file CalorimetryManager.h.

Referenced by EMShowerSimulation().

FSimEvent* CalorimetryManager::mySimEvent
private

Definition at line 101 of file CalorimetryManager.h.

Referenced by reconstruct().

std::vector< std::pair< int, float > > CalorimetryManager::myZero_
staticprivate
Initial value:
= std::vector<std::pair<int,float> >
(1,std::pair<int,float>(0,0.))

Definition at line 156 of file CalorimetryManager.h.

int CalorimetryManager::optionHDSim_
private

Definition at line 149 of file CalorimetryManager.h.

Referenced by HDShowerSimulation(), readParameters(), and reconstruct().

std::vector<double> CalorimetryManager::p_knots
private

Definition at line 161 of file CalorimetryManager.h.

Referenced by readParameters(), and respCorr().

double CalorimetryManager::pulledPadSurvivalProbability_
private

Definition at line 137 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), and readParameters().

double CalorimetryManager::radiusFactorEB_
private

Definition at line 141 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), and readParameters().

double CalorimetryManager::radiusFactorEE_
private

Definition at line 141 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), and readParameters().

std::vector<double> CalorimetryManager::radiusPreshowerCorrections_
private

Definition at line 142 of file CalorimetryManager.h.

Referenced by readParameters().

double CalorimetryManager::RCFactor_
private

Definition at line 147 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), and readParameters().

std::vector<double> CalorimetryManager::rsp
private

Definition at line 160 of file CalorimetryManager.h.

Referenced by readParameters().

double CalorimetryManager::RTFactor_
private

Definition at line 147 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), and readParameters().

std::vector<double> CalorimetryManager::samplingHBHE_
private

Definition at line 122 of file CalorimetryManager.h.

Referenced by readParameters(), and updateHCAL().

std::vector<double> CalorimetryManager::samplingHF_
private

Definition at line 123 of file CalorimetryManager.h.

Referenced by readParameters(), and updateHCAL().

std::vector<double> CalorimetryManager::samplingHO_
private

Definition at line 124 of file CalorimetryManager.h.

Referenced by readParameters(), and updateHCAL().

bool CalorimetryManager::simulatePreshower_
private

Definition at line 150 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), readParameters(), and reconstruct().

double CalorimetryManager::spotFraction_
private

Definition at line 139 of file CalorimetryManager.h.

Referenced by readParameters().

GflashAntiProtonShowerProfile* CalorimetryManager::theAntiProtonProfile
private

Definition at line 185 of file CalorimetryManager.h.

Referenced by CalorimetryManager(), and HDShowerSimulation().

std::vector<double> CalorimetryManager::theCoreIntervals_
private

Definition at line 146 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), and readParameters().

FastHFShowerLibrary* CalorimetryManager::theHFShowerLibrary
private
MaterialEffects* CalorimetryManager::theMuonEcalEffects
private
MaterialEffects* CalorimetryManager::theMuonHcalEffects
private
GflashPiKShowerProfile* CalorimetryManager::thePiKProfile
private

Definition at line 183 of file CalorimetryManager.h.

Referenced by CalorimetryManager(), and HDShowerSimulation().

GflashHadronShowerProfile* CalorimetryManager::theProfile
private
GflashProtonShowerProfile* CalorimetryManager::theProtonProfile
private

Definition at line 184 of file CalorimetryManager.h.

Referenced by CalorimetryManager(), and HDShowerSimulation().

std::vector<double> CalorimetryManager::theTailIntervals_
private

Definition at line 146 of file CalorimetryManager.h.

Referenced by EMShowerSimulation(), and readParameters().

std::vector<double> CalorimetryManager::timeShiftHB_
private

Definition at line 126 of file CalorimetryManager.h.

Referenced by readParameters(), and updateHCAL().

std::vector<double> CalorimetryManager::timeShiftHE_
private

Definition at line 127 of file CalorimetryManager.h.

Referenced by readParameters(), and updateHCAL().

std::vector<double> CalorimetryManager::timeShiftHF_
private

Definition at line 128 of file CalorimetryManager.h.

Referenced by readParameters(), and updateHCAL().

std::vector<double> CalorimetryManager::timeShiftHO_
private

Definition at line 129 of file CalorimetryManager.h.

Referenced by readParameters(), and updateHCAL().

bool CalorimetryManager::unfoldedMode_
private

Definition at line 117 of file CalorimetryManager.h.

bool CalorimetryManager::useCorrectionSL
private

Definition at line 189 of file CalorimetryManager.h.

Referenced by readParameters(), and updateHCAL().

bool CalorimetryManager::useShowerLibrary
private

Definition at line 188 of file CalorimetryManager.h.

Referenced by HDShowerSimulation(), readParameters(), reconstruct(), and updateHCAL().