CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 BSvsPVAnalyzer (const edm::ParameterSet &)
 
 ~BSvsPVAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 

Private Attributes

edm::InputTag _bscollection
 
BSvsPVHistogramMaker _bspvhm
 
bool _firstOnly
 
edm::InputTag _pvcollection
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

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

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

Definition at line 51 of file BSvsPVAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 84 of file BSvsPVAnalyzer.cc.

References _bspvhm, and BSvsPVHistogramMaker::book().

84  :
85  _bspvhm(iConfig.getParameter<edm::ParameterSet>("bspvHistogramMakerPSet")),
86  _pvcollection(iConfig.getParameter<edm::InputTag>("pvCollection")),
87  _bscollection(iConfig.getParameter<edm::InputTag>("bsCollection")),
88  _firstOnly(iConfig.getUntrackedParameter<bool>("firstOnly",false))
89 {
90  //now do what ever initialization is needed
91 
92  //
93 
94  _bspvhm.book();
95 
96 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag _bscollection
void book(const std::string dirname="")
edm::InputTag _pvcollection
BSvsPVHistogramMaker _bspvhm
BSvsPVAnalyzer::~BSvsPVAnalyzer ( )

Definition at line 99 of file BSvsPVAnalyzer.cc.

100 {
101 
102  // do anything here that needs to be done at desctruction time
103  // (e.g. close files, deallocate resources etc.)
104 
105 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 114 of file BSvsPVAnalyzer.cc.

References _bscollection, _bspvhm, _firstOnly, _pvcollection, BSvsPVHistogramMaker::fill(), and edm::Event::getByLabel().

115 {
116  using namespace edm;
117 
118  // get BS
119 
121  iEvent.getByLabel(_bscollection,bs);
122 
123  // get PV
124 
126  iEvent.getByLabel(_pvcollection,pvcoll);
127 
128  if(_firstOnly) {
129  reco::VertexCollection firstpv;
130  if(pvcoll->size()) firstpv.push_back((*pvcoll)[0]);
131  _bspvhm.fill(iEvent,firstpv,*bs);
132  }
133  else {
134  _bspvhm.fill(iEvent,*pvcoll,*bs);
135  }
136 }
edm::InputTag _bscollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
edm::InputTag _pvcollection
BSvsPVHistogramMaker _bspvhm
void fill(const unsigned int orbit, const int bx, const reco::VertexCollection &vertices, const reco::BeamSpot &bs)
void BSvsPVAnalyzer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 141 of file BSvsPVAnalyzer.cc.

142 { }
void BSvsPVAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 145 of file BSvsPVAnalyzer.cc.

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

145  {
146 
147  _bspvhm.beginRun(iRun.run());
148 
149 }
RunNumber_t run() const
Definition: RunBase.h:42
BSvsPVHistogramMaker _bspvhm
void beginRun(const unsigned int nrun)
void BSvsPVAnalyzer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 157 of file BSvsPVAnalyzer.cc.

157  {
158 }
void BSvsPVAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 152 of file BSvsPVAnalyzer.cc.

152  {
153 
154 }

Member Data Documentation

edm::InputTag BSvsPVAnalyzer::_bscollection
private

Definition at line 68 of file BSvsPVAnalyzer.cc.

Referenced by analyze().

BSvsPVHistogramMaker BSvsPVAnalyzer::_bspvhm
private

Definition at line 66 of file BSvsPVAnalyzer.cc.

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

bool BSvsPVAnalyzer::_firstOnly
private

Definition at line 69 of file BSvsPVAnalyzer.cc.

Referenced by analyze().

edm::InputTag BSvsPVAnalyzer::_pvcollection
private

Definition at line 67 of file BSvsPVAnalyzer.cc.

Referenced by analyze().