CMS 3D CMS Logo

Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

JPTJetAnalyzer Class Reference

JPT jet analyzer class definition. More...

#include <JPTJetAnalyzer.h>

Inheritance diagram for JPTJetAnalyzer:
JetAnalyzerBase

List of all members.

Classes

struct  HistogramConfig
 Helper class to hold the configuration for a histogram. More...
struct  TrackHistograms
 Helper class for grouping histograms belowing to a set of tracks. More...

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &eventSetup, const reco::JPTJet &jptJet, double &pt1, double &pt2, double &pt3, const int numPV)
 Do the analysis.
void analyze (const edm::Event &event, const edm::EventSetup &eventSetup, const reco::JPTJetCollection &jptJets, const int numPV)
void beginJob (DQMStore *dbe)
 Inizialize parameters for histo binning.
virtual void endJob ()
 Finish up a job.
 JPTJetAnalyzer (const edm::ParameterSet &config)
 Constructor.
virtual ~JPTJetAnalyzer ()
 Destructor.

Private Member Functions

MonitorElementbook2DHistogram (const std::string &name, const std::string &title, const std::string &xAxisTitle, const std::string &yAxisTitle, DQMStore *dqm)
MonitorElementbookHistogram (const std::string &name, const std::string &title, const std::string &xAxisTitle, DQMStore *dqm)
 Book histograms and profiles.
void bookHistograms (DQMStore *dqm)
 Book all histograms.
MonitorElementbookProfile (const std::string &name, const std::string &title, const std::string &xAxisTitle, const std::string &yAxisTitle, DQMStore *dqm)
void bookTrackHistograms (TrackHistograms *histos, const std::string &tag, const std::string &titleTag, MonitorElement *trackDirectionJetDRHisto, MonitorElement *trackImpactPointJetDRHisto, DQMStore *dqm)
 Book the histograms for a track.
void fillHistogram (MonitorElement *histogram, const double value)
 Fill histogram or profile if it has been booked.
void fillHistogram (MonitorElement *histogram, const double valueX, const double valueY)
void fillSiStripHitSoN (const TrackingRecHit &hit)
void fillSiStripSoNForTracks (const reco::TrackRefVector &tracks)
 Fill the SoN hisotgram for hits on tracks.
void fillTrackHistograms (TrackHistograms &histos, const reco::TrackRefVector &tracks, const reco::Jet &rawJet)
void fillTrackHistograms (TrackHistograms &allTracksHistos, TrackHistograms &inCaloInVertexHistos, TrackHistograms &inCaloOutVertexHistos, TrackHistograms &outCaloInVertexHistos, const reco::TrackRefVector &inVertexInCalo, const reco::TrackRefVector &outVertexInCalo, const reco::TrackRefVector &inVertexOutCalo, const reco::Jet &rawJet)
 Fill all track histograms.
void getConfigForHistogram (const std::string &configName, const edm::ParameterSet &psetContainingConfigPSet, std::ostringstream *pDebugStream=NULL)
 Load the config for a hitogram.
void getConfigForTrackHistograms (const std::string &tag, const edm::ParameterSet &psetContainingConfigPSet, std::ostringstream *pDebugStream=NULL)
 Load the configs for histograms associated with a set of tracks.

Static Private Member Functions

static double findPtFractionInCone (const reco::TrackRefVector &inConeTracks, const reco::TrackRefVector &outOfConeTracks)
 Utility function to calculate the fraction of track Pt in cone.

Private Attributes

TrackHistograms allElectronHistograms_
TrackHistograms allMuonHistograms_
TrackHistograms allPionHistograms_
const double correctedPtMin_
DQMStoredqm_
 DQMStore. Used to write out to file.
std::string dqmStoreFileName_
 DQM store file name.
const double fHPDMax_
std::map< std::string,
HistogramConfig
histogramConfig_
 Histogram configuration (nBins etc)
const std::string histogramPath_
 Path of directory used to store histograms in DQMStore.
TrackHistograms inCaloInVertexElectronHistograms_
TrackHistograms inCaloInVertexMuonHistograms_
TrackHistograms inCaloInVertexPionHistograms_
TrackHistograms inCaloOutVertexElectronHistograms_
TrackHistograms inCaloOutVertexMuonHistograms_
TrackHistograms inCaloOutVertexPionHistograms_
MonitorElementInCaloTrackDirectionJetDRHisto_
MonitorElementInVertexTrackImpactPointJetDRHisto_
MonitorElementJetDeltaEta_
MonitorElementJetDeltaPhi_
MonitorElementJetE_
MonitorElementJetEt_
MonitorElementJetEta_
std::auto_ptr
< reco::helper::JetIDHelper
jetID_
 Helper object to calculate jet ID parameters.
MonitorElementJetP_
MonitorElementJetPhi_
MonitorElementJetPhiVsEta_
MonitorElementJetPt1_
MonitorElementJetPt2_
MonitorElementJetPt3_
MonitorElementJetPt_
MonitorElementJetPx_
MonitorElementJetPy_
MonitorElementJetPz_
const int n90HitsMin_
 Jet ID cuts.
MonitorElementNTracksPerJetHisto_
MonitorElementNTracksPerJetVsJetEtaHisto_
MonitorElementNTracksPerJetVsJetEtHisto_
TrackHistograms outCaloInVertexElectronHistograms_
TrackHistograms outCaloInVertexMuonHistograms_
TrackHistograms outCaloInVertexPionHistograms_
MonitorElementOutCaloTrackDirectionJetDRHisto_
MonitorElementOutVertexTrackImpactPointJetDRHisto_
const double resEMFMin_
std::auto_ptr
< jptJetAnalysis::StripSignalOverNoiseCalculator
sOverNCalculator_
 Helper object to calculate strip SoN for tracks.
std::auto_ptr
< jptJetAnalysis::TrackPropagatorToCalo
trackPropagator_
 Helper object to propagate tracks to the calo surface.
const bool verbose_
 Create verbose debug messages.
const bool writeDQMStore_
 Write DQM store to a file?

Static Private Attributes

static const char * messageLoggerCatregory = "JetPlusTrackDQM"
 String constant for message logger category.

Detailed Description

JPT jet analyzer class definition.

DQM monitoring source for JPT Jets

Date:
2012/09/24 09:39:53
Revision:
1.14
Author:
N. Cripps - Imperial

Definition at line 47 of file JPTJetAnalyzer.h.


Constructor & Destructor Documentation

JPTJetAnalyzer::JPTJetAnalyzer ( const edm::ParameterSet config)

Constructor.

Definition at line 79 of file JPTJetAnalyzer.cc.

References dqmStoreFileName_, getConfigForHistogram(), getConfigForTrackHistograms(), edm::ParameterSet::getUntrackedParameter(), histogramPath_, LogTrace, messageLoggerCatregory, NULL, verbose_, and writeDQMStore_.

  : histogramPath_(config.getParameter<std::string>("HistogramPath")),
    verbose_(config.getUntrackedParameter<bool>("PrintDebugMessages",false)),
    writeDQMStore_(config.getUntrackedParameter<bool>("WriteDQMStore")),
    dqmStoreFileName_(),
    n90HitsMin_(config.getParameter<int>("n90HitsMin")),
    fHPDMax_(config.getParameter<double>("fHPDMax")),
    resEMFMin_(config.getParameter<double>("resEMFMin")),
    correctedPtMin_(config.getParameter<double>("correctedPtThreshold")),
    trackPropagator_(new jptJetAnalysis::TrackPropagatorToCalo),
    sOverNCalculator_(new jptJetAnalysis::StripSignalOverNoiseCalculator),
    jetID_(new reco::helper::JetIDHelper(config.getParameter<edm::ParameterSet>("JetIDParams")))
{
  //print config to debug log
  std::ostringstream debugStream;
  if (verbose_) {
    debugStream << "Configuration for JPTJetAnalyzer: " << std::endl
                << "\tHistogramPath: " << histogramPath_ << std::endl
                << "\tPrintDebugMessages? " << (verbose_ ? "yes" : "no") << std::endl;
  }
  if (writeDQMStore_) {
    dqmStoreFileName_ = config.getUntrackedParameter<std::string>("DQMStoreFileName");
  }
  
  //don't generate debug mesages if debug is disabled
  std::ostringstream* pDebugStream = (verbose_ ? &debugStream : NULL);
  
  //get histogram configuration
  getConfigForHistogram("E",config,pDebugStream);
  getConfigForHistogram("Et",config,pDebugStream);
  getConfigForHistogram("P",config,pDebugStream);
  /*  getConfigForHistogram("Mass",config,pDebugStream);  */
  getConfigForHistogram("Pt",config,pDebugStream);
  getConfigForHistogram("Pt1",config,pDebugStream);
  getConfigForHistogram("Pt2",config,pDebugStream);
  getConfigForHistogram("Pt3",config,pDebugStream);
  getConfigForHistogram("Px",config,pDebugStream);
  getConfigForHistogram("Py",config,pDebugStream);
  getConfigForHistogram("Pz",config,pDebugStream);
  getConfigForHistogram("Eta",config,pDebugStream);
  getConfigForHistogram("Phi",config,pDebugStream);
  /*  getConfigForHistogram("deltaEta",config,pDebugStream);
      getConfigForHistogram("deltaPhi",config,pDebugStream);  */
  getConfigForHistogram("PhiVsEta",config,pDebugStream);
  /*  getConfigForHistogram("N90Hits",config,pDebugStream);  
  getConfigForHistogram("fHPD",config,pDebugStream);
  getConfigForHistogram("ResEMF",config,pDebugStream);   
  getConfigForHistogram("fRBX",config,pDebugStream); 
  getConfigForHistogram("TrackSiStripHitStoN",config,pDebugStream); */
  getConfigForHistogram("InCaloTrackDirectionJetDR",config,pDebugStream);
  getConfigForHistogram("OutCaloTrackDirectionJetDR",config,pDebugStream);
  getConfigForHistogram("InVertexTrackImpactPointJetDR",config,pDebugStream);
  getConfigForHistogram("OutVertexTrackImpactPointJetDR",config,pDebugStream);
  /*  getConfigForHistogram("PtFractionInCone",config,pDebugStream);
  getConfigForHistogram("PtFractionInConeVsJetRawEt",config,pDebugStream);
  getConfigForHistogram("PtFractionInConeVsJetEta",config,pDebugStream);  */
  getConfigForHistogram("nTracks",config,pDebugStream);
  getConfigForHistogram("nTracksVsJetEt",config,pDebugStream);
  getConfigForHistogram("nTracksVsJetEta",config,pDebugStream);
  /*  getConfigForHistogram("CorrFactor",config,pDebugStream);
  getConfigForHistogram("CorrFactorVsJetEt",config,pDebugStream);
  getConfigForHistogram("CorrFactorVsJetEta",config,pDebugStream);  
  getConfigForHistogram("ZSPCorrFactor",config,pDebugStream);
  getConfigForHistogram("ZSPCorrFactorVsJetEt",config,pDebugStream);
  getConfigForHistogram("ZSPCorrFactorVsJetEta",config,pDebugStream);
  getConfigForHistogram("JPTCorrFactor",config,pDebugStream);
  getConfigForHistogram("JPTCorrFactorVsJetEt",config,pDebugStream);
  getConfigForHistogram("JPTCorrFactorVsJetEta",config,pDebugStream);  */
  getConfigForTrackHistograms("AllPions",config,pDebugStream);
  getConfigForTrackHistograms("InCaloInVertexPions",config,pDebugStream);
  getConfigForTrackHistograms("InCaloOutVertexPions",config,pDebugStream);
  getConfigForTrackHistograms("OutCaloInVertexPions",config,pDebugStream);
  getConfigForTrackHistograms("AllMuons",config,pDebugStream);
  getConfigForTrackHistograms("InCaloInVertexMuons",config,pDebugStream);
  getConfigForTrackHistograms("InCaloOutVertexMuons",config,pDebugStream);
  getConfigForTrackHistograms("OutCaloInVertexMuons",config,pDebugStream); 
  getConfigForTrackHistograms("AllElectrons",config,pDebugStream);
  getConfigForTrackHistograms("InCaloInVertexElectrons",config,pDebugStream);
  getConfigForTrackHistograms("InCaloOutVertexElectrons",config,pDebugStream);
  getConfigForTrackHistograms("OutCaloInVertexElectrons",config,pDebugStream);
  
  if (verbose_) LogTrace(messageLoggerCatregory) << debugStream.str();
}
JPTJetAnalyzer::~JPTJetAnalyzer ( ) [virtual]

Destructor.

Definition at line 163 of file JPTJetAnalyzer.cc.

{}

Member Function Documentation

void JPTJetAnalyzer::analyze ( const edm::Event event,
const edm::EventSetup eventSetup,
const reco::JPTJet jptJet,
double &  pt1,
double &  pt2,
double &  pt3,
const int  numPV 
)

Do the analysis.

Definition at line 192 of file JPTJetAnalyzer.cc.

References allElectronHistograms_, allMuonHistograms_, allPionHistograms_, reco::JPTJet::chargedMultiplicity(), correctedPtMin_, reco::LeafCandidate::energy(), reco::LeafCandidate::et(), reco::LeafCandidate::eta(), fHPDMax_, fillHistogram(), fillTrackHistograms(), reco::JPTJet::getCaloJetRef(), reco::JPTJet::getElecsInVertexInCalo(), reco::JPTJet::getElecsInVertexOutCalo(), reco::JPTJet::getElecsOutVertexInCalo(), reco::JPTJet::getMuonsInVertexInCalo(), reco::JPTJet::getMuonsInVertexOutCalo(), reco::JPTJet::getMuonsOutVertexInCalo(), reco::JPTJet::getPionsInVertexInCalo(), reco::JPTJet::getPionsInVertexOutCalo(), reco::JPTJet::getPionsOutVertexInCalo(), inCaloInVertexElectronHistograms_, inCaloInVertexMuonHistograms_, inCaloInVertexPionHistograms_, inCaloOutVertexElectronHistograms_, inCaloOutVertexMuonHistograms_, inCaloOutVertexPionHistograms_, JetE_, JetEt_, JetEta_, jetID_, JetP_, JetPhi_, JetPhiVsEta_, JetPt_, JetPx_, JetPy_, JetPz_, messageLoggerCatregory, n90HitsMin_, NTracksPerJetHisto_, NTracksPerJetVsJetEtaHisto_, NTracksPerJetVsJetEtHisto_, outCaloInVertexElectronHistograms_, outCaloInVertexMuonHistograms_, outCaloInVertexPionHistograms_, reco::LeafCandidate::p(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), resEMFMin_, sOverNCalculator_, and trackPropagator_.

Referenced by analyze().

{
  //update the track propagator and strip noise calculator
  trackPropagator_->update(eventSetup);
  sOverNCalculator_->update(eventSetup);
  
  //make corrected jets 
  /* */
  //  const double factorZSP = jptJet.getZSPCor();  
  const reco::Jet& rawJet = *jptJet.getCaloJetRef();
  /* */ 
  //  const double factorZSPJPT = jptJet.energy()/rawJet.energy(); 
  
  //check jet is correctable by JPT
  if ( fabs(rawJet.eta()) > 2.1) return;
  
  //get consitiuents of jet
  const reco::TrackRefVector& pionsInVertexInCalo = jptJet.getPionsInVertexInCalo();
  const reco::TrackRefVector& pionsInVertexOutCalo = jptJet.getPionsInVertexOutCalo();
  const reco::TrackRefVector& pionsOutVertexInCalo = jptJet.getPionsOutVertexInCalo();
  const reco::TrackRefVector& muonsInVertexInCalo = jptJet.getMuonsInVertexInCalo();
  const reco::TrackRefVector& muonsInVertexOutCalo = jptJet.getMuonsInVertexOutCalo();
  const reco::TrackRefVector& muonsOutVertexInCalo = jptJet.getMuonsOutVertexInCalo();
  const reco::TrackRefVector& electronsInVertexInCalo = jptJet.getElecsInVertexInCalo();
  const reco::TrackRefVector& electronsInVertexOutCalo = jptJet.getElecsInVertexOutCalo();
  const reco::TrackRefVector& electronsOutVertexInCalo = jptJet.getElecsOutVertexInCalo();
  
  //check pt against highest values
  const double pt = jptJet.pt();
  if (pt > pt1) {
    pt3 = pt2;
    pt2 = pt1;
    pt1 = pt;
  } else if (pt > pt2) {
    pt3 = pt2;
    pt2 = pt;
  } else if (pt > pt3) {
    pt3 = pt;
  }
  
  //fill histograms
  try {
    const reco::CaloJet& rawCaloJet = dynamic_cast<const reco::CaloJet&>(rawJet);
    jetID_->calculate(event,rawCaloJet);
  } catch (const std::bad_cast&) {
    edm::LogError(messageLoggerCatregory) << "Failed to cast raw jet to CaloJet. JPT Jet does not appear to have been built from a CaloJet. "
                                          << "Histograms not filled. ";
    return;
  }
  const bool idPassed = ( (jetID_->n90Hits() >= n90HitsMin_) && (jetID_->fHPD() < fHPDMax_) && (jetID_->restrictedEMF() >= resEMFMin_) );
  /*  fillHistogram(JetN90Hits_,jetID_->n90Hits());  
  fillHistogram(JetfHPD_,jetID_->fHPD());
  fillHistogram(JetResEMF_,jetID_->restrictedEMF());  
  fillHistogram(JetfRBX_,jetID_->fRBX());  */
  if (idPassed) {
    //    const double deltaEta = jptJet.eta() - rawJet.eta();
    //    const double deltaPhi = jptJet.phi() - rawJet.phi();
    if (jptJet.pt() > correctedPtMin_) {
      fillHistogram(JetE_,jptJet.energy());
      fillHistogram(JetEt_,jptJet.et());
      fillHistogram(JetP_,jptJet.p());
      /*      fillHistogram(JetMass_,jptJet.mass());  */
      fillHistogram(JetPt_,jptJet.pt());
      fillHistogram(JetPx_,jptJet.px());
      fillHistogram(JetPy_,jptJet.py());
      fillHistogram(JetPz_,jptJet.pz());

      fillHistogram(JetEta_,jptJet.eta());
      fillHistogram(JetPhi_,jptJet.phi());
      /*      fillHistogram(JetDeltaEta_,deltaEta);
              fillHistogram(JetDeltaPhi_,deltaPhi);    */
      fillHistogram(JetPhiVsEta_,jptJet.phi(),jptJet.eta());


      const uint16_t totalTracks = jptJet.chargedMultiplicity();
      fillHistogram(NTracksPerJetHisto_,totalTracks);
      fillHistogram(NTracksPerJetVsJetEtHisto_,rawJet.et(),totalTracks);
      fillHistogram(NTracksPerJetVsJetEtaHisto_,rawJet.eta(),totalTracks);
      /*      fillHistogram(CorrFactorHisto_,factorZSPJPT);
      fillHistogram(CorrFactorVsJetEtHisto_,rawJet.et(),factorZSPJPT);
      fillHistogram(CorrFactorVsJetEtaHisto_,rawJet.eta(),factorZSPJPT);
      fillHistogram(ZSPCorrFactorHisto_,factorZSP);
      fillHistogram(ZSPCorrFactorVsJetEtHisto_,rawJet.et(),factorZSP);
      fillHistogram(ZSPCorrFactorVsJetEtaHisto_,rawJet.eta(),factorZSP); */
      /*     const double factorJPT = factorZSPJPT / factorZSP;   */
      /*      fillHistogram(JPTCorrFactorHisto_,factorJPT);
      fillHistogram(JPTCorrFactorVsJetEtHisto_,rawJet.et(),factorJPT);
      fillHistogram(JPTCorrFactorVsJetEtaHisto_,rawJet.eta(),factorJPT);  */
      //      const double ptFractionInCone = findPtFractionInCone(pionsInVertexInCalo,pionsInVertexOutCalo);
      /*      fillHistogram(PtFractionInConeHisto_,ptFractionInCone);
      fillHistogram(PtFractionInConeVsJetRawEtHisto_,rawJet.et(),ptFractionInCone);
      fillHistogram(PtFractionInConeVsJetEtaHisto_,rawJet.eta(),ptFractionInCone); */
      //fill track level histograms
      fillTrackHistograms(allPionHistograms_,inCaloInVertexPionHistograms_,inCaloOutVertexPionHistograms_,outCaloInVertexPionHistograms_,
                          pionsInVertexInCalo,pionsOutVertexInCalo,pionsInVertexOutCalo,rawJet);
      fillTrackHistograms(allMuonHistograms_,inCaloInVertexMuonHistograms_,inCaloOutVertexMuonHistograms_,outCaloInVertexMuonHistograms_,
                          muonsInVertexInCalo,muonsOutVertexInCalo,muonsInVertexOutCalo,rawJet);
      fillTrackHistograms(allElectronHistograms_,inCaloInVertexElectronHistograms_,inCaloOutVertexElectronHistograms_,outCaloInVertexElectronHistograms_,
                          electronsInVertexInCalo,electronsOutVertexInCalo,electronsInVertexOutCalo,rawJet);
    }
  }
}
void JPTJetAnalyzer::analyze ( const edm::Event event,
const edm::EventSetup eventSetup,
const reco::JPTJetCollection jptJets,
const int  numPV 
)

Definition at line 175 of file JPTJetAnalyzer.cc.

References analyze(), fillHistogram(), JetPt1_, JetPt2_, and JetPt3_.

{
  double pt1 = 0;
  double pt2 = 0;
  double pt3 = 0;

  for (reco::JPTJetCollection::const_iterator iJet = jptJets.begin(); iJet != jptJets.end(); ++iJet) {
    analyze(event, eventSetup, *iJet, pt1, pt2, pt3, numPV);
  }
  if (pt1) fillHistogram(JetPt1_,pt1);
  if (pt2) fillHistogram(JetPt2_,pt2);
  if (pt3) fillHistogram(JetPt3_,pt3);
}
void JPTJetAnalyzer::beginJob ( DQMStore dbe) [virtual]

Inizialize parameters for histo binning.

Implements JetAnalyzerBase.

Definition at line 166 of file JPTJetAnalyzer.cc.

References bookHistograms(), dqm_, histogramPath_, and DQMStore::setCurrentFolder().

{
  dqm_ = dqmStore;
  //book histograms
  dqmStore->setCurrentFolder(histogramPath_);
  bookHistograms(dqmStore);
}
MonitorElement * JPTJetAnalyzer::book2DHistogram ( const std::string &  name,
const std::string &  title,
const std::string &  xAxisTitle,
const std::string &  yAxisTitle,
DQMStore dqm 
) [private]

Definition at line 380 of file JPTJetAnalyzer.cc.

References DQMStore::book2D(), JPTJetAnalyzer::HistogramConfig::enabled, interpolateCardsSimple::histo, histogramConfig_, JPTJetAnalyzer::HistogramConfig::max, JPTJetAnalyzer::HistogramConfig::maxY, messageLoggerCatregory, JPTJetAnalyzer::HistogramConfig::min, JPTJetAnalyzer::HistogramConfig::minY, JPTJetAnalyzer::HistogramConfig::nBins, JPTJetAnalyzer::HistogramConfig::nBinsY, NULL, and MonitorElement::setAxisTitle().

Referenced by bookHistograms().

{
  std::map<std::string,HistogramConfig>::const_iterator configIterator = histogramConfig_.find(name);
  if (configIterator == histogramConfig_.end()) {
    edm::LogWarning(messageLoggerCatregory) << "Trying to book histogram with name " << name << " when no config was not retrieved from ParameterSet";
    return NULL;
  }
  const HistogramConfig& histoConfig = (*configIterator).second;
  if (histoConfig.enabled) {
    MonitorElement* histo = dqm->book2D(name,title,histoConfig.nBins,histoConfig.min,histoConfig.max,histoConfig.nBinsY,histoConfig.minY,histoConfig.maxY);
    histo->setAxisTitle(xAxisTitle,1);
    histo->setAxisTitle(yAxisTitle,2);
    return histo;
  } else {
    return NULL;
  }
}
MonitorElement * JPTJetAnalyzer::bookHistogram ( const std::string &  name,
const std::string &  title,
const std::string &  xAxisTitle,
DQMStore dqm 
) [private]

Book histograms and profiles.

Definition at line 363 of file JPTJetAnalyzer.cc.

References DQMStore::book1D(), JPTJetAnalyzer::HistogramConfig::enabled, interpolateCardsSimple::histo, histogramConfig_, JPTJetAnalyzer::HistogramConfig::max, messageLoggerCatregory, JPTJetAnalyzer::HistogramConfig::min, JPTJetAnalyzer::HistogramConfig::nBins, NULL, and MonitorElement::setAxisTitle().

Referenced by bookHistograms(), and bookTrackHistograms().

{
  std::map<std::string,HistogramConfig>::const_iterator configIterator = histogramConfig_.find(name);
  if (configIterator == histogramConfig_.end()) {
    edm::LogWarning(messageLoggerCatregory) << "Trying to book histogram with name " << name << " when no config was not retrieved from ParameterSet";
    return NULL;
  }
  const HistogramConfig& histoConfig = (*configIterator).second;
  if (histoConfig.enabled) {
    MonitorElement* histo = dqm->book1D(name,title,histoConfig.nBins,histoConfig.min,histoConfig.max);
    histo->setAxisTitle(xAxisTitle,1);
    return histo;
  } else {
    return NULL;
  }
}
void JPTJetAnalyzer::bookHistograms ( DQMStore dqm) [private]

Book all histograms.

Definition at line 419 of file JPTJetAnalyzer.cc.

References allElectronHistograms_, allMuonHistograms_, allPionHistograms_, book2DHistogram(), bookHistogram(), bookProfile(), bookTrackHistograms(), inCaloInVertexElectronHistograms_, inCaloInVertexMuonHistograms_, inCaloInVertexPionHistograms_, inCaloOutVertexElectronHistograms_, inCaloOutVertexMuonHistograms_, inCaloOutVertexPionHistograms_, InCaloTrackDirectionJetDRHisto_, InVertexTrackImpactPointJetDRHisto_, JetE_, JetEt_, JetEta_, JetP_, JetPhi_, JetPhiVsEta_, JetPt1_, JetPt2_, JetPt3_, JetPt_, JetPx_, JetPy_, JetPz_, NTracksPerJetHisto_, NTracksPerJetVsJetEtaHisto_, NTracksPerJetVsJetEtHisto_, NULL, outCaloInVertexElectronHistograms_, outCaloInVertexMuonHistograms_, outCaloInVertexPionHistograms_, OutCaloTrackDirectionJetDRHisto_, and OutVertexTrackImpactPointJetDRHisto_.

Referenced by beginJob().

{
  JetE_        = bookHistogram("E","Corrected Jet Energy","E /GeV",dqm);
  JetEt_       = bookHistogram("Et","Corrected Jet E_{T}","E_{T} /GeV",dqm);
  JetP_        = bookHistogram("P","Corrected Jet Momentum","p /GeV/c",dqm);
  /*  JetMass_     = bookHistogram("Mass","Jet mass","Mass /GeV/c^{2}",dqm);  */
  JetPt_       = bookHistogram("Pt","Jet p_{T}","p_{T} /GeV/c",dqm);
  JetPt1_      = bookHistogram("Pt1","1st Jet p_{T}","p_{T} /GeV/c",dqm);
  JetPt2_      = bookHistogram("Pt2","2nd Jet p_{T}","p_{T} /GeV/c",dqm);
  JetPt3_      = bookHistogram("Pt3","3rd Jet p_{T}","p_{T} /GeV/c",dqm);
  JetPx_       = bookHistogram("Px","Jet p_{X}","p_{X} /GeV/c",dqm);
  JetPy_       = bookHistogram("Py","Jet p_{Y}","p_{Y} /GeV/c",dqm);
  JetPz_       = bookHistogram("Pz","Jet p_{Z}","p_{Z} /GeV/c",dqm);
  JetEta_      = bookHistogram("Eta","Jet #eta","#eta",dqm);
  JetPhi_      = bookHistogram("Phi","Jet #phi","#phi",dqm);
  /*  JetDeltaEta_ = bookHistogram("deltaEta","Change in #eta","#Delta #eta",dqm);
      JetDeltaPhi_ = bookHistogram("deltaPhi","Change in #phi","#Delta #phi",dqm);  */
  JetPhiVsEta_ = book2DHistogram("PhiVsEta","Corrected jet #phi vs #eta","jet #phi","jet #eta",dqm);
  /*  JetN90Hits_  = bookHistogram("N90Hits","Jet N90Hits","N90 Hits",dqm);  
  JetfHPD_     = bookHistogram("fHPD","Jet fHPD","fHPD",dqm);
  JetResEMF_   = bookHistogram("ResEMF","Jet restricted EM fraction","restricted EMF",dqm); 
  JetfRBX_     = bookHistogram("fRBX","Jet fRBX","fRBX",dqm); 


  TrackSiStripHitStoNHisto_            = bookHistogram("TrackSiStripHitStoN","Signal to noise of track SiStrip hits","S/N",dqm);  */
  InCaloTrackDirectionJetDRHisto_      = bookHistogram("InCaloTrackDirectionJetDR",
                                                       "#Delta R between track direrction at vertex and jet axis (track in cone at calo)","#Delta R",dqm);
  OutCaloTrackDirectionJetDRHisto_     = bookHistogram("OutCaloTrackDirectionJetDR",
                                                       "#Delta R between track direrction at vertex and jet axis (track out of cone at calo)","#Delta R",dqm);
  InVertexTrackImpactPointJetDRHisto_  = bookHistogram("InVertexTrackImpactPointJetDR",
                                                       "#Delta R between track impact point on calo and jet axis (track in cone at vertex)","#Delta R",dqm);
  OutVertexTrackImpactPointJetDRHisto_ = bookHistogram("OutVertexTrackImpactPointJetDR",
                                                       "#Delta R between track impact point on calo and jet axis (track out of cone at vertex)","#Delta R",dqm);
  
  NTracksPerJetHisto_         = bookHistogram("nTracks","Number of tracks for correction per jet","n tracks",dqm);
  NTracksPerJetVsJetEtHisto_  = bookProfile("nTracksVsJetEt","Number of tracks for correction per jet vs jet raw E_{T}","Jet raw E_{T} /GeV","n Tracks",dqm);
  NTracksPerJetVsJetEtaHisto_ = bookProfile("nTracksVsJetEta","Number of tracks for correction per jet vs jet #eta","Jet #eta","n Tracks",dqm);
  
  /*  PtFractionInConeHisto_           = bookHistogram("PtFractionInCone","#frac{p_{T}^{in-cone}}{p_{T}^{in-cone}+p_{T}^{out-of-cone}}",
                                                 "#frac{p_{T}^{in-cone}}{p_{T}^{in-cone}+p_{T}^{out-of-cone}}",dqm);   
  PtFractionInConeVsJetRawEtHisto_ = bookProfile("PtFractionInConeVsJetRawEt","#frac{p_{T}^{in-cone}}{p_{T}^{in-cone}+p_{T}^{out-of-cone}} vs jet raw E_{T}",
                                                 "Jet raw E_{T} / GeV","#frac{p_{T}^{in-cone}}{p_{T}^{in-cone}+p_{T}^{out-of-cone}}",dqm);
  PtFractionInConeVsJetEtaHisto_   = bookProfile("PtFractionInConeVsJetEta","#frac{p_{T}^{in-cone}}{p_{T}^{in-cone}+p_{T}^{out-of-cone}} vs jet #eta",
                                                 "Jet #eta","#frac{p_{T}^{in-cone}}{p_{T}^{in-cone}+p_{T}^{out-of-cone}}",dqm);
  
  CorrFactorHisto_            = bookHistogram("CorrFactor","Correction factor","Correction factor",dqm);
  CorrFactorVsJetEtHisto_     = bookProfile("CorrFactorVsJetEt","Correction factor vs jet raw E_{T}","Jet raw E_{T}","#frac{E_{T}^{corr}}{E_{T}^{raw}}",dqm);
  CorrFactorVsJetEtaHisto_    = bookProfile("CorrFactorVsJetEta","Correction factor vs jet #eta","Jet #eta","#frac{E_{T}^{corr}}{E_{T}^{raw}}",dqm);
  ZSPCorrFactorHisto_         = bookHistogram("ZSPCorrFactor","Correction factor from ZSP step","Correction factor",dqm);
  ZSPCorrFactorVsJetEtHisto_  = bookProfile("ZSPCorrFactorVsJetEt","Correction factor from ZSP step vs jet raw E_{T}",
                                            "Jet raw E_{T}","#frac{E_{T}^{corr}}{E_{T}^{raw}}",dqm);
  ZSPCorrFactorVsJetEtaHisto_ = bookProfile("ZSPCorrFactorVsJetEta","Correction factor from ZSP step vs jet #eta",
                                            "Jet #eta","#frac{E_{T}^{corr}}{E_{T}^{raw}}",dqm);
  JPTCorrFactorHisto_         = bookHistogram("JPTCorrFactor","Correction factor from JPT step","Correction factor",dqm);
  JPTCorrFactorVsJetEtHisto_  = bookProfile("JPTCorrFactorVsJetEt","Correction factor from JPT step vs jet raw E_{T}",
                                            "Jet raw E_{T}","#frac{E_{T}^{corr}}{E_{T}^{raw}}",dqm);
  JPTCorrFactorVsJetEtaHisto_ = bookProfile("JPTCorrFactorVsJetEta","Correction factor from JPT step vs jet #eta",
  "Jet #eta","#frac{E_{T}^{corr}}{E_{T}^{raw}}",dqm);   */


  
  bookTrackHistograms(&allPionHistograms_,"AllPions","pion",NULL,NULL,dqm);
  bookTrackHistograms(&inCaloInVertexPionHistograms_,"InCaloInVertexPions","pions in cone at calo and vertex",
                      InCaloTrackDirectionJetDRHisto_,InVertexTrackImpactPointJetDRHisto_,dqm);
  bookTrackHistograms(&inCaloOutVertexPionHistograms_,"InCaloOutVertexPions","pions in cone at calo but out at vertex",
                      InCaloTrackDirectionJetDRHisto_,OutVertexTrackImpactPointJetDRHisto_,dqm);
  bookTrackHistograms(&outCaloInVertexPionHistograms_,"OutCaloInVertexPions","pions out of cone at calo but in at vertex",
                      OutCaloTrackDirectionJetDRHisto_,InVertexTrackImpactPointJetDRHisto_,dqm);
  
  bookTrackHistograms(&allMuonHistograms_,"AllMuons","muon",NULL,NULL,dqm);
  bookTrackHistograms(&inCaloInVertexMuonHistograms_,"InCaloInVertexMuons","muons in cone at calo and vertex",
                      InCaloTrackDirectionJetDRHisto_,InVertexTrackImpactPointJetDRHisto_,dqm);
  bookTrackHistograms(&inCaloOutVertexMuonHistograms_,"InCaloOutVertexMuons","muons in cone at calo but out at vertex",
                      InCaloTrackDirectionJetDRHisto_,OutVertexTrackImpactPointJetDRHisto_,dqm);
  bookTrackHistograms(&outCaloInVertexMuonHistograms_,"OutCaloInVertexMuons","muons out of cone at calo but in at vertex",
                      OutCaloTrackDirectionJetDRHisto_,InVertexTrackImpactPointJetDRHisto_,dqm);
  
  bookTrackHistograms(&allElectronHistograms_,"AllElectrons","electron",NULL,NULL,dqm);
  bookTrackHistograms(&inCaloInVertexElectronHistograms_,"InCaloInVertexElectrons","electrons in cone at calo and vertex",
                      InCaloTrackDirectionJetDRHisto_,InVertexTrackImpactPointJetDRHisto_,dqm);
  bookTrackHistograms(&inCaloOutVertexElectronHistograms_,"InCaloOutVertexElectrons","electrons in cone at calo but out at vertex",
                      InCaloTrackDirectionJetDRHisto_,OutVertexTrackImpactPointJetDRHisto_,dqm);
  bookTrackHistograms(&outCaloInVertexElectronHistograms_,"OutCaloInVertexElectrons","electrons out of cone at calo but in at vertex",
                      OutCaloTrackDirectionJetDRHisto_,InVertexTrackImpactPointJetDRHisto_,dqm);
}
MonitorElement * JPTJetAnalyzer::bookProfile ( const std::string &  name,
const std::string &  title,
const std::string &  xAxisTitle,
const std::string &  yAxisTitle,
DQMStore dqm 
) [private]

Definition at line 399 of file JPTJetAnalyzer.cc.

References DQMStore::bookProfile(), JPTJetAnalyzer::HistogramConfig::enabled, interpolateCardsSimple::histo, histogramConfig_, JPTJetAnalyzer::HistogramConfig::max, messageLoggerCatregory, JPTJetAnalyzer::HistogramConfig::min, JPTJetAnalyzer::HistogramConfig::nBins, NULL, and MonitorElement::setAxisTitle().

Referenced by bookHistograms(), and bookTrackHistograms().

{
  std::map<std::string,HistogramConfig>::const_iterator configIterator = histogramConfig_.find(name);
  if (configIterator == histogramConfig_.end()) {
    edm::LogWarning(messageLoggerCatregory) << "Trying to book histogram with name " << name << " when no config was not retrieved from ParameterSet";
    return NULL;
  }
  const HistogramConfig& histoConfig = (*configIterator).second;
  if (histoConfig.enabled) {
    TProfile* underlyingRootObject = new TProfile(name.c_str(),title.c_str(),histoConfig.nBins,histoConfig.min,histoConfig.max);
    MonitorElement* histo = dqm->bookProfile(name,underlyingRootObject);
    histo->setAxisTitle(xAxisTitle,1);
    histo->setAxisTitle(yAxisTitle,2);
    return histo;
  } else {
    return NULL;
  }
}
void JPTJetAnalyzer::bookTrackHistograms ( TrackHistograms histos,
const std::string &  tag,
const std::string &  titleTag,
MonitorElement trackDirectionJetDRHisto,
MonitorElement trackImpactPointJetDRHisto,
DQMStore dqm 
) [private]

Book the histograms for a track.

Definition at line 505 of file JPTJetAnalyzer.cc.

References bookHistogram(), bookProfile(), JPTJetAnalyzer::TrackHistograms::etaHisto, JPTJetAnalyzer::TrackHistograms::nTracksHisto, JPTJetAnalyzer::TrackHistograms::phiHisto, JPTJetAnalyzer::TrackHistograms::ptHisto, JPTJetAnalyzer::TrackHistograms::ptVsEtaHisto, JPTJetAnalyzer::TrackHistograms::trackDirectionJetDRHisto, and JPTJetAnalyzer::TrackHistograms::trackImpactPointJetDRHisto.

Referenced by bookHistograms().

{
  histos->nTracksHisto = bookHistogram("n"+tag+"TracksPerJet","Number of "+titleTag+" tracks per jet","n Tracks",dqm);
  histos->ptHisto = bookHistogram(tag+"TrackPt",titleTag+" p_{T}","p_{T} /GeV/c",dqm);
  histos->phiHisto = bookHistogram(tag+"TrackPhi",titleTag+" track #phi","#phi",dqm);
  histos->etaHisto = bookHistogram(tag+"TrackEta",titleTag+" track #eta","#eta",dqm);
  /*  histos->nHitsHisto = bookHistogram(tag+"TrackNHits",titleTag+" track N hits","N hits",dqm);
      histos->nLayersHisto = bookHistogram(tag+"TrackNLayers",titleTag+" track N layers with hits","N layers",dqm);    */
  histos->ptVsEtaHisto = bookProfile(tag+"TrackPtVsEta",titleTag+" track p_{T} vs #eta","#eta","p_{T} /GeV/c",dqm);
  /*  histos->dzHisto = bookHistogram(tag+"TrackDz",titleTag+" track dz","dz /cm",dqm);
  histos->dxyHisto = bookHistogram(tag+"TrackDxy",titleTag+" track dxy","dxy /cm",dqm); */
  histos->trackDirectionJetDRHisto = trackDirectionJetDRHisto;
  histos->trackImpactPointJetDRHisto = trackImpactPointJetDRHisto;
}
void JPTJetAnalyzer::endJob ( void  ) [virtual]

Finish up a job.

Definition at line 301 of file JPTJetAnalyzer.cc.

References dqm_, dqmStoreFileName_, DQMStore::save(), and writeDQMStore_.

void JPTJetAnalyzer::fillHistogram ( MonitorElement histogram,
const double  value 
) [inline, private]

Fill histogram or profile if it has been booked.

Definition at line 192 of file JPTJetAnalyzer.h.

References MonitorElement::Fill().

Referenced by analyze(), and fillTrackHistograms().

{
  if (histogram) histogram->Fill(value);
}
void JPTJetAnalyzer::fillHistogram ( MonitorElement histogram,
const double  valueX,
const double  valueY 
) [inline, private]

Definition at line 197 of file JPTJetAnalyzer.h.

References MonitorElement::Fill().

{
  if (histogram) histogram->Fill(valueX,valueY);
}
void JPTJetAnalyzer::fillSiStripHitSoN ( const TrackingRecHit hit) [private]

Definition at line 581 of file JPTJetAnalyzer.cc.

References TrackingRecHit::geographicalId(), sistripsummary::TEC, sistripsummary::TIB, sistripsummary::TID, sistripsummary::TOB, and align::Tracker.

Referenced by fillSiStripSoNForTracks().

{
  //check it is an SiStrip hit
  DetId detId(hit.geographicalId());
  if (!( (detId.det() == DetId::Tracker) &&
        ( (detId.subdetId() == SiStripDetId::TIB) ||
          (detId.subdetId() == SiStripDetId::TID) ||
          (detId.subdetId() == SiStripDetId::TOB) ||
          (detId.subdetId() == SiStripDetId::TEC)
        )
     )) return;


  // J.Piedra, 2012/09/24
  //try to determine the type of the hit
  //  const TrackingRecHit* pHit = &hit;
  //  const SiStripRecHit2D* pRecHit2D = dynamic_cast<const SiStripRecHit2D*>(pHit);
  //  const SiStripMatchedRecHit2D* pMatchedRecHit2D = dynamic_cast<const SiStripMatchedRecHit2D*>(pHit);
  //  const ProjectedSiStripRecHit2D* pProjctedRecHit2D = dynamic_cast<const ProjectedSiStripRecHit2D*>(pHit);
  //  const InvalidTrackingRecHit* pInvalidHit = dynamic_cast<const InvalidTrackingRecHit*>(pHit);

  //  //fill signal to noise for appropriate hit
  //  if (pMatchedRecHit2D) {
  //    fillSiStripHitSoNForSingleHit(pMatchedRecHit2D->monoHit());
  //    fillSiStripHitSoNForSingleHit(pMatchedRecHit2D->stereoHit());
  //  } else if (pProjctedRecHit2D) {
  //    fillSiStripHitSoNForSingleHit(pProjctedRecHit2D->originalHit());
  //  } else if (pRecHit2D) {
  //    fillSiStripHitSoNForSingleHit(*pRecHit2D);
  //  } else if (pInvalidHit) {
  //    return;
  //  } else {
  //    edm::LogInfo(messageLoggerCatregory) << "Hit on det ID " << hit.geographicalId().rawId() << " cannot be converted to a strip hit";
  //  }
}
void JPTJetAnalyzer::fillSiStripSoNForTracks ( const reco::TrackRefVector tracks) [private]

Fill the SoN hisotgram for hits on tracks.

Definition at line 570 of file JPTJetAnalyzer.cc.

References edm::RefVector< C, T, F >::begin(), edm::RefVector< C, T, F >::end(), and fillSiStripHitSoN().

Referenced by fillTrackHistograms().

{
  const reco::TrackRefVector::const_iterator tracksEnd = tracks.end();
  for (reco::TrackRefVector::const_iterator iTrack = tracks.begin(); iTrack != tracksEnd; ++iTrack) {
    const trackingRecHit_iterator trackRecHitsEnd = (*iTrack)->recHitsEnd();
    for (trackingRecHit_iterator iHit = (*iTrack)->recHitsBegin(); iHit != trackRecHitsEnd; ++iHit) {
      fillSiStripHitSoN(**iHit);
    }
  }
}
void JPTJetAnalyzer::fillTrackHistograms ( TrackHistograms histos,
const reco::TrackRefVector tracks,
const reco::Jet rawJet 
) [private]

Definition at line 543 of file JPTJetAnalyzer.cc.

References edm::RefVector< C, T, F >::begin(), deltaR(), edm::RefVector< C, T, F >::end(), eta(), reco::TrackBase::eta(), JPTJetAnalyzer::TrackHistograms::etaHisto, fillHistogram(), phi, reco::TrackBase::phi(), JPTJetAnalyzer::TrackHistograms::phiHisto, reco::TrackBase::pt(), JPTJetAnalyzer::TrackHistograms::ptHisto, JPTJetAnalyzer::TrackHistograms::ptVsEtaHisto, JPTJetAnalyzer::TrackHistograms::trackDirectionJetDRHisto, JPTJetAnalyzer::TrackHistograms::trackImpactPointJetDRHisto, and trackPropagator_.

{
  const reco::TrackRefVector::const_iterator tracksEnd = tracks.end();
  for (reco::TrackRefVector::const_iterator iTrack = tracks.begin(); iTrack != tracksEnd; ++iTrack) {
    const reco::Track& track = **iTrack;
    const double pt = track.pt();
    const double phi = track.phi();
    const double eta = track.eta();
    //    const unsigned int nHits = track.found();
    //    const unsigned int nLayers = track.hitPattern().trackerLayersWithMeasurement();
    //    const double dz = track.dz();
    //    const double dxy = track.dxy();  
    fillHistogram(histos.ptHisto,pt);
    fillHistogram(histos.phiHisto,phi);
    fillHistogram(histos.etaHisto,eta);
    /*    fillHistogram(histos.nHitsHisto,nHits);
          fillHistogram(histos.nLayersHisto,nLayers);   */
    fillHistogram(histos.ptVsEtaHisto,eta,pt);
    /*    fillHistogram(histos.dzHisto,dz);
    fillHistogram(histos.dxyHisto,dxy);   */
    const double trackDirectionJetDR = deltaR(rawJet,track);
    fillHistogram(histos.trackDirectionJetDRHisto,trackDirectionJetDR);
    const double impactPointJetDR = deltaR(rawJet,trackPropagator_->impactPoint(track));
    fillHistogram(histos.trackImpactPointJetDRHisto,impactPointJetDR);
  }
}
void JPTJetAnalyzer::fillTrackHistograms ( TrackHistograms allTracksHistos,
TrackHistograms inCaloInVertexHistos,
TrackHistograms inCaloOutVertexHistos,
TrackHistograms outCaloInVertexHistos,
const reco::TrackRefVector inVertexInCalo,
const reco::TrackRefVector outVertexInCalo,
const reco::TrackRefVector inVertexOutCalo,
const reco::Jet rawJet 
) [private]

Fill all track histograms.

Definition at line 521 of file JPTJetAnalyzer.cc.

References fillHistogram(), fillSiStripSoNForTracks(), JPTJetAnalyzer::TrackHistograms::nTracksHisto, and edm::RefVector< C, T, F >::size().

Referenced by analyze().

{
  fillTrackHistograms(allTracksHistos,inVertexInCalo,rawJet);
  fillTrackHistograms(allTracksHistos,outVertexInCalo,rawJet);
  fillTrackHistograms(allTracksHistos,inVertexOutCalo,rawJet);
  fillHistogram(allTracksHistos.nTracksHisto,inVertexInCalo.size()+outVertexInCalo.size()+inVertexOutCalo.size());
  fillSiStripSoNForTracks(inVertexInCalo);
  fillSiStripSoNForTracks(outVertexInCalo);
  fillSiStripSoNForTracks(inVertexOutCalo);
  fillTrackHistograms(inCaloInVertexHistos,inVertexInCalo,rawJet);
  fillHistogram(inCaloInVertexHistos.nTracksHisto,inVertexInCalo.size());
  fillTrackHistograms(inCaloOutVertexHistos,outVertexInCalo,rawJet);
  fillHistogram(inCaloOutVertexHistos.nTracksHisto,outVertexInCalo.size());
  fillTrackHistograms(outCaloInVertexHistos,inVertexOutCalo,rawJet);
  fillHistogram(outCaloInVertexHistos.nTracksHisto,inVertexOutCalo.size());
}
double JPTJetAnalyzer::findPtFractionInCone ( const reco::TrackRefVector inConeTracks,
const reco::TrackRefVector outOfConeTracks 
) [static, private]

Utility function to calculate the fraction of track Pt in cone.

Definition at line 640 of file JPTJetAnalyzer.cc.

References edm::RefVector< C, T, F >::begin(), and edm::RefVector< C, T, F >::end().

{
  double totalPt = 0;
  double inConePt = 0;
  const reco::TrackRefVector::const_iterator inConeTracksEnd = inConeTracks.end();
  for (reco::TrackRefVector::const_iterator iInConeTrack = inConeTracks.begin(); iInConeTrack != inConeTracksEnd; ++iInConeTrack) {
    const double pt = (*iInConeTrack)->pt();
    totalPt += pt;
    inConePt += pt;
  }
  const reco::TrackRefVector::const_iterator outOfConeTracksEnd = outOfConeTracks.end();
  for (reco::TrackRefVector::const_iterator iOutOfConeTrack = outOfConeTracks.begin(); iOutOfConeTrack != outOfConeTracksEnd; ++iOutOfConeTrack) {
    const double pt = (*iOutOfConeTrack)->pt();
    totalPt += pt;
  }
  if (totalPt) return inConePt/totalPt;
  //return 0 if there are no tracks at all
  else return 0;
}
void JPTJetAnalyzer::getConfigForHistogram ( const std::string &  configName,
const edm::ParameterSet psetContainingConfigPSet,
std::ostringstream *  pDebugStream = NULL 
) [private]

Load the config for a hitogram.

Definition at line 306 of file JPTJetAnalyzer.cc.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), histogramConfig_, max(), cmsRun_displayProdMFGeom_cfg::maxY, messageLoggerCatregory, min, and cmsRun_displayProdMFGeom_cfg::minY.

Referenced by getConfigForTrackHistograms(), and JPTJetAnalyzer().

{
  const std::string psetName = configName+std::string("HistogramConfig");
  if (!psetContainingConfigPSet.exists(psetName)) {
    edm::LogWarning(messageLoggerCatregory) << "Histogram " << configName << " config not found" << std::endl;
    histogramConfig_[configName] = HistogramConfig();
  } else {
    if (pDebugStream) {
      (*pDebugStream) << "Histogram " << configName << " config found and loaded" << std::endl;
    }
    const edm::ParameterSet& pset = psetContainingConfigPSet.getParameter<edm::ParameterSet>(psetName);
    const bool enabled = (pset.exists("Enabled") ? pset.getParameter<bool>("Enabled") : true);
    if (!enabled) {
      histogramConfig_[configName] = HistogramConfig();
      if (pDebugStream) {
        (*pDebugStream) << "\tHistogram: " << configName << " Disabled" << std::endl;
      }
    } else {
      const unsigned int nBins = (pset.exists("NBins") ? pset.getParameter<unsigned int>("NBins") : 0);
      const double min = (pset.exists("Min") ? pset.getParameter<double>("Min") : 0);
      const double max = (pset.exists("Max") ? pset.getParameter<double>("Max") : 0);
      const unsigned int nBinsY = (pset.exists("NBinsY") ? pset.getParameter<unsigned int>("NBinsY") : 0);
      const double minY = (pset.exists("MinY") ? pset.getParameter<double>("MinY") : 0);
      const double maxY = (pset.exists("MaxY") ? pset.getParameter<double>("MaxY") : 0);
      if (nBins) {
        if (pDebugStream) {
          (*pDebugStream) << "\tHistogram: " << configName << "\tEnabled"
                          << "\tNBins: " << nBins << "\tMin: " << min << "\tMax: " << max;
          if (nBinsY) (*pDebugStream) << "\tNBinsY: " << nBinsY << "\tMinY: " << minY << "\tMaxY: " << maxY;
          (*pDebugStream) << std::endl;
        }
        if (nBinsY) {
          histogramConfig_[configName] = HistogramConfig(nBins,min,max,nBinsY,minY,maxY);
        } else {
          histogramConfig_[configName] = HistogramConfig(nBins,min,max);
        }
      }
    }
  }
}
void JPTJetAnalyzer::getConfigForTrackHistograms ( const std::string &  tag,
const edm::ParameterSet psetContainingConfigPSet,
std::ostringstream *  pDebugStream = NULL 
) [private]

Load the configs for histograms associated with a set of tracks.

Definition at line 348 of file JPTJetAnalyzer.cc.

References getConfigForHistogram().

Referenced by JPTJetAnalyzer().

{
  getConfigForHistogram("n"+tag+"TracksPerJet",psetContainingConfigPSet,pDebugStream);
  getConfigForHistogram(tag+"TrackPt",psetContainingConfigPSet,pDebugStream);
  getConfigForHistogram(tag+"TrackPhi",psetContainingConfigPSet,pDebugStream);
  getConfigForHistogram(tag+"TrackEta",psetContainingConfigPSet,pDebugStream);
  /*  getConfigForHistogram(tag+"TrackNHits",psetContainingConfigPSet,pDebugStream);
      getConfigForHistogram(tag+"TrackNLayers",psetContainingConfigPSet,pDebugStream);
      getConfigForHistogram(tag+"TrackNLayers",psetContainingConfigPSet,pDebugStream);     */
  getConfigForHistogram(tag+"TrackPtVsEta",psetContainingConfigPSet,pDebugStream);
  /*  getConfigForHistogram(tag+"TrackDz",psetContainingConfigPSet,pDebugStream);
  getConfigForHistogram(tag+"TrackDxy",psetContainingConfigPSet,pDebugStream); */
}

Member Data Documentation

Definition at line 185 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 184 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 183 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

const double JPTJetAnalyzer::correctedPtMin_ [private]

Definition at line 158 of file JPTJetAnalyzer.h.

Referenced by analyze().

DQMStore. Used to write out to file.

Definition at line 189 of file JPTJetAnalyzer.h.

Referenced by beginJob(), and endJob().

std::string JPTJetAnalyzer::dqmStoreFileName_ [private]

DQM store file name.

Definition at line 152 of file JPTJetAnalyzer.h.

Referenced by endJob(), and JPTJetAnalyzer().

const double JPTJetAnalyzer::fHPDMax_ [private]

Definition at line 156 of file JPTJetAnalyzer.h.

Referenced by analyze().

std::map<std::string,HistogramConfig> JPTJetAnalyzer::histogramConfig_ [private]

Histogram configuration (nBins etc)

Definition at line 147 of file JPTJetAnalyzer.h.

Referenced by book2DHistogram(), bookHistogram(), bookProfile(), and getConfigForHistogram().

const std::string JPTJetAnalyzer::histogramPath_ [private]

Path of directory used to store histograms in DQMStore.

Definition at line 143 of file JPTJetAnalyzer.h.

Referenced by beginJob(), and JPTJetAnalyzer().

Definition at line 185 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 184 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 183 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 185 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 184 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 183 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 176 of file JPTJetAnalyzer.h.

Referenced by bookHistograms().

Definition at line 177 of file JPTJetAnalyzer.h.

Referenced by bookHistograms().

Definition at line 172 of file JPTJetAnalyzer.h.

Definition at line 172 of file JPTJetAnalyzer.h.

Definition at line 168 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 168 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 172 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Helper object to calculate jet ID parameters.

Definition at line 165 of file JPTJetAnalyzer.h.

Referenced by analyze().

Definition at line 168 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 172 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 172 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 170 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 170 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 170 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 168 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 171 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 171 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 171 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

const char * JPTJetAnalyzer::messageLoggerCatregory = "JetPlusTrackDQM" [static, private]

String constant for message logger category.

Definition at line 139 of file JPTJetAnalyzer.h.

Referenced by analyze(), book2DHistogram(), bookHistogram(), bookProfile(), getConfigForHistogram(), and JPTJetAnalyzer().

const int JPTJetAnalyzer::n90HitsMin_ [private]

Jet ID cuts.

Definition at line 155 of file JPTJetAnalyzer.h.

Referenced by analyze().

Definition at line 178 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 178 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 178 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 185 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 184 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 183 of file JPTJetAnalyzer.h.

Referenced by analyze(), and bookHistograms().

Definition at line 176 of file JPTJetAnalyzer.h.

Referenced by bookHistograms().

Definition at line 177 of file JPTJetAnalyzer.h.

Referenced by bookHistograms().

const double JPTJetAnalyzer::resEMFMin_ [private]

Definition at line 157 of file JPTJetAnalyzer.h.

Referenced by analyze().

Helper object to calculate strip SoN for tracks.

Definition at line 163 of file JPTJetAnalyzer.h.

Referenced by analyze().

Helper object to propagate tracks to the calo surface.

Definition at line 161 of file JPTJetAnalyzer.h.

Referenced by analyze(), and fillTrackHistograms().

const bool JPTJetAnalyzer::verbose_ [private]

Create verbose debug messages.

Definition at line 145 of file JPTJetAnalyzer.h.

Referenced by JPTJetAnalyzer().

const bool JPTJetAnalyzer::writeDQMStore_ [private]

Write DQM store to a file?

Definition at line 150 of file JPTJetAnalyzer.h.

Referenced by endJob(), and JPTJetAnalyzer().