CMS 3D CMS Logo

MTDDigitizerBase.h
Go to the documentation of this file.
1 #ifndef FastTimingSimProducers_FastTimingCommon_MTDDigitizerBase_h
2 #define FastTimingSimProducers_FastTimingCommon_MTDDigitizerBase_h
3 
8 
11 
15 
16 #include "CLHEP/Units/GlobalPhysicalConstants.h"
17 
18 #include <string>
19 
20 namespace CLHEP {
21  class HepRandomEngine;
22 }
23 
24 namespace edm {
25  class Event;
26  class EventSetup;
27 }
28 
30 
32  public:
36  inputSimHits_( config.getParameter<edm::InputTag>("inputSimHits") ),
37  digiCollection_( config.getParameter<std::string>("digiCollectionTag") ),
38  verbosity_( config.getUntrackedParameter< uint32_t >("verbosity",0) ),
39  refSpeed_( 0.1*CLHEP::c_light ),
40  premixStage1MinCharge_( config.getParameter<double>("premixStage1MinCharge") ),
41  premixStage1MaxCharge_( config.getParameter<double>("premixStage1MaxCharge") ),
42  premixStage1_( config.getParameter<bool>("premixStage1")),
43  name_( config.getParameter<std::string>("digitizerName") ) {
44  iC.consumes<std::vector<PSimHit> >(inputSimHits_);
45 
46  if ( name_ == "BTLTileDigitizer" || name_ == "BTLBarDigitizer" ) {
47  if(premixStage1_) {
48  parent.produces<PMTDSimAccumulator>(digiCollection_);
49  }
50  else {
51  parent.produces<BTLDigiCollection>(digiCollection_);
52  }
53  }
54  else if ( name_ == "ETLDigitizer" )
55  if(premixStage1_) {
56  parent.produces<PMTDSimAccumulator>(digiCollection_);
57  }
58  else {
59  parent.produces<ETLDigiCollection>(digiCollection_);
60  }
61  else
62  throw cms::Exception("[MTDDigitizerBase::MTDDigitizerBase]")
63  << name_ << " is an invalid MTD digitizer name";
64  }
65 
66  virtual ~MTDDigitizerBase() {}
67 
68 
72  virtual void accumulate(edm::Event const& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre) = 0;
73  virtual void accumulate(PileUpEventPrincipal const& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre) = 0;
74  virtual void accumulate(edm::Handle<edm::PSimHitContainer> const &hits, int bxCrossing, CLHEP::HepRandomEngine* hre) = 0;
75  // for premixing
76  virtual void accumulate(const PMTDSimAccumulator& simAccumulator) = 0;
77 
81  virtual void initializeEvent(edm::Event const& e, edm::EventSetup const& c) = 0;
82  virtual void finalizeEvent(edm::Event& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre) = 0;
83 
87  virtual void beginRun(const edm::EventSetup & es) = 0;
88  virtual void endRun() = 0;
89 
90  const std::string& name() const {
91  return name_;
92  }
93 
94 
95  protected:
96  //input/output names
99 
100  //misc switches
101  const uint32_t verbosity_;
102 
103  //reference speed to evaluate time of arrival at the sensititive detector, assuming the center of CMS
104  const float refSpeed_;
105 
106  // Minimum charge threshold for premixing stage1
108  // Maximum charge for packing in premixing stage1
110 
111  // flag telling whether we are runing in premixing stage1
112  const bool premixStage1_;
113 
114  private:
116 
117 };
118 
121 
122 
123 
124 #endif
BranchAliasSetterT< ProductType > produces()
declare what type of product will make and with which optional label
const bool premixStage1_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
virtual ~MTDDigitizerBase()
Definition: config.py:1
const edm::InputTag inputSimHits_
const std::string digiCollection_
const std::string & name() const
const uint32_t verbosity_
const float refSpeed_
edmplugin::PluginFactory< MTDDigitizerBase *(const edm::ParameterSet &, edm::ConsumesCollector &, edm::ProducerBase &) > MTDDigitizerFactory
HLT enums.
MTDDigitizerBase(const edm::ParameterSet &config, edm::ConsumesCollector &iC, edm::ProducerBase &parent)