CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
CTPPSGeometryESModule Class Reference

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

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

Classes

struct  GDTokens
 

Public Member Functions

 CTPPSGeometryESModule (const edm::ParameterSet &)
 
template<typename REC >
std::unique_ptr< DetGeomDescproduceGD (IdealGeometryRecord const &iIdealRec, std::optional< REC > const &iAlignRec, GDTokens< REC > const &iTokens, const char *name)
 
 ~CTPPSGeometryESModule () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- 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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

template<typename REC >
std::unique_ptr< DetGeomDescproduceGD (IdealGeometryRecord const &, const std::optional< REC > &, GDTokens< REC > const &, const char *name)
 
std::unique_ptr< DetGeomDescproduceIdealGD (const IdealGeometryRecord &)
 
std::unique_ptr< DetGeomDescproduceMisalignedGD (const VeryForwardMisalignedGeometryRecord &)
 
std::unique_ptr< CTPPSGeometryproduceMisalignedTG (const VeryForwardMisalignedGeometryRecord &)
 
std::unique_ptr< DetGeomDescproduceRealGD (const VeryForwardRealGeometryRecord &)
 
std::unique_ptr< CTPPSGeometryproduceRealTG (const VeryForwardRealGeometryRecord &)
 

Static Private Member Functions

static void applyAlignments (const DetGeomDesc &, const CTPPSRPAlignmentCorrectionsData *, DetGeomDesc *&)
 
static void buildDetGeomDesc (DDFilteredView *fv, DetGeomDesc *gd)
 

Private Attributes

const edm::ESGetToken< DDCompactView, IdealGeometryRecordcompactViewToken_
 
const edm::ESGetToken< DetGeomDesc, VeryForwardMisalignedGeometryRecorddgdMisToken_
 
const edm::ESGetToken< DetGeomDesc, VeryForwardRealGeometryRecorddgdRealToken_
 
const GDTokens< RPMisalignedAlignmentRecordgdMisTokens_
 
const GDTokens< RPRealAlignmentRecordgdRealTokens_
 
const 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
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- 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())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 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 &)
 

Detailed Description

Builds ideal, real and misaligned geometries.

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

Definition at line 52 of file CTPPSGeometryESModule.cc.

Constructor & Destructor Documentation

CTPPSGeometryESModule::CTPPSGeometryESModule ( const edm::ParameterSet iConfig)

Definition at line 100 of file CTPPSGeometryESModule.cc.

References dgdMisToken_, dgdRealToken_, gdMisTokens_, gdRealTokens_, edm::ParameterSet::getParameter(), produceIdealGD(), produceMisalignedGD(), produceMisalignedTG(), produceRealGD(), produceRealTG(), edm::ESProducer::setWhatProduced(), and AlCaHLTBitMon_QueryRunRegistry::string.

100  :
101  verbosity_( iConfig.getUntrackedParameter<unsigned int>( "verbosity") ),
103  .consumes<DDCompactView>(edm::ESInputTag(""/*optional module label */,
104  iConfig.getParameter<std::string>( "compactViewTag" ) )) },
109 {
110 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< CTPPSGeometry > produceRealTG(const VeryForwardRealGeometryRecord &)
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
std::unique_ptr< CTPPSGeometry > produceMisalignedTG(const VeryForwardMisalignedGeometryRecord &)
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
const GDTokens< RPMisalignedAlignmentRecord > gdMisTokens_
std::unique_ptr< DetGeomDesc > produceRealGD(const VeryForwardRealGeometryRecord &)
const edm::ESGetToken< DetGeomDesc, VeryForwardMisalignedGeometryRecord > dgdMisToken_
const edm::ESGetToken< DDCompactView, IdealGeometryRecord > compactViewToken_
std::unique_ptr< DetGeomDesc > produceMisalignedGD(const VeryForwardMisalignedGeometryRecord &)
const edm::ESGetToken< DetGeomDesc, VeryForwardRealGeometryRecord > dgdRealToken_
std::unique_ptr< DetGeomDesc > produceIdealGD(const IdealGeometryRecord &)
const GDTokens< RPRealAlignmentRecord > gdRealTokens_
const unsigned int verbosity_
CTPPSGeometryESModule::~CTPPSGeometryESModule ( )
inlineoverride

Definition at line 56 of file CTPPSGeometryESModule.cc.

References fillDescriptions(), and produceIdealGD().

56 {}

Member Function Documentation

void CTPPSGeometryESModule::applyAlignments ( const DetGeomDesc idealGD,
const CTPPSRPAlignmentCorrectionsData alignments,
DetGeomDesc *&  newGD 
)
staticprivate

Definition at line 124 of file CTPPSGeometryESModule.cc.

References DetGeomDesc::addComponent(), DetGeomDesc::applyAlignment(), edmScanValgrind::buffer, DetGeomDesc::components(), DDD_CTPPS_DIAMONDS_RP_NAME, DDD_CTPPS_DIAMONDS_SEGMENT_NAME, DDD_CTPPS_PIXELS_RP_NAME, DDD_CTPPS_PIXELS_SENSOR_NAME, DDD_CTPPS_UFSD_SEGMENT_NAME, DDD_TOTEM_RP_RP_NAME, DDD_TOTEM_RP_SENSOR_NAME, DDD_TOTEM_TIMING_RP_NAME, DDD_TOTEM_TIMING_SENSOR_TMPL, DetGeomDesc::geographicalID(), CTPPSRPAlignmentCorrectionsData::getFullSensorCorrection(), CTPPSRPAlignmentCorrectionsData::getRPCorrection(), mps_fire::i, dataset::name, DetGeomDesc::name(), year_2016_postTS2_cff::rpId, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produceGD().

127 {
128  newGD = new DetGeomDesc( idealGD );
129  std::deque<const DetGeomDesc*> buffer;
130  std::deque<DetGeomDesc*> bufferNew;
131  buffer.emplace_back( &idealGD );
132  bufferNew.emplace_back( newGD );
133 
134  while ( !buffer.empty() ) {
135  const DetGeomDesc* sD = buffer.front();
136  DetGeomDesc* pD = bufferNew.front();
137  buffer.pop_front();
138  bufferNew.pop_front();
139 
140  const std::string name = pD->name();
141 
142  // Is it sensor? If yes, apply full sensor alignments
143  if ( name == DDD_TOTEM_RP_SENSOR_NAME
145  || name == DDD_CTPPS_UFSD_SEGMENT_NAME
147  || std::regex_match( name, std::regex( DDD_TOTEM_TIMING_SENSOR_TMPL ) )) {
148  unsigned int plId = pD->geographicalID();
149 
150  if ( alignments ) {
151  const auto& ac = alignments->getFullSensorCorrection( plId );
152  pD->applyAlignment( ac );
153  }
154  }
155 
156  // Is it RP box? If yes, apply RP alignments
157  if ( name == DDD_TOTEM_RP_RP_NAME
158  || name == DDD_CTPPS_DIAMONDS_RP_NAME
159  || name == DDD_CTPPS_PIXELS_RP_NAME
160  || name == DDD_TOTEM_TIMING_RP_NAME ) {
161  unsigned int rpId = pD->geographicalID();
162 
163  if ( alignments ) {
164  const auto& ac = alignments->getRPCorrection( rpId );
165  pD->applyAlignment( ac );
166  }
167  }
168 
169  // create and add children
170  for ( unsigned int i = 0; i < sD->components().size(); i++ ) {
171  const DetGeomDesc* sDC = sD->components()[i];
172  buffer.emplace_back( sDC );
173 
174  // create new node with the same information as in sDC and add it as a child of pD
175  DetGeomDesc* cD = new DetGeomDesc( *sDC );
176  pD->addComponent( cD );
177 
178  bufferNew.emplace_back( cD );
179  }
180  }
181 }
const std::string DDD_CTPPS_PIXELS_RP_NAME
Definition: CTPPSDDDNames.h:23
CTPPSRPAlignmentCorrectionData & getRPCorrection(unsigned int id)
returns the correction value from the RP map
DetId geographicalID() const
Definition: DetGeomDesc.h:54
void applyAlignment(const CTPPSRPAlignmentCorrectionData &)
alignment
Definition: DetGeomDesc.cc:102
const std::string DDD_TOTEM_TIMING_RP_NAME
Definition: CTPPSDDDNames.h:25
const std::string DDD_CTPPS_DIAMONDS_SEGMENT_NAME
Definition: CTPPSDDDNames.h:17
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
Container components() const
access to the tree structure
Definition: DetGeomDesc.cc:70
const std::string DDD_TOTEM_TIMING_SENSOR_TMPL
Definition: CTPPSDDDNames.h:19
CTPPSRPAlignmentCorrectionData getFullSensorCorrection(unsigned int id, bool useRPErrors=false) const
const std::string & name() const
Definition: DetGeomDesc.h:67
const std::string DDD_TOTEM_RP_RP_NAME
DDD names of RP volumes.
Definition: CTPPSDDDNames.h:22
const std::string DDD_CTPPS_DIAMONDS_RP_NAME
Definition: CTPPSDDDNames.h:24
const std::string DDD_TOTEM_RP_SENSOR_NAME
DDD names of sensors.
Definition: CTPPSDDDNames.h:14
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME
Definition: CTPPSDDDNames.h:15
void addComponent(DetGeomDesc *)
components (children) management
Definition: DetGeomDesc.cc:77
const std::string DDD_CTPPS_UFSD_SEGMENT_NAME
Definition: CTPPSDDDNames.h:18
void CTPPSGeometryESModule::buildDetGeomDesc ( DDFilteredView fv,
DetGeomDesc gd 
)
staticprivate

Definition at line 186 of file CTPPSGeometryESModule.cc.

References DetGeomDesc::addComponent(), protons_cff::arm, DDFilteredView::copyno(), DDFilteredView::copyNumbers(), DDD_CTPPS_DIAMONDS_RP_NAME, DDD_CTPPS_DIAMONDS_SEGMENT_NAME, DDD_CTPPS_PIXELS_RP_NAME, DDD_CTPPS_PIXELS_SENSOR_NAME, DDD_CTPPS_UFSD_SEGMENT_NAME, DDD_TOTEM_RP_RP_NAME, DDD_TOTEM_RP_SENSOR_NAME, DDD_TOTEM_TIMING_RP_NAME, DDD_TOTEM_TIMING_SENSOR_TMPL, protons_cff::decRPId, gamEcalExtractorBlocks_cff::detector, DDFilteredView::firstChild(), DDFilteredView::logicalPart(), DDName::name(), dataset::name, DDBase< N, C >::name(), DDFilteredView::nextSibling(), DDFilteredView::parent(), DetGeomDesc::setGeographicalID(), relativeConstraints::station, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by produceIdealGD().

187 {
188  // try to dive into next level
189  if ( !fv->firstChild() ) return;
190 
191  // loop over siblings in the level
192  do {
193  // create new DetGeomDesc node and add it to the parent's (gd) list
194  DetGeomDesc* newGD = new DetGeomDesc( fv );
195 
196  const std::string name = fv->logicalPart().name().name();
197 
198  // strip sensors
199  if ( name == DDD_TOTEM_RP_SENSOR_NAME ) {
200  const std::vector<int>& copy_num = fv->copyNumbers();
201  // check size of copy numubers array
202  if ( copy_num.size() < 3 )
203  throw cms::Exception("DDDTotemRPContruction") << "size of copyNumbers for strip sensor is "
204  << copy_num.size() << ". It must be >= 3.";
205 
206  // extract information
207  const unsigned int decRPId = copy_num[copy_num.size() - 3];
208  const unsigned int arm = decRPId / 100;
209  const unsigned int station = ( decRPId % 100 ) / 10;
210  const unsigned int rp = decRPId % 10;
211  const unsigned int detector = copy_num[copy_num.size() - 1];
212  newGD->setGeographicalID( TotemRPDetId( arm, station, rp, detector ) );
213  }
214 
215  // strip and pixels RPs
216  else if ( name == DDD_TOTEM_RP_RP_NAME || name == DDD_CTPPS_PIXELS_RP_NAME ) {
217  unsigned int decRPId = fv->copyno();
218 
219  // check if it is a pixel RP
220  if ( decRPId >= 10000 ){
221  decRPId = decRPId % 10000;
222  const unsigned int armIdx = ( decRPId / 100 ) % 10;
223  const unsigned int stIdx = ( decRPId / 10 ) % 10;
224  const unsigned int rpIdx = decRPId % 10;
225  newGD->setGeographicalID( CTPPSPixelDetId( armIdx, stIdx, rpIdx ) );
226  }
227  else {
228  const unsigned int armIdx = ( decRPId / 100 ) % 10;
229  const unsigned int stIdx = ( decRPId / 10 ) % 10;
230  const unsigned int rpIdx = decRPId % 10;
231  newGD->setGeographicalID( TotemRPDetId( armIdx, stIdx, rpIdx ) );
232  }
233  }
234 
235  else if ( std::regex_match( name, std::regex( DDD_TOTEM_TIMING_SENSOR_TMPL ) ) ) {
236  const std::vector<int>& copy_num = fv->copyNumbers();
237  // check size of copy numbers array
238  if ( copy_num.size() < 4 )
239  throw cms::Exception("DDDTotemRPContruction") << "size of copyNumbers for TOTEM timing sensor is "
240  << copy_num.size() << ". It must be >= 4.";
241 
242  const unsigned int decRPId = copy_num[copy_num.size()-4];
243  const unsigned int arm = decRPId / 100, station = ( decRPId % 100 )/10, rp = decRPId % 10;
244  const unsigned int plane = copy_num[copy_num.size()-2], channel = copy_num[copy_num.size()-1];
245  newGD->setGeographicalID( TotemTimingDetId( arm, station, rp, plane, channel ) );
246  }
247 
248  else if ( name == DDD_TOTEM_TIMING_RP_NAME ) {
249  const unsigned int arm = fv->copyno() / 100, station = ( fv->copyno() % 100 )/10, rp = fv->copyno() % 10;
250  newGD->setGeographicalID( TotemTimingDetId( arm, station, rp ) );
251  }
252 
253  // pixel sensors
254  else if ( name == DDD_CTPPS_PIXELS_SENSOR_NAME ) {
255  const std::vector<int>& copy_num = fv->copyNumbers();
256  // check size of copy numubers array
257  if ( copy_num.size() < 4 )
258  throw cms::Exception("DDDTotemRPContruction") << "size of copyNumbers for pixel sensor is "
259  << copy_num.size() << ". It must be >= 4.";
260 
261  // extract information
262  const unsigned int decRPId = copy_num[copy_num.size() - 4] % 10000;
263  const unsigned int arm = decRPId / 100;
264  const unsigned int station = ( decRPId % 100 ) / 10;
265  const unsigned int rp = decRPId % 10;
266  const unsigned int detector = copy_num[copy_num.size() - 2] - 1;
267  newGD->setGeographicalID( CTPPSPixelDetId( arm, station, rp, detector ) );
268  }
269 
270  // diamond/UFSD sensors
271  else if ( name == DDD_CTPPS_DIAMONDS_SEGMENT_NAME || name == DDD_CTPPS_UFSD_SEGMENT_NAME ) {
272  const std::vector<int>& copy_num = fv->copyNumbers();
273 
274  const unsigned int id = copy_num[copy_num.size()-1];
275  const unsigned int arm = copy_num[1]-1;
276  const unsigned int station = 1;
277  const unsigned int rp = 6;
278  const unsigned int plane = ( id / 100 );
279  const unsigned int channel = id % 100;
280 
281  newGD->setGeographicalID( CTPPSDiamondDetId( arm, station, rp, plane, channel ) );
282  }
283 
284  // diamond/UFSD RPs
285  else if ( name == DDD_CTPPS_DIAMONDS_RP_NAME ) {
286  const std::vector<int>& copy_num = fv->copyNumbers();
287 
288  // check size of copy numubers array
289  if ( copy_num.size() < 2 )
290  throw cms::Exception("DDDTotemRPContruction") << "size of copyNumbers for diamond RP is "
291  << copy_num.size() << ". It must be >= 2.";
292 
293  const unsigned int arm = copy_num[1] - 1;
294  const unsigned int station = 1;
295  const unsigned int rp = 6;
296 
297  newGD->setGeographicalID( CTPPSDiamondDetId( arm, station, rp ) );
298  }
299 
300  // add component
301  gd->addComponent( newGD );
302 
303  // recursion
304  buildDetGeomDesc( fv, newGD );
305  } while ( fv->nextSibling() );
306 
307  // go a level up
308  fv->parent();
309 }
Detector ID class for TOTEM Si strip detectors.
Definition: TotemRPDetId.h:30
bool parent()
set the current node to the parent node ...
const std::string DDD_CTPPS_PIXELS_RP_NAME
Definition: CTPPSDDDNames.h:23
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:74
nav_type copyNumbers() const
return the stack of copy numbers
bool nextSibling()
set the current node to the next sibling ...
const std::string DDD_TOTEM_TIMING_RP_NAME
Definition: CTPPSDDDNames.h:25
const std::string DDD_CTPPS_DIAMONDS_SEGMENT_NAME
Definition: CTPPSDDDNames.h:17
int copyno() const
Copy number associated with the current node.
void setGeographicalID(DetId id)
ID stuff.
Definition: DetGeomDesc.h:53
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
const std::string DDD_TOTEM_TIMING_SENSOR_TMPL
Definition: CTPPSDDDNames.h:19
const std::string DDD_TOTEM_RP_RP_NAME
DDD names of RP volumes.
Definition: CTPPSDDDNames.h:22
const std::string DDD_CTPPS_DIAMONDS_RP_NAME
Definition: CTPPSDDDNames.h:24
static void buildDetGeomDesc(DDFilteredView *fv, DetGeomDesc *gd)
bool firstChild()
set the current node to the first child ...
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
const std::string DDD_TOTEM_RP_SENSOR_NAME
DDD names of sensors.
Definition: CTPPSDDDNames.h:14
const std::string DDD_CTPPS_PIXELS_SENSOR_NAME
Definition: CTPPSDDDNames.h:15
void addComponent(DetGeomDesc *)
components (children) management
Definition: DetGeomDesc.cc:77
const std::string & name() const
Returns the name.
Definition: DDName.cc:53
const std::string DDD_CTPPS_UFSD_SEGMENT_NAME
Definition: CTPPSDDDNames.h:18
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...
void CTPPSGeometryESModule::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 113 of file CTPPSGeometryESModule.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~CTPPSGeometryESModule().

113  {
115  desc.addUntracked<unsigned int>("verbosity", 1);
116  desc.add<std::string>("compactViewTag", std::string());
117  descriptions.add("DoodadESSource", desc);
118 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename REC >
std::unique_ptr<DetGeomDesc> CTPPSGeometryESModule::produceGD ( IdealGeometryRecord const &  ,
const std::optional< REC > &  ,
GDTokens< REC > const &  ,
const char *  name 
)
private
template<typename REC >
std::unique_ptr<DetGeomDesc> CTPPSGeometryESModule::produceGD ( IdealGeometryRecord const &  iIdealRec,
std::optional< REC > const &  iAlignRec,
GDTokens< REC > const &  iTokens,
const char *  name 
)

Definition at line 335 of file CTPPSGeometryESModule.cc.

References CTPPSGeometryESModule::GDTokens< ALIGNMENT_REC >::alignmentToken_, applyAlignments(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), CTPPSRPAlignmentCorrectionsData::getRPMap(), CTPPSRPAlignmentCorrectionsData::getSensorMap(), CTPPSGeometryESModule::GDTokens< ALIGNMENT_REC >::idealGDToken_, edm::ESHandleBase::isValid(), edm::ESHandle< T >::product(), and verbosity_.

338  {
339  // get the input GeometricalDet
340  auto const& idealGD = iIdealRec.get( iTokens.idealGDToken_ );
341 
342  // load alignments
344  if(iAlignRec) {
345  alignments = iAlignRec->getHandle(iTokens.alignmentToken_);
346  }
347 
348  if ( alignments.isValid() ) {
349  if ( verbosity_ )
351  << ">> "<<name<<" > Real geometry: "
352  << alignments->getRPMap().size() << " RP and "
353  << alignments->getSensorMap().size() << " sensor alignments applied.";
354  }
355  else {
356  if ( verbosity_ )
358  << ">> "<<name<< " > Real geometry: No alignments applied.";
359  }
360 
361  DetGeomDesc* newGD = nullptr;
362  applyAlignments( idealGD, alignments.product(), newGD );
363  return std::unique_ptr<DetGeomDesc>( newGD );
364 }
static void applyAlignments(const DetGeomDesc &, const CTPPSRPAlignmentCorrectionsData *, DetGeomDesc *&)
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
const mapType & getRPMap() const
returns the map of RP alignment corrections
const mapType & getSensorMap() const
returns the map of sensor alignment corrections
bool isValid() const
Definition: ESHandle.h:44
const unsigned int verbosity_
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< DetGeomDesc > CTPPSGeometryESModule::produceIdealGD ( const IdealGeometryRecord iRecord)
private

Definition at line 314 of file CTPPSGeometryESModule.cc.

References buildDetGeomDesc(), compactViewToken_, ALCARECOTkAlBeamHalo_cff::filter, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), and pyrootRender::root.

Referenced by CTPPSGeometryESModule(), and ~CTPPSGeometryESModule().

315 {
316  // get the DDCompactView from EventSetup
317  auto const& cpv = iRecord.get( compactViewToken_);
318 
319  // create DDFilteredView and apply the filter
321  DDFilteredView fv( cpv, filter );
322 
323  // conversion to DetGeomDesc structure
324  auto root = std::make_unique<DetGeomDesc>( &fv );
325  buildDetGeomDesc( &fv, root.get() );
326 
327  // construct the tree of DetGeomDesc
328  return root;
329 }
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
A DDFilter that always returns true.
Definition: DDFilter.h:27
const edm::ESGetToken< DDCompactView, IdealGeometryRecord > compactViewToken_
static void buildDetGeomDesc(DDFilteredView *fv, DetGeomDesc *gd)
std::unique_ptr< DetGeomDesc > CTPPSGeometryESModule::produceMisalignedGD ( const VeryForwardMisalignedGeometryRecord iRecord)
private

Definition at line 376 of file CTPPSGeometryESModule.cc.

References gdMisTokens_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), produceGD(), and edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::tryToGetRecord().

Referenced by CTPPSGeometryESModule().

377 {
379  "CTPPSGeometryESModule::produceMisalignedGD");
380 }
std::unique_ptr< DetGeomDesc > produceGD(IdealGeometryRecord const &, const std::optional< REC > &, GDTokens< REC > const &, const char *name)
const GDTokens< RPMisalignedAlignmentRecord > gdMisTokens_
std::unique_ptr< CTPPSGeometry > CTPPSGeometryESModule::produceMisalignedTG ( const VeryForwardMisalignedGeometryRecord iRecord)
private

Definition at line 395 of file CTPPSGeometryESModule.cc.

References DEFINE_FWK_EVENTSETUP_MODULE, dgdMisToken_, and edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get().

Referenced by CTPPSGeometryESModule().

396 {
397  auto const& gD = iRecord.get( dgdMisToken_ );
398 
399  return std::make_unique<CTPPSGeometry>( &gD );
400 }
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
const edm::ESGetToken< DetGeomDesc, VeryForwardMisalignedGeometryRecord > dgdMisToken_
std::unique_ptr< DetGeomDesc > CTPPSGeometryESModule::produceRealGD ( const VeryForwardRealGeometryRecord iRecord)
private

Definition at line 367 of file CTPPSGeometryESModule.cc.

References gdRealTokens_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), produceGD(), and edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::tryToGetRecord().

Referenced by CTPPSGeometryESModule().

368 {
370  "CTPPSGeometryESModule::produceRealGD");
371 }
std::unique_ptr< DetGeomDesc > produceGD(IdealGeometryRecord const &, const std::optional< REC > &, GDTokens< REC > const &, const char *name)
const GDTokens< RPRealAlignmentRecord > gdRealTokens_
std::unique_ptr< CTPPSGeometry > CTPPSGeometryESModule::produceRealTG ( const VeryForwardRealGeometryRecord iRecord)
private

Definition at line 385 of file CTPPSGeometryESModule.cc.

References dgdRealToken_, and edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get().

Referenced by CTPPSGeometryESModule().

386 {
387  auto const& gD = iRecord.get( dgdRealToken_ );
388 
389  return std::make_unique<CTPPSGeometry>( &gD );
390 }
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
const edm::ESGetToken< DetGeomDesc, VeryForwardRealGeometryRecord > dgdRealToken_

Member Data Documentation

const edm::ESGetToken<DDCompactView, IdealGeometryRecord> CTPPSGeometryESModule::compactViewToken_
private

Definition at line 86 of file CTPPSGeometryESModule.cc.

Referenced by produceIdealGD().

const edm::ESGetToken<DetGeomDesc, VeryForwardMisalignedGeometryRecord> CTPPSGeometryESModule::dgdMisToken_
private

Definition at line 92 of file CTPPSGeometryESModule.cc.

Referenced by CTPPSGeometryESModule(), and produceMisalignedTG().

const edm::ESGetToken<DetGeomDesc, VeryForwardRealGeometryRecord> CTPPSGeometryESModule::dgdRealToken_
private

Definition at line 91 of file CTPPSGeometryESModule.cc.

Referenced by CTPPSGeometryESModule(), and produceRealTG().

const GDTokens<RPMisalignedAlignmentRecord> CTPPSGeometryESModule::gdMisTokens_
private

Definition at line 89 of file CTPPSGeometryESModule.cc.

Referenced by CTPPSGeometryESModule(), and produceMisalignedGD().

const GDTokens<RPRealAlignmentRecord> CTPPSGeometryESModule::gdRealTokens_
private

Definition at line 88 of file CTPPSGeometryESModule.cc.

Referenced by CTPPSGeometryESModule(), and produceRealGD().

const unsigned int CTPPSGeometryESModule::verbosity_
private

Definition at line 85 of file CTPPSGeometryESModule.cc.

Referenced by produceGD().