CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

AnotherPrimaryVertexAnalyzer Class Reference

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

Inheritance diagram for AnotherPrimaryVertexAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

List of all members.

Public Member Functions

 AnotherPrimaryVertexAnalyzer (const edm::ParameterSet &)
 ~AnotherPrimaryVertexAnalyzer ()

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

bool _firstOnly
edm::InputTag _pvcollection
VertexHistogramMaker _vhm
PrescaleWeightProvider_weightprov

Detailed Description

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

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

Definition at line 53 of file AnotherPrimaryVertexAnalyzer.cc.


Constructor & Destructor Documentation

AnotherPrimaryVertexAnalyzer::AnotherPrimaryVertexAnalyzer ( const edm::ParameterSet iConfig) [explicit]

Definition at line 86 of file AnotherPrimaryVertexAnalyzer.cc.

References _vhm, and VertexHistogramMaker::book().

                                                                                        :
  _vhm(iConfig.getParameter<edm::ParameterSet>("vHistogramMakerPSet")),
  _pvcollection(iConfig.getParameter<edm::InputTag>("pvCollection")),
  _firstOnly(iConfig.getUntrackedParameter<bool>("firstOnly",false)),
  _weightprov(iConfig.getParameter<bool>("usePrescaleWeight") ? 
              new PrescaleWeightProvider(iConfig.getParameter<edm::ParameterSet>("prescaleWeightProviderPSet")) : 0)
{
   //now do what ever initialization is needed

  //

  _vhm.book();

}
AnotherPrimaryVertexAnalyzer::~AnotherPrimaryVertexAnalyzer ( )

Definition at line 102 of file AnotherPrimaryVertexAnalyzer.cc.

References _weightprov.

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

  delete _weightprov;

}

Member Function Documentation

void AnotherPrimaryVertexAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 119 of file AnotherPrimaryVertexAnalyzer.cc.

References _firstOnly, _pvcollection, _vhm, _weightprov, VertexHistogramMaker::fill(), edm::Event::getByLabel(), PrescaleWeightProvider::prescaleWeight(), and histoStyle::weight.

{
  using namespace edm;
  
  // compute event weigth

  double weight = 1.;

  if(_weightprov) weight = _weightprov->prescaleWeight(iEvent,iSetup);

  // get PV

  Handle<reco::VertexCollection> pvcoll;
  iEvent.getByLabel(_pvcollection,pvcoll);

  if(_firstOnly) {
    reco::VertexCollection firstpv;
    if(pvcoll->size()) firstpv.push_back((*pvcoll)[0]);
    _vhm.fill(iEvent,firstpv,weight);
  }
  else {
    _vhm.fill(iEvent,*pvcoll,weight);
  }
}
void AnotherPrimaryVertexAnalyzer::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 147 of file AnotherPrimaryVertexAnalyzer.cc.

{ }
void AnotherPrimaryVertexAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [private, virtual]
void AnotherPrimaryVertexAnalyzer::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 165 of file AnotherPrimaryVertexAnalyzer.cc.

                                     {
}
void AnotherPrimaryVertexAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 160 of file AnotherPrimaryVertexAnalyzer.cc.

                                                                                    {

}

Member Data Documentation

Definition at line 70 of file AnotherPrimaryVertexAnalyzer.cc.

Referenced by analyze().

Definition at line 69 of file AnotherPrimaryVertexAnalyzer.cc.

Referenced by analyze().

Definition at line 68 of file AnotherPrimaryVertexAnalyzer.cc.

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