40 ON_TRACK_BIGPIXELCHARGE,
41 ON_TRACK_NOTBIGPIXELCHARGE,
47 DIGIS_HITMAP_ON_TRACK,
53 SIZE_VS_ETA_ON_TRACK_OUTER,
54 SIZE_VS_ETA_ON_TRACK_INNER,
55 ON_TRACK_CHARGE_OUTER,
56 ON_TRACK_CHARGE_INNER,
61 ON_TRACK_SIZE_X_OUTER,
62 ON_TRACK_SIZE_X_INNER,
64 ON_TRACK_SIZE_Y_OUTER,
65 ON_TRACK_SIZE_Y_INNER,
68 ON_TRACK_SIZE_XY_OUTER,
69 ON_TRACK_SIZE_XY_INNER,
71 CHARGE_VS_SIZE_ON_TRACK,
81 const bool applyVertexCut_;
88 SiPixelPhase1TrackClusters::SiPixelPhase1TrackClusters(
const edm::ParameterSet& iConfig)
92 offlinePrimaryVerticesToken_ =
96 pixelClusterShapeCacheToken_ =
104 if (
histo.size() != ENUM_SIZE) {
106 <<
"incompatible configuration " <<
histo.size() <<
"!=" << ENUM_SIZE << std::endl;
117 auto const& tkTpl = *tTopoHandle;
121 auto const& shapeFilter = *shapeFilterH;
124 if (applyVertexCut_) {
135 edm::LogWarning(
"SiPixelPhase1TrackClusters") <<
"track collection is not valid";
140 iEvent.getByToken(pixelClusterShapeCacheToken_, pixelClusterShapeCacheH);
141 if (!pixelClusterShapeCacheH.
isValid()) {
142 edm::LogWarning(
"SiPixelPhase1TrackClusters") <<
"PixelClusterShapeCache collection is not valid";
145 auto const& pixelClusterShapeCache = *pixelClusterShapeCacheH;
148 if (applyVertexCut_ &&
152 bool isBpixtrack =
false, isFpixtrack =
false, crossesPixVol =
false;
157 crossesPixVol =
true;
159 auto etatk =
track.eta();
161 auto const& trajParams =
track.extra()->trajParams();
163 auto hb =
track.recHitsBegin();
165 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
169 auto id =
hit->geographicalId();
172 auto subdetid = (
id.subdetId());
183 bool iAmOuter = ((tkTpl.pxbLadder(
id) % 2 == 1) && tkTpl.pxbLayer(
id) != 4) ||
184 ((tkTpl.pxbLadder(
id) % 2 != 1) && tkTpl.pxbLayer(
id) == 4);
186 auto pixhit = dynamic_cast<const SiPixelRecHit*>(
hit->hit());
190 auto geomdetunit = dynamic_cast<const PixelGeomDetUnit*>(pixhit->detUnit());
191 auto const& topol = geomdetunit->specificTopology();
194 auto clustp = pixhit->cluster();
197 auto const& cluster = *clustp;
198 const std::vector<SiPixelCluster::Pixel> pixelsVec = cluster.pixels();
199 for (
unsigned int i = 0;
i < pixelsVec.size(); ++
i) {
200 float pixx = pixelsVec[
i].x;
201 float pixy = pixelsVec[
i].y;
203 bool bigInX = topol.isItBigPixelInX(
int(pixx));
204 bool bigInY = topol.isItBigPixelInY(
int(pixy));
205 float pixel_charge = pixelsVec[
i].adc;
207 if (bigInX ==
true || bigInY ==
true) {
208 histo[ON_TRACK_BIGPIXELCHARGE].fill(pixel_charge,
id, &
iEvent);
210 histo[ON_TRACK_NOTBIGPIXELCHARGE].fill(pixel_charge,
id, &
iEvent);
213 auto const& ltp = trajParams[
h];
215 auto localDir = ltp.momentum() / ltp.momentum().mag();
218 auto charge = cluster.charge() * ltp.absdz();
220 auto clustgp = pixhit->globalPosition();
224 std::pair<float, float> pred;
225 if (shapeFilter.getSizes(*pixhit, localDir, pixelClusterShapeCache,
part, meas, pred)) {
226 auto shape = shapeFilter.isCompatible(*pixhit, localDir, pixelClusterShapeCache);
227 unsigned shapeVal = (shape ? 1 : 0);
231 histo[ON_TRACK_SIZE_X_OUTER].fill(pred.first, cluster.sizeX(),
id, &
iEvent);
232 histo[ON_TRACK_SIZE_Y_OUTER].fill(pred.second, cluster.sizeY(),
id, &
iEvent);
233 histo[ON_TRACK_SIZE_XY_OUTER].fill(cluster.sizeY(), cluster.sizeX(),
id, &
iEvent);
235 histo[ON_TRACK_SHAPE_OUTER].fill(shapeVal,
id, &
iEvent);
237 histo[ON_TRACK_SIZE_X_INNER].fill(pred.first, cluster.sizeX(),
id, &
iEvent);
238 histo[ON_TRACK_SIZE_Y_INNER].fill(pred.second, cluster.sizeY(),
id, &
iEvent);
239 histo[ON_TRACK_SIZE_XY_INNER].fill(cluster.sizeY(), cluster.sizeX(),
id, &
iEvent);
241 histo[ON_TRACK_SHAPE_INNER].fill(shapeVal,
id, &
iEvent);
244 histo[ON_TRACK_SIZE_X_F].fill(pred.first, cluster.sizeX(),
id, &
iEvent);
245 histo[ON_TRACK_SIZE_Y_F].fill(pred.second, cluster.sizeY(),
id, &
iEvent);
246 histo[ON_TRACK_SIZE_XY_F].fill(cluster.sizeY(), cluster.sizeX(),
id, &
iEvent);
251 for (
int i = 0;
i < cluster.size();
i++) {
253 histo[DIGIS_HITMAP_ON_TRACK].fill(
id, &
iEvent, vecipxl.
y, vecipxl.
x);
261 histo[ON_TRACK_POSITIONB].fill(clustgp.z(), clustgp.phi(),
id, &
iEvent);
262 histo[ON_TRACK_POSITIONF].fill(clustgp.x(), clustgp.y(),
id, &
iEvent);
269 histo[SIZE_VS_ETA_ON_TRACK_OUTER].fill(etatk, cluster.sizeY(),
id, &
iEvent);
272 histo[SIZE_VS_ETA_ON_TRACK_INNER].fill(etatk, cluster.sizeY(),
id, &
iEvent);
280 if (isBpixtrack || isFpixtrack)
288 if (isBpixtrack || isFpixtrack)
295 histo[ON_TRACK_NCLUSTERS].executePerEventHarvesting(&
iEvent);
296 histo[ON_TRACK_NDIGIS].executePerEventHarvesting(&
iEvent);