50 using Translation = ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>>;
72 template <
typename REC,
typename GEO>
73 std::unique_ptr<DetGeomDesc>
produceGD(
const GEO&,
74 const std::optional<REC>&,
98 : verbosity_(iConfig.getUntrackedParameter<unsigned int>(
"verbosity")),
99 buildMisalignedGeometry_(iConfig.getParameter<bool>(
"buildMisalignedGeometry")),
100 isRun2_(iConfig.getParameter<bool>(
"isRun2")),
101 fromPreprocessedDB_(iConfig.getUntrackedParameter<bool>(
"fromPreprocessedDB",
false)),
102 fromDD4hep_(iConfig.getUntrackedParameter<bool>(
"fromDD4hep",
false)) {
157 desc.
add<
bool>(
"buildMisalignedGeometry",
false)->setComment(
"switch if misaligned geometry shall be built");
158 desc.
add<
bool>(
"isRun2",
false)->setComment(
"Switch to legacy (2017-18) definition of diamond geometry");
163 descriptions.
add(
"CTPPSGeometryESModule", desc);
189 edm::LogInfo(
"CTPPSGeometryESModule") <<
" myDB size = " << myDB.container_.size();
192 auto pdet = std::make_unique<DetGeomDesc>(myDB);
196 template <
typename REC,
typename GEO>
198 GEO
const& iIdealRec,
199 std::optional<REC>
const& iAlignRec,
204 auto const& idealGD = iIdealRec.get(iGDToken);
209 auto alignmentsHandle = iAlignRec->getHandle(iAlignToken);
210 if (alignmentsHandle.isValid()) {
211 alignments = alignmentsHandle.product();
218 << alignments->
getSensorMap().size() <<
" sensor alignments applied.";
220 edm::LogVerbatim(name) <<
">> " << name <<
" > Real geometry: No alignment applied.";
233 "CTPPSGeometryESModule::produceRealGDFromPreprocessedDB");
244 "CTPPSGeometryESModule::produceMisalignedGDFromPreprocessedDB");
254 "CTPPSGeometryESModule::produceRealGD");
265 "CTPPSGeometryESModule::produceMisalignedGD");
273 return std::make_unique<CTPPSGeometry>(&gD,
verbosity_);
282 return std::make_unique<CTPPSGeometry>(&gD,
verbosity_);
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > dd4hepToken_
Log< level::Info, true > LogVerbatim
Event setup record containing the ideal PPS geometry information.
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
const edm::EventSetup & c
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::optional< DepRecordT > tryToGetRecord() const
edm::ESGetToken< DetGeomDesc, IdealGeometryRecord > idealGDToken_
const bool buildMisalignedGeometry_
const bool fromPreprocessedDB_
std::unique_ptr< DetGeomDesc > applyAlignments(const DetGeomDesc &, const CTPPSRPAlignmentCorrectionsData *)
edm::ESGetToken< DDCompactView, IdealGeometryRecord > ddToken_
std::unique_ptr< CTPPSGeometry > produceRealTG(const VeryForwardRealGeometryRecord &)
std::vector< int > fillCopyNos(TGeoIterator &it)
Compact representation of the geometrical detector hierarchy.
Event setup record containing the real (actual) geometry information.
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
std::unique_ptr< CTPPSGeometry > produceMisalignedTG(const VeryForwardMisalignedGeometryRecord &)
const DepRecordT getRecord() const
const mapType & getRPMap() const
returns the map of RP alignment corrections
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecord > misAlignmentToken_
std::unique_ptr< DetGeomDesc > produceGD(const GEO &, const std::optional< REC > &, edm::ESGetToken< DetGeomDesc, GEO > const &, edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, REC > const &, const char *name)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::unique_ptr< DetGeomDesc > produceRealGD(const VeryForwardRealGeometryRecord &)
std::unique_ptr< DetGeomDesc > buildDetGeomDescFromCompactView(const DDCompactView &myCompactView, const bool isRun2)
const mapType & getSensorMap() const
returns the map of sensor alignment corrections
edm::ESGetToken< DetGeomDesc, VeryForwardRealGeometryRecord > dgdRealToken_
Log< level::Info, false > LogInfo
edm::ESGetToken< DetGeomDesc, VeryForwardMisalignedGeometryRecord > dgdMisToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ROOT::Math::Rotation3D RotationMatrix
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord > realAlignmentToken_
edm::ESGetToken< DetGeomDesc, VeryForwardIdealGeometryRecord > idealDBGDToken_
~CTPPSGeometryESModule() override
edm::ESGetToken< PDetGeomDesc, VeryForwardIdealGeometryRecord > dbToken_
T getParameter(std::string const &) const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::unique_ptr< DetGeomDesc > produceMisalignedGD(const VeryForwardMisalignedGeometryRecord &)
Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and senso...
CTPPSGeometryESModule(const edm::ParameterSet &)
std::unique_ptr< DetGeomDesc > produceMisalignedGDFromPreprocessedDB(const VeryForwardMisalignedGeometryRecord &)
Event setup record containing the misaligned geometry information. It is used for alignment studies o...
std::unique_ptr< DetGeomDesc > produceIdealGD(const IdealGeometryRecord &)
const unsigned int verbosity_
std::unique_ptr< DetGeomDesc > produceIdealGDFromPreprocessedDB(const VeryForwardIdealGeometryRecord &)
std::unique_ptr< DetGeomDesc > produceRealGDFromPreprocessedDB(const VeryForwardRealGeometryRecord &)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >> Translation