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")) {
128 debugV_ =
p.getUntrackedParameter<
bool>(
"debugV",
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);
172 desc.addUntracked<
bool>(
"debugV",
false);
173 descriptions.
add(
"CSCGeometryESModule",
desc);
177 auto host = holder_.makeOrGet([
this]() {
179 debugV_, useGangedStripsInME1a_, useOnlyWiresInME1a_, useRealWireGeometry_, useCentreTIOffsets_);
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_);
Log< level::Info, true > LogVerbatim
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
edm::ESGetToken< Alignments, CSCAlignmentRcd > alignmentsToken_
void build(CSCGeometry &geom, const DDCompactView *fv, const MuonGeometryConstants &muonConstants)
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.
uint32_t cc[maxCellsPerHit]
const std::string myLabel_
void build(CSCGeometry &theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
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)
bool useGangedStripsInME1a_
std::shared_ptr< CSCGeometry > produce(const MuonGeometryRecord &record)
Produce CSCGeometry.
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
edm::ESGetToken< AlignmentErrorsExtended, CSCAlignmentErrorExtendedRcd > alignmentErrorsToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
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_