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