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