CMS 3D CMS Logo

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

An EDAnalyzer that runs StraightTrackAlignment. More...

Inheritance diagram for PPSStraightTrackAligner:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 PPSStraightTrackAligner (const edm::ParameterSet &ps)
 
 ~PPSStraightTrackAligner () override
 
- 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::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
 
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 &e, const edm::EventSetup &es) override
 
void endJob () override
 

Private Attributes

edm::ESGetToken< CTPPSGeometry, VeryForwardMisalignedGeometryRecordesTokenMisalignedGeometry_
 
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecordesTokenRealAlignment_
 
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecordesTokenRealGeometry_
 
edm::ESWatcher< VeryForwardRealGeometryRecordgeometryWatcher_
 
edm::InputTag tagDiamondHits_
 
edm::InputTag tagPixelHits_
 
edm::InputTag tagPixelLocalTracks_
 
edm::InputTag tagUVPatternsStrip_
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > tokenDiamondHits_
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelRecHit > > tokenPixelHits_
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenPixelLocalTracks_
 
edm::EDGetTokenT< edm::DetSetVector< TotemRPUVPattern > > tokenUVPatternsStrip_
 
unsigned int verbosity_
 
StraightTrackAlignment worker_
 
bool worker_initialized_
 

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

An EDAnalyzer that runs StraightTrackAlignment.

Definition at line 33 of file PPSStraightTrackAligner.cc.

Constructor & Destructor Documentation

◆ PPSStraightTrackAligner()

PPSStraightTrackAligner::PPSStraightTrackAligner ( const edm::ParameterSet ps)

Definition at line 70 of file PPSStraightTrackAligner.cc.

71  : verbosity_(ps.getUntrackedParameter<unsigned int>("verbosity", 0)),
72 
73  tagUVPatternsStrip_(ps.getParameter<edm::InputTag>("tagUVPatternsStrip")),
74  tagDiamondHits_(ps.getParameter<edm::InputTag>("tagDiamondHits")),
75  tagPixelHits_(ps.getParameter<edm::InputTag>("tagPixelHits")),
76  tagPixelLocalTracks_(ps.getParameter<edm::InputTag>("tagPixelLocalTracks")),
77 
82 
86 
87  worker_initialized_(false),
88  worker_(ps) {
89  if (!tagPixelHits_.label().empty() && !tagPixelLocalTracks_.label().empty())
90  LogWarning("PPS")
91  << "Both tagPixelHits and tagPixelLocalTracks are not empty - most likely this not what you want.";
92 }

References edm::InputTag::label(), tagPixelHits_, and tagPixelLocalTracks_.

◆ ~PPSStraightTrackAligner()

PPSStraightTrackAligner::~PPSStraightTrackAligner ( )
inlineoverride

Definition at line 39 of file PPSStraightTrackAligner.cc.

Member Function Documentation

◆ analyze()

void PPSStraightTrackAligner::analyze ( const edm::Event e,
const edm::EventSetup es 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 96 of file PPSStraightTrackAligner.cc.

96  {
97  // check if geometry hasn't changed
98  if (geometryWatcher_.check(es)) {
100  throw cms::Exception("PPS") << "PPSStraightTrackAligner can't cope with changing geometry - change in event "
101  << event.id() << endl;
102  }
103 
104  // check if worker already initialised
105  if (!worker_initialized_) {
106  auto hRealGeometry = es.getHandle(esTokenRealGeometry_);
107  auto hMisalignedGeometry = es.getHandle(esTokenMisalignedGeometry_);
108  auto hRealAlignment = es.getHandle(esTokenRealAlignment_);
109 
110  worker_.begin(hRealAlignment, hRealGeometry, hMisalignedGeometry);
111  worker_initialized_ = true;
112  }
113 
114  // get input
115  DetSetVector<TotemRPUVPattern> defaultStripUVPatterns;
116  const DetSetVector<TotemRPUVPattern> *pStripUVPatterns = &defaultStripUVPatterns;
117  Handle<DetSetVector<TotemRPUVPattern>> inputStripUVPatterns;
118  if (!tagUVPatternsStrip_.label().empty()) {
119  event.getByToken(tokenUVPatternsStrip_, inputStripUVPatterns);
120  pStripUVPatterns = &(*inputStripUVPatterns);
121  }
122 
123  DetSetVector<CTPPSDiamondRecHit> defaultDiamondHits;
124  const DetSetVector<CTPPSDiamondRecHit> *pDiamondHits = &defaultDiamondHits;
125  Handle<DetSetVector<CTPPSDiamondRecHit>> inputDiamondHits;
126  if (!tagDiamondHits_.label().empty()) {
127  event.getByToken(tokenDiamondHits_, inputDiamondHits);
128  pDiamondHits = &(*inputDiamondHits);
129  }
130 
131  DetSetVector<CTPPSPixelRecHit> defaultPixelHits;
132  const DetSetVector<CTPPSPixelRecHit> *pPixelHits = &defaultPixelHits;
134  if (!tagPixelHits_.label().empty()) {
135  event.getByToken(tokenPixelHits_, inputPixelHits);
136  pPixelHits = &(*inputPixelHits);
137  }
138 
139  DetSetVector<CTPPSPixelLocalTrack> defaultPixelLocalTracks;
140  const DetSetVector<CTPPSPixelLocalTrack> *pPixelLocalTracks = &defaultPixelLocalTracks;
141  Handle<DetSetVector<CTPPSPixelLocalTrack>> inputPixelLocalTracks;
142  if (!tagPixelLocalTracks_.label().empty()) {
143  event.getByToken(tokenPixelLocalTracks_, inputPixelLocalTracks);
144  pPixelLocalTracks = &(*inputPixelLocalTracks);
145  }
146 
147  // feed worker
148  worker_.processEvent(event.id(), *pStripUVPatterns, *pDiamondHits, *pPixelHits, *pPixelLocalTracks);
149 }

References StraightTrackAlignment::begin(), edm::ESWatcher< T >::check(), esTokenMisalignedGeometry_, esTokenRealAlignment_, esTokenRealGeometry_, Exception, geometryWatcher_, edm::EventSetup::getHandle(), edm::InputTag::label(), StraightTrackAlignment::processEvent(), tagDiamondHits_, tagPixelHits_, tagPixelLocalTracks_, tagUVPatternsStrip_, tokenDiamondHits_, tokenPixelHits_, tokenPixelLocalTracks_, tokenUVPatternsStrip_, worker_, and worker_initialized_.

◆ endJob()

void PPSStraightTrackAligner::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 153 of file PPSStraightTrackAligner.cc.

153  {
155  worker_.finish();
156  else
157  throw cms::Exception("PPS") << "worker not initialized." << endl;
158 }

References Exception, StraightTrackAlignment::finish(), worker_, and worker_initialized_.

Referenced by o2olib.O2ORunMgr::executeJob().

Member Data Documentation

◆ esTokenMisalignedGeometry_

edm::ESGetToken<CTPPSGeometry, VeryForwardMisalignedGeometryRecord> PPSStraightTrackAligner::esTokenMisalignedGeometry_
private

Definition at line 57 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ esTokenRealAlignment_

edm::ESGetToken<CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord> PPSStraightTrackAligner::esTokenRealAlignment_
private

Definition at line 58 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ esTokenRealGeometry_

edm::ESGetToken<CTPPSGeometry, VeryForwardRealGeometryRecord> PPSStraightTrackAligner::esTokenRealGeometry_
private

Definition at line 56 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ geometryWatcher_

edm::ESWatcher<VeryForwardRealGeometryRecord> PPSStraightTrackAligner::geometryWatcher_
private

Definition at line 54 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ tagDiamondHits_

edm::InputTag PPSStraightTrackAligner::tagDiamondHits_
private

Definition at line 45 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ tagPixelHits_

edm::InputTag PPSStraightTrackAligner::tagPixelHits_
private

Definition at line 46 of file PPSStraightTrackAligner.cc.

Referenced by analyze(), and PPSStraightTrackAligner().

◆ tagPixelLocalTracks_

edm::InputTag PPSStraightTrackAligner::tagPixelLocalTracks_
private

Definition at line 47 of file PPSStraightTrackAligner.cc.

Referenced by analyze(), and PPSStraightTrackAligner().

◆ tagUVPatternsStrip_

edm::InputTag PPSStraightTrackAligner::tagUVPatternsStrip_
private

Definition at line 44 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ tokenDiamondHits_

edm::EDGetTokenT<edm::DetSetVector<CTPPSDiamondRecHit> > PPSStraightTrackAligner::tokenDiamondHits_
private

Definition at line 50 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ tokenPixelHits_

edm::EDGetTokenT<edm::DetSetVector<CTPPSPixelRecHit> > PPSStraightTrackAligner::tokenPixelHits_
private

Definition at line 51 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ tokenPixelLocalTracks_

edm::EDGetTokenT<edm::DetSetVector<CTPPSPixelLocalTrack> > PPSStraightTrackAligner::tokenPixelLocalTracks_
private

Definition at line 52 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ tokenUVPatternsStrip_

edm::EDGetTokenT<edm::DetSetVector<TotemRPUVPattern> > PPSStraightTrackAligner::tokenUVPatternsStrip_
private

Definition at line 49 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ verbosity_

unsigned int PPSStraightTrackAligner::verbosity_
private

Definition at line 42 of file PPSStraightTrackAligner.cc.

◆ worker_

StraightTrackAlignment PPSStraightTrackAligner::worker_
private

Definition at line 61 of file PPSStraightTrackAligner.cc.

Referenced by analyze(), and endJob().

◆ worker_initialized_

bool PPSStraightTrackAligner::worker_initialized_
private

Definition at line 60 of file PPSStraightTrackAligner.cc.

Referenced by analyze(), and endJob().

PPSStraightTrackAligner::tagPixelHits_
edm::InputTag tagPixelHits_
Definition: PPSStraightTrackAligner.cc:46
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
edm::DetSetVector
Definition: DetSetVector.h:61
PPSStraightTrackAligner::worker_initialized_
bool worker_initialized_
Definition: PPSStraightTrackAligner.cc:60
PPSStraightTrackAligner::tagUVPatternsStrip_
edm::InputTag tagUVPatternsStrip_
Definition: PPSStraightTrackAligner.cc:44
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
PPSStraightTrackAligner::tagPixelLocalTracks_
edm::InputTag tagPixelLocalTracks_
Definition: PPSStraightTrackAligner.cc:47
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
StraightTrackAlignment::finish
virtual void finish()
performs analyses and fill results variable
Definition: StraightTrackAlignment.cc:709
PPSStraightTrackAligner::tokenDiamondHits_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > tokenDiamondHits_
Definition: PPSStraightTrackAligner.cc:50
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
PPSStraightTrackAligner::esTokenRealGeometry_
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > esTokenRealGeometry_
Definition: PPSStraightTrackAligner.cc:56
PPSStraightTrackAligner::esTokenMisalignedGeometry_
edm::ESGetToken< CTPPSGeometry, VeryForwardMisalignedGeometryRecord > esTokenMisalignedGeometry_
Definition: PPSStraightTrackAligner.cc:57
PPSStraightTrackAligner::verbosity_
unsigned int verbosity_
Definition: PPSStraightTrackAligner.cc:42
PPSStraightTrackAligner::tokenUVPatternsStrip_
edm::EDGetTokenT< edm::DetSetVector< TotemRPUVPattern > > tokenUVPatternsStrip_
Definition: PPSStraightTrackAligner.cc:49
StraightTrackAlignment::processEvent
virtual void processEvent(const edm::EventID &eventId, const edm::DetSetVector< TotemRPUVPattern > &uvPatternsStrip, const edm::DetSetVector< CTPPSDiamondRecHit > &hitsDiamond, const edm::DetSetVector< CTPPSPixelRecHit > &hitsPixel, const edm::DetSetVector< CTPPSPixelLocalTrack > &tracksPixel)
Definition: StraightTrackAlignment.cc:288
PPSStraightTrackAligner::tokenPixelHits_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelRecHit > > tokenPixelHits_
Definition: PPSStraightTrackAligner.cc:51
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
PPSStraightTrackAligner::tagDiamondHits_
edm::InputTag tagDiamondHits_
Definition: PPSStraightTrackAligner.cc:45
PPSStraightTrackAligner::tokenPixelLocalTracks_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenPixelLocalTracks_
Definition: PPSStraightTrackAligner.cc:52
PPSStraightTrackAligner::esTokenRealAlignment_
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord > esTokenRealAlignment_
Definition: PPSStraightTrackAligner.cc:58
Exception
Definition: hltDiff.cc:245
PPSStraightTrackAligner::geometryWatcher_
edm::ESWatcher< VeryForwardRealGeometryRecord > geometryWatcher_
Definition: PPSStraightTrackAligner.cc:54
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition: EDConsumerBase.h:202
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:155
StraightTrackAlignment::begin
virtual void begin(edm::ESHandle< CTPPSRPAlignmentCorrectionsData > hRealAlignment, edm::ESHandle< CTPPSGeometry > hRealGeometry, edm::ESHandle< CTPPSGeometry > hMisalignedGeometry)
Definition: StraightTrackAlignment.cc:251
event
Definition: event.py:1
edm::InputTag
Definition: InputTag.h:15
PPSStraightTrackAligner::worker_
StraightTrackAlignment worker_
Definition: PPSStraightTrackAligner.cc:61