CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
CTPPSGeometryESModule Class Reference
Inheritance diagram for CTPPSGeometryESModule:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Classes

struct  GDTokens
 

Public Member Functions

 CTPPSGeometryESModule (const edm::ParameterSet &)
 
 ~CTPPSGeometryESModule () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
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

std::vector< int > fillCopyNos (TGeoIterator &it)
 
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 &)
 

Private Attributes

edm::ESGetToken< cms::DDCompactView, IdealGeometryRecorddd4hepToken_
 
edm::ESGetToken< DDCompactView, IdealGeometryRecordddToken_
 
const edm::ESGetToken< DetGeomDesc, VeryForwardMisalignedGeometryRecorddgdMisToken_
 
const edm::ESGetToken< DetGeomDesc, VeryForwardRealGeometryRecorddgdRealToken_
 
const bool fromDD4hep_
 
const GDTokens< RPMisalignedAlignmentRecordgdMisTokens_
 
const GDTokens< RPRealAlignmentRecordgdRealTokens_
 
const bool isRun2_
 
const unsigned int verbosity_
 

Additional Inherited Members

- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &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={})
 
void usesResources (std::vector< std::string > const &)
 
- 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 EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 48 of file CTPPSGeometryESModule.cc.

Constructor & Destructor Documentation

◆ CTPPSGeometryESModule()

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

Definition at line 94 of file CTPPSGeometryESModule.cc.

96  : verbosity_(iConfig.getUntrackedParameter<unsigned int>("verbosity")),
97  isRun2_(iConfig.getParameter<bool>("isRun2")),
98  fromDD4hep_(iConfig.getUntrackedParameter<bool>("fromDD4hep", false)),
103  dgdMisToken_{
106 
107  if (!fromDD4hep_) {
108  ddToken_ = c.consumes<DDCompactView>(edm::ESInputTag("", iConfig.getParameter<std::string>("compactViewTag")));
109  } else {
110  dd4hepToken_ =
111  c.consumes<cms::DDCompactView>(edm::ESInputTag("", iConfig.getParameter<std::string>("compactViewTag")));
112  }

References produceRealGD(), and edm::ESProducer::setWhatProduced().

◆ ~CTPPSGeometryESModule()

CTPPSGeometryESModule::~CTPPSGeometryESModule ( )
inlineoverride

Definition at line 51 of file CTPPSGeometryESModule.cc.

52 {}

Member Function Documentation

◆ fillCopyNos()

std::vector<int> CTPPSGeometryESModule::fillCopyNos ( TGeoIterator &  it)
private

◆ fillDescriptions()

void CTPPSGeometryESModule::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 114 of file CTPPSGeometryESModule.cc.

115  {
117  desc.addUntracked<unsigned int>("verbosity", 1);
118  desc.add<bool>("isRun2", false)->setComment("Switch to legacy (2017-18) definition of diamond geometry");
119  desc.add<std::string>("compactViewTag", std::string());
120  desc.addUntracked<bool>("fromDD4hep", false);
121  descriptions.add("CTPPSGeometryESModule", desc);

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ produceGD()

template<typename REC >
std::unique_ptr< DetGeomDesc > CTPPSGeometryESModule::produceGD ( IdealGeometryRecord const &  iIdealRec,
const std::optional< REC > &  iAlignRec,
GDTokens< REC > const &  iTokens,
const char *  name 
)
private

Definition at line 142 of file CTPPSGeometryESModule.cc.

146  {
147  // get the input GeometricalDet
148  auto const& idealGD = iIdealRec.get(iTokens.idealGDToken_);
149 
150  // load alignments
151  CTPPSRPAlignmentCorrectionsData const* alignments = nullptr;
152  if (iAlignRec) {
153  auto alignmentsHandle = iAlignRec->getHandle(iTokens.alignmentToken_);
154  if (alignmentsHandle.isValid()) {
155  alignments = alignmentsHandle.product();
156  }
157  }
158 
159  if (verbosity_) {
160  if (alignments) {
161  edm::LogVerbatim(name) << ">> " << name << " > Real geometry: " << alignments->getRPMap().size() << " RP and "
162  << alignments->getSensorMap().size() << " sensor alignments applied.";
163  } else {
164  edm::LogVerbatim(name) << ">> " << name << " > Real geometry: No alignment applied.";
165  }
166  }
167 
168  return CTPPSGeometryESCommon::applyAlignments(idealGD, alignments);

References CTPPSGeometryESModule::GDTokens< ALIGNMENT_REC >::alignmentToken_, CTPPSGeometryESCommon::applyAlignments(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), CTPPSRPAlignmentCorrectionsData::getRPMap(), CTPPSRPAlignmentCorrectionsData::getSensorMap(), CTPPSGeometryESModule::GDTokens< ALIGNMENT_REC >::idealGDToken_, Skims_PA_cff::name, and verbosity_.

Referenced by produceMisalignedGD(), and produceRealGD().

◆ produceIdealGD()

std::unique_ptr< DetGeomDesc > CTPPSGeometryESModule::produceIdealGD ( const IdealGeometryRecord iRecord)
private

Definition at line 123 of file CTPPSGeometryESModule.cc.

124  {
125  if (!fromDD4hep_) {
126  // Get the DDCompactView from EventSetup
127  auto const& myCompactView = iRecord.get(ddToken_);
128 
129  // Build geo from compact view.
131  }
132 
133  else {
134  // Get the DDCompactView from EventSetup
135  auto const& myCompactView = iRecord.get(dd4hepToken_);
136 
137  // Build geo from compact view.
139  }

References detgeomdescbuilder::buildDetGeomDescFromCompactView(), dd4hepToken_, ddToken_, fromDD4hep_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), and isRun2_.

◆ produceMisalignedGD()

std::unique_ptr< DetGeomDesc > CTPPSGeometryESModule::produceMisalignedGD ( const VeryForwardMisalignedGeometryRecord iRecord)
private

◆ produceMisalignedTG()

std::unique_ptr< CTPPSGeometry > CTPPSGeometryESModule::produceMisalignedTG ( const VeryForwardMisalignedGeometryRecord iRecord)
private

Definition at line 197 of file CTPPSGeometryESModule.cc.

199  {
200  auto const& gD = iRecord.get(dgdMisToken_);
201 
202  return std::make_unique<CTPPSGeometry>(&gD, verbosity_);

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

◆ produceRealGD()

std::unique_ptr< DetGeomDesc > CTPPSGeometryESModule::produceRealGD ( const VeryForwardRealGeometryRecord iRecord)
private

◆ produceRealTG()

std::unique_ptr< CTPPSGeometry > CTPPSGeometryESModule::produceRealTG ( const VeryForwardRealGeometryRecord iRecord)
private

Definition at line 189 of file CTPPSGeometryESModule.cc.

190  {
191  auto const& gD = iRecord.get(dgdRealToken_);
192 
193  return std::make_unique<CTPPSGeometry>(&gD, verbosity_);

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

Member Data Documentation

◆ dd4hepToken_

edm::ESGetToken<cms::DDCompactView, IdealGeometryRecord> CTPPSGeometryESModule::dd4hepToken_
private

Definition at line 84 of file CTPPSGeometryESModule.cc.

Referenced by produceIdealGD().

◆ ddToken_

edm::ESGetToken<DDCompactView, IdealGeometryRecord> CTPPSGeometryESModule::ddToken_
private

Definition at line 83 of file CTPPSGeometryESModule.cc.

Referenced by produceIdealGD().

◆ dgdMisToken_

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

Definition at line 91 of file CTPPSGeometryESModule.cc.

Referenced by produceMisalignedTG().

◆ dgdRealToken_

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

Definition at line 90 of file CTPPSGeometryESModule.cc.

Referenced by produceRealTG().

◆ fromDD4hep_

const bool CTPPSGeometryESModule::fromDD4hep_
private

Definition at line 85 of file CTPPSGeometryESModule.cc.

Referenced by produceIdealGD().

◆ gdMisTokens_

const GDTokens<RPMisalignedAlignmentRecord> CTPPSGeometryESModule::gdMisTokens_
private

Definition at line 88 of file CTPPSGeometryESModule.cc.

Referenced by produceMisalignedGD().

◆ gdRealTokens_

const GDTokens<RPRealAlignmentRecord> CTPPSGeometryESModule::gdRealTokens_
private

Definition at line 87 of file CTPPSGeometryESModule.cc.

Referenced by produceRealGD().

◆ isRun2_

const bool CTPPSGeometryESModule::isRun2_
private

Definition at line 81 of file CTPPSGeometryESModule.cc.

Referenced by produceIdealGD().

◆ verbosity_

const unsigned int CTPPSGeometryESModule::verbosity_
private

Definition at line 80 of file CTPPSGeometryESModule.cc.

Referenced by produceGD(), produceMisalignedTG(), and produceRealTG().

edm::eventsetup::DependentRecordImplementation::getRecord
const DepRecordT getRecord() const
Definition: DependentRecordImplementation.h:50
edm::ESInputTag
Definition: ESInputTag.h:87
CTPPSRPAlignmentCorrectionsData::getRPMap
const mapType & getRPMap() const
returns the map of RP alignment corrections
Definition: CTPPSRPAlignmentCorrectionsData.h:46
CTPPSRPAlignmentCorrectionsData::getSensorMap
const mapType & getSensorMap() const
returns the map of sensor alignment corrections
Definition: CTPPSRPAlignmentCorrectionsData.h:49
CTPPSGeometryESModule::isRun2_
const bool isRun2_
Definition: CTPPSGeometryESModule.cc:81
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CTPPSGeometryESModule::produceGD
std::unique_ptr< DetGeomDesc > produceGD(IdealGeometryRecord const &, const std::optional< REC > &, GDTokens< REC > const &, const char *name)
Definition: CTPPSGeometryESModule.cc:142
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
CTPPSGeometryESModule::gdMisTokens_
const GDTokens< RPMisalignedAlignmentRecord > gdMisTokens_
Definition: CTPPSGeometryESModule.cc:88
RPMisalignedAlignmentRecord
Definition: RPMisalignedAlignmentRecord.h:6
CTPPSGeometryESModule::produceRealGD
std::unique_ptr< DetGeomDesc > produceRealGD(const VeryForwardRealGeometryRecord &)
Definition: CTPPSGeometryESModule.cc:170
CTPPSGeometryESModule::ddToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > ddToken_
Definition: CTPPSGeometryESModule.cc:83
RPRealAlignmentRecord
Definition: RPRealAlignmentRecord.h:6
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
CTPPSGeometryESModule::dgdMisToken_
const edm::ESGetToken< DetGeomDesc, VeryForwardMisalignedGeometryRecord > dgdMisToken_
Definition: CTPPSGeometryESModule.cc:91
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
CTPPSGeometryESModule::produceRealTG
std::unique_ptr< CTPPSGeometry > produceRealTG(const VeryForwardRealGeometryRecord &)
Definition: CTPPSGeometryESModule.cc:189
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
CTPPSGeometryESModule::gdRealTokens_
const GDTokens< RPRealAlignmentRecord > gdRealTokens_
Definition: CTPPSGeometryESModule.cc:87
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSGeometryESModule::produceIdealGD
std::unique_ptr< DetGeomDesc > produceIdealGD(const IdealGeometryRecord &)
Definition: CTPPSGeometryESModule.cc:123
CTPPSGeometryESModule::verbosity_
const unsigned int verbosity_
Definition: CTPPSGeometryESModule.cc:80
CTPPSGeometryESModule::produceMisalignedGD
std::unique_ptr< DetGeomDesc > produceMisalignedGD(const VeryForwardMisalignedGeometryRecord &)
Definition: CTPPSGeometryESModule.cc:179
DetGeomDesc
Definition: DetGeomDesc.h:49
CTPPSGeometryESCommon::applyAlignments
std::unique_ptr< DetGeomDesc > applyAlignments(const DetGeomDesc &, const CTPPSRPAlignmentCorrectionsData *)
Definition: CTPPSGeometryESCommon.cc:6
CTPPSGeometryESModule::fromDD4hep_
const bool fromDD4hep_
Definition: CTPPSGeometryESModule.cc:85
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::eventsetup::DependentRecordImplementation::tryToGetRecord
std::optional< DepRecordT > tryToGetRecord() const
Definition: DependentRecordImplementation.h:71
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
CTPPSGeometryESModule::dgdRealToken_
const edm::ESGetToken< DetGeomDesc, VeryForwardRealGeometryRecord > dgdRealToken_
Definition: CTPPSGeometryESModule.cc:90
cms::DDCompactView
Definition: DDCompactView.h:31
CTPPSRPAlignmentCorrectionsData
Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and senso...
Definition: CTPPSRPAlignmentCorrectionsData.h:24
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
detgeomdescbuilder::buildDetGeomDescFromCompactView
std::unique_ptr< DetGeomDesc > buildDetGeomDescFromCompactView(const DDCompactView &myCompactView, const bool isRun2)
Definition: DetGeomDescBuilder.cc:10
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
CTPPSGeometryESModule::produceMisalignedTG
std::unique_ptr< CTPPSGeometry > produceMisalignedTG(const VeryForwardMisalignedGeometryRecord &)
Definition: CTPPSGeometryESModule.cc:197
CTPPSGeometryESModule::dd4hepToken_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > dd4hepToken_
Definition: CTPPSGeometryESModule.cc:84