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
 
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)
 
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 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 55 of file PixelClusterShapeExtractor.cc.

Member Typedef Documentation

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

Definition at line 102 of file PixelClusterShapeExtractor.cc.

Constructor & Destructor Documentation

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

Definition at line 135 of file PixelClusterShapeExtractor.cc.

References file, and init().

135  :
136  hasSimHits(pset.getParameter<bool>("hasSimHits")),
137  hasRecTracks(pset.getParameter<bool>("hasRecTracks")),
138  noBPIX1(pset.getParameter<bool>("noBPIX1")),
140  consumes<reco::TrackCollection>(pset.getParameter<edm::InputTag>("tracks")) :
142  ),
144  clusterShapeCache_token(consumes<SiPixelClusterShapeCache>(pset.getParameter<edm::InputTag>("clusterShapeCacheSrc"))),
146 {
147  file = new TFile("clusterShape.root","RECREATE");
148  file->cd();
149  init();
150 }
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 389 of file PixelClusterShapeExtractor.cc.

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

Referenced by analyzeRecTracks().

390 {
391  if(hasSimHits)
392  {
393  LogTrace("MinBiasTracking")
394  << " [ClusterShape] analyze simHits, recHits";
395  analyzeSimHits(ev, es);
396  }
397 
398  if(hasRecTracks)
399  {
400  LogTrace("MinBiasTracking")
401  << " [ClusterShape] analyze recHits on recTracks";
402  analyzeRecTracks(ev,es);
403  }
404 }
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 334 of file PixelClusterShapeExtractor.cc.

References analyze(), clusterShapeCache_token, TrackingRecHit::geographicalId(), edm::EventSetup::get(), edm::Event::getByToken(), h, hcalSimParameters_cfi::hb, reco::TrackBase::highPurity, hrpc, fastTrackerRecHitType::isPixel(), TrackingRecHit::isValid(), noBPIX1, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, processRec(), edm::ESHandle< T >::product(), rpcPointValidation_cfi::recHit, HiIsolationCommonParameters_cff::track, l1t::tracks, and tracks_token.

Referenced by analyze(), and analyzeSimHits().

335 {
336 
338  es.get<CkfComponentsRecord>().get("ClusterShapeHitFilter",shape);
339  auto const & theClusterShape = *shape.product();
340 
341  edm::ESHandle<TrackerTopology> tTopoHandle;
342  es.get<TrackerTopologyRcd>().get(tTopoHandle);
343  auto const & tkTpl = *tTopoHandle;
344 
345 
346  // Get tracks
348  ev.getByToken(tracks_token, tracks);
349 
350  edm::Handle<SiPixelClusterShapeCache> clusterShapeCache;
351  ev.getByToken(clusterShapeCache_token, clusterShapeCache);
352 
353 
354  for (auto const & track : *tracks)
355  {
356  if (!track.quality(reco::Track::highPurity)) continue;
357  if (track.numberOfValidHits()<8) continue;
358  auto const & trajParams = track.extra()->trajParams();
359  assert(trajParams.size()==track.recHitsSize());
360  auto hb = track.recHitsBegin();
361  for(unsigned int h=0;h<track.recHitsSize();h++){
362  auto recHit = *(hb+h);
363  if (!recHit->isValid()) continue;
364  auto id = recHit->geographicalId();
365  if(noBPIX1 && tkTpl.pxbLayer(id)==1) continue;
366 
367  // check that we are in the pixel
368  auto subdetid = (id.subdetId());
369  bool isPixel = subdetid == PixelSubdetector::PixelBarrel || subdetid == PixelSubdetector::PixelEndcap;
370 
371  auto const & ltp = trajParams[h];
372  auto ldir = ltp.momentum()/ltp.momentum().mag();
373 
374  if(isPixel)
375  {
376  // Pixel
377  const SiPixelRecHit* pixelRecHit =
378  dynamic_cast<const SiPixelRecHit *>(recHit);
379 
380  if(pixelRecHit != nullptr)
381  processRec(*pixelRecHit, theClusterShape, ldir, *clusterShapeCache, hrpc);
382  }
383  }
384  }
385 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
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:63
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 analyzeRecTracks(), 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(), and trackerHitAssociatorConfig_.

Referenced by analyze(), and processPixelRecHits().

301 {
302 
304  es.get<CkfComponentsRecord>().get("ClusterShapeHitFilter",shape);
305  auto const & theClusterShape = *shape.product();
306 
307  edm::ESHandle<TrackerTopology> tTopoHandle;
308  es.get<TrackerTopologyRcd>().get(tTopoHandle);
309  auto const & tkTpl = *tTopoHandle;
310 
311 
312  edm::Handle<SiPixelClusterShapeCache> clusterShapeCache;
313  ev.getByToken(clusterShapeCache_token, clusterShapeCache);
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 
323  edm::Handle<SiPixelClusterShapeCache> clusterShapeCache;
324  ev.getByToken(clusterShapeCache_token, clusterShapeCache);
325 
326  auto const & recHits = coll.product()->data();
327  processPixelRecHits(recHits, *theHitAssociator, theClusterShape, *clusterShapeCache,tkTpl);
328  }
329 
330 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
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:81
T get() const
Definition: EventSetup.h:63
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 235 of file PixelClusterShapeExtractor.cc.

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

Referenced by processPixelRecHits(), and processSim().

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

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 153 of file PixelClusterShapeExtractor.cc.

References file, h, hrpc, and hspc.

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

Definition at line 109 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  {
117  for(int ex = 0; ex <= exMax; ex++)
118  for(int ey = 0; ey <= eyMax; ey++)
119  {
120  sprintf(histName,"hspc_%d_%d_%d",subdet, ex,ey);
121  hspc.push_back(new TH2F(histName,histName,
122  10 * 2 * (exMax+2), -(exMax+2),(exMax+2),
123  10 * 2 * (eyMax+2), -(eyMax+2),(eyMax+2)));
124 
125  sprintf(histName,"hrpc_%d_%d_%d",subdet, ex,ey);
126  hrpc.push_back(new TH2F(histName,histName,
127  10 * 2 * (exMax+2), -(exMax+2),(exMax+2),
128  10 * 2 * (eyMax+2), -(eyMax+2),(eyMax+2)));
129  }
130  }
131  theMutex.reset(new std::mutex[hspc.size()]);
132 }
static boost::mutex mutex
Definition: Proxy.cc:11
#define eyMax
#define exMax
std::unique_ptr< std::mutex[]> theMutex
bool PixelClusterShapeExtractor::isSuitable ( const PSimHit simHit,
const GeomDetUnit gdu 
) const
private

?????

Definition at line 169 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().

170 {
171  // Outgoing?
172  // very expensive....
173  GlobalVector gvec = gdu.position() -
174  GlobalPoint(0,0,0);
175  LocalVector lvec = gdu.toLocal(gvec);
176  LocalVector ldir = simHit.exitPoint() - simHit.entryPoint();
177 
178  // cut on size as well (pixel is 285um thick...
179  bool isOutgoing = std::abs(ldir.z())>0.01f && (lvec.z()*ldir.z() > 0);
180 
182  const bool isRelevant = RelevantProcesses.count(simHit.processType());
183  // From a relevant process? primary or decay
184  //bool isRelevant = (simHit.processType() == 2 ||
185  // simHit.processType() == 4);
186 
187  constexpr float ptCut2 = 0.2*0.2; // 0.050*0.050;
188  // Fast enough? pt > 50 MeV/c FIXME (at least 200MeV....
189  bool isFast = (simHit.momentumAtEntry().perp2() > ptCut2);
190 
191  //std::cout << "isOutgoing = " << isOutgoing << ", isRelevant = " << simHit.processType() << ", isFast = " << isFast << std::endl;
192  return (isOutgoing && isRelevant && isFast);
193 }
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
Definition: PSimHit.h:47
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
T perp2() const
Definition: PV3DBase.h:71
#define constexpr
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:38
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:48
T z() const
Definition: PV3DBase.h:64
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:118
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:35
void PixelClusterShapeExtractor::processPixelRecHits ( SiPixelRecHitCollection::DataContainer const &  recHits,
TrackerHitAssociator const &  theAssociator,
ClusterShapeHitFilter const &  theFilter,
SiPixelClusterShapeCache const &  clusterShapeCache,
const TrackerTopology tkTpl 
) const
private

Definition at line 256 of file PixelClusterShapeExtractor.cc.

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

Referenced by analyzeSimHits().

262 {
263  struct Elem { const SiPixelRecHit * rhit; PSimHit shit; unsigned int size;};
264  std::map<pair<unsigned int, float>, Elem> simHitMap;
265 
266  PSimHit simHit;
267  pair<unsigned int, float> key;
268  unsigned int ss;
269 
270  for(auto const & recHit : recHits) {
271  if(noBPIX1 && tkTpl.pxbLayer(recHit.geographicalId())==1) continue;
272  if(!checkSimHits(recHit, theHitAssociator, simHit, key,ss)) continue;
273  // Fill map
274  if(simHitMap.count(key) == 0)
275  { simHitMap[key] = {&recHit,simHit,ss}; }
276  else if( recHit.cluster()->size() >
277  simHitMap[key].rhit->cluster()->size())
278  simHitMap[key] = {&recHit,simHit,std::max(ss,simHitMap[key].size)};
279  }
280  for (auto const & elem : simHitMap) {
281  /* irrelevant
282  auto const rh = *elem.second.rhit;
283  auto const& topol = reinterpret_cast<const PixelGeomDetUnit*>(rh.detUnit())->specificTopology();
284  auto const & cl = *rh.cluster();
285  if (cl.minPixelCol()==0) continue;
286  if (cl.maxPixelCol()+1==topol.ncolumns()) continue;
287  if (cl.minPixelRow()==0) continue;
288  if (cl.maxPixelRow()+1==topol.nrows()) continue;
289  */
290  if (elem.second.size==1)
291  processSim(*elem.second.rhit, theFilter, elem.second.shit, clusterShapeCache, hspc);
292  }
293 }
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:18
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 196 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().

198 {
199  int part;
201  pair<float,float> pred;
202 
203  if(theClusterShape.getSizes(recHit,ldir,clusterShapeCache, part,meas,pred))
204  if(meas.size() == 1)
205  if(meas.front().first <= exMax &&
206  meas.front().second <= eyMax)
207  {
208  int i = (part * (exMax + 1) +
209  meas.front().first) * (eyMax + 1) +
210  meas.front().second;
211 #ifdef DO_DEBUG
212  if (meas.front().second==0 && std::abs(pred.second)>3)
213  {
214  Lock lock(theMutex[0]);
215  int id = recHit.geographicalId();
216  std::cout << id << " bigpred " << meas.front().first << '/'<<meas.front().second
217  << ' ' << pred.first << '/' << 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:67
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 checkSimHits(), PSimHit::entryPoint(), PSimHit::exitPoint(), and processRec().

Referenced by processPixelRecHits().

228 {
229  LocalVector ldir = simHit.exitPoint() - simHit.entryPoint();
230  processRec(recHit, theClusterFilter, ldir, clusterShapeCache, histo);
231 }
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:38
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:35

Member Data Documentation

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

Definition at line 99 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and analyzeSimHits().

TFile* PixelClusterShapeExtractor::file
private

Definition at line 91 of file PixelClusterShapeExtractor.cc.

Referenced by endJob(), and PixelClusterShapeExtractor().

const bool PixelClusterShapeExtractor::hasRecTracks
private

Definition at line 94 of file PixelClusterShapeExtractor.cc.

Referenced by analyze().

const bool PixelClusterShapeExtractor::hasSimHits
private

Definition at line 93 of file PixelClusterShapeExtractor.cc.

Referenced by analyze().

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

Definition at line 105 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and endJob().

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

Definition at line 104 of file PixelClusterShapeExtractor.cc.

Referenced by endJob(), and processPixelRecHits().

const bool PixelClusterShapeExtractor::noBPIX1
private

Definition at line 95 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and processPixelRecHits().

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

Definition at line 98 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeSimHits().

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

Definition at line 103 of file PixelClusterShapeExtractor.cc.

Referenced by processRec().

const TrackerHitAssociator::Config PixelClusterShapeExtractor::trackerHitAssociatorConfig_
private

Definition at line 100 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeSimHits().

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

Definition at line 97 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks().