CMS 3D CMS Logo

HGCPassive.h
Go to the documentation of this file.
1 // File: HGCPassive.cc
3 // copied from SimG4HGCalValidation
4 // Description: Main analysis class for HGCal Validation of G4 Hits
6 
12 
13 // to retreive hits
15 
19 
23 
25 
26 #include "G4LogicalVolumeStore.hh"
27 #include "G4PhysicalVolumeStore.hh"
28 #include "G4Step.hh"
29 #include "G4TouchableHistory.hh"
30 #include "G4Track.hh"
31 
32 #include <array>
33 #include <map>
34 #include <string>
35 #include <vector>
36 
37 class HGCPassive : public SimProducer,
38  public Observer<const BeginOfRun *>,
39  public Observer<const BeginOfEvent *>,
40  public Observer<const G4Step *> {
41 public:
43  ~HGCPassive() override;
44 
45  void produce(edm::Event &, const edm::EventSetup &) override;
46 
47 private:
48  HGCPassive(const HGCPassive &) = delete; // stop default
49  const HGCPassive &operator=(const HGCPassive &) = delete;
50 
51  // observer classes
52  void update(const BeginOfRun *run) override;
53  void update(const BeginOfEvent *evt) override;
54  void update(const G4Step *step) override;
55 
56  // void endOfEvent(edm::PassiveHitContainer &HGCEEAbsE);
57  void endOfEvent(edm::PassiveHitContainer &hgcPH, unsigned int k);
58 
59  typedef std::map<G4LogicalVolume *, std::pair<unsigned int, std::string>>::iterator volumeIterator;
60  G4VPhysicalVolume *getTopPV();
61  volumeIterator findLV(G4LogicalVolume *plv);
62  void storeInfo(
63  const volumeIterator itr, G4LogicalVolume *plv, unsigned int copy, double time, double energy, bool flag);
64 
65 private:
66  std::vector<std::string> LVNames_;
67  G4VPhysicalVolume *topPV_;
68  G4LogicalVolume *topLV_;
69  std::map<G4LogicalVolume *, std::pair<unsigned int, std::string>> mapLV_;
71 
72  // some private members for ananlysis
73  unsigned int count_;
74  bool init_;
75  std::map<std::pair<G4LogicalVolume *, unsigned int>, std::array<double, 3>> store_;
76 };
Observer
Definition: Observer.h:23
PassiveHit.h
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
HGCPassive::topPV_
G4VPhysicalVolume * topPV_
Definition: HGCPassive.h:67
step
step
Definition: StallMonitor.cc:94
HGCPassive::~HGCPassive
~HGCPassive() override
Definition: HGCPassive.cc:40
SimProducer.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HGCPassive::operator=
const HGCPassive & operator=(const HGCPassive &)=delete
protons_cff.time
time
Definition: protons_cff.py:39
EndOfEvent.h
Observer.h
HGCPassive::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: HGCPassive.cc:42
HGCPassive::motherName_
std::string motherName_
Definition: HGCPassive.h:70
HGCPassive::mapLV_
std::map< G4LogicalVolume *, std::pair< unsigned int, std::string > > mapLV_
Definition: HGCPassive.h:69
MakerMacros.h
BeginOfRun.h
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
dqmdumpme.k
k
Definition: dqmdumpme.py:60
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCPassive::update
void update(const BeginOfRun *run) override
This routine will be called when the appropriate signal arrives.
Definition: HGCPassive.cc:50
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
SimProducer
Definition: SimProducer.h:64
SimWatcherFactory.h
HGCPassive::init_
bool init_
Definition: HGCPassive.h:74
BeginOfEvent.h
ModuleDef.h
edm::PassiveHitContainer
std::vector< PassiveHit > PassiveHitContainer
Definition: PassiveHit.h:100
HGCPassive::HGCPassive
HGCPassive(const edm::ParameterSet &p)
Definition: HGCPassive.cc:22
BeginOfEvent
Definition: BeginOfEvent.h:6
BeginOfRun
Definition: BeginOfRun.h:6
edm::EventSetup
Definition: EventSetup.h:58
HGCPassive::endOfEvent
void endOfEvent(edm::PassiveHitContainer &hgcPH, unsigned int k)
Definition: HGCPassive.cc:151
HGCPassive::LVNames_
std::vector< std::string > LVNames_
Definition: HGCPassive.h:66
HGCPassive::getTopPV
G4VPhysicalVolume * getTopPV()
Definition: HGCPassive.cc:172
writedatasetfile.run
run
Definition: writedatasetfile.py:27
HGCPassive::volumeIterator
std::map< G4LogicalVolume *, std::pair< unsigned int, std::string > >::iterator volumeIterator
Definition: HGCPassive.h:59
HGCPassive::storeInfo
void storeInfo(const volumeIterator itr, G4LogicalVolume *plv, unsigned int copy, double time, double energy, bool flag)
Definition: HGCPassive.cc:195
EventSetup.h
ParameterSet.h
HGCPassive::topLV_
G4LogicalVolume * topLV_
Definition: HGCPassive.h:68
edm::Event
Definition: Event.h:73
HGCPassive::store_
std::map< std::pair< G4LogicalVolume *, unsigned int >, std::array< double, 3 > > store_
Definition: HGCPassive.h:75
HGCPassive
Definition: HGCPassive.h:37
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
HGCPassive::findLV
volumeIterator findLV(G4LogicalVolume *plv)
Definition: HGCPassive.cc:176
HGCPassive::count_
unsigned int count_
Definition: HGCPassive.h:73