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
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const 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
 
ESProxyIndex const * esGetTokenIndices (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::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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices 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
 
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 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)
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 

Detailed Description

Definition at line 52 of file PixelClusterShapeExtractor.cc.

Member Typedef Documentation

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

Definition at line 103 of file PixelClusterShapeExtractor.cc.

Constructor & Destructor Documentation

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

Definition at line 143 of file PixelClusterShapeExtractor.cc.

References file, and init().

144  : hasSimHits(pset.getParameter<bool>("hasSimHits")),
145  hasRecTracks(pset.getParameter<bool>("hasRecTracks")),
146  noBPIX1(pset.getParameter<bool>("noBPIX1")),
147  tracks_token(hasRecTracks ? consumes<reco::TrackCollection>(pset.getParameter<edm::InputTag>("tracks"))
151  consumes<SiPixelClusterShapeCache>(pset.getParameter<edm::InputTag>("clusterShapeCacheSrc"))),
153  file = new TFile("clusterShape.root", "RECREATE");
154  file->cd();
155  init();
156 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< SiPixelClusterShapeCache > clusterShapeCache_token
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
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::EDGetTokenT< reco::TrackCollection > tracks_token

Member Function Documentation

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

Definition at line 380 of file PixelClusterShapeExtractor.cc.

References analyzeRecTracks(), analyzeSimHits(), DEFINE_FWK_MODULE, hasRecTracks, hasSimHits, and LogTrace.

380  {
381  if (hasSimHits) {
382  LogTrace("MinBiasTracking") << " [ClusterShape] analyze simHits, recHits";
383  analyzeSimHits(ev, es);
384  }
385 
386  if (hasRecTracks) {
387  LogTrace("MinBiasTracking") << " [ClusterShape] analyze recHits on recTracks";
388  analyzeRecTracks(ev, es);
389  }
390 }
bool ev
#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
void PixelClusterShapeExtractor::analyzeRecTracks ( const edm::Event ev,
const edm::EventSetup es 
) const
private

Definition at line 329 of file PixelClusterShapeExtractor.cc.

References SiPixelPhase1OnlineDQM_cff::clusterShapeCache, clusterShapeCache_token, edm::EventSetup::get(), edm::Event::getByToken(), h, hcalSimParameters_cfi::hb, reco::TrackBase::highPurity, hrpc, fastTrackerRecHitType::isPixel(), noBPIX1, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, processRec(), edm::ESHandle< T >::product(), rpcPointValidation_cfi::recHit, HLT_2018_cff::track, PDWG_EXOHSCP_cff::tracks, and tracks_token.

Referenced by analyze().

329  {
331  es.get<CkfComponentsRecord>().get("ClusterShapeHitFilter", shape);
332  auto const& theClusterShape = *shape.product();
333 
334  edm::ESHandle<TrackerTopology> tTopoHandle;
335  es.get<TrackerTopologyRcd>().get(tTopoHandle);
336  auto const& tkTpl = *tTopoHandle;
337 
338  // Get tracks
340  ev.getByToken(tracks_token, tracks);
341 
343  ev.getByToken(clusterShapeCache_token, clusterShapeCache);
344 
345  for (auto const& track : *tracks) {
346  if (!track.quality(reco::Track::highPurity))
347  continue;
348  if (track.numberOfValidHits() < 8)
349  continue;
350  auto const& trajParams = track.extra()->trajParams();
351  assert(trajParams.size() == track.recHitsSize());
352  auto hb = track.recHitsBegin();
353  for (unsigned int h = 0; h < track.recHitsSize(); h++) {
354  auto recHit = *(hb + h);
355  if (!recHit->isValid())
356  continue;
357  auto id = recHit->geographicalId();
358  if (noBPIX1 && tkTpl.pxbLayer(id) == 1)
359  continue;
360 
361  // check that we are in the pixel
362  auto subdetid = (id.subdetId());
363  bool isPixel = subdetid == PixelSubdetector::PixelBarrel || subdetid == PixelSubdetector::PixelEndcap;
364 
365  auto const& ltp = trajParams[h];
366  auto ldir = ltp.momentum() / ltp.momentum().mag();
367 
368  if (isPixel) {
369  // Pixel
370  const SiPixelRecHit* pixelRecHit = dynamic_cast<const SiPixelRecHit*>(recHit);
371 
372  if (pixelRecHit != nullptr)
373  processRec(*pixelRecHit, theClusterShape, ldir, *clusterShapeCache, hrpc);
374  }
375  }
376  }
377 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
const edm::EDGetTokenT< SiPixelClusterShapeCache > clusterShapeCache_token
void processRec(const SiPixelRecHit &recHit, ClusterShapeHitFilter const &theFilter, LocalVector ldir, const SiPixelClusterShapeCache &clusterShapeCache, const vector< TH2F * > &histo) const
const edm::EDGetTokenT< reco::TrackCollection > tracks_token
T get() const
Definition: EventSetup.h:73
bool isPixel(HitType hitType)
T const * product() const
Definition: ESHandle.h:86
Our base class.
Definition: SiPixelRecHit.h:23
void PixelClusterShapeExtractor::analyzeSimHits ( const edm::Event ev,
const edm::EventSetup es 
) const
private

Definition at line 300 of file PixelClusterShapeExtractor.cc.

References SiPixelPhase1OnlineDQM_cff::clusterShapeCache, clusterShapeCache_token, coll, edmNew::DetSetVector< T >::data(), ev, edm::EventSetup::get(), edm::Event::getByToken(), pixelRecHits_token, processPixelRecHits(), edm::Handle< T >::product(), edm::ESHandle< T >::product(), FastTrackerRecHitMaskProducer_cfi::recHits, and trackerHitAssociatorConfig_.

Referenced by analyze().

300  {
302  es.get<CkfComponentsRecord>().get("ClusterShapeHitFilter", shape);
303  auto const& theClusterShape = *shape.product();
304 
305  edm::ESHandle<TrackerTopology> tTopoHandle;
306  es.get<TrackerTopologyRcd>().get(tTopoHandle);
307  auto const& tkTpl = *tTopoHandle;
308 
310  ev.getByToken(clusterShapeCache_token, clusterShapeCache);
311 
312  // Get associator
313  auto theHitAssociator = std::make_unique<TrackerHitAssociator>(ev, trackerHitAssociatorConfig_);
314 
315  // Pixel hits
316  {
318  ev.getByToken(pixelRecHits_token, coll);
319 
321  ev.getByToken(clusterShapeCache_token, clusterShapeCache);
322 
323  auto const& recHits = coll.product()->data();
324  processPixelRecHits(recHits, *theHitAssociator, theClusterShape, *clusterShapeCache, tkTpl);
325  }
326 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
const edm::EDGetTokenT< SiPixelClusterShapeCache > clusterShapeCache_token
bool ev
void processPixelRecHits(SiPixelRecHitCollection::DataContainer const &recHits, TrackerHitAssociator const &theAssociator, ClusterShapeHitFilter const &theFilter, SiPixelClusterShapeCache const &clusterShapeCache, const TrackerTopology &tkTpl) const
const TrackerHitAssociator::Config trackerHitAssociatorConfig_
const edm::EDGetTokenT< edmNew::DetSetVector< SiPixelRecHit > > pixelRecHits_token
data_type const * data(size_t cell) const
JetCorrectorParametersCollection coll
Definition: classes.h:10
T const * product() const
Definition: Handle.h:69
T get() const
Definition: EventSetup.h:73
T const * product() const
Definition: ESHandle.h:86
bool PixelClusterShapeExtractor::checkSimHits ( const TrackingRecHit recHit,
TrackerHitAssociator const &  theAssociator,
PSimHit simHit,
pair< unsigned int, float > &  key,
unsigned int &  ss 
) const
private

Definition at line 236 of file PixelClusterShapeExtractor.cc.

References TrackerHitAssociator::associateHit(), TrackingRecHit::detUnit(), isSuitable(), FastTrackerRecHitCombiner_cfi::simHits, PSimHit::timeOfFlight(), and PSimHit::trackId().

Referenced by processPixelRecHits().

240  {
241  auto const& simHits = theHitAssociator.associateHit(recHit);
242 
243  //std::cout << "simHits.size() = " << simHits.size() << std::endl;
244  for (auto const& sh : simHits) {
245  if (isSuitable(sh, *recHit.detUnit())) {
246  simHit = sh;
247  key = {simHit.trackId(), simHit.timeOfFlight()};
248  ss = simHits.size();
249  return true;
250  }
251  }
252 
253  return false;
254 }
bool isSuitable(const PSimHit &simHit, const GeomDetUnit &gdu) const
float timeOfFlight() const
Definition: PSimHit.h:73
virtual const GeomDetUnit * detUnit() const
unsigned int trackId() const
Definition: PSimHit.h:106
void PixelClusterShapeExtractor::endJob ( void  )
overridevirtual

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 159 of file PixelClusterShapeExtractor.cc.

References file, h, hrpc, and hspc.

159  {
160  file->cd();
161 
162  // simulated
163  for (auto h = hspc.begin(); h != hspc.end(); h++)
164  (*h)->Write();
165 
166  // reconstructed
167  for (auto h = hrpc.begin(); h != hrpc.end(); h++)
168  (*h)->Write();
169 
170  file->Close();
171 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void PixelClusterShapeExtractor::init ( void  )
private

Definition at line 110 of file PixelClusterShapeExtractor.cc.

References exMax, eyMax, and mutex.

Referenced by PixelClusterShapeExtractor().

110  {
111  // Declare histograms
112  char histName[256];
113 
114  // pixel
115  for (int subdet = 0; subdet <= 1; subdet++) {
116  for (int ex = 0; ex <= exMax; ex++)
117  for (int ey = 0; ey <= eyMax; ey++) {
118  sprintf(histName, "hspc_%d_%d_%d", subdet, ex, ey);
119  hspc.push_back(new TH2F(histName,
120  histName,
121  10 * 2 * (exMax + 2),
122  -(exMax + 2),
123  (exMax + 2),
124  10 * 2 * (eyMax + 2),
125  -(eyMax + 2),
126  (eyMax + 2)));
127 
128  sprintf(histName, "hrpc_%d_%d_%d", subdet, ex, ey);
129  hrpc.push_back(new TH2F(histName,
130  histName,
131  10 * 2 * (exMax + 2),
132  -(exMax + 2),
133  (exMax + 2),
134  10 * 2 * (eyMax + 2),
135  -(eyMax + 2),
136  (eyMax + 2)));
137  }
138  }
139  theMutex.reset(new std::mutex[hspc.size()]);
140 }
static boost::mutex mutex
Definition: Proxy.cc:9
#define eyMax
#define exMax
std::unique_ptr< std::mutex[]> theMutex
bool PixelClusterShapeExtractor::isSuitable ( const PSimHit simHit,
const GeomDetUnit gdu 
) const
private

?????

Definition at line 174 of file PixelClusterShapeExtractor.cc.

References funct::abs(), constexpr, PSimHit::entryPoint(), PSimHit::exitPoint(), f, trackerHitRTTI::isFast(), PSimHit::momentumAtEntry(), PV3DBase< T, PVType, FrameType >::perp2(), GeomDet::position(), PSimHit::processType(), GeomDet::toLocal(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by checkSimHits().

174  {
175  // Outgoing?
176  // very expensive....
177  GlobalVector gvec = gdu.position() - GlobalPoint(0, 0, 0);
178  LocalVector lvec = gdu.toLocal(gvec);
179  LocalVector ldir = simHit.exitPoint() - simHit.entryPoint();
180 
181  // cut on size as well (pixel is 285um thick...
182  bool isOutgoing = std::abs(ldir.z()) > 0.01f && (lvec.z() * ldir.z() > 0);
183 
185  const bool isRelevant = RelevantProcesses.count(simHit.processType());
186  // From a relevant process? primary or decay
187  //bool isRelevant = (simHit.processType() == 2 ||
188  // simHit.processType() == 4);
189 
190  constexpr float ptCut2 = 0.2 * 0.2; // 0.050*0.050;
191  // Fast enough? pt > 50 MeV/c FIXME (at least 200MeV....
192  bool isFast = (simHit.momentumAtEntry().perp2() > ptCut2);
193 
194  //std::cout << "isOutgoing = " << isOutgoing << ", isRelevant = " << simHit.processType() << ", isFast = " << isFast << std::endl;
195  return (isOutgoing && isRelevant && isFast);
196 }
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
Definition: PSimHit.h:55
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
T perp2() const
Definition: PV3DBase.h:68
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:46
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
T z() const
Definition: PV3DBase.h:61
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
bool isFast(TrackingRecHit const &hit)
unsigned short processType() const
Definition: PSimHit.h:120
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:43
#define constexpr
void PixelClusterShapeExtractor::processPixelRecHits ( SiPixelRecHitCollection::DataContainer const &  recHits,
TrackerHitAssociator const &  theAssociator,
ClusterShapeHitFilter const &  theFilter,
SiPixelClusterShapeCache const &  clusterShapeCache,
const TrackerTopology tkTpl 
) const
private

Definition at line 257 of file PixelClusterShapeExtractor.cc.

References checkSimHits(), HTMLExport::elem(), hspc, crabWrapper::key, SiStripPI::max, noBPIX1, processSim(), TrackerTopology::pxbLayer(), rpcPointValidation_cfi::recHit, rpcPointValidation_cfi::simHit, findQualityFiles::size, and contentValuesCheck::ss.

Referenced by analyzeSimHits().

261  {
262  struct Elem {
263  const SiPixelRecHit* rhit;
264  PSimHit shit;
265  unsigned int size;
266  };
267  std::map<pair<unsigned int, float>, Elem> simHitMap;
268 
269  PSimHit simHit;
270  pair<unsigned int, float> key;
271  unsigned int ss;
272 
273  for (auto const& recHit : recHits) {
274  if (noBPIX1 && tkTpl.pxbLayer(recHit.geographicalId()) == 1)
275  continue;
276  if (!checkSimHits(recHit, theHitAssociator, simHit, key, ss))
277  continue;
278  // Fill map
279  if (simHitMap.count(key) == 0) {
280  simHitMap[key] = {&recHit, simHit, ss};
281  } else if (recHit.cluster()->size() > simHitMap[key].rhit->cluster()->size())
282  simHitMap[key] = {&recHit, simHit, std::max(ss, simHitMap[key].size)};
283  }
284  for (auto const& elem : simHitMap) {
285  /* irrelevant
286  auto const rh = *elem.second.rhit;
287  auto const& topol = reinterpret_cast<const PixelGeomDetUnit*>(rh.detUnit())->specificTopology();
288  auto const & cl = *rh.cluster();
289  if (cl.minPixelCol()==0) continue;
290  if (cl.maxPixelCol()+1==topol.ncolumns()) continue;
291  if (cl.minPixelRow()==0) continue;
292  if (cl.maxPixelRow()+1==topol.nrows()) continue;
293  */
294  if (elem.second.size == 1)
295  processSim(*elem.second.rhit, theFilter, elem.second.shit, clusterShapeCache, hspc);
296  }
297 }
size
Write out results.
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
def elem(elemtype, innerHTML='', html_class='', kwargs)
Definition: HTMLExport.py:19
unsigned int pxbLayer(const DetId &id) const
Our base class.
Definition: SiPixelRecHit.h:23
void PixelClusterShapeExtractor::processRec ( const SiPixelRecHit recHit,
ClusterShapeHitFilter const &  theFilter,
LocalVector  ldir,
const SiPixelClusterShapeCache clusterShapeCache,
const vector< TH2F * > &  histo 
) const
private

Definition at line 199 of file PixelClusterShapeExtractor.cc.

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

Referenced by analyzeRecTracks(), and processSim().

203  {
204  int part;
206  pair<float, float> pred;
207 
208  if (theClusterShape.getSizes(recHit, ldir, clusterShapeCache, part, meas, pred))
209  if (meas.size() == 1)
210  if (meas.front().first <= exMax && meas.front().second <= eyMax) {
211  int i = (part * (exMax + 1) + meas.front().first) * (eyMax + 1) + meas.front().second;
212 #ifdef DO_DEBUG
213  if (meas.front().second == 0 && std::abs(pred.second) > 3) {
214  Lock lock(theMutex[0]);
215  int id = recHit.geographicalId();
216  std::cout << id << " bigpred " << meas.front().first << '/' << meas.front().second << ' ' << pred.first << '/'
217  << pred.second << ' ' << ldir << ' ' << ldir.mag() << std::endl;
218  }
219 #endif
220  Lock lock(theMutex[i]);
221  histo[i]->Fill(pred.first, pred.second);
222  }
223 }
#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
constexpr size_type size() const noexcept
Definition: VecArray.h:70
part
Definition: HCALResponse.h:20
std::unique_lock< std::mutex > Lock
DetId geographicalId() const
#define exMax
std::unique_ptr< std::mutex[]> theMutex
void PixelClusterShapeExtractor::processSim ( const SiPixelRecHit recHit,
ClusterShapeHitFilter const &  theClusterFilter,
const PSimHit simHit,
const SiPixelClusterShapeCache clusterShapeCache,
const vector< TH2F * > &  histo 
) const
private

Definition at line 226 of file PixelClusterShapeExtractor.cc.

References PSimHit::entryPoint(), PSimHit::exitPoint(), and processRec().

Referenced by processPixelRecHits().

230  {
231  LocalVector ldir = simHit.exitPoint() - simHit.entryPoint();
232  processRec(recHit, theClusterFilter, ldir, clusterShapeCache, histo);
233 }
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:46
void processRec(const SiPixelRecHit &recHit, ClusterShapeHitFilter const &theFilter, LocalVector ldir, const SiPixelClusterShapeCache &clusterShapeCache, const vector< TH2F * > &histo) const
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:43

Member Data Documentation

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

Definition at line 100 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and analyzeSimHits().

TFile* PixelClusterShapeExtractor::file
private

Definition at line 92 of file PixelClusterShapeExtractor.cc.

Referenced by endJob(), and PixelClusterShapeExtractor().

const bool PixelClusterShapeExtractor::hasRecTracks
private

Definition at line 95 of file PixelClusterShapeExtractor.cc.

Referenced by analyze().

const bool PixelClusterShapeExtractor::hasSimHits
private

Definition at line 94 of file PixelClusterShapeExtractor.cc.

Referenced by analyze().

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

Definition at line 106 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and endJob().

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

Definition at line 105 of file PixelClusterShapeExtractor.cc.

Referenced by endJob(), and processPixelRecHits().

const bool PixelClusterShapeExtractor::noBPIX1
private

Definition at line 96 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and processPixelRecHits().

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

Definition at line 99 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeSimHits().

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

Definition at line 104 of file PixelClusterShapeExtractor.cc.

Referenced by processRec().

const TrackerHitAssociator::Config PixelClusterShapeExtractor::trackerHitAssociatorConfig_
private

Definition at line 101 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeSimHits().

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

Definition at line 98 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks().