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
 
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::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 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>
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 65 of file AlignmentMonitorAsAnalyzer.cc.

Member Typedef Documentation

◆ ConstTrajTrackPair

Definition at line 70 of file AlignmentMonitorAsAnalyzer.cc.

◆ ConstTrajTrackPairCollection

Definition at line 71 of file AlignmentMonitorAsAnalyzer.cc.

Constructor & Destructor Documentation

◆ AlignmentMonitorAsAnalyzer()

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

Definition at line 102 of file AlignmentMonitorAsAnalyzer.cc.

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

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 118 of file AlignmentMonitorAsAnalyzer.cc.

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

References GeometryAligner::applyAlignments(), TrackerGeomBuilderFromGeometricDet::build(), CSCGeometryBuilder::build(), align::DetectorGlobalPosition(), edm::EventSetup::get(), get, 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 210 of file AlignmentMonitorAsAnalyzer.cc.

210 { m_firstEvent = true; }

References m_firstEvent.

◆ endJob()

void AlignmentMonitorAsAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 213 of file AlignmentMonitorAsAnalyzer.cc.

213  {
214  for (auto const& monitor : m_monitors) {
215  monitor->endOfLoop();
216  }
217  for (auto const& monitor : m_monitors) {
218  monitor->endOfJob();
219  }
220 }

References m_monitors, and beam_dqm_sourceclient-live_cfg::monitor.

Referenced by o2olib.O2ORunMgr::executeJob().

Member Data Documentation

◆ m_alignableMuon

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

Definition at line 83 of file AlignmentMonitorAsAnalyzer.cc.

Referenced by analyze().

◆ m_alignableTracker

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

Definition at line 82 of file AlignmentMonitorAsAnalyzer.cc.

Referenced by analyze().

◆ m_alignmentParameterStore

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

Definition at line 84 of file AlignmentMonitorAsAnalyzer.cc.

Referenced by analyze().

◆ m_aliParamStoreCfg

edm::ParameterSet AlignmentMonitorAsAnalyzer::m_aliParamStoreCfg
private

Definition at line 80 of file AlignmentMonitorAsAnalyzer.cc.

Referenced by analyze().

◆ m_firstEvent

bool AlignmentMonitorAsAnalyzer::m_firstEvent
private

Definition at line 88 of file AlignmentMonitorAsAnalyzer.cc.

Referenced by analyze(), and beginJob().

◆ m_monitors

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

Definition at line 86 of file AlignmentMonitorAsAnalyzer.cc.

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

◆ m_tjTag

edm::InputTag AlignmentMonitorAsAnalyzer::m_tjTag
private

Definition at line 79 of file AlignmentMonitorAsAnalyzer.cc.

Referenced by analyze().

DTGeometry
Definition: DTGeometry.h:28
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
DTGeometryBuilder
AlignmentMonitorAsAnalyzer::ConstTrajTrackPair
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
Definition: AlignmentMonitorAsAnalyzer.cc:70
DTGeometryBuilderFromDDD
Definition: DTGeometryBuilderFromDDD.h:31
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
GlobalPositionRcd
Definition: GlobalPositionRcd.h:6
PTrackerParametersRcd
Definition: PTrackerParametersRcd.h:9
AlignmentMonitorAsAnalyzer::m_tjTag
edm::InputTag m_tjTag
Definition: AlignmentMonitorAsAnalyzer.cc:79
AlignmentMonitorAsAnalyzer::ConstTrajTrackPairCollection
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
Definition: AlignmentMonitorAsAnalyzer.cc:71
CSCGeometry
Definition: CSCGeometry.h:24
DetId
Definition: DetId.h:17
CSCGeometryBuilder
Definition: CSCGeometryBuilder.h:20
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
DTAlignmentRcd
Definition: DTAlignmentRcd.h:6
edm::ESHandle< TrackerTopology >
AlignmentMonitorAsAnalyzer::m_alignableMuon
std::unique_ptr< AlignableMuon > m_alignableMuon
Definition: AlignmentMonitorAsAnalyzer.cc:83
DTAlignmentErrorExtendedRcd
Definition: DTAlignmentErrorExtendedRcd.h:6
CSCGeometryBuilder::build
void build(CSCGeometry &theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
Definition: CSCGeometryBuilder.cc:17
LaserDQM_cfi.mon
mon
Definition: LaserDQM_cfi.py:3
AlignmentMonitorAsAnalyzer::m_aliParamStoreCfg
edm::ParameterSet m_aliParamStoreCfg
Definition: AlignmentMonitorAsAnalyzer.cc:80
gather_cfg.monitors
monitors
Definition: gather_cfg.py:173
CSCAlignmentErrorExtendedRcd
Definition: CSCAlignmentErrorExtendedRcd.h:6
edm::ParameterSet
Definition: ParameterSet.h:36
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:86
beam_dqm_sourceclient-live_cfg.monitor
monitor
Definition: beam_dqm_sourceclient-live_cfg.py:237
iEvent
int iEvent
Definition: GenABIO.cc:224
get
#define get
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
CSCGeometryBuilderFromDDD
Definition: CSCGeometryBuilderFromDDD.h:30
AlignmentMonitorAsAnalyzer::m_alignableTracker
std::unique_ptr< AlignableTracker > m_alignableTracker
Definition: AlignmentMonitorAsAnalyzer.cc:82
TrackerGeomBuilderFromGeometricDet
Definition: TrackerGeomBuilderFromGeometricDet.h:17
DetId::Muon
Definition: DetId.h:26
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
TrackerAlignmentErrorExtendedRcd
Definition: TrackerAlignmentErrorExtendedRcd.h:6
AlignmentMonitorAsAnalyzer::m_alignmentParameterStore
std::unique_ptr< AlignmentParameterStore > m_alignmentParameterStore
Definition: AlignmentMonitorAsAnalyzer.cc:84
edm::InputTag
Definition: InputTag.h:15
GeometryAligner::applyAlignments
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
Definition: GeometryAligner.h:52
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27
CSCAlignmentRcd
Definition: CSCAlignmentRcd.h:6
AlignmentMonitorAsAnalyzer::m_firstEvent
bool m_firstEvent
Definition: AlignmentMonitorAsAnalyzer.cc:88
GeometryAligner
Class to update a given geometry with a set of alignments.
Definition: GeometryAligner.h:33
TrackerGeometry
Definition: TrackerGeometry.h:14