CMS 3D CMS Logo

CalorimetryManager.h
Go to the documentation of this file.
1 #ifndef CALORIMETRYMANAGER_H
2 #define CALORIMETRYMANAGER_H
3 
6 
7 // FastSimulation headers
16 
18 
19 // For the uint32_t
20 //#include <boost/cstdint.hpp>
21 #include <map>
22 #include <algorithm>
23 
24 class FSimEvent;
25 class FSimTrack;
26 class RawParticle;
27 class CaloGeometryHelper;
28 class Histos;
29 class HSParameters;
32 class MaterialEffects;
34 //Gflash
39 // FastHFshowerLibrary
41 
42 namespace edm {
43  class ParameterSet;
44 }
45 
47 
48  public:
50  CalorimetryManager(FSimEvent* aSimEvent,
51  const edm::ParameterSet& fastCalo,
52  const edm::ParameterSet& MuonECALPars,
53  const edm::ParameterSet& MuonHCALPars,
54  const edm::ParameterSet& fastGflash);
56 
57  // Does the real job
58  void reconstruct(RandomEngineAndDistribution const*);
59 
60  // Return the address of the Calorimeter
61  CaloGeometryHelper * getCalorimeter() const {return myCalorimeter_;}
62 
63  // Return the address of the FastHFShowerLibrary
64  FastHFShowerLibrary * getHFShowerLibrary() const {return theHFShowerLibrary;}
65 
66  // load container from edm::Event
67  void loadFromEcalBarrel(edm::PCaloHitContainer & c) const;
68 
69  void loadFromEcalEndcap(edm::PCaloHitContainer & c) const;
70 
71  void loadFromHcal(edm::PCaloHitContainer & c) const;
72 
73  void loadFromPreshower(edm::PCaloHitContainer & c) const;
74 
75  void loadMuonSimTracks(edm::SimTrackContainer & m) const;
76 
77  private:
78  // Simulation of electromagnetic showers in PS, ECAL, HCAL
79  void EMShowerSimulation(const FSimTrack& myTrack, RandomEngineAndDistribution const*);
80 
81  void reconstructHCAL(const FSimTrack& myTrack, RandomEngineAndDistribution const*);
82 
83  void MuonMipSimulation(const FSimTrack & myTrack, RandomEngineAndDistribution const*);
84 
86  void HDShowerSimulation(const FSimTrack& myTrack, RandomEngineAndDistribution const*);
87 
88  // Read the parameters
89  void readParameters(const edm::ParameterSet& fastCalo);
90 
91  void updateECAL(const std::map<CaloHitID,float>& hitMap, int onEcal, int trackID=0, float corr=1.0);
92  void updateHCAL(const std::map<CaloHitID,float>& hitMap, int trackID=0, float corr=1.0);
93  void updatePreshower(const std::map<CaloHitID,float>& hitMap, int trackID=0, float corr=1.0);
94 
95  void respCorr(double);
96 
97  void clean();
98 
99  private:
100 
103 
105 
108 
109  std::vector<std::pair<CaloHitID,float> > EBMapping_;
110  std::vector<std::pair<CaloHitID,float> > EEMapping_;
111  std::vector<std::pair<CaloHitID,float> > HMapping_;
112  std::vector<std::pair<CaloHitID,float> > ESMapping_;
113 
114  bool debug_;
115  std::vector<unsigned int> evtsToDebug_;
116 
118 
119  //Digitizer
122  std::vector<double> samplingHBHE_;
123  std::vector<double> samplingHF_;
124  std::vector<double> samplingHO_;
125  int ietaShiftHB_, ietaShiftHE_, ietaShiftHO_, ietaShiftHF_;
126  std::vector<double> timeShiftHB_;
127  std::vector<double> timeShiftHE_;
128  std::vector<double> timeShiftHF_;
129  std::vector<double> timeShiftHO_;
130 
135 
136  // Parameters
140  // double radiusFactor_;
141  double radiusFactorEB_ , radiusFactorEE_;
142  std::vector<double> radiusPreshowerCorrections_;
143  double aTerm, bTerm;
144  std::vector<double> mipValues_;
146  std::vector<double> theCoreIntervals_,theTailIntervals_;
147  double RCFactor_,RTFactor_;
148  //FR
149  int optionHDSim_, hdGridSize_, hdSimMethod_;
151  //RF
152 
155 
156  static std::vector<std::pair<int, float> > myZero_;
157 
158  // RespCorrP p, k_e(p), k_h(p) vectors and evaluated for each p
159  // ecorr and hcorr
160  std::vector<double> rsp;
161  std::vector<double> p_knots;
162  std::vector<double> k_e;
163  std::vector<double> k_h;
164  double ecorr;
165  double hcorr;
166 
167  // Used to check if the calorimeters was initialized
169 
170  std::vector<FSimTrack> muonSimTracks;
171  MaterialEffects* theMuonEcalEffects; // material effects for muons in ECAL
172  MaterialEffects* theMuonHcalEffects; // material effects for muons in HCAL
173 
174 
175  // If set to true the simulation in ECAL would be done 1X0 by 1X0
176  // this is slow but more adapted to detailed studies.
177  // Otherwise roughty 5 steps are used.
178  // This variable is transferred to EMShower
180 
181  //Gflash
186 
187  // HFShowerLibrary
191 
192  std::unique_ptr<KKCorrectionFactors> ecalCorrection;
193 
194 };
195 #endif
std::vector< double > rsp
std::vector< double > k_h
RawParticle myElec
A few pointers to save time.
std::vector< std::pair< CaloHitID, float > > ESMapping_
std::vector< PCaloHit > PCaloHitContainer
GflashPiKShowerProfile * thePiKProfile
std::vector< double > timeShiftHO_
MaterialEffects * theMuonEcalEffects
MaterialEffects * theMuonHcalEffects
GflashHadronShowerProfile * theProfile
CaloGeometryHelper * getCalorimeter() const
std::vector< double > timeShiftHF_
std::vector< double > p_knots
std::vector< std::pair< CaloHitID, float > > EBMapping_
std::vector< FSimTrack > muonSimTracks
const LandauFluctuationGenerator * aLandauGenerator
std::vector< double > samplingHF_
GflashAntiProtonShowerProfile * theAntiProtonProfile
FastHFShowerLibrary * getHFShowerLibrary() const
GflashProtonShowerProfile * theProtonProfile
std::vector< double > radiusPreshowerCorrections_
std::vector< double > theTailIntervals_
std::vector< double > samplingHBHE_
HCALResponse * myHDResponse_
JetCorrectorParameters corr
Definition: classes.h:5
std::vector< T * > clean
Definition: MVATrainer.cc:156
CaloGeometryHelper * myCalorimeter_
std::vector< double > timeShiftHB_
GammaFunctionGenerator * aGammaGenerator
std::vector< double > mipValues_
static std::vector< std::pair< int, float > > myZero_
std::vector< std::pair< CaloHitID, float > > EEMapping_
HLT enums.
std::vector< unsigned int > evtsToDebug_
std::vector< double > k_e
Definition: Histos.h:19
std::vector< std::pair< CaloHitID, float > > HMapping_
std::vector< double > samplingHO_
FastHFShowerLibrary * theHFShowerLibrary
std::unique_ptr< KKCorrectionFactors > ecalCorrection
HSParameters * myHSParameters_
std::vector< SimTrack > SimTrackContainer
std::vector< double > timeShiftHE_