CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFCandidateManagerAnalyzer.cc
Go to the documentation of this file.
2 
7 
10 
13 
14 // #include "DQMServices/Core/interface/MonitorElement.h"
15 // #include <TH1F.h>
16 
17 using namespace reco;
18 using namespace edm;
19 using namespace std;
20 
21 
22 
24  BenchmarkAnalyzer(parameterSet),
25  PFCandidateManager( parameterSet.getParameter<double>("dRMax"),
26  parameterSet.getParameter<bool>("matchCharge"),
27  (Benchmark::Mode) parameterSet.getParameter<int>("mode") ),
28  matchLabel_( parameterSet.getParameter<InputTag>("MatchCollection") )
29 {
30  setRange( parameterSet.getParameter<double>("ptMin"),
31  parameterSet.getParameter<double>("ptMax"),
32  parameterSet.getParameter<double>("etaMin"),
33  parameterSet.getParameter<double>("etaMax"),
34  parameterSet.getParameter<double>("phiMin"),
35  parameterSet.getParameter<double>("phiMax") );
36 
37  myColl_ = consumes< PFCandidateCollection >(inputLabel_);
38  myMatchColl_ = consumes< View<Candidate> >(matchLabel_);
39 }
40 
41 
42 void
44 {
45 
47  setup();
48 }
49 
50 void
52  const edm::EventSetup& iSetup) {
53 
54 
55 
57  iEvent.getByToken(myColl_, collection);
58 
59  Handle< View<Candidate> > matchCollection;
60  iEvent.getByToken(myMatchColl_, matchCollection);
61 
62  fill( *collection, *matchCollection );
63 }
64 
66 }
T getParameter(std::string const &) const
A benchmark managing several benchmarks.
virtual void beginJob()=0
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
abstract base class
Definition: Benchmark.h:21
edm::InputTag inputLabel_
input collection
PFCandidateManagerAnalyzer(const edm::ParameterSet &parameterSet)
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< reco::PFCandidateCollection > myColl_
void analyze(const edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< edm::View< reco::Candidate > > myMatchColl_
void setRange(float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax)
Definition: Benchmark.h:52
abtract base class for benchmark analyzers
void fill(const reco::PFCandidateCollection &candCollection, const C &matchedCandCollection)
fill histograms with all particle
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11
void setup()
book histograms