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 
14 
15 #include "CLHEP/Units/GlobalPhysicalConstants.h"
16 
17 #include <string>
18 
19 namespace CLHEP {
20  class HepRandomEngine;
21 }
22 
23 namespace edm {
24  class Event;
25  class EventSetup;
26 }
27 
29 
31  public:
35  inputSimHits_( config.getParameter<edm::InputTag>("inputSimHits") ),
36  digiCollection_( config.getParameter<std::string>("digiCollectionTag") ),
37  verbosity_( config.getUntrackedParameter< uint32_t >("verbosity",0) ),
38  refSpeed_( 0.1*CLHEP::c_light ),
39  name_( config.getParameter<std::string>("digitizerName") ) {
40  iC.consumes<std::vector<PSimHit> >(inputSimHits_);
41 
42  if ( name_ == "BTLDigitizer" )
43  parent.produces<BTLDigiCollection>(digiCollection_);
44  else if ( name_ == "ETLDigitizer" )
45  parent.produces<ETLDigiCollection>(digiCollection_);
46  else
47  throw cms::Exception("[MTDDigitizerBase::MTDDigitizerBase]")
48  << name_ << " is an invalid MTD digitizer name";
49  }
50 
51  virtual ~MTDDigitizerBase() {}
52 
53 
57  virtual void accumulate(edm::Event const& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre) = 0;
58  virtual void accumulate(PileUpEventPrincipal const& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre) = 0;
59  virtual void accumulate(edm::Handle<edm::PSimHitContainer> const &hits, int bxCrossing, CLHEP::HepRandomEngine* hre) = 0;
60 
64  virtual void initializeEvent(edm::Event const& e, edm::EventSetup const& c) = 0;
65  virtual void finalizeEvent(edm::Event& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre) = 0;
66 
70  virtual void beginRun(const edm::EventSetup & es) = 0;
71  virtual void endRun() = 0;
72 
73  const std::string& name() const {
74  return name_;
75  }
76 
77 
78  protected:
79  //input/output names
82 
83  //misc switches
84  const uint32_t verbosity_;
85 
86  //reference speed to evaluate time of arrival at the sensititive detector, assuming the center of CMS
87  const float refSpeed_;
88 
89  private:
91 
92 };
93 
96 
97 
98 
99 #endif
BranchAliasSetterT< ProductType > produces()
declare what type of product will make and with which optional label
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)