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 "G4Step.hh"
27 #include "G4LogicalVolumeStore.hh"
28 #include "G4PhysicalVolumeStore.hh"
29 #include "G4Track.hh"
30 #include "G4TouchableHistory.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 
42 
43 public:
45  ~HGCPassive() override;
46 
47  void produce(edm::Event&, const edm::EventSetup&) override;
48 
49 private:
50  HGCPassive(const HGCPassive&) = delete; // stop default
51  const HGCPassive& operator=(const HGCPassive&) = delete;
52 
53  // observer classes
54  void update(const BeginOfRun * run) override;
55  void update(const BeginOfEvent * evt) override;
56  void update(const G4Step * step) override;
57 
58  //void endOfEvent(edm::PassiveHitContainer &HGCEEAbsE);
59  void endOfEvent(edm::PassiveHitContainer& hgcPH, unsigned int k);
60 
61  typedef std::map<G4LogicalVolume*,std::pair<unsigned int,std::string>>::iterator volumeIterator;
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 
69  std::vector<std::string> LVNames_;
70  G4VPhysicalVolume *topPV_;
71  G4LogicalVolume *topLV_;
72  std::map<G4LogicalVolume*,std::pair<unsigned int,std::string>> mapLV_;
74 
75  // some private members for ananlysis
76  unsigned int count_;
77  bool init_;
78  std::map<std::pair<G4LogicalVolume*,unsigned int>,std::array<double,3>> store_;
79 };
80 
81 
void storeInfo(const volumeIterator itr, G4LogicalVolume *plv, unsigned int copy, double time, double energy, bool flag)
Definition: HGCPassive.cc:212
def copy(args, dbName)
G4LogicalVolume * topLV_
Definition: HGCPassive.h:71
void endOfEvent(edm::PassiveHitContainer &hgcPH, unsigned int k)
Definition: HGCPassive.cc:167
volumeIterator findLV(G4LogicalVolume *plv)
Definition: HGCPassive.cc:194
G4VPhysicalVolume * topPV_
Definition: HGCPassive.h:70
G4VPhysicalVolume * getTopPV()
Definition: HGCPassive.cc:190
HGCPassive(const edm::ParameterSet &p)
Definition: HGCPassive.cc:22
std::vector< std::string > LVNames_
Definition: HGCPassive.h:69
~HGCPassive() override
Definition: HGCPassive.cc:42
std::string motherName_
Definition: HGCPassive.h:73
void produce(edm::Event &, const edm::EventSetup &) override
Definition: HGCPassive.cc:44
std::vector< PassiveHit > PassiveHitContainer
Definition: PassiveHit.h:60
std::map< G4LogicalVolume *, std::pair< unsigned int, std::string > > mapLV_
Definition: HGCPassive.h:72
int k[5][pyjets_maxn]
unsigned int count_
Definition: HGCPassive.h:76
void update(const BeginOfRun *run) override
This routine will be called when the appropriate signal arrives.
Definition: HGCPassive.cc:53
step
const HGCPassive & operator=(const HGCPassive &)=delete
bool init_
Definition: HGCPassive.h:77
std::map< G4LogicalVolume *, std::pair< unsigned int, std::string > >::iterator volumeIterator
Definition: HGCPassive.h:61
std::map< std::pair< G4LogicalVolume *, unsigned int >, std::array< double, 3 > > store_
Definition: HGCPassive.h:78