47 const std::set<unsigned> RelevantProcesses = { 0 };
60 void endJob()
override;
78 PSimHit & simHit, pair<unsigned int, float> &
key,
unsigned int & ss)
const;
80 void processPixelRecHits
102 using Lock = std::unique_lock<std::mutex>;
104 mutable std::vector<TH2F *>
hspc;
105 mutable std::vector<TH2F *>
hrpc;
115 for(
int subdet = 0; subdet <= 1; subdet++)
117 for(
int ex = 0; ex <=
exMax; ex++)
118 for(
int ey = 0; ey <=
eyMax; ey++)
120 sprintf(histName,
"hspc_%d_%d_%d",subdet, ex,ey);
121 hspc.push_back(
new TH2F(histName,histName,
125 sprintf(histName,
"hrpc_%d_%d_%d",subdet, ex,ey);
126 hrpc.push_back(
new TH2F(histName,histName,
145 trackerHitAssociatorConfig_(pset, consumesCollector())
147 file =
new TFile(
"clusterShape.root",
"RECREATE");
159 for(
auto h =
hspc.begin();
h!=
hspc.end();
h++) (*h)->Write();
162 for(
auto h =
hrpc.begin();
h!=
hrpc.end();
h++) (*h)->Write();
179 bool isOutgoing =
std::abs(ldir.
z())>0.01
f && (lvec.
z()*ldir.
z() > 0);
182 const bool isRelevant = RelevantProcesses.count(simHit.
processType());
192 return (isOutgoing && isRelevant && isFast);
201 pair<float,float> pred;
203 if(theClusterShape.
getSizes(recHit,ldir,clusterShapeCache, part,meas,pred))
208 int i = (part * (
exMax + 1) +
217 <<
' ' << pred.first <<
'/' << pred.second <<
' ' << ldir <<
' ' << ldir.
mag()<< std::endl;
221 histo[
i]->Fill(pred.first, pred.second);
230 processRec(recHit, theClusterFilter, ldir, clusterShapeCache, histo);
241 for (
auto const & sh :
simHits)
264 std::map<pair<unsigned int, float>, Elem> simHitMap;
267 pair<unsigned int, float>
key;
270 for(
auto const & recHit : recHits) {
272 if(!
checkSimHits(recHit, theHitAssociator, simHit, key,ss))
continue;
274 if(simHitMap.count(key) == 0)
276 else if( recHit.cluster()->size() >
277 simHitMap[
key].rhit->cluster()->size())
280 for (
auto const &
elem : simHitMap) {
290 if (
elem.second.size==1)
305 auto const & theClusterShape = *shape.
product();
309 auto const & tkTpl = *tTopoHandle;
327 processPixelRecHits(recHits, *theHitAssociator, theClusterShape, *clusterShapeCache,tkTpl);
339 auto const & theClusterShape = *shape.
product();
343 auto const & tkTpl = *tTopoHandle;
354 for (
auto const &
track : *tracks)
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;
365 if(
noBPIX1 && tkTpl.pxbLayer(
id)==1)
continue;
368 auto subdetid = (
id.subdetId());
371 auto const & ltp = trajParams[
h];
372 auto ldir = ltp.momentum()/ltp.momentum().mag();
380 if(pixelRecHit !=
nullptr)
381 processRec(*pixelRecHit, theClusterShape, ldir, *clusterShapeCache,
hrpc);
394 <<
" [ClusterShape] analyze simHits, recHits";
401 <<
" [ClusterShape] analyze recHits on recTracks";
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< data_type > DataContainer
static boost::mutex mutex
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
def analyze(function, filename, filter=None)
#define DEFINE_FWK_MODULE(type)
Global3DPoint GlobalPoint
std::vector< Track > TrackCollection
collection of Tracks
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Local3DPoint exitPoint() const
Exit point in the local Det frame.
const Surface::PositionType & position() const
The position (origin of the R.F.)
float timeOfFlight() const
data_type const * data(size_t cell) const
Abs< T >::type abs(const T &t)
bool isFast(TrackingRecHit const &hit)
constexpr size_type size() const noexcept
def elem(elemtype, innerHTML='', html_class='', kwargs)
unsigned int pxbLayer(const DetId &id) const
T const * product() const
bool getSizes(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, int &part, ClusterData::ArrayType &meas, std::pair< float, float > &predr, PixelData const *pd=0) const
unsigned short processType() const
virtual const GeomDetUnit * detUnit() const
bool isPixel(HitType hitType)
unsigned int trackId() const
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
DetId geographicalId() const
T const * product() const
Local3DPoint entryPoint() const
Entry point in the local Det frame.