CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CalorimetryManager.h
Go to the documentation of this file.
1 #ifndef CALORIMETRYMANAGER_H
2 #define CALORIMETRYMANAGER_H
3 
5 
6 // FastSimulation headers
12 
13 // For the uint32_t
14 //#include <boost/cstdint.hpp>
15 #include <map>
16 #include <algorithm>
17 
18 class FSimEvent;
19 class FSimTrack;
20 class RawParticle;
21 class CaloGeometryHelper;
22 class Histos;
23 class HSParameters;
24 class RandomEngine;
27 class MaterialEffects;
28 //Gflash
33 
34 class DQMStore;
35 
36 namespace edm {
37  class ParameterSet;
38 }
39 
41 
42  public:
44  CalorimetryManager(FSimEvent* aSimEvent,
45  const edm::ParameterSet& fastCalo,
46  const edm::ParameterSet& MuonECALPars,
47  const edm::ParameterSet& MuonHCALPars,
48  const edm::ParameterSet& fastGflash,
49  const RandomEngine* engine);
51 
52  // Does the real job
53  void reconstruct();
54 
55  // Return the address of the Calorimeter
57 
58  // load container from edm::Event
60 
62 
64 
66 
68 
69  private:
70  // Simulation of electromagnetic showers in PS, ECAL, HCAL
71  void EMShowerSimulation(const FSimTrack& myTrack);
72 
73  // Simulation of electromagnetic showers in VFCAL
74  void reconstructECAL(const FSimTrack& track) ;
75 
76  void reconstructHCAL(const FSimTrack& myTrack);
77 
78  void MuonMipSimulation(const FSimTrack & myTrack);
79 
81  void HDShowerSimulation(const FSimTrack& myTrack);
82 
83  // Read the parameters
84  void readParameters(const edm::ParameterSet& fastCalo);
85 
86  void updateMap(uint32_t cellid,float energy,int id,std::map<uint32_t,std::vector<std::pair<int,float> > >& mymap);
87 
88  void updateMap(int hi,float energy,int id,std::vector<std::vector<std::pair<int,float> > > & mymap,std::vector<int> & firedCells);
89 
90  void respCorr(double);
91 
92  void clean();
93 
94  private:
95 
98 
101 
102 
105 
106  // In the not unfolded case (standard) the most inner vector will be of size = 1
107  // the preshower does not have hashed_indices, hence the map
108  std::vector<std::vector<std::pair<int,float> > > EBMapping_;
109  std::vector<std::vector<std::pair<int,float> > > EEMapping_;
110  std::vector<std::vector<std::pair<int,float> > > HMapping_;
111  std::map<uint32_t,std::vector<std::pair<int,float> > > ESMapping_;
112 
113  std::vector<int> firedCellsEB_;
114  std::vector<int> firedCellsEE_;
115  std::vector<int> firedCellsHCAL_;
116 
117  // this is bad, the same information already exists in CaloRecHitsProducers
118  // should make a es_producer of CaloGeometryTools
119  std::vector<DetId> theDetIds_;
120  bool debug_;
121  bool useDQM_;
122  std::vector<unsigned int> evtsToDebug_;
123 
124 
125 
127 
132 
133  // Parameters
137  // double radiusFactor_;
139  std::vector<double> radiusPreshowerCorrections_;
140  double aTerm, bTerm;
141  std::vector<double> mipValues_;
145  //FR
148  //RF
149 
150  // Famos Random Engine
154 
155  static std::vector<std::pair<int, float> > myZero_;
156 
157  // RespCorrP p, k_e(p), k_h(p) vectors and evaluated for each p
158  // ecorr and hcorr
159  std::vector<double> rsp;
160  std::vector<double> p_knots;
161  std::vector<double> k_e;
162  std::vector<double> k_h;
163  double ecorr;
164  double hcorr;
165 
166  // Used to check if the calorimeters was initialized
168 
169  std::vector<FSimTrack> muonSimTracks;
170  MaterialEffects* theMuonEcalEffects; // material effects for muons in ECAL
171  MaterialEffects* theMuonHcalEffects; // material effects for muons in HCAL
172 
173 
174  // If set to true the simulation in ECAL would be done 1X0 by 1X0
175  // this is slow but more adapted to detailed studies.
176  // Otherwise roughty 5 steps are used.
177  // This variable is transferred to EMShower
179 
180  //Gflash
185 };
186 #endif
std::vector< double > rsp
std::vector< double > k_h
RawParticle myElec
A few pointers to save time.
std::vector< PCaloHit > PCaloHitContainer
GflashPiKShowerProfile * thePiKProfile
void updateMap(uint32_t cellid, float energy, int id, std::map< uint32_t, std::vector< std::pair< int, float > > > &mymap)
std::map< uint32_t, std::vector< std::pair< int, float > > > ESMapping_
MaterialEffects * theMuonEcalEffects
MaterialEffects * theMuonHcalEffects
std::vector< std::vector< std::pair< int, float > > > EBMapping_
GflashHadronShowerProfile * theProfile
void reconstructECAL(const FSimTrack &track)
void loadFromPreshower(edm::PCaloHitContainer &c) const
CaloGeometryHelper * getCalorimeter() const
void readParameters(const edm::ParameterSet &fastCalo)
void HDShowerSimulation(const FSimTrack &myTrack)
Hadronic Shower Simulation.
void MuonMipSimulation(const FSimTrack &myTrack)
std::vector< std::vector< std::pair< int, float > > > EEMapping_
std::vector< double > p_knots
std::vector< int > firedCellsEB_
std::vector< int > firedCellsHCAL_
std::vector< FSimTrack > muonSimTracks
const RandomEngine * random
const LandauFluctuationGenerator * aLandauGenerator
GflashAntiProtonShowerProfile * theAntiProtonProfile
GflashProtonShowerProfile * theProtonProfile
void loadFromEcalEndcap(edm::PCaloHitContainer &c) const
std::vector< DetId > theDetIds_
std::vector< double > radiusPreshowerCorrections_
std::vector< int > firedCellsEE_
std::vector< double > theTailIntervals_
std::vector< std::vector< std::pair< int, float > > > HMapping_
void loadMuonSimTracks(edm::SimTrackContainer &m) const
HCALResponse * myHDResponse_
CaloGeometryHelper * myCalorimeter_
std::vector< double > theCoreIntervals_
void loadFromHcal(edm::PCaloHitContainer &c) const
void EMShowerSimulation(const FSimTrack &myTrack)
GammaFunctionGenerator * aGammaGenerator
std::vector< double > mipValues_
static std::vector< std::pair< int, float > > myZero_
std::vector< unsigned int > evtsToDebug_
std::vector< double > k_e
Definition: Histos.h:19
HSParameters * myHSParameters_
std::vector< SimTrack > SimTrackContainer
void reconstructHCAL(const FSimTrack &myTrack)
void loadFromEcalBarrel(edm::PCaloHitContainer &c) const