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 } // namespace edm
28 
30 
32 public:
34  edm::ProducesCollector producesCollector,
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_ == "BTLDigitizer") {
47  if (premixStage1_) {
48  producesCollector.produces<PMTDSimAccumulator>(digiCollection_);
49  } else {
50  producesCollector.produces<BTLDigiCollection>(digiCollection_);
51  }
52  } else if (name_ == "ETLDigitizer")
53  if (premixStage1_) {
54  producesCollector.produces<PMTDSimAccumulator>(digiCollection_);
55  } else {
56  producesCollector.produces<ETLDigiCollection>(digiCollection_);
57  }
58  else
59  throw cms::Exception("[MTDDigitizerBase::MTDDigitizerBase]") << name_ << " is an invalid MTD digitizer name";
60  }
61 
62  virtual ~MTDDigitizerBase() {}
63 
67  virtual void accumulate(edm::Event const& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre) = 0;
68  virtual void accumulate(PileUpEventPrincipal const& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre) = 0;
70  int bxCrossing,
71  CLHEP::HepRandomEngine* hre) = 0;
72  // for premixing
73  virtual void accumulate(const PMTDSimAccumulator& simAccumulator) = 0;
74 
78  virtual void initializeEvent(edm::Event const& e, edm::EventSetup const& c) = 0;
79  virtual void finalizeEvent(edm::Event& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre) = 0;
80 
84  virtual void beginRun(const edm::EventSetup& es) = 0;
85  virtual void endRun() = 0;
86 
87  const std::string& name() const { return name_; }
88 
89 protected:
90  //input/output names
93 
94  //misc switches
95  const uint32_t verbosity_;
96 
97  //reference speed to evaluate time of arrival at the sensititive detector, assuming the center of CMS
98  const float refSpeed_;
99 
100  // Minimum charge threshold for premixing stage1
102  // Maximum charge for packing in premixing stage1
104 
105  // flag telling whether we are runing in premixing stage1
106  const bool premixStage1_;
107 
108 private:
110 };
111 
116 
117 #endif
MTDDigitizerBase::MTDDigitizerBase
MTDDigitizerBase(const edm::ParameterSet &config, edm::ProducesCollector producesCollector, edm::ConsumesCollector &iC)
Definition: MTDDigitizerBase.h:33
FTLDigiCollections.h
PluginFactory.h
electrons_cff.bool
bool
Definition: electrons_cff.py:372
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
PMTDSimAccumulator.h
edm
HLT enums.
Definition: AlignableModifier.h:19
PMTDSimAccumulator
Definition: PMTDSimAccumulator.h:9
PSimHitContainer.h
MTDDigitizerBase::inputSimHits_
const edm::InputTag inputSimHits_
Definition: MTDDigitizerBase.h:91
edm::SortedCollection
Definition: SortedCollection.h:49
PileUpEventPrincipal
Definition: PileUpEventPrincipal.h:19
MTDDigitizerBase::initializeEvent
virtual void initializeEvent(edm::Event const &e, edm::EventSetup const &c)=0
actions at the start/end of event
MTDDigitizerBase::premixStage1_
const bool premixStage1_
Definition: MTDDigitizerBase.h:106
MTDDigitizerBase::~MTDDigitizerBase
virtual ~MTDDigitizerBase()
Definition: MTDDigitizerBase.h:62
edm::Handle< edm::PSimHitContainer >
MTDDigitizerBase::premixStage1MaxCharge_
double premixStage1MaxCharge_
Definition: MTDDigitizerBase.h:103
MTDDigitizerTypes.h
MTDDigitizerBase
Definition: MTDDigitizerBase.h:31
ProducesCollector.h
MTDDigitizerBase::digiCollection_
const std::string digiCollection_
Definition: MTDDigitizerBase.h:92
config
Definition: config.py:1
PSimHit.h
MTDDigitizerBase::beginRun
virtual void beginRun(const edm::EventSetup &es)=0
actions at the start/end of run
Event
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
CLHEP
Definition: CocoaGlobals.h:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
MTDDigitizerBase::accumulate
virtual void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)=0
handle SimHit accumulation
edmplugin::PluginFactory
Definition: PluginFactory.h:34
MTDDigitizerBase::name
const std::string & name() const
Definition: MTDDigitizerBase.h:87
MTDDigitizerBase::verbosity_
const uint32_t verbosity_
Definition: MTDDigitizerBase.h:95
edm::ProducesCollector::produces
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
Definition: ProducesCollector.h:52
edm::EventSetup
Definition: EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
InputTag.h
MTDDigitizerBase::refSpeed_
const float refSpeed_
Definition: MTDDigitizerBase.h:98
MTDDigitizerBase::finalizeEvent
virtual void finalizeEvent(edm::Event &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)=0
MTDDigitizerBase::endRun
virtual void endRun()=0
std
Definition: JetResolutionObject.h:76
edm::ProducesCollector
Definition: ProducesCollector.h:43
Exception
Definition: hltDiff.cc:246
ConsumesCollector.h
EventSetup
ParameterSet.h
MTDDigitizerBase::premixStage1MinCharge_
double premixStage1MinCharge_
Definition: MTDDigitizerBase.h:101
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
MTDDigitizerBase::name_
std::string name_
Definition: MTDDigitizerBase.h:109
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37