CMS 3D CMS Logo

SimG4FluxProducer.h
Go to the documentation of this file.
1 #ifndef SimG4CMSForwardSimG4FluxProducer_h
2 #define SimG4CMSForwardSimG4FluxProducer_h
3 
9 
10 // to retreive hits
12 
16 
17 #include "G4Step.hh"
18 #include "G4LogicalVolumeStore.hh"
19 #include "G4PhysicalVolumeStore.hh"
20 
21 #include <vector>
22 #include <string>
23 #include <map>
24 
26  public Observer<const BeginOfRun *>,
27  public Observer<const BeginOfEvent *>,
28  public Observer<const G4Step *> {
29 
30 
31 public:
33  ~SimG4FluxProducer() override;
34 
35  void produce(edm::Event&, const edm::EventSetup&) override;
36 
37 private:
38  SimG4FluxProducer(const SimG4FluxProducer&) = delete; // stop default
39  const SimG4FluxProducer& operator=(const SimG4FluxProducer&) = delete;
40 
41  // observer classes
42  void update(const BeginOfRun * run) override;
43  void update(const BeginOfEvent * evt) override;
44  void update(const G4Step * step) override;
45 
46  void endOfEvent(ParticleFlux& pflx, unsigned int k);
47  G4VPhysicalVolume * getTopPV();
48  std::map<G4LogicalVolume*,std::pair<unsigned int,std::string>>::iterator findLV(G4LogicalVolume * plv);
49 
50 private:
51 
52  std::vector<std::string> LVNames_;
53  std::vector<int> LVTypes_;
54  G4VPhysicalVolume *topPV_;
55  std::map<G4LogicalVolume*,std::pair<unsigned int,std::string>> mapLV_;
56 
57  // some private members for ananlysis
58  unsigned int count_;
59  bool init_;
60  std::map<std::pair<G4LogicalVolume*,unsigned int>,ParticleFlux> store_;
61 };
62 
63 #endif
const SimG4FluxProducer & operator=(const SimG4FluxProducer &)=delete
SimG4FluxProducer(const edm::ParameterSet &p)
std::map< std::pair< G4LogicalVolume *, unsigned int >, ParticleFlux > store_
~SimG4FluxProducer() override
void produce(edm::Event &, const edm::EventSetup &) override
std::map< G4LogicalVolume *, std::pair< unsigned int, std::string > > mapLV_
G4VPhysicalVolume * topPV_
std::vector< int > LVTypes_
void update(const BeginOfRun *run) override
This routine will be called when the appropriate signal arrives.
std::map< G4LogicalVolume *, std::pair< unsigned int, std::string > >::iterator findLV(G4LogicalVolume *plv)
G4VPhysicalVolume * getTopPV()
std::vector< std::string > LVNames_
int k[5][pyjets_maxn]
void endOfEvent(ParticleFlux &pflx, unsigned int k)
step
Definition: StallMonitor.cc:94