CMS 3D CMS Logo

MTDTopologyEP.cc
Go to the documentation of this file.
12 
13 #include <memory>
14 //#define EDM_ML_DEBUG
15 
17 public:
19 
20  using ReturnType = std::unique_ptr<MTDTopology>;
21 
22  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
23 
25 
26 private:
28 
30 };
31 
33  : token_{setWhatProduced(this).consumesFrom<PMTDParameters, PMTDParametersRcd>(edm::ESInputTag())} {}
34 
37  descriptions.add("mtdTopology", ttc);
38 }
39 
41  int mtdTopologyMode;
42  MTDTopology::BTLValues btlVals;
43  MTDTopology::ETLValues etlVals;
44 
45  fillParameters(iRecord.get(token_), mtdTopologyMode, btlVals, etlVals);
46 
47  return std::make_unique<MTDTopology>(mtdTopologyMode, btlVals, etlVals);
48 }
49 
51  int& mtdTopologyMode,
52  MTDTopology::BTLValues& btlVals,
53  MTDTopology::ETLValues& etlVals) {
54  mtdTopologyMode = ptp.topologyMode_;
55 
56  btlVals.sideStartBit_ = ptp.vitems_[0].vpars_[0]; // 16
57  btlVals.layerStartBit_ = ptp.vitems_[0].vpars_[1]; // 16
58  btlVals.trayStartBit_ = ptp.vitems_[0].vpars_[2]; // 8
59  btlVals.moduleStartBit_ = ptp.vitems_[0].vpars_[3]; // 2
60  btlVals.sideMask_ = ptp.vitems_[0].vpars_[4]; // 0xF
61  btlVals.layerMask_ = ptp.vitems_[0].vpars_[5]; // 0xF
62  btlVals.trayMask_ = ptp.vitems_[0].vpars_[6]; // 0xFF
63  btlVals.moduleMask_ = ptp.vitems_[0].vpars_[7]; // 0x3F
64 
65  etlVals.sideStartBit_ = ptp.vitems_[1].vpars_[0];
66  etlVals.layerStartBit_ = ptp.vitems_[1].vpars_[1];
67  etlVals.ringStartBit_ = ptp.vitems_[1].vpars_[2];
68  etlVals.moduleStartBit_ = ptp.vitems_[1].vpars_[3];
69  etlVals.sideMask_ = ptp.vitems_[1].vpars_[4];
70  etlVals.layerMask_ = ptp.vitems_[1].vpars_[5];
71  etlVals.ringMask_ = ptp.vitems_[1].vpars_[6];
72  etlVals.moduleMask_ = ptp.vitems_[1].vpars_[7];
73 
74 #ifdef EDM_ML_DEBUG
75 
76  edm::LogInfo("MTDTopologyEP") << "Topology mode = " << mtdTopologyMode << "\n"
77  << "BTL values = " << btlVals.sideStartBit_ << " " << btlVals.layerStartBit_ << " "
78  << btlVals.trayStartBit_ << " " << btlVals.moduleStartBit_ << " " << std::hex
79  << btlVals.sideMask_ << " " << std::hex << btlVals.layerMask_ << " " << std::hex
80  << btlVals.trayMask_ << " " << std::hex << btlVals.moduleMask_ << "\n"
81  << "ETL values = " << etlVals.sideStartBit_ << " " << etlVals.layerStartBit_ << " "
82  << etlVals.ringStartBit_ << " " << etlVals.moduleStartBit_ << " " << std::hex
83  << etlVals.sideMask_ << " " << std::hex << etlVals.layerMask_ << " " << std::hex
84  << etlVals.ringMask_ << " " << std::hex << etlVals.moduleMask_ << " ";
85 
86 #endif
87 }
88 
MTDTopology::ETLValues::moduleStartBit_
unsigned int moduleStartBit_
Definition: MTDTopology.h:33
ConfigurationDescriptions.h
PMTDParameters
Definition: PMTDParameters.h:6
MTDTopologyEP::produce
ReturnType produce(const MTDTopologyRcd &)
Definition: MTDTopologyEP.cc:40
MTDTopologyEP::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: MTDTopologyEP.cc:35
edm::ESInputTag
Definition: ESInputTag.h:87
MessageLogger.h
MTDTopologyEP::token_
const edm::ESGetToken< PMTDParameters, PMTDParametersRcd > token_
Definition: MTDTopologyEP.cc:29
PMTDParameters::vitems_
std::vector< Item > vitems_
Definition: PMTDParameters.h:18
ESHandle.h
MTDTopology::BTLValues::trayStartBit_
unsigned int trayStartBit_
Definition: MTDTopology.h:21
edm::LogInfo
Definition: MessageLogger.h:254
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
MTDTopology::ETLValues::ringStartBit_
unsigned int ringStartBit_
Definition: MTDTopology.h:32
ESProducer.h
MTDTopology::BTLValues::layerMask_
unsigned int layerMask_
Definition: MTDTopology.h:24
MTDTopology::BTLValues::moduleMask_
unsigned int moduleMask_
Definition: MTDTopology.h:26
MTDTopologyEP::ReturnType
std::unique_ptr< MTDTopology > ReturnType
Definition: MTDTopologyEP.cc:20
MTDTopology::BTLValues
Definition: MTDTopology.h:18
MTDTopology::ETLValues
Definition: MTDTopology.h:29
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
MTDTopology::ETLValues::ringMask_
unsigned int ringMask_
Definition: MTDTopology.h:36
ParameterSetDescription.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:112
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
MTDTopology::ETLValues::sideStartBit_
unsigned int sideStartBit_
Definition: MTDTopology.h:30
MTDTopologyEP::MTDTopologyEP
MTDTopologyEP(const edm::ParameterSet &)
Definition: MTDTopologyEP.cc:32
PMTDParametersRcd.h
edm::ParameterSet
Definition: ParameterSet.h:36
MTDTopologyEP::fillParameters
void fillParameters(const PMTDParameters &, int &, MTDTopology::BTLValues &, MTDTopology::ETLValues &)
Definition: MTDTopologyEP.cc:50
MTDTopologyRcd
Definition: MTDTopologyRcd.h:10
PMTDParametersRcd
Definition: PMTDParametersRcd.h:9
MTDTopology::BTLValues::sideStartBit_
unsigned int sideStartBit_
Definition: MTDTopology.h:19
MTDTopology::BTLValues::sideMask_
unsigned int sideMask_
Definition: MTDTopology.h:23
PMTDParameters::topologyMode_
int topologyMode_
Definition: PMTDParameters.h:20
edm::ESGetToken< PMTDParameters, PMTDParametersRcd >
MTDTopology::ETLValues::sideMask_
unsigned int sideMask_
Definition: MTDTopology.h:34
ModuleFactory.h
MTDTopologyRcd.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
MTDTopology::BTLValues::trayMask_
unsigned int trayMask_
Definition: MTDTopology.h:25
PMTDParameters.h
MTDTopology::ETLValues::moduleMask_
unsigned int moduleMask_
Definition: MTDTopology.h:37
Exception.h
edm::ESProducer
Definition: ESProducer.h:101
MTDTopology::ETLValues::layerStartBit_
unsigned int layerStartBit_
Definition: MTDTopology.h:31
MTDTopology::BTLValues::layerStartBit_
unsigned int layerStartBit_
Definition: MTDTopology.h:20
MTDTopology::ETLValues::layerMask_
unsigned int layerMask_
Definition: MTDTopology.h:35
MTDTopologyEP
Definition: MTDTopologyEP.cc:16
MTDTopology::BTLValues::moduleStartBit_
unsigned int moduleStartBit_
Definition: MTDTopology.h:22
MTDTopology.h