48 const std::set<unsigned> RelevantProcesses = {0};
58 void endJob()
override;
70 const vector<TH2F*>&
histo)
const;
77 const vector<TH2F*>&
histo)
const;
82 pair<unsigned int, float>&
key,
83 unsigned int&
ss)
const;
105 using Lock = std::unique_lock<std::mutex>;
117 for (
int subdet = 0; subdet <= 1; subdet++) {
118 for (
int ex = 0; ex <=
exMax; ex++)
119 for (
int ey = 0; ey <=
eyMax; ey++) {
120 sprintf(histName,
"hspc_%d_%d_%d", subdet, ex, ey);
121 hspc.push_back(
new TH2F(histName,
123 10 * 2 * (
exMax + 2),
126 10 * 2 * (
eyMax + 2),
130 sprintf(histName,
"hrpc_%d_%d_%d", subdet, ex, ey);
131 hrpc.push_back(
new TH2F(histName,
133 10 * 2 * (
exMax + 2),
136 10 * 2 * (
eyMax + 2),
141 theMutex = std::make_unique<std::mutex[]>(hspc.size());
152 clusterShapeCache_token(
154 trackerHitAssociatorConfig_(
pset, consumesCollector()) {
155 file =
new TFile(
"clusterShape.root",
"RECREATE");
184 bool isOutgoing =
std::abs(ldir.
z()) > 0.01
f && (lvec.
z() * ldir.
z() > 0);
187 const bool isRelevant = RelevantProcesses.count(
simHit.processType());
192 constexpr
float ptCut2 = 0.2 * 0.2;
194 bool isFast = (
simHit.momentumAtEntry().perp2() > ptCut2);
197 return (isOutgoing && isRelevant &&
isFast);
205 const vector<TH2F*>&
histo)
const {
208 pair<float, float> pred;
211 if (meas.
size() == 1)
217 int id =
recHit.geographicalId();
218 std::cout <<
id <<
" bigpred " << meas.
front().first <<
'/' << meas.
front().second <<
' ' << pred.first <<
'/'
219 << pred.second <<
' ' << ldir <<
' ' << ldir.
mag() << std::endl;
223 histo[
i]->Fill(pred.first, pred.second);
232 const vector<TH2F*>&
histo)
const {
241 pair<unsigned int, float>&
key,
242 unsigned int&
ss)
const {
246 for (
auto const& sh :
simHits) {
269 std::map<pair<unsigned int, float>, Elem> simHitMap;
272 pair<unsigned int, float>
key;
281 if (simHitMap.count(
key) == 0) {
283 }
else if (
recHit.cluster()->size() > simHitMap[
key].rhit->cluster()->size())
286 for (
auto const& elem : simHitMap) {
296 if (elem.second.size == 1)
305 auto const& theClusterShape = *shape.
product();
309 auto const& tkTpl = *tTopoHandle;
334 auto const& theClusterShape = *shape.
product();
338 auto const& tkTpl = *tTopoHandle;
350 if (
track.numberOfValidHits() < 8)
352 auto const& trajParams =
track.extra()->trajParams();
354 auto hb =
track.recHitsBegin();
355 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
359 auto id =
recHit->geographicalId();
360 if (
noBPIX1 && tkTpl.pxbLayer(
id) == 1)
364 auto subdetid = (
id.subdetId());
367 auto const& ltp = trajParams[
h];
368 auto ldir = ltp.momentum() / ltp.momentum().mag();
374 if (pixelRecHit !=
nullptr)
384 LogTrace(
"MinBiasTracking") <<
" [ClusterShape] analyze simHits, recHits";
389 LogTrace(
"MinBiasTracking") <<
" [ClusterShape] analyze recHits on recTracks";