39 ON_TRACK_BIGPIXELCHARGE,
40 ON_TRACK_NOTBIGPIXELCHARGE,
46 DIGIS_HITMAP_ON_TRACK,
52 SIZE_VS_ETA_ON_TRACK_OUTER,
53 SIZE_VS_ETA_ON_TRACK_INNER,
54 ON_TRACK_CHARGE_OUTER,
55 ON_TRACK_CHARGE_INNER,
60 ON_TRACK_SIZE_X_OUTER,
61 ON_TRACK_SIZE_X_INNER,
63 ON_TRACK_SIZE_Y_OUTER,
64 ON_TRACK_SIZE_Y_INNER,
67 ON_TRACK_SIZE_XY_OUTER,
68 ON_TRACK_SIZE_XY_INNER,
70 CHARGE_VS_SIZE_ON_TRACK,
80 const bool applyVertexCut_;
91 SiPixelPhase1TrackClusters::SiPixelPhase1TrackClusters(
const edm::ParameterSet& iConfig)
95 offlinePrimaryVerticesToken_ =
99 pixelClusterShapeCacheToken_ =
102 trackerTopoToken_ = esConsumes<TrackerTopology, TrackerTopologyRcd>();
103 trackerGeomToken_ = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>();
104 clusterShapeHitFilterToken_ =
105 esConsumes<ClusterShapeHitFilter, CkfComponentsRecord>(
edm::ESInputTag(
"",
"ClusterShapeHitFilter"));
112 if (
histo.size() != ENUM_SIZE) {
114 <<
"incompatible configuration " <<
histo.size() <<
"!=" << ENUM_SIZE << std::endl;
123 auto const& tkTpl = *tTopoHandle;
126 auto const& shapeFilter = *shapeFilterH;
129 if (applyVertexCut_) {
140 edm::LogWarning(
"SiPixelPhase1TrackClusters") <<
"track collection is not valid";
145 iEvent.getByToken(pixelClusterShapeCacheToken_, pixelClusterShapeCacheH);
146 if (!pixelClusterShapeCacheH.
isValid()) {
147 edm::LogWarning(
"SiPixelPhase1TrackClusters") <<
"PixelClusterShapeCache collection is not valid";
150 auto const& pixelClusterShapeCache = *pixelClusterShapeCacheH;
153 if (applyVertexCut_ &&
157 bool isBpixtrack =
false, isFpixtrack =
false, crossesPixVol =
false;
162 crossesPixVol =
true;
164 auto etatk =
track.eta();
166 auto const& trajParams =
track.extra()->trajParams();
168 auto hb =
track.recHitsBegin();
170 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
174 auto id =
hit->geographicalId();
177 auto subdetid = (
id.subdetId());
188 bool iAmOuter = ((tkTpl.pxbLadder(
id) % 2 == 1) && tkTpl.pxbLayer(
id) != 4) ||
189 ((tkTpl.pxbLadder(
id) % 2 != 1) && tkTpl.pxbLayer(
id) == 4);
191 auto pixhit = dynamic_cast<const SiPixelRecHit*>(
hit->hit());
195 auto geomdetunit = dynamic_cast<const PixelGeomDetUnit*>(pixhit->detUnit());
196 auto const& topol = geomdetunit->specificTopology();
199 auto clustp = pixhit->cluster();
202 auto const& cluster = *clustp;
203 const std::vector<SiPixelCluster::Pixel> pixelsVec = cluster.pixels();
204 for (
unsigned int i = 0;
i < pixelsVec.size(); ++
i) {
205 float pixx = pixelsVec[
i].x;
206 float pixy = pixelsVec[
i].y;
208 bool bigInX = topol.isItBigPixelInX(
int(pixx));
209 bool bigInY = topol.isItBigPixelInY(
int(pixy));
210 float pixel_charge = pixelsVec[
i].adc;
212 if (bigInX ==
true || bigInY ==
true) {
213 histo[ON_TRACK_BIGPIXELCHARGE].fill(pixel_charge,
id, &
iEvent);
215 histo[ON_TRACK_NOTBIGPIXELCHARGE].fill(pixel_charge,
id, &
iEvent);
218 auto const& ltp = trajParams[
h];
220 auto localDir = ltp.momentum() / ltp.momentum().mag();
223 auto charge = cluster.charge() * ltp.absdz();
225 auto clustgp = pixhit->globalPosition();
229 std::pair<float, float> pred;
230 if (shapeFilter.getSizes(*pixhit, localDir, pixelClusterShapeCache,
part, meas, pred)) {
231 auto shape = shapeFilter.isCompatible(*pixhit, localDir, pixelClusterShapeCache);
232 unsigned shapeVal = (shape ? 1 : 0);
236 histo[ON_TRACK_SIZE_X_OUTER].fill(pred.first, cluster.sizeX(),
id, &
iEvent);
237 histo[ON_TRACK_SIZE_Y_OUTER].fill(pred.second, cluster.sizeY(),
id, &
iEvent);
238 histo[ON_TRACK_SIZE_XY_OUTER].fill(cluster.sizeY(), cluster.sizeX(),
id, &
iEvent);
240 histo[ON_TRACK_SHAPE_OUTER].fill(shapeVal,
id, &
iEvent);
242 histo[ON_TRACK_SIZE_X_INNER].fill(pred.first, cluster.sizeX(),
id, &
iEvent);
243 histo[ON_TRACK_SIZE_Y_INNER].fill(pred.second, cluster.sizeY(),
id, &
iEvent);
244 histo[ON_TRACK_SIZE_XY_INNER].fill(cluster.sizeY(), cluster.sizeX(),
id, &
iEvent);
246 histo[ON_TRACK_SHAPE_INNER].fill(shapeVal,
id, &
iEvent);
249 histo[ON_TRACK_SIZE_X_F].fill(pred.first, cluster.sizeX(),
id, &
iEvent);
250 histo[ON_TRACK_SIZE_Y_F].fill(pred.second, cluster.sizeY(),
id, &
iEvent);
251 histo[ON_TRACK_SIZE_XY_F].fill(cluster.sizeY(), cluster.sizeX(),
id, &
iEvent);
256 for (
int i = 0;
i < cluster.size();
i++) {
258 histo[DIGIS_HITMAP_ON_TRACK].fill(
id, &
iEvent, vecipxl.
y, vecipxl.
x);
266 histo[ON_TRACK_POSITIONB].fill(clustgp.z(), clustgp.phi(),
id, &
iEvent);
267 histo[ON_TRACK_POSITIONF].fill(clustgp.x(), clustgp.y(),
id, &
iEvent);
274 histo[SIZE_VS_ETA_ON_TRACK_OUTER].fill(etatk, cluster.sizeY(),
id, &
iEvent);
277 histo[SIZE_VS_ETA_ON_TRACK_INNER].fill(etatk, cluster.sizeY(),
id, &
iEvent);
285 if (isBpixtrack || isFpixtrack)
293 if (isBpixtrack || isFpixtrack)
300 histo[ON_TRACK_NCLUSTERS].executePerEventHarvesting(&
iEvent);
301 histo[ON_TRACK_NDIGIS].executePerEventHarvesting(&
iEvent);