95 : fromDDD_(p.getParameter<bool>(
"fromDDD")),
96 fromDD4hep_(p.getParameter<bool>(
"fromDD4hep")),
97 alignmentsLabel_(p.getParameter<std::
string>(
"alignmentsLabel")),
98 myLabel_(p.getParameter<std::
string>(
"appendToDataLabel")) {
120 if (useGangedStripsInME1a_)
121 useOnlyWiresInME1a_ =
false;
151 << (
applyAlignment_ ?
"looking for" :
"IGNORING") <<
" alignment labels '"
163 desc.
add<
bool>(
"fromDDD",
true);
164 desc.
add<
bool>(
"fromDD4hep",
false);
167 desc.
add<
bool>(
"useRealWireGeometry",
true);
168 desc.
add<
bool>(
"useOnlyWiresInME1a",
false);
169 desc.
add<
bool>(
"useGangedStripsInME1a",
true);
170 desc.
add<
bool>(
"useCentreTIOffsets",
false);
171 desc.
add<
bool>(
"applyAlignment",
true);
173 descriptions.
add(
"CSCGeometryESModule", desc);
177 auto host = holder_.makeOrGet([
this]() {
179 debugV_, useGangedStripsInME1a_, useOnlyWiresInME1a_, useRealWireGeometry_, useCentreTIOffsets_);
182 initCSCGeometry_(record,
host);
186 if (applyAlignment_) {
189 const auto& globalPosition = record.
get(globalPositionToken_);
190 const auto& alignments = record.
get(alignmentsToken_);
191 const auto& alignmentErrors = record.
get(alignmentErrorsToken_);
193 if (alignments.empty() && alignmentErrors.empty() && globalPosition.empty()) {
194 edm::LogVerbatim(
"Config") <<
"@SUB=CSCGeometryRecord::produce Alignment(Error)s and global position (label '"
195 << alignmentsLabel_ <<
"') empty: Geometry producer (label "
196 <<
"'" << myLabel_ <<
"') assumes fake and does not apply.";
208 edm::LogVerbatim(
"CSCGeoemtryESModule") <<
"(0) CSCGeometryESModule - DDD ";
212 const auto& mdc = rec.get(mdcToken_);
216 }
else if (fromDD4hep_) {
217 edm::LogVerbatim(
"CSCGeoemtryESModule") <<
"(0) CSCGeometryESModule - DD4hep ";
221 const auto& mdc = rec.get(mdcToken_);
226 bool recreateGeometry =
false;
229 [&recreateGeometry](
auto const& rec) { recreateGeometry =
true; });
232 [&recreateGeometry](
auto const& rec) { recreateGeometry =
true; });
233 edm::LogVerbatim(
"CSCGeoemtryESModule") <<
"(0) CSCGeometryESModule - DB recreateGeometry=false ";
234 if (recreateGeometry) {
235 edm::LogVerbatim(
"CSCGeoemtryESModule") <<
"(0) CSCGeometryESModule - DB recreateGeometry=true ";
237 const auto& rig = record.
get(rigToken_);
238 const auto& rdp = record.
get(rdpToken_);
240 cscgb.
build(*host, rig, rdp);
Log< level::Info, true > LogVerbatim
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< Alignments, CSCAlignmentRcd > alignmentsToken_
void build(CSCGeometry &geom, const DDCompactView *fv, const MuonGeometryConstants &muonConstants)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
CSCGeometryESModule(const edm::ParameterSet &p)
Constructor.
const std::string alignmentsLabel_
Class to update a given geometry with a set of alignments.
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokendd4hep_
static void fillDescriptions(edm::ConfigurationDescriptions &)
Creation of configuration file.
const std::string myLabel_
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
void build(CSCGeometry &theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
tuple CSCGeometryESModule
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
edm::ESGetToken< CSCRecoDigiParameters, CSCRecoDigiParametersRcd > rdpToken_
void initCSCGeometry_(const MuonGeometryRecord &, std::shared_ptr< HostType > &host)
edm::ESGetToken< Alignments, GlobalPositionRcd > globalPositionToken_
void applyAlignments(const C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
bool useGangedStripsInME1a_
std::shared_ptr< CSCGeometry > produce(const MuonGeometryRecord &record)
Produce CSCGeometry.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::ESGetToken< AlignmentErrorsExtended, CSCAlignmentErrorExtendedRcd > alignmentErrorsToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T getParameter(std::string const &) const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
T const * product() const
bool useRealWireGeometry_
edm::ESGetToken< MuonGeometryConstants, IdealGeometryRecord > mdcToken_
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
edm::ReusableObjectHolder< HostType > holder_
edm::ESGetToken< RecoIdealGeometry, CSCRecoGeometryRcd > rigToken_