CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::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
< SiPixelClusterShapeCache
clusterShapeCache_token
 
const edm::ESGetToken
< ClusterShapeHitFilter,
CkfComponentsRecord
csfToken_
 
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,
TrackerTopologyRcd
topoToken_
 Tokens for ESconsumes. More...
 
const TrackerHitAssociator::Config trackerHitAssociatorConfig_
 
const edm::EDGetTokenT
< reco::TrackCollection
tracks_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 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<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

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

Definition at line 109 of file PixelClusterShapeExtractor.cc.

Constructor & Destructor Documentation

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
T getParameter(std::string const &) const
Definition: ParameterSet.h:303

Member Function Documentation

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(), 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
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(), clusterShapeCache_token, csfToken_, edm::Event::getByToken(), edm::EventSetup::getData(), h, hcalSimParameters_cfi::hb, reco::TrackBase::highPurity, hrpc, fastTrackerRecHitType::isPixel(), noBPIX1, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, processRec(), topoToken_, HLT_FULL_cff::track, 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 
340  edm::Handle<SiPixelClusterShapeCache> clusterShapeCache;
341  ev.getByToken(clusterShapeCache_token, clusterShapeCache);
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 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
const edm::EDGetTokenT< SiPixelClusterShapeCache > clusterShapeCache_token
auto const & tracks
cannot be loose
assert(be >=bs)
bool getData(T &iHolder) const
Definition: EventSetup.h:122
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Tokens for ESconsumes.
const edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecord > csfToken_
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
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
void PixelClusterShapeExtractor::analyzeSimHits ( const edm::Event ev,
const edm::EventSetup es 
) const
private

Definition at line 308 of file PixelClusterShapeExtractor.cc.

References clusterShapeCache_token, csfToken_, makeMEIFBenchmarkPlots::ev, edm::Event::getByToken(), edm::EventSetup::getData(), pixelRecHits_token, processPixelRecHits(), edm::Handle< T >::product(), HLT_FULL_cff::recHits, topoToken_, and trackerHitAssociatorConfig_.

Referenced by analyze().

308  {
309  auto const& theClusterShape = es.getData(csfToken_);
310  auto const& tkTpl = es.getData(topoToken_);
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 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
const edm::EDGetTokenT< SiPixelClusterShapeCache > clusterShapeCache_token
void processPixelRecHits(SiPixelRecHitCollection::DataContainer const &recHits, TrackerHitAssociator const &theAssociator, ClusterShapeHitFilter const &theFilter, SiPixelClusterShapeCache const &clusterShapeCache, const TrackerTopology &tkTpl) const
bool getData(T &iHolder) const
Definition: EventSetup.h:122
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_
T const * product() const
Definition: Handle.h:70
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(), TrackingRecHit::detUnit(), isSuitable(), trackerHits::simHits, PSimHit::timeOfFlight(), and PSimHit::trackId().

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 }
bool isSuitable(const PSimHit &simHit, const GeomDetUnit &gdu) const
float timeOfFlight() const
Definition: PSimHit.h:73
tuple key
prepare the HTCondor submission files and eventually submit them
tuple simHits
Definition: trackerHits.py:16
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 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
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
bool PixelClusterShapeExtractor::isSuitable ( const PSimHit simHit,
const GeomDetUnit gdu 
) const
private

?????

Definition at line 182 of file PixelClusterShapeExtractor.cc.

References funct::abs(), PSimHit::entryPoint(), PSimHit::exitPoint(), validate-o2o-wbm::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().

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 }
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
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
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(), hspc, submitPVResolutionJobs::key, SiStripPI::max, noBPIX1, processSim(), TrackerTopology::pxbLayer(), 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 }
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
tuple key
prepare the HTCondor submission files and eventually submit them
unsigned int pxbLayer(const DetId &id) const
tuple size
Write out results.
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 207 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().

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
tuple cout
Definition: gather_cfg.py:144
DetId geographicalId() const
constexpr size_type size() const noexcept
Definition: VecArray.h:70
#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 234 of file PixelClusterShapeExtractor.cc.

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

Referenced by processPixelRecHits().

238  {
239  LocalVector ldir = simHit.exitPoint() - simHit.entryPoint();
240  processRec(recHit, theClusterFilter, ldir, clusterShapeCache, histo);
241 }
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 106 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and analyzeSimHits().

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

Definition at line 96 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and analyzeSimHits().

TFile* PixelClusterShapeExtractor::file
private

Definition at line 98 of file PixelClusterShapeExtractor.cc.

Referenced by endJob(), and PixelClusterShapeExtractor().

const bool PixelClusterShapeExtractor::hasRecTracks
private

Definition at line 101 of file PixelClusterShapeExtractor.cc.

Referenced by analyze().

const bool PixelClusterShapeExtractor::hasSimHits
private

Definition at line 100 of file PixelClusterShapeExtractor.cc.

Referenced by analyze().

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

Definition at line 112 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and endJob().

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

Definition at line 111 of file PixelClusterShapeExtractor.cc.

Referenced by endJob(), and processPixelRecHits().

const bool PixelClusterShapeExtractor::noBPIX1
private

Definition at line 102 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and processPixelRecHits().

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

Definition at line 105 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeSimHits().

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

Definition at line 110 of file PixelClusterShapeExtractor.cc.

Referenced by processRec().

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

Tokens for ESconsumes.

Definition at line 95 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks(), and analyzeSimHits().

const TrackerHitAssociator::Config PixelClusterShapeExtractor::trackerHitAssociatorConfig_
private

Definition at line 107 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeSimHits().

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

Definition at line 104 of file PixelClusterShapeExtractor.cc.

Referenced by analyzeRecTracks().