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 std::vector<SiPixelTemplateStore> thePixelTemp_;
106 SiPixelPhase1TrackClusters::SiPixelPhase1TrackClusters(
const edm::ParameterSet& iConfig)
110 offlinePrimaryVerticesToken_ =
111 applyVertexCut_ ? consumes<reco::VertexCollection>(iConfig.getParameter<
edm::InputTag>(
"vertices"))
114 pixelClusterShapeCacheToken_ =
115 consumes<SiPixelClusterShapeCache>(iConfig.getParameter<
edm::InputTag>(
"clusterShapeCache"));
117 trackerTopoToken_ = esConsumes<edm::Transition::BeginRun>();
118 trackerGeomToken_ = esConsumes<edm::Transition::BeginRun>();
119 clusterShapeHitFilterToken_ =
120 esConsumes<ClusterShapeHitFilter, CkfComponentsRecord>(
edm::ESInputTag(
"",
"ClusterShapeHitFilter"));
121 templateDBobjectToken_ = esConsumes<edm::Transition::BeginRun>();
126 tkTpl = &iSetup.
getData(trackerTopoToken_);
129 templateDBobject_ = &iSetup.
getData(templateDBobjectToken_);
132 <<
"Templates not filled correctly. Check the sqlite file. Using SiPixelTemplateDBObject version " 133 << (*templateDBobject_).version() << std::endl;
140 if (
histo.size() != ENUM_SIZE) {
142 <<
"incompatible configuration " <<
histo.size() <<
"!=" << ENUM_SIZE << std::endl;
147 auto const& shapeFilter = *shapeFilterH;
150 if (applyVertexCut_) {
161 edm::LogWarning(
"SiPixelPhase1TrackClusters") <<
"track collection is not valid";
168 iEvent.getByToken(pixelClusterShapeCacheToken_, pixelClusterShapeCacheH);
169 if (!pixelClusterShapeCacheH.
isValid()) {
170 edm::LogWarning(
"SiPixelPhase1TrackClusters") <<
"PixelClusterShapeCache collection is not valid";
173 auto const& pixelClusterShapeCache = *pixelClusterShapeCacheH;
176 if (applyVertexCut_ &&
180 bool isBpixtrack =
false, isFpixtrack =
false, crossesPixVol =
false;
185 crossesPixVol =
true;
187 auto etatk =
track.eta();
189 auto const& trajParams =
track.extra()->trajParams();
191 auto hb =
track.recHitsBegin();
193 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
197 auto id =
hit->geographicalId();
200 auto subdetid = (
id.subdetId());
211 bool iAmOuter = ((tkTpl->pxbLadder(
id) % 2 == 1) && tkTpl->pxbLayer(
id) != 4) ||
212 ((tkTpl->pxbLadder(
id) % 2 != 1) && tkTpl->pxbLayer(
id) == 4);
218 auto geomdetunit =
dynamic_cast<const PixelGeomDetUnit*
>(pixhit->detUnit());
222 auto clustp = pixhit->cluster();
225 auto const& cluster = *clustp;
226 const std::vector<SiPixelCluster::Pixel> pixelsVec = cluster.pixels();
227 for (
unsigned int i = 0;
i < pixelsVec.size(); ++
i) {
228 float pixx = pixelsVec[
i].x;
229 float pixy = pixelsVec[
i].y;
232 bool bigInY = topol.isItBigPixelInY(
int(pixy));
233 float pixel_charge = pixelsVec[
i].adc;
235 if (bigInX ==
true || bigInY ==
true) {
236 histo[ON_TRACK_BIGPIXELCHARGE].fill(pixel_charge,
id, &
iEvent);
238 histo[ON_TRACK_NOTBIGPIXELCHARGE].fill(pixel_charge,
id, &
iEvent);
241 auto const& ltp = trajParams[
h];
243 auto localDir = ltp.momentum() / ltp.momentum().mag();
246 auto charge = cluster.charge() * ltp.absdz();
248 float cotAlpha = ltp.dxdz();
249 float cotBeta = ltp.dydz();
256 templ.interpolate(templateDBobject_->getTemplateID(
id), cotAlpha, cotBeta, locBz, locBx);
257 auto charge_cor = (
charge * templ.qscale()) / templ.r_qMeas_qTrue();
258 auto tmpl = templ.qscale() / templ.r_qMeas_qTrue();
260 auto clustgp = pixhit->globalPosition();
264 std::pair<float, float> pred;
265 if (shapeFilter.getSizes(*pixhit, localDir, pixelClusterShapeCache,
part, meas, pred)) {
266 auto shape = shapeFilter.isCompatible(*pixhit, localDir, pixelClusterShapeCache);
267 unsigned shapeVal = (
shape ? 1 : 0);
271 histo[ON_TRACK_SIZE_X_OUTER].fill(pred.first, cluster.sizeX(),
id, &
iEvent);
272 histo[ON_TRACK_SIZE_Y_OUTER].fill(pred.second, cluster.sizeY(),
id, &
iEvent);
273 histo[ON_TRACK_SIZE_XY_OUTER].fill(cluster.sizeY(), cluster.sizeX(),
id, &
iEvent);
275 histo[ON_TRACK_SHAPE_OUTER].fill(shapeVal,
id, &
iEvent);
277 histo[ON_TRACK_SIZE_X_INNER].fill(pred.first, cluster.sizeX(),
id, &
iEvent);
278 histo[ON_TRACK_SIZE_Y_INNER].fill(pred.second, cluster.sizeY(),
id, &
iEvent);
279 histo[ON_TRACK_SIZE_XY_INNER].fill(cluster.sizeY(), cluster.sizeX(),
id, &
iEvent);
281 histo[ON_TRACK_SHAPE_INNER].fill(shapeVal,
id, &
iEvent);
284 histo[ON_TRACK_SIZE_X_F].fill(pred.first, cluster.sizeX(),
id, &
iEvent);
285 histo[ON_TRACK_SIZE_Y_F].fill(pred.second, cluster.sizeY(),
id, &
iEvent);
286 histo[ON_TRACK_SIZE_XY_F].fill(cluster.sizeY(), cluster.sizeX(),
id, &
iEvent);
291 for (
int i = 0;
i < cluster.size();
i++) {
293 histo[DIGIS_HITMAP_ON_TRACK].fill(
id, &
iEvent, vecipxl.
y, vecipxl.
x);
299 histo[ON_TRACK_CORRECTEDCHARGE].fill(charge_cor,
id, &
iEvent);
303 histo[ON_TRACK_POSITIONB].fill(clustgp.z(), clustgp.phi(),
id, &
iEvent);
304 histo[ON_TRACK_POSITIONF].fill(clustgp.x(), clustgp.y(),
id, &
iEvent);
311 histo[SIZE_VS_ETA_ON_TRACK_OUTER].fill(etatk, cluster.sizeY(),
id, &
iEvent);
313 histo[ON_TRACK_CORRECTEDCHARGE_OUTER].fill(charge_cor,
id, &
iEvent);
316 histo[SIZE_VS_ETA_ON_TRACK_INNER].fill(etatk, cluster.sizeY(),
id, &
iEvent);
318 histo[ON_TRACK_CORRECTEDCHARGE_INNER].fill(charge_cor,
id, &
iEvent);
326 if (isBpixtrack || isFpixtrack)
334 if (isBpixtrack || isFpixtrack)
341 histo[ON_TRACK_NCLUSTERS].executePerEventHarvesting(&
iEvent);
342 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
static bool pushfile(int filenum, std::vector< SiPixelTemplateStore > &pixelTemp, std::string dir="CalibTracker/SiPixelESProducers/data/")
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.