CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SubsystemNeutronWriter.h
Go to the documentation of this file.
1 #ifndef SubsystemNeutronWriter_h
2 #define SubsystemNeutronWriter_h
3 
15 #include <vector>
16 #include <map>
20 
21 namespace CLHEP {
22  class HepRandomEngine;
23 }
24 
25 class NeutronWriter;
26 
29 {
30 public:
31 
32  explicit SubsystemNeutronWriter(edm::ParameterSet const& pset);
33 
35  virtual ~SubsystemNeutronWriter();
36 
37  void printStats();
38 
39  virtual void produce(edm::Event & e, edm::EventSetup const& c);
40 
41  virtual int localDetId(int globalDetId) const = 0;
42 
43  virtual int chamberType(int globalDetId) const = 0;
44 
45  virtual int chamberId(int globalDetId) const = 0;
46 
48  virtual bool accept(const edm::PSimHitContainer & cluster) const = 0;
49 
51  void initialize(int chamberType);
52 
53 protected:
54 
55 
56  virtual void writeHits(int chamberType, edm::PSimHitContainer & chamberHits, CLHEP::HepRandomEngine*);
57 
58  void writeCluster(int chamberType, const edm::PSimHitContainer & cluster);
59 
61  void adjust(PSimHit & h, float timeOffset, float smearing);
62 
64  void updateCount(int chamberType);
65 
66 private:
71  double theTimeWindow;
72  double theT0;
75  // true means to translate DetId into just layer number, e.g., 1-6 in CSC
77  std::map<int, int> theCountPerChamberType;
78 };
79 
80 #endif
81 
virtual int chamberType(int globalDetId) const =0
virtual ~SubsystemNeutronWriter()
destructor prints statistics on number of events written
void initialize(int chamberType)
good practice to do once for each chamber type
virtual bool accept(const edm::PSimHitContainer &cluster) const =0
decides whether this cluster is good enough to be included
void adjust(PSimHit &h, float timeOffset, float smearing)
helper to add time offsets and local det ID
virtual int localDetId(int globalDetId) const =0
virtual int chamberId(int globalDetId) const =0
doesn&#39;t have to be a producer. Can act as an analyzer, too.
virtual void writeHits(int chamberType, edm::PSimHitContainer &chamberHits, CLHEP::HepRandomEngine *)
std::map< int, int > theCountPerChamberType
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
SubsystemNeutronWriter(edm::ParameterSet const &pset)
void updateCount(int chamberType)
updates the counter
void writeCluster(int chamberType, const edm::PSimHitContainer &cluster)
virtual void produce(edm::Event &e, edm::EventSetup const &c)
std::vector< PSimHit > PSimHitContainer