CMS 3D CMS Logo

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::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

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
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Attributes

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

Private Attributes

TrackClassifier classifier_
 
edm::InputTag ClusterTPMapSrc_
 
edm::EDGetTokenT< ClusterTPAssociationclusterTPMapToken_
 
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::JetCollectionPatJetCollectionTag_
 
edm::InputTag PatJetSrc_
 
edm::EDGetTokenT< reco::VertexCollectionPrimaryVertexColl_
 
edm::InputTag PVSrc_
 
edm::EDGetTokenT< reco::TrackCollectionTrackCollectionTag_
 
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]
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

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_, PatJetCollectionTag_, PatJetSrc_, PrimaryVertexColl_, PVSrc_, TrackCollectionTag_, and TrackSrc_.

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")),
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  // TrkHistCat = {"BCWeakDecay", "BWeakDecay", "CWeakDecay", "PU", "Other",
42  // "Fake"};
43 }
T getParameter(std::string const &) const
edm::EDGetTokenT< ClusterTPAssociation > clusterTPMapToken_
edm::EDGetTokenT< reco::TrackCollection > TrackCollectionTag_
edm::EDGetTokenT< reco::VertexCollection > PrimaryVertexColl_
edm::EDGetTokenT< pat::JetCollection > PatJetCollectionTag_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
BDHadronTrackMonitoringAnalyzer::~BDHadronTrackMonitoringAnalyzer ( )
override

Definition at line 197 of file BDHadronTrackMonitoringAnalyzer.cc.

197 {}

Member Function Documentation

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

Definition at line 205 of file BDHadronTrackMonitoringAnalyzer.cc.

References funct::abs(), BCWeakDecay, TransientTrackBuilder::build(), TrackCategories::BWeakDecay, BWeakDecay, classifier_, IPTools::closestApproachToJet(), clusterTPMapToken_, compare(), RecoVertex::convertPos(), TrackCategories::CWeakDecay, CWeakDecay, listHistos::decayLength, decayLength_, DEFINE_FWK_MODULE, distJetAxis_, reco::TrackBase::dxy(), reco::TrackBase::dz(), MillePedeFileConverter_cfg::e, reco::TrackBase::eta(), TrackClassifier::evaluate(), TrackCategories::Fake, Fake, reco::TransientTrack::field(), dqm::impl::MonitorElement::Fill(), TrackCategories::flags(), edm::EventSetup::get(), edm::Event::getByToken(), 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(), BeamMonitor_cff::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 HltBtagValidation_cff::Vertex.

205  {
207  iEvent.getByToken(PatJetCollectionTag_, patJetsColl);
208 
210  iEvent.getByToken(TrackCollectionTag_, tracksHandle);
211 
212  edm::Handle<ClusterTPAssociation> pCluster2TPListH;
213  iEvent.getByToken(clusterTPMapToken_, pCluster2TPListH);
214  const ClusterTPAssociation &clusterToTPMap = *pCluster2TPListH;
215 
217  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", trackBuilder);
218 
219  classifier_.newEvent(iEvent, iSetup);
220 
221  // -----Primary Vertex-----
222  const reco::Vertex *pv;
223 
225  iEvent.getByToken(PrimaryVertexColl_, primaryVertex);
226 
227  bool pvFound = (!primaryVertex->empty());
228  if (pvFound) {
229  pv = &(*primaryVertex->begin());
230  } else {
232  e(0, 0) = 0.0015 * 0.0015;
233  e(1, 1) = 0.0015 * 0.0015;
234  e(2, 2) = 15. * 15.;
235  reco::Vertex::Point p(0, 0, 0);
236  pv = new reco::Vertex(p, e, 1, 1, 1);
237  }
238  // -----------------------
239 
240  // -------- Loop Over Jets ----------
241  for (pat::JetCollection::const_iterator jet = patJetsColl->begin(); jet != patJetsColl->end(); ++jet) {
242  if (jet->pt() < minJetPt_ || std::fabs(jet->eta()) > maxJetEta_)
243  continue;
244 
245  unsigned int flav = abs(jet->hadronFlavour());
246 
247  // std::cout << "patJet collection has pfImpactParameterTagInfo?: " <<
248  // jet->hasTagInfo("pfImpactParameter") << std::endl;
249  const CandIPTagInfo *trackIpTagInfo = jet->tagInfoCandIP(ipTagInfos_);
250  const std::vector<edm::Ptr<reco::Candidate>> &selectedTracks(trackIpTagInfo->selectedTracks());
251 
252  unsigned int nseltracks = 0;
253  std::vector<int> nseltracksCat(TrkHistCat.size(),
254  0); // following the order of TrkHistCat
255 
256  unsigned int nTrackSize = selectedTracks.size(); // number of tracks from IPInfos to loop over
257  // -------- Loop Over (selected) Tracks ----------
258  for (unsigned int itt = 0; itt < nTrackSize; ++itt) {
259  const TrackBaseRef ptrackRef = toTrackRef(selectedTracks[itt]);
260  const reco::Track *ptrackPtr = reco::btag::toTrack(ptrackRef);
261  const reco::Track &ptrack = *ptrackPtr;
262 
263  reco::TransientTrack transientTrack = trackBuilder->build(ptrackPtr);
264  GlobalVector direction(jet->px(), jet->py(), jet->pz());
265 
266  Double_t distJetAxis = IPTools::jetTrackDistance(transientTrack, direction, *pv).second.value();
267 
268  Double_t decayLength = 999;
269  TrajectoryStateOnSurface closest =
270  IPTools::closestApproachToJet(transientTrack.impactPointState(), *pv, direction, transientTrack.field());
271  if (closest.isValid())
272  decayLength = (closest.globalPosition() - RecoVertex::convertPos(pv->position())).mag();
273  else
274  decayLength = 999;
275 
276  // extra cut ons the tracks
277  if (std::fabs(distJetAxis) > distJetAxis_ || decayLength > decayLength_) {
278  continue;
279  }
280  nseltracks += 1; // if it passed these cuts, nselectedtracks +1
281 
283 
284  double TrkPt = ptrack.pt();
285  double TrkEta = ptrack.eta();
286  double TrkPhi = ptrack.phi();
287  double TrkDxy = ptrack.dxy(pv->position());
288  double TrkDz = ptrack.dz(pv->position());
289  int TrknHitAll = ptrack.numberOfValidHits();
290  int TrknHitPixel = ptrack.hitPattern().numberOfValidPixelHits();
291  int TrknHitStrip = ptrack.hitPattern().numberOfValidStripHits();
292 
293  double TrkTruthPt = -99;
294  double TrkTruthEta = -99;
295  double TrkTruthPhi = -99;
296  double TrkTruthDxy = -1;
297  double TrkTruthDz = -1;
298  int TrkTruthnHitAll = -1;
299  int TrkTruthnHitPixel = -1;
300  int TrkTruthnHitStrip = -1;
301 
302  // Get corresponding Trackingparticle
303  std::pair<TrackingParticleRef, double> res = classifier_.history().getMatchedTrackingParticle();
304  TrackingParticleRef tpr = res.first;
305  double quality_tpr = res.second;
306 
307  // Match TP to hit-cluster (re-ordering according to TP rather than
308  // clusters and look for equal_range of a given tpr)
309  auto clusterTPmap = clusterToTPMap.map();
310  std::sort(clusterTPmap.begin(), clusterTPmap.end(), compare);
311  auto clusterRange =
312  std::equal_range(clusterTPmap.begin(), clusterTPmap.end(), std::make_pair(OmniClusterRef(), tpr), compare);
313  if (quality_tpr != 0) {
314  TrkTruthPt = tpr->pt();
315  TrkTruthEta = tpr->eta();
316  TrkTruthPhi = tpr->phi();
317 
318  const TrackingParticle::Point &vertex_pv = pv->position();
319  TrackingParticle::Point vertex_tpr = tpr->vertex();
320  TrackingParticle::Vector momentum_tpr = tpr->momentum();
321  TrkTruthDxy = (-(vertex_tpr.x() - vertex_pv.x()) * momentum_tpr.y() +
322  (vertex_tpr.y() - vertex_pv.y()) * momentum_tpr.x()) /
323  tpr->pt();
324  TrkTruthDz = (vertex_tpr.z() - vertex_pv.z()) - ((vertex_tpr.x() - vertex_pv.x()) * momentum_tpr.x() +
325  (vertex_tpr.y() - vertex_pv.y()) * momentum_tpr.y()) /
326  sqrt(momentum_tpr.perp2()) * momentum_tpr.z() /
327  sqrt(momentum_tpr.perp2());
328 
329  TrkTruthnHitAll = 0;
330  TrkTruthnHitPixel = 0;
331  TrkTruthnHitStrip = 0;
332  if (clusterRange.first != clusterRange.second) {
333  for (auto ip = clusterRange.first; ip != clusterRange.second; ++ip) {
334  const OmniClusterRef &cluster = ip->first;
335  if (cluster.isPixel() && cluster.isValid()) {
336  TrkTruthnHitPixel += 1;
337  }
338  if (cluster.isStrip() && cluster.isValid()) {
339  TrkTruthnHitStrip += 1;
340  }
341  }
342  }
343  TrkTruthnHitAll = TrkTruthnHitPixel + TrkTruthnHitStrip;
344  }
345 
346  // ----------- Filling the correct histograms based on jet flavour and
347  // Track history Category --------
348 
349  // BCWeakDecay
351  theFlag[TrackCategories::CWeakDecay]) {
361  if (quality_tpr != 0) {
370  }
371  }
372  // BWeakDecay
373  else if (theFlag[TrackCategories::SignalEvent] && theFlag[TrackCategories::BWeakDecay] &&
374  !theFlag[TrackCategories::CWeakDecay]) {
384  if (quality_tpr != 0) {
393  }
394  }
395  // CWeakDecay
396  else if (theFlag[TrackCategories::SignalEvent] && !theFlag[TrackCategories::BWeakDecay] &&
397  theFlag[TrackCategories::CWeakDecay]) {
407  if (quality_tpr != 0) {
416  }
417  }
418  // PU
419  else if (!theFlag[TrackCategories::SignalEvent] && !theFlag[TrackCategories::Fake]) {
420  nseltracksCat[BDHadronTrackMonitoringAnalyzer::PU] += 1;
429  if (quality_tpr != 0) {
438  }
439  }
440  // Other
441  else if (theFlag[TrackCategories::SignalEvent] && !theFlag[TrackCategories::BWeakDecay] &&
442  !theFlag[TrackCategories::CWeakDecay]) {
443  nseltracksCat[BDHadronTrackMonitoringAnalyzer::Other] += 1;
452  if (quality_tpr != 0) {
461  }
462  }
463  // Fake
464  else if (!theFlag[TrackCategories::SignalEvent] && theFlag[TrackCategories::Fake]) {
465  nseltracksCat[BDHadronTrackMonitoringAnalyzer::Fake] += 1;
474  // NO TRUTH FOR FAKES!!!
475  }
476  }
477  // -------- END Loop Over (selected) Tracks ----------
478  // Still have to fill some jet-flavour specific variables
479  if (flav == 5) {
480  nTrkAll_bjet->Fill(nseltracks);
481  for (unsigned int i = 0; i < TrkHistCat.size(); i++) {
482  nTrk_bjet[i]->Fill(nseltracksCat[i]);
483  }
484  } else if (flav == 4) {
485  nTrkAll_cjet->Fill(nseltracks);
486  for (unsigned int i = 0; i < TrkHistCat.size(); i++) {
487  nTrk_cjet[i]->Fill(nseltracksCat[i]);
488  }
489  } else {
490  nTrkAll_dusgjet->Fill(nseltracks);
491  for (unsigned int i = 0; i < TrkHistCat.size(); i++) {
492  nTrk_dusgjet[i]->Fill(nseltracksCat[i]);
493  }
494  }
495  }
496  // -------- END Loop Over Jets ----------
497 
498  if (!pvFound) {
499  delete pv;
500  }
501 }
reco::Vertex::Point convertPos(const GlobalPoint &p)
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:525
edm::EDGetTokenT< reco::TrackCollection > TrackCollectionTag_
edm::EDGetTokenT< reco::VertexCollection > PrimaryVertexColl_
reco::TransientTrack build(const reco::Track *p) const
int numberOfValidStripHits() const
Definition: HitPattern.h:813
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:43
GlobalPoint globalPosition() const
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:614
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:113
Definition: Electron.h:6
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:617
T sqrt(T t)
Definition: SSEVec.h:19
double pt() const
track transverse momentum
Definition: TrackBase.h:602
def pv(vc)
Definition: MetAnalyzer.py:7
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:740
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:596
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:483
const reco::TrackBaseRef toTrackRef(const edm::Ptr< reco::Candidate > &cnd)
T get() const
Definition: EventSetup.h:73
const map_type & map() const
int numberOfValidPixelHits() const
Definition: HitPattern.h:801
std::vector< bool > Flags
Main types associated to the class.
TrajectoryStateOnSurface impactPointState() const
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:587
primaryVertex
hltOfflineBeamSpot for HLTMON
void BDHadronTrackMonitoringAnalyzer::bookHistograms ( DQMStore::IBooker ibook,
edm::Run const &  run,
edm::EventSetup const &  es 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 47 of file BDHadronTrackMonitoringAnalyzer.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), mps_fire::i, nTrk_bjet, nTrk_cjet, nTrk_dusgjet, nTrkAll_bjet, nTrkAll_cjet, nTrkAll_dusgjet, dqm::dqmstoreimpl::DQMStore::IBooker::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.

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

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(), BDHadronTrackMonitoringHarvester::dqmEndJob(), and toTrackRef().

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().