CMS 3D CMS Logo

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< DetGeomDescproduceIdealGD (const IdealGeometryRecord &)
 
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 > &idealGD, const edm::ESHandle< RPAlignmentCorrectionsData > &alignments, DetGeomDesc *&newGD)
 
- 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< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- 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 52 of file TotemRPGeometryESModule.cc.

Constructor & Destructor Documentation

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

Definition at line 80 of file TotemRPGeometryESModule.cc.

References edm::ParameterSet::getUntrackedParameter(), produceIdealGD(), produceMisalignedGD(), produceMisalignedTG(), produceRealGD(), produceRealTG(), edm::ESProducer::setWhatProduced(), and verbosity.

81 {
82  verbosity = p.getUntrackedParameter<unsigned int>("verbosity", 1);
83 
85 
88 
91 }
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< DetGeomDesc > produceMisalignedGD(const VeryForwardMisalignedGeometryRecord &)
std::unique_ptr< TotemRPGeometry > produceRealTG(const VeryForwardRealGeometryRecord &)
std::unique_ptr< DetGeomDesc > produceIdealGD(const IdealGeometryRecord &)
TotemRPGeometryESModule::~TotemRPGeometryESModule ( )
virtual

Definition at line 95 of file TotemRPGeometryESModule.cc.

96 {
97 }

Member Function Documentation

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

Definition at line 101 of file TotemRPGeometryESModule.cc.

References DetGeomDesc::addComponent(), DetGeomDesc::ApplyAlignment(), edmScanValgrind::buffer, DetGeomDesc::components(), DDD_CTPPS_DIAMONDS_DETECTOR_NAME, DDD_TOTEM_RP_DETECTOR_NAME, DDD_TOTEM_RP_PRIMARY_VACUUM_NAME, DetGeomDesc::geographicalID(), RPAlignmentCorrectionsData::GetFullSensorCorrection(), RPAlignmentCorrectionsData::GetRPCorrection(), mps_fire::i, edm::ESHandleBase::isValid(), DDName::name(), DetGeomDesc::name(), or, and edm::ESHandle< T >::product().

Referenced by produceMisalignedGD(), and produceRealGD().

103 {
104  newGD = new DetGeomDesc( *(idealGD.product()) );
105  deque<const DetGeomDesc *> buffer;
106  deque<DetGeomDesc *> bufferNew;
107  buffer.push_back(idealGD.product());
108  bufferNew.push_back(newGD);
109 
110  while (buffer.size() > 0)
111  {
112  const DetGeomDesc *sD = buffer.front();
113  DetGeomDesc *pD = bufferNew.front();
114  buffer.pop_front();
115  bufferNew.pop_front();
116 
117  // Is it sensor? If yes, apply full sensor alignments
118  if ( pD->name().name().compare( DDD_TOTEM_RP_DETECTOR_NAME) == 0
119  or pD->name().name().compare( DDD_CTPPS_DIAMONDS_DETECTOR_NAME ) == 0 )
120  {
121  unsigned int plId = pD->geographicalID();
122 
123  if (alignments.isValid())
124  {
125  const RPAlignmentCorrectionData& ac = alignments->GetFullSensorCorrection(plId);
126  pD->ApplyAlignment(ac);
127  }
128  }
129 
130  // Is it RP box? If yes, apply RP alignments
131  if (! pD->name().name().compare(DDD_TOTEM_RP_PRIMARY_VACUUM_NAME))
132  {
133  unsigned int rpId = pD->geographicalID();
134 
135  if (alignments.isValid())
136  {
137  const RPAlignmentCorrectionData& ac = alignments->GetRPCorrection(rpId);
138  pD->ApplyAlignment(ac);
139  }
140  }
141 
142  // create and add children
143  for (unsigned int i = 0; i < sD->components().size(); i++)
144  {
145  const DetGeomDesc *sDC = sD->components()[i];
146  buffer.push_back(sDC);
147 
148  // create new node with the same information as in sDC and add it as a child of pD
149  DetGeomDesc * cD = new DetGeomDesc(*sDC);
150  pD->addComponent(cD);
151 
152  bufferNew.push_back(cD);
153  }
154  }
155 }
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
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
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...
RPAlignmentCorrectionData GetFullSensorCorrection(unsigned int id, bool useRPErrors=false) const
DDName name() const
Definition: DetGeomDesc.h:90
const char DDD_CTPPS_DIAMONDS_DETECTOR_NAME[]
virtual DetId geographicalID() const
Definition: DetGeomDesc.h:64
RPAlignmentCorrectionData & GetRPCorrection(unsigned int id)
returns the correction value from the RP map
const char DDD_TOTEM_RP_DETECTOR_NAME[]
DDD name of RP detector.
bool isValid() const
Definition: ESHandle.h:47
T const * product() const
Definition: ESHandle.h:86
void addComponent(DetGeomDesc *)
Definition: DetGeomDesc.cc:159
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
std::unique_ptr< DetGeomDesc > TotemRPGeometryESModule::produceIdealGD ( const IdealGeometryRecord iRecord)

Definition at line 159 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

160 {
161  // get the DDCompactView from EventSetup
163  iRecord.get("XMLIdealGeometryESSource_CTPPS", cpv);
164 
165  // construct the tree of DetGeomDesc
166  DDDTotemRPContruction worker;
167  return std::unique_ptr<DetGeomDesc>( const_cast<DetGeomDesc*>( worker.construct(&(*cpv)) ) );
168 }
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< DetGeomDesc > TotemRPGeometryESModule::produceMisalignedGD ( const VeryForwardMisalignedGeometryRecord iRecord)

Definition at line 203 of file TotemRPGeometryESModule.cc.

References ApplyAlignments(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), RPAlignmentCorrectionsData::GetRPMap(), RPAlignmentCorrectionsData::GetSensorMap(), edm::ESHandleBase::isValid(), NULL, and verbosity.

Referenced by TotemRPGeometryESModule().

204 {
205  // get the input GeometricalDet
207  iRecord.getRecord<IdealGeometryRecord>().get(idealGD);
208 
209  // load alignments
211  try { iRecord.getRecord<RPMisalignedAlignmentRecord>().get(alignments); }
212  catch (...) {}
213 
214  if (alignments.isValid())
215  {
216  if (verbosity)
217  LogVerbatim("TotemRPGeometryESModule::produceMisalignedGD")
218  << ">> TotemRPGeometryESModule::produceMisalignedGD > Misaligned geometry: "
219  << alignments->GetRPMap().size() << " RP and "
220  << alignments->GetSensorMap().size() << " sensor alignments applied.";
221  } else {
222  if (verbosity)
223  LogVerbatim("TotemRPGeometryESModule::produceMisalignedGD")
224  << ">> TotemRPGeometryESModule::produceMisalignedGD > Misaligned geometry: No alignments applied.";
225  }
226 
227  DetGeomDesc* newGD = NULL;
228  ApplyAlignments(idealGD, alignments, newGD);
229  return std::unique_ptr<DetGeomDesc>(newGD);
230 }
const mapType & GetSensorMap() const
returns the map of sensor alignment corrections
const mapType & GetRPMap() const
returns the map of RP alignment corrections
#define NULL
Definition: scimark2.h:8
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
void ApplyAlignments(const edm::ESHandle< DetGeomDesc > &idealGD, const edm::ESHandle< RPAlignmentCorrectionsData > &alignments, DetGeomDesc *&newGD)
bool isValid() const
Definition: ESHandle.h:47
std::unique_ptr< TotemRPGeometry > TotemRPGeometryESModule::produceMisalignedTG ( const VeryForwardMisalignedGeometryRecord iRecord)

Definition at line 244 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

245 {
247  iRecord.get(gD);
248 
249  return std::make_unique<TotemRPGeometry>( gD.product());
250 }
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 172 of file TotemRPGeometryESModule.cc.

References ApplyAlignments(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), RPAlignmentCorrectionsData::GetRPMap(), RPAlignmentCorrectionsData::GetSensorMap(), edm::ESHandleBase::isValid(), NULL, and verbosity.

Referenced by TotemRPGeometryESModule().

173 {
174  // get the input GeometricalDet
176  iRecord.getRecord<IdealGeometryRecord>().get(idealGD);
177 
178  // load alignments
180  try { iRecord.getRecord<RPRealAlignmentRecord>().get(alignments); }
181  catch (...) {}
182 
183  if (alignments.isValid())
184  {
185  if (verbosity)
186  LogVerbatim("TotemRPGeometryESModule::produceRealGD")
187  << ">> TotemRPGeometryESModule::produceRealGD > Real geometry: "
188  << alignments->GetRPMap().size() << " RP and "
189  << alignments->GetSensorMap().size() << " sensor alignments applied.";
190  } else {
191  if (verbosity)
192  LogVerbatim("TotemRPGeometryESModule::produceRealGD")
193  << ">> TotemRPGeometryESModule::produceRealGD > Real geometry: No alignments applied.";
194  }
195 
196  DetGeomDesc* newGD = NULL;
197  ApplyAlignments(idealGD, alignments, newGD);
198  return std::unique_ptr<DetGeomDesc>(newGD);
199 }
const mapType & GetSensorMap() const
returns the map of sensor alignment corrections
const mapType & GetRPMap() const
returns the map of RP alignment corrections
#define NULL
Definition: scimark2.h:8
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
void ApplyAlignments(const edm::ESHandle< DetGeomDesc > &idealGD, const edm::ESHandle< RPAlignmentCorrectionsData > &alignments, DetGeomDesc *&newGD)
bool isValid() const
Definition: ESHandle.h:47
std::unique_ptr< TotemRPGeometry > TotemRPGeometryESModule::produceRealTG ( const VeryForwardRealGeometryRecord iRecord)

Definition at line 234 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

235 {
237  iRecord.get(gD);
238 
239  return std::make_unique<TotemRPGeometry>( gD.product());
240 }
void get(HolderT &iHolder) const
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

unsigned int TotemRPGeometryESModule::verbosity
protected