CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
BDHadronTrackMonitoringAnalyzer Class Reference

#include <BDHadronTrackMonitoringAnalyzer.h>

Inheritance diagram for BDHadronTrackMonitoringAnalyzer:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Types

enum  HistoryClasses {
  BCWeakDecay = 0, BWeakDecay = 1, CWeakDecay = 2, PU = 3,
  Other = 4, Fake = 5
}
 
- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 BDHadronTrackMonitoringAnalyzer (const edm::ParameterSet &pSet)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 ~BDHadronTrackMonitoringAnalyzer () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Attributes

static const std::vector
< std::string > 
TrkHistCat
 

Private Attributes

TrackClassifier classifier_
 
edm::InputTag ClusterTPMapSrc_
 
edm::EDGetTokenT
< ClusterTPAssociation
clusterTPMapToken_
 
double decayLength_
 
double distJetAxis_
 
std::string ipTagInfos_
 
double maxJetEta_
 
double minJetPt_
 
MonitorElementnTrk_bjet [6]
 
MonitorElementnTrk_cjet [6]
 
MonitorElementnTrk_dusgjet [6]
 
MonitorElementnTrkAll_bjet
 
MonitorElementnTrkAll_cjet
 
MonitorElementnTrkAll_dusgjet
 
edm::EDGetTokenT
< pat::JetCollection
PatJetCollectionTag_
 
edm::InputTag PatJetSrc_
 
edm::EDGetTokenT
< reco::VertexCollection
PrimaryVertexColl_
 
edm::InputTag PVSrc_
 
edm::EDGetTokenT
< reco::TrackCollection
TrackCollectionTag_
 
edm::InputTag TrackSrc_
 
MonitorElementTrkDxy_alljets [6]
 
MonitorElementTrkDz_alljets [6]
 
MonitorElementTrkEta_alljets [6]
 
MonitorElementTrkHitAll_alljets [6]
 
MonitorElementTrkHitPixel_alljets [6]
 
MonitorElementTrkHitStrip_alljets [6]
 
MonitorElementTrkPhi_alljets [6]
 
MonitorElementTrkPt_alljets [6]
 
MonitorElementTrkTruthDxy_alljets [5]
 
MonitorElementTrkTruthDz_alljets [5]
 
MonitorElementTrkTruthEta_alljets [5]
 
MonitorElementTrkTruthHitAll_alljets [5]
 
MonitorElementTrkTruthHitPixel_alljets [5]
 
MonitorElementTrkTruthHitStrip_alljets [5]
 
MonitorElementTrkTruthPhi_alljets [5]
 
MonitorElementTrkTruthPt_alljets [5]
 
edm::ESGetToken
< TransientTrackBuilder,
TransientTrackRecord
ttrackToken_
 

Additional Inherited Members

- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Top level steering routine for B + D hadron track monitoring tool from RECODEBUG samples.

Definition at line 47 of file BDHadronTrackMonitoringAnalyzer.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

BDHadronTrackMonitoringAnalyzer::BDHadronTrackMonitoringAnalyzer ( const edm::ParameterSet pSet)
explicit

Definition at line 24 of file BDHadronTrackMonitoringAnalyzer.cc.

References ClusterTPMapSrc_, clusterTPMapToken_, DeDxTools::esConsumes(), PatJetCollectionTag_, PatJetSrc_, PrimaryVertexColl_, PVSrc_, TrackCollectionTag_, TrackSrc_, and ttrackToken_.

25  : distJetAxis_(pSet.getParameter<double>("distJetAxisCut")),
26  decayLength_(pSet.getParameter<double>("decayLengthCut")),
27  minJetPt_(pSet.getParameter<double>("minJetPt")),
28  maxJetEta_(pSet.getParameter<double>("maxJetEta")),
29  ipTagInfos_(pSet.getParameter<std::string>("ipTagInfos")),
30  PatJetSrc_(pSet.getParameter<InputTag>("PatJetSource")),
31  TrackSrc_(pSet.getParameter<InputTag>("TrackSource")),
32  PVSrc_(pSet.getParameter<InputTag>("PrimaryVertexSource")),
33  ClusterTPMapSrc_(pSet.getParameter<InputTag>("clusterTPMap")),
34  classifier_(pSet, consumesCollector())
35 
36 {
37  PatJetCollectionTag_ = consumes<pat::JetCollection>(PatJetSrc_);
38  TrackCollectionTag_ = consumes<reco::TrackCollection>(TrackSrc_);
39  PrimaryVertexColl_ = consumes<reco::VertexCollection>(PVSrc_);
40  clusterTPMapToken_ = consumes<ClusterTPAssociation>(ClusterTPMapSrc_);
41  ttrackToken_ = esConsumes(edm::ESInputTag("", "TransientTrackBuilder"));
42  // TrkHistCat = {"BCWeakDecay", "BWeakDecay", "CWeakDecay", "PU", "Other",
43  // "Fake"};
44 }
edm::EDGetTokenT< ClusterTPAssociation > clusterTPMapToken_
edm::EDGetTokenT< reco::TrackCollection > TrackCollectionTag_
edm::EDGetTokenT< reco::VertexCollection > PrimaryVertexColl_
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > ttrackToken_
edm::EDGetTokenT< pat::JetCollection > PatJetCollectionTag_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
BDHadronTrackMonitoringAnalyzer::~BDHadronTrackMonitoringAnalyzer ( )
override

Definition at line 198 of file BDHadronTrackMonitoringAnalyzer.cc.

198 {}

Member Function Documentation

void BDHadronTrackMonitoringAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 206 of file BDHadronTrackMonitoringAnalyzer.cc.

References funct::abs(), BCWeakDecay, TrackCategories::BWeakDecay, BWeakDecay, classifier_, IPTools::closestApproachToJet(), clusterTPMapToken_, compare(), RecoVertex::convertPos(), TrackCategories::CWeakDecay, CWeakDecay, listHistos::decayLength, decayLength_, distJetAxis_, reco::TrackBase::dxy(), reco::TrackBase::dz(), alignCSCRings::e, reco::TrackBase::eta(), TrackClassifier::evaluate(), TrackCategories::Fake, Fake, reco::TransientTrack::field(), dqm::impl::MonitorElement::Fill(), TrackCategories::flags(), edm::Event::getByToken(), edm::EventSetup::getHandle(), TrackHistory::getMatchedTrackingParticle(), TrajectoryStateOnSurface::globalPosition(), TrackClassifier::history(), reco::TrackBase::hitPattern(), mps_fire::i, reco::TransientTrack::impactPointState(), ipTagInfos_, OmniClusterRef::isPixel(), OmniClusterRef::isStrip(), TrajectoryStateOnSurface::isValid(), OmniClusterRef::isValid(), metsig::jet, IPTools::jetTrackDistance(), ClusterTPAssociation::map(), maxJetEta_, minJetPt_, TrackClassifier::newEvent(), nTrk_bjet, nTrk_cjet, nTrk_dusgjet, nTrkAll_bjet, nTrkAll_cjet, nTrkAll_dusgjet, reco::TrackBase::numberOfValidHits(), reco::HitPattern::numberOfValidPixelHits(), reco::HitPattern::numberOfValidStripHits(), Other, AlCaHLTBitMon_ParallelJobs::p, PatJetCollectionTag_, reco::TrackBase::phi(), reco::Vertex::position(), beam_dqm_sourceclient-live_cfg::primaryVertex, PrimaryVertexColl_, reco::TrackBase::pt(), PU, MetAnalyzer::pv(), TrackCollections2monitor_cff::selectedTracks, TrackCategories::SignalEvent, mathSSE::sqrt(), reco::btag::toTrack(), toTrackRef(), TrackCollectionTag_, TrkDxy_alljets, TrkDz_alljets, TrkEta_alljets, TrkHistCat, TrkHitAll_alljets, TrkHitPixel_alljets, TrkHitStrip_alljets, TrkPhi_alljets, TrkPt_alljets, TrkTruthDxy_alljets, TrkTruthDz_alljets, TrkTruthEta_alljets, TrkTruthHitAll_alljets, TrkTruthHitPixel_alljets, TrkTruthHitStrip_alljets, TrkTruthPhi_alljets, TrkTruthPt_alljets, and ttrackToken_.

206  {
208  iEvent.getByToken(PatJetCollectionTag_, patJetsColl);
209 
211  iEvent.getByToken(TrackCollectionTag_, tracksHandle);
212 
213  edm::Handle<ClusterTPAssociation> pCluster2TPListH;
214  iEvent.getByToken(clusterTPMapToken_, pCluster2TPListH);
215  const ClusterTPAssociation &clusterToTPMap = *pCluster2TPListH;
216 
217  //edm::ESHandle<TransientTrackBuilder>
218  const auto &trackBuilder = iSetup.getHandle(ttrackToken_);
219 
220  classifier_.newEvent(iEvent, iSetup);
221 
222  // -----Primary Vertex-----
223  const reco::Vertex *pv;
224 
226  iEvent.getByToken(PrimaryVertexColl_, primaryVertex);
227 
228  bool pvFound = (!primaryVertex->empty());
229  if (pvFound) {
230  pv = &(*primaryVertex->begin());
231  } else {
233  e(0, 0) = 0.0015 * 0.0015;
234  e(1, 1) = 0.0015 * 0.0015;
235  e(2, 2) = 15. * 15.;
236  reco::Vertex::Point p(0, 0, 0);
237  pv = new reco::Vertex(p, e, 1, 1, 1);
238  }
239  // -----------------------
240 
241  // -------- Loop Over Jets ----------
242  for (pat::JetCollection::const_iterator jet = patJetsColl->begin(); jet != patJetsColl->end(); ++jet) {
243  if (jet->pt() < minJetPt_ || std::fabs(jet->eta()) > maxJetEta_)
244  continue;
245 
246  unsigned int flav = abs(jet->hadronFlavour());
247 
248  // std::cout << "patJet collection has pfImpactParameterTagInfo?: " <<
249  // jet->hasTagInfo("pfImpactParameter") << std::endl;
250  const CandIPTagInfo *trackIpTagInfo = jet->tagInfoCandIP(ipTagInfos_);
251  const std::vector<edm::Ptr<reco::Candidate>> &selectedTracks(trackIpTagInfo->selectedTracks());
252 
253  unsigned int nseltracks = 0;
254  std::vector<int> nseltracksCat(TrkHistCat.size(),
255  0); // following the order of TrkHistCat
256 
257  unsigned int nTrackSize = selectedTracks.size(); // number of tracks from IPInfos to loop over
258  // -------- Loop Over (selected) Tracks ----------
259  for (unsigned int itt = 0; itt < nTrackSize; ++itt) {
260  const TrackBaseRef ptrackRef = toTrackRef(selectedTracks[itt]);
261  const reco::Track *ptrackPtr = reco::btag::toTrack(ptrackRef);
262  const reco::Track &ptrack = *ptrackPtr;
263 
264  reco::TransientTrack transientTrack = trackBuilder->build(ptrackPtr);
265  GlobalVector direction(jet->px(), jet->py(), jet->pz());
266 
267  Double_t distJetAxis = IPTools::jetTrackDistance(transientTrack, direction, *pv).second.value();
268 
269  Double_t decayLength = 999;
270  TrajectoryStateOnSurface closest =
271  IPTools::closestApproachToJet(transientTrack.impactPointState(), *pv, direction, transientTrack.field());
272  if (closest.isValid())
273  decayLength = (closest.globalPosition() - RecoVertex::convertPos(pv->position())).mag();
274  else
275  decayLength = 999;
276 
277  // extra cut ons the tracks
278  if (std::fabs(distJetAxis) > distJetAxis_ || decayLength > decayLength_) {
279  continue;
280  }
281  nseltracks += 1; // if it passed these cuts, nselectedtracks +1
282 
284 
285  double TrkPt = ptrack.pt();
286  double TrkEta = ptrack.eta();
287  double TrkPhi = ptrack.phi();
288  double TrkDxy = ptrack.dxy(pv->position());
289  double TrkDz = ptrack.dz(pv->position());
290  int TrknHitAll = ptrack.numberOfValidHits();
291  int TrknHitPixel = ptrack.hitPattern().numberOfValidPixelHits();
292  int TrknHitStrip = ptrack.hitPattern().numberOfValidStripHits();
293 
294  double TrkTruthPt = -99;
295  double TrkTruthEta = -99;
296  double TrkTruthPhi = -99;
297  double TrkTruthDxy = -1;
298  double TrkTruthDz = -1;
299  int TrkTruthnHitAll = -1;
300  int TrkTruthnHitPixel = -1;
301  int TrkTruthnHitStrip = -1;
302 
303  // Get corresponding Trackingparticle
304  std::pair<TrackingParticleRef, double> res = classifier_.history().getMatchedTrackingParticle();
305  TrackingParticleRef tpr = res.first;
306  double quality_tpr = res.second;
307 
308  // Match TP to hit-cluster (re-ordering according to TP rather than
309  // clusters and look for equal_range of a given tpr)
310  auto clusterTPmap = clusterToTPMap.map();
311  std::sort(clusterTPmap.begin(), clusterTPmap.end(), compare);
312  auto clusterRange =
313  std::equal_range(clusterTPmap.begin(), clusterTPmap.end(), std::make_pair(OmniClusterRef(), tpr), compare);
314  if (quality_tpr != 0) {
315  TrkTruthPt = tpr->pt();
316  TrkTruthEta = tpr->eta();
317  TrkTruthPhi = tpr->phi();
318 
319  const TrackingParticle::Point &vertex_pv = pv->position();
320  TrackingParticle::Point vertex_tpr = tpr->vertex();
321  TrackingParticle::Vector momentum_tpr = tpr->momentum();
322  TrkTruthDxy = (-(vertex_tpr.x() - vertex_pv.x()) * momentum_tpr.y() +
323  (vertex_tpr.y() - vertex_pv.y()) * momentum_tpr.x()) /
324  tpr->pt();
325  TrkTruthDz = (vertex_tpr.z() - vertex_pv.z()) - ((vertex_tpr.x() - vertex_pv.x()) * momentum_tpr.x() +
326  (vertex_tpr.y() - vertex_pv.y()) * momentum_tpr.y()) /
327  sqrt(momentum_tpr.perp2()) * momentum_tpr.z() /
328  sqrt(momentum_tpr.perp2());
329 
330  TrkTruthnHitAll = 0;
331  TrkTruthnHitPixel = 0;
332  TrkTruthnHitStrip = 0;
333  if (clusterRange.first != clusterRange.second) {
334  for (auto ip = clusterRange.first; ip != clusterRange.second; ++ip) {
335  const OmniClusterRef &cluster = ip->first;
336  if (cluster.isPixel() && cluster.isValid()) {
337  TrkTruthnHitPixel += 1;
338  }
339  if (cluster.isStrip() && cluster.isValid()) {
340  TrkTruthnHitStrip += 1;
341  }
342  }
343  }
344  TrkTruthnHitAll = TrkTruthnHitPixel + TrkTruthnHitStrip;
345  }
346 
347  // ----------- Filling the correct histograms based on jet flavour and
348  // Track history Category --------
349 
350  // BCWeakDecay
352  theFlag[TrackCategories::CWeakDecay]) {
362  if (quality_tpr != 0) {
371  }
372  }
373  // BWeakDecay
374  else if (theFlag[TrackCategories::SignalEvent] && theFlag[TrackCategories::BWeakDecay] &&
375  !theFlag[TrackCategories::CWeakDecay]) {
385  if (quality_tpr != 0) {
394  }
395  }
396  // CWeakDecay
397  else if (theFlag[TrackCategories::SignalEvent] && !theFlag[TrackCategories::BWeakDecay] &&
398  theFlag[TrackCategories::CWeakDecay]) {
408  if (quality_tpr != 0) {
417  }
418  }
419  // PU
420  else if (!theFlag[TrackCategories::SignalEvent] && !theFlag[TrackCategories::Fake]) {
421  nseltracksCat[BDHadronTrackMonitoringAnalyzer::PU] += 1;
430  if (quality_tpr != 0) {
439  }
440  }
441  // Other
442  else if (theFlag[TrackCategories::SignalEvent] && !theFlag[TrackCategories::BWeakDecay] &&
443  !theFlag[TrackCategories::CWeakDecay]) {
444  nseltracksCat[BDHadronTrackMonitoringAnalyzer::Other] += 1;
453  if (quality_tpr != 0) {
462  }
463  }
464  // Fake
465  else if (!theFlag[TrackCategories::SignalEvent] && theFlag[TrackCategories::Fake]) {
466  nseltracksCat[BDHadronTrackMonitoringAnalyzer::Fake] += 1;
475  // NO TRUTH FOR FAKES!!!
476  }
477  }
478  // -------- END Loop Over (selected) Tracks ----------
479  // Still have to fill some jet-flavour specific variables
480  if (flav == 5) {
481  nTrkAll_bjet->Fill(nseltracks);
482  for (unsigned int i = 0; i < TrkHistCat.size(); i++) {
483  nTrk_bjet[i]->Fill(nseltracksCat[i]);
484  }
485  } else if (flav == 4) {
486  nTrkAll_cjet->Fill(nseltracks);
487  for (unsigned int i = 0; i < TrkHistCat.size(); i++) {
488  nTrk_cjet[i]->Fill(nseltracksCat[i]);
489  }
490  } else {
491  nTrkAll_dusgjet->Fill(nseltracks);
492  for (unsigned int i = 0; i < TrkHistCat.size(); i++) {
493  nTrk_dusgjet[i]->Fill(nseltracksCat[i]);
494  }
495  }
496  }
497  // -------- END Loop Over Jets ----------
498 
499  if (!pvFound) {
500  delete pv;
501  }
502 }
reco::Vertex::Point convertPos(const GlobalPoint &p)
tuple decayLength
Definition: listHistos.py:101
bool isStrip() const
bool compare(const P &i, const P &j)
edm::EDGetTokenT< ClusterTPAssociation > clusterTPMapToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< reco::TrackCollection > TrackCollectionTag_
edm::EDGetTokenT< reco::VertexCollection > PrimaryVertexColl_
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > ttrackToken_
int numberOfValidStripHits() const
Definition: HitPattern.h:837
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:44
GlobalPoint globalPosition() const
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
TrajectoryStateOnSurface closestApproachToJet(const TrajectoryStateOnSurface &state, const reco::Vertex &vertex, const GlobalVector &aJetDirection, const MagneticField *field)
Definition: IPTools.cc:182
const MagneticField * field() const
TrackHistory const & history() const
Returns a reference to the track history used in the classification.
const reco::Track * toTrack(const reco::TrackBaseRef &t)
Definition: IPTagInfo.h:24
const Point & position() const
position
Definition: Vertex.h:127
std::pair< double, Measurement1D > jetTrackDistance(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:206
edm::EDGetTokenT< pat::JetCollection > PatJetCollectionTag_
void Fill(long long x)
math::XYZPointD Point
point in the space
bool isValid() const
TrackClassifier const & evaluate(reco::TrackBaseRef const &)
Classify the RecoTrack in categories.
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
T sqrt(T t)
Definition: SSEVec.h:19
double pt() const
track transverse momentum
Definition: TrackBase.h:637
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:798
static const std::vector< std::string > TrkHistCat
void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)
bool isPixel() const
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:622
const Flags & flags() const
Returns flags with the category descriptions.
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
const reco::TrackBaseRef toTrackRef(const edm::Ptr< reco::Candidate > &cnd)
const map_type & map() const
int numberOfValidPixelHits() const
Definition: HitPattern.h:825
std::vector< bool > Flags
Main types associated to the class.
TrajectoryStateOnSurface impactPointState() const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
const std::pair< TrackingParticleRef, double > getMatchedTrackingParticle() const
Definition: TrackHistory.h:58
math::XYZVectorD Vector
point in the space
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:608
void BDHadronTrackMonitoringAnalyzer::bookHistograms ( DQMStore::IBooker ibook,
edm::Run const &  run,
edm::EventSetup const &  es 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 48 of file BDHadronTrackMonitoringAnalyzer.cc.

References dqm::implementation::IBooker::book1D(), mps_fire::i, nTrk_bjet, nTrk_cjet, nTrk_dusgjet, nTrkAll_bjet, nTrkAll_cjet, nTrkAll_dusgjet, dqm::implementation::NavigatorBase::setCurrentFolder(), RecoBTag::setTDRStyle(), TrkDxy_alljets, TrkDz_alljets, TrkEta_alljets, TrkHistCat, TrkHitAll_alljets, TrkHitPixel_alljets, TrkHitStrip_alljets, TrkPhi_alljets, TrkPt_alljets, TrkTruthDxy_alljets, TrkTruthDz_alljets, TrkTruthEta_alljets, TrkTruthHitAll_alljets, TrkTruthHitPixel_alljets, TrkTruthHitStrip_alljets, TrkTruthPhi_alljets, and TrkTruthPt_alljets.

50  {
51  ibook.setCurrentFolder("BDHadronTracks/JetContent");
52  //
53  // Book all histograms.
54  //
56 
57  nTrkAll_bjet = ibook.book1D(
58  "nTrkAll_bjet", "Number of selected tracks in b jets;number of selected tracks;jets", 16, -0.5, 15.5);
59 
60  nTrkAll_cjet = ibook.book1D(
61  "nTrkAll_cjet", "Number of selected tracks in c jets;number of selected tracks;jets", 16, -0.5, 15.5);
62 
63  nTrkAll_dusgjet = ibook.book1D(
64  "nTrkAll_dusgjet", "Number of selected tracks in dusg jets;number of selected tracks;jets", 16, -0.5, 15.5);
65 
66  // Loop over different Track History Categories
67  for (unsigned int i = 0; i < TrkHistCat.size(); i++) {
68  ibook.setCurrentFolder("BDHadronTracks/JetContent");
69  // b jets
70  nTrk_bjet[i] = ibook.book1D("nTrk_bjet_" + TrkHistCat[i],
71  "Number of selected tracks in b jets (" + TrkHistCat[i] +
72  ");number of selected tracks (" + TrkHistCat[i] + ");jets",
73  16,
74  -0.5,
75  15.5);
76 
77  // c jets
78  nTrk_cjet[i] = ibook.book1D("nTrk_cjet_" + TrkHistCat[i],
79  "Number of selected tracks in c jets (" + TrkHistCat[i] +
80  ");number of selected tracks (" + TrkHistCat[i] + ");jets",
81  16,
82  -0.5,
83  15.5);
84 
85  // dusg jets
86  nTrk_dusgjet[i] = ibook.book1D("nTrk_dusgjet_" + TrkHistCat[i],
87  "Number of selected tracks in dusg jets (" + TrkHistCat[i] +
88  ");number of selected tracks (" + TrkHistCat[i] + ");jets",
89  16,
90  -0.5,
91  15.5);
92 
93  ibook.setCurrentFolder("BDHadronTracks/TrackInfo");
94  // track properties for all flavours combined
95  TrkPt_alljets[i] = ibook.book1D("TrkPt_" + TrkHistCat[i],
96  "Track pT (" + TrkHistCat[i] + ");track p_{T} (" + TrkHistCat[i] + ");tracks",
97  30,
98  0,
99  100);
100  TrkEta_alljets[i] = ibook.book1D("TrkEta_" + TrkHistCat[i],
101  "Track #eta (" + TrkHistCat[i] + ");track #eta (" + TrkHistCat[i] + ");tracks",
102  30,
103  -2.5,
104  2.5);
105  TrkPhi_alljets[i] = ibook.book1D("TrkPhi_" + TrkHistCat[i],
106  "Track #phi (" + TrkHistCat[i] + ");track #phi (" + TrkHistCat[i] + ");tracks",
107  30,
108  -3.15,
109  3.15);
110  TrkDxy_alljets[i] = ibook.book1D("TrkDxy_" + TrkHistCat[i],
111  "Track dxy (" + TrkHistCat[i] + ");track dxy (" + TrkHistCat[i] + ");tracks",
112  30,
113  -0.1,
114  0.1);
115  TrkDz_alljets[i] = ibook.book1D("TrkDz_" + TrkHistCat[i],
116  "Track dz (" + TrkHistCat[i] + ");track dz (" + TrkHistCat[i] + ");tracks",
117  30,
118  -0.1,
119  0.1);
120  TrkHitAll_alljets[i] = ibook.book1D(
121  "TrkHitAll_" + TrkHistCat[i],
122  "Number of tracker hits (" + TrkHistCat[i] + ");track number of all hits (" + TrkHistCat[i] + ");tracks",
123  31,
124  -0.5,
125  30.5);
126  TrkHitStrip_alljets[i] = ibook.book1D(
127  "TrkHitStrip_" + TrkHistCat[i],
128  "Number of strip hits (" + TrkHistCat[i] + ");track number of strip hits (" + TrkHistCat[i] + ");tracks",
129  31,
130  -0.5,
131  30.5);
132  TrkHitPixel_alljets[i] = ibook.book1D(
133  "TrkHitPixel_" + TrkHistCat[i],
134  "Number of pixel hits (" + TrkHistCat[i] + ");track number of pixel hits (" + TrkHistCat[i] + ");tracks",
135  9,
136  -0.5,
137  8.5);
138 
139  ibook.setCurrentFolder("BDHadronTracks/TrackTruthInfo");
140  if (i < 5) { // Fakes (i == 5) have no truth by definition!
142  ibook.book1D("TrkTruthPt_" + TrkHistCat[i],
143  "Track pT (" + TrkHistCat[i] + " Truth);track p_{T} (" + TrkHistCat[i] + " Truth);tracks",
144  30,
145  0,
146  100);
148  ibook.book1D("TrkTruthEta_" + TrkHistCat[i],
149  "Track #eta (" + TrkHistCat[i] + " Truth);track #eta (" + TrkHistCat[i] + " Truth);tracks",
150  30,
151  -2.5,
152  2.5);
154  ibook.book1D("TrkTruthPhi_" + TrkHistCat[i],
155  "Track #phi (" + TrkHistCat[i] + " Truth);track #phi (" + TrkHistCat[i] + " Truth);tracks",
156  30,
157  -3.15,
158  3.15);
160  ibook.book1D("TrkTruthDxy_" + TrkHistCat[i],
161  "Track dxy (" + TrkHistCat[i] + " Truth);track dxy (" + TrkHistCat[i] + " Truth);tracks",
162  30,
163  -0.1,
164  0.1);
166  ibook.book1D("TrkTruthDz_" + TrkHistCat[i],
167  "Track dz (" + TrkHistCat[i] + " Truth);track dz (" + TrkHistCat[i] + " Truth);tracks",
168  30,
169  -0.1,
170  0.1);
172  ibook.book1D("TrkTruthHitAll_" + TrkHistCat[i],
173  "Number of tracker hits (" + TrkHistCat[i] + " Truth);track number of all hits (" +
174  TrkHistCat[i] + " Truth);tracks",
175  31,
176  -0.5,
177  30.5);
179  ibook.book1D("TrkTruthHitStrip_" + TrkHistCat[i],
180  "Number of strip hits (" + TrkHistCat[i] + " Truth);track number of strip hits (" +
181  TrkHistCat[i] + " Truth);tracks",
182  31,
183  -0.5,
184  30.5);
186  ibook.book1D("TrkTruthHitPixel_" + TrkHistCat[i],
187  "Number of pixel hits (" + TrkHistCat[i] + " Truth);track number of pixel hits (" +
188  TrkHistCat[i] + " Truth);tracks",
189  9,
190  -0.5,
191  8.5);
192  }
193  }
194 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
TStyle * setTDRStyle()
Definition: Tools.cc:343
static const std::vector< std::string > TrkHistCat
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

Member Data Documentation

TrackClassifier BDHadronTrackMonitoringAnalyzer::classifier_
private

Definition at line 82 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze().

edm::InputTag BDHadronTrackMonitoringAnalyzer::ClusterTPMapSrc_
private

Definition at line 73 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by BDHadronTrackMonitoringAnalyzer().

edm::EDGetTokenT<ClusterTPAssociation> BDHadronTrackMonitoringAnalyzer::clusterTPMapToken_
private

Definition at line 79 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and BDHadronTrackMonitoringAnalyzer().

double BDHadronTrackMonitoringAnalyzer::decayLength_
private

Definition at line 62 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze().

double BDHadronTrackMonitoringAnalyzer::distJetAxis_
private

Definition at line 61 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze().

std::string BDHadronTrackMonitoringAnalyzer::ipTagInfos_
private

Definition at line 67 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze().

double BDHadronTrackMonitoringAnalyzer::maxJetEta_
private

Definition at line 64 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze().

double BDHadronTrackMonitoringAnalyzer::minJetPt_
private

Definition at line 63 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze().

MonitorElement* BDHadronTrackMonitoringAnalyzer::nTrk_bjet[6]
private

Definition at line 87 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BDHadronTrackMonitoringAnalyzer::nTrk_cjet[6]
private

Definition at line 91 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BDHadronTrackMonitoringAnalyzer::nTrk_dusgjet[6]
private

Definition at line 95 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BDHadronTrackMonitoringAnalyzer::nTrkAll_bjet
private

Definition at line 86 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BDHadronTrackMonitoringAnalyzer::nTrkAll_cjet
private

Definition at line 90 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BDHadronTrackMonitoringAnalyzer::nTrkAll_dusgjet
private

Definition at line 94 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<pat::JetCollection> BDHadronTrackMonitoringAnalyzer::PatJetCollectionTag_
private

Definition at line 76 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and BDHadronTrackMonitoringAnalyzer().

edm::InputTag BDHadronTrackMonitoringAnalyzer::PatJetSrc_
private

Definition at line 70 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by BDHadronTrackMonitoringAnalyzer().

edm::EDGetTokenT<reco::VertexCollection> BDHadronTrackMonitoringAnalyzer::PrimaryVertexColl_
private

Definition at line 78 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and BDHadronTrackMonitoringAnalyzer().

edm::InputTag BDHadronTrackMonitoringAnalyzer::PVSrc_
private

Definition at line 72 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by BDHadronTrackMonitoringAnalyzer().

edm::EDGetTokenT<reco::TrackCollection> BDHadronTrackMonitoringAnalyzer::TrackCollectionTag_
private

Definition at line 77 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and BDHadronTrackMonitoringAnalyzer().

edm::InputTag BDHadronTrackMonitoringAnalyzer::TrackSrc_
private

Definition at line 71 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by BDHadronTrackMonitoringAnalyzer().

MonitorElement* BDHadronTrackMonitoringAnalyzer::TrkDxy_alljets[6]
private

Definition at line 105 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BDHadronTrackMonitoringAnalyzer::TrkDz_alljets[6]
private

Definition at line 108 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BDHadronTrackMonitoringAnalyzer::TrkEta_alljets[6]
private

Definition at line 101 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

const std::vector< std::string > BDHadronTrackMonitoringAnalyzer::TrkHistCat
static
Initial value:
= {
"BCWeakDecay", "BWeakDecay", "CWeakDecay", "PU", "Other", "Fake"}

Definition at line 57 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), bookHistograms(), and BDHadronTrackMonitoringHarvester::dqmEndJob().

MonitorElement* BDHadronTrackMonitoringAnalyzer::TrkHitAll_alljets[6]
private

Definition at line 111 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BDHadronTrackMonitoringAnalyzer::TrkHitPixel_alljets[6]
private

Definition at line 117 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BDHadronTrackMonitoringAnalyzer::TrkHitStrip_alljets[6]
private

Definition at line 114 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BDHadronTrackMonitoringAnalyzer::TrkPhi_alljets[6]
private

Definition at line 103 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* BDHadronTrackMonitoringAnalyzer::TrkPt_alljets[6]
private

Definition at line 99 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * BDHadronTrackMonitoringAnalyzer::TrkTruthDxy_alljets[5]
private

Definition at line 105 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * BDHadronTrackMonitoringAnalyzer::TrkTruthDz_alljets[5]
private

Definition at line 108 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * BDHadronTrackMonitoringAnalyzer::TrkTruthEta_alljets[5]
private

Definition at line 101 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * BDHadronTrackMonitoringAnalyzer::TrkTruthHitAll_alljets[5]
private

Definition at line 111 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * BDHadronTrackMonitoringAnalyzer::TrkTruthHitPixel_alljets[5]
private

Definition at line 117 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * BDHadronTrackMonitoringAnalyzer::TrkTruthHitStrip_alljets[5]
private

Definition at line 114 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * BDHadronTrackMonitoringAnalyzer::TrkTruthPhi_alljets[5]
private

Definition at line 103 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * BDHadronTrackMonitoringAnalyzer::TrkTruthPt_alljets[5]
private

Definition at line 99 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and bookHistograms().

edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> BDHadronTrackMonitoringAnalyzer::ttrackToken_
private

Definition at line 80 of file BDHadronTrackMonitoringAnalyzer.h.

Referenced by analyze(), and BDHadronTrackMonitoringAnalyzer().