CMS 3D CMS Logo

Public Member Functions | Protected Attributes

METBenchmark Class Reference

To plot MET quantities. More...

#include <METBenchmark.h>

Inheritance diagram for METBenchmark:
Benchmark METBenchmarkAnalyzer

List of all members.

Public Member Functions

template<class C >
void fill (const C &candidates)
 fill a collection
void fillOne (const reco::MET &candidate)
 fill histograms with a given particle
 METBenchmark (Mode mode)
void setup ()
 book histograms
virtual ~METBenchmark ()

Protected Attributes

TH1F * phi_
TH1F * pt_
TH1F * px_
TH1F * sumEt_

Detailed Description

To plot MET quantities.

Definition at line 9 of file METBenchmark.h.


Constructor & Destructor Documentation

METBenchmark::METBenchmark ( Mode  mode) [inline]

Definition at line 13 of file METBenchmark.h.

METBenchmark::~METBenchmark ( ) [virtual]

Definition at line 19 of file METBenchmark.cc.

{}

Member Function Documentation

template<class C >
void METBenchmark::fill ( const C &  candidates)

fill a collection

Definition at line 36 of file METBenchmark.h.

References fillOne(), and i.

Referenced by METBenchmarkAnalyzer::analyze().

                                               {

  for (unsigned int i = 0; i < candCollection.size(); ++i) {
    const reco::MET& cand = candCollection[i];
    fillOne(cand);
  }
}
void METBenchmark::fillOne ( const reco::MET candidate)

fill histograms with a given particle

Definition at line 48 of file METBenchmark.cc.

References reco::LeafCandidate::eta(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), and reco::MET::sumEt().

Referenced by fill().

                                              {

  if( !isInRange(cand.pt(), cand.eta(), cand.phi() ) ) return;

  pt_->Fill( cand.pt() );
  px_->Fill( cand.px() );
  px_->Fill( cand.py() );
  phi_->Fill( cand.phi() );
  sumEt_->Fill( cand.sumEt() );
}
void METBenchmark::setup ( void  )

book histograms

Definition at line 22 of file METBenchmark.cc.

References Benchmark::PhaseSpace::m, Benchmark::PhaseSpace::M, and Benchmark::PhaseSpace::n.

Referenced by METBenchmarkAnalyzer::beginJob().

                         {

  //std::cout << "FL: METBenchmark.cc: start setup()" << std::endl;

  PhaseSpace ptPS(100,0,200);
  PhaseSpace pxPS(100,-100.,100);
  PhaseSpace phiPS(50, -3.1416, 3.1416);
  PhaseSpace sumEtPS(100, 0, 3000);

  switch(mode_) {
  case DQMOFFLINE:
    ptPS = PhaseSpace(100, 0, 3000);
    break;
  default:
    break;
  }

  pt_ = book1D("pt_", "pt_;p_{T} (GeV)", ptPS.n, ptPS.m, ptPS.M);
  px_ = book1D("px_", "px_;p_{X} (GeV)", pxPS.n, pxPS.m, pxPS.M);

  // might want to increase the number of bins, to match the size of the ECAL crystals
  phi_ = book1D("phi_", "phi_;#phi", phiPS.n, phiPS.m, phiPS.M);
  sumEt_ = book1D("sumEt_", "sumEt_;#sumE_{T}", sumEtPS.n, sumEtPS.m, sumEtPS.M);
}

Member Data Documentation

TH1F* METBenchmark::phi_ [protected]

Definition at line 30 of file METBenchmark.h.

TH1F* METBenchmark::pt_ [protected]

Definition at line 28 of file METBenchmark.h.

TH1F* METBenchmark::px_ [protected]

Definition at line 29 of file METBenchmark.h.

TH1F* METBenchmark::sumEt_ [protected]

Definition at line 31 of file METBenchmark.h.