CMS 3D CMS Logo

Functions
CTPPSGeometryESCommon Namespace Reference

Functions

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

Function Documentation

◆ applyAlignments()

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

Definition at line 6 of file CTPPSGeometryESCommon.cc.

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
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  }

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, Skims_PA_cff::name, DetGeomDesc::name(), profile_2016_postTS2_cff::rpId, and AlCaHLTBitMon_QueryRunRegistry::string.

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

DetGeomDesc::applyAlignment
void applyAlignment(const CTPPSRPAlignmentCorrectionData &)
Definition: DetGeomDesc.cc:113
mps_fire.i
i
Definition: mps_fire.py:428
DDD_CTPPS_UFSD_SEGMENT_NAME
const std::string DDD_CTPPS_UFSD_SEGMENT_NAME
Definition: CTPPSDDDNames.h:18
DDD_CTPPS_PIXELS_SENSOR_NAME
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME
Definition: CTPPSDDDNames.h:14
DetGeomDesc::addComponent
void addComponent(DetGeomDesc *)
Definition: DetGeomDesc.cc:111
DDD_CTPPS_PIXELS_RP_NAME
const std::string DDD_CTPPS_PIXELS_RP_NAME
Definition: CTPPSDDDNames.h:23
DDD_TOTEM_TIMING_RP_NAME
const std::string DDD_TOTEM_TIMING_RP_NAME
Definition: CTPPSDDDNames.h:26
DDD_CTPPS_DIAMONDS_SEGMENT_NAME
const std::string DDD_CTPPS_DIAMONDS_SEGMENT_NAME
Definition: CTPPSDDDNames.h:17
CTPPSRPAlignmentCorrectionsData::getRPCorrection
CTPPSRPAlignmentCorrectionData & getRPCorrection(unsigned int id)
returns the correction value from the RP map
Definition: CTPPSRPAlignmentCorrectionsData.cc:17
DetGeomDesc::geographicalID
DetId geographicalID() const
Definition: DetGeomDesc.h:101
DDD_CTPPS_PIXELS_SENSOR_NAME_2x2
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME_2x2
Definition: CTPPSDDDNames.h:15
DetGeomDesc::cmWithoutChildren
Definition: DetGeomDesc.h:68
DetGeomDesc::components
const Container & components() const
Definition: DetGeomDesc.h:104
DDD_CTPPS_DIAMONDS_RP_NAME
const std::string DDD_CTPPS_DIAMONDS_RP_NAME
Definition: CTPPSDDDNames.h:25
DetGeomDesc::name
const std::string & name() const
Definition: DetGeomDesc.h:72
DDD_TOTEM_TIMING_SENSOR_TMPL
const std::string DDD_TOTEM_TIMING_SENSOR_TMPL
Definition: CTPPSDDDNames.h:19
DetGeomDesc
Definition: DetGeomDesc.h:50
DDD_TOTEM_RP_RP_NAME
const std::string DDD_TOTEM_RP_RP_NAME
DDD names of RP volumes.
Definition: CTPPSDDDNames.h:22
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
profile_2016_postTS2_cff.rpId
rpId
Definition: profile_2016_postTS2_cff.py:21
DDD_TOTEM_RP_SENSOR_NAME
const std::string DDD_TOTEM_RP_SENSOR_NAME
DDD names of sensors.
Definition: CTPPSDDDNames.h:13
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
CTPPSRPAlignmentCorrectionsData::getFullSensorCorrection
CTPPSRPAlignmentCorrectionData getFullSensorCorrection(unsigned int id, bool useRPErrors=false) const
Definition: CTPPSRPAlignmentCorrectionsData.cc:47