CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 public:
31 
33  ~SubsystemNeutronWriter() override;
34 
35  void printStats();
36 
37  void produce(edm::Event& e, edm::EventSetup const& c) override;
38 
39  virtual int localDetId(int globalDetId) const = 0;
40 
41  virtual int chamberType(int globalDetId) const = 0;
42 
43  virtual int chamberId(int globalDetId) const = 0;
44 
46  virtual bool accept(const edm::PSimHitContainer& cluster) const = 0;
47 
49  void initialize(int chamberType);
50 
51 protected:
52  virtual void writeHits(int chamberType, edm::PSimHitContainer& chamberHits, CLHEP::HepRandomEngine*);
53 
54  void writeCluster(int chamberType, const edm::PSimHitContainer& cluster);
55 
57  void adjust(PSimHit& h, float timeOffset, float smearing);
58 
60  void updateCount(int chamberType);
61 
62 private:
67  double theTimeWindow;
68  double theT0;
71  // true means to translate DetId into just layer number, e.g., 1-6 in CSC
73  std::map<int, int> theCountPerChamberType;
74 };
75 
76 #endif
const edm::EventSetup & c
virtual int chamberType(int globalDetId) const =0
void initialize(int chamberType)
good practice to do once for each chamber type
~SubsystemNeutronWriter() override
destructor prints statistics on number of events written
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
SubsystemNeutronWriter(edm::ParameterSet const &pset)
void updateCount(int chamberType)
updates the counter
void writeCluster(int chamberType, const edm::PSimHitContainer &cluster)
void produce(edm::Event &e, edm::EventSetup const &c) override
std::vector< PSimHit > PSimHitContainer
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4