CMS 3D CMS Logo

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

#include <MTDMapDDDtoID.h>

Public Types

typedef std::map< nav_type, uint32_t > MapType
 
typedef GeometricTimingDet::nav_type nav_type
 
typedef std::map< uint32_t, nav_typeRevMapType
 

Public Member Functions

std::vector< nav_type > const & allNavTypes () const
 
void clear ()
 
unsigned int id (const nav_type &) const
 calculate the id of a given node More...
 
 MTDMapDDDtoID (const GeometricTimingDet *iDet)
 
nav_type const & navType (uint32_t) const
 
 ~MTDMapDDDtoID ()
 

Private Member Functions

void buildAll (const GeometricTimingDet *)
 
void buildAllStep2 (const GeometricTimingDet *)
 

Private Attributes

std::vector< nav_typenavVec
 
MapType path2id_
 
RevMapType revpath2id_
 

Detailed Description

Definition at line 13 of file MTDMapDDDtoID.h.

Member Typedef Documentation

typedef std::map<nav_type, uint32_t> MTDMapDDDtoID::MapType

Definition at line 16 of file MTDMapDDDtoID.h.

Definition at line 15 of file MTDMapDDDtoID.h.

typedef std::map<uint32_t, nav_type> MTDMapDDDtoID::RevMapType

Definition at line 17 of file MTDMapDDDtoID.h.

Constructor & Destructor Documentation

MTDMapDDDtoID::MTDMapDDDtoID ( const GeometricTimingDet iDet)

Definition at line 9 of file MTDMapDDDtoID.cc.

References buildAll().

9  {
10  buildAll(iDet);
11  //
12  // loop over all the volumes which hahe a SpecPar called specpar with value value,
13  // and save in the map the association nav_type<->id
14  //
15 }
void buildAll(const GeometricTimingDet *)
MTDMapDDDtoID::~MTDMapDDDtoID ( )
inline

Definition at line 20 of file MTDMapDDDtoID.h.

References allNavTypes(), buildAll(), buildAllStep2(), clear(), id(), and navType().

20 { clear(); }

Member Function Documentation

std::vector< MTDMapDDDtoID::nav_type > const & MTDMapDDDtoID::allNavTypes ( ) const

Definition at line 48 of file MTDMapDDDtoID.cc.

References navVec.

Referenced by ~MTDMapDDDtoID().

48 { return navVec; }
std::vector< nav_type > navVec
Definition: MTDMapDDDtoID.h:34
void MTDMapDDDtoID::buildAll ( const GeometricTimingDet iDet)
private

Definition at line 17 of file MTDMapDDDtoID.cc.

References buildAllStep2(), and hlt_dqm_clientPB-live_cfg::me.

Referenced by MTDMapDDDtoID(), and ~MTDMapDDDtoID().

17  {
18  edm::LogInfo("MTDMapDDDtoID") << " Building the MTDMapDDDtoID map.";
19  MTDMapDDDtoID* me = const_cast<MTDMapDDDtoID*>(this);
20  me->buildAllStep2(iDet);
21 }
void buildAllStep2(const GeometricTimingDet *)
void MTDMapDDDtoID::buildAllStep2 ( const GeometricTimingDet theTracker)
private

Definition at line 23 of file MTDMapDDDtoID.cc.

References GeometricTimingDet::deepComponents(), navVec, path2id_, and revpath2id_.

Referenced by buildAll(), and ~MTDMapDDDtoID().

23  {
24  std::vector<const GeometricTimingDet*> allDetectors;
25  theTracker->deepComponents(allDetectors);
26 
27  //
28  // Also build a map! (for slower access)
29  //
30 
31  for (auto& allDetector : allDetectors) {
32  path2id_.insert(std::pair<nav_type, uint32_t>(allDetector->navType(), (allDetector->geographicalID())()));
33  revpath2id_.insert(std::pair<uint32_t, nav_type>((allDetector->geographicalID())(), allDetector->navType()));
34  navVec.emplace_back(allDetector->navType());
35  }
36  edm::LogInfo("MTDMapDDDtoID") << "Created MTDMapDDDtoID; results in " << allDetectors.size()
37  << " detectors numbered.";
38 }
RevMapType revpath2id_
Definition: MTDMapDDDtoID.h:36
std::vector< nav_type > navVec
Definition: MTDMapDDDtoID.h:34
MapType path2id_
Definition: MTDMapDDDtoID.h:35
ConstGeometricTimingDetContainer deepComponents() const
void MTDMapDDDtoID::clear ( void  )

Definition at line 61 of file MTDMapDDDtoID.cc.

References path2id_.

Referenced by ~MTDMapDDDtoID().

61  {
62  path2id_.clear();
63  edm::LogInfo("MTDMapDDDtoID") << " MTDMapDDDtoID maps deleted from memory.";
64 }
MapType path2id_
Definition: MTDMapDDDtoID.h:35
unsigned int MTDMapDDDtoID::id ( const nav_type n) const

calculate the id of a given node

Definition at line 40 of file MTDMapDDDtoID.cc.

References path2id_, and mps_fire::result.

Referenced by ~MTDMapDDDtoID().

40  {
41  std::map<nav_type, uint32_t>::const_iterator it = path2id_.find(n);
42  unsigned int result = 0;
43  if (it != path2id_.end())
44  result = it->second;
45  return result;
46 }
MapType path2id_
Definition: MTDMapDDDtoID.h:35
MTDMapDDDtoID::nav_type const & MTDMapDDDtoID::navType ( uint32_t  num) const

Definition at line 54 of file MTDMapDDDtoID.cc.

References revpath2id_.

Referenced by ~MTDMapDDDtoID().

54  {
55  std::map<uint32_t, nav_type>::const_iterator it = revpath2id_.find(num);
56  if (it != revpath2id_.end())
57  return it->second;
58  return nullresult;
59 }
RevMapType revpath2id_
Definition: MTDMapDDDtoID.h:36

Member Data Documentation

std::vector<nav_type> MTDMapDDDtoID::navVec
private

Definition at line 34 of file MTDMapDDDtoID.h.

Referenced by allNavTypes(), and buildAllStep2().

MapType MTDMapDDDtoID::path2id_
private

Definition at line 35 of file MTDMapDDDtoID.h.

Referenced by buildAllStep2(), clear(), and id().

RevMapType MTDMapDDDtoID::revpath2id_
private

Definition at line 36 of file MTDMapDDDtoID.h.

Referenced by buildAllStep2(), and navType().