CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
CTPPSGeometryESCommon Namespace Reference

Functions

std::unique_ptr< DetGeomDescapplyAlignments (const DetGeomDesc &, const CTPPSRPAlignmentCorrectionsData *)
 

Function Documentation

std::unique_ptr< DetGeomDesc > CTPPSGeometryESCommon::applyAlignments ( const DetGeomDesc idealDetRoot,
const CTPPSRPAlignmentCorrectionsData alignments 
)

Definition at line 6 of file CTPPSGeometryESCommon.cc.

References DetGeomDesc::addComponent(), DetGeomDesc::applyAlignment(), DetGeomDesc::cmWithoutChildren, DetGeomDesc::components(), DDD_CTPPS_DIAMONDS_RP_NAME, DDD_CTPPS_DIAMONDS_SEGMENT_NAME, DDD_CTPPS_PIXELS_RP_NAME, DDD_CTPPS_PIXELS_SENSOR_NAME, DDD_CTPPS_PIXELS_SENSOR_NAME_2x2, DDD_CTPPS_UFSD_SEGMENT_NAME, DDD_TOTEM_RP_RP_NAME, DDD_TOTEM_RP_SENSOR_NAME, DDD_TOTEM_TIMING_RP_NAME, DDD_TOTEM_TIMING_SENSOR_TMPL, DetGeomDesc::geographicalID(), CTPPSRPAlignmentCorrectionsData::getFullSensorCorrection(), CTPPSRPAlignmentCorrectionsData::getRPCorrection(), mps_fire::i, DetGeomDesc::name(), mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CTPPSCompositeESSource::buildGeometry(), and CTPPSGeometryESModule::produceGD().

7  {
8  std::deque<const DetGeomDesc*> bufferIdealGeo;
9  bufferIdealGeo.emplace_back(&idealDetRoot);
10 
11  std::deque<DetGeomDesc*> bufferAlignedGeo;
12  DetGeomDesc* alignedDetRoot = new DetGeomDesc(idealDetRoot, DetGeomDesc::cmWithoutChildren);
13  bufferAlignedGeo.emplace_back(alignedDetRoot);
14 
15  while (!bufferIdealGeo.empty()) {
16  const DetGeomDesc* idealDet = bufferIdealGeo.front();
17  DetGeomDesc* alignedDet = bufferAlignedGeo.front();
18  bufferIdealGeo.pop_front();
19  bufferAlignedGeo.pop_front();
20 
21  const std::string name = alignedDet->name();
22 
23  // Is it sensor? If yes, apply full sensor alignments
27  std::regex_match(name, std::regex(DDD_TOTEM_TIMING_SENSOR_TMPL))) {
28  unsigned int plId = alignedDet->geographicalID();
29 
30  if (alignments) {
31  const auto& ac = alignments->getFullSensorCorrection(plId);
32  alignedDet->applyAlignment(ac);
33  }
34  }
35 
36  // Is it RP box? If yes, apply RP alignments
38  name == DDD_TOTEM_TIMING_RP_NAME) {
39  unsigned int rpId = alignedDet->geographicalID();
40 
41  if (alignments) {
42  const auto& ac = alignments->getRPCorrection(rpId);
43  alignedDet->applyAlignment(ac);
44  }
45  }
46 
47  // create and add children
48  const auto& idealDetChildren = idealDet->components();
49  for (unsigned int i = 0; i < idealDetChildren.size(); i++) {
50  const DetGeomDesc* idealDetChild = idealDetChildren[i];
51  bufferIdealGeo.emplace_back(idealDetChild);
52 
53  // create new node with the same information as in idealDetChild and add it as a child of alignedDet
54  DetGeomDesc* alignedDetChild = new DetGeomDesc(*idealDetChild, DetGeomDesc::cmWithoutChildren);
55  alignedDet->addComponent(alignedDetChild);
56 
57  bufferAlignedGeo.emplace_back(alignedDetChild);
58  }
59  }
60  return std::unique_ptr<DetGeomDesc>(alignedDetRoot);
61  }
const std::string DDD_CTPPS_PIXELS_RP_NAME
Definition: CTPPSDDDNames.h:24
CTPPSRPAlignmentCorrectionData & getRPCorrection(unsigned int id)
returns the correction value from the RP map
DetId geographicalID() const
Definition: DetGeomDesc.h:102
void applyAlignment(const CTPPSRPAlignmentCorrectionData &)
Definition: DetGeomDesc.cc:114
const std::string DDD_TOTEM_TIMING_RP_NAME
Definition: CTPPSDDDNames.h:27
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME_2x2
Definition: CTPPSDDDNames.h:16
const std::string DDD_CTPPS_DIAMONDS_SEGMENT_NAME
Definition: CTPPSDDDNames.h:18
const std::string DDD_TOTEM_TIMING_SENSOR_TMPL
Definition: CTPPSDDDNames.h:20
CTPPSRPAlignmentCorrectionData getFullSensorCorrection(unsigned int id, bool useRPErrors=false) const
const Container & components() const
Definition: DetGeomDesc.h:105
const std::string & name() const
Definition: DetGeomDesc.h:73
const std::string DDD_TOTEM_RP_RP_NAME
DDD names of RP volumes.
Definition: CTPPSDDDNames.h:23
const std::string DDD_CTPPS_DIAMONDS_RP_NAME
Definition: CTPPSDDDNames.h:26
const std::string DDD_TOTEM_RP_SENSOR_NAME
DDD names of sensors.
Definition: CTPPSDDDNames.h:14
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME
Definition: CTPPSDDDNames.h:15
void addComponent(DetGeomDesc *)
Definition: DetGeomDesc.cc:112
const std::string DDD_CTPPS_UFSD_SEGMENT_NAME
Definition: CTPPSDDDNames.h:19