CMS 3D CMS Logo

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

#include <Validation/RecoVertex/plugins/BSvsPVAnalyzer.cc>

Inheritance diagram for BSvsPVAnalyzer:
edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 BSvsPVAnalyzer (const edm::ParameterSet &)
 
 ~BSvsPVAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources >
 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 &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endJob () override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 

Private Attributes

BSvsPVHistogramMaker _bspvhm
 
bool _firstOnly
 
edm::EDGetTokenT< reco::BeamSpot_recoBeamSpotToken
 
edm::EDGetTokenT< reco::VertexCollection_recoVertexCollectionToken
 

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

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

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

Definition at line 49 of file BSvsPVAnalyzer.cc.

Constructor & Destructor Documentation

◆ BSvsPVAnalyzer()

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

Definition at line 80 of file BSvsPVAnalyzer.cc.

81  : _bspvhm(iConfig.getParameter<edm::ParameterSet>("bspvHistogramMakerPSet"), consumesCollector()),
82  _recoVertexCollectionToken(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("pvCollection"))),
83  _recoBeamSpotToken(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("bsCollection"))),
84  _firstOnly(iConfig.getUntrackedParameter<bool>("firstOnly", false)) {
85  //now do what ever initialization is needed
86  usesResource(TFileService::kSharedResource);
87  //
88 
89  _bspvhm.book();
90 }

References _bspvhm, BSvsPVHistogramMaker::book(), and TFileService::kSharedResource.

◆ ~BSvsPVAnalyzer()

BSvsPVAnalyzer::~BSvsPVAnalyzer ( )
override

Definition at line 92 of file BSvsPVAnalyzer.cc.

92  {
93  // do anything here that needs to be done at desctruction time
94  // (e.g. close files, deallocate resources etc.)
95 }

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 102 of file BSvsPVAnalyzer.cc.

102  {
103  // get BS
104 
106  iEvent.getByToken(_recoBeamSpotToken, bs);
107 
108  // get PV
109 
111  iEvent.getByToken(_recoVertexCollectionToken, pvcoll);
112 
113  if (_firstOnly) {
114  reco::VertexCollection firstpv;
115  if (!pvcoll->empty())
116  firstpv.push_back((*pvcoll)[0]);
117  _bspvhm.fill(iEvent, firstpv, *bs);
118  } else {
119  _bspvhm.fill(iEvent, *pvcoll, *bs);
120  }
121 }

References _bspvhm, _firstOnly, _recoBeamSpotToken, _recoVertexCollectionToken, cms::cuda::bs, BSvsPVHistogramMaker::fill(), and iEvent.

◆ beginJob()

void BSvsPVAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 124 of file BSvsPVAnalyzer.cc.

124 {}

◆ beginRun()

void BSvsPVAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 126 of file BSvsPVAnalyzer.cc.

126 { _bspvhm.beginRun(iRun.run()); }

References _bspvhm, BSvsPVHistogramMaker::beginRun(), and edm::RunBase::run().

◆ endJob()

void BSvsPVAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 130 of file BSvsPVAnalyzer.cc.

130 {}

◆ endRun()

void BSvsPVAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 128 of file BSvsPVAnalyzer.cc.

128 {}

Member Data Documentation

◆ _bspvhm

BSvsPVHistogramMaker BSvsPVAnalyzer::_bspvhm
private

Definition at line 63 of file BSvsPVAnalyzer.cc.

Referenced by analyze(), beginRun(), and BSvsPVAnalyzer().

◆ _firstOnly

bool BSvsPVAnalyzer::_firstOnly
private

Definition at line 66 of file BSvsPVAnalyzer.cc.

Referenced by analyze().

◆ _recoBeamSpotToken

edm::EDGetTokenT<reco::BeamSpot> BSvsPVAnalyzer::_recoBeamSpotToken
private

Definition at line 65 of file BSvsPVAnalyzer.cc.

Referenced by analyze().

◆ _recoVertexCollectionToken

edm::EDGetTokenT<reco::VertexCollection> BSvsPVAnalyzer::_recoVertexCollectionToken
private

Definition at line 64 of file BSvsPVAnalyzer.cc.

Referenced by analyze().

reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
BSvsPVHistogramMaker::beginRun
void beginRun(const unsigned int nrun)
Definition: BSvsPVHistogramMaker.cc:163
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:47
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
BSvsPVHistogramMaker::book
void book(const std::string dirname="")
Definition: BSvsPVHistogramMaker.cc:39
edm::Handle< reco::BeamSpot >
edm::RunBase::run
RunNumber_t run() const
Definition: RunBase.h:40
cms::cuda::bs
bs
Definition: HistoContainer.h:127
edm::ParameterSet
Definition: ParameterSet.h:47
iEvent
int iEvent
Definition: GenABIO.cc:224
BSvsPVAnalyzer::_recoBeamSpotToken
edm::EDGetTokenT< reco::BeamSpot > _recoBeamSpotToken
Definition: BSvsPVAnalyzer.cc:65
BSvsPVHistogramMaker::fill
void fill(const unsigned int orbit, const int bx, const reco::VertexCollection &vertices, const reco::BeamSpot &bs)
Definition: BSvsPVHistogramMaker.cc:217
TFileService::kSharedResource
static const std::string kSharedResource
Definition: TFileService.h:76
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
BSvsPVAnalyzer::_bspvhm
BSvsPVHistogramMaker _bspvhm
Definition: BSvsPVAnalyzer.cc:63
BSvsPVAnalyzer::_firstOnly
bool _firstOnly
Definition: BSvsPVAnalyzer.cc:66
edm::InputTag
Definition: InputTag.h:15
BSvsPVAnalyzer::_recoVertexCollectionToken
edm::EDGetTokenT< reco::VertexCollection > _recoVertexCollectionToken
Definition: BSvsPVAnalyzer.cc:64