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 gather_cfg::cout, 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(idealCV);
422 
423  // load alignments
425  try {
426  iRecord.getRecord<RPMeasuredAlignmentRecord>().get(alignments);
427  } catch (...) {
428  cout<< "Exception in TotemRPGeometryESModule::produceMeasuredDDCV"
429  << " during iRecord.getRecord<RPMeasuredAlignmentRecord>().get(alignments)"<<endl;
430  }
431 
432  if (alignments.isValid()) {
433  if (verbosity){
434  cout << ">> TotemRPGeometryESModule::produceMeasuredDDCV > Measured geometry: "
435  << alignments->GetRPMap().size() << " RP and "
436  << alignments->GetSensorMap().size() << " sensor alignments applied.\n";
437  }
438  } else {
439  if (verbosity)
440  cout << ">> TotemRPGeometryESModule::produceMeasuredDDCV > Measured geometry: No alignments applied.\n";
441  }
442 
443  DDCompactView *measuredCV = NULL;
444  ApplyAlignments(idealCV, alignments, measuredCV);
445  return auto_ptr<DDCompactView>(measuredCV);
446 }
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
tuple cout
Definition: gather_cfg.py:145
bool isValid() const
Definition: ESHandle.h:47
auto_ptr< DetGeomDesc > TotemRPGeometryESModule::produceMeasuredGD ( const VeryForwardMeasuredGeometryRecord iRecord)

Definition at line 450 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

451 {
452  // get the DDCompactView from EventSetup
454  iRecord.get(cpv);
455 
456  // construct the tree of DetGeomDesc
457  DDDTotemRPContruction worker;
458  return auto_ptr<DetGeomDesc>( const_cast<DetGeomDesc*>( worker.construct(&(*cpv)) ) );
459 }
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 514 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

515 {
517  iRecord.get(gD);
518 
519  std::auto_ptr<TotemRPGeometry> rpG( new TotemRPGeometry(gD.product()) );
520  return rpG;
521 }
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 489 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

490 {
491  // get the input (= measured) GeometricalDet
492  edm::ESHandle<DetGeomDesc> measuredGD;
493  iRecord.getRecord<VeryForwardMeasuredGeometryRecord>().get(measuredGD);
494 
495  // load alignments
497  try { iRecord.getRecord<RPMisalignedAlignmentRecord>().get(alignments); }
498  catch (...) {}
499  if (alignments.isValid()) {
500  printf(">> TotemRPGeometryESModule::produceMisalignedGD > Misaligned geometry: %lu RP and %lu sensor alignments applied.\n",
501  alignments->GetRPMap().size(), alignments->GetSensorMap().size());
502  } else {
503  if (verbosity)
504  printf(">> TotemRPGeometryESModule::produceMisalignedGD > Misaligned geometry: No alignments applied.\n");
505  }
506 
507  DetGeomDesc* newGD = NULL;
508  ApplyAlignments(measuredGD, alignments, newGD);
509  return auto_ptr<DetGeomDesc>(newGD);
510 }
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 536 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

537 {
539  iRecord.get(gD);
540 
541  std::auto_ptr<TotemRPGeometry> rpG( new TotemRPGeometry(gD.product()) );
542  return rpG;
543 }
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 463 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

464 {
465  // get the input (= measured) GeometricalDet
466  edm::ESHandle<DetGeomDesc> measuredGD;
467  iRecord.getRecord<VeryForwardMeasuredGeometryRecord>().get(measuredGD);
468 
469  // load alignments
471  try { iRecord.getRecord<RPRealAlignmentRecord>().get(alignments); }
472  catch (...) {}
473  if (alignments.isValid()) {
474  if (verbosity)
475  printf(">> TotemRPGeometryESModule::produceRealGD > Real geometry: %lu RP and %lu sensor alignments applied.\n",
476  alignments->GetRPMap().size(), alignments->GetSensorMap().size());
477  } else {
478  if (verbosity)
479  printf(">> TotemRPGeometryESModule::produceRealGD > Real geometry: No alignments applied.\n");
480  }
481 
482  DetGeomDesc* newGD = NULL;
483  ApplyAlignments(measuredGD, alignments, newGD);
484  return auto_ptr<DetGeomDesc>(newGD);
485 }
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 525 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

526 {
528  iRecord.get(gD);
529 
530  std::auto_ptr<TotemRPGeometry> rpG( new TotemRPGeometry(gD.product()) );
531  return rpG;
532 }
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.