CMS 3D CMS Logo

Public Member Functions | Protected Attributes

PFMETMonitor Class Reference

#include <PFMETMonitor.h>

Inheritance diagram for PFMETMonitor:
Benchmark

List of all members.

Public Member Functions

void fillOne (const reco::MET &met, const reco::MET &matchedMet, float &minVal, float &maxVal)
 PFMETMonitor (Benchmark::Mode mode=Benchmark::DEFAULT)
void setDirectory (TDirectory *dir)
 set directory (to use in ROOT)
void setParameters (const edm::ParameterSet &parameterSet)
 set the parameters accessing them from ParameterSet
void setParameters (Benchmark::Mode mode, float ptmin, float ptmax, float etamin, float etamax, float phimin, float phimax, bool metSpHistos)
 set the parameters locally
void setup ()
 book histograms
void setup (const edm::ParameterSet &parameterSet)
 book histograms
virtual ~PFMETMonitor ()

Protected Attributes

CandidateBenchmark candBench_
bool createMETSpecificHistos_
TH1F * delta_ex_
TH2F * delta_ex_VS_set_
TH2F * delta_set_Over_set_VS_set_
TH2F * delta_set_VS_set_
bool histogramBooked_
MatchCandidateBenchmark matchCandBench_
TH1F * px_
TH1F * sumEt_

Detailed Description

Definition at line 11 of file PFMETMonitor.h.


Constructor & Destructor Documentation

PFMETMonitor::PFMETMonitor ( Benchmark::Mode  mode = Benchmark::DEFAULT)
PFMETMonitor::~PFMETMonitor ( ) [virtual]

Definition at line 35 of file PFMETMonitor.cc.

{}

Member Function Documentation

void PFMETMonitor::fillOne ( const reco::MET met,
const reco::MET matchedMet,
float &  minVal,
float &  maxVal 
)

Definition at line 182 of file PFMETMonitor.cc.

References candBench_, createMETSpecificHistos_, delta_ex_, delta_ex_VS_set_, delta_set_Over_set_VS_set_, delta_set_VS_set_, reco::LeafCandidate::eta(), MatchCandidateBenchmark::fillOne(), CandidateBenchmark::fillOne(), histogramBooked_, Benchmark::isInRange(), matchCandBench_, reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::LeafCandidate::px(), px_, reco::LeafCandidate::py(), reco::MET::sumEt(), and sumEt_.

Referenced by PFMETDQMAnalyzer::analyze(), and PFRootEventManager::processEntry().

                                                                                    {
  candBench_.fillOne(met);
  matchCandBench_.fillOne(met, matchedMet);
  if (createMETSpecificHistos_ && histogramBooked_) {
    if( !isInRange(met.pt(), met.eta(), met.phi() ) ) return;

    if (px_) px_->Fill(met.px());
    if (delta_ex_) {
      delta_ex_->Fill(met.px()-matchedMet.px());
      delta_ex_->Fill(met.py()-matchedMet.py());
    }
    if (sumEt_) sumEt_->Fill( met.sumEt());

    if (delta_ex_VS_set_) {
      delta_ex_VS_set_->Fill(matchedMet.sumEt(), met.px()-matchedMet.px());
      delta_ex_VS_set_->Fill(matchedMet.sumEt(), met.py()-matchedMet.py());
    }
    if (delta_set_VS_set_) delta_set_VS_set_->Fill(matchedMet.sumEt(),met.sumEt()-matchedMet.sumEt());
    if (delta_set_Over_set_VS_set_ &&  matchedMet.sumEt()>0.001 ) {
      float setRes = (met.sumEt() - matchedMet.sumEt())/matchedMet.sumEt();
      if (setRes > maxVal) maxVal = setRes;
      if (setRes < minVal) minVal = setRes;    
      delta_set_Over_set_VS_set_->Fill(matchedMet.sumEt(),setRes);
    }
  } 
}
void PFMETMonitor::setDirectory ( TDirectory *  dir) [virtual]

set directory (to use in ROOT)

Reimplemented from Benchmark.

Definition at line 175 of file PFMETMonitor.cc.

References candBench_, matchCandBench_, and Benchmark::setDirectory().

Referenced by PFRootEventManager::readOptions().

void PFMETMonitor::setParameters ( const edm::ParameterSet parameterSet)

set the parameters accessing them from ParameterSet

Definition at line 40 of file PFMETMonitor.cc.

References candBench_, createMETSpecificHistos_, edm::ParameterSet::getParameter(), matchCandBench_, Benchmark::mode_, Benchmark::setParameters(), and Benchmark::setRange().

                                                                      {
  
  mode_           = (Benchmark::Mode) parameterSet.getParameter<int>( "mode" );
  createMETSpecificHistos_ = parameterSet.getParameter<bool>( "CreateMETSpecificHistos" );
  setRange( parameterSet.getParameter<double>("ptMin"),
            parameterSet.getParameter<double>("ptMax"),
            parameterSet.getParameter<double>("etaMin"),
            parameterSet.getParameter<double>("etaMax"),
            parameterSet.getParameter<double>("phiMin"),
            parameterSet.getParameter<double>("phiMax") );


  candBench_.setParameters(mode_);
  matchCandBench_.setParameters(mode_);
}
void PFMETMonitor::setParameters ( Benchmark::Mode  mode,
float  ptmin,
float  ptmax,
float  etamin,
float  etamax,
float  phimin,
float  phimax,
bool  metSpHistos 
)
void PFMETMonitor::setup ( void  )

book histograms

Definition at line 140 of file PFMETMonitor.cc.

References Benchmark::book1D(), Benchmark::book2D(), candBench_, createMETSpecificHistos_, delta_ex_, delta_ex_VS_set_, delta_set_Over_set_VS_set_, delta_set_VS_set_, histogramBooked_, Benchmark::PhaseSpace::m, Benchmark::PhaseSpace::M, matchCandBench_, Benchmark::PhaseSpace::n, px_, MatchCandidateBenchmark::setup(), CandidateBenchmark::setup(), and sumEt_.

Referenced by PFMETDQMAnalyzer::beginJob(), and PFRootEventManager::readOptions().

                         {
  candBench_.setup();
  matchCandBench_.setup();
  
  if (createMETSpecificHistos_ && !histogramBooked_) {

    PhaseSpace pxPS       = PhaseSpace( 50, 0, 200);
    PhaseSpace dpxPS      = PhaseSpace( 50, -500, 500);    
    PhaseSpace setPS      = PhaseSpace( 50, 0.0, 3000);
    PhaseSpace dsetPS     = PhaseSpace( 50, -1000.0, 1000);
    PhaseSpace setOvsetPS = PhaseSpace( 100,0., 2.);

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

    sumEt_ = book1D("sumEt_", "sumEt_;#sumE_{T}", setPS.n, setPS.m, setPS.M);

    delta_ex_ = book1D("delta_ex_", "#DeltaME_{X}", dpxPS.n, dpxPS.m, dpxPS.M);
    
    delta_ex_VS_set_ = book2D("delta_ex_VS_set_", ";SE_{T, true} (GeV);#DeltaE_{X}",
                              setPS.n, setPS.m, setPS.M, 
                              dpxPS.n, dpxPS.m, dpxPS.M );
    
    delta_set_VS_set_ = book2D("delta_set_VS_set_", 
                               ";SE_{T, true} (GeV);#DeltaSE_{T}",
                               setPS.n, setPS.m, setPS.M,
                               dsetPS.n, dsetPS.m, dsetPS.M );
    
    delta_set_Over_set_VS_set_ = book2D("delta_set_Over_set_VS_set_", 
                                        ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}",
                                        setPS.n, setPS.m, setPS.M,
                                        setOvsetPS.n, setOvsetPS.m, setOvsetPS.M );
    histogramBooked_ = true;
  }
}
void PFMETMonitor::setup ( const edm::ParameterSet parameterSet)

book histograms

Definition at line 72 of file PFMETMonitor.cc.

References Benchmark::book1D(), Benchmark::book2D(), candBench_, createMETSpecificHistos_, delta_ex_, delta_ex_VS_set_, delta_set_Over_set_VS_set_, delta_set_VS_set_, edm::ParameterSet::getParameter(), histogramBooked_, matchCandBench_, px_, MatchCandidateBenchmark::setup(), CandidateBenchmark::setup(), and sumEt_.

                                                             {
  candBench_.setup(parameterSet);
  matchCandBench_.setup(parameterSet);
  
  if (createMETSpecificHistos_ && !histogramBooked_) {

    edm::ParameterSet pxPS      = parameterSet.getParameter<edm::ParameterSet>("DeltaPxHistoParameter");
    edm::ParameterSet dpxPS      = parameterSet.getParameter<edm::ParameterSet>("DeltaPxHistoParameter");
    edm::ParameterSet dptPS      = parameterSet.getParameter<edm::ParameterSet>("DeltaPtHistoParameter");
    edm::ParameterSet setPS      = parameterSet.getParameter<edm::ParameterSet>("SumEtHistoParameter");
    edm::ParameterSet dsetPS     = parameterSet.getParameter<edm::ParameterSet>("DeltaSumEtHistoParameter");
    edm::ParameterSet setOvsetPS = parameterSet.getParameter<edm::ParameterSet>("DeltaSumEtOvSumEtHistoParameter");
    
    if (pxPS.getParameter<bool>("switchOn")) {
      px_  = book1D("px_", "px_;p_{X} (GeV)",
                     pxPS.getParameter<int32_t>("nBin"),
                     pxPS.getParameter<double>("xMin"),
                     pxPS.getParameter<double>("xMax"));
    }
    if (setPS.getParameter<bool>("switchOn")) {
      sumEt_  = book1D("sumEt_", "sumEt_;#sumE_{T}",
                     setPS.getParameter<int32_t>("nBin"),
                     setPS.getParameter<double>("xMin"),
                     setPS.getParameter<double>("xMax"));
    }
    if (dpxPS.getParameter<bool>("switchOn")) {
      delta_ex_  = book1D("delta_ex_", "#DeltaME_{X}",
                     dpxPS.getParameter<int32_t>("nBin"),
                     dpxPS.getParameter<double>("xMin"),
                     dpxPS.getParameter<double>("xMax"));
    }

    if (dpxPS.getParameter<bool>("switchOn")) {
      delta_ex_VS_set_ = book2D("delta_ex_VS_set_", 
                                ";SE_{T, true} (GeV);#DeltaE_{X}",
                                setPS.getParameter<int32_t>("nBin"), 
                                setPS.getParameter<double>("xMin"), 
                                setPS.getParameter<double>("xMax"),                             
                                dptPS.getParameter<int32_t>("nBin"),
                                dptPS.getParameter<double>("xMin"), 
                                dptPS.getParameter<double>("xMax"));
    }
    if (dsetPS.getParameter<bool>("switchOn")) {
      delta_set_VS_set_ = book2D("delta_set_VS_set_", 
                                 ";SE_{T, true} (GeV);#DeltaSE_{T}",
                                 setPS.getParameter<int32_t>("nBin"), 
                                 setPS.getParameter<double>("xMin"), 
                                 setPS.getParameter<double>("xMax"),
                                 dsetPS.getParameter<int32_t>("nBin"), 
                                 dsetPS.getParameter<double>("xMin"), 
                                 dsetPS.getParameter<double>("xMax"));
    }
    if (setOvsetPS.getParameter<bool>("switchOn")) {
      delta_set_Over_set_VS_set_ = book2D("delta_set_Over_set_VS_set_", 
                                          ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}",
                                          setPS.getParameter<int32_t>("nBin"), 
                                          setPS.getParameter<double>("xMin"), 
                                          setPS.getParameter<double>("xMax"),
                                          setOvsetPS.getParameter<int32_t>("nBin"), 
                                          setOvsetPS.getParameter<double>("xMin"), 
                                          setOvsetPS.getParameter<double>("xMax"));
    }
    histogramBooked_ = true;
  }
}

Member Data Documentation

Definition at line 46 of file PFMETMonitor.h.

Referenced by fillOne(), setDirectory(), setParameters(), and setup().

Definition at line 49 of file PFMETMonitor.h.

Referenced by fillOne(), PFMETMonitor(), setParameters(), and setup().

TH1F* PFMETMonitor::delta_ex_ [protected]

Definition at line 41 of file PFMETMonitor.h.

Referenced by fillOne(), PFMETMonitor(), and setup().

TH2F* PFMETMonitor::delta_ex_VS_set_ [protected]

Definition at line 42 of file PFMETMonitor.h.

Referenced by fillOne(), PFMETMonitor(), and setup().

Definition at line 44 of file PFMETMonitor.h.

Referenced by fillOne(), PFMETMonitor(), and setup().

Definition at line 43 of file PFMETMonitor.h.

Referenced by fillOne(), PFMETMonitor(), and setup().

Definition at line 50 of file PFMETMonitor.h.

Referenced by fillOne(), PFMETMonitor(), and setup().

Definition at line 47 of file PFMETMonitor.h.

Referenced by fillOne(), setDirectory(), setParameters(), and setup().

TH1F* PFMETMonitor::px_ [protected]

Definition at line 39 of file PFMETMonitor.h.

Referenced by fillOne(), PFMETMonitor(), and setup().

TH1F* PFMETMonitor::sumEt_ [protected]

Definition at line 40 of file PFMETMonitor.h.

Referenced by fillOne(), PFMETMonitor(), and setup().