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
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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
 
edm::ESGetToken< CSCGeometry, MuonGeometryRecordesTokenCSC_
 
edm::ESGetToken< DTGeometry, MuonGeometryRecordesTokenDT_
 
edm::ESGetToken< GEMGeometry, MuonGeometryRecordesTokenGEM_
 
AlignmentErrorsExtendedgem_AlignmentErrorsExtended
 
Alignmentsgem_Alignments
 
std::string theCSCAlignRecordName
 
std::string theCSCErrorRecordName
 
std::string theDTAlignRecordName
 misalignment scenario More...
 
std::string theDTErrorRecordName
 
std::string theGEMAlignRecordName
 
std::string theGEMErrorRecordName
 
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 39 of file MuonMisalignedProducer.cc.

Constructor & Destructor Documentation

◆ MuonMisalignedProducer()

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

Constructor.

Definition at line 73 of file MuonMisalignedProducer.cc.

74  : theSaveToDB(p.getUntrackedParameter<bool>("saveToDbase")),
75  theScenario(p.getParameter<edm::ParameterSet>("scenario")),
76  theDTAlignRecordName("DTAlignmentRcd"),
77  theDTErrorRecordName("DTAlignmentErrorExtendedRcd"),
78  theCSCAlignRecordName("CSCAlignmentRcd"),
79  theCSCErrorRecordName("CSCAlignmentErrorExtendedRcd"),
80  theGEMAlignRecordName("GEMAlignmentRcd"),
81  theGEMErrorRecordName("GEMAlignmentErrorExtendedRcd"),
82  esTokenDT_(esConsumes(edm::ESInputTag("", "idealForMuonMisalignedProducer"))),
83  esTokenCSC_(esConsumes(edm::ESInputTag("", "idealForMuonMisalignedProducer"))),
84  esTokenGEM_(esConsumes(edm::ESInputTag("", "idealForMuonMisalignedProducer"))) {}

◆ ~MuonMisalignedProducer()

MuonMisalignedProducer::~MuonMisalignedProducer ( )
override

Destructor.

Definition at line 87 of file MuonMisalignedProducer.cc.

87 {}

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 90 of file MuonMisalignedProducer.cc.

90  {
91  edm::LogInfo("MisalignedMuon") << "Producer called";
92  // Create the Muon geometry from ideal geometry
93  edm::ESHandle<DTGeometry> theDTGeometry = eventSetup.getHandle(esTokenDT_);
94  edm::ESHandle<CSCGeometry> theCSCGeometry = eventSetup.getHandle(esTokenCSC_);
95  edm::ESHandle<GEMGeometry> theGEMGeometry = eventSetup.getHandle(esTokenGEM_);
96 
97  // Create the alignable hierarchy
98  AlignableMuon* theAlignableMuon = new AlignableMuon(&(*theDTGeometry), &(*theCSCGeometry), &(*theGEMGeometry));
99 
100  // Create misalignment scenario
101  MuonScenarioBuilder scenarioBuilder(theAlignableMuon);
102  scenarioBuilder.applyScenario(theScenario);
103 
104  // Get alignments and errors
105  dt_Alignments = theAlignableMuon->dtAlignments();
107  csc_Alignments = theAlignableMuon->cscAlignments();
109  gem_Alignments = theAlignableMuon->gemAlignments();
111 
112  // Misalign the EventSetup geometry
113  /* GeometryAligner aligner;
114  aligner.applyAlignments<DTGeometry>(&(*theDTGeometry), dt_Alignments, dt_AlignmentErrorsExtended, AlignTransform());
115  aligner.applyAlignments<CSCGeometry>(
116  &(*theCSCGeometry), csc_Alignments, csc_AlignmentErrorsExtended, AlignTransform());
117  aligner.applyAlignments<GEMGeometry>(
118  &(*theGEMGeometry), gem_Alignments, gem_AlignmentErrorsExtended, AlignTransform());
119  */
120  // Write alignments to DB
121  if (theSaveToDB)
122  this->saveToDB();
123 
124  edm::LogInfo("MisalignedMuon") << "Producer done";
125 }

References align::AlignableMuon, MuonScenarioBuilder::applyScenario(), csc_AlignmentErrorsExtended, csc_Alignments, AlignableMuon::cscAlignmentErrorsExtended(), AlignableMuon::cscAlignments(), dt_AlignmentErrorsExtended, dt_Alignments, AlignableMuon::dtAlignmentErrorsExtended(), AlignableMuon::dtAlignments(), esTokenCSC_, esTokenDT_, esTokenGEM_, gem_AlignmentErrorsExtended, gem_Alignments, AlignableMuon::gemAlignmentErrorsExtended(), AlignableMuon::gemAlignments(), edm::EventSetup::getHandle(), saveToDB(), theSaveToDB, and theScenario.

◆ saveToDB()

void MuonMisalignedProducer::saveToDB ( void  )

Save alignemnts and error to database.

Definition at line 128 of file MuonMisalignedProducer.cc.

128  {
129  // Call service
131  if (!poolDbService.isAvailable()) // Die if not available
132  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
133 
134  // Store DT alignments and errors
135  poolDbService->writeOne<Alignments>(&(*dt_Alignments), poolDbService->beginOfTime(), theDTAlignRecordName);
136  poolDbService->writeOne<AlignmentErrorsExtended>(
137  &(*dt_AlignmentErrorsExtended), poolDbService->beginOfTime(), theDTErrorRecordName);
138 
139  // Store CSC alignments and errors
140  poolDbService->writeOne<Alignments>(&(*csc_Alignments), poolDbService->beginOfTime(), theCSCAlignRecordName);
141  poolDbService->writeOne<AlignmentErrorsExtended>(
142  &(*csc_AlignmentErrorsExtended), poolDbService->beginOfTime(), theCSCErrorRecordName);
143  poolDbService->writeOne<Alignments>(&(*gem_Alignments), poolDbService->beginOfTime(), theGEMAlignRecordName);
144  poolDbService->writeOne<AlignmentErrorsExtended>(
145  &(*gem_AlignmentErrorsExtended), poolDbService->beginOfTime(), theGEMErrorRecordName);
146 }

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

Referenced by analyze().

Member Data Documentation

◆ csc_AlignmentErrorsExtended

AlignmentErrorsExtended* MuonMisalignedProducer::csc_AlignmentErrorsExtended
private

Definition at line 67 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ csc_Alignments

Alignments* MuonMisalignedProducer::csc_Alignments
private

Definition at line 66 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ dt_AlignmentErrorsExtended

AlignmentErrorsExtended* MuonMisalignedProducer::dt_AlignmentErrorsExtended
private

Definition at line 65 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ dt_Alignments

Alignments* MuonMisalignedProducer::dt_Alignments
private

Definition at line 64 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ esTokenCSC_

edm::ESGetToken<CSCGeometry, MuonGeometryRecord> MuonMisalignedProducer::esTokenCSC_
private

Definition at line 61 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ esTokenDT_

edm::ESGetToken<DTGeometry, MuonGeometryRecord> MuonMisalignedProducer::esTokenDT_
private

Definition at line 60 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ esTokenGEM_

edm::ESGetToken<GEMGeometry, MuonGeometryRecord> MuonMisalignedProducer::esTokenGEM_
private

Definition at line 62 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ gem_AlignmentErrorsExtended

AlignmentErrorsExtended* MuonMisalignedProducer::gem_AlignmentErrorsExtended
private

Definition at line 69 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ gem_Alignments

Alignments* MuonMisalignedProducer::gem_Alignments
private

Definition at line 68 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ theCSCAlignRecordName

std::string MuonMisalignedProducer::theCSCAlignRecordName
private

Definition at line 57 of file MuonMisalignedProducer.cc.

Referenced by saveToDB().

◆ theCSCErrorRecordName

std::string MuonMisalignedProducer::theCSCErrorRecordName
private

Definition at line 57 of file MuonMisalignedProducer.cc.

Referenced by saveToDB().

◆ theDTAlignRecordName

std::string MuonMisalignedProducer::theDTAlignRecordName
private

misalignment scenario

Definition at line 56 of file MuonMisalignedProducer.cc.

Referenced by saveToDB().

◆ theDTErrorRecordName

std::string MuonMisalignedProducer::theDTErrorRecordName
private

Definition at line 56 of file MuonMisalignedProducer.cc.

Referenced by saveToDB().

◆ theGEMAlignRecordName

std::string MuonMisalignedProducer::theGEMAlignRecordName
private

Definition at line 58 of file MuonMisalignedProducer.cc.

Referenced by saveToDB().

◆ theGEMErrorRecordName

std::string MuonMisalignedProducer::theGEMErrorRecordName
private

Definition at line 58 of file MuonMisalignedProducer.cc.

Referenced by saveToDB().

◆ theSaveToDB

const bool MuonMisalignedProducer::theSaveToDB
private

Definition at line 53 of file MuonMisalignedProducer.cc.

Referenced by analyze().

◆ theScenario

const edm::ParameterSet MuonMisalignedProducer::theScenario
private

whether or not writing to DB

Definition at line 54 of file MuonMisalignedProducer.cc.

Referenced by analyze().

MuonMisalignedProducer::theGEMAlignRecordName
std::string theGEMAlignRecordName
Definition: MuonMisalignedProducer.cc:58
AlignableMuon::dtAlignmentErrorsExtended
AlignmentErrorsExtended * dtAlignmentErrorsExtended()
Get DT alignment errors sorted by DetId.
Definition: AlignableMuon.cc:561
edm::ESInputTag
Definition: ESInputTag.h:87
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:215
MuonMisalignedProducer::esTokenGEM_
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > esTokenGEM_
Definition: MuonMisalignedProducer.cc:62
AlignableMuon::cscAlignments
Alignments * cscAlignments()
Get CSC alignments sorted by DetId.
Definition: AlignableMuon.cc:568
MuonMisalignedProducer::theGEMErrorRecordName
std::string theGEMErrorRecordName
Definition: MuonMisalignedProducer.cc:58
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
MuonMisalignedProducer::gem_AlignmentErrorsExtended
AlignmentErrorsExtended * gem_AlignmentErrorsExtended
Definition: MuonMisalignedProducer.cc:69
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
MuonMisalignedProducer::saveToDB
void saveToDB()
Save alignemnts and error to database.
Definition: MuonMisalignedProducer.cc:128
AlignableMuon::dtAlignments
Alignments * dtAlignments()
Get DT alignments sorted by DetId.
Definition: AlignableMuon.cc:554
align::AlignableMuon
Definition: StructureType.h:90
MuonMisalignedProducer::theDTAlignRecordName
std::string theDTAlignRecordName
misalignment scenario
Definition: MuonMisalignedProducer.cc:56
edm::ESHandle< DTGeometry >
AlignableMuon::gemAlignments
Alignments * gemAlignments()
Definition: AlignableMuon.cc:597
MuonMisalignedProducer::csc_Alignments
Alignments * csc_Alignments
Definition: MuonMisalignedProducer.cc:66
MuonMisalignedProducer::csc_AlignmentErrorsExtended
AlignmentErrorsExtended * csc_AlignmentErrorsExtended
Definition: MuonMisalignedProducer.cc:67
MuonMisalignedProducer::theSaveToDB
const bool theSaveToDB
Definition: MuonMisalignedProducer.cc:53
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
MuonMisalignedProducer::esTokenDT_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > esTokenDT_
Definition: MuonMisalignedProducer.cc:60
AlignableMuon
Constructor of the full muon geometry.
Definition: AlignableMuon.h:38
edm::Service< cond::service::PoolDBOutputService >
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
MuonMisalignedProducer::theDTErrorRecordName
std::string theDTErrorRecordName
Definition: MuonMisalignedProducer.cc:56
AlignableMuon::gemAlignmentErrorsExtended
AlignmentErrorsExtended * gemAlignmentErrorsExtended()
Definition: AlignableMuon.cc:608
MuonMisalignedProducer::dt_Alignments
Alignments * dt_Alignments
Definition: MuonMisalignedProducer.cc:64
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
MuonMisalignedProducer::theCSCAlignRecordName
std::string theCSCAlignRecordName
Definition: MuonMisalignedProducer.cc:57
MuonMisalignedProducer::esTokenCSC_
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > esTokenCSC_
Definition: MuonMisalignedProducer.cc:61
MuonMisalignedProducer::gem_Alignments
Alignments * gem_Alignments
Definition: MuonMisalignedProducer.cc:68
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:63
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition: EDConsumerBase.h:206
MuonMisalignedProducer::theCSCErrorRecordName
std::string theCSCErrorRecordName
Definition: MuonMisalignedProducer.cc:57
cms::Exception
Definition: Exception.h:70
AlignableMuon::cscAlignmentErrorsExtended
AlignmentErrorsExtended * cscAlignmentErrorsExtended()
Get CSC alignment errors sorted by DetId.
Definition: AlignableMuon.cc:580
MuonMisalignedProducer::dt_AlignmentErrorsExtended
AlignmentErrorsExtended * dt_AlignmentErrorsExtended
Definition: MuonMisalignedProducer.cc:65
Alignments
Definition: Alignments.h:10
MuonMisalignedProducer::theScenario
const edm::ParameterSet theScenario
whether or not writing to DB
Definition: MuonMisalignedProducer.cc:54
MuonScenarioBuilder
Builds a scenario from configuration and applies it to the alignable Muon.
Definition: MuonScenarioBuilder.h:19