CMS 3D CMS Logo

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

Public Member Functions

 MTDGeometricTimingDetExtraESModule (const edm::ParameterSet &p)
 
std::unique_ptr< std::vector< GeometricTimingDetExtra > > produce (const IdealGeometryRecord &)
 
 ~MTDGeometricTimingDetExtraESModule () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
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)
 

Private Member Functions

void putOne (std::vector< GeometricTimingDetExtra > &gde, const GeometricTimingDet *gd, const DDExpandedView &ev, int lev)
 

Private Attributes

edm::ESGetToken< DDCompactView, IdealGeometryRecordcompactViewToken_
 
const bool fromDDD_
 
edm::ESGetToken< PGeometricTimingDetExtra, PGeometricTimingDetExtraRcdpTimingDetExtraToken_
 
edm::ESGetToken< GeometricTimingDet, IdealGeometryRecordtimingDetToken_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- 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 char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &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 >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- 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 23 of file MTDGeometricTimingDetExtraESModule.cc.

Constructor & Destructor Documentation

◆ MTDGeometricTimingDetExtraESModule()

MTDGeometricTimingDetExtraESModule::MTDGeometricTimingDetExtraESModule ( const edm::ParameterSet p)

Definition at line 44 of file MTDGeometricTimingDetExtraESModule.cc.

45  : fromDDD_(p.getParameter<bool>("fromDDD")) {
46  auto cc = setWhatProduced(this);
47  const edm::ESInputTag kEmptyTag;
48  timingDetToken_ = cc.consumes<GeometricTimingDet>(kEmptyTag);
49  if (fromDDD_) {
50  compactViewToken_ = cc.consumes<DDCompactView>(kEmptyTag);
51  } else {
53  }
54 }

References compactViewToken_, fromDDD_, pTimingDetExtraToken_, edm::ESProducer::setWhatProduced(), and timingDetToken_.

◆ ~MTDGeometricTimingDetExtraESModule()

MTDGeometricTimingDetExtraESModule::~MTDGeometricTimingDetExtraESModule ( )
override

Definition at line 56 of file MTDGeometricTimingDetExtraESModule.cc.

56 {}

Member Function Documentation

◆ produce()

std::unique_ptr< std::vector< GeometricTimingDetExtra > > MTDGeometricTimingDetExtraESModule::produce ( const IdealGeometryRecord iRecord)

Definition at line 58 of file MTDGeometricTimingDetExtraESModule.cc.

59  {
60  auto gde = std::make_unique<std::vector<GeometricTimingDetExtra> >();
61  // get the GeometricTimingDet which has a nav_type
62  auto const& gd = iRecord.get(timingDetToken_);
63  if (fromDDD_) {
64  // traverse all components from the tracker down;
65  // read the DD if from DD
66  const GeometricTimingDet* tracker = &(gd);
67  auto cpv = iRecord.getTransientHandle(compactViewToken_);
68  DDExpandedView ev(*cpv);
69  ev.goTo(tracker->navType());
70  putOne((*gde), tracker, ev, 0);
71  int count = 0;
72  int lev = 1;
73  // CmsMTDStringToEnum ctst
74  gde->reserve(tracker->deepComponents().size());
75  for (const auto* git : tracker->components()) {
76  ev.goTo(git->navType());
77  putOne((*gde), git, ev, lev);
78  std::vector<const GeometricTimingDet*> const& inone = git->components();
79  if (inone.empty())
80  ++count;
81  ++lev;
82  for (const auto* git2 : inone) {
83  ev.goTo(git2->navType());
84  putOne((*gde), git2, ev, lev);
85  std::vector<const GeometricTimingDet*> const& intwo = git2->components();
86  if (intwo.empty())
87  ++count;
88  ++lev;
89  for (const auto* git3 : intwo) {
90  ev.goTo(git3->navType());
91  putOne((*gde), git3, ev, lev);
92  std::vector<const GeometricTimingDet*> const& inthree = git3->components();
93  if (inthree.empty())
94  ++count;
95  ++lev;
96  for (const auto* git4 : inthree) {
97  ev.goTo(git4->navType());
98  putOne((*gde), git4, ev, lev);
99  std::vector<const GeometricTimingDet*> const& infour = git4->components();
100  if (infour.empty())
101  ++count;
102  ++lev;
103  for (const auto* git5 : infour) {
104  ev.goTo(git5->navType());
105  putOne((*gde), git5, ev, lev);
106  std::vector<const GeometricTimingDet*> const& infive = git5->components();
107  if (infive.empty())
108  ++count;
109  ++lev;
110  for (const auto* git6 : infive) {
111  ev.goTo(git6->navType());
112  putOne((*gde), git6, ev, lev);
113  std::vector<const GeometricTimingDet*> const& insix = git6->components();
114  if (insix.empty()) {
115  ++count;
116  } else {
117  edm::LogError("GeometricTimingDetExtra") << "Hierarchy has exceeded hard-coded level 6 for Tracker ";
118  }
119  } // level 6
120  --lev;
121  } // level 5
122  --lev;
123  } // level 4
124  --lev;
125  } //level 3
126  --lev;
127  } // level 2
128  --lev;
129  }
130  } else {
131  // if it is not from the DD, then just get the GDE from ES and match w/ GD.
132  PGeometricTimingDetExtra const& pgde = iRecord.get(pTimingDetExtraToken_);
133  std::map<uint32_t, const GeometricTimingDet*> helperMap;
134  const GeometricTimingDet* tracker = &gd;
135  helperMap[gd.geographicalID()] = tracker;
136  for (const auto* git : tracker->components()) { // level 1
137  helperMap[git->geographicalID()] = git;
138  for (const auto* git2 : git->components()) { // level 2
139  helperMap[git2->geographicalID()] = git2;
140  for (const auto* git3 : git2->components()) { // level 3
141  helperMap[git3->geographicalID()] = git3;
142  for (const auto* git4 : git3->components()) { // level 4
143  helperMap[git4->geographicalID()] = git4;
144  for (const auto* git5 : git4->components()) { // level 5
145  helperMap[git5->geographicalID()] = git5;
146  for (const auto* git6 : git5->components()) { // level 6
147  helperMap[git6->geographicalID()] = git6;
148  if (!git6->components().empty()) {
149  edm::LogError("GeometricTimingDetExtra")
150  << "Hierarchy has exceeded hard-coded level of 6 for Tracker ";
151  }
152  } // level 6
153  } // level 5
154  } // level 4
155  } //level 3
156  } // level 2
157  }
158 
159  const std::vector<PGeometricTimingDetExtra::Item>& pgdes = pgde.pgdes_;
160  gde->reserve(pgdes.size());
161  std::vector<DDExpandedNode> evs; //EMPTY
162  std::string nm; //EMPTY
163  for (const auto& pgde : pgdes) {
164  gde->emplace_back(GeometricTimingDetExtra(helperMap[pgde.geographicalId_],
165  pgde.geographicalId_,
166  evs,
167  pgde.volume_,
168  pgde.density_,
169  pgde.weight_,
170  pgde.copy_,
171  pgde.material_,
172  nm));
173  }
174  }
175  return gde;
176 }

References compactViewToken_, KineDebug3::count(), ev, fromDDD_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getTransientHandle(), PGeometricTimingDetExtra::pgdes_, pTimingDetExtraToken_, putOne(), AlCaHLTBitMon_QueryRunRegistry::string, timingDetToken_, and PbPb_ZMuSkimMuonDPG_cff::tracker.

◆ putOne()

void MTDGeometricTimingDetExtraESModule::putOne ( std::vector< GeometricTimingDetExtra > &  gde,
const GeometricTimingDet gd,
const DDExpandedView ev,
int  lev 
)
private

Definition at line 178 of file MTDGeometricTimingDetExtraESModule.cc.

181  {
182  std::string matname = ((ev.logicalPart()).material()).name().name();
183  std::string lpname = ((ev.logicalPart()).name().name());
184  std::vector<DDExpandedNode> evs = GeometricTimingDetExtra::GeoHistory(ev.geoHistory().begin(), ev.geoHistory().end());
185  gde.emplace_back(GeometricTimingDetExtra(
186  gd,
187  gd->geographicalId(),
188  evs,
189  ((ev.logicalPart()).solid()).volume(),
190  ((ev.logicalPart()).material()).density(),
191  ((ev.logicalPart()).material()).density() * (((ev.logicalPart()).solid()).volume() / 1000.),
192  ev.copyno(),
193  matname,
194  lpname,
195  true));
196 }

References fastSimProducer_cff::density, ev, GeometricTimingDet::geographicalId(), Skims_PA_cff::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produce().

Member Data Documentation

◆ compactViewToken_

edm::ESGetToken<DDCompactView, IdealGeometryRecord> MTDGeometricTimingDetExtraESModule::compactViewToken_
private

◆ fromDDD_

const bool MTDGeometricTimingDetExtraESModule::fromDDD_
private

◆ pTimingDetExtraToken_

edm::ESGetToken<PGeometricTimingDetExtra, PGeometricTimingDetExtraRcd> MTDGeometricTimingDetExtraESModule::pTimingDetExtraToken_
private

◆ timingDetToken_

edm::ESGetToken<GeometricTimingDet, IdealGeometryRecord> MTDGeometricTimingDetExtraESModule::timingDetToken_
private
edm::ESInputTag
Definition: ESInputTag.h:87
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
PGeometricTimingDetExtraRcd
Definition: PGeometricTimingDetExtraRcd.h:5
GeometricTimingDetExtra
Definition: GeometricTimingDetExtra.h:13
cc
MTDGeometricTimingDetExtraESModule::compactViewToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > compactViewToken_
Definition: MTDGeometricTimingDetExtraESModule.cc:37
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:99
DDExpandedView
Provides an exploded view of the detector (tree-view)
Definition: DDExpandedView.h:41
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:112
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
edm::LogError
Definition: MessageLogger.h:183
PGeometricTimingDetExtra::pgdes_
std::vector< Item > pgdes_
Definition: PGeometricTimingDetExtra.h:27
GeometricTimingDetExtra::GeoHistory
std::vector< DDExpandedNode > GeoHistory
Definition: GeometricTimingDetExtra.h:18
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
GeometricTimingDet
Definition: GeometricTimingDet.h:28
GeometricTimingDet::geographicalId
DetId geographicalId() const
Definition: GeometricTimingDet.h:135
PGeometricTimingDetExtra
Definition: PGeometricTimingDetExtra.h:9
MTDGeometricTimingDetExtraESModule::fromDDD_
const bool fromDDD_
Definition: MTDGeometricTimingDetExtraESModule.cc:39
MTDGeometricTimingDetExtraESModule::pTimingDetExtraToken_
edm::ESGetToken< PGeometricTimingDetExtra, PGeometricTimingDetExtraRcd > pTimingDetExtraToken_
Definition: MTDGeometricTimingDetExtraESModule.cc:38
MTDGeometricTimingDetExtraESModule::timingDetToken_
edm::ESGetToken< GeometricTimingDet, IdealGeometryRecord > timingDetToken_
Definition: MTDGeometricTimingDetExtraESModule.cc:36
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
fastSimProducer_cff.density
density
Definition: fastSimProducer_cff.py:61
MTDGeometricTimingDetExtraESModule::putOne
void putOne(std::vector< GeometricTimingDetExtra > &gde, const GeometricTimingDet *gd, const DDExpandedView &ev, int lev)
Definition: MTDGeometricTimingDetExtraESModule.cc:178