46 const std::set<unsigned> RelevantProcesses = {0};
56 void endJob()
override;
68 const vector<TH2F*>&
histo)
const;
75 const vector<TH2F*>&
histo)
const;
80 pair<unsigned int, float>&
key,
81 unsigned int&
ss)
const;
103 using Lock = std::unique_lock<std::mutex>;
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,
121 10 * 2 * (
exMax + 2),
124 10 * 2 * (
eyMax + 2),
128 sprintf(histName,
"hrpc_%d_%d_%d", subdet, ex, ey);
129 hrpc.push_back(
new TH2F(histName,
131 10 * 2 * (
exMax + 2),
134 10 * 2 * (
eyMax + 2),
150 clusterShapeCache_token(
152 trackerHitAssociatorConfig_(
pset, consumesCollector()) {
153 file =
new TFile(
"clusterShape.root",
"RECREATE");
182 bool isOutgoing =
std::abs(ldir.
z()) > 0.01
f && (lvec.
z() * ldir.
z() > 0);
185 const bool isRelevant = RelevantProcesses.count(
simHit.processType());
190 constexpr
float ptCut2 = 0.2 * 0.2;
192 bool isFast = (
simHit.momentumAtEntry().perp2() > ptCut2);
195 return (isOutgoing && isRelevant &&
isFast);
203 const vector<TH2F*>&
histo)
const {
206 pair<float, float> pred;
209 if (meas.
size() == 1)
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;
221 histo[
i]->Fill(pred.first, pred.second);
230 const vector<TH2F*>&
histo)
const {
239 pair<unsigned int, float>&
key,
240 unsigned int&
ss)
const {
244 for (
auto const& sh :
simHits) {
267 std::map<pair<unsigned int, float>, Elem> simHitMap;
270 pair<unsigned int, float>
key;
279 if (simHitMap.count(
key) == 0) {
281 }
else if (
recHit.cluster()->size() > simHitMap[
key].rhit->cluster()->size())
284 for (
auto const& elem : simHitMap) {
294 if (elem.second.size == 1)
303 auto const& theClusterShape = *shape.
product();
307 auto const& tkTpl = *tTopoHandle;
332 auto const& theClusterShape = *shape.
product();
336 auto const& tkTpl = *tTopoHandle;
348 if (
track.numberOfValidHits() < 8)
350 auto const& trajParams =
track.extra()->trajParams();
352 auto hb =
track.recHitsBegin();
353 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
357 auto id =
recHit->geographicalId();
358 if (
noBPIX1 && tkTpl.pxbLayer(
id) == 1)
362 auto subdetid = (
id.subdetId());
365 auto const& ltp = trajParams[
h];
366 auto ldir = ltp.momentum() / ltp.momentum().mag();
372 if (pixelRecHit !=
nullptr)
382 LogTrace(
"MinBiasTracking") <<
" [ClusterShape] analyze simHits, recHits";
387 LogTrace(
"MinBiasTracking") <<
" [ClusterShape] analyze recHits on recTracks";