CMS 3D CMS Logo

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

#include <DQMOffline/CalibTracker/plugins/SiPixelCalSingleMuonAnalyzer.cc>

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

Public Member Functions

 SiPixelCalSingleMuonAnalyzer (const edm::ParameterSet &)
 
 ~SiPixelCalSingleMuonAnalyzer () override=default
 
- 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 Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- 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< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 

Private Types

typedef dqm::reco::MonitorElement MonitorElement
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void countClusters (const edm::Handle< SiPixelClusterCollectionNew > &handle, unsigned int &nClusGlobal)
 
const bool detidIsOnPixel (const DetId &detid)
 
std::pair< float, float > findClosestCluster (const edm::Handle< SiPixelClusterCollectionNew > &handle, const PixelClusterParameterEstimator *pixelCPE_, const TrackerGeometry *trackerGeometry_, uint32_t rawId, float traj_lx, float traj_ly)
 
TrajectoryStateOnSurface getTrajectoryStateOnSurface (const TrajectoryMeasurement &measurement)
 

Private Attributes

const edm::EDGetTokenT< SiPixelClusterCollectionNewclustersToken_
 
const edm::EDGetTokenT< edm::ValueMap< std::vector< float > > > distanceToken_
 
const std::string dqm_path_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeomEsToken_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeomEsTokenBR_
 
MonitorElementh_distClosestInactive
 
MonitorElementh_distClosestMissing
 
MonitorElementh_distClosestTrack
 
MonitorElementh_distClosestValid
 
MonitorElementh_nALCARECOClusters
 
MonitorElementh_nCloseByClusters
 
const edm::EDGetTokenT< edm::View< reco::Track > > muonTracksToken_
 
const edm::EDGetTokenT< SiPixelClusterCollectionNewnearByClustersToken_
 
bool phase_
 
const edm::ESGetToken< PixelClusterParameterEstimator, TkPixelCPERecordpixelCPEEsToken_
 
SiPixelDetInfoFileReader reader_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoEsTokenBR_
 
const edm::EDGetTokenT< TrajTrackAssociationCollectiontrajTrackCollectionToken_
 

Additional Inherited Members

- 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
 
- 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

Description: Analysis of the closebyPixelClusters collections for Pixel Hit Efficiency mearurements purposes

Definition at line 50 of file SiPixelCalSingleMuonAnalyzer.cc.

Member Typedef Documentation

◆ MonitorElement

Definition at line 85 of file SiPixelCalSingleMuonAnalyzer.cc.

Constructor & Destructor Documentation

◆ SiPixelCalSingleMuonAnalyzer()

SiPixelCalSingleMuonAnalyzer::SiPixelCalSingleMuonAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 98 of file SiPixelCalSingleMuonAnalyzer.cc.

100  pixelCPEEsToken_(esConsumes(edm::ESInputTag("", "PixelCPEGeneric"))),
101  geomEsTokenBR_(esConsumes<edm::Transition::BeginRun>()),
102  topoEsTokenBR_(esConsumes<edm::Transition::BeginRun>()),
103  clustersToken_(consumes<SiPixelClusterCollectionNew>(iConfig.getParameter<edm::InputTag>("clusterCollection"))),
105  consumes<SiPixelClusterCollectionNew>(iConfig.getParameter<edm::InputTag>("nearByClusterCollection"))),
107  consumes<TrajTrackAssociationCollection>(iConfig.getParameter<edm::InputTag>("trajectoryInput"))),
108  distanceToken_(consumes<edm::ValueMap<std::vector<float>>>(iConfig.getParameter<edm::InputTag>("distToTrack"))),
109  muonTracksToken_(consumes<edm::View<reco::Track>>(iConfig.getParameter<edm::InputTag>("muonTracks"))),
110  dqm_path_(iConfig.getParameter<std::string>("dqmPath")),
111  reader_(edm::FileInPath(iConfig.getParameter<std::string>("skimmedGeometryPath")).fullPath()) {}
const edm::EDGetTokenT< edm::View< reco::Track > > muonTracksToken_
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDGetTokenT< SiPixelClusterCollectionNew > nearByClustersToken_
std::string fullPath() const
Definition: FileInPath.cc:161
const edm::EDGetTokenT< TrajTrackAssociationCollection > trajTrackCollectionToken_
const edm::EDGetTokenT< edm::ValueMap< std::vector< float > > > distanceToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomEsTokenBR_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomEsToken_
const edm::ESGetToken< PixelClusterParameterEstimator, TkPixelCPERecord > pixelCPEEsToken_
const edm::EDGetTokenT< SiPixelClusterCollectionNew > clustersToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoEsTokenBR_

◆ ~SiPixelCalSingleMuonAnalyzer()

SiPixelCalSingleMuonAnalyzer::~SiPixelCalSingleMuonAnalyzer ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 118 of file SiPixelCalSingleMuonAnalyzer.cc.

References clustersToken_, countClusters(), detidIsOnPixel(), HLT_2022v14_cff::distance, distanceToken_, dqm::impl::MonitorElement::Fill(), findClosestCluster(), geomEsToken_, edm::EventSetup::getData(), getTrajectoryStateOnSurface(), h_distClosestInactive, h_distClosestMissing, h_distClosestTrack, h_distClosestValid, h_nALCARECOClusters, h_nCloseByClusters, iEvent, TrackingRecHit::inactive, TrajectoryStateOnSurface::isValid(), edm::Ref< C, T, F >::key(), TrajectoryStateOnSurface::localPosition(), LogDebug, LogTrace, TrackingRecHit::missing, ALCARECOTkAlDQM_cff::muonTracks, muonTracksToken_, nearByClustersToken_, custom_jme_cff::nMuons, pixelCPEEsToken_, DetId::rawId(), rpcPointValidation_cfi::recHit, mathSSE::sqrt(), HLT_2022v14_cff::track, trajTrackCollectionToken_, TrackingRecHit::valid, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

118  {
119  using namespace edm;
120 
121  // get the Tracker geometry from event setup
122  const TrackerGeometry* trackerGeometry_ = &iSetup.getData(geomEsToken_);
123 
124  // get the Pixel CPE from event setup
125  const PixelClusterParameterEstimator* pixelCPE_ = &iSetup.getData(pixelCPEEsToken_);
126 
127  // get the muon track collection
128  const auto& muonTrackCollectionHandle = iEvent.getHandle(muonTracksToken_);
129  auto const& muonTracks = *muonTrackCollectionHandle;
130 
131  // get the track distances
132  const auto& distancesToTrack = iEvent.getHandle(distanceToken_);
133 
134  unsigned int nMuons = muonTracks.size();
135  for (unsigned int ij = 0; ij < nMuons; ij++) {
136  auto muon = muonTrackCollectionHandle->ptrAt(ij);
137  edm::RefToBase<reco::Track> trackRef = muonTrackCollectionHandle->refAt(ij);
138  const auto& distances = (*distancesToTrack)[trackRef];
139 
140  LogDebug("SiPixelCalSingleMuonAnalyzer") << "distances size: " << distances.size() << std::endl;
141 
142  unsigned counter = 0;
143  double closestDR = 999.;
144  for (const auto& distance : distances) {
145  counter++;
146  LogDebug("SiPixelCalSingleMuonAnalyzer")
147  << "track: " << counter << " distance:" << std::sqrt(distance) << std::endl;
148  if (distance < closestDR && distance > 0) {
149  closestDR = distance;
150  }
151  }
152 
153  h_distClosestTrack->Fill(std::sqrt(closestDR));
154  }
155 
156  // Get cluster collection
157  const auto& clusterCollectionHandle = iEvent.getHandle(clustersToken_);
158 
159  unsigned int nClusGlobal = 0;
160  countClusters(clusterCollectionHandle, nClusGlobal);
161 
162  h_nALCARECOClusters->Fill(nClusGlobal);
163  LogTrace("SiPixelCalSingleMuonAnalyzer") << "total ALCARECO clusters: " << nClusGlobal << std::endl;
164 
165  // Get nearby cluster collection
166  const auto& nearByClusterCollectionHandle = iEvent.getHandle(nearByClustersToken_);
167 
168  unsigned int nNearByClusGlobal = 0;
169  countClusters(nearByClusterCollectionHandle, nNearByClusGlobal);
170 
171  h_nCloseByClusters->Fill(nNearByClusGlobal);
172  LogTrace("SiPixelCalSingleMuonAnalyzer") << "total close-by clusters: " << nNearByClusGlobal << std::endl;
173 
174  // Get Traj-Track Collection
175  const auto& trajTrackCollectionHandle = iEvent.getHandle(trajTrackCollectionToken_);
176 
177  if (!trajTrackCollectionHandle.isValid())
178  return;
179 
180  for (const auto& pair : *trajTrackCollectionHandle) {
181  const edm::Ref<std::vector<Trajectory>> traj = pair.key;
182  const reco::TrackRef track = pair.val;
183 
184  for (const TrajectoryMeasurement& measurement : traj->measurements()) {
185  if (!measurement.updatedState().isValid())
186  return;
187 
188  const TransientTrackingRecHit::ConstRecHitPointer& recHit = measurement.recHit();
189 
190  // Only looking for pixel hits
191  DetId r_rawId = recHit->geographicalId();
192 
193  if (!this->detidIsOnPixel(r_rawId))
194  continue;
195 
196  // Skipping hits with undeterminable positions
197  TrajectoryStateOnSurface trajStateOnSurface = this->getTrajectoryStateOnSurface(measurement);
198 
199  if (!(trajStateOnSurface.isValid()))
200  continue;
201 
202  // Position measurements
203  // Looking for valid and missing hits
204  LocalPoint localPosition = trajStateOnSurface.localPosition();
205 
206  const auto& traj_lx = localPosition.x();
207  const auto& traj_ly = localPosition.y();
208 
209  const auto loc = this->findClosestCluster(
210  nearByClusterCollectionHandle, pixelCPE_, trackerGeometry_, r_rawId.rawId(), traj_lx, traj_ly);
211 
212  float dist = (loc.first != -999.) ? std::sqrt(loc.first * loc.first + loc.second * loc.second) : -0.1;
213 
214  if (recHit->getType() == TrackingRecHit::valid) {
215  LogTrace("SiPixelCalSingleMuonAnalyzer")
216  << "RawID:" << r_rawId.rawId() << " (valid hit), distance: " << dist << std::endl;
217  h_distClosestValid->Fill(dist);
218  }
219 
220  if (recHit->getType() == TrackingRecHit::missing) {
221  LogTrace("SiPixelCalSingleMuonAnalyzer")
222  << "RawID:" << r_rawId.rawId() << " (missing hit), distance: " << dist << std::endl;
223  h_distClosestMissing->Fill(dist);
224  }
225 
226  if (recHit->getType() == TrackingRecHit::inactive) {
227  LogTrace("SiPixelCalSingleMuonAnalyzer")
228  << "RawID:" << r_rawId.rawId() << " (inactive hit), distance: " << dist << std::endl;
230  }
231  }
232  }
233 }
const edm::EDGetTokenT< edm::View< reco::Track > > muonTracksToken_
const edm::EDGetTokenT< SiPixelClusterCollectionNew > nearByClustersToken_
const edm::EDGetTokenT< TrajTrackAssociationCollection > trajTrackCollectionToken_
key_type key() const
Accessor for product key.
Definition: Ref.h:250
#define LogTrace(id)
const edm::EDGetTokenT< edm::ValueMap< std::vector< float > > > distanceToken_
void Fill(long long x)
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
int iEvent
Definition: GenABIO.cc:224
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
T sqrt(T t)
Definition: SSEVec.h:19
bool getData(T &iHolder) const
Definition: EventSetup.h:122
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomEsToken_
const edm::ESGetToken< PixelClusterParameterEstimator, TkPixelCPERecord > pixelCPEEsToken_
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::pair< float, float > findClosestCluster(const edm::Handle< SiPixelClusterCollectionNew > &handle, const PixelClusterParameterEstimator *pixelCPE_, const TrackerGeometry *trackerGeometry_, uint32_t rawId, float traj_lx, float traj_ly)
HLT enums.
void countClusters(const edm::Handle< SiPixelClusterCollectionNew > &handle, unsigned int &nClusGlobal)
const bool detidIsOnPixel(const DetId &detid)
TrajectoryStateOnSurface getTrajectoryStateOnSurface(const TrajectoryMeasurement &measurement)
const edm::EDGetTokenT< SiPixelClusterCollectionNew > clustersToken_
#define LogDebug(id)

◆ bookHistograms()

void SiPixelCalSingleMuonAnalyzer::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 236 of file SiPixelCalSingleMuonAnalyzer.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book1I(), dqm_path_, h_distClosestInactive, h_distClosestMissing, h_distClosestTrack, h_distClosestValid, h_nALCARECOClusters, h_nCloseByClusters, and dqm::implementation::NavigatorBase::setCurrentFolder().

236  {
237  // book the overall event count and event types histograms
238  iBooker.setCurrentFolder(dqm_path_ + "/ClusterCounts");
239  h_nALCARECOClusters = iBooker.book1I(
240  "h_nALCARECOClusters", "Number of Pixel clusters per event (ALCARECO) ;N_{clusters};events", 20, 0, 20);
241  h_nCloseByClusters = iBooker.book1I(
242  "h_nCloseByClusters", "Number of Pixel clusters per event (close-by) ;N_{clusters};events", 20, 0, 20);
243 
244  iBooker.setCurrentFolder(dqm_path_ + "/TrajDistance");
246  iBooker.book1D("h_distClosestValid",
247  "Distance of Closest cluster to trajectory (valid);distance (cm); valid trajectory measurements",
248  110,
249  -0.105,
250  0.995);
251  h_distClosestMissing = iBooker.book1D(
252  "h_distClosestMissing",
253  "Distance of Closest cluster to trajectory (missing);distance (cm);missing trajectory measurements",
254  110,
255  -0.105,
256  0.995);
257  h_distClosestInactive = iBooker.book1D(
258  "h_distClosestInactive",
259  "Distance of Closest cluster to trajectory (inactive);distance (cm);inactive trajectory measurements",
260  110,
261  -0.105,
262  0.995);
263 
264  iBooker.setCurrentFolder(dqm_path_ + "/OtherTrackDistance");
266  iBooker.book1D("h_distClosestTrack",
267  "#DeltaR Distance of Closest track to the muon trajectory;#DeltaR distance; muon trajectories",
268  100,
269  0.,
270  5.);
271 }
MonitorElement * book1I(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ countClusters()

void SiPixelCalSingleMuonAnalyzer::countClusters ( const edm::Handle< SiPixelClusterCollectionNew > &  handle,
unsigned int &  nClusGlobal 
)
private

Definition at line 312 of file SiPixelCalSingleMuonAnalyzer.cc.

References patZpeak::handle, and LogDebug.

Referenced by analyze().

316 {
317  for (const auto& DSVItr : *handle) {
318  uint32_t rawid(DSVItr.detId());
319  DetId detId(rawid);
320  LogDebug("SiPixelCalSingleMuonAnalyzer") << "DetId: " << detId.rawId() << " size: " << DSVItr.size() << std::endl;
321  nClusGlobal += DSVItr.size();
322  }
323 }
Definition: DetId.h:17
#define LogDebug(id)

◆ detidIsOnPixel()

const bool SiPixelCalSingleMuonAnalyzer::detidIsOnPixel ( const DetId detid)
private

Definition at line 274 of file SiPixelCalSingleMuonAnalyzer.cc.

References DetId::det(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::subdetId(), and DetId::Tracker.

Referenced by analyze().

276 {
277  if (detid.det() != DetId::Tracker)
278  return false;
280  return true;
282  return true;
283  return false;
284 }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48

◆ fillDescriptions()

void SiPixelCalSingleMuonAnalyzer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 373 of file SiPixelCalSingleMuonAnalyzer.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, HLT_2022v14_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

373  {
375  desc.setComment("Analysis of the closebyPixelClusters collections");
376  desc.add<edm::InputTag>("clusterCollection", edm::InputTag("ALCARECOSiPixelCalSingleMuonTight"));
377  desc.add<edm::InputTag>("nearByClusterCollection", edm::InputTag("closebyPixelClusters"));
378  desc.add<edm::InputTag>("trajectoryInput", edm::InputTag("refittedTracks"));
379  desc.add<edm::InputTag>("muonTracks", edm::InputTag("ALCARECOSiPixelCalSingleMuonTight"));
380  desc.add<edm::InputTag>("distToTrack", edm::InputTag("trackDistances"));
381  desc.add<std::string>("dqmPath", "SiPixelCalSingleMuonTight");
382  desc.add<std::string>("skimmedGeometryPath",
383  "SLHCUpgradeSimulations/Geometry/data/PhaseI/PixelSkimmedGeometry_phase1.txt");
384  descriptions.addWithDefaultLabel(desc);
385 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ findClosestCluster()

std::pair< float, float > SiPixelCalSingleMuonAnalyzer::findClosestCluster ( const edm::Handle< SiPixelClusterCollectionNew > &  handle,
const PixelClusterParameterEstimator pixelCPE_,
const TrackerGeometry trackerGeometry_,
uint32_t  rawId,
float  traj_lx,
float  traj_ly 
)
private

Definition at line 326 of file SiPixelCalSingleMuonAnalyzer.cc.

References ALCARECOSiPixelCalSingleMuonDQM_cff::clusterCollection, edmNew::DetSet< T >::end(), PixelClusterParameterEstimator::getParameters(), patZpeak::handle, TrackerGeometry::idToDetUnit(), submitPVValidationJobs::params, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, GeomDetEnumerators::subDetId, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by analyze().

334 {
337 
338  float minD = 10e7;
339 
340  auto loc = std::make_pair(-999., -999.);
341 
342  for (; itClusterSet != clusterCollection.end(); itClusterSet++) {
343  DetId detId(itClusterSet->id());
344  if (detId.rawId() != rawId)
345  continue;
346 
347  unsigned int subDetId = detId.subdetId();
349  edm::LogError("NearByPixelClustersAnalyzer")
350  << "ERROR: not a pixel cluster!!!" << std::endl; // should not happen
351  continue;
352  }
353 
354  const PixelGeomDetUnit* pixdet = (const PixelGeomDetUnit*)trackerGeometry_->idToDetUnit(detId);
355  edmNew::DetSet<SiPixelCluster>::const_iterator itCluster = itClusterSet->begin();
356  for (; itCluster != itClusterSet->end(); ++itCluster) {
357  LocalPoint lp(itCluster->x(), itCluster->y(), 0.);
358  PixelClusterParameterEstimator::ReturnType params = pixelCPE_->getParameters(*itCluster, *pixdet);
359  lp = std::get<0>(params);
360 
361  float D = (lp.x() - traj_lx) * (lp.x() - traj_lx) + (lp.y() - traj_ly) * (lp.y() - traj_ly);
362  if (D < minD) {
363  minD = D;
364  loc.first = (lp.x() - traj_lx);
365  loc.second = (lp.y() - traj_ly);
366  }
367  } // loop on cluster sets
368  }
369  return loc;
370 }
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
constexpr unsigned int subDetId[21]
data_type const * const_iterator
Definition: DetSetNew.h:31
Log< level::Error, false > LogError
virtual ReturnType getParameters(const SiPixelCluster &cl, const GeomDetUnit &det) const =0
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetId.h:17
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
iterator end()
Definition: DetSetNew.h:56
std::tuple< LocalPoint, LocalError, SiPixelRecHitQuality::QualWordType > ReturnType

◆ getTrajectoryStateOnSurface()

TrajectoryStateOnSurface SiPixelCalSingleMuonAnalyzer::getTrajectoryStateOnSurface ( const TrajectoryMeasurement measurement)
private

Definition at line 287 of file SiPixelCalSingleMuonAnalyzer.cc.

References TrajectoryMeasurement::backwardPredictedState(), and TrajectoryMeasurement::forwardPredictedState().

Referenced by analyze().

290 {
291  const static TrajectoryStateCombiner trajStateCombiner;
292 
293  const auto& forwardPredictedState = measurement.forwardPredictedState();
294  const auto& backwardPredictedState = measurement.backwardPredictedState();
295 
296  if (forwardPredictedState.isValid() && backwardPredictedState.isValid())
297  return trajStateCombiner(forwardPredictedState, backwardPredictedState);
298 
299  else if (backwardPredictedState.isValid())
300  return backwardPredictedState;
301 
302  else if (forwardPredictedState.isValid())
303  return forwardPredictedState;
304 
305  edm::LogError("NearbyPixelClusterProducer") << "Error saving traj. measurement data."
306  << " Trajectory state on surface cannot be determined." << std::endl;
307 
308  return TrajectoryStateOnSurface();
309 }
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
Log< level::Error, false > LogError
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)

Member Data Documentation

◆ clustersToken_

const edm::EDGetTokenT<SiPixelClusterCollectionNew> SiPixelCalSingleMuonAnalyzer::clustersToken_
private

Definition at line 76 of file SiPixelCalSingleMuonAnalyzer.cc.

Referenced by analyze().

◆ distanceToken_

const edm::EDGetTokenT<edm::ValueMap<std::vector<float> > > SiPixelCalSingleMuonAnalyzer::distanceToken_
private

Definition at line 79 of file SiPixelCalSingleMuonAnalyzer.cc.

Referenced by analyze().

◆ dqm_path_

const std::string SiPixelCalSingleMuonAnalyzer::dqm_path_
private

Definition at line 82 of file SiPixelCalSingleMuonAnalyzer.cc.

Referenced by bookHistograms().

◆ geomEsToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiPixelCalSingleMuonAnalyzer::geomEsToken_
private

Definition at line 71 of file SiPixelCalSingleMuonAnalyzer.cc.

Referenced by analyze().

◆ geomEsTokenBR_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiPixelCalSingleMuonAnalyzer::geomEsTokenBR_
private

Definition at line 73 of file SiPixelCalSingleMuonAnalyzer.cc.

◆ h_distClosestInactive

MonitorElement* SiPixelCalSingleMuonAnalyzer::h_distClosestInactive
private

Definition at line 90 of file SiPixelCalSingleMuonAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ h_distClosestMissing

MonitorElement* SiPixelCalSingleMuonAnalyzer::h_distClosestMissing
private

Definition at line 89 of file SiPixelCalSingleMuonAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ h_distClosestTrack

MonitorElement* SiPixelCalSingleMuonAnalyzer::h_distClosestTrack
private

Definition at line 91 of file SiPixelCalSingleMuonAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ h_distClosestValid

MonitorElement* SiPixelCalSingleMuonAnalyzer::h_distClosestValid
private

Definition at line 88 of file SiPixelCalSingleMuonAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ h_nALCARECOClusters

MonitorElement* SiPixelCalSingleMuonAnalyzer::h_nALCARECOClusters
private

Definition at line 86 of file SiPixelCalSingleMuonAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ h_nCloseByClusters

MonitorElement* SiPixelCalSingleMuonAnalyzer::h_nCloseByClusters
private

Definition at line 87 of file SiPixelCalSingleMuonAnalyzer.cc.

Referenced by analyze(), and bookHistograms().

◆ muonTracksToken_

const edm::EDGetTokenT<edm::View<reco::Track> > SiPixelCalSingleMuonAnalyzer::muonTracksToken_
private

Definition at line 80 of file SiPixelCalSingleMuonAnalyzer.cc.

Referenced by analyze().

◆ nearByClustersToken_

const edm::EDGetTokenT<SiPixelClusterCollectionNew> SiPixelCalSingleMuonAnalyzer::nearByClustersToken_
private

Definition at line 77 of file SiPixelCalSingleMuonAnalyzer.cc.

Referenced by analyze().

◆ phase_

bool SiPixelCalSingleMuonAnalyzer::phase_
private

Definition at line 92 of file SiPixelCalSingleMuonAnalyzer.cc.

◆ pixelCPEEsToken_

const edm::ESGetToken<PixelClusterParameterEstimator, TkPixelCPERecord> SiPixelCalSingleMuonAnalyzer::pixelCPEEsToken_
private

Definition at line 72 of file SiPixelCalSingleMuonAnalyzer.cc.

Referenced by analyze().

◆ reader_

SiPixelDetInfoFileReader SiPixelCalSingleMuonAnalyzer::reader_
private

Definition at line 83 of file SiPixelCalSingleMuonAnalyzer.cc.

◆ topoEsTokenBR_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiPixelCalSingleMuonAnalyzer::topoEsTokenBR_
private

Definition at line 74 of file SiPixelCalSingleMuonAnalyzer.cc.

◆ trajTrackCollectionToken_

const edm::EDGetTokenT<TrajTrackAssociationCollection> SiPixelCalSingleMuonAnalyzer::trajTrackCollectionToken_
private

Definition at line 78 of file SiPixelCalSingleMuonAnalyzer.cc.

Referenced by analyze().