CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MuonMisalignedProducer Class Reference
Inheritance diagram for MuonMisalignedProducer:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 Produce the misaligned Muon geometry and store iti. More...
 
 MuonMisalignedProducer (const edm::ParameterSet &)
 Constructor. More...
 
void saveToDB ()
 Save alignemnts and error to database. More...
 
 ~MuonMisalignedProducer () override
 Destructor. More...
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

AlignmentErrorsExtendedcsc_AlignmentErrorsExtended
 
Alignmentscsc_Alignments
 
AlignmentErrorsExtendeddt_AlignmentErrorsExtended
 
Alignmentsdt_Alignments
 
std::string theCSCAlignRecordName
 
std::string theCSCErrorRecordName
 
std::string theDTAlignRecordName
 misalignment scenario More...
 
std::string theDTErrorRecordName
 
std::string theIdealGeometryLabel
 
const bool theSaveToDB
 
const edm::ParameterSet theScenario
 whether or not writing to DB More...
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 36 of file MuonMisalignedProducer.cc.

Constructor & Destructor Documentation

◆ MuonMisalignedProducer()

MuonMisalignedProducer::MuonMisalignedProducer ( const edm::ParameterSet p)

Constructor.

Definition at line 64 of file MuonMisalignedProducer.cc.

65  : theSaveToDB(p.getUntrackedParameter<bool>("saveToDbase")),
66  theScenario(p.getParameter<edm::ParameterSet>("scenario")),
67  theDTAlignRecordName("DTAlignmentRcd"),
68  theDTErrorRecordName("DTAlignmentErrorExtendedRcd"),
69  theCSCAlignRecordName("CSCAlignmentRcd"),
70  theCSCErrorRecordName("CSCAlignmentErrorExtendedRcd"),
71  theIdealGeometryLabel("idealForMuonMisalignedProducer") {}

◆ ~MuonMisalignedProducer()

MuonMisalignedProducer::~MuonMisalignedProducer ( )
override

Destructor.

Definition at line 74 of file MuonMisalignedProducer.cc.

74 {}

Member Function Documentation

◆ analyze()

void MuonMisalignedProducer::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
overridevirtual

Produce the misaligned Muon geometry and store iti.

Implements edm::one::EDAnalyzerBase.

Definition at line 77 of file MuonMisalignedProducer.cc.

77  {
78  edm::LogInfo("MisalignedMuon") << "Producer called";
79  // Create the Muon geometry from ideal geometry
80  edm::ESHandle<DTGeometry> theDTGeometry;
81  edm::ESHandle<CSCGeometry> theCSCGeometry;
82  eventSetup.get<MuonGeometryRecord>().get(theIdealGeometryLabel, theDTGeometry);
83  eventSetup.get<MuonGeometryRecord>().get(theIdealGeometryLabel, theCSCGeometry);
84 
85  // Create the alignable hierarchy
86  AlignableMuon* theAlignableMuon = new AlignableMuon(&(*theDTGeometry), &(*theCSCGeometry));
87 
88  // Create misalignment scenario
89  MuonScenarioBuilder scenarioBuilder(theAlignableMuon);
90  scenarioBuilder.applyScenario(theScenario);
91 
92  // Get alignments and errors
93  dt_Alignments = theAlignableMuon->dtAlignments();
95  csc_Alignments = theAlignableMuon->cscAlignments();
97 
98  // Misalign the EventSetup geometry
99  GeometryAligner aligner;
100 
102  aligner.applyAlignments<CSCGeometry>(
104 
105  // Write alignments to DB
106  if (theSaveToDB)
107  this->saveToDB();
108 
109  edm::LogInfo("MisalignedMuon") << "Producer done";
110 }

References align::AlignableMuon, GeometryAligner::applyAlignments(), MuonScenarioBuilder::applyScenario(), csc_AlignmentErrorsExtended, csc_Alignments, AlignableMuon::cscAlignmentErrorsExtended(), AlignableMuon::cscAlignments(), dt_AlignmentErrorsExtended, dt_Alignments, AlignableMuon::dtAlignmentErrorsExtended(), AlignableMuon::dtAlignments(), edm::EventSetup::get(), get, saveToDB(), theIdealGeometryLabel, theSaveToDB, and theScenario.

◆ saveToDB()

void MuonMisalignedProducer::saveToDB ( void  )

Save alignemnts and error to database.

Definition at line 113 of file MuonMisalignedProducer.cc.

113  {
114  // Call service
116  if (!poolDbService.isAvailable()) // Die if not available
117  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
118 
119  // Store DT alignments and errors
120  poolDbService->writeOne<Alignments>(&(*dt_Alignments), poolDbService->beginOfTime(), theDTAlignRecordName);
121  poolDbService->writeOne<AlignmentErrorsExtended>(
122  &(*dt_AlignmentErrorsExtended), poolDbService->beginOfTime(), theDTErrorRecordName);
123 
124  // Store CSC alignments and errors
125  poolDbService->writeOne<Alignments>(&(*csc_Alignments), poolDbService->beginOfTime(), theCSCAlignRecordName);
126  poolDbService->writeOne<AlignmentErrorsExtended>(
127  &(*csc_AlignmentErrorsExtended), poolDbService->beginOfTime(), theCSCErrorRecordName);
128 }

References cond::service::PoolDBOutputService::beginOfTime(), edm::Service< T >::isAvailable(), theCSCAlignRecordName, theCSCErrorRecordName, theDTAlignRecordName, theDTErrorRecordName, and cond::service::PoolDBOutputService::writeOne().

Referenced by analyze().

Member Data Documentation

◆ csc_AlignmentErrorsExtended

AlignmentErrorsExtended* MuonMisalignedProducer::csc_AlignmentErrorsExtended
private

Definition at line 60 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ csc_Alignments

Alignments* MuonMisalignedProducer::csc_Alignments
private

Definition at line 59 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ dt_AlignmentErrorsExtended

AlignmentErrorsExtended* MuonMisalignedProducer::dt_AlignmentErrorsExtended
private

Definition at line 58 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ dt_Alignments

Alignments* MuonMisalignedProducer::dt_Alignments
private

Definition at line 57 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ theCSCAlignRecordName

std::string MuonMisalignedProducer::theCSCAlignRecordName
private

Definition at line 54 of file MuonMisalignedProducer.cc.

Referenced by saveToDB().

◆ theCSCErrorRecordName

std::string MuonMisalignedProducer::theCSCErrorRecordName
private

Definition at line 54 of file MuonMisalignedProducer.cc.

Referenced by saveToDB().

◆ theDTAlignRecordName

std::string MuonMisalignedProducer::theDTAlignRecordName
private

misalignment scenario

Definition at line 53 of file MuonMisalignedProducer.cc.

Referenced by saveToDB().

◆ theDTErrorRecordName

std::string MuonMisalignedProducer::theDTErrorRecordName
private

Definition at line 53 of file MuonMisalignedProducer.cc.

Referenced by saveToDB().

◆ theIdealGeometryLabel

std::string MuonMisalignedProducer::theIdealGeometryLabel
private

Definition at line 55 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ theSaveToDB

const bool MuonMisalignedProducer::theSaveToDB
private

Definition at line 50 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ theScenario

const edm::ParameterSet MuonMisalignedProducer::theScenario
private

whether or not writing to DB

Definition at line 51 of file MuonMisalignedProducer.cc.

Referenced by analyze().

DTGeometry
Definition: DTGeometry.h:28
AlignableMuon::dtAlignmentErrorsExtended
AlignmentErrorsExtended * dtAlignmentErrorsExtended()
Get DT alignment errors sorted by DetId.
Definition: AlignableMuon.cc:426
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:215
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
AlignableMuon::cscAlignments
Alignments * cscAlignments()
Get CSC alignments sorted by DetId.
Definition: AlignableMuon.cc:433
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
MuonMisalignedProducer::saveToDB
void saveToDB()
Save alignemnts and error to database.
Definition: MuonMisalignedProducer.cc:113
AlignableMuon::dtAlignments
Alignments * dtAlignments()
Get DT alignments sorted by DetId.
Definition: AlignableMuon.cc:419
GeometryAligner::applyAlignments
void applyAlignments(const C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
Definition: GeometryAligner.h:52
CSCGeometry
Definition: CSCGeometry.h:24
align::AlignableMuon
Definition: StructureType.h:84
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
MuonMisalignedProducer::theDTAlignRecordName
std::string theDTAlignRecordName
misalignment scenario
Definition: MuonMisalignedProducer.cc:53
edm::ESHandle< DTGeometry >
MuonMisalignedProducer::csc_Alignments
Alignments * csc_Alignments
Definition: MuonMisalignedProducer.cc:59
MuonMisalignedProducer::csc_AlignmentErrorsExtended
AlignmentErrorsExtended * csc_AlignmentErrorsExtended
Definition: MuonMisalignedProducer.cc:60
MuonMisalignedProducer::theSaveToDB
const bool theSaveToDB
Definition: MuonMisalignedProducer.cc:50
AlignTransform
Definition: AlignTransform.h:15
edm::ParameterSet
Definition: ParameterSet.h:47
AlignableMuon
Constructor of the full muon geometry.
Definition: AlignableMuon.h:33
edm::Service< cond::service::PoolDBOutputService >
MuonMisalignedProducer::theDTErrorRecordName
std::string theDTErrorRecordName
Definition: MuonMisalignedProducer.cc:53
MuonMisalignedProducer::dt_Alignments
Alignments * dt_Alignments
Definition: MuonMisalignedProducer.cc:57
get
#define get
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
MuonMisalignedProducer::theCSCAlignRecordName
std::string theCSCAlignRecordName
Definition: MuonMisalignedProducer.cc:54
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:63
MuonMisalignedProducer::theCSCErrorRecordName
std::string theCSCErrorRecordName
Definition: MuonMisalignedProducer.cc:54
cms::Exception
Definition: Exception.h:70
AlignableMuon::cscAlignmentErrorsExtended
AlignmentErrorsExtended * cscAlignmentErrorsExtended()
Get CSC alignment errors sorted by DetId.
Definition: AlignableMuon.cc:445
MuonMisalignedProducer::theIdealGeometryLabel
std::string theIdealGeometryLabel
Definition: MuonMisalignedProducer.cc:55
MuonMisalignedProducer::dt_AlignmentErrorsExtended
AlignmentErrorsExtended * dt_AlignmentErrorsExtended
Definition: MuonMisalignedProducer.cc:58
Alignments
Definition: Alignments.h:10
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
MuonMisalignedProducer::theScenario
const edm::ParameterSet theScenario
whether or not writing to DB
Definition: MuonMisalignedProducer.cc:51
MuonScenarioBuilder
Builds a scenario from configuration and applies it to the alignable Muon.
Definition: MuonScenarioBuilder.h:19
GeometryAligner
Class to update a given geometry with a set of alignments.
Definition: GeometryAligner.h:33