42 ON_TRACK_CORRECTEDCHARGE,
44 ON_TRACK_BIGPIXELCHARGE,
45 ON_TRACK_NOTBIGPIXELCHARGE,
51 DIGIS_HITMAP_ON_TRACK,
57 SIZE_VS_ETA_ON_TRACK_OUTER,
58 SIZE_VS_ETA_ON_TRACK_INNER,
59 ON_TRACK_CHARGE_OUTER,
60 ON_TRACK_CHARGE_INNER,
61 ON_TRACK_CORRECTEDCHARGE_OUTER,
62 ON_TRACK_CORRECTEDCHARGE_INNER,
63 TEMPLATE_CORRECTION_OUTER,
64 TEMPLATE_CORRECTION_INNER,
69 ON_TRACK_SIZE_X_OUTER,
70 ON_TRACK_SIZE_X_INNER,
72 ON_TRACK_SIZE_Y_OUTER,
73 ON_TRACK_SIZE_Y_INNER,
76 ON_TRACK_SIZE_XY_OUTER,
77 ON_TRACK_SIZE_XY_INNER,
79 CHARGE_VS_SIZE_ON_TRACK,
90 const bool applyVertexCut_;
92 const std::vector<SiPixelTemplateStore>* thePixelTemp_ =
nullptr;
107 SiPixelPhase1TrackClusters::SiPixelPhase1TrackClusters(
const edm::ParameterSet& iConfig)
111 offlinePrimaryVerticesToken_ =
112 applyVertexCut_ ? consumes<reco::VertexCollection>(iConfig.getParameter<
edm::InputTag>(
"vertices"))
115 pixelClusterShapeCacheToken_ =
116 consumes<SiPixelClusterShapeCache>(iConfig.getParameter<
edm::InputTag>(
"clusterShapeCache"));
118 trackerTopoToken_ = esConsumes<edm::Transition::BeginRun>();
119 trackerGeomToken_ = esConsumes<edm::Transition::BeginRun>();
120 clusterShapeHitFilterToken_ =
121 esConsumes<ClusterShapeHitFilter, CkfComponentsRecord>(
edm::ESInputTag(
"",
"ClusterShapeHitFilter"));
122 templateStoreToken_ = esConsumes<edm::Transition::BeginRun>();
123 templateDBobjectToken_ = esConsumes<edm::Transition::BeginRun>();
128 tkTpl = &iSetup.
getData(trackerTopoToken_);
131 templateDBobject_ = &iSetup.
getData(templateDBobjectToken_);
132 thePixelTemp_ = &iSetup.
getData(templateStoreToken_);
139 if (
histo.size() != ENUM_SIZE) {
141 <<
"incompatible configuration " <<
histo.size() <<
"!=" << ENUM_SIZE << std::endl;
146 auto const& shapeFilter = *shapeFilterH;
149 if (applyVertexCut_) {
160 edm::LogWarning(
"SiPixelPhase1TrackClusters") <<
"track collection is not valid";
167 iEvent.getByToken(pixelClusterShapeCacheToken_, pixelClusterShapeCacheH);
168 if (!pixelClusterShapeCacheH.
isValid()) {
169 edm::LogWarning(
"SiPixelPhase1TrackClusters") <<
"PixelClusterShapeCache collection is not valid";
172 auto const& pixelClusterShapeCache = *pixelClusterShapeCacheH;
175 if (applyVertexCut_ &&
179 bool isBpixtrack =
false, isFpixtrack =
false, crossesPixVol =
false;
184 crossesPixVol =
true;
186 auto etatk =
track.eta();
188 auto const& trajParams =
track.extra()->trajParams();
190 auto hb =
track.recHitsBegin();
192 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
196 auto id =
hit->geographicalId();
199 auto subdetid = (
id.subdetId());
210 bool iAmOuter = ((tkTpl->pxbLadder(
id) % 2 == 1) && tkTpl->pxbLayer(
id) != 4) ||
211 ((tkTpl->pxbLadder(
id) % 2 != 1) && tkTpl->pxbLayer(
id) == 4);
217 auto geomdetunit =
dynamic_cast<const PixelGeomDetUnit*
>(pixhit->detUnit());
221 auto clustp = pixhit->cluster();
224 auto const& cluster = *clustp;
225 const std::vector<SiPixelCluster::Pixel> pixelsVec = cluster.pixels();
226 for (
unsigned int i = 0;
i < pixelsVec.size(); ++
i) {
227 float pixx = pixelsVec[
i].x;
228 float pixy = pixelsVec[
i].y;
231 bool bigInY = topol.isItBigPixelInY(
int(pixy));
232 float pixel_charge = pixelsVec[
i].adc;
234 if (bigInX ==
true || bigInY ==
true) {
235 histo[ON_TRACK_BIGPIXELCHARGE].fill(pixel_charge,
id, &
iEvent);
237 histo[ON_TRACK_NOTBIGPIXELCHARGE].fill(pixel_charge,
id, &
iEvent);
240 auto const& ltp = trajParams[
h];
242 auto localDir = ltp.momentum() / ltp.momentum().mag();
245 auto charge = cluster.charge() * ltp.absdz();
247 float cotAlpha = ltp.dxdz();
248 float cotBeta = ltp.dydz();
255 templ.interpolate(templateDBobject_->getTemplateID(
id), cotAlpha, cotBeta, locBz, locBx);
256 auto charge_cor = (
charge * templ.qscale()) / templ.r_qMeas_qTrue();
257 auto tmpl = templ.qscale() / templ.r_qMeas_qTrue();
259 auto clustgp = pixhit->globalPosition();
263 std::pair<float, float> pred;
264 if (shapeFilter.getSizes(*pixhit, localDir, pixelClusterShapeCache,
part, meas, pred)) {
265 auto shape = shapeFilter.isCompatible(*pixhit, localDir, pixelClusterShapeCache);
266 unsigned shapeVal = (
shape ? 1 : 0);
270 histo[ON_TRACK_SIZE_X_OUTER].fill(pred.first, cluster.sizeX(),
id, &
iEvent);
271 histo[ON_TRACK_SIZE_Y_OUTER].fill(pred.second, cluster.sizeY(),
id, &
iEvent);
272 histo[ON_TRACK_SIZE_XY_OUTER].fill(cluster.sizeY(), cluster.sizeX(),
id, &
iEvent);
274 histo[ON_TRACK_SHAPE_OUTER].fill(shapeVal,
id, &
iEvent);
276 histo[ON_TRACK_SIZE_X_INNER].fill(pred.first, cluster.sizeX(),
id, &
iEvent);
277 histo[ON_TRACK_SIZE_Y_INNER].fill(pred.second, cluster.sizeY(),
id, &
iEvent);
278 histo[ON_TRACK_SIZE_XY_INNER].fill(cluster.sizeY(), cluster.sizeX(),
id, &
iEvent);
280 histo[ON_TRACK_SHAPE_INNER].fill(shapeVal,
id, &
iEvent);
283 histo[ON_TRACK_SIZE_X_F].fill(pred.first, cluster.sizeX(),
id, &
iEvent);
284 histo[ON_TRACK_SIZE_Y_F].fill(pred.second, cluster.sizeY(),
id, &
iEvent);
285 histo[ON_TRACK_SIZE_XY_F].fill(cluster.sizeY(), cluster.sizeX(),
id, &
iEvent);
290 for (
int i = 0;
i < cluster.size();
i++) {
292 histo[DIGIS_HITMAP_ON_TRACK].fill(
id, &
iEvent, vecipxl.
y, vecipxl.
x);
298 histo[ON_TRACK_CORRECTEDCHARGE].fill(charge_cor,
id, &
iEvent);
302 histo[ON_TRACK_POSITIONB].fill(clustgp.z(), clustgp.phi(),
id, &
iEvent);
303 histo[ON_TRACK_POSITIONF].fill(clustgp.x(), clustgp.y(),
id, &
iEvent);
310 histo[SIZE_VS_ETA_ON_TRACK_OUTER].fill(etatk, cluster.sizeY(),
id, &
iEvent);
312 histo[ON_TRACK_CORRECTEDCHARGE_OUTER].fill(charge_cor,
id, &
iEvent);
315 histo[SIZE_VS_ETA_ON_TRACK_INNER].fill(etatk, cluster.sizeY(),
id, &
iEvent);
317 histo[ON_TRACK_CORRECTEDCHARGE_INNER].fill(charge_cor,
id, &
iEvent);
325 if (isBpixtrack || isFpixtrack)
333 if (isBpixtrack || isFpixtrack)
340 histo[ON_TRACK_NCLUSTERS].executePerEventHarvesting(&
iEvent);
341 histo[ON_TRACK_NDIGIS].executePerEventHarvesting(&
iEvent);
T getParameter(std::string const &) const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Log< level::Error, false > LogError
std::vector< Vertex > VertexCollection
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
virtual bool isItBigPixelInX(int ixbin) const =0
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
virtual void dqmBeginRun(edm::Run const &, edm::EventSetup const &)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
static constexpr float d0
void analyze(edm::Event const &e, edm::EventSetup const &) override=0
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
Log< level::Warning, false > LogWarning
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.