CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MTDGeometricTimingDetExtraESModule Class Reference

#include <MTDGeometricTimingDetExtraESModule.h>

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 ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
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

bool fromDDD_
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
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 >
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 eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

Definition at line 10 of file MTDGeometricTimingDetExtraESModule.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file MTDGeometricTimingDetExtraESModule.cc.

References edm::ESProducer::setWhatProduced().

25  : fromDDD_(p.getParameter<bool>("fromDDD"))
26 {
27  setWhatProduced(this);
28 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
MTDGeometricTimingDetExtraESModule::~MTDGeometricTimingDetExtraESModule ( )
override

Definition at line 30 of file MTDGeometricTimingDetExtraESModule.cc.

30 {}

Member Function Documentation

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

Definition at line 33 of file MTDGeometricTimingDetExtraESModule.cc.

References GeometricTimingDet::components(), KineDebug3::count(), GeometricTimingDet::deepComponents(), ev, fromDDD_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), DDExpandedView::goTo(), GeometricTimingDet::navType(), PGeometricTimingDetExtra::pgdes_, putOne(), AlCaHLTBitMon_QueryRunRegistry::string, and trackingTruthProducer_cfi::tracker.

33  {
34  auto gde = std::make_unique<std::vector<GeometricTimingDetExtra> >();
35  // get the GeometricTimingDet which has a nav_type
37  iRecord.get ( gd );
38  if (fromDDD_) {
39  // traverse all components from the tracker down;
40  // read the DD if from DD
41  const GeometricTimingDet* tracker = &(*gd);
43  iRecord.get( cpv );
44  DDExpandedView ev(*cpv);
45  ev.goTo(tracker->navType());
46  putOne((*gde), tracker, ev, 0);
47  std::vector<const GeometricTimingDet*> tc = tracker->components();
48  int count=0;
49  int lev = 1;
50  // CmsMTDStringToEnum ctst
51  gde->reserve(tracker->deepComponents().size());
52  for( const auto* git : tc ) {
53  ev.goTo(git->navType());
54  putOne((*gde), git, ev, lev);
55  std::vector<const GeometricTimingDet*> inone = git->components();
56  if ( inone.empty() ) ++count;
57  ++lev;
58  for( const auto* git2 : inone ) {
59  ev.goTo(git2->navType());
60  putOne((*gde), git2, ev, lev);
61  std::vector<const GeometricTimingDet*> intwo= git2->components();
62  if ( intwo.empty() ) ++count;
63  ++lev;
64  for( const auto* git3 : intwo ) {
65  ev.goTo(git3->navType());
66  putOne((*gde), git3, ev, lev);
67  std::vector<const GeometricTimingDet*> inthree= git3->components();
68  if ( inthree.empty() ) ++count;
69  ++lev;
70  for( const auto* git4 : inthree ) {
71  ev.goTo(git4->navType());
72  putOne((*gde), git4, ev, lev);
73  std::vector<const GeometricTimingDet*> infour= git4->components();
74  if ( infour.empty() ) ++count;
75  ++lev;
76  for( const auto* git5 : infour ) {
77  ev.goTo(git5->navType());
78  putOne((*gde), git5, ev, lev);
79  std::vector<const GeometricTimingDet*> infive= git5->components();
80  if ( infive.empty() ) ++count;
81  ++lev;
82  for( const auto* git6 : infive ) {
83  ev.goTo(git6->navType());
84  putOne((*gde), git6, ev, lev);
85  std::vector<const GeometricTimingDet*> insix= git6->components();
86  if ( insix.empty() ){
87  ++count;
88  } else {
89  edm::LogError("GeometricTimingDetExtra") << "Hierarchy has exceeded hard-coded level 6 for Tracker " ;
90  }
91  } // level 6
92  --lev;
93  } // level 5
94  --lev;
95  } // level 4
96  --lev;
97  } //level 3
98  --lev;
99  } // level 2
100  --lev;
101  }
102  }else{
103  // if it is not from the DD, then just get the GDE from ES and match w/ GD.
105  iRecord.getRecord<PGeometricTimingDetExtraRcd>().get(pgde);
106  std::map<uint32_t, const GeometricTimingDet*> helperMap;
107  const GeometricTimingDet* tracker = &(*gd);
108  helperMap[gd->geographicalID()] = tracker;
109  std::vector<const GeometricTimingDet*> tc = tracker->components();
110  for( const auto* git : tc ) { // level 1
111  helperMap[git->geographicalID()] = git;
112  std::vector<const GeometricTimingDet*> inone = git->components();
113  for( const auto* git2 : inone ) { // level 2
114  helperMap[git2->geographicalID()] = git2;
115  std::vector<const GeometricTimingDet*> intwo= git2->components();
116  for( const auto* git3 : intwo ) { // level 3
117  helperMap[git3->geographicalID()] = git3;
118  std::vector<const GeometricTimingDet*> inthree= git3->components();
119  for( const auto* git4 : inthree ) { // level 4
120  helperMap[git4->geographicalID()] = git4;
121  std::vector<const GeometricTimingDet*> infour= git4->components();
122  for( const auto* git5 : infour ) { // level 5
123  helperMap[git5->geographicalID()] = git5;
124  std::vector<const GeometricTimingDet*> infive= git5->components();
125  for( const auto* git6 : infive ) { // level 6
126  helperMap[git6->geographicalID()] = git6;
127  if ( !git6->components().empty() ){
128  edm::LogError("GeometricTimingDetExtra") << "Hierarchy has exceeded hard-coded level of 6 for Tracker " ;
129  }
130  } // level 6
131  } // level 5
132  } // level 4
133  } //level 3
134  } // level 2
135  }
136 
137  const std::vector<PGeometricTimingDetExtra::Item>& pgdes = pgde->pgdes_;
138  gde->reserve(pgdes.size());
139  std::vector<DDExpandedNode> evs; //EMPTY
140  std::string nm; //EMPTY
141  for (const auto & pgde : pgdes) {
142  gde->emplace_back( GeometricTimingDetExtra(helperMap[pgde.geographicalId_], pgde.geographicalId_, evs
143  , pgde.volume_, pgde.density_, pgde.weight_, pgde.copy_
144  , pgde.material_, nm));
145  }
146  }
147  return gde;
148 }
void putOne(std::vector< GeometricTimingDetExtra > &gde, const GeometricTimingDet *gd, const DDExpandedView &ev, int lev)
bool ev
ConstGeometricTimingDetContainer & components()
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
ConstGeometricTimingDetContainer deepComponents() const
nav_type const & navType() const
Provides an exploded view of the detector (tree-view)
void MTDGeometricTimingDetExtraESModule::putOne ( std::vector< GeometricTimingDetExtra > &  gde,
const GeometricTimingDet gd,
const DDExpandedView ev,
int  lev 
)
private

Definition at line 150 of file MTDGeometricTimingDetExtraESModule.cc.

References DDExpandedView::copyno(), DEFINE_FWK_EVENTSETUP_MODULE, GeometricTimingDet::geographicalId(), DDExpandedView::geoHistory(), DDExpandedView::logicalPart(), dataset::name, AlCaHLTBitMon_QueryRunRegistry::string, and funct::true.

Referenced by produce().

150  {
151  std::string matname = ((ev.logicalPart()).material()).name().fullname();
152  std::string lpname = ((ev.logicalPart()).name().fullname());
153  std::vector<DDExpandedNode> evs = GeometricTimingDetExtra::GeoHistory(ev.geoHistory().begin(),ev.geoHistory().end());
154  gde.emplace_back(GeometricTimingDetExtra( gd, gd->geographicalId(), evs,
155  ((ev.logicalPart()).solid()).volume(), ((ev.logicalPart()).material()).density(),
156  ((ev.logicalPart()).material()).density() * ( ((ev.logicalPart()).solid()).volume() / 1000.),
157  ev.copyno(), matname, lpname, true ));
158 }
DetId geographicalId() const
std::vector< DDExpandedNode > GeoHistory
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
int copyno() const
Copy number associated with the current node.
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.

Member Data Documentation

bool MTDGeometricTimingDetExtraESModule::fromDDD_
private

Definition at line 22 of file MTDGeometricTimingDetExtraESModule.h.

Referenced by produce().