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 #include "CLHEP/Random/RandFlat.h"
21 
22 
23 class NeutronWriter;
24 
27 {
28 public:
29 
31 
33  virtual ~SubsystemNeutronWriter();
34 
35  void printStats();
36 
37  virtual void produce(edm::Event & e, edm::EventSetup const& c);
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 
53 
54  virtual void writeHits(int chamberType, edm::PSimHitContainer & chamberHits);
55 
56  void writeCluster(int chamberType, const edm::PSimHitContainer & cluster);
57 
59  void adjust(PSimHit & h, float timeOffset, float smearing);
60 
62  void updateCount(int chamberType);
63 
64 private:
66  CLHEP::RandFlat * theRandFlat;
69  double theTimeWindow;
70  double theT0;
73  // true means to translate DetId into just layer number, e.g., 1-6 in CSC
75  std::map<int, int> theCountPerChamberType;
76 };
77 
78 #endif
79 
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.
std::map< int, int > theCountPerChamberType
tuple pset
Definition: CrabTask.py:85
SubsystemNeutronWriter(edm::ParameterSet const &pset)
void updateCount(int chamberType)
updates the counter
void writeCluster(int chamberType, const edm::PSimHitContainer &cluster)
virtual void writeHits(int chamberType, edm::PSimHitContainer &chamberHits)
virtual void produce(edm::Event &e, edm::EventSetup const &c)
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