CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
AlignmentMonitorAsAnalyzer Class Reference

#include <Dummy/AlignmentMonitorAsAnalyzer/src/AlignmentMonitorAsAnalyzer.cc>

Inheritance diagram for AlignmentMonitorAsAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Types

typedef std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
 
typedef std::vector< ConstTrajTrackPairConstTrajTrackPairCollection
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 AlignmentMonitorAsAnalyzer (const edm::ParameterSet &)
 
 ~AlignmentMonitorAsAnalyzer () override=default
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

std::string idealGeometryLabel
 
std::unique_ptr< AlignableMuonm_alignableMuon
 
std::unique_ptr< AlignableTrackerm_alignableTracker
 
std::unique_ptr< AlignmentParameterStorem_alignmentParameterStore
 
edm::ParameterSet m_aliParamStoreCfg
 
bool m_firstEvent
 
std::vector< std::unique_ptr< AlignmentMonitorBase > > m_monitors
 
edm::InputTag m_tjTag
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 62 of file AlignmentMonitorAsAnalyzer.cc.

Member Typedef Documentation

◆ ConstTrajTrackPair

Definition at line 67 of file AlignmentMonitorAsAnalyzer.cc.

◆ ConstTrajTrackPairCollection

Definition at line 68 of file AlignmentMonitorAsAnalyzer.cc.

Constructor & Destructor Documentation

◆ AlignmentMonitorAsAnalyzer()

AlignmentMonitorAsAnalyzer::AlignmentMonitorAsAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 99 of file AlignmentMonitorAsAnalyzer.cc.

100  : m_tjTag(iConfig.getParameter<edm::InputTag>("tjTkAssociationMapTag")),
101  m_aliParamStoreCfg(iConfig.getParameter<edm::ParameterSet>("ParameterStore")),
102  idealGeometryLabel("idealForAlignmentMonitorAsAnalyzer") {
103  std::vector<std::string> monitors = iConfig.getUntrackedParameter<std::vector<std::string>>("monitors");
104 
105  for (auto const& mon : monitors) {
106  m_monitors.emplace_back(
108  }
109 }

References beamerCreator::create(), get, edm::ParameterSet::getUntrackedParameter(), m_monitors, LaserDQM_cfi::mon, and gather_cfg::monitors.

◆ ~AlignmentMonitorAsAnalyzer()

AlignmentMonitorAsAnalyzer::~AlignmentMonitorAsAnalyzer ( )
overridedefault

Member Function Documentation

◆ analyze()

void AlignmentMonitorAsAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 116 of file AlignmentMonitorAsAnalyzer.cc.

116  {
117  //Retrieve tracker topology from geometry
118  edm::ESHandle<TrackerTopology> tTopoHandle;
119  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
120  const TrackerTopology* const tTopo = tTopoHandle.product();
121 
122  if (m_firstEvent) {
123  GeometryAligner aligner;
124 
125  edm::ESHandle<GeometricDet> theGeometricDet;
126  iSetup.get<IdealGeometryRecord>().get(theGeometricDet);
128  iSetup.get<PTrackerParametersRcd>().get(ptp);
129  TrackerGeomBuilderFromGeometricDet trackerBuilder;
130  std::shared_ptr<TrackerGeometry> theTracker(trackerBuilder.build(&(*theGeometricDet), *ptp, tTopo));
131 
132  edm::ESHandle<DTGeometry> theMuonDT;
133  edm::ESHandle<CSCGeometry> theMuonCSC;
134  iSetup.get<MuonGeometryRecord>().get(idealGeometryLabel, theMuonDT);
135  iSetup.get<MuonGeometryRecord>().get(idealGeometryLabel, theMuonCSC);
136 
137  edm::ESHandle<Alignments> globalPositionRcd;
138  iSetup.get<GlobalPositionRcd>().get(globalPositionRcd);
139 
140  edm::ESHandle<Alignments> alignments;
141  iSetup.get<TrackerAlignmentRcd>().get(alignments);
143  iSetup.get<TrackerAlignmentErrorExtendedRcd>().get(alignmentErrors);
144  aligner.applyAlignments<TrackerGeometry>(&(*theTracker),
145  &(*alignments),
146  &(*alignmentErrors),
147  align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Tracker)));
148 
149  edm::ESHandle<Alignments> dtAlignments;
150  iSetup.get<DTAlignmentRcd>().get(dtAlignments);
151  edm::ESHandle<AlignmentErrorsExtended> dtAlignmentErrorsExtended;
152  iSetup.get<DTAlignmentErrorExtendedRcd>().get(dtAlignmentErrorsExtended);
153  aligner.applyAlignments<DTGeometry>(&(*theMuonDT),
154  &(*dtAlignments),
155  &(*dtAlignmentErrorsExtended),
156  align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Muon)));
157 
158  edm::ESHandle<Alignments> cscAlignments;
159  iSetup.get<CSCAlignmentRcd>().get(cscAlignments);
160  edm::ESHandle<AlignmentErrorsExtended> cscAlignmentErrorsExtended;
161  iSetup.get<CSCAlignmentErrorExtendedRcd>().get(cscAlignmentErrorsExtended);
162  aligner.applyAlignments<CSCGeometry>(&(*theMuonCSC),
163  &(*cscAlignments),
164  &(*cscAlignmentErrorsExtended),
165  align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Muon)));
166 
167  // within an analyzer, modules can't expect to see any selected alignables!
168  align::Alignables empty_alignables;
169 
170  m_alignableTracker = std::make_unique<AlignableTracker>(&(*theTracker), tTopo);
171  m_alignableMuon = std::make_unique<AlignableMuon>(&(*theMuonDT), &(*theMuonCSC));
172  m_alignmentParameterStore = std::make_unique<AlignmentParameterStore>(empty_alignables, m_aliParamStoreCfg);
173 
174  for (auto const& monitor : m_monitors) {
175  monitor->beginOfJob(m_alignableTracker.get(), m_alignableMuon.get(), m_alignmentParameterStore.get());
176  }
177  for (auto const& monitor : m_monitors) {
178  monitor->startingNewLoop();
179  }
180 
181  m_firstEvent = false;
182  }
183 
184  // Retrieve trajectories and tracks from the event
186  iEvent.getByLabel(m_tjTag, trajTracksMap);
187 
188  // Form pairs of trajectories and tracks
189  ConstTrajTrackPairCollection trajTracks;
190  for (const auto& iPair : *trajTracksMap) {
191  trajTracks.push_back(ConstTrajTrackPair(&(*iPair.key), &(*iPair.val)));
192  }
193 
194  // Run the monitors
195  for (const auto& monitor : m_monitors) {
196  monitor->duringLoop(iEvent, iSetup, trajTracks);
197  }
198 }

References GeometryAligner::applyAlignments(), TrackerGeomBuilderFromGeometricDet::build(), align::DetectorGlobalPosition(), edm::EventSetup::get(), get, idealGeometryLabel, iEvent, m_alignableMuon, m_alignableTracker, m_alignmentParameterStore, m_aliParamStoreCfg, m_firstEvent, m_monitors, m_tjTag, beam_dqm_sourceclient-live_cfg::monitor, DetId::Muon, edm::ESHandle< T >::product(), and DetId::Tracker.

◆ beginJob()

void AlignmentMonitorAsAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 201 of file AlignmentMonitorAsAnalyzer.cc.

201 { m_firstEvent = true; }

References m_firstEvent.

◆ endJob()

void AlignmentMonitorAsAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 204 of file AlignmentMonitorAsAnalyzer.cc.

204  {
205  for (auto const& monitor : m_monitors) {
206  monitor->endOfLoop();
207  }
208  for (auto const& monitor : m_monitors) {
209  monitor->endOfJob();
210  }
211 }

References m_monitors, and beam_dqm_sourceclient-live_cfg::monitor.

Referenced by o2olib.O2ORunMgr::executeJob().

Member Data Documentation

◆ idealGeometryLabel

std::string AlignmentMonitorAsAnalyzer::idealGeometryLabel
private

Definition at line 84 of file AlignmentMonitorAsAnalyzer.cc.

Referenced by analyze().

◆ m_alignableMuon

std::unique_ptr<AlignableMuon> AlignmentMonitorAsAnalyzer::m_alignableMuon
private

Definition at line 80 of file AlignmentMonitorAsAnalyzer.cc.

Referenced by analyze().

◆ m_alignableTracker

std::unique_ptr<AlignableTracker> AlignmentMonitorAsAnalyzer::m_alignableTracker
private

Definition at line 79 of file AlignmentMonitorAsAnalyzer.cc.

Referenced by analyze().

◆ m_alignmentParameterStore

std::unique_ptr<AlignmentParameterStore> AlignmentMonitorAsAnalyzer::m_alignmentParameterStore
private

Definition at line 81 of file AlignmentMonitorAsAnalyzer.cc.

Referenced by analyze().

◆ m_aliParamStoreCfg

edm::ParameterSet AlignmentMonitorAsAnalyzer::m_aliParamStoreCfg
private

Definition at line 77 of file AlignmentMonitorAsAnalyzer.cc.

Referenced by analyze().

◆ m_firstEvent

bool AlignmentMonitorAsAnalyzer::m_firstEvent
private

Definition at line 85 of file AlignmentMonitorAsAnalyzer.cc.

Referenced by analyze(), and beginJob().

◆ m_monitors

std::vector<std::unique_ptr<AlignmentMonitorBase> > AlignmentMonitorAsAnalyzer::m_monitors
private

Definition at line 83 of file AlignmentMonitorAsAnalyzer.cc.

Referenced by AlignmentMonitorAsAnalyzer(), analyze(), and endJob().

◆ m_tjTag

edm::InputTag AlignmentMonitorAsAnalyzer::m_tjTag
private

Definition at line 76 of file AlignmentMonitorAsAnalyzer.cc.

Referenced by analyze().

DTGeometry
Definition: DTGeometry.h:28
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
AlignmentMonitorAsAnalyzer::ConstTrajTrackPair
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
Definition: AlignmentMonitorAsAnalyzer.cc:67
TrackerTopology
Definition: TrackerTopology.h:16
TrackerGeomBuilderFromGeometricDet::build
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
Definition: TrackerGeomBuilderFromGeometricDet.cc:43
TrackerAlignmentRcd
Definition: TrackerAlignmentRcd.h:6
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
edm::Handle
Definition: AssociativeIterator.h:50
GeometryAligner::applyAlignments
void applyAlignments(const C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
Definition: GeometryAligner.h:52
GlobalPositionRcd
Definition: GlobalPositionRcd.h:6
PTrackerParametersRcd
Definition: PTrackerParametersRcd.h:9
AlignmentMonitorAsAnalyzer::m_tjTag
edm::InputTag m_tjTag
Definition: AlignmentMonitorAsAnalyzer.cc:76
AlignmentMonitorAsAnalyzer::ConstTrajTrackPairCollection
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
Definition: AlignmentMonitorAsAnalyzer.cc:68
CSCGeometry
Definition: CSCGeometry.h:24
DetId
Definition: DetId.h:17
AlignmentMonitorAsAnalyzer::idealGeometryLabel
std::string idealGeometryLabel
Definition: AlignmentMonitorAsAnalyzer.cc:84
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
DTAlignmentRcd
Definition: DTAlignmentRcd.h:6
edm::ESHandle< TrackerTopology >
AlignmentMonitorAsAnalyzer::m_alignableMuon
std::unique_ptr< AlignableMuon > m_alignableMuon
Definition: AlignmentMonitorAsAnalyzer.cc:80
DTAlignmentErrorExtendedRcd
Definition: DTAlignmentErrorExtendedRcd.h:6
LaserDQM_cfi.mon
mon
Definition: LaserDQM_cfi.py:3
AlignmentMonitorAsAnalyzer::m_aliParamStoreCfg
edm::ParameterSet m_aliParamStoreCfg
Definition: AlignmentMonitorAsAnalyzer.cc:77
gather_cfg.monitors
monitors
Definition: gather_cfg.py:173
CSCAlignmentErrorExtendedRcd
Definition: CSCAlignmentErrorExtendedRcd.h:6
edm::ParameterSet
Definition: ParameterSet.h:47
DetId::Tracker
Definition: DetId.h:25
align::DetectorGlobalPosition
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
Definition: DetectorGlobalPosition.cc:10
AlignmentMonitorAsAnalyzer::m_monitors
std::vector< std::unique_ptr< AlignmentMonitorBase > > m_monitors
Definition: AlignmentMonitorAsAnalyzer.cc:83
beam_dqm_sourceclient-live_cfg.monitor
monitor
Definition: beam_dqm_sourceclient-live_cfg.py:240
iEvent
int iEvent
Definition: GenABIO.cc:224
get
#define get
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
AlignmentMonitorAsAnalyzer::m_alignableTracker
std::unique_ptr< AlignableTracker > m_alignableTracker
Definition: AlignmentMonitorAsAnalyzer.cc:79
TrackerGeomBuilderFromGeometricDet
Definition: TrackerGeomBuilderFromGeometricDet.h:17
DetId::Muon
Definition: DetId.h:26
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
TrackerAlignmentErrorExtendedRcd
Definition: TrackerAlignmentErrorExtendedRcd.h:6
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
AlignmentMonitorAsAnalyzer::m_alignmentParameterStore
std::unique_ptr< AlignmentParameterStore > m_alignmentParameterStore
Definition: AlignmentMonitorAsAnalyzer.cc:81
edm::InputTag
Definition: InputTag.h:15
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
CSCAlignmentRcd
Definition: CSCAlignmentRcd.h:6
AlignmentMonitorAsAnalyzer::m_firstEvent
bool m_firstEvent
Definition: AlignmentMonitorAsAnalyzer.cc:85
GeometryAligner
Class to update a given geometry with a set of alignments.
Definition: GeometryAligner.h:33
TrackerGeometry
Definition: TrackerGeometry.h:14