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 *,
60  std::pair<unsigned int, std::string>>::iterator
62  G4VPhysicalVolume *getTopPV();
63  volumeIterator findLV(G4LogicalVolume *plv);
64  void storeInfo(const volumeIterator itr, G4LogicalVolume *plv,
65  unsigned int copy, double time, double energy, bool flag);
66 
67  private:
68  std::vector<std::string> LVNames_;
69  G4VPhysicalVolume *topPV_;
70  G4LogicalVolume *topLV_;
71  std::map<G4LogicalVolume *, std::pair<unsigned int, std::string>> mapLV_;
73 
74  // some private members for ananlysis
75  unsigned int count_;
76  bool init_;
77  std::map<std::pair<G4LogicalVolume *, unsigned int>, std::array<double, 3>>
79 };
void storeInfo(const volumeIterator itr, G4LogicalVolume *plv, unsigned int copy, double time, double energy, bool flag)
Definition: HGCPassive.cc:212
std::map< G4LogicalVolume *, std::pair< unsigned int, std::string > >::iterator volumeIterator
Definition: HGCPassive.h:61
def copy(args, dbName)
G4LogicalVolume * topLV_
Definition: HGCPassive.h:70
void endOfEvent(edm::PassiveHitContainer &hgcPH, unsigned int k)
Definition: HGCPassive.cc:165
volumeIterator findLV(G4LogicalVolume *plv)
Definition: HGCPassive.cc:194
G4VPhysicalVolume * topPV_
Definition: HGCPassive.h:69
G4VPhysicalVolume * getTopPV()
Definition: HGCPassive.cc:188
HGCPassive(const edm::ParameterSet &p)
Definition: HGCPassive.cc:22
std::vector< std::string > LVNames_
Definition: HGCPassive.h:68
~HGCPassive() override
Definition: HGCPassive.cc:41
std::string motherName_
Definition: HGCPassive.h:72
void produce(edm::Event &, const edm::EventSetup &) override
Definition: HGCPassive.cc:43
std::vector< PassiveHit > PassiveHitContainer
Definition: PassiveHit.h:58
int k[5][pyjets_maxn]
unsigned int count_
Definition: HGCPassive.h:75
std::map< std::pair< G4LogicalVolume *, unsigned int >, std::array< double, 3 > > store_
Definition: HGCPassive.h:78
void update(const BeginOfRun *run) override
This routine will be called when the appropriate signal arrives.
Definition: HGCPassive.cc:52
step
Definition: StallMonitor.cc:94
const HGCPassive & operator=(const HGCPassive &)=delete
bool init_
Definition: HGCPassive.h:76
std::map< G4LogicalVolume *, std::pair< unsigned int, std::string > > mapLV_
Definition: HGCPassive.h:71