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  virtual ~SimG4FluxProducer();
34 
35  void produce(edm::Event&, const edm::EventSetup&);
36 
37 private:
38  SimG4FluxProducer(const SimG4FluxProducer&); // stop default
40 
41  // observer classes
42  void update(const BeginOfRun * run);
43  void update(const BeginOfEvent * evt);
44  void update(const G4Step * step);
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
SimG4FluxProducer(const edm::ParameterSet &p)
std::map< std::pair< G4LogicalVolume *, unsigned int >, ParticleFlux > store_
std::map< G4LogicalVolume *, std::pair< unsigned int, std::string > > mapLV_
G4VPhysicalVolume * topPV_
std::vector< int > LVTypes_
std::map< G4LogicalVolume *, std::pair< unsigned int, std::string > >::iterator findLV(G4LogicalVolume *plv)
const SimG4FluxProducer & operator=(const SimG4FluxProducer &)
G4VPhysicalVolume * getTopPV()
std::vector< std::string > LVNames_
int k[5][pyjets_maxn]
void endOfEvent(ParticleFlux &pflx, unsigned int k)
virtual ~SimG4FluxProducer()
void produce(edm::Event &, const edm::EventSetup &)
step
void update(const BeginOfRun *run)
This routine will be called when the appropriate signal arrives.