test
CMS 3D CMS Logo

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

#include <SiPixelPhase1TrackEfficiency.h>

Inheritance diagram for SiPixelPhase1TrackEfficiency:
SiPixelPhase1Base DQMEDAnalyzer HistogramManagerHolder edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 
 SiPixelPhase1TrackEfficiency (const edm::ParameterSet &conf)
 
- Public Member Functions inherited from SiPixelPhase1Base
void bookHistograms (DQMStore::IBooker &iBooker, edm::Run const &run, edm::EventSetup const &iSetup)
 
 SiPixelPhase1Base (const edm::ParameterSet &iConfig)
 
virtual ~SiPixelPhase1Base ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & 
itemsToGetFromEvent () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 
- Public Member Functions inherited from HistogramManagerHolder
 HistogramManagerHolder (const edm::ParameterSet &iConfig)
 

Private Types

enum  { CLUSTER_PROB, VALID, MISSING, EFFICIENCY }
 

Private Attributes

edm::EDGetTokenT
< edmNew::DetSetVector
< SiPixelCluster > > 
clustersToken_
 
edm::EDGetTokenT
< TrajTrackAssociationCollection
trackAssociationToken_
 
edm::EDGetTokenT
< reco::VertexCollection
vtxToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 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 HistogramManagerHolder
GeometryInterface geometryInterface
 
std::vector< HistogramManagerhisto
 

Detailed Description

Definition at line 16 of file SiPixelPhase1TrackEfficiency.h.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

SiPixelPhase1TrackEfficiency::SiPixelPhase1TrackEfficiency ( const edm::ParameterSet conf)
explicit

Definition at line 24 of file SiPixelPhase1TrackEfficiency.cc.

References edm::ParameterSet::getParameter(), trackAssociationToken_, and vtxToken_.

24  :
25  SiPixelPhase1Base(iConfig)
26 {
27  trackAssociationToken_ = consumes<TrajTrackAssociationCollection>(iConfig.getParameter<edm::InputTag>("trajectories"));
28  vtxToken_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("primaryvertices"));
29 }
SiPixelPhase1Base(const edm::ParameterSet &iConfig)
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
edm::EDGetTokenT< TrajTrackAssociationCollection > trackAssociationToken_

Member Function Documentation

void SiPixelPhase1TrackEfficiency::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 31 of file SiPixelPhase1TrackEfficiency.cc.

References assert(), CLUSTER_PROB, SiPixelRecHit::clusterProbability(), cuy::col, edm::EventSetup::get(), edm::Event::getByToken(), HistogramManagerHolder::histo, edm::ESHandleBase::isValid(), BaseTrackerRecHit::localPositionFast(), Topology::measurementPosition(), MISSING, TrackingRecHit::missing, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, PixelGeomDetUnit::specificTopology(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, trackAssociationToken_, patCandidatesForDimuonsSequences_cff::tracker, VALID, TrackingRecHit::valid, HLT_25ns10e33_v2_cff::vertices, vtxToken_, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

31  {
32 
33  // get geometry
35  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
36  assert(tracker.isValid());
37 
38  // get primary vertex
40  iEvent.getByToken( vtxToken_, vertices);
41  if (!vertices.isValid() || vertices->size() == 0) return;
42  // should be used for weird cuts
43  //const auto primaryVertex = vertices->at(0);
44 
45  // get the map
47  iEvent.getByToken( trackAssociationToken_, ttac);
48 
49  for (auto& item : *ttac) {
50  auto trajectory_ref = item.key;
51  reco::TrackRef track_ref = item.val;
52 
53  bool isBpixtrack = false, isFpixtrack = false;
54  int nStripHits = 0;
55 
56  // first, look at the full track to see whether it is good
57  for (auto& measurement : trajectory_ref->measurements()) {
58  // check if things are all valid
59  if (!measurement.updatedState().isValid()) continue;
60  auto hit = measurement.recHit();
61  if (!hit->isValid()) continue;
62 
63  DetId id = hit->geographicalId();
64  uint32_t subdetid = (id.subdetId());
65 
66  // count strip hits
67  if(subdetid==StripSubdetector::TIB) nStripHits++;
68  if(subdetid==StripSubdetector::TOB) nStripHits++;
69  if(subdetid==StripSubdetector::TID) nStripHits++;
70  if(subdetid==StripSubdetector::TEC) nStripHits++;
71 
72  // check that we are in the pixel
73  if (subdetid == PixelSubdetector::PixelBarrel) isBpixtrack = true;
74  if (subdetid == PixelSubdetector::PixelEndcap) isFpixtrack = true;
75  }
76 
77  if (!isBpixtrack && !isFpixtrack) continue;
78 
79  // then, look at each hit
80  for (auto& measurement : trajectory_ref->measurements()) {
81  if (!measurement.updatedState().isValid()) continue;
82  auto hit = measurement.recHit();
83 
84  DetId id = hit->geographicalId();
85  uint32_t subdetid = (id.subdetId());
86  if ( subdetid != PixelSubdetector::PixelBarrel
87  && subdetid != PixelSubdetector::PixelEndcap) continue;
88 
89  bool isHitValid = hit->getType()==TrackingRecHit::valid;
90  bool isHitMissing = hit->getType()==TrackingRecHit::missing;
91 
92  const SiPixelRecHit* pixhit = dynamic_cast<const SiPixelRecHit*>(hit->hit());
93  int row = 0, col = 0;
94  if (pixhit) {
95  double clusterProbability= pixhit->clusterProbability(0);
96  if (clusterProbability > 0)
97  histo[CLUSTER_PROB].fill(log10(clusterProbability), id, &iEvent);
98 
99  const PixelGeomDetUnit* geomdetunit = dynamic_cast<const PixelGeomDetUnit*> ( tracker->idToDet(id) );
100  const PixelTopology& topol = geomdetunit->specificTopology();
101  LocalPoint const& lp = pixhit->localPositionFast();
102  MeasurementPoint mp = topol.measurementPosition(lp);
103  row = (int) mp.x();
104  col = (int) mp.y();
105  }
106 
107  if (isHitValid) histo[VALID ].fill(id, &iEvent, col, row);
108  if (isHitMissing) histo[MISSING].fill(id, &iEvent, col, row);
109  }
110  }
111 }
float clusterProbability(unsigned int flags=0) const
T y() const
Definition: PV2DBase.h:46
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
assert(m_qm.get())
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
Definition: DetId.h:18
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
const T & get() const
Definition: EventSetup.h:56
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
std::vector< HistogramManager > histo
const LocalPoint & localPositionFast() const
bool isValid() const
Definition: ESHandle.h:47
int col
Definition: cuy.py:1008
T x() const
Definition: PV2DBase.h:45
Our base class.
Definition: SiPixelRecHit.h:23
edm::EDGetTokenT< TrajTrackAssociationCollection > trackAssociationToken_

Member Data Documentation

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > SiPixelPhase1TrackEfficiency::clustersToken_
private

Definition at line 29 of file SiPixelPhase1TrackEfficiency.h.

edm::EDGetTokenT<TrajTrackAssociationCollection> SiPixelPhase1TrackEfficiency::trackAssociationToken_
private

Definition at line 30 of file SiPixelPhase1TrackEfficiency.h.

Referenced by analyze(), and SiPixelPhase1TrackEfficiency().

edm::EDGetTokenT<reco::VertexCollection> SiPixelPhase1TrackEfficiency::vtxToken_
private

Definition at line 31 of file SiPixelPhase1TrackEfficiency.h.

Referenced by analyze(), and SiPixelPhase1TrackEfficiency().