CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JPTJetAnalyzer.cc
Go to the documentation of this file.
33 #include <cmath>
34 #include <string>
35 #include <memory>
36 #include <vector>
37 
38 namespace jptJetAnalysis {
39 
40  // Helpper class to propagate tracks to the calo surface using the same implementation as the JetTrackAssociator
42  {
43  public:
45  void update(const edm::EventSetup& eventSetup);
47  private:
52  };
53 
54  // Helpper class to calculate strip signal to noise and manage the necessary ES objects
56  {
57  public:
58  StripSignalOverNoiseCalculator(const std::string& theQualityLabel = std::string(""));
59  void update(const edm::EventSetup& eventSetup);
60  double signalOverNoise(const SiStripCluster& cluster) const;
61  double operator () (const SiStripCluster& cluster) const
62  { return signalOverNoise(cluster); }
63  private:
64  const std::string qualityLabel_;
68  uint32_t qualityCacheId_;
69  uint32_t noiseCacheId_;
70  uint32_t gainCacheId_;
71  };
72 
73 }
74 
75 const char* JPTJetAnalyzer::messageLoggerCatregory = "JetPlusTrackDQM";
76 
78  : histogramPath_(config.getParameter<std::string>("HistogramPath")),
79  verbose_(config.getUntrackedParameter<bool>("PrintDebugMessages",false)),
80  writeDQMStore_(config.getUntrackedParameter<bool>("WriteDQMStore")),
81  dqmStoreFileName_(),
82  n90HitsMin_(config.getParameter<int>("n90HitsMin")),
83  fHPDMax_(config.getParameter<double>("fHPDMax")),
84  resEMFMin_(config.getParameter<double>("resEMFMin")),
85  correctedPtMin_(config.getParameter<double>("correctedPtThreshold")),
86  trackPropagator_(new jptJetAnalysis::TrackPropagatorToCalo),
87  sOverNCalculator_(new jptJetAnalysis::StripSignalOverNoiseCalculator),
88  jetID_(new reco::helper::JetIDHelper(config.getParameter<edm::ParameterSet>("JetIDParams")))
89 {
90  //print config to debug log
91  std::ostringstream debugStream;
92  if (verbose_) {
93  debugStream << "Configuration for JPTJetAnalyzer: " << std::endl
94  << "\tHistogramPath: " << histogramPath_ << std::endl
95  << "\tPrintDebugMessages? " << (verbose_ ? "yes" : "no") << std::endl;
96  }
97  if (writeDQMStore_) {
98  dqmStoreFileName_ = config.getUntrackedParameter<std::string>("DQMStoreFileName");
99  }
100 
101  //don't generate debug mesages if debug is disabled
102  std::ostringstream* pDebugStream = (verbose_ ? &debugStream : NULL);
103 
104  //get histogram configuration
105  getConfigForHistogram("E",config,pDebugStream);
106  getConfigForHistogram("Et",config,pDebugStream);
107  getConfigForHistogram("P",config,pDebugStream);
108  getConfigForHistogram("Mass",config,pDebugStream);
109  getConfigForHistogram("Pt",config,pDebugStream);
110  getConfigForHistogram("Pt1",config,pDebugStream);
111  getConfigForHistogram("Pt2",config,pDebugStream);
112  getConfigForHistogram("Pt3",config,pDebugStream);
113  getConfigForHistogram("Px",config,pDebugStream);
114  getConfigForHistogram("Py",config,pDebugStream);
115  getConfigForHistogram("Pz",config,pDebugStream);
116  getConfigForHistogram("Eta",config,pDebugStream);
117  getConfigForHistogram("Phi",config,pDebugStream);
118  getConfigForHistogram("deltaEta",config,pDebugStream);
119  getConfigForHistogram("deltaPhi",config,pDebugStream);
120  getConfigForHistogram("PhiVsEta",config,pDebugStream);
121  getConfigForHistogram("N90Hits",config,pDebugStream);
122  getConfigForHistogram("fHPD",config,pDebugStream);
123  getConfigForHistogram("ResEMF",config,pDebugStream);
124  getConfigForHistogram("fRBX",config,pDebugStream);
125  getConfigForHistogram("TrackSiStripHitStoN",config,pDebugStream);
126  getConfigForHistogram("InCaloTrackDirectionJetDR",config,pDebugStream);
127  getConfigForHistogram("OutCaloTrackDirectionJetDR",config,pDebugStream);
128  getConfigForHistogram("InVertexTrackImpactPointJetDR",config,pDebugStream);
129  getConfigForHistogram("OutVertexTrackImpactPointJetDR",config,pDebugStream);
130  getConfigForHistogram("PtFractionInCone",config,pDebugStream);
131  getConfigForHistogram("PtFractionInConeVsJetRawEt",config,pDebugStream);
132  getConfigForHistogram("PtFractionInConeVsJetEta",config,pDebugStream);
133  getConfigForHistogram("nTracks",config,pDebugStream);
134  getConfigForHistogram("nTracksVsJetEt",config,pDebugStream);
135  getConfigForHistogram("nTracksVsJetEta",config,pDebugStream);
136  getConfigForHistogram("CorrFactor",config,pDebugStream);
137  getConfigForHistogram("CorrFactorVsJetEt",config,pDebugStream);
138  getConfigForHistogram("CorrFactorVsJetEta",config,pDebugStream);
139  getConfigForHistogram("ZSPCorrFactor",config,pDebugStream);
140  getConfigForHistogram("ZSPCorrFactorVsJetEt",config,pDebugStream);
141  getConfigForHistogram("ZSPCorrFactorVsJetEta",config,pDebugStream);
142  getConfigForHistogram("JPTCorrFactor",config,pDebugStream);
143  getConfigForHistogram("JPTCorrFactorVsJetEt",config,pDebugStream);
144  getConfigForHistogram("JPTCorrFactorVsJetEta",config,pDebugStream);
145  getConfigForTrackHistograms("AllPions",config,pDebugStream);
146  getConfigForTrackHistograms("InCaloInVertexPions",config,pDebugStream);
147  getConfigForTrackHistograms("InCaloOutVertexPions",config,pDebugStream);
148  getConfigForTrackHistograms("OutCaloInVertexPions",config,pDebugStream);
149  getConfigForTrackHistograms("AllMuons",config,pDebugStream);
150  getConfigForTrackHistograms("InCaloInVertexMuons",config,pDebugStream);
151  getConfigForTrackHistograms("InCaloOutVertexMuons",config,pDebugStream);
152  getConfigForTrackHistograms("OutCaloInVertexMuons",config,pDebugStream);
153  getConfigForTrackHistograms("AllElectrons",config,pDebugStream);
154  getConfigForTrackHistograms("InCaloInVertexElectrons",config,pDebugStream);
155  getConfigForTrackHistograms("InCaloOutVertexElectrons",config,pDebugStream);
156  getConfigForTrackHistograms("OutCaloInVertexElectrons",config,pDebugStream);
157 
158  if (verbose_) LogTrace(messageLoggerCatregory) << debugStream.str();
159 }
160 
162 {}
163 
165 {
166  dqm_ = dqmStore;
167  //book histograms
168  dqmStore->setCurrentFolder(histogramPath_);
169  bookHistograms(dqmStore);
170 }
171 
172 
173 void JPTJetAnalyzer::analyze(const edm::Event& event, const edm::EventSetup& eventSetup, const reco::JPTJetCollection& jptJets)
174 {
175  double pt1 = 0;
176  double pt2 = 0;
177  double pt3 = 0;
178  for (reco::JPTJetCollection::const_iterator iJet = jptJets.begin(); iJet != jptJets.end(); ++iJet) {
179  analyze(event,eventSetup,*iJet,pt1,pt2,pt3);
180  }
181  if (pt1) fillHistogram(JetPt1_,pt1);
182  if (pt2) fillHistogram(JetPt2_,pt2);
183  if (pt3) fillHistogram(JetPt3_,pt3);
184 }
185 
186 void JPTJetAnalyzer::analyze(const edm::Event& event, const edm::EventSetup& eventSetup, const reco::JPTJet& jptJet, double& pt1, double& pt2, double& pt3)
187 {
188 
189  //update the track propagator and strip noise calculator
190  trackPropagator_->update(eventSetup);
191  sOverNCalculator_->update(eventSetup);
192 
193  //make corrected jets
194  const double factorZSP = jptJet.getZSPCor();
195  const reco::Jet& rawJet = *jptJet.getCaloJetRef();
196  const double factorZSPJPT = jptJet.energy()/rawJet.energy();
197 
198  //check jet is correctable by JPT
199  if ( fabs(rawJet.eta()) > 2.1) return;
200 
201  //get consitiuents of jet
202  const reco::TrackRefVector& pionsInVertexInCalo = jptJet.getPionsInVertexInCalo();
203  const reco::TrackRefVector& pionsInVertexOutCalo = jptJet.getPionsInVertexOutCalo();
204  const reco::TrackRefVector& pionsOutVertexInCalo = jptJet.getPionsOutVertexInCalo();
205  const reco::TrackRefVector& muonsInVertexInCalo = jptJet.getMuonsInVertexInCalo();
206  const reco::TrackRefVector& muonsInVertexOutCalo = jptJet.getMuonsInVertexOutCalo();
207  const reco::TrackRefVector& muonsOutVertexInCalo = jptJet.getMuonsOutVertexInCalo();
208  const reco::TrackRefVector& electronsInVertexInCalo = jptJet.getElecsInVertexInCalo();
209  const reco::TrackRefVector& electronsInVertexOutCalo = jptJet.getElecsInVertexOutCalo();
210  const reco::TrackRefVector& electronsOutVertexInCalo = jptJet.getElecsOutVertexInCalo();
211 
212  //check pt against highest values
213  const double pt = jptJet.pt();
214  if (pt > pt1) {
215  pt3 = pt2;
216  pt2 = pt1;
217  pt1 = pt;
218  } else if (pt > pt2) {
219  pt3 = pt2;
220  pt2 = pt;
221  } else if (pt > pt3) {
222  pt3 = pt;
223  }
224 
225  //fill histograms
226  try {
227  const reco::CaloJet& rawCaloJet = dynamic_cast<const reco::CaloJet&>(rawJet);
228  jetID_->calculate(event,rawCaloJet);
229  } catch (const std::bad_cast&) {
230  edm::LogError(messageLoggerCatregory) << "Failed to cast raw jet to CaloJet. JPT Jet does not appear to have been built from a CaloJet. "
231  << "Histograms not filled. ";
232  return;
233  }
234  const bool idPassed = ( (jetID_->n90Hits() >= n90HitsMin_) && (jetID_->fHPD() < fHPDMax_) && (jetID_->restrictedEMF() >= resEMFMin_) );
235  fillHistogram(JetN90Hits_,jetID_->n90Hits());
236  fillHistogram(JetfHPD_,jetID_->fHPD());
237  fillHistogram(JetResEMF_,jetID_->restrictedEMF());
238  fillHistogram(JetfRBX_,jetID_->fRBX());
239  if (idPassed) {
240  const double deltaEta = jptJet.eta() - rawJet.eta();
241  const double deltaPhi = jptJet.phi() - rawJet.phi();
242  if (jptJet.pt() > correctedPtMin_) {
243  fillHistogram(JetE_,jptJet.energy());
244  fillHistogram(JetEt_,jptJet.et());
245  fillHistogram(JetP_,jptJet.p());
246  fillHistogram(JetMass_,jptJet.mass());
247  fillHistogram(JetPt_,jptJet.pt());
248  fillHistogram(JetPx_,jptJet.px());
249  fillHistogram(JetPy_,jptJet.py());
250  fillHistogram(JetPz_,jptJet.pz());
251 
252  fillHistogram(JetEta_,jptJet.eta());
253  fillHistogram(JetPhi_,jptJet.phi());
254  fillHistogram(JetDeltaEta_,deltaEta);
255  fillHistogram(JetDeltaPhi_,deltaPhi);
256  fillHistogram(JetPhiVsEta_,jptJet.phi(),jptJet.eta());
257  const uint16_t totalTracks = jptJet.chargedMultiplicity();
258  fillHistogram(NTracksPerJetHisto_,totalTracks);
259  fillHistogram(NTracksPerJetVsJetEtHisto_,rawJet.et(),totalTracks);
260  fillHistogram(NTracksPerJetVsJetEtaHisto_,rawJet.eta(),totalTracks);
261  fillHistogram(CorrFactorHisto_,factorZSPJPT);
262  fillHistogram(CorrFactorVsJetEtHisto_,rawJet.et(),factorZSPJPT);
263  fillHistogram(CorrFactorVsJetEtaHisto_,rawJet.eta(),factorZSPJPT);
265  fillHistogram(ZSPCorrFactorVsJetEtHisto_,rawJet.et(),factorZSP);
266  fillHistogram(ZSPCorrFactorVsJetEtaHisto_,rawJet.eta(),factorZSP);
267  const double factorJPT = factorZSPJPT / factorZSP;
269  fillHistogram(JPTCorrFactorVsJetEtHisto_,rawJet.et(),factorJPT);
270  fillHistogram(JPTCorrFactorVsJetEtaHisto_,rawJet.eta(),factorJPT);
271  const double ptFractionInCone = findPtFractionInCone(pionsInVertexInCalo,pionsInVertexOutCalo);
272  fillHistogram(PtFractionInConeHisto_,ptFractionInCone);
273  fillHistogram(PtFractionInConeVsJetRawEtHisto_,rawJet.et(),ptFractionInCone);
274  fillHistogram(PtFractionInConeVsJetEtaHisto_,rawJet.eta(),ptFractionInCone);
275  //fill track level histograms
277  pionsInVertexInCalo,pionsOutVertexInCalo,pionsInVertexOutCalo,rawJet);
279  muonsInVertexInCalo,muonsOutVertexInCalo,muonsInVertexOutCalo,rawJet);
281  electronsInVertexInCalo,electronsOutVertexInCalo,electronsInVertexOutCalo,rawJet);
282  }
283  }
284 }
285 
287 {
289 }
290 
291 void JPTJetAnalyzer::getConfigForHistogram(const std::string& configName, const edm::ParameterSet& psetContainingConfigPSet,
292  std::ostringstream* pDebugStream)
293 {
294  const std::string psetName = configName+std::string("HistogramConfig");
295  if (!psetContainingConfigPSet.exists(psetName)) {
296  edm::LogWarning(messageLoggerCatregory) << "Histogram " << configName << " config not found" << std::endl;
297  histogramConfig_[configName] = HistogramConfig();
298  } else {
299  if (pDebugStream) {
300  (*pDebugStream) << "Histogram " << configName << " config found and loaded" << std::endl;
301  }
302  const edm::ParameterSet& pset = psetContainingConfigPSet.getParameter<edm::ParameterSet>(psetName);
303  const bool enabled = (pset.exists("Enabled") ? pset.getParameter<bool>("Enabled") : true);
304  if (!enabled) {
305  histogramConfig_[configName] = HistogramConfig();
306  if (pDebugStream) {
307  (*pDebugStream) << "\tHistogram: " << configName << " Disabled" << std::endl;
308  }
309  } else {
310  const unsigned int nBins = (pset.exists("NBins") ? pset.getParameter<unsigned int>("NBins") : 0);
311  const double min = (pset.exists("Min") ? pset.getParameter<double>("Min") : 0);
312  const double max = (pset.exists("Max") ? pset.getParameter<double>("Max") : 0);
313  const unsigned int nBinsY = (pset.exists("NBinsY") ? pset.getParameter<unsigned int>("NBinsY") : 0);
314  const double minY = (pset.exists("MinY") ? pset.getParameter<double>("MinY") : 0);
315  const double maxY = (pset.exists("MaxY") ? pset.getParameter<double>("MaxY") : 0);
316  if (nBins) {
317  if (pDebugStream) {
318  (*pDebugStream) << "\tHistogram: " << configName << "\tEnabled"
319  << "\tNBins: " << nBins << "\tMin: " << min << "\tMax: " << max;
320  if (nBinsY) (*pDebugStream) << "\tNBinsY: " << nBinsY << "\tMinY: " << minY << "\tMaxY: " << maxY;
321  (*pDebugStream) << std::endl;
322  }
323  if (nBinsY) {
324  histogramConfig_[configName] = HistogramConfig(nBins,min,max,nBinsY,minY,maxY);
325  } else {
326  histogramConfig_[configName] = HistogramConfig(nBins,min,max);
327  }
328  }
329  }
330  }
331 }
332 
333 void JPTJetAnalyzer::getConfigForTrackHistograms(const std::string& tag, const edm::ParameterSet& psetContainingConfigPSet,
334  std::ostringstream* pDebugStream)
335 {
336  getConfigForHistogram("n"+tag+"TracksPerJet",psetContainingConfigPSet,pDebugStream);
337  getConfigForHistogram(tag+"TrackPt",psetContainingConfigPSet,pDebugStream);
338  getConfigForHistogram(tag+"TrackPhi",psetContainingConfigPSet,pDebugStream);
339  getConfigForHistogram(tag+"TrackEta",psetContainingConfigPSet,pDebugStream);
340  getConfigForHistogram(tag+"TrackNHits",psetContainingConfigPSet,pDebugStream);
341  getConfigForHistogram(tag+"TrackNLayers",psetContainingConfigPSet,pDebugStream);
342  getConfigForHistogram(tag+"TrackNLayers",psetContainingConfigPSet,pDebugStream);
343  getConfigForHistogram(tag+"TrackPtVsEta",psetContainingConfigPSet,pDebugStream);
344  getConfigForHistogram(tag+"TrackDz",psetContainingConfigPSet,pDebugStream);
345  getConfigForHistogram(tag+"TrackDxy",psetContainingConfigPSet,pDebugStream);
346 }
347 
348 MonitorElement* JPTJetAnalyzer::bookHistogram(const std::string& name, const std::string& title, const std::string& xAxisTitle, DQMStore* dqm)
349 {
350  std::map<std::string,HistogramConfig>::const_iterator configIterator = histogramConfig_.find(name);
351  if (configIterator == histogramConfig_.end()) {
352  edm::LogWarning(messageLoggerCatregory) << "Trying to book histogram with name " << name << " when no config was not retrieved from ParameterSet";
353  return NULL;
354  }
355  const HistogramConfig& histoConfig = (*configIterator).second;
356  if (histoConfig.enabled) {
357  MonitorElement* histo = dqm->book1D(name,title,histoConfig.nBins,histoConfig.min,histoConfig.max);
358  histo->setAxisTitle(xAxisTitle,1);
359  return histo;
360  } else {
361  return NULL;
362  }
363 }
364 
365 MonitorElement* JPTJetAnalyzer::book2DHistogram(const std::string& name, const std::string& title,
366  const std::string& xAxisTitle, const std::string& yAxisTitle, DQMStore* dqm)
367 {
368  std::map<std::string,HistogramConfig>::const_iterator configIterator = histogramConfig_.find(name);
369  if (configIterator == histogramConfig_.end()) {
370  edm::LogWarning(messageLoggerCatregory) << "Trying to book histogram with name " << name << " when no config was not retrieved from ParameterSet";
371  return NULL;
372  }
373  const HistogramConfig& histoConfig = (*configIterator).second;
374  if (histoConfig.enabled) {
375  MonitorElement* histo = dqm->book2D(name,title,histoConfig.nBins,histoConfig.min,histoConfig.max,histoConfig.nBinsY,histoConfig.minY,histoConfig.maxY);
376  histo->setAxisTitle(xAxisTitle,1);
377  histo->setAxisTitle(yAxisTitle,2);
378  return histo;
379  } else {
380  return NULL;
381  }
382 }
383 
384 MonitorElement* JPTJetAnalyzer::bookProfile(const std::string& name, const std::string& title,
385  const std::string& xAxisTitle, const std::string& yAxisTitle, DQMStore* dqm)
386 {
387  std::map<std::string,HistogramConfig>::const_iterator configIterator = histogramConfig_.find(name);
388  if (configIterator == histogramConfig_.end()) {
389  edm::LogWarning(messageLoggerCatregory) << "Trying to book histogram with name " << name << " when no config was not retrieved from ParameterSet";
390  return NULL;
391  }
392  const HistogramConfig& histoConfig = (*configIterator).second;
393  if (histoConfig.enabled) {
394  TProfile* underlyingRootObject = new TProfile(name.c_str(),title.c_str(),histoConfig.nBins,histoConfig.min,histoConfig.max);
395  MonitorElement* histo = dqm->bookProfile(name,underlyingRootObject);
396  histo->setAxisTitle(xAxisTitle,1);
397  histo->setAxisTitle(yAxisTitle,2);
398  return histo;
399  } else {
400  return NULL;
401  }
402 }
403 
405 {
406  JetE_ = bookHistogram("E","Corrected Jet Energy","E /GeV",dqm);
407  JetEt_ = bookHistogram("Et","Corrected Jet E_{T}","E_{T} /GeV",dqm);
408  JetP_ = bookHistogram("P","Corrected Jet Momentum","p /GeV/c",dqm);
409  JetMass_ = bookHistogram("Mass","Jet mass","Mass /GeV/c^{2}",dqm);
410  JetPt_ = bookHistogram("Pt","Jet p_{T}","p_{T} /GeV/c",dqm);
411  JetPt1_ = bookHistogram("Pt1","1st Jet p_{T}","p_{T} /GeV/c",dqm);
412  JetPt2_ = bookHistogram("Pt2","2nd Jet p_{T}","p_{T} /GeV/c",dqm);
413  JetPt3_ = bookHistogram("Pt3","3rd Jet p_{T}","p_{T} /GeV/c",dqm);
414  JetPx_ = bookHistogram("Px","Jet p_{X}","p_{X} /GeV/c",dqm);
415  JetPy_ = bookHistogram("Py","Jet p_{Y}","p_{Y} /GeV/c",dqm);
416  JetPz_ = bookHistogram("Pz","Jet p_{Z}","p_{Z} /GeV/c",dqm);
417  JetEta_ = bookHistogram("Eta","Jet #eta","#eta",dqm);
418  JetPhi_ = bookHistogram("Phi","Jet #phi","#phi",dqm);
419  JetDeltaEta_ = bookHistogram("deltaEta","Change in #eta","#Delta #eta",dqm);
420  JetDeltaPhi_ = bookHistogram("deltaPhi","Change in #phi","#Delta #phi",dqm);
421  JetPhiVsEta_ = book2DHistogram("PhiVsEta","Corrected jet #phi vs #eta","jet #phi","jet #eta",dqm);
422  JetN90Hits_ = bookHistogram("N90Hits","Jet N90Hits","N90 Hits",dqm);
423  JetfHPD_ = bookHistogram("fHPD","Jet fHPD","fHPD",dqm);
424  JetResEMF_ = bookHistogram("ResEMF","Jet restricted EM fraction","restricted EMF",dqm);
425  JetfRBX_ = bookHistogram("fRBX","Jet fRBX","fRBX",dqm);
426 
427  TrackSiStripHitStoNHisto_ = bookHistogram("TrackSiStripHitStoN","Signal to noise of track SiStrip hits","S/N",dqm);
428  InCaloTrackDirectionJetDRHisto_ = bookHistogram("InCaloTrackDirectionJetDR",
429  "#Delta R between track direrction at vertex and jet axis (track in cone at calo)","#Delta R",dqm);
430  OutCaloTrackDirectionJetDRHisto_ = bookHistogram("OutCaloTrackDirectionJetDR",
431  "#Delta R between track direrction at vertex and jet axis (track out of cone at calo)","#Delta R",dqm);
432  InVertexTrackImpactPointJetDRHisto_ = bookHistogram("InVertexTrackImpactPointJetDR",
433  "#Delta R between track impact point on calo and jet axis (track in cone at vertex)","#Delta R",dqm);
434  OutVertexTrackImpactPointJetDRHisto_ = bookHistogram("OutVertexTrackImpactPointJetDR",
435  "#Delta R between track impact point on calo and jet axis (track out of cone at vertex)","#Delta R",dqm);
436 
437  NTracksPerJetHisto_ = bookHistogram("nTracks","Number of tracks for correction per jet","n tracks",dqm);
438  NTracksPerJetVsJetEtHisto_ = bookProfile("nTracksVsJetEt","Number of tracks for correction per jet vs jet raw E_{T}","Jet raw E_{T} /GeV","n Tracks",dqm);
439  NTracksPerJetVsJetEtaHisto_ = bookProfile("nTracksVsJetEta","Number of tracks for correction per jet vs jet #eta","Jet #eta","n Tracks",dqm);
440 
441  PtFractionInConeHisto_ = bookHistogram("PtFractionInCone","#frac{p_{T}^{in-cone}}{p_{T}^{in-cone}+p_{T}^{out-of-cone}}",
442  "#frac{p_{T}^{in-cone}}{p_{T}^{in-cone}+p_{T}^{out-of-cone}}",dqm);
443  PtFractionInConeVsJetRawEtHisto_ = bookProfile("PtFractionInConeVsJetRawEt","#frac{p_{T}^{in-cone}}{p_{T}^{in-cone}+p_{T}^{out-of-cone}} vs jet raw E_{T}",
444  "Jet raw E_{T} / GeV","#frac{p_{T}^{in-cone}}{p_{T}^{in-cone}+p_{T}^{out-of-cone}}",dqm);
445  PtFractionInConeVsJetEtaHisto_ = bookProfile("PtFractionInConeVsJetEta","#frac{p_{T}^{in-cone}}{p_{T}^{in-cone}+p_{T}^{out-of-cone}} vs jet #eta",
446  "Jet #eta","#frac{p_{T}^{in-cone}}{p_{T}^{in-cone}+p_{T}^{out-of-cone}}",dqm);
447 
448  CorrFactorHisto_ = bookHistogram("CorrFactor","Correction factor","Correction factor",dqm);
449  CorrFactorVsJetEtHisto_ = bookProfile("CorrFactorVsJetEt","Correction factor vs jet raw E_{T}","Jet raw E_{T}","#frac{E_{T}^{corr}}{E_{T}^{raw}}",dqm);
450  CorrFactorVsJetEtaHisto_ = bookProfile("CorrFactorVsJetEta","Correction factor vs jet #eta","Jet #eta","#frac{E_{T}^{corr}}{E_{T}^{raw}}",dqm);
451  ZSPCorrFactorHisto_ = bookHistogram("ZSPCorrFactor","Correction factor from ZSP step","Correction factor",dqm);
452  ZSPCorrFactorVsJetEtHisto_ = bookProfile("ZSPCorrFactorVsJetEt","Correction factor from ZSP step vs jet raw E_{T}",
453  "Jet raw E_{T}","#frac{E_{T}^{corr}}{E_{T}^{raw}}",dqm);
454  ZSPCorrFactorVsJetEtaHisto_ = bookProfile("ZSPCorrFactorVsJetEta","Correction factor from ZSP step vs jet #eta",
455  "Jet #eta","#frac{E_{T}^{corr}}{E_{T}^{raw}}",dqm);
456  JPTCorrFactorHisto_ = bookHistogram("JPTCorrFactor","Correction factor from JPT step","Correction factor",dqm);
457  JPTCorrFactorVsJetEtHisto_ = bookProfile("JPTCorrFactorVsJetEt","Correction factor from JPT step vs jet raw E_{T}",
458  "Jet raw E_{T}","#frac{E_{T}^{corr}}{E_{T}^{raw}}",dqm);
459  JPTCorrFactorVsJetEtaHisto_ = bookProfile("JPTCorrFactorVsJetEta","Correction factor from JPT step vs jet #eta",
460  "Jet #eta","#frac{E_{T}^{corr}}{E_{T}^{raw}}",dqm);
461 
462 
463 
464  bookTrackHistograms(&allPionHistograms_,"AllPions","pion",NULL,NULL,dqm);
465  bookTrackHistograms(&inCaloInVertexPionHistograms_,"InCaloInVertexPions","pions in cone at calo and vertex",
467  bookTrackHistograms(&inCaloOutVertexPionHistograms_,"InCaloOutVertexPions","pions in cone at calo but out at vertex",
469  bookTrackHistograms(&outCaloInVertexPionHistograms_,"OutCaloInVertexPions","pions out of cone at calo but in at vertex",
471 
472  bookTrackHistograms(&allMuonHistograms_,"AllMuons","muon",NULL,NULL,dqm);
473  bookTrackHistograms(&inCaloInVertexMuonHistograms_,"InCaloInVertexMuons","muons in cone at calo and vertex",
475  bookTrackHistograms(&inCaloOutVertexMuonHistograms_,"InCaloOutVertexMuons","muons in cone at calo but out at vertex",
477  bookTrackHistograms(&outCaloInVertexMuonHistograms_,"OutCaloInVertexMuons","muons out of cone at calo but in at vertex",
479 
480  bookTrackHistograms(&allElectronHistograms_,"AllElectrons","electron",NULL,NULL,dqm);
481  bookTrackHistograms(&inCaloInVertexElectronHistograms_,"InCaloInVertexElectrons","electrons in cone at calo and vertex",
483  bookTrackHistograms(&inCaloOutVertexElectronHistograms_,"InCaloOutVertexElectrons","electrons in cone at calo but out at vertex",
485  bookTrackHistograms(&outCaloInVertexElectronHistograms_,"OutCaloInVertexElectrons","electrons out of cone at calo but in at vertex",
487 }
488 
489 void JPTJetAnalyzer::bookTrackHistograms(TrackHistograms* histos, const std::string& tag, const std::string& titleTag,
490  MonitorElement* trackDirectionJetDRHisto, MonitorElement* trackImpactPointJetDRHisto, DQMStore* dqm)
491 {
492  histos->nTracksHisto = bookHistogram("n"+tag+"TracksPerJet","Number of "+titleTag+" tracks per jet","n Tracks",dqm);
493  histos->ptHisto = bookHistogram(tag+"TrackPt",titleTag+" p_{T}","p_{T} /GeV/c",dqm);
494  histos->phiHisto = bookHistogram(tag+"TrackPhi",titleTag+" track #phi","#phi",dqm);
495  histos->etaHisto = bookHistogram(tag+"TrackEta",titleTag+" track #eta","#eta",dqm);
496  histos->nHitsHisto = bookHistogram(tag+"TrackNHits",titleTag+" track N hits","N hits",dqm);
497  histos->nLayersHisto = bookHistogram(tag+"TrackNLayers",titleTag+" track N layers with hits","N layers",dqm);
498  histos->ptVsEtaHisto = bookProfile(tag+"TrackPtVsEta",titleTag+" track p_{T} vs #eta","#eta","p_{T} /GeV/c",dqm);
499  histos->dzHisto = bookHistogram(tag+"TrackDz",titleTag+" track dz","dz /cm",dqm);
500  histos->dxyHisto = bookHistogram(tag+"TrackDxy",titleTag+" track dxy","dxy /cm",dqm);
501  histos->trackDirectionJetDRHisto = trackDirectionJetDRHisto;
502  histos->trackImpactPointJetDRHisto = trackImpactPointJetDRHisto;
503 }
504 
505 void JPTJetAnalyzer::fillTrackHistograms(TrackHistograms& allTracksHistos, TrackHistograms& inCaloInVertexHistos,
506  TrackHistograms& inCaloOutVertexHistos, TrackHistograms& outCaloInVertexHistos,
507  const reco::TrackRefVector& inVertexInCalo,
508  const reco::TrackRefVector& outVertexInCalo,
509  const reco::TrackRefVector& inVertexOutCalo,
510  const reco::Jet& rawJet)
511 {
512  fillTrackHistograms(allTracksHistos,inVertexInCalo,rawJet);
513  fillTrackHistograms(allTracksHistos,outVertexInCalo,rawJet);
514  fillTrackHistograms(allTracksHistos,inVertexOutCalo,rawJet);
515  fillHistogram(allTracksHistos.nTracksHisto,inVertexInCalo.size()+outVertexInCalo.size()+inVertexOutCalo.size());
516  fillSiStripSoNForTracks(inVertexInCalo);
517  fillSiStripSoNForTracks(outVertexInCalo);
518  fillSiStripSoNForTracks(inVertexOutCalo);
519  fillTrackHistograms(inCaloInVertexHistos,inVertexInCalo,rawJet);
520  fillHistogram(inCaloInVertexHistos.nTracksHisto,inVertexInCalo.size());
521  fillTrackHistograms(inCaloOutVertexHistos,outVertexInCalo,rawJet);
522  fillHistogram(inCaloOutVertexHistos.nTracksHisto,outVertexInCalo.size());
523  fillTrackHistograms(outCaloInVertexHistos,inVertexOutCalo,rawJet);
524  fillHistogram(outCaloInVertexHistos.nTracksHisto,inVertexOutCalo.size());
525 }
526 
528 {
529  const reco::TrackRefVector::const_iterator tracksEnd = tracks.end();
530  for (reco::TrackRefVector::const_iterator iTrack = tracks.begin(); iTrack != tracksEnd; ++iTrack) {
531  const reco::Track& track = **iTrack;
532  const double pt = track.pt();
533  const double phi = track.phi();
534  const double eta = track.eta();
535  const unsigned int nHits = track.found();
536  const unsigned int nLayers = track.hitPattern().trackerLayersWithMeasurement();
537  const double dz = track.dz();
538  const double dxy = track.dxy();
539  fillHistogram(histos.ptHisto,pt);
540  fillHistogram(histos.phiHisto,phi);
541  fillHistogram(histos.etaHisto,eta);
542  fillHistogram(histos.nHitsHisto,nHits);
543  fillHistogram(histos.nLayersHisto,nLayers);
544  fillHistogram(histos.ptVsEtaHisto,eta,pt);
545  fillHistogram(histos.dzHisto,dz);
546  fillHistogram(histos.dxyHisto,dxy);
547  const double trackDirectionJetDR = deltaR(rawJet,track);
548  fillHistogram(histos.trackDirectionJetDRHisto,trackDirectionJetDR);
549  const double impactPointJetDR = deltaR(rawJet,trackPropagator_->impactPoint(track));
550  fillHistogram(histos.trackImpactPointJetDRHisto,impactPointJetDR);
551  }
552 }
553 
555 {
556  const reco::TrackRefVector::const_iterator tracksEnd = tracks.end();
557  for (reco::TrackRefVector::const_iterator iTrack = tracks.begin(); iTrack != tracksEnd; ++iTrack) {
558  const trackingRecHit_iterator trackRecHitsEnd = (*iTrack)->recHitsEnd();
559  for (trackingRecHit_iterator iHit = (*iTrack)->recHitsBegin(); iHit != trackRecHitsEnd; ++iHit) {
560  fillSiStripHitSoN(**iHit);
561  }
562  }
563 }
564 
566 {
567  //check it is an SiStrip hit
568  DetId detId(hit.geographicalId());
569  if (!( (detId.det() == DetId::Tracker) &&
570  ( (detId.subdetId() == SiStripDetId::TIB) ||
571  (detId.subdetId() == SiStripDetId::TID) ||
572  (detId.subdetId() == SiStripDetId::TOB) ||
573  (detId.subdetId() == SiStripDetId::TEC)
574  )
575  )) return;
576  //try to determine the type of the hit
577  const TrackingRecHit* pHit = &hit;
578  const SiStripRecHit2D* pRecHit2D = dynamic_cast<const SiStripRecHit2D*>(pHit);
579  const SiStripMatchedRecHit2D* pMatchedRecHit2D = dynamic_cast<const SiStripMatchedRecHit2D*>(pHit);
580  const ProjectedSiStripRecHit2D* pProjctedRecHit2D = dynamic_cast<const ProjectedSiStripRecHit2D*>(pHit);
581  const InvalidTrackingRecHit* pInvalidHit = dynamic_cast<const InvalidTrackingRecHit*>(pHit);
582  //fill signal to noise for appropriate hit
583  if (pMatchedRecHit2D) {
584  fillSiStripHitSoNForSingleHit(*pMatchedRecHit2D->monoHit());
585  fillSiStripHitSoNForSingleHit(*pMatchedRecHit2D->stereoHit());
586  } else if (pProjctedRecHit2D) {
587  fillSiStripHitSoNForSingleHit(pProjctedRecHit2D->originalHit());
588  } else if (pRecHit2D) {
589  fillSiStripHitSoNForSingleHit(*pRecHit2D);
590  } else if (pInvalidHit) {
591  return;
592  } else {
593  edm::LogInfo(messageLoggerCatregory) << "Hit on det ID " << hit.geographicalId().rawId() << " cannot be converted to a strip hit";
594  }
595 }
596 
598 {
599  //get the cluster
600  const SiStripCluster* cluster = NULL;
601  const SiStripRecHit2D::ClusterRegionalRef& regionalClusterRef = hit.cluster_regional();
602  const SiStripRecHit2D::ClusterRef& normalClusterRef = hit.cluster();
603  if (regionalClusterRef.isNonnull()) {
604  cluster = &*regionalClusterRef;
605  } else if (normalClusterRef.isNonnull()) {
606  cluster = &*normalClusterRef;
607  } else {
608  edm::LogError(messageLoggerCatregory) << "Unable to get cluster from SiStripRecHit2D with det ID " << hit.geographicalId().rawId();
609  return;
610  }
611  //calculate signal to noise for cluster
612  const double sOverN = (*sOverNCalculator_)(*cluster);
613  //fill histogram
615 }
616 
617 double JPTJetAnalyzer::findPtFractionInCone(const reco::TrackRefVector& inConeTracks, const reco::TrackRefVector& outOfConeTracks)
618 {
619  double totalPt = 0;
620  double inConePt = 0;
621  const reco::TrackRefVector::const_iterator inConeTracksEnd = inConeTracks.end();
622  for (reco::TrackRefVector::const_iterator iInConeTrack = inConeTracks.begin(); iInConeTrack != inConeTracksEnd; ++iInConeTrack) {
623  const double pt = (*iInConeTrack)->pt();
624  totalPt += pt;
625  inConePt += pt;
626  }
627  const reco::TrackRefVector::const_iterator outOfConeTracksEnd = outOfConeTracks.end();
628  for (reco::TrackRefVector::const_iterator iOutOfConeTrack = outOfConeTracks.begin(); iOutOfConeTrack != outOfConeTracksEnd; ++iOutOfConeTrack) {
629  const double pt = (*iOutOfConeTrack)->pt();
630  totalPt += pt;
631  }
632  if (totalPt) return inConePt/totalPt;
633  //return 0 if there are no tracks at all
634  else return 0;
635 }
636 
637 
638 
640  : enabled(false),
641  nBins(0),
642  min(0),
643  max(0),
644  nBinsY(0),
645  minY(0),
646  maxY(0)
647 {}
648 
649 JPTJetAnalyzer::HistogramConfig::HistogramConfig(const unsigned int theNBins, const double theMin, const double theMax)
650  : enabled(true),
651  nBins(theNBins),
652  min(theMin),
653  max(theMax),
654  nBinsY(0),
655  minY(0),
656  maxY(0)
657 {}
658 
659 JPTJetAnalyzer::HistogramConfig::HistogramConfig(const unsigned int theNBinsX, const double theMinX, const double theMaxX,
660  const unsigned int theNBinsY, const double theMinY, const double theMaxY)
661  : enabled(true),
662  nBins(theNBinsX),
663  min(theMinX),
664  max(theMaxX),
665  nBinsY(theNBinsY),
666  minY(theMinY),
667  maxY(theMaxY)
668 {}
669 
671  : ptHisto(NULL),
672  phiHisto(NULL),
673  etaHisto(NULL),
674  nHitsHisto(NULL),
675  nLayersHisto(NULL),
676  ptVsEtaHisto(NULL),
677  dzHisto(NULL),
678  dxyHisto(NULL),
679  trackDirectionJetDRHisto(NULL),
680  trackImpactPointJetDRHisto(NULL)
681 {}
682 
684  MonitorElement* thePtHisto, MonitorElement* thePhiHisto, MonitorElement* theEtaHisto,
685  MonitorElement* theNHitsHisto, MonitorElement* theNLayersHisto, MonitorElement* thePtVsEtaHisto,
686  MonitorElement* theDzHisto, MonitorElement* theDxyHisto,
687  MonitorElement* theTrackDirectionJetDRHisto, MonitorElement* theTrackImpactPointJetDRHisto)
688  : nTracksHisto(theNTracksHisto),
689  ptHisto(thePtHisto),
690  phiHisto(thePhiHisto),
691  etaHisto(theEtaHisto),
692  nHitsHisto(theNHitsHisto),
693  nLayersHisto(theNLayersHisto),
694  ptVsEtaHisto(thePtVsEtaHisto),
695  dzHisto(theDzHisto),
696  dxyHisto(theDxyHisto),
697  trackDirectionJetDRHisto(theTrackDirectionJetDRHisto),
698  trackImpactPointJetDRHisto(theTrackImpactPointJetDRHisto)
699 {}
700 
701 namespace jptJetAnalysis {
702 
703  TrackPropagatorToCalo::TrackPropagatorToCalo()
704  : magneticField_(NULL),
705  propagator_(NULL),
706  magneticFieldCacheId_(0),
707  propagatorCacheId_(0)
708  {}
709 
711  {
712  //update magnetic filed if necessary
713  const IdealMagneticFieldRecord& magneticFieldRecord = eventSetup.get<IdealMagneticFieldRecord>();
714  const uint32_t newMagneticFieldCacheId = magneticFieldRecord.cacheIdentifier();
715  if ((newMagneticFieldCacheId != magneticFieldCacheId_) || !magneticField_) {
716  edm::ESHandle<MagneticField> magneticFieldHandle;
717  magneticFieldRecord.get(magneticFieldHandle);
718  magneticField_ = magneticFieldHandle.product();
719  magneticFieldCacheId_ = newMagneticFieldCacheId;
720  }
721  //update propagator if necessary
722  const TrackingComponentsRecord& trackingComponentsRecord = eventSetup.get<TrackingComponentsRecord>();
723  const uint32_t newPropagatorCacheId = trackingComponentsRecord.cacheIdentifier();
724  if ((propagatorCacheId_ != newPropagatorCacheId) || !propagator_) {
725  edm::ESHandle<Propagator> propagatorHandle;
726  trackingComponentsRecord.get("SteppingHelixPropagatorAlong",propagatorHandle);
727  propagator_ = propagatorHandle.product();
728  propagatorCacheId_ = newPropagatorCacheId;
729  }
730  }
731 
733  {
735  }
736 
738  : qualityLabel_(theQualityLabel),
739  quality_(NULL),
740  noise_(NULL),
741  gain_(NULL),
742  qualityCacheId_(0),
743  noiseCacheId_(0),
744  gainCacheId_(0)
745  {}
746 
748  {
749  //update the quality if necessary
750  const SiStripQualityRcd& qualityRecord = eventSetup.get<SiStripQualityRcd>();
751  const uint32_t newQualityCacheId = qualityRecord.cacheIdentifier();
752  if ((newQualityCacheId != qualityCacheId_) || !quality_) {
753  edm::ESHandle<SiStripQuality> qualityHandle;
754  qualityRecord.get(qualityLabel_,qualityHandle);
755  quality_ = qualityHandle.product();
756  qualityCacheId_ = newQualityCacheId;
757  }
758  //update the noise if necessary
759  const SiStripNoisesRcd& noiseRecord = eventSetup.get<SiStripNoisesRcd>();
760  const uint32_t newNoiseCacheId = noiseRecord.cacheIdentifier();
761  if ((newNoiseCacheId != noiseCacheId_) || !noise_) {
762  edm::ESHandle<SiStripNoises> noiseHandle;
763  noiseRecord.get(noiseHandle);
764  noise_ = noiseHandle.product();
765  noiseCacheId_ = newNoiseCacheId;
766  }
767  //update the gain if necessary
768  const SiStripGainRcd& gainRecord = eventSetup.get<SiStripGainRcd>();
769  const uint32_t newGainCacheId = gainRecord.cacheIdentifier();
770  if ((newGainCacheId != gainCacheId_) || !gain_) {
771  edm::ESHandle<SiStripGain> gainHandle;
772  gainRecord.get(gainHandle);
773  gain_ = gainHandle.product();
774  gainCacheId_ = newGainCacheId;
775  }
776  }
777 
779  {
780  const uint32_t detId = cluster.geographicalId();
781  const uint16_t firstStrip = cluster.firstStrip();
782  const SiStripQuality::Range& qualityRange = quality_->getRange(detId);
783  const SiStripNoises::Range& noiseRange = noise_->getRange(detId);
784  const SiStripApvGain::Range& gainRange = gain_->getRange(detId);
785  double signal = 0;
786  double noise2 = 0;
787  unsigned int nNonZeroStrips = 0;
788  const std::vector<uint8_t>& clusterAmplitudes = cluster.amplitudes();
789  const std::vector<uint8_t>::const_iterator clusterAmplitudesEnd = clusterAmplitudes.end();
790  const std::vector<uint8_t>::const_iterator clusterAmplitudesBegin = clusterAmplitudes.begin();
791  for (std::vector<uint8_t>::const_iterator iAmp = clusterAmplitudesBegin; iAmp != clusterAmplitudesEnd; ++iAmp) {
792  const uint8_t adc = *iAmp;
793  const uint16_t strip = iAmp-clusterAmplitudesBegin+firstStrip;
794  const bool stripBad = quality_->IsStripBad(qualityRange,strip);
795  const double noise = noise_->getNoise(strip,noiseRange);
796  const double gain = gain_->getStripGain(strip,gainRange);
797  signal += adc;
798  if (adc) ++nNonZeroStrips;
799  const double noiseContrib = (stripBad ? 0 : noise/gain);
800  noise2 += noiseContrib*noiseContrib;
801  }
802  const double noise = sqrt(noise2/nNonZeroStrips);
803  if (noise) return signal/noise;
804  else return 0;
805  }
806 
807 }
int adc(sample_type sample)
get the ADC sample (12 bits)
static const char noise_[]
MonitorElement * CorrFactorVsJetEtaHisto_
MonitorElement * JetPt_
T getParameter(std::string const &) const
unsigned long long cacheIdentifier() const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * NTracksPerJetHisto_
virtual double p() const
magnitude of momentum vector
MonitorElement * JetResEMF_
virtual ~JPTJetAnalyzer()
Destructor.
const reco::TrackRefVector & getElecsOutVertexInCalo() const
Definition: JPTJet.h:124
MonitorElement * JetPt1_
DQMStore * dqm_
DQMStore. Used to write out to file.
Helper class for grouping histograms belowing to a set of tracks.
Jets made from CaloTowers.
Definition: CaloJet.h:30
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
MonitorElement * PtFractionInConeVsJetRawEtHisto_
const reco::TrackRefVector & getPionsInVertexOutCalo() const
Definition: JPTJet.h:117
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
MonitorElement * NTracksPerJetVsJetEtHisto_
virtual double et() const
transverse energy
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
double deltaPhi(float phi1, float phi2)
Definition: VectorUtil.h:30
Helper class to hold the configuration for a histogram.
const SiStripRecHit2D * stereoHit() const
Base class for all types of Jets.
Definition: Jet.h:21
bool IsStripBad(const uint32_t &detid, const short &strip) const
TrackHistograms allElectronHistograms_
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:1883
std::auto_ptr< jptJetAnalysis::StripSignalOverNoiseCalculator > sOverNCalculator_
Helper object to calculate strip SoN for tracks.
bool exists(std::string const &parameterName) const
checks if a parameter exists
MonitorElement * CorrFactorVsJetEtHisto_
MonitorElement * JetEta_
TrackHistograms inCaloOutVertexMuonHistograms_
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:138
#define NULL
Definition: scimark2.h:8
const bool verbose_
Create verbose debug messages.
TrackHistograms outCaloInVertexMuonHistograms_
#define min(a, b)
Definition: mlp_lapack.h:161
MonitorElement * JetN90Hits_
uint16_t firstStrip() const
MonitorElement * InVertexTrackImpactPointJetDRHisto_
std::auto_ptr< reco::helper::JetIDHelper > jetID_
Helper object to calculate jet ID parameters.
const edm::RefToBase< reco::Jet > & getCaloJetRef() const
Definition: JPTJet.h:130
ClusterRegionalRef const & cluster_regional() const
double signalOverNoise(const SiStripCluster &cluster) const
tuple histo
Definition: trackerHits.py:12
TrackHistograms inCaloInVertexMuonHistograms_
MonitorElement * ZSPCorrFactorHisto_
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:242
float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range) const
Definition: SiStripGain.cc:87
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:860
T eta() const
MonitorElement * TrackSiStripHitStoNHisto_
MonitorElement * JetDeltaPhi_
virtual double eta() const
momentum pseudorapidity
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:237
void fillSiStripHitSoN(const TrackingRecHit &hit)
MonitorElement * InCaloTrackDirectionJetDRHisto_
JPTJetAnalyzer(const edm::ParameterSet &config)
Constructor.
MonitorElement * JetfRBX_
MonitorElement * CorrFactorHisto_
void bookTrackHistograms(TrackHistograms *histos, const std::string &tag, const std::string &titleTag, MonitorElement *trackDirectionJetDRHisto, MonitorElement *trackImpactPointJetDRHisto, DQMStore *dqm)
Book the histograms for a track.
uint32_t geographicalId() const
TrackHistograms inCaloOutVertexElectronHistograms_
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
static const char * messageLoggerCatregory
String constant for message logger category.
MonitorElement * JetMass_
void getConfigForHistogram(const std::string &configName, const edm::ParameterSet &psetContainingConfigPSet, std::ostringstream *pDebugStream=NULL)
Load the config for a hitogram.
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:248
void update(const edm::EventSetup &eventSetup)
virtual double mass() const
mass
virtual double energy() const
energy
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:140
MonitorElement * bookProfile(const std::string &name, const std::string &title, const std::string &xAxisTitle, const std::string &yAxisTitle, DQMStore *dqm)
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup, const reco::JPTJet &jptJet, double &pt1, double &pt2, double &pt3)
Do the analysis.
MonitorElement * JPTCorrFactorVsJetEtHisto_
const T & max(const T &a, const T &b)
MonitorElement * book2DHistogram(const std::string &name, const std::string &title, const std::string &xAxisTitle, const std::string &yAxisTitle, DQMStore *dqm)
T sqrt(T t)
Definition: SSEVec.h:28
MonitorElement * JetPz_
Jets made from CaloJets corrected for ZSP and tracks.
Definition: JPTJet.h:29
double pt() const
track transverse momentum
Definition: TrackBase.h:130
void bookHistograms(DQMStore *dqm)
Book all histograms.
void fillHistogram(MonitorElement *histogram, const double value)
Fill histogram or profile if it has been booked.
void get(HolderT &iHolder) const
std::auto_ptr< jptJetAnalysis::TrackPropagatorToCalo > trackPropagator_
Helper object to propagate tracks to the calo surface.
std::pair< ContainerIterator, ContainerIterator > Range
void fillSiStripHitSoNForSingleHit(const SiStripRecHit2D &hit)
MonitorElement * OutCaloTrackDirectionJetDRHisto_
tuple pset
Definition: CrabTask.py:85
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:833
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:216
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_
double operator()(const SiStripCluster &cluster) const
#define LogTrace(id)
StripSignalOverNoiseCalculator(const std::string &theQualityLabel=std::string(""))
MonitorElement * JetP_
MonitorElement * JetEt_
TrackHistograms outCaloInVertexPionHistograms_
MonitorElement * JetE_
MonitorElement * JetPt3_
static float getNoise(uint16_t strip, const Range &range)
MonitorElement * JetPhiVsEta_
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:126
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
TrackHistograms outCaloInVertexElectronHistograms_
const double fHPDMax_
Definition: DetId.h:20
MonitorElement * ZSPCorrFactorVsJetEtaHisto_
const reco::TrackRefVector & getPionsInVertexInCalo() const
Tracks.
Definition: JPTJet.h:116
dictionary histos
Definition: combine.py:3
virtual double px() const
x coordinate of momentum vector
const float & getZSPCor() const
Definition: JPTJet.h:128
virtual void endJob()
Finish up a job.
tuple tracks
Definition: testEve_cfg.py:39
MonitorElement * trackImpactPointJetDRHisto
virtual double pt() const
transverse momentum
TrackHistograms allMuonHistograms_
const double correctedPtMin_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
const T & get() const
Definition: EventSetup.h:55
ClusterRef const & cluster() const
T const * product() const
Definition: ESHandle.h:62
const Range getRange(const uint32_t &detID) const
TrackHistograms inCaloInVertexElectronHistograms_
const reco::TrackRefVector & getElecsInVertexOutCalo() const
Definition: JPTJet.h:123
MonitorElement * NTracksPerJetVsJetEtaHisto_
virtual double pz() const
z coordinate of momentum vector
void update(const edm::EventSetup &eventSetup)
const reco::TrackRefVector & getMuonsInVertexOutCalo() const
Definition: JPTJet.h:120
TrackHistograms allPionHistograms_
const reco::TrackRefVector & getPionsOutVertexInCalo() const
Definition: JPTJet.h:118
MonitorElement * JPTCorrFactorHisto_
static math::XYZPoint propagateTrackToCalorimeter(const reco::Track &, const MagneticField &, const Propagator &)
Propagates track to calorimeter face.
int chargedMultiplicity() const
chargedMultiplicity
Definition: JPTJet.h:108
MonitorElement * JetPy_
TrackHistograms inCaloOutVertexPionHistograms_
unsigned short found() const
Number of valid hits on track.
Definition: Track.h:100
std::pair< ContainerIterator, ContainerIterator > Range
tuple config
Definition: cmsDriver.py:17
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 const char gain_[]
MonitorElement * JetfHPD_
static double findPtFractionInCone(const reco::TrackRefVector &inConeTracks, const reco::TrackRefVector &outOfConeTracks)
Utility function to calculate the fraction of track Pt in cone.
MonitorElement * bookHistogram(const std::string &name, const std::string &title, const std::string &xAxisTitle, DQMStore *dqm)
Book histograms and profiles.
const SiStripApvGain::Range getRange(const uint32_t &detID) const
Definition: SiStripGain.cc:129
size_type size() const
Size of the RefVector.
Definition: RefVector.h:85
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
MonitorElement * JetDeltaEta_
const reco::TrackRefVector & getElecsInVertexInCalo() const
Definition: JPTJet.h:122
MonitorElement * JetPt2_
MonitorElement * trackDirectionJetDRHisto
DetId geographicalId() const
MonitorElement * PtFractionInConeHisto_
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:41
std::string dqmStoreFileName_
DQM store file name.
MonitorElement * JPTCorrFactorVsJetEtaHisto_
const std::string histogramPath_
Path of directory used to store histograms in DQMStore.
const Range getRange(const uint32_t &detID) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:647
const SiStripRecHit2D * monoHit() const
math::XYZPoint impactPoint(const reco::Track &track) const
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:120
MonitorElement * JetPx_
const int n90HitsMin_
Jet ID cuts.
virtual double phi() const
momentum azimuthal angle
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
const reco::TrackRefVector & getMuonsInVertexInCalo() const
Definition: JPTJet.h:119
const SiStripRecHit2D & originalHit() const
MonitorElement * OutVertexTrackImpactPointJetDRHisto_
const bool writeDQMStore_
Write DQM store to a file?
const std::vector< uint8_t > & amplitudes() const
virtual double py() const
y coordinate of momentum vector
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
MonitorElement * PtFractionInConeVsJetEtaHisto_
MonitorElement * ZSPCorrFactorVsJetEtHisto_
void fillSiStripSoNForTracks(const reco::TrackRefVector &tracks)
Fill the SoN hisotgram for hits on tracks.
const reco::TrackRefVector & getMuonsOutVertexInCalo() const
Definition: JPTJet.h:121
Definition: DDAxes.h:10