test
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 | Protected Attributes
TotemRPGeometryESModule Class Reference

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

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

Public Member Functions

std::unique_ptr< DDCompactViewproduceMeasuredDDCV (const VeryForwardMeasuredGeometryRecord &)
 
std::unique_ptr< DetGeomDescproduceMeasuredGD (const VeryForwardMeasuredGeometryRecord &)
 
std::unique_ptr< TotemRPGeometryproduceMeasuredTG (const VeryForwardMeasuredGeometryRecord &)
 
std::unique_ptr< DetGeomDescproduceMisalignedGD (const VeryForwardMisalignedGeometryRecord &)
 
std::unique_ptr< TotemRPGeometryproduceMisalignedTG (const VeryForwardMisalignedGeometryRecord &)
 
std::unique_ptr< DetGeomDescproduceRealGD (const VeryForwardRealGeometryRecord &)
 
std::unique_ptr< TotemRPGeometryproduceRealTG (const VeryForwardRealGeometryRecord &)
 
 TotemRPGeometryESModule (const edm::ParameterSet &p)
 
virtual ~TotemRPGeometryESModule ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Protected Member Functions

void ApplyAlignments (const edm::ESHandle< DetGeomDesc > &measuredGD, const edm::ESHandle< RPAlignmentCorrectionsData > &alignments, DetGeomDesc *&newGD)
 
void ApplyAlignments (const edm::ESHandle< DDCompactView > &ideal_ddcv, const edm::ESHandle< RPAlignmentCorrectionsData > &alignments, DDCompactView *&measured_ddcv)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- 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 eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Protected Attributes

unsigned int verbosity
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey,
edm::propagate_const
< std::shared_ptr< DataProxy > > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Builds ideal, real and misaligned geometries.

See schema of TOTEM RP geometry classes

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 TotemRPGeometry from DetGeoDesc tree.

Definition at line 53 of file TotemRPGeometryESModule.cc.

Constructor & Destructor Documentation

TotemRPGeometryESModule::TotemRPGeometryESModule ( const edm::ParameterSet p)

Definition at line 84 of file TotemRPGeometryESModule.cc.

References edm::ParameterSet::getUntrackedParameter(), produceMeasuredDDCV(), produceMeasuredGD(), produceMeasuredTG(), produceMisalignedGD(), produceMisalignedTG(), produceRealGD(), produceRealTG(), and HLT_25ns10e33_v2_cff::verbosity.

85 {
86  verbosity = p.getUntrackedParameter<unsigned int>("verbosity", 1);
87 
91 
94 
97 }
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< TotemRPGeometry > produceMisalignedTG(const VeryForwardMisalignedGeometryRecord &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::unique_ptr< DetGeomDesc > produceRealGD(const VeryForwardRealGeometryRecord &)
std::unique_ptr< DDCompactView > produceMeasuredDDCV(const VeryForwardMeasuredGeometryRecord &)
std::unique_ptr< DetGeomDesc > produceMeasuredGD(const VeryForwardMeasuredGeometryRecord &)
std::unique_ptr< DetGeomDesc > produceMisalignedGD(const VeryForwardMisalignedGeometryRecord &)
std::unique_ptr< TotemRPGeometry > produceRealTG(const VeryForwardRealGeometryRecord &)
std::unique_ptr< TotemRPGeometry > produceMeasuredTG(const VeryForwardMeasuredGeometryRecord &)
TotemRPGeometryESModule::~TotemRPGeometryESModule ( )
virtual

Definition at line 101 of file TotemRPGeometryESModule.cc.

102 {
103 }

Member Function Documentation

void TotemRPGeometryESModule::ApplyAlignments ( const edm::ESHandle< DetGeomDesc > &  measuredGD,
const edm::ESHandle< RPAlignmentCorrectionsData > &  alignments,
DetGeomDesc *&  newGD 
)
protected

Definition at line 107 of file TotemRPGeometryESModule.cc.

References DetGeomDesc::addComponent(), DetGeomDesc::ApplyAlignment(), DetGeomDesc::components(), DDD_TOTEM_RP_DETECTOR_NAME, DDD_TOTEM_RP_PRIMARY_VACUUM_NAME, DetGeomDesc::geographicalID(), i, edm::ESHandleBase::isValid(), DDName::name(), DetGeomDesc::name(), and edm::ESHandle< class >::product().

109 {
110  newGD = new DetGeomDesc( *(idealGD.product()) );
111  deque<const DetGeomDesc *> buffer;
112  deque<DetGeomDesc *> bufferNew;
113  buffer.push_back(idealGD.product());
114  bufferNew.push_back(newGD);
115 
116  while (buffer.size() > 0)
117  {
118  const DetGeomDesc *sD = buffer.front();
119  DetGeomDesc *pD = bufferNew.front();
120  buffer.pop_front();
121  bufferNew.pop_front();
122 
123  // Is it sensor? If yes, apply full sensor alignments
124  if (! pD->name().name().compare(DDD_TOTEM_RP_DETECTOR_NAME))
125  {
126  unsigned int plId = pD->geographicalID();
127 
128  if (alignments.isValid())
129  {
130  const RPAlignmentCorrectionData& ac = alignments->GetFullSensorCorrection(plId);
131  pD->ApplyAlignment(ac);
132  }
133  }
134 
135  // Is it RP box? If yes, apply RP alignments
136  if (! pD->name().name().compare(DDD_TOTEM_RP_PRIMARY_VACUUM_NAME))
137  {
138  unsigned int rpId = pD->geographicalID();
139 
140  if (alignments.isValid())
141  {
142  const RPAlignmentCorrectionData& ac = alignments->GetRPCorrection(rpId);
143  pD->ApplyAlignment(ac);
144  }
145  }
146 
147  // create and add children
148  for (unsigned int i = 0; i < sD->components().size(); i++)
149  {
150  const DetGeomDesc *sDC = sD->components()[i];
151  buffer.push_back(sDC);
152 
153  // create new node with the same information as in sDC and add it as a child of pD
154  DetGeomDesc * cD = new DetGeomDesc(*sDC);
155  pD->addComponent(cD);
156 
157  bufferNew.push_back(cD);
158  }
159  }
160 }
int i
Definition: DBlmapReader.cc:9
const char DDD_TOTEM_RP_PRIMARY_VACUUM_NAME[]
DDD name of RP.
void ApplyAlignment(const RPAlignmentCorrectionData &)
alignment
Definition: DetGeomDesc.cc:184
virtual ConstContainer components() const
access to the tree structure
Definition: DetGeomDesc.cc:121
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
Alignment correction or result of alignment procedure for a single RP sensor. Within the geometry des...
DDName name() const
Definition: DetGeomDesc.h:90
virtual DetId geographicalID() const
Definition: DetGeomDesc.h:64
const char DDD_TOTEM_RP_DETECTOR_NAME[]
DDD name of RP detector.
bool isValid() const
Definition: ESHandle.h:47
void addComponent(DetGeomDesc *)
Definition: DetGeomDesc.cc:159
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
void TotemRPGeometryESModule::ApplyAlignments ( const edm::ESHandle< DDCompactView > &  ideal_ddcv,
const edm::ESHandle< RPAlignmentCorrectionsData > &  alignments,
DDCompactView *&  measured_ddcv 
)
protected

Definition at line 413 of file TotemRPGeometryESModule.cc.

References MeasuredGeometryProducer::produce(), and reco_calib_source_client_cfg::producer.

415 {
416  MeasuredGeometryProducer producer(ideal_ddcv, alignments);
417  measured_ddcv = producer.produce();
418  return;
419 }
std::unique_ptr< DDCompactView > TotemRPGeometryESModule::produceMeasuredDDCV ( const VeryForwardMeasuredGeometryRecord iRecord)

Definition at line 423 of file TotemRPGeometryESModule.cc.

References edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), edm::ESHandleBase::isValid(), NULL, and HLT_25ns10e33_v2_cff::verbosity.

Referenced by TotemRPGeometryESModule().

424 {
425  // get the ideal DDCompactView from EventSetup
427  iRecord.getRecord<IdealGeometryRecord>().get("XMLIdealGeometryESSource_CTPPS", idealCV);
428 
429  // load alignments
431  try {
432  iRecord.getRecord<RPMeasuredAlignmentRecord>().get(alignments);
433  } catch (...) {}
434 
435  if (alignments.isValid())
436  {
437  if (verbosity)
438  {
439  LogVerbatim("TotemRPGeometryESModule::produceMeasuredDDCV")
440  << ">> TotemRPGeometryESModule::produceMeasuredDDCV > Measured geometry: "
441  << alignments->GetRPMap().size() << " RP and "
442  << alignments->GetSensorMap().size() << " sensor alignments applied.";
443  }
444  } else {
445  if (verbosity)
446  LogVerbatim("TotemRPGeometryESModule::produceMeasuredDDCV")
447  << ">> TotemRPGeometryESModule::produceMeasuredDDCV > Measured geometry: No alignments applied.";
448  }
449 
450  DDCompactView *measuredCV = NULL;
451  ApplyAlignments(idealCV, alignments, measuredCV);
452  return std::unique_ptr<DDCompactView>(measuredCV);
453 }
void ApplyAlignments(const edm::ESHandle< DetGeomDesc > &measuredGD, const edm::ESHandle< RPAlignmentCorrectionsData > &alignments, DetGeomDesc *&newGD)
#define NULL
Definition: scimark2.h:8
type of data representation of DDCompactView
Definition: DDCompactView.h:90
bool isValid() const
Definition: ESHandle.h:47
std::unique_ptr< DetGeomDesc > TotemRPGeometryESModule::produceMeasuredGD ( const VeryForwardMeasuredGeometryRecord iRecord)

Definition at line 457 of file TotemRPGeometryESModule.cc.

References DDDTotemRPContruction::construct(), and edm::eventsetup::EventSetupRecord::get().

Referenced by TotemRPGeometryESModule().

458 {
459  // get the DDCompactView from EventSetup
461  iRecord.get(cpv);
462 
463  // construct the tree of DetGeomDesc
464  DDDTotemRPContruction worker;
465  return std::unique_ptr<DetGeomDesc>( const_cast<DetGeomDesc*>( worker.construct(&(*cpv)) ) );
466 }
Builds structure of DetGeomDesc objects out of DDCompactView (resp. DDFilteredView).
const DetGeomDesc * construct(const DDCompactView *cpv)
void get(HolderT &iHolder) const
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
std::unique_ptr< TotemRPGeometry > TotemRPGeometryESModule::produceMeasuredTG ( const VeryForwardMeasuredGeometryRecord iRecord)

Definition at line 532 of file TotemRPGeometryESModule.cc.

References edm::eventsetup::EventSetupRecord::get(), and edm::ESHandle< class >::product().

Referenced by TotemRPGeometryESModule().

533 {
535  iRecord.get(gD);
536 
537  return std::make_unique<TotemRPGeometry>( gD.product() );
538 }
void get(HolderT &iHolder) const
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< DetGeomDesc > TotemRPGeometryESModule::produceMisalignedGD ( const VeryForwardMisalignedGeometryRecord iRecord)

Definition at line 501 of file TotemRPGeometryESModule.cc.

References edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), edm::ESHandleBase::isValid(), NULL, and HLT_25ns10e33_v2_cff::verbosity.

Referenced by TotemRPGeometryESModule().

502 {
503  // get the input (= measured) GeometricalDet
504  edm::ESHandle<DetGeomDesc> measuredGD;
505  iRecord.getRecord<VeryForwardMeasuredGeometryRecord>().get(measuredGD);
506 
507  // load alignments
509  try { iRecord.getRecord<RPMisalignedAlignmentRecord>().get(alignments); }
510  catch (...) {}
511 
512  if (alignments.isValid())
513  {
514  if (verbosity)
515  LogVerbatim("TotemRPGeometryESModule::produceMisalignedGD")
516  << ">> TotemRPGeometryESModule::produceMisalignedGD > Measured geometry: "
517  << alignments->GetRPMap().size() << " RP and "
518  << alignments->GetSensorMap().size() << " sensor alignments applied.";
519  } else {
520  if (verbosity)
521  LogVerbatim("TotemRPGeometryESModule::produceMisalignedGD")
522  << ">> TotemRPGeometryESModule::produceMisalignedGD > Misaligned geometry: No alignments applied.";
523  }
524 
525  DetGeomDesc* newGD = NULL;
526  ApplyAlignments(measuredGD, alignments, newGD);
527  return std::unique_ptr<DetGeomDesc>(newGD);
528 }
void ApplyAlignments(const edm::ESHandle< DetGeomDesc > &measuredGD, const edm::ESHandle< RPAlignmentCorrectionsData > &alignments, DetGeomDesc *&newGD)
#define NULL
Definition: scimark2.h:8
Event setup record containing the Measured (measured) geometry information.
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
bool isValid() const
Definition: ESHandle.h:47
std::unique_ptr< TotemRPGeometry > TotemRPGeometryESModule::produceMisalignedTG ( const VeryForwardMisalignedGeometryRecord iRecord)

Definition at line 552 of file TotemRPGeometryESModule.cc.

References edm::eventsetup::EventSetupRecord::get(), and edm::ESHandle< class >::product().

Referenced by TotemRPGeometryESModule().

553 {
555  iRecord.get(gD);
556 
557  return std::make_unique<TotemRPGeometry>( gD.product());
558 }
void get(HolderT &iHolder) const
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< DetGeomDesc > TotemRPGeometryESModule::produceRealGD ( const VeryForwardRealGeometryRecord iRecord)

Definition at line 470 of file TotemRPGeometryESModule.cc.

References edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), edm::ESHandleBase::isValid(), NULL, and HLT_25ns10e33_v2_cff::verbosity.

Referenced by TotemRPGeometryESModule().

471 {
472  // get the input (= measured) GeometricalDet
473  edm::ESHandle<DetGeomDesc> measuredGD;
474  iRecord.getRecord<VeryForwardMeasuredGeometryRecord>().get(measuredGD);
475 
476  // load alignments
478  try { iRecord.getRecord<RPRealAlignmentRecord>().get(alignments); }
479  catch (...) {}
480 
481  if (alignments.isValid())
482  {
483  if (verbosity)
484  LogVerbatim("TotemRPGeometryESModule::produceRealGD")
485  << ">> TotemRPGeometryESModule::produceRealGD > Measured geometry: "
486  << alignments->GetRPMap().size() << " RP and "
487  << alignments->GetSensorMap().size() << " sensor alignments applied.";
488  } else {
489  if (verbosity)
490  LogVerbatim("TotemRPGeometryESModule::produceRealGD")
491  << ">> TotemRPGeometryESModule::produceRealGD > Real geometry: No alignments applied.";
492  }
493 
494  DetGeomDesc* newGD = NULL;
495  ApplyAlignments(measuredGD, alignments, newGD);
496  return std::unique_ptr<DetGeomDesc>(newGD);
497 }
void ApplyAlignments(const edm::ESHandle< DetGeomDesc > &measuredGD, const edm::ESHandle< RPAlignmentCorrectionsData > &alignments, DetGeomDesc *&newGD)
#define NULL
Definition: scimark2.h:8
Event setup record containing the Measured (measured) geometry information.
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
bool isValid() const
Definition: ESHandle.h:47
std::unique_ptr< TotemRPGeometry > TotemRPGeometryESModule::produceRealTG ( const VeryForwardRealGeometryRecord iRecord)

Definition at line 542 of file TotemRPGeometryESModule.cc.

References edm::eventsetup::EventSetupRecord::get(), and edm::ESHandle< class >::product().

Referenced by TotemRPGeometryESModule().

543 {
545  iRecord.get(gD);
546 
547  return std::make_unique<TotemRPGeometry>( gD.product());
548 }
void get(HolderT &iHolder) const
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

unsigned int TotemRPGeometryESModule::verbosity
protected

Definition at line 71 of file TotemRPGeometryESModule.cc.