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
59  void reconstructTrack(FSimTrack& myTrack, RandomEngineAndDistribution const*);
60  void reconstruct(RandomEngineAndDistribution const*);
61 
62  // Return the address of the Calorimeter
63  CaloGeometryHelper * getCalorimeter() const {return myCalorimeter_;}
64 
65  // Return the address of the FastHFShowerLibrary
66  FastHFShowerLibrary * getHFShowerLibrary() const {return theHFShowerLibrary;}
67 
68  // load container from edm::Event
69  void loadFromEcalBarrel(edm::PCaloHitContainer & c) const;
70 
71  void loadFromEcalEndcap(edm::PCaloHitContainer & c) const;
72 
73  void loadFromHcal(edm::PCaloHitContainer & c) const;
74 
75  void loadFromPreshower(edm::PCaloHitContainer & c) const;
76 
77  void loadMuonSimTracks(edm::SimTrackContainer & m) const;
78 
79  void harvestMuonSimTracks(edm::SimTrackContainer & m) const;
80 
81  private:
82  // Simulation of electromagnetic showers in PS, ECAL, HCAL
83  void EMShowerSimulation(const FSimTrack& myTrack, RandomEngineAndDistribution const*);
84 
85  void reconstructHCAL(const FSimTrack& myTrack, RandomEngineAndDistribution const*);
86 
87  void MuonMipSimulation(const FSimTrack & myTrack, RandomEngineAndDistribution const*);
88 
90  void HDShowerSimulation(const FSimTrack& myTrack, RandomEngineAndDistribution const*);
91 
92  // Read the parameters
93  void readParameters(const edm::ParameterSet& fastCalo);
94 
95  void updateECAL(const std::map<CaloHitID,float>& hitMap, int onEcal, int trackID=0, float corr=1.0);
96  void updateHCAL(const std::map<CaloHitID,float>& hitMap, int trackID=0, float corr=1.0);
97  void updatePreshower(const std::map<CaloHitID,float>& hitMap, int trackID=0, float corr=1.0);
98 
99  void respCorr(double);
100 
101  void clean();
102 
103  private:
104 
107 
109 
112 
113  std::vector<std::pair<CaloHitID,float> > EBMapping_;
114  std::vector<std::pair<CaloHitID,float> > EEMapping_;
115  std::vector<std::pair<CaloHitID,float> > HMapping_;
116  std::vector<std::pair<CaloHitID,float> > ESMapping_;
117 
118  bool debug_;
119  std::vector<unsigned int> evtsToDebug_;
120 
122 
123  //Digitizer
126  std::vector<double> samplingHBHE_;
127  std::vector<double> samplingHF_;
128  std::vector<double> samplingHO_;
129  int ietaShiftHB_, ietaShiftHE_, ietaShiftHO_, ietaShiftHF_;
130  std::vector<double> timeShiftHB_;
131  std::vector<double> timeShiftHE_;
132  std::vector<double> timeShiftHF_;
133  std::vector<double> timeShiftHO_;
134 
139 
140  // Parameters
144  // double radiusFactor_;
145  double radiusFactorEB_ , radiusFactorEE_;
146  std::vector<double> radiusPreshowerCorrections_;
147  double aTerm, bTerm;
148  std::vector<double> mipValues_;
150  std::vector<double> theCoreIntervals_,theTailIntervals_;
151  double RCFactor_,RTFactor_;
152  //FR
153  int optionHDSim_, hdGridSize_, hdSimMethod_;
155  //RF
156 
159 
160  static std::vector<std::pair<int, float> > myZero_;
161 
162  // RespCorrP p, k_e(p), k_h(p) vectors and evaluated for each p
163  // ecorr and hcorr
164  std::vector<double> rsp;
165  std::vector<double> p_knots;
166  std::vector<double> k_e;
167  std::vector<double> k_h;
168  double ecorr;
169  double hcorr;
170 
171  // Used to check if the calorimeters was initialized
173 
174  std::vector<FSimTrack> muonSimTracks;
175  std::vector<FSimTrack> savedMuonSimTracks;
176  MaterialEffects* theMuonEcalEffects; // material effects for muons in ECAL
177  MaterialEffects* theMuonHcalEffects; // material effects for muons in HCAL
178 
179 
180  // If set to true the simulation in ECAL would be done 1X0 by 1X0
181  // this is slow but more adapted to detailed studies.
182  // Otherwise roughty 5 steps are used.
183  // This variable is transferred to EMShower
185 
186  //Gflash
191 
192  // HFShowerLibrary
196 
197  std::unique_ptr<KKCorrectionFactors> ecalCorrection;
198 
199 };
200 #endif
static AlgebraicMatrix initialize()
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
TRandom random
Definition: MVATrainer.cc:138
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:154
CaloGeometryHelper * myCalorimeter_
std::vector< double > timeShiftHB_
GammaFunctionGenerator * aGammaGenerator
std::vector< double > mipValues_
static std::vector< std::pair< int, float > > myZero_
std::vector< FSimTrack > savedMuonSimTracks
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_