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 
81  const std::string& name() const { return name_; }
82 
83 protected:
84  //input/output names
87 
88  //misc switches
89  const uint32_t verbosity_;
90 
91  //reference speed to evaluate time of arrival at the sensititive detector, assuming the center of CMS
92  const float refSpeed_;
93 
94  // Minimum charge threshold for premixing stage1
96  // Maximum charge for packing in premixing stage1
98 
99  // flag telling whether we are runing in premixing stage1
100  const bool premixStage1_;
101 
102 private:
104 };
105 
110 
111 #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:366
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
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
MTDDigitizerBase::inputSimHits_
const edm::InputTag inputSimHits_
Definition: MTDDigitizerBase.h:85
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:100
MTDDigitizerBase::~MTDDigitizerBase
virtual ~MTDDigitizerBase()
Definition: MTDDigitizerBase.h:62
edm::Handle< edm::PSimHitContainer >
MTDDigitizerBase::premixStage1MaxCharge_
double premixStage1MaxCharge_
Definition: MTDDigitizerBase.h:97
MTDDigitizerTypes.h
MTDDigitizerBase
Definition: MTDDigitizerBase.h:31
ProducesCollector.h
MTDDigitizerBase::digiCollection_
const std::string digiCollection_
Definition: MTDDigitizerBase.h:86
config
Definition: config.py:1
PSimHit.h
Event
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
CLHEP
Definition: CocoaGlobals.h:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
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:81
MTDDigitizerBase::verbosity_
const uint32_t verbosity_
Definition: MTDDigitizerBase.h:89
edm::ProducesCollector::produces
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
Definition: ProducesCollector.h:52
edm::EventSetup
Definition: EventSetup.h:58
InputTag.h
MTDDigitizerBase::refSpeed_
const float refSpeed_
Definition: MTDDigitizerBase.h:92
MTDDigitizerBase::finalizeEvent
virtual void finalizeEvent(edm::Event &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)=0
std
Definition: JetResolutionObject.h:76
edm::ProducesCollector
Definition: ProducesCollector.h:43
Exception
Definition: hltDiff.cc:245
ConsumesCollector.h
EventSetup
ParameterSet.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
MTDDigitizerBase::premixStage1MinCharge_
double premixStage1MinCharge_
Definition: MTDDigitizerBase.h:95
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
MTDDigitizerBase::name_
std::string name_
Definition: MTDDigitizerBase.h:103
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37