CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JPTJetAnalyzer.h
Go to the documentation of this file.
1 #ifndef JPTJetAnalyzer_H
2 #define JPTJetAnalyzer_H
3 
20 #include <memory>
21 
22 
23 #include "GlobalVariables.h"
24 
25 
26 // forward declare classes which do not need to be defined for interface
27 class DQMStore;
28 namespace reco {
29  namespace helper {
30  class JetIDHelper;
31  }
32 }
33 namespace jptJetAnalysis {
36 }
37 namespace jpt {
38  class MatchedTracks;
39 }
41 class JetCorrector;
42 class TrackingRecHit;
43 class SiStripRecHit2D;
44 
45 
48  public:
51 
53  virtual ~JPTJetAnalyzer();
54 
56  void beginJob(DQMStore * dbe);
57 
59  void analyze(const edm::Event& event, const edm::EventSetup& eventSetup, const reco::JPTJet& jptJet, double& pt1, double& pt2, double& pt3, const int numPV);
60  void analyze(const edm::Event& event, const edm::EventSetup& eventSetup, const reco::JPTJetCollection& jptJets, const int numPV);
61 
63  virtual void endJob();
64 
65  private:
66 
67  // Helper classes
69  struct HistogramConfig {
70  bool enabled;
71  unsigned int nBins;
72  double min;
73  double max;
74  unsigned int nBinsY;
75  double minY;
76  double maxY;
78  HistogramConfig(const unsigned int theNBins, const double theMin, const double theMax);
79  HistogramConfig(const unsigned int theNBinsX, const double theMinX, const double theMaxX,
80  const unsigned int theNBinsY, const double theMinY, const double theMaxY);
81  };
83  struct TrackHistograms {
88  /* MonitorElement* nHitsHisto;
89  MonitorElement* nLayersHisto; */
91  /* MonitorElement* dzHisto;
92  MonitorElement* dxyHisto; */
96  TrackHistograms(MonitorElement* theNTracksHisto, MonitorElement* thePtHisto, MonitorElement* thePhiHisto, MonitorElement* theEtaHisto,
97  /* MonitorElement* theNHitsHisto, MonitorElement* theNLayersHisto, */
98 MonitorElement* thePtVsEtaHisto,
99  /* MonitorElement* dzHisto, MonitorElement* dxyHisto, */
100 MonitorElement* theTrackDirectionJetDRHisto, MonitorElement* theTrackImpactPointJetDRHisto);
101  };
102 
103  // Private methods
105  void getConfigForHistogram(const std::string& configName, const edm::ParameterSet& psetContainingConfigPSet, std::ostringstream* pDebugStream = NULL);
107  void getConfigForTrackHistograms(const std::string& tag, const edm::ParameterSet& psetContainingConfigPSet,std::ostringstream* pDebugStream = NULL);
109  MonitorElement* bookHistogram(const std::string& name, const std::string& title, const std::string& xAxisTitle, DQMStore* dqm);
110  MonitorElement* book2DHistogram(const std::string& name, const std::string& title, const std::string& xAxisTitle, const std::string& yAxisTitle, DQMStore* dqm);
111  MonitorElement* bookProfile(const std::string& name, const std::string& title, const std::string& xAxisTitle, const std::string& yAxisTitle, DQMStore* dqm);
113  void bookHistograms(DQMStore* dqm);
115  void bookTrackHistograms(TrackHistograms* histos, const std::string& tag, const std::string& titleTag,
116  MonitorElement* trackDirectionJetDRHisto, MonitorElement* trackImpactPointJetDRHisto, DQMStore* dqm);
118  void fillHistogram(MonitorElement* histogram, const double value);
119  void fillHistogram(MonitorElement* histogram, const double valueX, const double valueY);
121  void fillTrackHistograms(TrackHistograms& allTracksHistos, TrackHistograms& inCaloInVertexHistos,
122  TrackHistograms& inCaloOutVertexHistos, TrackHistograms& outCaloInVertexHistos,
123  const reco::TrackRefVector& inVertexInCalo,
124  const reco::TrackRefVector& outVertexInCalo,
125  const reco::TrackRefVector& inVertexOutCalo,
126  const reco::Jet& rawJet);
130  void fillSiStripHitSoN(const TrackingRecHit& hit);
131 
132  // J.Piedra, 2012/09/24
133  // void fillSiStripHitSoNForSingleHit(const SiStripRecHit2D& hit);
134 
136  static double findPtFractionInCone(const reco::TrackRefVector& inConeTracks, const reco::TrackRefVector& outOfConeTracks);
137 
139  static const char* messageLoggerCatregory;
140 
141  // Config
143  const std::string histogramPath_;
145  const bool verbose_;
147  std::map<std::string,HistogramConfig> histogramConfig_;
148 
150  const bool writeDQMStore_;
152  std::string dqmStoreFileName_;
153 
155  const int n90HitsMin_;
156  const double fHPDMax_;
157  const double resEMFMin_;
158  const double correctedPtMin_;
159 
161  std::auto_ptr<jptJetAnalysis::TrackPropagatorToCalo> trackPropagator_;
163  std::auto_ptr<jptJetAnalysis::StripSignalOverNoiseCalculator> sOverNCalculator_;
165  std::auto_ptr<reco::helper::JetIDHelper> jetID_;
166 
167  // Histograms
169  /* MonitorElement *JetMass_ */
173  /* MonitorElement *JetN90Hits_
174  MonitorElement *JetfHPD_, *JetResEMF_, *JetfRBX_;
175  MonitorElement *TrackSiStripHitStoNHisto_; */
179  /* MonitorElement *PtFractionInConeHisto_, *PtFractionInConeVsJetRawEtHisto_, *PtFractionInConeVsJetEtaHisto_;
180  MonitorElement *CorrFactorHisto_, *CorrFactorVsJetEtHisto_, *CorrFactorVsJetEtaHisto_;
181  MonitorElement *ZSPCorrFactorHisto_, *ZSPCorrFactorVsJetEtHisto_, *ZSPCorrFactorVsJetEtaHisto_;
182  MonitorElement *JPTCorrFactorHisto_, *JPTCorrFactorVsJetEtHisto_, *JPTCorrFactorVsJetEtaHisto_; */
186 
187 
190 };
191 
192 inline void JPTJetAnalyzer::fillHistogram(MonitorElement* histogram, const double value)
193 {
194  if (histogram) histogram->Fill(value);
195 }
196 
197 inline void JPTJetAnalyzer::fillHistogram(MonitorElement* histogram, const double valueX, const double valueY)
198 {
199  if (histogram) histogram->Fill(valueX,valueY);
200 }
201 
202 #endif
MonitorElement * JetPt_
MonitorElement * NTracksPerJetHisto_
virtual ~JPTJetAnalyzer()
Destructor.
DQMStore * dqm_
DQMStore. Used to write out to file.
MonitorElement * JetPt1_
Helper class for grouping histograms belowing to a set of tracks.
MonitorElement * NTracksPerJetVsJetEtHisto_
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.
TrackHistograms inCaloInVertexPionHistograms_
std::vector< JPTJet > JPTJetCollection
collection of CaloJet objects
Helper class to hold the configuration for a histogram.
Base class for all types of Jets.
Definition: Jet.h:21
TrackHistograms allElectronHistograms_
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.
std::auto_ptr< jptJetAnalysis::StripSignalOverNoiseCalculator > sOverNCalculator_
Helper object to calculate strip SoN for tracks.
MonitorElement * JetEta_
TrackHistograms inCaloOutVertexMuonHistograms_
#define NULL
Definition: scimark2.h:8
const bool verbose_
Create verbose debug messages.
TrackHistograms outCaloInVertexMuonHistograms_
MonitorElement * InVertexTrackImpactPointJetDRHisto_
std::auto_ptr< reco::helper::JetIDHelper > jetID_
Helper object to calculate jet ID parameters.
TrackHistograms inCaloInVertexMuonHistograms_
MonitorElement * JetDeltaPhi_
void fillSiStripHitSoN(const TrackingRecHit &hit)
MonitorElement * InCaloTrackDirectionJetDRHisto_
void Fill(long long x)
JPTJetAnalyzer(const edm::ParameterSet &config)
Constructor.
void bookTrackHistograms(TrackHistograms *histos, const std::string &tag, const std::string &titleTag, MonitorElement *trackDirectionJetDRHisto, MonitorElement *trackImpactPointJetDRHisto, DQMStore *dqm)
Book the histograms for a track.
TrackHistograms inCaloOutVertexElectronHistograms_
static const char * messageLoggerCatregory
String constant for message logger category.
void getConfigForHistogram(const std::string &configName, const edm::ParameterSet &psetContainingConfigPSet, std::ostringstream *pDebugStream=NULL)
Load the config for a hitogram.
MonitorElement * bookProfile(const std::string &name, const std::string &title, const std::string &xAxisTitle, const std::string &yAxisTitle, DQMStore *dqm)
MonitorElement * book2DHistogram(const std::string &name, const std::string &title, const std::string &xAxisTitle, const std::string &yAxisTitle, DQMStore *dqm)
MonitorElement * JetPz_
Jets made from CaloJets corrected for ZSP and tracks.
Definition: JPTJet.h:29
void bookHistograms(DQMStore *dqm)
Book all histograms.
void fillHistogram(MonitorElement *histogram, const double value)
Fill histogram or profile if it has been booked.
std::auto_ptr< jptJetAnalysis::TrackPropagatorToCalo > trackPropagator_
Helper object to propagate tracks to the calo surface.
MonitorElement * OutCaloTrackDirectionJetDRHisto_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::map< std::string, HistogramConfig > histogramConfig_
Histogram configuration (nBins etc)
MonitorElement * JetPhi_
const double resEMFMin_
MonitorElement * JetP_
MonitorElement * JetEt_
TrackHistograms outCaloInVertexPionHistograms_
MonitorElement * JetE_
MonitorElement * JetPt3_
MonitorElement * JetPhiVsEta_
TrackHistograms outCaloInVertexElectronHistograms_
const double fHPDMax_
virtual void endJob()
Finish up a job.
tuple tracks
Definition: testEve_cfg.py:39
MonitorElement * trackImpactPointJetDRHisto
TrackHistograms allMuonHistograms_
const double correctedPtMin_
TrackHistograms inCaloInVertexElectronHistograms_
MonitorElement * NTracksPerJetVsJetEtaHisto_
TrackHistograms allPionHistograms_
Particles matched to tracks that are in/in, in/out, out/in at Vertex and CaloFace.
Jet energy correction algorithm using tracks.
MonitorElement * JetPy_
TrackHistograms inCaloOutVertexPionHistograms_
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 double findPtFractionInCone(const reco::TrackRefVector &inConeTracks, const reco::TrackRefVector &outOfConeTracks)
Utility function to calculate the fraction of track Pt in cone.
JPT jet analyzer class definition.
MonitorElement * bookHistogram(const std::string &name, const std::string &title, const std::string &xAxisTitle, DQMStore *dqm)
Book histograms and profiles.
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
MonitorElement * JetDeltaEta_
MonitorElement * JetPt2_
MonitorElement * trackDirectionJetDRHisto
std::string dqmStoreFileName_
DQM store file name.
const std::string histogramPath_
Path of directory used to store histograms in DQMStore.
MonitorElement * JetPx_
const int n90HitsMin_
Jet ID cuts.
MonitorElement * OutVertexTrackImpactPointJetDRHisto_
const bool writeDQMStore_
Write DQM store to a file?
void fillSiStripSoNForTracks(const reco::TrackRefVector &tracks)
Fill the SoN hisotgram for hits on tracks.