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 public:
48  CalorimetryManager(FSimEvent* aSimEvent,
49  const edm::ParameterSet& fastCalo,
50  const edm::ParameterSet& MuonECALPars,
51  const edm::ParameterSet& MuonHCALPars,
52  const edm::ParameterSet& fastGflash);
54 
55  // Does the real job
56  void initialize(RandomEngineAndDistribution const* random);
57  void reconstructTrack(FSimTrack& myTrack, RandomEngineAndDistribution const*);
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  void harvestMuonSimTracks(edm::SimTrackContainer& m) const;
78 
79 private:
80  // Simulation of electromagnetic showers in PS, ECAL, HCAL
81  void EMShowerSimulation(const FSimTrack& myTrack, RandomEngineAndDistribution const*);
82 
83  void reconstructHCAL(const FSimTrack& myTrack, RandomEngineAndDistribution const*);
84 
85  void MuonMipSimulation(const FSimTrack& myTrack, RandomEngineAndDistribution const*);
86 
88  void HDShowerSimulation(const FSimTrack& myTrack, RandomEngineAndDistribution const*);
89 
90  // Read the parameters
91  void readParameters(const edm::ParameterSet& fastCalo);
92 
93  void updateECAL(const std::map<CaloHitID, float>& hitMap, int onEcal, int trackID = 0, float corr = 1.0);
94  void updateHCAL(const std::map<CaloHitID, float>& hitMap, int trackID = 0, float corr = 1.0);
95  void updatePreshower(const std::map<CaloHitID, float>& hitMap, int trackID = 0, float corr = 1.0);
96 
97  void respCorr(double);
98 
99  void clean();
100 
101 private:
104 
106 
109 
110  std::vector<std::pair<CaloHitID, float> > EBMapping_;
111  std::vector<std::pair<CaloHitID, float> > EEMapping_;
112  std::vector<std::pair<CaloHitID, float> > HMapping_;
113  std::vector<std::pair<CaloHitID, float> > ESMapping_;
114 
115  bool debug_;
116  std::vector<unsigned int> evtsToDebug_;
117 
119 
120  //Digitizer
123  std::vector<double> samplingHBHE_;
124  std::vector<double> samplingHF_;
125  std::vector<double> samplingHO_;
126  int ietaShiftHB_, ietaShiftHE_, ietaShiftHO_, ietaShiftHF_;
127  std::vector<double> timeShiftHB_;
128  std::vector<double> timeShiftHE_;
129  std::vector<double> timeShiftHF_;
130  std::vector<double> timeShiftHO_;
131 
136 
137  // Parameters
141  // double radiusFactor_;
142  double radiusFactorEB_, radiusFactorEE_;
143  std::vector<double> radiusPreshowerCorrections_;
144  double aTerm, bTerm;
145  std::vector<double> mipValues_;
147  std::vector<double> theCoreIntervals_, theTailIntervals_;
148  double RCFactor_, RTFactor_;
149  //FR
150  int optionHDSim_, hdGridSize_, hdSimMethod_;
152  //RF
153 
156 
157  static std::vector<std::pair<int, float> > myZero_;
158 
159  // RespCorrP p, k_e(p), k_h(p) vectors and evaluated for each p
160  // ecorr and hcorr
161  std::vector<double> rsp;
162  std::vector<double> p_knots;
163  std::vector<double> k_e;
164  std::vector<double> k_h;
165  double ecorr;
166  double hcorr;
167 
168  // Used to check if the calorimeters was initialized
170 
171  std::vector<FSimTrack> muonSimTracks;
172  std::vector<FSimTrack> savedMuonSimTracks;
173  MaterialEffects* theMuonEcalEffects; // material effects for muons in ECAL
174  MaterialEffects* theMuonHcalEffects; // material effects for muons in HCAL
175 
176  // If set to true the simulation in ECAL would be done 1X0 by 1X0
177  // this is slow but more adapted to detailed studies.
178  // Otherwise roughty 5 steps are used.
179  // This variable is transferred to EMShower
181 
182  //Gflash
187 
188  // HFShowerLibrary
192 
193  std::unique_ptr<KKCorrectionFactors> ecalCorrection;
194 };
195 #endif
static AlgebraicMatrix initialize()
std::vector< double > rsp
std::vector< double > k_h
RawParticle myElec
A few pointers to save time.
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
static void clean(char *s)
std::vector< FSimTrack > muonSimTracks
const LandauFluctuationGenerator * aLandauGenerator
std::vector< double > samplingHF_
GflashAntiProtonShowerProfile * theAntiProtonProfile
FastHFShowerLibrary * getHFShowerLibrary() const
GflashProtonShowerProfile * theProtonProfile
std::vector< std::pair< CaloHitID, float > > ESMapping_
std::vector< double > radiusPreshowerCorrections_
std::vector< double > theTailIntervals_
std::vector< double > samplingHBHE_
HCALResponse * myHDResponse_
JetCorrectorParameters corr
Definition: classes.h:5
CaloGeometryHelper * myCalorimeter_
std::vector< double > timeShiftHB_
std::vector< std::pair< CaloHitID, float > > HMapping_
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 > > EBMapping_
std::vector< double > samplingHO_
FastHFShowerLibrary * theHFShowerLibrary
std::unique_ptr< KKCorrectionFactors > ecalCorrection
HSParameters * myHSParameters_
std::vector< SimTrack > SimTrackContainer
std::vector< double > timeShiftHE_