CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
MTDTopologyEP Class Reference
Inheritance diagram for MTDTopologyEP:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

using ReturnType = std::unique_ptr< MTDTopology >
 

Public Member Functions

 MTDTopologyEP (const edm::ParameterSet &)
 
ReturnType produce (const MTDTopologyRcd &)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

void fillParameters (const PMTDParameters &, int &mtdTopologyMode, MTDTopology::ETLValues &)
 

Private Attributes

const edm::ESGetToken< PMTDParameters, PMTDParametersRcdtoken_
 

Additional Inherited Members

- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 17 of file MTDTopologyEP.cc.

Member Typedef Documentation

◆ ReturnType

using MTDTopologyEP::ReturnType = std::unique_ptr<MTDTopology>

Definition at line 21 of file MTDTopologyEP.cc.

Constructor & Destructor Documentation

◆ MTDTopologyEP()

MTDTopologyEP::MTDTopologyEP ( const edm::ParameterSet conf)

Definition at line 33 of file MTDTopologyEP.cc.

References edm::ESProducer::setWhatProduced().

auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
const edm::ESGetToken< PMTDParameters, PMTDParametersRcd > token_

Member Function Documentation

◆ fillDescriptions()

void MTDTopologyEP::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 36 of file MTDTopologyEP.cc.

References edm::ConfigurationDescriptions::add().

36  {
38  descriptions.add("mtdTopology", ttc);
39 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ fillParameters()

void MTDTopologyEP::fillParameters ( const PMTDParameters ptp,
int &  mtdTopologyMode,
MTDTopology::ETLValues etlVals 
)
private

Definition at line 50 of file MTDTopologyEP.cc.

References MTDTopologyMode::barphiflat, Exception, MTDTopology::ETLfaceLayout::idDetType1_, MTDTopology::ETLfaceLayout::idDiscSide_, MTDTopology::ETLfaceLayout::offset_, contentValuesCheck::ss, MTDTopology::ETLfaceLayout::start_copy_, PMTDParameters::topologyMode_, trackerHitRTTI::vector, and PMTDParameters::vitems_.

Referenced by produce().

50  {
51  mtdTopologyMode = ptp.topologyMode_;
52 
53  // for legacy geometry scenarios no topology informastion is stored, only for newer ETL 2-discs layout
54 
55  if (mtdTopologyMode <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) {
56  return;
57  }
58 
59  // Check on the internal consistency of thr ETL layout information provided by parameters
60 
61  for (size_t it = 3; it <= 9; it++) {
62  if (ptp.vitems_[it].vpars_.size() != ptp.vitems_[2].vpars_.size()) {
63  throw cms::Exception("MTDTopologyEP") << "Inconsistent size of ETL structure arrays";
64  }
65  }
66 
68 
69  // Front Face (0), starting with type Right (2)
70 
71  tmpFace.idDiscSide_ = 0; // ETL front side
72  tmpFace.idDetType1_ = 2; // ETL module type right
73 
74  tmpFace.start_copy_[0] = ptp.vitems_[3].vpars_; // start_copy_FR
75  tmpFace.start_copy_[1] = ptp.vitems_[2].vpars_; // start_copy_FL
76  tmpFace.offset_[0] = ptp.vitems_[7].vpars_; // offset_FR
77  tmpFace.offset_[1] = ptp.vitems_[6].vpars_; // offset_FL
78 
79  etlVals.emplace_back(tmpFace);
80 
81  // Back Face (1), starting with type Left (1)
82 
83  tmpFace.idDiscSide_ = 1; // ETL back side
84  tmpFace.idDetType1_ = 1; // ETL module type left
85 
86  tmpFace.start_copy_[0] = ptp.vitems_[4].vpars_; // start_copy_BL
87  tmpFace.start_copy_[1] = ptp.vitems_[5].vpars_; // start_copy_BR
88  tmpFace.offset_[0] = ptp.vitems_[8].vpars_; // offset_BL
89  tmpFace.offset_[1] = ptp.vitems_[9].vpars_; // offset_BR
90 
91  etlVals.emplace_back(tmpFace);
92 
93 #ifdef EDM_ML_DEBUG
94  edm::LogVerbatim("MTDTopologyEP") << " Topology mode = " << mtdTopologyMode << "\n";
95  auto print_array = [&](std::vector<int> vector) {
96  std::stringstream ss;
97  for (auto const& elem : vector) {
98  ss << " " << elem;
99  }
100  ss << "\n";
101  return ss.str();
102  };
103 
104  for (auto const& ilay : etlVals) {
105  edm::LogVerbatim("MTDTopologyEP") << " disc face = " << ilay.idDiscSide_ << " start det type = " << ilay.idDetType1_
106  << "\n start_copy[0]= " << print_array(ilay.start_copy_[0])
107  << "\n start_copy[1]= " << print_array(ilay.start_copy_[1])
108  << "\n offset[0]= " << print_array(ilay.offset_[0])
109  << "\n offset[1]= " << print_array(ilay.offset_[1]);
110  }
111 
112 #endif
113 }
Log< level::Info, true > LogVerbatim
std::vector< Item > vitems_
std::array< std::vector< int >, 2 > start_copy_
Definition: MTDTopology.h:19
std::array< std::vector< int >, 2 > offset_
Definition: MTDTopology.h:20

◆ produce()

MTDTopologyEP::ReturnType MTDTopologyEP::produce ( const MTDTopologyRcd iRecord)

Definition at line 41 of file MTDTopologyEP.cc.

References fillParameters(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), and token_.

41  {
42  int mtdTopologyMode;
43  MTDTopology::ETLValues etlVals;
44 
45  fillParameters(iRecord.get(token_), mtdTopologyMode, etlVals);
46 
47  return std::make_unique<MTDTopology>(mtdTopologyMode, etlVals);
48 }
std::vector< ETLfaceLayout > ETLValues
Definition: MTDTopology.h:23
const edm::ESGetToken< PMTDParameters, PMTDParametersRcd > token_
void fillParameters(const PMTDParameters &, int &mtdTopologyMode, MTDTopology::ETLValues &)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const

Member Data Documentation

◆ token_

const edm::ESGetToken<PMTDParameters, PMTDParametersRcd> MTDTopologyEP::token_
private

Definition at line 30 of file MTDTopologyEP.cc.

Referenced by produce().