CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions
DDDTotemRPContruction Class Reference

Builds structure of DetGeomDesc objects out of DDCompactView (resp. DDFilteredView). More...

#include <DDDTotemRPConstruction.h>

Public Member Functions

const DetGeomDescconstruct (const DDCompactView *cpv)
 
 DDDTotemRPContruction ()
 

Protected Member Functions

void buildDetGeomDesc (DDFilteredView *fv, DetGeomDesc *gd)
 

Detailed Description

Builds structure of DetGeomDesc objects out of DDCompactView (resp. DDFilteredView).

It adds detector IDs (via class TotemRPDetId). intended to be called from: modul TotemRPDetGeomDescESModule.

Definition at line 25 of file DDDTotemRPConstruction.h.

Constructor & Destructor Documentation

DDDTotemRPContruction::DDDTotemRPContruction ( )

Definition at line 25 of file DDDTotemRPConstruction.cc.

26 {
27 }

Member Function Documentation

void DDDTotemRPContruction::buildDetGeomDesc ( DDFilteredView fv,
DetGeomDesc gd 
)
protected

Definition at line 48 of file DDDTotemRPConstruction.cc.

References funct::A, DetGeomDesc::addComponent(), DDFilteredView::copyno(), DDFilteredView::copyNumbers(), DDD_TOTEM_RP_DETECTOR_NAME, DDD_TOTEM_RP_PRIMARY_VACUUM_NAME, DDFilteredView::firstChild(), DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), DDFilteredView::nextSibling(), DDFilteredView::parent(), DetGeomDesc::setGeographicalID(), and relativeConstraints::station.

49 {
50  // try to dive into next level
51  if (! fv->firstChild())
52  return;
53 
54  // loop over siblings in the level
55  do {
56  // create new DetGeomDesc node and add it to the parent's (gd) list
57  DetGeomDesc* newGD = new DetGeomDesc(fv);
58 
59  // add ID (only for detectors/sensors)
60  if (fv->logicalPart().name().name().compare(DDD_TOTEM_RP_DETECTOR_NAME) == 0)
61  {
62  const vector<int> &cN = fv->copyNumbers();
63  // check size of copy numubers array
64  if (cN.size() < 3)
65  throw cms::Exception("DDDTotemRPContruction") << "size of copyNumbers for RP_Silicon_Detector is "
66  << cN.size() << ". It must be >= 3." << endl;
67 
68  // extract information
69  const unsigned int A = cN[cN.size() - 3];
70  const unsigned int arm = A / 100;
71  const unsigned int station = (A % 100) / 10;
72  const unsigned int rp = A % 10;
73  const unsigned int detector = cN[cN.size() - 1];
74  newGD->setGeographicalID(TotemRPDetId(arm, station, rp, detector));
75  }
76 
77  if (fv->logicalPart().name().name().compare(DDD_TOTEM_RP_PRIMARY_VACUUM_NAME) == 0)
78  {
79  const uint32_t decRPId = fv->copyno();
80  const uint32_t armIdx = (decRPId / 100) % 10;
81  const uint32_t stIdx = (decRPId / 10) % 10;
82  const uint32_t rpIdx = decRPId % 10;
83 
84  newGD->setGeographicalID(TotemRPDetId(armIdx, stIdx, rpIdx));
85  }
86 
87  gd->addComponent(newGD);
88 
89  // recursion
90  buildDetGeomDesc(fv, newGD);
91  } while (fv->nextSibling());
92 
93  // go a level up
94  fv->parent();
95 }
Detector ID class for TOTEM Si strip detectors.
Definition: TotemRPDetId.h:30
void buildDetGeomDesc(DDFilteredView *fv, DetGeomDesc *gd)
bool parent()
set the current node to the parent node ...
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:78
nav_type copyNumbers() const
return the stack of copy numbers
bool nextSibling()
set the current node to the next sibling ...
const char DDD_TOTEM_RP_PRIMARY_VACUUM_NAME[]
DDD name of RP.
int copyno() const
Copy number associated with the current node.
void setGeographicalID(DetId id)
ID stuff.
Definition: DetGeomDesc.h:63
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
bool firstChild()
set the current node to the first child ...
const char DDD_TOTEM_RP_DETECTOR_NAME[]
DDD name of RP detector.
void addComponent(DetGeomDesc *)
Definition: DetGeomDesc.cc:159
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
const DetGeomDesc * DDDTotemRPContruction::construct ( const DDCompactView cpv)

Definition at line 31 of file DDDTotemRPConstruction.cc.

References patCandidatesForDimuonsSequences_cff::tracker.

Referenced by TotemRPGeometryESModule::produceMeasuredGD().

32 {
33  // create DDFilteredView and apply the filter
34  DDFilteredView fv(*cpv);
35 
36  // conversion to DetGeomDesc structure
37  // create the root node and recursively propagates through the tree
38  // adds IDs
39  DetGeomDesc* tracker = new DetGeomDesc(&fv);
40  buildDetGeomDesc(&fv, tracker);
41 
42  // return the root of the structure
43  return tracker;
44 }
void buildDetGeomDesc(DDFilteredView *fv, DetGeomDesc *gd)
Geometrical description of a detector.
Definition: DetGeomDesc.h:40