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:
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, double, double, double>
105  std::vector<PassiveData> store_;
106 };
107 
108 #endif
CaloSlaveSD.h
Handle.h
CaloSteppingAction::birkSlopeEC_
double birkSlopeEC_
Definition: CaloSteppingAction.h:99
Observer
Definition: Observer.h:23
CaloSteppingAction::nSD_
static const int nSD_
Definition: CaloSteppingAction.h:83
CaloSteppingAction::store_
std::vector< PassiveData > store_
Definition: CaloSteppingAction.h:105
CaloSteppingAction::curve_LY
double curve_LY(double crystalLength, double crystalDepth) const
Definition: CaloSteppingAction.cc:387
PassiveHit.h
BeginOfJob.h
step
step
Definition: StallMonitor.cc:94
SimProducer.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CaloSteppingAction::getDepth
uint16_t getDepth(bool flag, double crystalDepth, double radl) const
Definition: CaloSteppingAction.cc:377
CaloGVHit
Definition: CaloGVHit.h:30
pos
Definition: PixelAliasList.h:18
CaloSteppingAction::fillHits
void fillHits(edm::PCaloHitContainer &cc, int type)
Definition: CaloSteppingAction.cc:102
protons_cff.time
time
Definition: protons_cff.py:39
CaloSteppingAction::birkC3HC_
double birkC3HC_
Definition: CaloSteppingAction.h:101
EndOfEvent.h
CaloSteppingAction::volEESD_
std::vector< const G4LogicalVolume * > volEESD_
Definition: CaloSteppingAction.h:95
CaloSteppingAction::CaloSteppingAction
CaloSteppingAction(const edm::ParameterSet &p)
Definition: CaloSteppingAction.cc:33
HcalNumberingFromDDD.h
CaloSteppingAction::allSteps_
int allSteps_
Definition: CaloSteppingAction.h:98
chg
const float chg[109]
Definition: CoreSimTrack.cc:5
Observer.h
CaloSteppingAction::volHCSD_
std::vector< const G4LogicalVolume * > volHCSD_
Definition: CaloSteppingAction.h:95
MakerMacros.h
CaloSteppingAction::nameHCSD_
std::vector< std::string > nameHCSD_
Definition: CaloSteppingAction.h:93
BeginOfRun.h
CaloSteppingAction::xtalMap_
std::map< const G4LogicalVolume *, double > xtalMap_
Definition: CaloSteppingAction.h:96
CaloSteppingAction
Definition: CaloSteppingAction.h:52
CaloSteppingAction::getDetIDHC
uint32_t getDetIDHC(int det, int lay, int depth, const math::XYZVectorD &pos) const
Definition: CaloSteppingAction.cc:348
CaloSteppingAction::fillPassiveHits
void fillPassiveHits(edm::PassiveHitContainer &cc)
Definition: CaloSteppingAction.cc:109
HcalNumberingScheme.h
CaloSteppingAction::birkC1HC_
double birkC1HC_
Definition: CaloSteppingAction.h:100
CaloSteppingAction::fillHit
void fillHit(uint32_t id, double dE, double time, int primID, uint16_t depth, double em, int flag)
Definition: CaloSteppingAction.cc:360
BeginOfJob
Definition: BeginOfJob.h:8
EndOfEvent
Definition: EndOfEvent.h:6
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
CaloSteppingAction::nameEBSD_
std::vector< std::string > nameEBSD_
Definition: CaloSteppingAction.h:93
CaloSteppingAction::birkC2HC_
double birkC2HC_
Definition: CaloSteppingAction.h:100
HcalNumberingFromPS.h
CaloSteppingAction::getBirkHC
double getBirkHC(double dE, double step, double chg, double dens) const
Definition: CaloSteppingAction.cc:425
math::XYZVectorD
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
Definition: Vector3D.h:8
CaloSteppingAction::PassiveData
std::tuple< const G4LogicalVolume *, uint32_t, int, int, double, double, double, double, double, double, double > PassiveData
Definition: CaloSteppingAction.h:104
edm::ParameterSet
Definition: ParameterSet.h:47
CaloSteppingAction::birkCutEC_
double birkCutEC_
Definition: CaloSteppingAction.h:100
Event.h
EcalBarrelNumberingScheme.h
SimProducer
Definition: SimProducer.h:64
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
SimWatcherFactory.h
BeginOfEvent.h
CaloGVHit.h
CaloSteppingAction::NaNTrap
void NaNTrap(const G4Step *) const
Definition: CaloSteppingAction.cc:334
ModuleDef.h
CaloSteppingAction::nameHitC_
std::vector< std::string > nameHitC_
Definition: CaloSteppingAction.h:94
edm::PassiveHitContainer
std::vector< PassiveHit > PassiveHitContainer
Definition: PassiveHit.h:100
CaloSteppingAction::mapLV_
std::map< const G4LogicalVolume *, std::string > mapLV_
Definition: CaloSteppingAction.h:97
BeginOfEvent
Definition: BeginOfEvent.h:6
BeginOfRun
Definition: BeginOfRun.h:6
edm::EventSetup
Definition: EventSetup.h:58
EcalBaseNumber.h
CaloSteppingAction::eeNumberingScheme_
std::unique_ptr< EcalEndcapNumberingScheme > eeNumberingScheme_
Definition: CaloSteppingAction.h:85
CaloSteppingAction::nameEESD_
std::vector< std::string > nameEESD_
Definition: CaloSteppingAction.h:93
cc
CaloSteppingAction::eventID_
int eventID_
Definition: CaloSteppingAction.h:98
CaloSteppingAction::saveHits
void saveHits(int flag)
Definition: CaloSteppingAction.cc:442
CaloSteppingAction::getBirkL3
double getBirkL3(double dE, double step, double chg, double dens) const
Definition: CaloSteppingAction.cc:405
writedatasetfile.run
run
Definition: writedatasetfile.py:27
CaloSteppingAction::slave_
std::unique_ptr< CaloSlaveSD > slave_[nSD_]
Definition: CaloSteppingAction.h:91
CaloSteppingAction::~CaloSteppingAction
~CaloSteppingAction() override
Definition: CaloSteppingAction.cc:83
Point3D.h
edm::PCaloHitContainer
std::vector< PCaloHit > PCaloHitContainer
Definition: PCaloHitContainer.h:8
EventSetup.h
CaloSteppingAction::timeSliceUnit_
double timeSliceUnit_
Definition: CaloSteppingAction.h:101
CaloSteppingAction::count_
int count_
Definition: CaloSteppingAction.h:98
PCaloHitContainer.h
CaloSteppingAction::hitMap_
std::map< std::pair< int, CaloHitID >, CaloGVHit > hitMap_[nSD_]
Definition: CaloSteppingAction.h:102
CaloSteppingAction::volEBSD_
std::vector< const G4LogicalVolume * > volEBSD_
Definition: CaloSteppingAction.h:95
CaloSteppingAction::hcNumberingPS_
std::unique_ptr< HcalNumberingFromPS > hcNumberingPS_
Definition: CaloSteppingAction.h:86
ParameterSet.h
CaloSteppingAction::hcNumberingScheme_
std::unique_ptr< HcalNumberingScheme > hcNumberingScheme_
Definition: CaloSteppingAction.h:90
edm::Event
Definition: Event.h:73
EcalEndcapNumberingScheme.h
CaloSteppingAction::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: CaloSteppingAction.cc:88
CaloSteppingAction::slopeLY_
double slopeLY_
Definition: CaloSteppingAction.h:99
CaloSteppingAction::birkC1EC_
double birkC1EC_
Definition: CaloSteppingAction.h:99
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
CaloSteppingAction::update
void update(const BeginOfJob *job) override
This routine will be called when the appropriate signal arrives.
Definition: CaloSteppingAction.cc:131
CaloSteppingAction::ebNumberingScheme_
std::unique_ptr< EcalBarrelNumberingScheme > ebNumberingScheme_
Definition: CaloSteppingAction.h:84
HcalDDDSimConstants.h