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 
18 #include <memory>
19 
20 
21 #include "GlobalVariables.h"
22 
23 
24 // forward declare classes which do not need to be defined for interface
25 class DQMStore;
26 namespace reco {
27  namespace helper {
28  class JetIDHelper;
29  }
30 }
31 namespace jptJetAnalysis {
34 }
35 namespace jpt {
36  class MatchedTracks;
37 }
39 class JetCorrector;
40 class TrackingRecHit;
41 class SiStripRecHit2D;
42 
43 
46  public:
49 
51  virtual ~JPTJetAnalyzer();
52 
54  void beginJob(DQMStore * dbe);
55 
57  void analyze(const edm::Event& event, const edm::EventSetup& eventSetup, const reco::JPTJet& jptJet, double& pt1, double& pt2, double& pt3, const int numPV);
58  void analyze(const edm::Event& event, const edm::EventSetup& eventSetup, const reco::JPTJetCollection& jptJets, const int numPV);
59 
61  virtual void endJob();
62 
63  private:
64 
65  // Helper classes
67  struct HistogramConfig {
68  bool enabled;
69  unsigned int nBins;
70  double min;
71  double max;
72  unsigned int nBinsY;
73  double minY;
74  double maxY;
76  HistogramConfig(const unsigned int theNBins, const double theMin, const double theMax);
77  HistogramConfig(const unsigned int theNBinsX, const double theMinX, const double theMaxX,
78  const unsigned int theNBinsY, const double theMinY, const double theMaxY);
79  };
81  struct TrackHistograms {
86  /* MonitorElement* nHitsHisto;
87  MonitorElement* nLayersHisto; */
89  /* MonitorElement* dzHisto;
90  MonitorElement* dxyHisto; */
94  TrackHistograms(MonitorElement* theNTracksHisto, MonitorElement* thePtHisto, MonitorElement* thePhiHisto, MonitorElement* theEtaHisto,
95  /* MonitorElement* theNHitsHisto, MonitorElement* theNLayersHisto, */
96 MonitorElement* thePtVsEtaHisto,
97  /* MonitorElement* dzHisto, MonitorElement* dxyHisto, */
98 MonitorElement* theTrackDirectionJetDRHisto, MonitorElement* theTrackImpactPointJetDRHisto);
99  };
100 
101  // Private methods
103  void getConfigForHistogram(const std::string& configName, const edm::ParameterSet& psetContainingConfigPSet, std::ostringstream* pDebugStream = NULL);
105  void getConfigForTrackHistograms(const std::string& tag, const edm::ParameterSet& psetContainingConfigPSet,std::ostringstream* pDebugStream = NULL);
107  MonitorElement* bookHistogram(const std::string& name, const std::string& title, const std::string& xAxisTitle, DQMStore* dqm);
108  MonitorElement* book2DHistogram(const std::string& name, const std::string& title, const std::string& xAxisTitle, const std::string& yAxisTitle, DQMStore* dqm);
109  MonitorElement* bookProfile(const std::string& name, const std::string& title, const std::string& xAxisTitle, const std::string& yAxisTitle, DQMStore* dqm);
111  void bookHistograms(DQMStore* dqm);
113  void bookTrackHistograms(TrackHistograms* histos, const std::string& tag, const std::string& titleTag,
114  MonitorElement* trackDirectionJetDRHisto, MonitorElement* trackImpactPointJetDRHisto, DQMStore* dqm);
116  void fillHistogram(MonitorElement* histogram, const double value);
117  void fillHistogram(MonitorElement* histogram, const double valueX, const double valueY);
119  void fillTrackHistograms(TrackHistograms& allTracksHistos, TrackHistograms& inCaloInVertexHistos,
120  TrackHistograms& inCaloOutVertexHistos, TrackHistograms& outCaloInVertexHistos,
121  const reco::TrackRefVector& inVertexInCalo,
122  const reco::TrackRefVector& outVertexInCalo,
123  const reco::TrackRefVector& inVertexOutCalo,
124  const reco::Jet& rawJet);
128  void fillSiStripHitSoN(const TrackingRecHit& hit);
129 
130  // J.Piedra, 2012/09/24
131  // void fillSiStripHitSoNForSingleHit(const SiStripRecHit2D& hit);
132 
134  static double findPtFractionInCone(const reco::TrackRefVector& inConeTracks, const reco::TrackRefVector& outOfConeTracks);
135 
137  static const char* messageLoggerCatregory;
138 
139  // Config
143  const bool verbose_;
145  std::map<std::string,HistogramConfig> histogramConfig_;
146 
148  const bool writeDQMStore_;
151 
153  const int n90HitsMin_;
154  const double fHPDMax_;
155  const double resEMFMin_;
156  const double correctedPtMin_;
157 
159  std::auto_ptr<jptJetAnalysis::TrackPropagatorToCalo> trackPropagator_;
161  std::auto_ptr<jptJetAnalysis::StripSignalOverNoiseCalculator> sOverNCalculator_;
163  std::auto_ptr<reco::helper::JetIDHelper> jetID_;
164 
165  // Histograms
167  /* MonitorElement *JetMass_ */
171  /* MonitorElement *JetN90Hits_
172  MonitorElement *JetfHPD_, *JetResEMF_, *JetfRBX_;
173  MonitorElement *TrackSiStripHitStoNHisto_; */
177  /* MonitorElement *PtFractionInConeHisto_, *PtFractionInConeVsJetRawEtHisto_, *PtFractionInConeVsJetEtaHisto_;
178  MonitorElement *CorrFactorHisto_, *CorrFactorVsJetEtHisto_, *CorrFactorVsJetEtaHisto_;
179  MonitorElement *ZSPCorrFactorHisto_, *ZSPCorrFactorVsJetEtHisto_, *ZSPCorrFactorVsJetEtaHisto_;
180  MonitorElement *JPTCorrFactorHisto_, *JPTCorrFactorVsJetEtHisto_, *JPTCorrFactorVsJetEtaHisto_; */
184 
185 
188 };
189 
190 inline void JPTJetAnalyzer::fillHistogram(MonitorElement* histogram, const double value)
191 {
192  if (histogram) histogram->Fill(value);
193 }
194 
195 inline void JPTJetAnalyzer::fillHistogram(MonitorElement* histogram, const double valueX, const double valueY)
196 {
197  if (histogram) histogram->Fill(valueX,valueY);
198 }
199 
200 #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:20
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.