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::auto_ptr< DDCompactViewproduceMeasuredDDCV (const VeryForwardMeasuredGeometryRecord &)
 
std::auto_ptr< DetGeomDescproduceMeasuredGD (const VeryForwardMeasuredGeometryRecord &)
 
std::auto_ptr< TotemRPGeometryproduceMeasuredTG (const VeryForwardMeasuredGeometryRecord &)
 
std::auto_ptr< DetGeomDescproduceMisalignedGD (const VeryForwardMisalignedGeometryRecord &)
 
std::auto_ptr< TotemRPGeometryproduceMisalignedTG (const VeryForwardMisalignedGeometryRecord &)
 
std::auto_ptr< DetGeomDescproduceRealGD (const VeryForwardRealGeometryRecord &)
 
std::auto_ptr< TotemRPGeometryproduceRealTG (const VeryForwardRealGeometryRecord &)
 
 TotemRPGeometryESModule (const edm::ParameterSet &p)
 
virtual ~TotemRPGeometryESModule ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_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::auto_ptr< DDCompactView > produceMeasuredDDCV(const VeryForwardMeasuredGeometryRecord &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::auto_ptr< DetGeomDesc > produceMeasuredGD(const VeryForwardMeasuredGeometryRecord &)
std::auto_ptr< TotemRPGeometry > produceRealTG(const VeryForwardRealGeometryRecord &)
std::auto_ptr< DetGeomDesc > produceRealGD(const VeryForwardRealGeometryRecord &)
std::auto_ptr< TotemRPGeometry > produceMisalignedTG(const VeryForwardMisalignedGeometryRecord &)
std::auto_ptr< TotemRPGeometry > produceMeasuredTG(const VeryForwardMeasuredGeometryRecord &)
std::auto_ptr< DetGeomDesc > produceMisalignedGD(const VeryForwardMisalignedGeometryRecord &)
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(), DetGeomDesc::copyno(), DDD_TOTEM_RP_DETECTOR_NAME, DDD_TOTEM_RP_PRIMARY_VACUUM_NAME, DetGeomDesc::geographicalID(), i, edm::ESHandleBase::isValid(), DDName::name(), DetGeomDesc::name(), edm::ESHandle< class >::product(), DetId::rawId(), and TotemRPDetId::rawToDecId().

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 decId = TotemRPDetId::rawToDecId(pD->geographicalID().rawId());
127 
128  if (alignments.isValid())
129  {
130  const RPAlignmentCorrectionData& ac = alignments->GetFullSensorCorrection(decId);
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->copyno();
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
static unsigned int rawToDecId(unsigned int raw)
fast conversion Raw to Decimal ID
Definition: TotemRPDetId.h:120
const char DDD_TOTEM_RP_PRIMARY_VACUUM_NAME[]
DDD name of RP.
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
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 int copyno() const
Definition: DetGeomDesc.h:93
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:87
void TotemRPGeometryESModule::ApplyAlignments ( const edm::ESHandle< DDCompactView > &  ideal_ddcv,
const edm::ESHandle< RPAlignmentCorrectionsData > &  alignments,
DDCompactView *&  measured_ddcv 
)
protected

Definition at line 407 of file TotemRPGeometryESModule.cc.

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

409 {
410  MeasuredGeometryProducer producer(ideal_ddcv, alignments);
411  measured_ddcv = producer.produce();
412  return;
413 }
auto_ptr< DDCompactView > TotemRPGeometryESModule::produceMeasuredDDCV ( const VeryForwardMeasuredGeometryRecord iRecord)

Definition at line 417 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

418 {
419  // get the ideal DDCompactView from EventSetup
421  iRecord.getRecord<IdealGeometryRecord>().get("XMLIdealGeometryESSource_CTPPS", idealCV);
422 
423  // load alignments
425  try {
426  iRecord.getRecord<RPMeasuredAlignmentRecord>().get(alignments);
427  } catch (...) {}
428 
429  if (alignments.isValid())
430  {
431  if (verbosity)
432  {
433  LogVerbatim("TotemRPGeometryESModule::produceMeasuredDDCV")
434  << ">> TotemRPGeometryESModule::produceMeasuredDDCV > Measured geometry: "
435  << alignments->GetRPMap().size() << " RP and "
436  << alignments->GetSensorMap().size() << " sensor alignments applied.";
437  }
438  } else {
439  if (verbosity)
440  LogVerbatim("TotemRPGeometryESModule::produceMeasuredDDCV")
441  << ">> TotemRPGeometryESModule::produceMeasuredDDCV > Measured geometry: No alignments applied.";
442  }
443 
444  DDCompactView *measuredCV = NULL;
445  ApplyAlignments(idealCV, alignments, measuredCV);
446  return auto_ptr<DDCompactView>(measuredCV);
447 }
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:77
bool isValid() const
Definition: ESHandle.h:47
auto_ptr< DetGeomDesc > TotemRPGeometryESModule::produceMeasuredGD ( const VeryForwardMeasuredGeometryRecord iRecord)

Definition at line 451 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

452 {
453  // get the DDCompactView from EventSetup
455  iRecord.get(cpv);
456 
457  // construct the tree of DetGeomDesc
458  DDDTotemRPContruction worker;
459  return auto_ptr<DetGeomDesc>( const_cast<DetGeomDesc*>( worker.construct(&(*cpv)) ) );
460 }
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
auto_ptr< TotemRPGeometry > TotemRPGeometryESModule::produceMeasuredTG ( const VeryForwardMeasuredGeometryRecord iRecord)

Definition at line 526 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

527 {
529  iRecord.get(gD);
530 
531  std::auto_ptr<TotemRPGeometry> rpG( new TotemRPGeometry(gD.product()) );
532  return rpG;
533 }
void get(HolderT &iHolder) const
T const * product() const
Definition: ESHandle.h:86
The manager class for TOTEM RP geometry.
auto_ptr< DetGeomDesc > TotemRPGeometryESModule::produceMisalignedGD ( const VeryForwardMisalignedGeometryRecord iRecord)

Definition at line 495 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

496 {
497  // get the input (= measured) GeometricalDet
498  edm::ESHandle<DetGeomDesc> measuredGD;
499  iRecord.getRecord<VeryForwardMeasuredGeometryRecord>().get(measuredGD);
500 
501  // load alignments
503  try { iRecord.getRecord<RPMisalignedAlignmentRecord>().get(alignments); }
504  catch (...) {}
505 
506  if (alignments.isValid())
507  {
508  if (verbosity)
509  LogVerbatim("TotemRPGeometryESModule::produceMisalignedGD")
510  << ">> TotemRPGeometryESModule::produceMisalignedGD > Measured geometry: "
511  << alignments->GetRPMap().size() << " RP and "
512  << alignments->GetSensorMap().size() << " sensor alignments applied.";
513  } else {
514  if (verbosity)
515  LogVerbatim("TotemRPGeometryESModule::produceMisalignedGD")
516  << ">> TotemRPGeometryESModule::produceMisalignedGD > Misaligned geometry: No alignments applied.";
517  }
518 
519  DetGeomDesc* newGD = NULL;
520  ApplyAlignments(measuredGD, alignments, newGD);
521  return auto_ptr<DetGeomDesc>(newGD);
522 }
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
auto_ptr< TotemRPGeometry > TotemRPGeometryESModule::produceMisalignedTG ( const VeryForwardMisalignedGeometryRecord iRecord)

Definition at line 548 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

549 {
551  iRecord.get(gD);
552 
553  std::auto_ptr<TotemRPGeometry> rpG( new TotemRPGeometry(gD.product()) );
554  return rpG;
555 }
void get(HolderT &iHolder) const
T const * product() const
Definition: ESHandle.h:86
The manager class for TOTEM RP geometry.
auto_ptr< DetGeomDesc > TotemRPGeometryESModule::produceRealGD ( const VeryForwardRealGeometryRecord iRecord)

Definition at line 464 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

465 {
466  // get the input (= measured) GeometricalDet
467  edm::ESHandle<DetGeomDesc> measuredGD;
468  iRecord.getRecord<VeryForwardMeasuredGeometryRecord>().get(measuredGD);
469 
470  // load alignments
472  try { iRecord.getRecord<RPRealAlignmentRecord>().get(alignments); }
473  catch (...) {}
474 
475  if (alignments.isValid())
476  {
477  if (verbosity)
478  LogVerbatim("TotemRPGeometryESModule::produceRealGD")
479  << ">> TotemRPGeometryESModule::produceRealGD > Measured geometry: "
480  << alignments->GetRPMap().size() << " RP and "
481  << alignments->GetSensorMap().size() << " sensor alignments applied.";
482  } else {
483  if (verbosity)
484  LogVerbatim("TotemRPGeometryESModule::produceRealGD")
485  << ">> TotemRPGeometryESModule::produceRealGD > Real geometry: No alignments applied.";
486  }
487 
488  DetGeomDesc* newGD = NULL;
489  ApplyAlignments(measuredGD, alignments, newGD);
490  return auto_ptr<DetGeomDesc>(newGD);
491 }
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
auto_ptr< TotemRPGeometry > TotemRPGeometryESModule::produceRealTG ( const VeryForwardRealGeometryRecord iRecord)

Definition at line 537 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

538 {
540  iRecord.get(gD);
541 
542  std::auto_ptr<TotemRPGeometry> rpG( new TotemRPGeometry(gD.product()) );
543  return rpG;
544 }
void get(HolderT &iHolder) const
T const * product() const
Definition: ESHandle.h:86
The manager class for TOTEM RP geometry.

Member Data Documentation

unsigned int TotemRPGeometryESModule::verbosity
protected

Definition at line 71 of file TotemRPGeometryESModule.cc.