CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
PixelClusterShapeExtractor Class Referencefinal
Inheritance diagram for PixelClusterShapeExtractor:
edm::global::EDAnalyzer<> edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::StreamID, const edm::Event &evt, const edm::EventSetup &) const override
 
void endJob () override
 
 PixelClusterShapeExtractor (const edm::ParameterSet &pset)
 
- Public Member Functions inherited from edm::global::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
bool wantsStreamLuminosityBlocks () const noexcept final
 
bool wantsStreamRuns () const noexcept final
 
- Public Member Functions inherited from edm::global::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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

using Lock = std::unique_lock< std::mutex >
 

Private Member Functions

void analyzeRecTracks (const edm::Event &ev, const edm::EventSetup &es) const
 
void analyzeSimHits (const edm::Event &ev, const edm::EventSetup &es) const
 
bool checkSimHits (const TrackingRecHit &recHit, TrackerHitAssociator const &theAssociator, PSimHit &simHit, pair< unsigned int, float > &key, unsigned int &ss) const
 
void init ()
 
bool isSuitable (const PSimHit &simHit, const GeomDetUnit &gdu) const
 
void processPixelRecHits (SiPixelRecHitCollection::DataContainer const &recHits, TrackerHitAssociator const &theAssociator, ClusterShapeHitFilter const &theFilter, SiPixelClusterShapeCache const &clusterShapeCache, const TrackerTopology &tkTpl) const
 
void processRec (const SiPixelRecHit &recHit, ClusterShapeHitFilter const &theFilter, LocalVector ldir, const SiPixelClusterShapeCache &clusterShapeCache, const vector< TH2F *> &histo) const
 
void processSim (const SiPixelRecHit &recHit, ClusterShapeHitFilter const &theClusterFilter, const PSimHit &simHit, const SiPixelClusterShapeCache &clusterShapeCache, const vector< TH2F *> &histo) const
 

Private Attributes

const edm::EDGetTokenT< SiPixelClusterShapeCacheclusterShapeCache_token
 
const edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecordcsfToken_
 
TFile * file
 
const bool hasRecTracks
 
const bool hasSimHits
 
std::vector< TH2F * > hrpc
 
std::vector< TH2F * > hspc
 
const bool noBPIX1
 
const edm::EDGetTokenT< edmNew::DetSetVector< SiPixelRecHit > > pixelRecHits_token
 
std::unique_ptr< std::mutex[]> theMutex
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoToken_
 Tokens for ESconsumes. More...
 
const TrackerHitAssociator::Config trackerHitAssociatorConfig_
 
const edm::EDGetTokenT< reco::TrackCollectiontracks_token
 

Additional Inherited Members

- Public Types inherited from edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 54 of file PixelClusterShapeExtractor.cc.

Member Typedef Documentation

◆ Lock

using PixelClusterShapeExtractor::Lock = std::unique_lock<std::mutex>
private

Definition at line 109 of file PixelClusterShapeExtractor.cc.

Constructor & Destructor Documentation

◆ PixelClusterShapeExtractor()

PixelClusterShapeExtractor::PixelClusterShapeExtractor ( const edm::ParameterSet pset)
explicit

Definition at line 149 of file PixelClusterShapeExtractor.cc.

References file, and init().

150  : topoToken_(esConsumes()),
151  csfToken_(esConsumes(edm::ESInputTag("", "ClusterShapeHitFilter"))),
152  hasSimHits(pset.getParameter<bool>("hasSimHits")),
153  hasRecTracks(pset.getParameter<bool>("hasRecTracks")),
154  noBPIX1(pset.getParameter<bool>("noBPIX1")),
155  tracks_token(hasRecTracks ? consumes<reco::TrackCollection>(pset.getParameter<edm::InputTag>("tracks"))
159  consumes<SiPixelClusterShapeCache>(pset.getParameter<edm::InputTag>("clusterShapeCacheSrc"))),
161  file = new TFile("clusterShape.root", "RECREATE");
162  file->cd();
163  init();
164 }
const edm::EDGetTokenT< SiPixelClusterShapeCache > clusterShapeCache_token
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Tokens for ESconsumes.
const TrackerHitAssociator::Config trackerHitAssociatorConfig_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
const edm::EDGetTokenT< edmNew::DetSetVector< SiPixelRecHit > > pixelRecHits_token
const edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecord > csfToken_
const edm::EDGetTokenT< reco::TrackCollection > tracks_token

Member Function Documentation

◆ analyze()

void PixelClusterShapeExtractor::analyze ( edm::StreamID  ,
const edm::Event evt,
const edm::EventSetup es 
) const
overridevirtual

Implements edm::global::EDAnalyzerBase.

Definition at line 378 of file PixelClusterShapeExtractor.cc.

References analyzeRecTracks(), analyzeSimHits(), makeMEIFBenchmarkPlots::ev, hasRecTracks, hasSimHits, and LogTrace.

378  {
379  if (hasSimHits) {
380  LogTrace("MinBiasTracking") << " [ClusterShape] analyze simHits, recHits";
381  analyzeSimHits(ev, es);
382  }
383 
384  if (hasRecTracks) {
385  LogTrace("MinBiasTracking") << " [ClusterShape] analyze recHits on recTracks";
386  analyzeRecTracks(ev, es);
387  }
388 }
#define LogTrace(id)
void analyzeSimHits(const edm::Event &ev, const edm::EventSetup &es) const
void analyzeRecTracks(const edm::Event &ev, const edm::EventSetup &es) const

◆ analyzeRecTracks()

void PixelClusterShapeExtractor::analyzeRecTracks ( const edm::Event ev,
const edm::EventSetup es 
) const
private

Definition at line 332 of file PixelClusterShapeExtractor.cc.

References cms::cuda::assert(), SiPixelPhase1OnlineDQM_cff::clusterShapeCache, clusterShapeCache_token, csfToken_, makeMEIFBenchmarkPlots::ev, edm::EventSetup::getData(), h, Hcal_Conditions_forGlobalTag_cff::hb, reco::TrackBase::highPurity, hrpc, fastTrackerRecHitType::isPixel(), noBPIX1, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, processRec(), rpcPointValidation_cfi::recHit, topoToken_, HLT_2024v14_cff::track, DiMuonV_cfg::tracks, and tracks_token.

Referenced by analyze().

332  {
333  auto const& theClusterShape = es.getData(csfToken_);
334  auto const& tkTpl = es.getData(topoToken_);
335 
336  // Get tracks
338  ev.getByToken(tracks_token, tracks);
339 
342 
343  for (auto const& track : *tracks) {
344  if (!track.quality(reco::Track::highPurity))
345  continue;
346  if (track.numberOfValidHits() < 8)
347  continue;
348  auto const& trajParams = track.extra()->trajParams();
349  assert(trajParams.size() == track.recHitsSize());
350  auto hb = track.recHitsBegin();
351  for (unsigned int h = 0; h < track.recHitsSize(); h++) {
352  auto recHit = *(hb + h);
353  if (!recHit->isValid())
354  continue;
355  auto id = recHit->geographicalId();
356  if (noBPIX1 && tkTpl.pxbLayer(id) == 1)
357  continue;
358 
359  // check that we are in the pixel
360  auto subdetid = (id.subdetId());
361  bool isPixel = subdetid == PixelSubdetector::PixelBarrel || subdetid == PixelSubdetector::PixelEndcap;
362 
363  auto const& ltp = trajParams[h];
364  auto ldir = ltp.momentum() / ltp.momentum().mag();
365 
366  if (isPixel) {
367  // Pixel
368  const SiPixelRecHit* pixelRecHit = dynamic_cast<const SiPixelRecHit*>(recHit);
369 
370  if (pixelRecHit != nullptr)
371  processRec(*pixelRecHit, theClusterShape, ldir, *clusterShapeCache, hrpc);
372  }
373  }
374  }
375 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const edm::EDGetTokenT< SiPixelClusterShapeCache > clusterShapeCache_token
assert(be >=bs)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Tokens for ESconsumes.
const edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecord > csfToken_
const edm::EDGetTokenT< reco::TrackCollection > tracks_token
void processRec(const SiPixelRecHit &recHit, ClusterShapeHitFilter const &theFilter, LocalVector ldir, const SiPixelClusterShapeCache &clusterShapeCache, const vector< TH2F *> &histo) const
bool isPixel(HitType hitType)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
Our base class.
Definition: SiPixelRecHit.h:23

◆ analyzeSimHits()

void PixelClusterShapeExtractor::analyzeSimHits ( const edm::Event ev,
const edm::EventSetup es 
) const
private

Definition at line 308 of file PixelClusterShapeExtractor.cc.

References SiPixelPhase1OnlineDQM_cff::clusterShapeCache, clusterShapeCache_token, csfToken_, edmNew::DetSetVector< T >::data(), makeMEIFBenchmarkPlots::ev, edm::EventSetup::getData(), pixelRecHits_token, processPixelRecHits(), edm::Handle< T >::product(), FastTrackerRecHitMaskProducer_cfi::recHits, topoToken_, and trackerHitAssociatorConfig_.

Referenced by analyze().

308  {
309  auto const& theClusterShape = es.getData(csfToken_);
310  auto const& tkTpl = es.getData(topoToken_);
311 
314 
315  // Get associator
316  auto theHitAssociator = std::make_unique<TrackerHitAssociator>(ev, trackerHitAssociatorConfig_);
317 
318  // Pixel hits
319  {
321  ev.getByToken(pixelRecHits_token, coll);
322 
325 
326  auto const& recHits = coll.product()->data();
327  processPixelRecHits(recHits, *theHitAssociator, theClusterShape, *clusterShapeCache, tkTpl);
328  }
329 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const edm::EDGetTokenT< SiPixelClusterShapeCache > clusterShapeCache_token
T const * product() const
Definition: Handle.h:70
data_type const * data(size_t cell) const
void processPixelRecHits(SiPixelRecHitCollection::DataContainer const &recHits, TrackerHitAssociator const &theAssociator, ClusterShapeHitFilter const &theFilter, SiPixelClusterShapeCache const &clusterShapeCache, const TrackerTopology &tkTpl) const
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Tokens for ESconsumes.
const TrackerHitAssociator::Config trackerHitAssociatorConfig_
const edm::EDGetTokenT< edmNew::DetSetVector< SiPixelRecHit > > pixelRecHits_token
const edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecord > csfToken_

◆ checkSimHits()

bool PixelClusterShapeExtractor::checkSimHits ( const TrackingRecHit recHit,
TrackerHitAssociator const &  theAssociator,
PSimHit simHit,
pair< unsigned int, float > &  key,
unsigned int &  ss 
) const
private

Definition at line 244 of file PixelClusterShapeExtractor.cc.

References TrackerHitAssociator::associateHit(), isSuitable(), submitPVResolutionJobs::key, rpcPointValidation_cfi::recHit, rpcPointValidation_cfi::simHit, FastTrackerRecHitCombiner_cfi::simHits, and contentValuesCheck::ss.

Referenced by processPixelRecHits().

248  {
249  auto const& simHits = theHitAssociator.associateHit(recHit);
250 
251  //std::cout << "simHits.size() = " << simHits.size() << std::endl;
252  for (auto const& sh : simHits) {
253  if (isSuitable(sh, *recHit.detUnit())) {
254  simHit = sh;
255  key = {simHit.trackId(), simHit.timeOfFlight()};
256  ss = simHits.size();
257  return true;
258  }
259  }
260 
261  return false;
262 }
key
prepare the HTCondor submission files and eventually submit them
bool isSuitable(const PSimHit &simHit, const GeomDetUnit &gdu) const

◆ endJob()

void PixelClusterShapeExtractor::endJob ( void  )
overridevirtual

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 167 of file PixelClusterShapeExtractor.cc.

References file, h, hrpc, and hspc.

167  {
168  file->cd();
169 
170  // simulated
171  for (auto h = hspc.begin(); h != hspc.end(); h++)
172  (*h)->Write();
173 
174  // reconstructed
175  for (auto h = hrpc.begin(); h != hrpc.end(); h++)
176  (*h)->Write();
177 
178  file->Close();
179 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ init()

void PixelClusterShapeExtractor::init ( void  )
private

Definition at line 116 of file PixelClusterShapeExtractor.cc.

References exMax, and eyMax.

Referenced by PixelClusterShapeExtractor().

116  {
117  // Declare histograms
118  char histName[256];
119 
120  // pixel
121  for (int subdet = 0; subdet <= 1; subdet++) {
122  for (int ex = 0; ex <= exMax; ex++)
123  for (int ey = 0; ey <= eyMax; ey++) {
124  sprintf(histName, "hspc_%d_%d_%d", subdet, ex, ey);
125  hspc.push_back(new TH2F(histName,
126  histName,
127  10 * 2 * (exMax + 2),
128  -(exMax + 2),
129  (exMax + 2),
130  10 * 2 * (eyMax + 2),
131  -(eyMax + 2),
132  (eyMax + 2)));
133 
134  sprintf(histName, "hrpc_%d_%d_%d", subdet, ex, ey);
135  hrpc.push_back(new TH2F(histName,
136  histName,
137  10 * 2 * (exMax + 2),
138  -(exMax + 2),
139  (exMax + 2),
140  10 * 2 * (eyMax + 2),
141  -(eyMax + 2),
142  (eyMax + 2)));
143  }
144  }
145  theMutex = std::make_unique<std::mutex[]>(hspc.size());
146 }
#define eyMax
#define exMax
std::unique_ptr< std::mutex[]> theMutex

◆ isSuitable()

bool PixelClusterShapeExtractor::isSuitable ( const PSimHit simHit,
const GeomDetUnit gdu 
) const
private

?????

Definition at line 182 of file PixelClusterShapeExtractor.cc.

References funct::abs(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), f, trackerHitRTTI::isFast(), GeomDet::position(), rpcPointValidation_cfi::simHit, GeomDet::toLocal(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by checkSimHits().

182  {
183  // Outgoing?
184  // very expensive....
185  GlobalVector gvec = gdu.position() - GlobalPoint(0, 0, 0);
186  LocalVector lvec = gdu.toLocal(gvec);
187  LocalVector ldir = simHit.exitPoint() - simHit.entryPoint();
188 
189  // cut on size as well (pixel is 285um thick...
190  bool isOutgoing = std::abs(ldir.z()) > 0.01f && (lvec.z() * ldir.z() > 0);
191 
193  const bool isRelevant = RelevantProcesses.count(simHit.processType());
194  // From a relevant process? primary or decay
195  //bool isRelevant = (simHit.processType() == 2 ||
196  // simHit.processType() == 4);
197 
198  constexpr float ptCut2 = 0.2 * 0.2; // 0.050*0.050;
199  // Fast enough? pt > 50 MeV/c FIXME (at least 200MeV....
200  bool isFast = (simHit.momentumAtEntry().perp2() > ptCut2);
201 
202  //std::cout << "isOutgoing = " << isOutgoing << ", isRelevant = " << simHit.processType() << ", isFast = " << isFast << std::endl;
203  return (isOutgoing && isRelevant && isFast);
204 }
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
T z() const
Definition: PV3DBase.h:61
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
bool isFast(TrackingRecHit const &hit)
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43

◆ processPixelRecHits()

void PixelClusterShapeExtractor::processPixelRecHits ( SiPixelRecHitCollection::DataContainer const &  recHits,
TrackerHitAssociator const &  theAssociator,
ClusterShapeHitFilter const &  theFilter,
SiPixelClusterShapeCache const &  clusterShapeCache,
const TrackerTopology tkTpl 
) const
private

Definition at line 265 of file PixelClusterShapeExtractor.cc.

References checkSimHits(), SiPixelPhase1OnlineDQM_cff::clusterShapeCache, hspc, submitPVResolutionJobs::key, WZElectronSkims53X_cff::max, noBPIX1, processSim(), TrackerTopology::pxbLayer(), rpcPointValidation_cfi::recHit, FastTrackerRecHitMaskProducer_cfi::recHits, rpcPointValidation_cfi::simHit, findQualityFiles::size, and contentValuesCheck::ss.

Referenced by analyzeSimHits().

269  {
270  struct Elem {
271  const SiPixelRecHit* rhit;
272  PSimHit shit;
273  unsigned int size;
274  };
275  std::map<pair<unsigned int, float>, Elem> simHitMap;
276 
277  PSimHit simHit;
278  pair<unsigned int, float> key;
279  unsigned int ss;
280 
281  for (auto const& recHit : recHits) {
282  if (noBPIX1 && tkTpl.pxbLayer(recHit.geographicalId()) == 1)
283  continue;
284  if (!checkSimHits(recHit, theHitAssociator, simHit, key, ss))
285  continue;
286  // Fill map
287  if (simHitMap.count(key) == 0) {
288  simHitMap[key] = {&recHit, simHit, ss};
289  } else if (recHit.cluster()->size() > simHitMap[key].rhit->cluster()->size())
290  simHitMap[key] = {&recHit, simHit, std::max(ss, simHitMap[key].size)};
291  }
292  for (auto const& elem : simHitMap) {
293  /* irrelevant
294  auto const rh = *elem.second.rhit;
295  auto const& topol = reinterpret_cast<const PixelGeomDetUnit*>(rh.detUnit())->specificTopology();
296  auto const & cl = *rh.cluster();
297  if (cl.minPixelCol()==0) continue;
298  if (cl.maxPixelCol()+1==topol.ncolumns()) continue;
299  if (cl.minPixelRow()==0) continue;
300  if (cl.maxPixelRow()+1==topol.nrows()) continue;
301  */
302  if (elem.second.size == 1)
303  processSim(*elem.second.rhit, theFilter, elem.second.shit, clusterShapeCache, hspc);
304  }
305 }
size
Write out results.
unsigned int pxbLayer(const DetId &id) const
key
prepare the HTCondor submission files and eventually submit them
bool checkSimHits(const TrackingRecHit &recHit, TrackerHitAssociator const &theAssociator, PSimHit &simHit, pair< unsigned int, float > &key, unsigned int &ss) const
void processSim(const SiPixelRecHit &recHit, ClusterShapeHitFilter const &theClusterFilter, const PSimHit &simHit, const SiPixelClusterShapeCache &clusterShapeCache, const vector< TH2F *> &histo) const
Our base class.
Definition: SiPixelRecHit.h:23

◆ processRec()

void PixelClusterShapeExtractor::processRec ( const SiPixelRecHit recHit,
ClusterShapeHitFilter const &  theFilter,
LocalVector  ldir,
const SiPixelClusterShapeCache clusterShapeCache,
const vector< TH2F *> &  histo 
) const
private

Definition at line 207 of file PixelClusterShapeExtractor.cc.

References funct::abs(), SiPixelPhase1OnlineDQM_cff::clusterShapeCache, gather_cfg::cout, exMax, eyMax, edm::VecArray< T, N >::front(), ClusterShapeHitFilter::getSizes(), timingPdfMaker::histo, mps_fire::i, CommonMethods::lock(), PV3DBase< T, PVType, FrameType >::mag(), rpcPointValidation_cfi::recHit, edm::VecArray< T, N >::size(), and theMutex.

Referenced by analyzeRecTracks(), and processSim().

211  {
212  int part;
214  pair<float, float> pred;
215 
216  if (theClusterShape.getSizes(recHit, ldir, clusterShapeCache, part, meas, pred))
217  if (meas.size() == 1)
218  if (meas.front().first <= exMax && meas.front().second <= eyMax) {
219  int i = (part * (exMax + 1) + meas.front().first) * (eyMax + 1) + meas.front().second;
220 #ifdef DO_DEBUG
221  if (meas.front().second == 0 && std::abs(pred.second) > 3) {
222  Lock lock(theMutex[0]);
223  int id = recHit.geographicalId();
224  std::cout << id << " bigpred " << meas.front().first << '/' << meas.front().second << ' ' << pred.first << '/'
225  << pred.second << ' ' << ldir << ' ' << ldir.mag() << std::endl;
226  }
227 #endif
228  Lock lock(theMutex[i]);
229  histo[i]->Fill(pred.first, pred.second);
230  }
231 }
#define eyMax
T mag() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reference front()
Definition: VecArray.h:50
part
Definition: HCALResponse.h:20
std::unique_lock< std::mutex > Lock
constexpr size_type size() const noexcept
Definition: VecArray.h:70
#define exMax
std::unique_ptr< std::mutex[]> theMutex

◆ processSim()

void PixelClusterShapeExtractor::processSim ( const SiPixelRecHit recHit,
ClusterShapeHitFilter const &  theClusterFilter,
const PSimHit simHit,
const SiPixelClusterShapeCache clusterShapeCache,
const vector< TH2F *> &  histo 
) const
private

Definition at line 234 of file PixelClusterShapeExtractor.cc.

References SiPixelPhase1OnlineDQM_cff::clusterShapeCache, timingPdfMaker::histo, processRec(), rpcPointValidation_cfi::recHit, and rpcPointValidation_cfi::simHit.

Referenced by processPixelRecHits().

238  {
239  LocalVector ldir = simHit.exitPoint() - simHit.entryPoint();
240  processRec(recHit, theClusterFilter, ldir, clusterShapeCache, histo);
241 }
void processRec(const SiPixelRecHit &recHit, ClusterShapeHitFilter const &theFilter, LocalVector ldir, const SiPixelClusterShapeCache &clusterShapeCache, const vector< TH2F *> &histo) const

Member Data Documentation

◆ clusterShapeCache_token

const edm::EDGetTokenT<SiPixelClusterShapeCache> PixelClusterShapeExtractor::clusterShapeCache_token
private

Definition at line 106 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and analyzeSimHits().

◆ csfToken_

const edm::ESGetToken<ClusterShapeHitFilter, CkfComponentsRecord> PixelClusterShapeExtractor::csfToken_
private

Definition at line 96 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and analyzeSimHits().

◆ file

TFile* PixelClusterShapeExtractor::file
private

Definition at line 98 of file PixelClusterShapeExtractor.cc.

Referenced by endJob(), and PixelClusterShapeExtractor().

◆ hasRecTracks

const bool PixelClusterShapeExtractor::hasRecTracks
private

Definition at line 101 of file PixelClusterShapeExtractor.cc.

Referenced by analyze().

◆ hasSimHits

const bool PixelClusterShapeExtractor::hasSimHits
private

Definition at line 100 of file PixelClusterShapeExtractor.cc.

Referenced by analyze().

◆ hrpc

std::vector<TH2F*> PixelClusterShapeExtractor::hrpc
private

Definition at line 112 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and endJob().

◆ hspc

std::vector<TH2F*> PixelClusterShapeExtractor::hspc
private

Definition at line 111 of file PixelClusterShapeExtractor.cc.

Referenced by endJob(), and processPixelRecHits().

◆ noBPIX1

const bool PixelClusterShapeExtractor::noBPIX1
private

Definition at line 102 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and processPixelRecHits().

◆ pixelRecHits_token

const edm::EDGetTokenT<edmNew::DetSetVector<SiPixelRecHit> > PixelClusterShapeExtractor::pixelRecHits_token
private

Definition at line 105 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeSimHits().

◆ theMutex

std::unique_ptr<std::mutex[]> PixelClusterShapeExtractor::theMutex
private

Definition at line 110 of file PixelClusterShapeExtractor.cc.

Referenced by processRec().

◆ topoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> PixelClusterShapeExtractor::topoToken_
private

Tokens for ESconsumes.

Definition at line 95 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and analyzeSimHits().

◆ trackerHitAssociatorConfig_

const TrackerHitAssociator::Config PixelClusterShapeExtractor::trackerHitAssociatorConfig_
private

Definition at line 107 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeSimHits().

◆ tracks_token

const edm::EDGetTokenT<reco::TrackCollection> PixelClusterShapeExtractor::tracks_token
private

Definition at line 104 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks().