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 <vector>
33 #include <string>
34 #include <map>
35 
36 class HGCPassive : public SimProducer,
37  public Observer<const BeginOfRun *>,
38  public Observer<const BeginOfEvent *>,
39  public Observer<const G4Step *> {
40 
41 
42 public:
44  virtual ~HGCPassive();
45 
46  void produce(edm::Event&, const edm::EventSetup&);
47 
48 private:
49  HGCPassive(const HGCPassive&); // stop default
50  const HGCPassive& operator=(const HGCPassive&);
51 
52  // observer classes
53  void update(const BeginOfRun * run);
54  void update(const BeginOfEvent * evt);
55  void update(const G4Step * step);
56 
57  //void endOfEvent(edm::PassiveHitContainer &HGCEEAbsE);
58  void endOfEvent(edm::PassiveHitContainer& hgcPH, unsigned int k);
59 
60  typedef std::map<G4LogicalVolume*,std::pair<unsigned int,std::string>>::iterator volumeIterator;
61  G4VPhysicalVolume * getTopPV();
62  volumeIterator findLV(G4LogicalVolume * plv);
63  void storeInfo(const volumeIterator itr, G4LogicalVolume* plv,
64  unsigned int copy, double time, double energy);
65 
66 private:
67 
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::pair<double,double>> store_;
78 };
79 
80 
G4LogicalVolume * topLV_
Definition: HGCPassive.h:70
void update(const BeginOfRun *run)
This routine will be called when the appropriate signal arrives.
Definition: HGCPassive.cc:54
void endOfEvent(edm::PassiveHitContainer &hgcPH, unsigned int k)
Definition: HGCPassive.cc:150
volumeIterator findLV(G4LogicalVolume *plv)
Definition: HGCPassive.cc:176
std::map< std::pair< G4LogicalVolume *, unsigned int >, std::pair< double, double > > store_
Definition: HGCPassive.h:77
G4VPhysicalVolume * topPV_
Definition: HGCPassive.h:69
virtual ~HGCPassive()
Definition: HGCPassive.cc:42
G4VPhysicalVolume * getTopPV()
Definition: HGCPassive.cc:172
HGCPassive(const edm::ParameterSet &p)
Definition: HGCPassive.cc:22
const HGCPassive & operator=(const HGCPassive &)
std::vector< std::string > LVNames_
Definition: HGCPassive.h:68
void storeInfo(const volumeIterator itr, G4LogicalVolume *plv, unsigned int copy, double time, double energy)
Definition: HGCPassive.cc:194
std::string motherName_
Definition: HGCPassive.h:72
std::vector< PassiveHit > PassiveHitContainer
Definition: PassiveHit.h:57
std::map< G4LogicalVolume *, std::pair< unsigned int, std::string > > mapLV_
Definition: HGCPassive.h:71
int k[5][pyjets_maxn]
unsigned int count_
Definition: HGCPassive.h:75
void produce(edm::Event &, const edm::EventSetup &)
Definition: HGCPassive.cc:45
step
bool init_
Definition: HGCPassive.h:76
std::map< G4LogicalVolume *, std::pair< unsigned int, std::string > >::iterator volumeIterator
Definition: HGCPassive.h:60