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< DetGeomDescproduceIdealGD (const IdealGeometryRecord &)
 
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 > &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::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 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(), and HLT_25ns10e33_v2_cff::verbosity.

81 {
82  verbosity = p.getUntrackedParameter<unsigned int>("verbosity", 1);
83 
85 
88 
91 }
T getUntrackedParameter(std::string const &, T const &) const
std::auto_ptr< DetGeomDesc > produceIdealGD(const IdealGeometryRecord &)
std::auto_ptr< TotemRPGeometry > produceRealTG(const VeryForwardRealGeometryRecord &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::auto_ptr< DetGeomDesc > produceRealGD(const VeryForwardRealGeometryRecord &)
std::auto_ptr< TotemRPGeometry > produceMisalignedTG(const VeryForwardMisalignedGeometryRecord &)
std::auto_ptr< DetGeomDesc > produceMisalignedGD(const VeryForwardMisalignedGeometryRecord &)
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(), DetGeomDesc::components(), DDD_CTPPS_DIAMONDS_DETECTOR_NAME, DDD_TOTEM_RP_DETECTOR_NAME, DDD_TOTEM_RP_PRIMARY_VACUUM_NAME, DetGeomDesc::geographicalID(), i, edm::ESHandleBase::isValid(), DDName::name(), DetGeomDesc::name(), or, and edm::ESHandle< class >::product().

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 }
int i
Definition: DBlmapReader.cc:9
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
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
const char DDD_CTPPS_DIAMONDS_DETECTOR_NAME[]
virtual DetId geographicalID() const
Definition: DetGeomDesc.h:64
T const * product() const
Definition: ESHandle.h:86
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
std::auto_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 auto_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
auto_ptr< DetGeomDesc > TotemRPGeometryESModule::produceMisalignedGD ( const VeryForwardMisalignedGeometryRecord iRecord)

Definition at line 203 of file TotemRPGeometryESModule.cc.

References edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), edm::ESHandleBase::isValid(), NULL, and HLT_25ns10e33_v2_cff::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::auto_ptr<DetGeomDesc>(newGD);
230 }
#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
auto_ptr< TotemRPGeometry > TotemRPGeometryESModule::produceMisalignedTG ( const VeryForwardMisalignedGeometryRecord iRecord)

Definition at line 245 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

246 {
248  iRecord.get(gD);
249 
250  std::auto_ptr<TotemRPGeometry> rpG( new TotemRPGeometry(gD.product()) );
251  return rpG;
252 }
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 172 of file TotemRPGeometryESModule.cc.

References edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), edm::ESHandleBase::isValid(), NULL, and HLT_25ns10e33_v2_cff::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::auto_ptr<DetGeomDesc>(newGD);
199 }
#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::auto_ptr< TotemRPGeometry > TotemRPGeometryESModule::produceRealTG ( const VeryForwardRealGeometryRecord iRecord)

Definition at line 234 of file TotemRPGeometryESModule.cc.

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

Referenced by TotemRPGeometryESModule().

235 {
237  iRecord.get(gD);
238 
239  std::auto_ptr<TotemRPGeometry> rpG( new TotemRPGeometry(gD.product()) );
240  return rpG;
241 }
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 67 of file TotemRPGeometryESModule.cc.