CMS 3D CMS Logo

HcalSensitiveDetectorBuilder.cc
Go to the documentation of this file.
1 
2 // system include files
3 #include <string>
4 #include <vector>
5 
6 // user include files
10 
19 
26 
28 public:
30  : hdscToken_{cc.esConsumes<edm::Transition::BeginRun>()},
33  hbdkToken_{
35  hedkToken_{
37  hcalDDSim_{nullptr},
38  hcalDDRec_{nullptr},
39  hcalSimConstants_{nullptr},
40  hbDarkening_{nullptr},
41  heDarkening_{nullptr} {
42  edm::ParameterSet m_HC = p.getParameter<edm::ParameterSet>("HCalSD");
43  agingFlagHB_ = m_HC.getParameter<bool>("HBDarkening");
44  agingFlagHE_ = m_HC.getParameter<bool>("HEDarkening");
45  forTBHC_ = m_HC.getUntrackedParameter<bool>("ForTBHCAL", false);
46  forTBH2_ = m_HC.getUntrackedParameter<bool>("ForTBH2", false);
47  }
48 
49  void beginRun(const edm::EventSetup& es) final {
50  hcalDDSim_ = &es.getData(hdscToken_);
51  if ((!forTBHC_) && (!forTBH2_))
52  hcalDDRec_ = &es.getData(hdrcToken_);
54  if (hscs.isValid())
55  hcalSimConstants_ = hscs.product();
56  else
57  edm::LogWarning("HcalSim") << "HcalSensitiveDetectorBuilder does not find record for HcalSimulationConstants";
58  if (agingFlagHB_) {
59  edm::ESHandle<HBHEDarkening> hbdark = es.getHandle(hbdkToken_);
60  if (hbdark.isValid())
61  hbDarkening_ = hbdark.product();
62  else
63  edm::LogVerbatim("HcalSim") << "HcalSensitiveDetectorBuilder does not find record for HBDarkening";
64  }
65  if (agingFlagHE_) {
66  edm::ESHandle<HBHEDarkening> hedark = es.getHandle(hedkToken_);
67  if (hedark.isValid())
68  heDarkening_ = hedark.product();
69  else
70  edm::LogVerbatim("HcalSim") << "HcalSensitiveDetectorBuilder does not find record for HEDarkening";
71  }
72  }
73 
74  std::unique_ptr<SensitiveDetector> make(const std::string& iname,
75  const SensitiveDetectorCatalog& clg,
76  const edm::ParameterSet& p,
77  const SimTrackManager* man,
78  SimActivityRegistry& reg) const final {
79  auto sd = std::make_unique<HCalSD>(
82  return sd;
83  }
84 
85 private:
98 };
99 
HBHEDarkeningRecord
Definition: HBHEDarkeningRecord.h:4
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
HcalSensitiveDetectorBuilder::hdscToken_
const edm::ESGetToken< HcalDDDSimConstants, HcalSimNumberingRecord > hdscToken_
Definition: HcalSensitiveDetectorBuilder.cc:86
SimTrackManager
Definition: SimTrackManager.h:35
edm::ESInputTag
Definition: ESInputTag.h:87
MessageLogger.h
HBHEDarkeningRecord.h
ESHandle.h
HcalSimNumberingRecord.h
HcalSensitiveDetectorBuilder::forTBHC_
bool forTBHC_
Definition: HcalSensitiveDetectorBuilder.cc:97
HcalSensitiveDetectorBuilder::HcalSensitiveDetectorBuilder
HcalSensitiveDetectorBuilder(edm::ParameterSet const &p, edm::ConsumesCollector cc)
Definition: HcalSensitiveDetectorBuilder.cc:29
HBHEDarkening.h
HCalSD
Definition: HCalSD.h:38
HcalRecNumberingRecord.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
ESGetToken.h
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
HcalDDDSimConstants
Definition: HcalDDDSimConstants.h:24
HcalSensitiveDetectorBuilder::forTBH2_
bool forTBH2_
Definition: HcalSensitiveDetectorBuilder.cc:97
HcalSimulationConstants
Definition: HcalSimulationConstants.h:15
HcalSensitiveDetector
HCalSD HcalSensitiveDetector
Definition: HcalSensitiveDetectorBuilder.cc:100
edm::ESHandle
Definition: DTSurvey.h:22
SensitiveDetectorCatalog
Definition: SensitiveDetectorCatalog.h:10
HcalSensitiveDetectorBuilder::hedkToken_
const edm::ESGetToken< HBHEDarkening, HBHEDarkeningRecord > hedkToken_
Definition: HcalSensitiveDetectorBuilder.cc:90
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HcalSensitiveDetectorBuilder::agingFlagHE_
bool agingFlagHE_
Definition: HcalSensitiveDetectorBuilder.cc:96
HcalSensitiveDetectorBuilder::hcalDDSim_
const HcalDDDSimConstants * hcalDDSim_
Definition: HcalSensitiveDetectorBuilder.cc:91
SensitiveDetectorMakerBase
Definition: SensitiveDetectorMakerBase.h:28
HBHEDarkening
Definition: HBHEDarkening.h:17
ModuleDef.h
SimActivityRegistryEnroller::enroll
static void enroll(SimActivityRegistry &iReg, T *iObj)
Definition: SimActivityRegistryEnroller.h:50
HcalSensitiveDetectorBuilder
Definition: HcalSensitiveDetectorBuilder.cc:27
edm::EventSetup
Definition: EventSetup.h:58
cc
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
edm::ESGetToken< HcalDDDSimConstants, HcalSimNumberingRecord >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalSensitiveDetectorBuilder::agingFlagHB_
bool agingFlagHB_
Definition: HcalSensitiveDetectorBuilder.cc:96
HCalSD.h
HcalSensitiveDetectorBuilder::heDarkening_
const HBHEDarkening * heDarkening_
Definition: HcalSensitiveDetectorBuilder.cc:95
SimActivityRegistryEnroller.h
HcalSensitiveDetectorBuilder::hbdkToken_
const edm::ESGetToken< HBHEDarkening, HBHEDarkeningRecord > hbdkToken_
Definition: HcalSensitiveDetectorBuilder.cc:89
SimActivityRegistry
Definition: SimActivityRegistry.h:39
DEFINE_SENSITIVEDETECTORBUILDER
#define DEFINE_SENSITIVEDETECTORBUILDER(type, name)
Definition: SensitiveDetectorPluginFactory.h:21
HcalSensitiveDetectorBuilder::beginRun
void beginRun(const edm::EventSetup &es) final
Definition: HcalSensitiveDetectorBuilder.cc:49
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
edm::Transition::BeginRun
HcalDDDRecConstants.h
HcalSimulationConstants.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HcalSensitiveDetectorBuilder::make
std::unique_ptr< SensitiveDetector > make(const std::string &iname, const SensitiveDetectorCatalog &clg, const edm::ParameterSet &p, const SimTrackManager *man, SimActivityRegistry &reg) const final
Definition: HcalSensitiveDetectorBuilder.cc:74
sd
double sd
Definition: CascadeWrapper.h:113
HcalDDDRecConstants
Definition: HcalDDDRecConstants.h:23
ConsumesCollector.h
SensitiveDetectorPluginFactory.h
ParameterSet.h
HcalSensitiveDetectorBuilder::hcalSimConstants_
const HcalSimulationConstants * hcalSimConstants_
Definition: HcalSensitiveDetectorBuilder.cc:93
HcalSensitiveDetectorBuilder::hcalDDRec_
const HcalDDDRecConstants * hcalDDRec_
Definition: HcalSensitiveDetectorBuilder.cc:92
SensitiveDetectorMakerBase.h
HcalSensitiveDetectorBuilder::hscsToken_
const edm::ESGetToken< HcalSimulationConstants, HcalSimNumberingRecord > hscsToken_
Definition: HcalSensitiveDetectorBuilder.cc:88
HcalSensitiveDetectorBuilder::hbDarkening_
const HBHEDarkening * hbDarkening_
Definition: HcalSensitiveDetectorBuilder.cc:94
HcalSensitiveDetectorBuilder::hdrcToken_
const edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > hdrcToken_
Definition: HcalSensitiveDetectorBuilder.cc:87
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
HcalDDDSimConstants.h