CMS 3D CMS Logo

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 26 of file DDDTotemRPConstruction.cc.

27 {
28 }

Member Function Documentation

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

Definition at line 50 of file DDDTotemRPConstruction.cc.

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

51 {
52  // try to dive into next level
53  if (! fv->firstChild())
54  return;
55 
56  // loop over siblings in the level
57  do {
58  // create new DetGeomDesc node and add it to the parent's (gd) list
59  DetGeomDesc* newGD = new DetGeomDesc(fv);
60 
61  // add ID (only for detectors/sensors)
62  if (fv->logicalPart().name().name().compare(DDD_TOTEM_RP_DETECTOR_NAME) == 0)
63  {
64  const vector<int> &cN = fv->copyNumbers();
65  // check size of copy numubers array
66  if (cN.size() < 3)
67  throw cms::Exception("DDDTotemRPContruction") << "size of copyNumbers for RP_Silicon_Detector is "
68  << cN.size() << ". It must be >= 3." << endl;
69 
70  // extract information
71  const unsigned int A = cN[cN.size() - 3];
72  const unsigned int arm = A / 100;
73  const unsigned int station = (A % 100) / 10;
74  const unsigned int rp = A % 10;
75  const unsigned int detector = cN[cN.size() - 1];
76  newGD->setGeographicalID(TotemRPDetId(arm, station, rp, detector));
77  }
78 
79  if (fv->logicalPart().name().name().compare(DDD_TOTEM_RP_PRIMARY_VACUUM_NAME) == 0)
80  {
81  const uint32_t decRPId = fv->copyno();
82  const uint32_t armIdx = (decRPId / 100) % 10;
83  const uint32_t stIdx = (decRPId / 10) % 10;
84  const uint32_t rpIdx = decRPId % 10;
85 
86  newGD->setGeographicalID(TotemRPDetId(armIdx, stIdx, rpIdx));
87  }
88 
89  if (fv->logicalPart().name().name().compare(DDD_CTPPS_DIAMONDS_DETECTOR_NAME) == 0)
90  {
91  const vector<int>& copy_num = fv->copyNumbers();
92  const unsigned int id = copy_num[copy_num.size()-1],
93  arm = copy_num[1]-1,
94  station = 1,
95  rp = 6,
96  plane = ( id / 100 ),
97  channel = id % 100;
98  newGD->setGeographicalID( CTPPSDiamondDetId( arm, station, rp, plane, channel ) );
99  }
100 
101  gd->addComponent(newGD);
102 
103  // recursion
104  buildDetGeomDesc(fv, newGD);
105  } while (fv->nextSibling());
106 
107  // go a level up
108  fv->parent();
109 }
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
const char DDD_CTPPS_DIAMONDS_DETECTOR_NAME[]
bool firstChild()
set the current node to the first child ...
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
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 32 of file DDDTotemRPConstruction.cc.

References ALCARECOTkAlBeamHalo_cff::filter, and mixOne_simraw_on_sim_cfi::tracker.

Referenced by TotemRPGeometryESModule::produceIdealGD().

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