CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
SiPixelPhase1RecHits Class Reference

#include <SiPixelPhase1RecHits.h>

Inheritance diagram for SiPixelPhase1RecHits:
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 &) override
 
 SiPixelPhase1RecHits (const edm::ParameterSet &conf)
 
- Public Member Functions inherited from SiPixelPhase1Base
void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override=0
 
void bookHistograms (DQMStore::IBooker &iBooker, edm::Run const &run, edm::EventSetup const &iSetup) override
 
 SiPixelPhase1Base (const edm::ParameterSet &iConfig)
 
 ~SiPixelPhase1Base () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
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
 
 ~EDAnalyzerBase () 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
 
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
 
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  {
  NRECHITS, CLUST_X, CLUST_Y, ERROR_X,
  ERROR_Y, POS, CLUSTER_PROB
}
 

Private Attributes

bool applyVertexCut_
 
edm::EDGetTokenT< reco::VertexCollectionofflinePrimaryVerticesToken_
 
bool onlyValid_
 
edm::EDGetTokenT< reco::TrackCollectionsrcToken_
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
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::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (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 SiPixelPhase1Base
bool checktrigger (const edm::Event &iEvent, const edm::EventSetup &iSetup, const unsigned trgidx) const
 
- 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 SiPixelPhase1RecHits.h.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

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

Definition at line 22 of file SiPixelPhase1RecHits.cc.

References applyVertexCut_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), offlinePrimaryVerticesToken_, onlyValid_, srcToken_, and AlCaHLTBitMon_QueryRunRegistry::string.

22  :
23  SiPixelPhase1Base(iConfig)
24 {
25  srcToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("src"));
26 
27  offlinePrimaryVerticesToken_ = consumes<reco::VertexCollection>(std::string("offlinePrimaryVertices"));
28 
29  onlyValid_=iConfig.getParameter<bool>("onlyValidHits");
30 
31  applyVertexCut_=iConfig.getUntrackedParameter<bool>("VertexCut",true);
32 
33 }
SiPixelPhase1Base(const edm::ParameterSet &iConfig)
edm::EDGetTokenT< reco::VertexCollection > offlinePrimaryVerticesToken_
edm::EDGetTokenT< reco::TrackCollection > srcToken_

Member Function Documentation

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

Definition at line 35 of file SiPixelPhase1RecHits.cc.

References funct::abs(), applyVertexCut_, CLUST_X, CLUST_Y, SiPixelRecHit::cluster(), CLUSTER_PROB, SiPixelRecHit::clusterProbability(), cuy::col, DEFINE_FWK_MODULE, ERROR_X, ERROR_Y, edm::EventSetup::get(), edm::Event::getByToken(), h, hcalSimParameters_cfi::hb, HistogramManagerHolder::histo, TrackerGeometry::idToDet(), createfilelist::int, edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), Topology::measurementPosition(), NRECHITS, offlinePrimaryVerticesToken_, onlyValid_, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, POS, RecoTauValidation_cfi::sizeX, RecoTauValidation_cfi::sizeY, PixelGeomDetUnit::specificTopology(), mathSSE::sqrt(), srcToken_, HiIsolationCommonParameters_cff::track, mixOne_simraw_on_sim_cfi::tracker, l1t::tracks, TrackingRecHit::valid, electrons_cff::vertices, PV2DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV2DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::y(), and LocalError::yy().

35  {
36 
38  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
39  assert(tracker.isValid());
40 
42  iEvent.getByToken( srcToken_, tracks);
43  if (!tracks.isValid()) return;
44 
46  iEvent.getByToken(offlinePrimaryVerticesToken_, vertices);
47 
48  if (applyVertexCut_ && (!vertices.isValid() || vertices->empty())) return;
49 
50 
51  for (auto const & track : *tracks) {
52 
53  if (applyVertexCut_ && (track.pt() < 0.75 || std::abs( track.dxy(vertices->at(0).position()) ) > 5*track.dxyError())) continue;
54 
55  bool isBpixtrack = false, isFpixtrack = false;
56 
57  auto const & trajParams = track.extra()->trajParams();
58  auto hb = track.recHitsBegin();
59  for(unsigned int h=0;h<track.recHitsSize();h++){
60 
61  auto hit = *(hb+h);
62  if(!hit->isValid()) continue;
63 
64  DetId id = hit->geographicalId();
65  uint32_t subdetid = (id.subdetId());
66 
67  if (subdetid == PixelSubdetector::PixelBarrel) isBpixtrack = true;
68  if (subdetid == PixelSubdetector::PixelEndcap) isFpixtrack = true;
69  }
70 
71  if (!isBpixtrack && !isFpixtrack) continue;
72 
73  // then, look at each hit
74  for(unsigned int h=0;h<track.recHitsSize();h++){
75  auto rechit = *(hb+h);
76 
77  if(!rechit->isValid()) continue;
78 
79  //continue if not a Pixel recHit
80  DetId id = rechit->geographicalId();
81  uint32_t subdetid = (id.subdetId());
82 
83  if ( subdetid != PixelSubdetector::PixelBarrel
84  && subdetid != PixelSubdetector::PixelEndcap) continue;
85 
86  bool isHitValid = rechit->getType()==TrackingRecHit::valid;
87  if (onlyValid_ && !isHitValid) continue; //useful to run on cosmics where the TrackEfficiency plugin is not used
88 
89  const SiPixelRecHit* prechit = dynamic_cast<const SiPixelRecHit*>(rechit);//to be used to get the associated cluster and the cluster probability
90 
91  int sizeX=0, sizeY=0;
92 
93  if (isHitValid){
94  SiPixelRecHit::ClusterRef const& clust = prechit->cluster();
95  sizeX = (*clust).sizeX();
96  sizeY = (*clust).sizeY();
97  }
98 
99  const PixelGeomDetUnit* geomdetunit = dynamic_cast<const PixelGeomDetUnit*> ( tracker->idToDet(id) );
100  const PixelTopology& topol = geomdetunit->specificTopology();
101 
102  LocalPoint lp = trajParams[h].position();
103  MeasurementPoint mp = topol.measurementPosition(lp);
104 
105  int row = (int) mp.x();
106  int col = (int) mp.y();
107 
108  float rechit_x = lp.x();
109  float rechit_y = lp.y();
110 
111  LocalError lerr = rechit->localPositionError();
112  float lerr_x = sqrt(lerr.xx());
113  float lerr_y = sqrt(lerr.yy());
114 
115  histo[NRECHITS].fill(id, &iEvent, col, row); //in general a inclusive counter of missing/valid/inactive hits
116 
117  if (isHitValid){
118  histo[CLUST_X].fill(sizeX, id, &iEvent, col, row);
119  histo[CLUST_Y].fill(sizeY, id, &iEvent, col, row);
120  }
121 
122  histo[ERROR_X].fill(lerr_x, id, &iEvent);
123  histo[ERROR_Y].fill(lerr_y, id, &iEvent);
124 
125  histo[POS].fill(rechit_x, rechit_y, id, &iEvent);
126 
127  if (isHitValid){
128  double clusterProbability= prechit->clusterProbability(0);
129  if (clusterProbability > 0)
130  histo[CLUSTER_PROB].fill(log10(clusterProbability), id, &iEvent);
131  }
132  }
133  }
134 
135  histo[NRECHITS].executePerEventHarvesting(&iEvent);
136 }
float xx() const
Definition: LocalError.h:24
float clusterProbability(unsigned int flags=0) const
T y() const
Definition: PV2DBase.h:46
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
T y() const
Definition: PV3DBase.h:63
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:74
Definition: DetId.h:18
ClusterRef cluster() const
Definition: SiPixelRecHit.h:49
const T & get() const
Definition: EventSetup.h:55
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
std::vector< HistogramManager > histo
col
Definition: cuy.py:1008
const TrackerGeomDet * idToDet(DetId) const override
bool isValid() const
Definition: ESHandle.h:47
T x() const
Definition: PV2DBase.h:45
T x() const
Definition: PV3DBase.h:62
edm::EDGetTokenT< reco::VertexCollection > offlinePrimaryVerticesToken_
edm::EDGetTokenT< reco::TrackCollection > srcToken_
Our base class.
Definition: SiPixelRecHit.h:23

Member Data Documentation

bool SiPixelPhase1RecHits::applyVertexCut_
private

Definition at line 36 of file SiPixelPhase1RecHits.h.

Referenced by analyze(), and SiPixelPhase1RecHits().

edm::EDGetTokenT<reco::VertexCollection> SiPixelPhase1RecHits::offlinePrimaryVerticesToken_
private

Definition at line 33 of file SiPixelPhase1RecHits.h.

Referenced by analyze(), and SiPixelPhase1RecHits().

bool SiPixelPhase1RecHits::onlyValid_
private

Definition at line 35 of file SiPixelPhase1RecHits.h.

Referenced by analyze(), and SiPixelPhase1RecHits().

edm::EDGetTokenT<reco::TrackCollection> SiPixelPhase1RecHits::srcToken_
private

Definition at line 32 of file SiPixelPhase1RecHits.h.

Referenced by analyze(), and SiPixelPhase1RecHits().