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 &)
 
 SiPixelPhase1RecHits (const edm::ParameterSet &conf)
 
- Public Member Functions inherited from SiPixelPhase1Base
void analyze (edm::Event const &e, edm::EventSetup const &eSetup)=0
 
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 & 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 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 15 of file SiPixelPhase1RecHits.h.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

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

Definition at line 27 of file SiPixelPhase1RecHits.cc.

References edm::ParameterSet::getParameter(), onlyValid_, and srcToken_.

27  :
28  SiPixelPhase1Base(iConfig)
29 {
30  srcToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("src"));
31  onlyValid_=iConfig.getParameter<bool>("onlyValidHits");
32 }
SiPixelPhase1Base(const edm::ParameterSet &iConfig)
edm::EDGetTokenT< reco::TrackCollection > srcToken_

Member Function Documentation

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

Definition at line 34 of file SiPixelPhase1RecHits.cc.

References 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(), Topology::measurementPosition(), NRECHITS, 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, 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().

34  {
35 
37  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
38  assert(tracker.isValid());
39 
41  iEvent.getByToken( srcToken_, tracks);
42  if (!tracks.isValid()) return;
43 
44  for (auto const & track : *tracks) {
45 
46  bool isBpixtrack = false, isFpixtrack = false;
47 
48  auto const & trajParams = track.extra()->trajParams();
49  auto hb = track.recHitsBegin();
50  for(unsigned int h=0;h<track.recHitsSize();h++){
51 
52  auto hit = *(hb+h);
53  if(!hit->isValid()) continue;
54 
55  DetId id = hit->geographicalId();
56  uint32_t subdetid = (id.subdetId());
57 
58  if (subdetid == PixelSubdetector::PixelBarrel) isBpixtrack = true;
59  if (subdetid == PixelSubdetector::PixelEndcap) isFpixtrack = true;
60  }
61 
62  if (!isBpixtrack && !isFpixtrack) continue;
63 
64  // then, look at each hit
65  for(unsigned int h=0;h<track.recHitsSize();h++){
66  auto rechit = *(hb+h);
67 
68  if(!rechit->isValid()) continue;
69 
70  //continue if not a Pixel recHit
71  DetId id = rechit->geographicalId();
72  uint32_t subdetid = (id.subdetId());
73 
74  if ( subdetid != PixelSubdetector::PixelBarrel
75  && subdetid != PixelSubdetector::PixelEndcap) continue;
76 
77  bool isHitValid = rechit->getType()==TrackingRecHit::valid;
78  if (onlyValid_ && !isHitValid) continue; //useful to run on cosmics where the TrackEfficiency plugin is not used
79 
80  const SiPixelRecHit* prechit = dynamic_cast<const SiPixelRecHit*>(rechit);//to be used to get the associated cluster and the cluster probability
81 
82  int sizeX=0, sizeY=0;
83 
84  if (isHitValid){
85  SiPixelRecHit::ClusterRef const& clust = prechit->cluster();
86  sizeX = (*clust).sizeX();
87  sizeY = (*clust).sizeY();
88  }
89 
90  const PixelGeomDetUnit* geomdetunit = dynamic_cast<const PixelGeomDetUnit*> ( tracker->idToDet(id) );
91  const PixelTopology& topol = geomdetunit->specificTopology();
92 
93  LocalPoint lp = trajParams[h].position();
95 
96  int row = (int) mp.x();
97  int col = (int) mp.y();
98 
99  float rechit_x = lp.x();
100  float rechit_y = lp.y();
101 
102  LocalError lerr = rechit->localPositionError();
103  float lerr_x = sqrt(lerr.xx());
104  float lerr_y = sqrt(lerr.yy());
105 
106  histo[NRECHITS].fill(id, &iEvent, col, row); //in general a inclusive counter of missing/valid/inactive hits
107 
108  if (isHitValid){
109  histo[CLUST_X].fill(sizeX, id, &iEvent, col, row);
110  histo[CLUST_Y].fill(sizeY, id, &iEvent, col, row);
111  }
112 
113  histo[ERROR_X].fill(lerr_x, id, &iEvent);
114  histo[ERROR_Y].fill(lerr_y, id, &iEvent);
115 
116  histo[POS].fill(rechit_x, rechit_y, id, &iEvent);
117 
118  if (isHitValid){
119  double clusterProbability= prechit->clusterProbability(0);
120  if (clusterProbability > 0)
121  histo[CLUSTER_PROB].fill(log10(clusterProbability), id, &iEvent);
122  }
123  }
124  }
125 
126  histo[NRECHITS].executePerEventHarvesting(&iEvent);
127 }
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:460
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
Definition: DetId.h:18
ClusterRef cluster() const
Definition: SiPixelRecHit.h:49
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
col
Definition: cuy.py:1008
bool isValid() const
Definition: ESHandle.h:47
T x() const
Definition: PV2DBase.h:45
T x() const
Definition: PV3DBase.h:62
edm::EDGetTokenT< reco::TrackCollection > srcToken_
const TrackerGeomDet * idToDet(DetId) const
Our base class.
Definition: SiPixelRecHit.h:23

Member Data Documentation

bool SiPixelPhase1RecHits::onlyValid_
private

Definition at line 26 of file SiPixelPhase1RecHits.h.

Referenced by analyze(), and SiPixelPhase1RecHits().

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

Definition at line 33 of file SiPixelPhase1RecHits.h.

Referenced by analyze(), and SiPixelPhase1RecHits().