CMS 3D CMS Logo

CaloSteppingAction.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_CaloSteppingAction_H
2 #define SimG4CMS_CaloSteppingAction_H
3 //#define HcalNumberingTest
4 
12 
20 
24 
28 
32 #ifdef HcalNumberingTest
35 #endif
36 
37 #include "G4LogicalVolume.hh"
38 #include "G4Region.hh"
39 #include "G4Step.hh"
40 #include "G4UserSteppingAction.hh"
41 #include "G4VPhysicalVolume.hh"
42 #include "G4VTouchable.hh"
43 #include "G4Track.hh"
44 
45 #include <algorithm>
46 #include <iostream>
47 #include <memory>
48 #include <string>
49 #include <vector>
50 #include <utility>
51 
53  public Observer<const BeginOfJob *>,
54  public Observer<const BeginOfRun *>,
55  public Observer<const BeginOfEvent *>,
56  public Observer<const EndOfEvent *>,
57  public Observer<const G4Step *> {
58 public:
60  ~CaloSteppingAction() override;
61 
62  void produce(edm::Event &, const edm::EventSetup &) override;
63 
64 private:
65  void fillHits(edm::PCaloHitContainer &cc, int type);
67  // observer classes
68  void update(const BeginOfJob *job) override;
69  void update(const BeginOfRun *run) override;
70  void update(const BeginOfEvent *evt) override;
71  void update(const G4Step *step) override;
72  void update(const EndOfEvent *evt) override;
73 
74  void NaNTrap(const G4Step *) const;
75  uint32_t getDetIDHC(int det, int lay, int depth, const math::XYZVectorD &pos) const;
76  void fillHit(uint32_t id, double dE, double time, int primID, uint16_t depth, double em, int flag);
77  uint16_t getDepth(bool flag, double crystalDepth, double radl) const;
78  double curve_LY(double crystalLength, double crystalDepth) const;
79  double getBirkL3(double dE, double step, double chg, double dens) const;
80  double getBirkHC(double dE, double step, double chg, double dens) const;
81  void saveHits(int flag);
82 
83  static const int nSD_ = 3;
84  std::unique_ptr<EcalBarrelNumberingScheme> ebNumberingScheme_;
85  std::unique_ptr<EcalEndcapNumberingScheme> eeNumberingScheme_;
86  std::unique_ptr<HcalNumberingFromPS> hcNumberingPS_;
87 #ifdef HcalNumberingTest
88  std::unique_ptr<HcalNumberingFromDDD> hcNumbering_;
89 #endif
90  std::unique_ptr<HcalNumberingScheme> hcNumberingScheme_;
91  std::unique_ptr<CaloSlaveSD> slave_[nSD_];
92 
93  std::vector<std::string> nameEBSD_, nameEESD_, nameHCSD_;
94  std::vector<std::string> nameHitC_;
95  std::vector<const G4LogicalVolume *> volEBSD_, volEESD_, volHCSD_;
96  std::map<const G4LogicalVolume *, double> xtalMap_;
97  std::map<const G4LogicalVolume *, std::string> mapLV_;
102  std::map<std::pair<int, CaloHitID>, CaloGVHit> hitMap_[nSD_];
103  typedef std::tuple<const G4LogicalVolume *, uint32_t, int, int, double, double, double, double> PassiveData;
104  std::vector<PassiveData> store_;
105 };
106 
107 #endif
std::map< std::pair< int, CaloHitID >, CaloGVHit > hitMap_[nSD_]
std::vector< const G4LogicalVolume * > volEBSD_
type
Definition: HCALResponse.h:21
std::vector< PCaloHit > PCaloHitContainer
double getBirkL3(double dE, double step, double chg, double dens) const
const float chg[109]
Definition: CoreSimTrack.cc:5
void produce(edm::Event &, const edm::EventSetup &) override
uint32_t getDetIDHC(int det, int lay, int depth, const math::XYZVectorD &pos) const
double getBirkHC(double dE, double step, double chg, double dens) const
double curve_LY(double crystalLength, double crystalDepth) const
void fillHits(edm::PCaloHitContainer &cc, int type)
std::vector< const G4LogicalVolume * > volEESD_
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
Definition: Vector3D.h:8
std::vector< std::string > nameHitC_
std::map< const G4LogicalVolume *, std::string > mapLV_
CaloSteppingAction(const edm::ParameterSet &p)
std::vector< const G4LogicalVolume * > volHCSD_
std::vector< std::string > nameHCSD_
std::map< const G4LogicalVolume *, double > xtalMap_
void fillPassiveHits(edm::PassiveHitContainer &cc)
std::vector< PassiveHit > PassiveHitContainer
Definition: PassiveHit.h:75
std::unique_ptr< CaloSlaveSD > slave_[nSD_]
std::vector< std::string > nameEBSD_
void fillHit(uint32_t id, double dE, double time, int primID, uint16_t depth, double em, int flag)
void NaNTrap(const G4Step *) const
std::unique_ptr< HcalNumberingFromPS > hcNumberingPS_
std::unique_ptr< HcalNumberingScheme > hcNumberingScheme_
void update(const BeginOfJob *job) override
This routine will be called when the appropriate signal arrives.
std::unique_ptr< EcalBarrelNumberingScheme > ebNumberingScheme_
std::unique_ptr< EcalEndcapNumberingScheme > eeNumberingScheme_
std::vector< std::string > nameEESD_
std::vector< PassiveData > store_
step
Definition: StallMonitor.cc:94
static const int nSD_
uint16_t getDepth(bool flag, double crystalDepth, double radl) const
~CaloSteppingAction() override
std::tuple< const G4LogicalVolume *, uint32_t, int, int, double, double, double, double > PassiveData