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 CaloGeometryHelper;
27 class Histos;
28 class HSParameters;
31 class MaterialEffects;
33 //Gflash
38 // FastHFshowerLibrary
40 
41 namespace edm {
42  class ParameterSet;
43 }
44 
46 
47  public:
49  CalorimetryManager(FSimEvent* aSimEvent,
50  const edm::ParameterSet& fastCalo,
51  const edm::ParameterSet& MuonECALPars,
52  const edm::ParameterSet& MuonHCALPars,
53  const edm::ParameterSet& fastGflash);
55 
56  // Does the real job
58  void reconstructTrack(FSimTrack& myTrack, RandomEngineAndDistribution const*);
59  void reconstruct(RandomEngineAndDistribution const*);
60 
61  // Return the address of the Calorimeter
62  CaloGeometryHelper * getCalorimeter() const {return myCalorimeter_;}
63 
64  // Return the address of the FastHFShowerLibrary
65  FastHFShowerLibrary * getHFShowerLibrary() const {return theHFShowerLibrary;}
66 
67  // load container from edm::Event
68  void loadFromEcalBarrel(edm::PCaloHitContainer & c) const;
69 
70  void loadFromEcalEndcap(edm::PCaloHitContainer & c) const;
71 
72  void loadFromHcal(edm::PCaloHitContainer & c) const;
73 
74  void loadFromPreshower(edm::PCaloHitContainer & c) const;
75 
76  void loadMuonSimTracks(edm::SimTrackContainer & m) const;
77 
78  void harvestMuonSimTracks(edm::SimTrackContainer & m) const;
79 
80  private:
81  // Simulation of electromagnetic showers in PS, ECAL, HCAL
82  void EMShowerSimulation(const FSimTrack& myTrack, RandomEngineAndDistribution const*);
83 
84  void reconstructHCAL(const FSimTrack& myTrack, RandomEngineAndDistribution const*);
85 
86  void MuonMipSimulation(const FSimTrack & myTrack, RandomEngineAndDistribution const*);
87 
89  void HDShowerSimulation(const FSimTrack& myTrack, RandomEngineAndDistribution const*);
90 
91  // Read the parameters
92  void readParameters(const edm::ParameterSet& fastCalo);
93 
94  void updateECAL(const std::map<CaloHitID,float>& hitMap, int onEcal, int trackID=0, float corr=1.0);
95  void updateHCAL(const std::map<CaloHitID,float>& hitMap, int trackID=0, float corr=1.0);
96  void updatePreshower(const std::map<CaloHitID,float>& hitMap, int trackID=0, float corr=1.0);
97 
98  void respCorr(double);
99 
100  void clean();
101 
102  private:
103 
106 
108 
111 
112  std::vector<std::pair<CaloHitID,float> > EBMapping_;
113  std::vector<std::pair<CaloHitID,float> > EEMapping_;
114  std::vector<std::pair<CaloHitID,float> > HMapping_;
115  std::vector<std::pair<CaloHitID,float> > ESMapping_;
116 
117  bool debug_;
118  std::vector<unsigned int> evtsToDebug_;
119 
121 
122  //Digitizer
125  std::vector<double> samplingHBHE_;
126  std::vector<double> samplingHF_;
127  std::vector<double> samplingHO_;
128  int ietaShiftHB_, ietaShiftHE_, ietaShiftHO_, ietaShiftHF_;
129  std::vector<double> timeShiftHB_;
130  std::vector<double> timeShiftHE_;
131  std::vector<double> timeShiftHF_;
132  std::vector<double> timeShiftHO_;
133 
138 
139  // Parameters
143  // double radiusFactor_;
144  double radiusFactorEB_ , radiusFactorEE_;
145  std::vector<double> radiusPreshowerCorrections_;
146  double aTerm, bTerm;
147  std::vector<double> mipValues_;
149  std::vector<double> theCoreIntervals_,theTailIntervals_;
150  double RCFactor_,RTFactor_;
151  //FR
152  int optionHDSim_, hdGridSize_, hdSimMethod_;
154  //RF
155 
158 
159  static std::vector<std::pair<int, float> > myZero_;
160 
161  // RespCorrP p, k_e(p), k_h(p) vectors and evaluated for each p
162  // ecorr and hcorr
163  std::vector<double> rsp;
164  std::vector<double> p_knots;
165  std::vector<double> k_e;
166  std::vector<double> k_h;
167  double ecorr;
168  double hcorr;
169 
170  // Used to check if the calorimeters was initialized
172 
173  std::vector<FSimTrack> muonSimTracks;
174  std::vector<FSimTrack> savedMuonSimTracks;
175  MaterialEffects* theMuonEcalEffects; // material effects for muons in ECAL
176  MaterialEffects* theMuonHcalEffects; // material effects for muons in HCAL
177 
178 
179  // If set to true the simulation in ECAL would be done 1X0 by 1X0
180  // this is slow but more adapted to detailed studies.
181  // Otherwise roughty 5 steps are used.
182  // This variable is transferred to EMShower
184 
185  //Gflash
190 
191  // HFShowerLibrary
195 
196  std::unique_ptr<KKCorrectionFactors> ecalCorrection;
197 
198 };
199 #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_