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
 
 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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 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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

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.

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

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
StraightTrackAlignment worker_
std::string const & label() const
Definition: InputTag.h:36
edm::ESGetToken< CTPPSGeometry, VeryForwardMisalignedGeometryRecord > esTokenMisalignedGeometry_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > tokenDiamondHits_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::DetSetVector< TotemRPUVPattern > > tokenUVPatternsStrip_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelRecHit > > tokenPixelHits_
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > esTokenRealGeometry_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenPixelLocalTracks_
Log< level::Warning, false > LogWarning
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord > esTokenRealAlignment_

◆ ~PPSStraightTrackAligner()

PPSStraightTrackAligner::~PPSStraightTrackAligner ( )
inlineoverride

Definition at line 36 of file PPSStraightTrackAligner.cc.

36 {}

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.

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_.

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 }
StraightTrackAlignment worker_
std::string const & label() const
Definition: InputTag.h:36
edm::ESGetToken< CTPPSGeometry, VeryForwardMisalignedGeometryRecord > esTokenMisalignedGeometry_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > tokenDiamondHits_
edm::EDGetTokenT< edm::DetSetVector< TotemRPUVPattern > > tokenUVPatternsStrip_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelRecHit > > tokenPixelHits_
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > esTokenRealGeometry_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
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)
virtual void begin(edm::ESHandle< CTPPSRPAlignmentCorrectionsData > hRealAlignment, edm::ESHandle< CTPPSGeometry > hRealGeometry, edm::ESHandle< CTPPSGeometry > hMisalignedGeometry)
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenPixelLocalTracks_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
edm::ESWatcher< VeryForwardRealGeometryRecord > geometryWatcher_
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord > esTokenRealAlignment_
Definition: event.py:1

◆ endJob()

void PPSStraightTrackAligner::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 153 of file PPSStraightTrackAligner.cc.

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

Referenced by o2olib.O2ORunMgr::executeJob().

153  {
155  worker_.finish();
156  else
157  throw cms::Exception("PPS") << "worker not initialized." << endl;
158 }
StraightTrackAlignment worker_
virtual void finish()
performs analyses and fill results variable

Member Data Documentation

◆ esTokenMisalignedGeometry_

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

Definition at line 54 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ esTokenRealAlignment_

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

Definition at line 55 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ esTokenRealGeometry_

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

Definition at line 53 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ geometryWatcher_

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

Definition at line 51 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ tagDiamondHits_

edm::InputTag PPSStraightTrackAligner::tagDiamondHits_
private

Definition at line 42 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ tagPixelHits_

edm::InputTag PPSStraightTrackAligner::tagPixelHits_
private

Definition at line 43 of file PPSStraightTrackAligner.cc.

Referenced by analyze(), and PPSStraightTrackAligner().

◆ tagPixelLocalTracks_

edm::InputTag PPSStraightTrackAligner::tagPixelLocalTracks_
private

Definition at line 44 of file PPSStraightTrackAligner.cc.

Referenced by analyze(), and PPSStraightTrackAligner().

◆ tagUVPatternsStrip_

edm::InputTag PPSStraightTrackAligner::tagUVPatternsStrip_
private

Definition at line 41 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ tokenDiamondHits_

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

Definition at line 47 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ tokenPixelHits_

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

Definition at line 48 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ tokenPixelLocalTracks_

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

Definition at line 49 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ tokenUVPatternsStrip_

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

Definition at line 46 of file PPSStraightTrackAligner.cc.

Referenced by analyze().

◆ verbosity_

unsigned int PPSStraightTrackAligner::verbosity_
private

Definition at line 39 of file PPSStraightTrackAligner.cc.

◆ worker_

StraightTrackAlignment PPSStraightTrackAligner::worker_
private

Definition at line 58 of file PPSStraightTrackAligner.cc.

Referenced by analyze(), and endJob().

◆ worker_initialized_

bool PPSStraightTrackAligner::worker_initialized_
private

Definition at line 57 of file PPSStraightTrackAligner.cc.

Referenced by analyze(), and endJob().