CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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;
69  virtual void accumulate(edm::Handle<edm::PSimHitContainer> const& hits,
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
const bool premixStage1_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EventSetup & c
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
virtual ~MTDDigitizerBase()
virtual void finalizeEvent(edm::Event &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)=0
const edm::InputTag inputSimHits_
const std::string digiCollection_
const std::string & name() const
const uint32_t verbosity_
double premixStage1MinCharge_
virtual void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)=0
handle SimHit accumulation
const float refSpeed_
virtual void initializeEvent(edm::Event const &e, edm::EventSetup const &c)=0
actions at the start/end of event
MTDDigitizerBase(const edm::ParameterSet &config, edm::ProducesCollector producesCollector, edm::ConsumesCollector &iC)
tuple config
parse the configuration file
double premixStage1MaxCharge_