CMS 3D CMS Logo

Public Member Functions | Private Attributes

JetPtAnalyzer Class Reference

#include <JetPtAnalyzer.h>

Inheritance diagram for JetPtAnalyzer:
JetAnalyzerBase

List of all members.

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &, const reco::CaloJetCollection &caloJets)
 Get the analysis.
void beginJob (DQMStore *dbe)
 Inizialize parameters for histo binning.
void endJob ()
 Finish up a job.
 JetPtAnalyzer (const edm::ParameterSet &)
 Constructor.
void setSource (std::string source)
virtual ~JetPtAnalyzer ()
 Destructor.

Private Attributes

std::string _source
int etaBin
double etaMax
double etaMin
reco::helper::JetIDHelperjetID
MonitorElementjetME
std::string jetname
MonitorElementmConstituents
MonitorElementmEFrac
MonitorElementmEmEnergyInEB
MonitorElementmEmEnergyInEE
MonitorElementmEmEnergyInHF
MonitorElementmEta
MonitorElementmfHPD
MonitorElementmfRBX
MonitorElementmHadEnergyInHB
MonitorElementmHadEnergyInHE
MonitorElementmHadEnergyInHF
MonitorElementmHadEnergyInHO
MonitorElementmHFrac
MonitorElementmMaxEInEmTowers
MonitorElementmMaxEInHadTowers
MonitorElementmN90Hits
MonitorElementmNJets
MonitorElementmPhi
MonitorElementmresEMF
edm::ParameterSet parameters
int phiBin
double phiMax
double phiMin
int ptBin
double ptMax
double ptMin
edm::InputTag theCaloJetCollectionLabel

Detailed Description

DQM monitoring source for Calo Jets

Author:
J.Weng ETH Zuerich

Definition at line 35 of file JetPtAnalyzer.h.


Constructor & Destructor Documentation

JetPtAnalyzer::JetPtAnalyzer ( const edm::ParameterSet pSet)

Constructor.

Definition at line 19 of file JetPtAnalyzer.cc.

References Parameters::parameters.

                                                        {

  parameters   = pSet;

  // Note: one could also add cut on energies from short and long fibers
  // or fraction of energy from the hottest HPD readout 

  //-------------------
}
JetPtAnalyzer::~JetPtAnalyzer ( ) [virtual]

Destructor.

Definition at line 30 of file JetPtAnalyzer.cc.

{ }

Member Function Documentation

void JetPtAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const reco::CaloJetCollection caloJets 
)

Get the analysis.

Definition at line 95 of file JetPtAnalyzer.cc.

References metsig::jet, and LogTrace.

                                                                 {
  //  int numofjets=0;
  LogTrace(jetname)<<"[JetPtAnalyzer] Analyze Calo Jet";

  for (reco::CaloJetCollection::const_iterator jet = caloJets.begin(); jet!=caloJets.end(); ++jet){
  //-----------------------------
  jetME->Fill(1);

  jetID->calculate(iEvent, *jet);
  
  if (mEta)  mEta->Fill (jet->pt(),jet->eta());
  if (mPhi)  mPhi->Fill (jet->pt(),jet->phi());

  //  if (mNJets)    mNJets->Fill (jet->pt(),numofjets);
  if (mConstituents) mConstituents->Fill (jet->pt(),jet->nConstituents());
  if (mHFrac)        mHFrac->Fill (jet->pt(),jet->energyFractionHadronic());
  if (mEFrac)        mEFrac->Fill (jet->pt(),jet->emEnergyFraction());

 
  if (mMaxEInEmTowers)  mMaxEInEmTowers->Fill (jet->pt(),jet->maxEInEmTowers());
  if (mMaxEInHadTowers) mMaxEInHadTowers->Fill (jet->pt(),jet->maxEInHadTowers());

  if (mHadEnergyInHO)   mHadEnergyInHO->Fill (jet->pt(),jet->hadEnergyInHO());
  if (mHadEnergyInHB)   mHadEnergyInHB->Fill (jet->pt(),jet->hadEnergyInHB());
  if (mHadEnergyInHF)   mHadEnergyInHF->Fill (jet->pt(),jet->hadEnergyInHF());
  if (mHadEnergyInHE)   mHadEnergyInHE->Fill (jet->pt(),jet->hadEnergyInHE());
  if (mEmEnergyInEB)    mEmEnergyInEB->Fill (jet->pt(),jet->emEnergyInEB());
  if (mEmEnergyInEE)    mEmEnergyInEE->Fill (jet->pt(),jet->emEnergyInEE());
  if (mEmEnergyInHF)    mEmEnergyInHF->Fill (jet->pt(),jet->emEnergyInHF());

  if (mN90Hits)         mN90Hits->Fill (jet->pt(),jetID->n90Hits());  
  if (mresEMF)          mresEMF->Fill(jet->pt(),jetID->restrictedEMF());
  if (mfHPD)            mfHPD->Fill(jet->pt(),jetID->fHPD());
  if (mfRBX)            mfRBX->Fill(jet->pt(),jetID->fRBX());

  }
}
void JetPtAnalyzer::beginJob ( DQMStore dbe) [virtual]

Inizialize parameters for histo binning.

Implements JetAnalyzerBase.

Definition at line 34 of file JetPtAnalyzer.cc.

References DQMStore::book1D(), DQMStore::book2D(), jptDQMConfig_cff::etaMax, jptDQMConfig_cff::etaMin, LogTrace, Parameters::parameters, jptDQMConfig_cff::phiMax, jptDQMConfig_cff::phiMin, jptDQMConfig_cff::ptMax, PtMinSelector_cfg::ptMin, MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

                                           {

  jetname = "jetPtAnalyzer";

  LogTrace(jetname)<<"[JetPtAnalyzer] Parameters initialization";
  dbe->setCurrentFolder("JetMET/Jet/"+_source);

  jetME = dbe->book1D("jetReco", "jetReco", 3, 1, 4);
  jetME->setBinLabel(1,"CaloJets",1);

  //initialize JetID
  jetID = new reco::helper::JetIDHelper(parameters.getParameter<ParameterSet>("JetIDParams"));

  // monitoring of eta parameter
  etaBin = parameters.getParameter<int>("etaBin");
  etaMin = parameters.getParameter<double>("etaMin");
  etaMax = parameters.getParameter<double>("etaMax");

  // monitoring of phi paramater
  phiBin = parameters.getParameter<int>("phiBin");
  phiMin = parameters.getParameter<double>("phiMin");
  phiMax = parameters.getParameter<double>("phiMax");

  // monitoring of the transverse momentum
  ptBin = parameters.getParameter<int>("ptBin");
  ptMin = parameters.getParameter<double>("ptMin");
  ptMax = parameters.getParameter<double>("ptMax");

  mEta                     = dbe->book2D("EtaVsPt", "EtaVsPt",ptBin, ptMin, ptMax, etaBin, etaMin, etaMax);
  mPhi                     = dbe->book2D("PhiVsPt", "PhiVsPt",ptBin, ptMin, ptMax, phiBin, phiMin, phiMax);
  mConstituents            = dbe->book2D("ConstituentsVsPt", "# of ConstituentsVsPt",ptBin, ptMin, ptMax, 100, 0, 100);
  //  mNJets                   = dbe->book2D("NJetsVsPt", "Number of JetsVsPt",ptBin, ptMin, ptMax, 100, 0, 100);

  // CaloJet specific
  mHFrac                  = dbe->book2D("HFracVsPt", "HFracVsPt",ptBin, ptMin, ptMax, 120, -0.1, 1.1);
  mEFrac                  = dbe->book2D("EFracVsPt", "EFracVsPt", ptBin, ptMin, ptMax,120, -0.1, 1.1);
  mMaxEInEmTowers         = dbe->book2D("MaxEInEmTowersVsPt", "MaxEInEmTowersVsPt", ptBin, ptMin, ptMax,100, 0, 100);
  mMaxEInHadTowers        = dbe->book2D("MaxEInHadTowersVsPt", "MaxEInHadTowersVsPt",ptBin, ptMin, ptMax, 100, 0, 100);
  mHadEnergyInHO          = dbe->book2D("HadEnergyInHOVsPt", "HadEnergyInHOVsPt",ptBin, ptMin, ptMax, 100, 0, 10);
  mHadEnergyInHB          = dbe->book2D("HadEnergyInHBVsPt", "HadEnergyInHBVsPt",ptBin, ptMin, ptMax, 100, 0, 50);
  mHadEnergyInHF          = dbe->book2D("HadEnergyInHFVsPt", "HadEnergyInHFVsPt",ptBin, ptMin, ptMax ,100, 0, 50);
  mHadEnergyInHE          = dbe->book2D("HadEnergyInHEVsPt", "HadEnergyInHEVsPt",ptBin, ptMin, ptMax, 100, 0, 100);
  mEmEnergyInEB           = dbe->book2D("EmEnergyInEBVsPt", "EmEnergyInEBVsPt",ptBin, ptMin, ptMax, 100, 0, 50);
  mEmEnergyInEE           = dbe->book2D("EmEnergyInEEVsPt", "EmEnergyInEEVsPt",ptBin, ptMin, ptMax, 100, 0, 50);
  mEmEnergyInHF           = dbe->book2D("EmEnergyInHFVsPt", "EmEnergyInHFVsPt",ptBin, ptMin, ptMax, 120, -20, 100); 
  //jetID variables
  mN90Hits                    = dbe->book2D("N90HitsVsPt", "N90HitsVsPt",ptBin, ptMin, ptMax, 50, 0, 50);
  mresEMF                    = dbe->book2D("resEMFVsPt", "resEMFVsPt",ptBin, ptMin, ptMax,50, 0., 1.);
  mfHPD                   = dbe->book2D("fHPDVsPt", "fHPDVsPt",ptBin, ptMin, ptMax,50, 0., 1.);
  mfRBX                    = dbe->book2D("fRBXVsPt", "fRBXVsPt",ptBin, ptMin, ptMax,50, 0., 1.);


}
void JetPtAnalyzer::endJob ( void  )

Finish up a job.

Definition at line 87 of file JetPtAnalyzer.cc.

                           {

  delete jetID;

}
void JetPtAnalyzer::setSource ( std::string  source) [inline]

Definition at line 55 of file JetPtAnalyzer.h.

References _source, and LaserTracksInput_cfi::source.

                                   {
    _source = source;
  }

Member Data Documentation

std::string JetPtAnalyzer::_source [private]

Definition at line 65 of file JetPtAnalyzer.h.

Referenced by setSource().

int JetPtAnalyzer::etaBin [private]

Definition at line 73 of file JetPtAnalyzer.h.

double JetPtAnalyzer::etaMax [private]

Definition at line 75 of file JetPtAnalyzer.h.

double JetPtAnalyzer::etaMin [private]

Definition at line 74 of file JetPtAnalyzer.h.

Definition at line 70 of file JetPtAnalyzer.h.

Definition at line 86 of file JetPtAnalyzer.h.

std::string JetPtAnalyzer::jetname [private]

Definition at line 64 of file JetPtAnalyzer.h.

Definition at line 90 of file JetPtAnalyzer.h.

Definition at line 92 of file JetPtAnalyzer.h.

Definition at line 103 of file JetPtAnalyzer.h.

Definition at line 104 of file JetPtAnalyzer.h.

Definition at line 105 of file JetPtAnalyzer.h.

Definition at line 87 of file JetPtAnalyzer.h.

Definition at line 108 of file JetPtAnalyzer.h.

Definition at line 109 of file JetPtAnalyzer.h.

Definition at line 100 of file JetPtAnalyzer.h.

Definition at line 102 of file JetPtAnalyzer.h.

Definition at line 101 of file JetPtAnalyzer.h.

Definition at line 99 of file JetPtAnalyzer.h.

Definition at line 91 of file JetPtAnalyzer.h.

Definition at line 97 of file JetPtAnalyzer.h.

Definition at line 98 of file JetPtAnalyzer.h.

Definition at line 106 of file JetPtAnalyzer.h.

Definition at line 94 of file JetPtAnalyzer.h.

Definition at line 88 of file JetPtAnalyzer.h.

Definition at line 107 of file JetPtAnalyzer.h.

Definition at line 62 of file JetPtAnalyzer.h.

int JetPtAnalyzer::phiBin [private]

Definition at line 77 of file JetPtAnalyzer.h.

double JetPtAnalyzer::phiMax [private]

Definition at line 79 of file JetPtAnalyzer.h.

double JetPtAnalyzer::phiMin [private]

Definition at line 78 of file JetPtAnalyzer.h.

int JetPtAnalyzer::ptBin [private]

Definition at line 81 of file JetPtAnalyzer.h.

double JetPtAnalyzer::ptMax [private]

Definition at line 83 of file JetPtAnalyzer.h.

double JetPtAnalyzer::ptMin [private]

Definition at line 82 of file JetPtAnalyzer.h.

Definition at line 67 of file JetPtAnalyzer.h.