CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
CTPPSGeometryESModule Class Reference

Builds ideal, real and misaligned geometries. More...

Inheritance diagram for CTPPSGeometryESModule:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Classes

struct  GDTokens
 

Public Member Functions

 CTPPSGeometryESModule (const edm::ParameterSet &)
 
template<typename REC >
std::unique_ptr< DetGeomDescproduceGD (IdealGeometryRecord const &iIdealRec, std::optional< REC > const &iAlignRec, GDTokens< REC > const &iTokens, const char *name)
 
 ~CTPPSGeometryESModule () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

template<typename REC >
std::unique_ptr< DetGeomDescproduceGD (IdealGeometryRecord const &, const std::optional< REC > &, GDTokens< REC > const &, const char *name)
 
std::unique_ptr< DetGeomDescproduceIdealGD (const IdealGeometryRecord &)
 
std::unique_ptr< DetGeomDescproduceMisalignedGD (const VeryForwardMisalignedGeometryRecord &)
 
std::unique_ptr< CTPPSGeometryproduceMisalignedTG (const VeryForwardMisalignedGeometryRecord &)
 
std::unique_ptr< DetGeomDescproduceRealGD (const VeryForwardRealGeometryRecord &)
 
std::unique_ptr< CTPPSGeometryproduceRealTG (const VeryForwardRealGeometryRecord &)
 

Static Private Member Functions

static void applyAlignments (const DetGeomDesc &, const CTPPSRPAlignmentCorrectionsData *, DetGeomDesc *&)
 
static void buildDetGeomDesc (DDFilteredView *fv, DetGeomDesc *gd)
 

Private Attributes

const edm::ESGetToken< DDCompactView, IdealGeometryRecordcompactViewToken_
 
const edm::ESGetToken< DetGeomDesc, VeryForwardMisalignedGeometryRecorddgdMisToken_
 
const edm::ESGetToken< DetGeomDesc, VeryForwardRealGeometryRecorddgdRealToken_
 
const GDTokens< RPMisalignedAlignmentRecordgdMisTokens_
 
const GDTokens< RPRealAlignmentRecordgdRealTokens_
 
const unsigned int verbosity_
 

Additional Inherited Members

- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy >>>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Builds ideal, real and misaligned geometries.

First, it creates a tree of DetGeomDesc from DDCompView. For real and misaligned geometries, it applies alignment corrections (RPAlignmentCorrections) found in corresponding ...GeometryRecord.

Second, it creates CTPPSGeometry from DetGeoDesc tree.

Definition at line 52 of file CTPPSGeometryESModule.cc.

Constructor & Destructor Documentation

CTPPSGeometryESModule::CTPPSGeometryESModule ( const edm::ParameterSet iConfig)

Definition at line 99 of file CTPPSGeometryESModule.cc.

References dgdMisToken_, dgdRealToken_, gdMisTokens_, gdRealTokens_, edm::ParameterSet::getParameter(), produceIdealGD(), produceMisalignedGD(), produceMisalignedTG(), produceRealGD(), produceRealTG(), edm::ESProducer::setWhatProduced(), and AlCaHLTBitMon_QueryRunRegistry::string.

100  : verbosity_(iConfig.getUntrackedParameter<unsigned int>("verbosity")),
102  .consumes<DDCompactView>(edm::ESInputTag(
103  "" /*optional module label */, iConfig.getParameter<std::string>("compactViewTag")))},
108  dgdMisToken_{
110 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< CTPPSGeometry > produceRealTG(const VeryForwardRealGeometryRecord &)
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
std::unique_ptr< CTPPSGeometry > produceMisalignedTG(const VeryForwardMisalignedGeometryRecord &)
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
const GDTokens< RPMisalignedAlignmentRecord > gdMisTokens_
std::unique_ptr< DetGeomDesc > produceRealGD(const VeryForwardRealGeometryRecord &)
const edm::ESGetToken< DetGeomDesc, VeryForwardMisalignedGeometryRecord > dgdMisToken_
const edm::ESGetToken< DDCompactView, IdealGeometryRecord > compactViewToken_
std::unique_ptr< DetGeomDesc > produceMisalignedGD(const VeryForwardMisalignedGeometryRecord &)
const edm::ESGetToken< DetGeomDesc, VeryForwardRealGeometryRecord > dgdRealToken_
std::unique_ptr< DetGeomDesc > produceIdealGD(const IdealGeometryRecord &)
const GDTokens< RPRealAlignmentRecord > gdRealTokens_
const unsigned int verbosity_
CTPPSGeometryESModule::~CTPPSGeometryESModule ( )
inlineoverride

Definition at line 55 of file CTPPSGeometryESModule.cc.

References fillDescriptions(), and produceIdealGD().

55 {}

Member Function Documentation

void CTPPSGeometryESModule::applyAlignments ( const DetGeomDesc idealGD,
const CTPPSRPAlignmentCorrectionsData alignments,
DetGeomDesc *&  newGD 
)
staticprivate

Definition at line 121 of file CTPPSGeometryESModule.cc.

References DetGeomDesc::addComponent(), DetGeomDesc::applyAlignment(), edmScanValgrind::buffer, DetGeomDesc::components(), DDD_CTPPS_DIAMONDS_RP_NAME, DDD_CTPPS_DIAMONDS_SEGMENT_NAME, DDD_CTPPS_PIXELS_RP_NAME, DDD_CTPPS_PIXELS_SENSOR_NAME, 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(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produceGD().

123  {
124  newGD = new DetGeomDesc(idealGD);
125  std::deque<const DetGeomDesc*> buffer;
126  std::deque<DetGeomDesc*> bufferNew;
127  buffer.emplace_back(&idealGD);
128  bufferNew.emplace_back(newGD);
129 
130  while (!buffer.empty()) {
131  const DetGeomDesc* sD = buffer.front();
132  DetGeomDesc* pD = bufferNew.front();
133  buffer.pop_front();
134  bufferNew.pop_front();
135 
136  const std::string name = pD->name();
137 
138  // Is it sensor? If yes, apply full sensor alignments
141  std::regex_match(name, std::regex(DDD_TOTEM_TIMING_SENSOR_TMPL))) {
142  unsigned int plId = pD->geographicalID();
143 
144  if (alignments) {
145  const auto& ac = alignments->getFullSensorCorrection(plId);
146  pD->applyAlignment(ac);
147  }
148  }
149 
150  // Is it RP box? If yes, apply RP alignments
152  name == DDD_TOTEM_TIMING_RP_NAME) {
153  unsigned int rpId = pD->geographicalID();
154 
155  if (alignments) {
156  const auto& ac = alignments->getRPCorrection(rpId);
157  pD->applyAlignment(ac);
158  }
159  }
160 
161  // create and add children
162  for (unsigned int i = 0; i < sD->components().size(); i++) {
163  const DetGeomDesc* sDC = sD->components()[i];
164  buffer.emplace_back(sDC);
165 
166  // create new node with the same information as in sDC and add it as a child of pD
167  DetGeomDesc* cD = new DetGeomDesc(*sDC);
168  pD->addComponent(cD);
169 
170  bufferNew.emplace_back(cD);
171  }
172  }
173 }
const std::string DDD_CTPPS_PIXELS_RP_NAME
Definition: CTPPSDDDNames.h:22
CTPPSRPAlignmentCorrectionData & getRPCorrection(unsigned int id)
returns the correction value from the RP map
DetId geographicalID() const
Definition: DetGeomDesc.h:53
void applyAlignment(const CTPPSRPAlignmentCorrectionData &)
alignment
Definition: DetGeomDesc.cc:76
const std::string DDD_TOTEM_TIMING_RP_NAME
Definition: CTPPSDDDNames.h:25
const std::string DDD_CTPPS_DIAMONDS_SEGMENT_NAME
Definition: CTPPSDDDNames.h:16
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
Container components() const
access to the tree structure
Definition: DetGeomDesc.cc:54
const std::string DDD_TOTEM_TIMING_SENSOR_TMPL
Definition: CTPPSDDDNames.h:18
CTPPSRPAlignmentCorrectionData getFullSensorCorrection(unsigned int id, bool useRPErrors=false) const
const std::string & name() const
Definition: DetGeomDesc.h:66
const std::string DDD_TOTEM_RP_RP_NAME
DDD names of RP volumes.
Definition: CTPPSDDDNames.h:21
const std::string DDD_CTPPS_DIAMONDS_RP_NAME
Definition: CTPPSDDDNames.h:24
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 *)
components (children) management
Definition: DetGeomDesc.cc:58
const std::string DDD_CTPPS_UFSD_SEGMENT_NAME
Definition: CTPPSDDDNames.h:17
void CTPPSGeometryESModule::buildDetGeomDesc ( DDFilteredView fv,
DetGeomDesc gd 
)
staticprivate

Definition at line 177 of file CTPPSGeometryESModule.cc.

References DetGeomDesc::addComponent(), DDFilteredView::copyno(), DDFilteredView::copyNumbers(), DDD_CTPPS_DIAMONDS_RP_NAME, DDD_CTPPS_DIAMONDS_SEGMENT_NAME, DDD_CTPPS_PIXELS_RP_NAME, DDD_CTPPS_PIXELS_SENSOR_NAME, 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, hgcalTestNeighbor_cfi::detector, DDFilteredView::firstChild(), DDFilteredView::logicalPart(), Skims_PA_cff::name, DDName::name(), DDBase< N, C >::name(), DDFilteredView::nextSibling(), DDFilteredView::parent(), DetGeomDesc::setGeographicalID(), relativeConstraints::station, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produceIdealGD().

177  {
178  // try to dive into next level
179  if (!fv->firstChild())
180  return;
181 
182  // loop over siblings in the level
183  do {
184  // create new DetGeomDesc node and add it to the parent's (gd) list
185  DetGeomDesc* newGD = new DetGeomDesc(fv);
186 
187  const std::string name = fv->logicalPart().name().name();
188 
189  // strip sensors
190  if (name == DDD_TOTEM_RP_SENSOR_NAME) {
191  const std::vector<int>& copy_num = fv->copyNumbers();
192  // check size of copy numubers array
193  if (copy_num.size() < 3)
194  throw cms::Exception("DDDTotemRPContruction")
195  << "size of copyNumbers for strip sensor is " << copy_num.size() << ". It must be >= 3.";
196 
197  // extract information
198  const unsigned int decRPId = copy_num[copy_num.size() - 3];
199  const unsigned int arm = decRPId / 100;
200  const unsigned int station = (decRPId % 100) / 10;
201  const unsigned int rp = decRPId % 10;
202  const unsigned int detector = copy_num[copy_num.size() - 1];
203  newGD->setGeographicalID(TotemRPDetId(arm, station, rp, detector));
204  }
205 
206  // strip and pixels RPs
207  else if (name == DDD_TOTEM_RP_RP_NAME || name == DDD_CTPPS_PIXELS_RP_NAME) {
208  unsigned int decRPId = fv->copyno();
209 
210  // check if it is a pixel RP
211  if (decRPId >= 10000) {
212  decRPId = decRPId % 10000;
213  const unsigned int armIdx = (decRPId / 100) % 10;
214  const unsigned int stIdx = (decRPId / 10) % 10;
215  const unsigned int rpIdx = decRPId % 10;
216  newGD->setGeographicalID(CTPPSPixelDetId(armIdx, stIdx, rpIdx));
217  } else {
218  const unsigned int armIdx = (decRPId / 100) % 10;
219  const unsigned int stIdx = (decRPId / 10) % 10;
220  const unsigned int rpIdx = decRPId % 10;
221  newGD->setGeographicalID(TotemRPDetId(armIdx, stIdx, rpIdx));
222  }
223  }
224 
225  else if (std::regex_match(name, std::regex(DDD_TOTEM_TIMING_SENSOR_TMPL))) {
226  const std::vector<int>& copy_num = fv->copyNumbers();
227  // check size of copy numbers array
228  if (copy_num.size() < 4)
229  throw cms::Exception("DDDTotemRPContruction")
230  << "size of copyNumbers for TOTEM timing sensor is " << copy_num.size() << ". It must be >= 4.";
231 
232  const unsigned int decRPId = copy_num[copy_num.size() - 4];
233  const unsigned int arm = decRPId / 100, station = (decRPId % 100) / 10, rp = decRPId % 10;
234  const unsigned int plane = copy_num[copy_num.size() - 2], channel = copy_num[copy_num.size() - 1];
235  newGD->setGeographicalID(TotemTimingDetId(arm, station, rp, plane, channel));
236  }
237 
238  else if (name == DDD_TOTEM_TIMING_RP_NAME) {
239  const unsigned int arm = fv->copyno() / 100, station = (fv->copyno() % 100) / 10, rp = fv->copyno() % 10;
240  newGD->setGeographicalID(TotemTimingDetId(arm, station, rp));
241  }
242 
243  // pixel sensors
244  else if (name == DDD_CTPPS_PIXELS_SENSOR_NAME) {
245  const std::vector<int>& copy_num = fv->copyNumbers();
246  // check size of copy numubers array
247  if (copy_num.size() < 4)
248  throw cms::Exception("DDDTotemRPContruction")
249  << "size of copyNumbers for pixel sensor is " << copy_num.size() << ". It must be >= 4.";
250 
251  // extract information
252  const unsigned int decRPId = copy_num[copy_num.size() - 4] % 10000;
253  const unsigned int arm = decRPId / 100;
254  const unsigned int station = (decRPId % 100) / 10;
255  const unsigned int rp = decRPId % 10;
256  const unsigned int detector = copy_num[copy_num.size() - 2] - 1;
257  newGD->setGeographicalID(CTPPSPixelDetId(arm, station, rp, detector));
258  }
259 
260  // diamond/UFSD sensors
261  else if (name == DDD_CTPPS_DIAMONDS_SEGMENT_NAME || name == DDD_CTPPS_UFSD_SEGMENT_NAME) {
262  const std::vector<int>& copy_num = fv->copyNumbers();
263 
264  const unsigned int id = copy_num[copy_num.size() - 1];
265  const unsigned int arm = copy_num[1] - 1;
266  const unsigned int station = 1;
267  const unsigned int rp = 6;
268  const unsigned int plane = (id / 100);
269  const unsigned int channel = id % 100;
270 
271  newGD->setGeographicalID(CTPPSDiamondDetId(arm, station, rp, plane, channel));
272  }
273 
274  // diamond/UFSD RPs
275  else if (name == DDD_CTPPS_DIAMONDS_RP_NAME) {
276  const std::vector<int>& copy_num = fv->copyNumbers();
277 
278  // check size of copy numubers array
279  if (copy_num.size() < 2)
280  throw cms::Exception("DDDTotemRPContruction")
281  << "size of copyNumbers for diamond RP is " << copy_num.size() << ". It must be >= 2.";
282 
283  const unsigned int arm = copy_num[1] - 1;
284  const unsigned int station = 1;
285  const unsigned int rp = 6;
286 
287  newGD->setGeographicalID(CTPPSDiamondDetId(arm, station, rp));
288  }
289 
290  // add component
291  gd->addComponent(newGD);
292 
293  // recursion
294  buildDetGeomDesc(fv, newGD);
295  } while (fv->nextSibling());
296 
297  // go a level up
298  fv->parent();
299 }
Detector ID class for TOTEM Si strip detectors.
Definition: TotemRPDetId.h:30
bool parent()
set the current node to the parent node ...
const std::string DDD_CTPPS_PIXELS_RP_NAME
Definition: CTPPSDDDNames.h:22
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:59
nav_type copyNumbers() const
return the stack of copy numbers
bool nextSibling()
set the current node to the next sibling ...
const std::string DDD_TOTEM_TIMING_RP_NAME
Definition: CTPPSDDDNames.h:25
const std::string DDD_CTPPS_DIAMONDS_SEGMENT_NAME
Definition: CTPPSDDDNames.h:16
int copyno() const
Copy number associated with the current node.
void setGeographicalID(DetId id)
ID stuff.
Definition: DetGeomDesc.h:52
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
const std::string DDD_TOTEM_TIMING_SENSOR_TMPL
Definition: CTPPSDDDNames.h:18
const std::string DDD_TOTEM_RP_RP_NAME
DDD names of RP volumes.
Definition: CTPPSDDDNames.h:21
const std::string DDD_CTPPS_DIAMONDS_RP_NAME
Definition: CTPPSDDDNames.h:24
static void buildDetGeomDesc(DDFilteredView *fv, DetGeomDesc *gd)
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 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 *)
components (children) management
Definition: DetGeomDesc.cc:58
const std::string & name() const
Returns the name.
Definition: DDName.cc:40
const std::string DDD_CTPPS_UFSD_SEGMENT_NAME
Definition: CTPPSDDDNames.h:17
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...
void CTPPSGeometryESModule::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 112 of file CTPPSGeometryESModule.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~CTPPSGeometryESModule().

112  {
114  desc.addUntracked<unsigned int>("verbosity", 1);
115  desc.add<std::string>("compactViewTag", std::string());
116  descriptions.add("DoodadESSource", desc);
117 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename REC >
std::unique_ptr<DetGeomDesc> CTPPSGeometryESModule::produceGD ( IdealGeometryRecord const &  ,
const std::optional< REC > &  ,
GDTokens< REC > const &  ,
const char *  name 
)
private
template<typename REC >
std::unique_ptr<DetGeomDesc> CTPPSGeometryESModule::produceGD ( IdealGeometryRecord const &  iIdealRec,
std::optional< REC > const &  iAlignRec,
GDTokens< REC > const &  iTokens,
const char *  name 
)

Definition at line 322 of file CTPPSGeometryESModule.cc.

References CTPPSGeometryESModule::GDTokens< ALIGNMENT_REC >::alignmentToken_, applyAlignments(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), CTPPSRPAlignmentCorrectionsData::getRPMap(), CTPPSRPAlignmentCorrectionsData::getSensorMap(), CTPPSGeometryESModule::GDTokens< ALIGNMENT_REC >::idealGDToken_, edm::ESHandleBase::isValid(), edm::ESHandle< T >::product(), and verbosity_.

325  {
326  // get the input GeometricalDet
327  auto const& idealGD = iIdealRec.get(iTokens.idealGDToken_);
328 
329  // load alignments
331  if (iAlignRec) {
332  alignments = iAlignRec->getHandle(iTokens.alignmentToken_);
333  }
334 
335  if (alignments.isValid()) {
336  if (verbosity_)
337  edm::LogVerbatim(name) << ">> " << name << " > Real geometry: " << alignments->getRPMap().size() << " RP and "
338  << alignments->getSensorMap().size() << " sensor alignments applied.";
339  } else {
340  if (verbosity_)
341  edm::LogVerbatim(name) << ">> " << name << " > Real geometry: No alignments applied.";
342  }
343 
344  DetGeomDesc* newGD = nullptr;
345  applyAlignments(idealGD, alignments.product(), newGD);
346  return std::unique_ptr<DetGeomDesc>(newGD);
347 }
static void applyAlignments(const DetGeomDesc &, const CTPPSRPAlignmentCorrectionsData *, DetGeomDesc *&)
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
const mapType & getRPMap() const
returns the map of RP alignment corrections
const mapType & getSensorMap() const
returns the map of sensor alignment corrections
bool isValid() const
Definition: ESHandle.h:44
const unsigned int verbosity_
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< DetGeomDesc > CTPPSGeometryESModule::produceIdealGD ( const IdealGeometryRecord iRecord)
private

Definition at line 303 of file CTPPSGeometryESModule.cc.

References buildDetGeomDesc(), compactViewToken_, ALCARECOTkAlBeamHalo_cff::filter, and edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get().

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

303  {
304  // get the DDCompactView from EventSetup
305  auto const& cpv = iRecord.get(compactViewToken_);
306 
307  // create DDFilteredView and apply the filter
309  DDFilteredView fv(cpv, filter);
310 
311  // conversion to DetGeomDesc structure
312  auto root = std::make_unique<DetGeomDesc>(&fv);
313  buildDetGeomDesc(&fv, root.get());
314 
315  // construct the tree of DetGeomDesc
316  return root;
317 }
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
A DDFilter that always returns true.
Definition: DDFilter.h:26
const edm::ESGetToken< DDCompactView, IdealGeometryRecord > compactViewToken_
static void buildDetGeomDesc(DDFilteredView *fv, DetGeomDesc *gd)
std::unique_ptr< DetGeomDesc > CTPPSGeometryESModule::produceMisalignedGD ( const VeryForwardMisalignedGeometryRecord iRecord)
private

Definition at line 358 of file CTPPSGeometryESModule.cc.

References gdMisTokens_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), produceGD(), and edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::tryToGetRecord().

Referenced by CTPPSGeometryESModule().

359  {
360  return produceGD(iRecord.getRecord<IdealGeometryRecord>(),
362  gdMisTokens_,
363  "CTPPSGeometryESModule::produceMisalignedGD");
364 }
std::unique_ptr< DetGeomDesc > produceGD(IdealGeometryRecord const &, const std::optional< REC > &, GDTokens< REC > const &, const char *name)
const GDTokens< RPMisalignedAlignmentRecord > gdMisTokens_
std::unique_ptr< CTPPSGeometry > CTPPSGeometryESModule::produceMisalignedTG ( const VeryForwardMisalignedGeometryRecord iRecord)
private

Definition at line 376 of file CTPPSGeometryESModule.cc.

References DEFINE_FWK_EVENTSETUP_MODULE, dgdMisToken_, and edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get().

Referenced by CTPPSGeometryESModule().

377  {
378  auto const& gD = iRecord.get(dgdMisToken_);
379 
380  return std::make_unique<CTPPSGeometry>(&gD);
381 }
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
const edm::ESGetToken< DetGeomDesc, VeryForwardMisalignedGeometryRecord > dgdMisToken_
std::unique_ptr< DetGeomDesc > CTPPSGeometryESModule::produceRealGD ( const VeryForwardRealGeometryRecord iRecord)
private

Definition at line 349 of file CTPPSGeometryESModule.cc.

References gdRealTokens_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), produceGD(), and edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::tryToGetRecord().

Referenced by CTPPSGeometryESModule().

349  {
350  return produceGD(iRecord.getRecord<IdealGeometryRecord>(),
353  "CTPPSGeometryESModule::produceRealGD");
354 }
std::unique_ptr< DetGeomDesc > produceGD(IdealGeometryRecord const &, const std::optional< REC > &, GDTokens< REC > const &, const char *name)
const GDTokens< RPRealAlignmentRecord > gdRealTokens_
std::unique_ptr< CTPPSGeometry > CTPPSGeometryESModule::produceRealTG ( const VeryForwardRealGeometryRecord iRecord)
private

Definition at line 368 of file CTPPSGeometryESModule.cc.

References dgdRealToken_, and edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get().

Referenced by CTPPSGeometryESModule().

368  {
369  auto const& gD = iRecord.get(dgdRealToken_);
370 
371  return std::make_unique<CTPPSGeometry>(&gD);
372 }
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
const edm::ESGetToken< DetGeomDesc, VeryForwardRealGeometryRecord > dgdRealToken_

Member Data Documentation

const edm::ESGetToken<DDCompactView, IdealGeometryRecord> CTPPSGeometryESModule::compactViewToken_
private

Definition at line 87 of file CTPPSGeometryESModule.cc.

Referenced by produceIdealGD().

const edm::ESGetToken<DetGeomDesc, VeryForwardMisalignedGeometryRecord> CTPPSGeometryESModule::dgdMisToken_
private

Definition at line 93 of file CTPPSGeometryESModule.cc.

Referenced by CTPPSGeometryESModule(), and produceMisalignedTG().

const edm::ESGetToken<DetGeomDesc, VeryForwardRealGeometryRecord> CTPPSGeometryESModule::dgdRealToken_
private

Definition at line 92 of file CTPPSGeometryESModule.cc.

Referenced by CTPPSGeometryESModule(), and produceRealTG().

const GDTokens<RPMisalignedAlignmentRecord> CTPPSGeometryESModule::gdMisTokens_
private

Definition at line 90 of file CTPPSGeometryESModule.cc.

Referenced by CTPPSGeometryESModule(), and produceMisalignedGD().

const GDTokens<RPRealAlignmentRecord> CTPPSGeometryESModule::gdRealTokens_
private

Definition at line 89 of file CTPPSGeometryESModule.cc.

Referenced by CTPPSGeometryESModule(), and produceRealGD().

const unsigned int CTPPSGeometryESModule::verbosity_
private

Definition at line 86 of file CTPPSGeometryESModule.cc.

Referenced by produceGD().