CMS 3D CMS Logo

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
SubsystemNeutronWriter::initialize
void initialize(int chamberType)
good practice to do once for each chamber type
Definition: SubsystemNeutronWriter.cc:101
SubsystemNeutronWriter::theTimeWindow
double theTimeWindow
Definition: SubsystemNeutronWriter.h:67
SubsystemNeutronWriter::useLocalDetId_
bool useLocalDetId_
Definition: SubsystemNeutronWriter.h:72
NeutronWriter
Definition: NeutronWriter.h:15
PSimHitContainer.h
SubsystemNeutronWriter::~SubsystemNeutronWriter
~SubsystemNeutronWriter() override
destructor prints statistics on number of events written
Definition: SubsystemNeutronWriter.cc:59
EDProducer.h
SubsystemNeutronWriter::localDetId
virtual int localDetId(int globalDetId) const =0
SubsystemNeutronWriter::writeCluster
void writeCluster(int chamberType, const edm::PSimHitContainer &cluster)
Definition: SubsystemNeutronWriter.cc:146
SubsystemNeutronWriter::initialized
bool initialized
Definition: SubsystemNeutronWriter.h:70
SubsystemNeutronWriter::chamberId
virtual int chamberId(int globalDetId) const =0
SubsystemNeutronWriter::accept
virtual bool accept(const edm::PSimHitContainer &cluster) const =0
decides whether this cluster is good enough to be included
SubsystemNeutronWriter::chamberType
virtual int chamberType(int globalDetId) const =0
SubsystemNeutronWriter::theNeutronTimeCut
double theNeutronTimeCut
Definition: SubsystemNeutronWriter.h:66
h
SubsystemNeutronWriter::updateCount
void updateCount(int chamberType)
updates the counter
Definition: SubsystemNeutronWriter.cc:172
CLHEP
Definition: CocoaGlobals.h:27
edm::ParameterSet
Definition: ParameterSet.h:47
SubsystemNeutronWriter::theT0
double theT0
Definition: SubsystemNeutronWriter.h:68
SubsystemNeutronWriter::writeHits
virtual void writeHits(int chamberType, edm::PSimHitContainer &chamberHits, CLHEP::HepRandomEngine *)
Definition: SubsystemNeutronWriter.cc:107
edm::stream::EDProducer
Definition: EDProducer.h:38
SubsystemNeutronWriter::SubsystemNeutronWriter
SubsystemNeutronWriter(edm::ParameterSet const &pset)
Definition: SubsystemNeutronWriter.cc:24
edm::EventSetup
Definition: EventSetup.h:58
SubsystemNeutronWriter::produce
void produce(edm::Event &e, edm::EventSetup const &c) override
Definition: SubsystemNeutronWriter.cc:73
InputTag.h
SubsystemNeutronWriter::theCountPerChamberType
std::map< int, int > theCountPerChamberType
Definition: SubsystemNeutronWriter.h:73
CalibratedDigis_cfi.timeOffset
timeOffset
Definition: CalibratedDigis_cfi.py:23
SubsystemNeutronWriter::theInputTag
edm::InputTag theInputTag
Definition: SubsystemNeutronWriter.h:65
SubsystemNeutronWriter
doesn't have to be a producer. Can act as an analyzer, too.
Definition: SubsystemNeutronWriter.h:28
SubsystemNeutronWriter::theHitWriter
NeutronWriter * theHitWriter
Definition: SubsystemNeutronWriter.h:63
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
PSimHit
Definition: PSimHit.h:15
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
SubsystemNeutronWriter::adjust
void adjust(PSimHit &h, float timeOffset, float smearing)
helper to add time offsets and local det ID
Definition: SubsystemNeutronWriter.cc:153
SubsystemNeutronWriter::theNEvents
int theNEvents
Definition: SubsystemNeutronWriter.h:69
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
SubsystemNeutronWriter::printStats
void printStats()
Definition: SubsystemNeutronWriter.cc:64
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
SubsystemNeutronWriter::useRandFlat
bool useRandFlat
Definition: SubsystemNeutronWriter.h:64