CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SiPixelLorentzAnglePCLWorker.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CalibTracker/SiPixelLorentzAnglePCLWorker
4 // Class: SiPixelLorentzAnglePCLWorker
5 //
11 //
12 // Original Author: mmusich
13 // Created: Sat, 29 May 2021 14:46:19 GMT
14 //
15 //
16 
17 // system includes
18 #include <string>
19 #include <fmt/printf.h>
20 
21 // user include files
57 
58 // ROOT includes
59 #include <TTree.h>
60 #include <TFile.h>
61 #include <fstream>
62 
63 //
64 // class declaration
65 //
66 
67 static const int maxpix = 1000;
68 struct Pixinfo {
69  int npix;
70  float row[maxpix];
71  float col[maxpix];
72  float adc[maxpix];
73  float x[maxpix];
74  float y[maxpix];
75 };
76 
77 struct Hit {
78  float x;
79  float y;
80  double alpha;
81  double beta;
82  double gamma;
83 };
84 struct Clust {
85  float x;
86  float y;
87  float charge;
88  int size_x;
89  int size_y;
90  int maxPixelCol;
91  int maxPixelRow;
92  int minPixelCol;
93  int minPixelRow;
94 };
95 struct Rechit {
96  float x;
97  float y;
98 };
99 
101 public:
103  ~SiPixelLorentzAnglePCLWorker() override = default;
104 
105  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
106 
107 private:
108  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
109 
110  void analyze(edm::Event const&, edm::EventSetup const&) override;
111 
112  void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
113 
114  void dqmEndRun(edm::Run const&, edm::EventSetup const&);
115 
116  const Pixinfo fillPix(const SiPixelCluster& LocPix, const PixelTopology* topol) const;
117  const std::pair<LocalPoint, LocalPoint> surface_deformation(const PixelTopology* topol,
119  const SiPixelRecHit* recHitPix) const;
120  // ------------ member data ------------
122 
123  // template stuff
126  std::vector<SiPixelTemplateStore> thePixelTemp_;
127 
129  bool notInPCL_;
131  std::vector<std::string> newmodulelist_;
132 
133  // tree branches barrel
134  int run_;
135  long int event_;
137  int bx_;
138  int orbit_;
139  int module_;
140  int ladder_;
141  int layer_;
143  float pt_;
144  float eta_;
145  float phi_;
146  double chi2_;
147  double ndof_;
155  float qScale_;
156  float rQmQt_;
157 
158  // tree branches forward
159  int sideF_;
160  int diskF_;
161  int bladeF_;
162  int panelF_;
163  int moduleF_;
171  float qScaleF_;
172  float rQmQtF_;
173 
174  // parameters from config file
175  double ptmin_;
176  double normChi2Max_;
177  std::vector<int> clustSizeYMin_;
179  double residualMax_;
183 
184  std::unique_ptr<TFile> hFile_;
185  std::unique_ptr<TTree> SiPixelLorentzAngleTreeBarrel_;
186  std::unique_ptr<TTree> SiPixelLorentzAngleTreeForward_;
187 
188  // es consumes
194 
195  // event consumes
197 };
198 
199 //
200 // constructors and destructor
201 //
203  : folder_(iConfig.getParameter<std::string>("folder")),
204  notInPCL_(iConfig.getParameter<bool>("notInPCL")),
205  filename_(iConfig.getParameter<std::string>("fileName")),
206  newmodulelist_(iConfig.getParameter<std::vector<std::string>>("newmodulelist")),
207  ptmin_(iConfig.getParameter<double>("ptMin")),
208  normChi2Max_(iConfig.getParameter<double>("normChi2Max")),
209  clustSizeYMin_(iConfig.getParameter<std::vector<int>>("clustSizeYMin")),
210  clustSizeXMax_(iConfig.getParameter<int>("clustSizeXMax")),
211  residualMax_(iConfig.getParameter<double>("residualMax")),
212  clustChargeMaxPerLength_(iConfig.getParameter<double>("clustChargeMaxPerLength")),
213  hist_depth_(iConfig.getParameter<int>("binsDepth")),
214  hist_drift_(iConfig.getParameter<int>("binsDrift")),
215  geomEsToken_(esConsumes<edm::Transition::BeginRun>()),
216  topoEsToken_(esConsumes<edm::Transition::BeginRun>()),
217  siPixelTemplateEsToken_(esConsumes<edm::Transition::BeginRun>()),
218  topoPerEventEsToken_(esConsumes()),
219  geomPerEventEsToken_(esConsumes()) {
220  t_trajTrack = consumes<TrajTrackAssociationCollection>(iConfig.getParameter<edm::InputTag>("src"));
221 
222  // now do what ever initialization is needed
223  int bufsize = 64000;
224 
225  // create tree structure
226  // Barrel pixel
227  if (notInPCL_) {
228  hFile_ = std::make_unique<TFile>(filename_.c_str(), "RECREATE");
230  std::make_unique<TTree>("SiPixelLorentzAngleTreeBarrel_", "SiPixel LorentzAngle tree barrel", bufsize);
231  SiPixelLorentzAngleTreeBarrel_->Branch("run", &run_, "run/I", bufsize);
232  SiPixelLorentzAngleTreeBarrel_->Branch("event", &event_, "event/l", bufsize);
233  SiPixelLorentzAngleTreeBarrel_->Branch("lumiblock", &lumiblock_, "lumiblock/I", bufsize);
234  SiPixelLorentzAngleTreeBarrel_->Branch("bx", &bx_, "bx/I", bufsize);
235  SiPixelLorentzAngleTreeBarrel_->Branch("orbit", &orbit_, "orbit/I", bufsize);
236  SiPixelLorentzAngleTreeBarrel_->Branch("module", &module_, "module/I", bufsize);
237  SiPixelLorentzAngleTreeBarrel_->Branch("ladder", &ladder_, "ladder/I", bufsize);
238  SiPixelLorentzAngleTreeBarrel_->Branch("layer", &layer_, "layer/I", bufsize);
239  SiPixelLorentzAngleTreeBarrel_->Branch("isflipped", &isflipped_, "isflipped/I", bufsize);
240  SiPixelLorentzAngleTreeBarrel_->Branch("pt", &pt_, "pt/F", bufsize);
241  SiPixelLorentzAngleTreeBarrel_->Branch("eta", &eta_, "eta/F", bufsize);
242  SiPixelLorentzAngleTreeBarrel_->Branch("phi", &phi_, "phi/F", bufsize);
243  SiPixelLorentzAngleTreeBarrel_->Branch("chi2", &chi2_, "chi2/D", bufsize);
244  SiPixelLorentzAngleTreeBarrel_->Branch("ndof", &ndof_, "ndof/D", bufsize);
245  SiPixelLorentzAngleTreeBarrel_->Branch("trackhit", &trackhit_, "x/F:y/F:alpha/D:beta/D:gamma_/D", bufsize);
246  SiPixelLorentzAngleTreeBarrel_->Branch("npix", &pixinfo_.npix, "npix/I", bufsize);
247  SiPixelLorentzAngleTreeBarrel_->Branch("rowpix", pixinfo_.row, "row[npix]/F", bufsize);
248  SiPixelLorentzAngleTreeBarrel_->Branch("colpix", pixinfo_.col, "col[npix]/F", bufsize);
249  SiPixelLorentzAngleTreeBarrel_->Branch("adc", pixinfo_.adc, "adc[npix]/F", bufsize);
250  SiPixelLorentzAngleTreeBarrel_->Branch("xpix", pixinfo_.x, "x[npix]/F", bufsize);
251  SiPixelLorentzAngleTreeBarrel_->Branch("ypix", pixinfo_.y, "y[npix]/F", bufsize);
252 
253  SiPixelLorentzAngleTreeBarrel_->Branch(
254  "clust",
255  &clust_,
256  "x/F:y/F:charge/F:size_x/I:size_y/I:maxPixelCol/I:maxPixelRow:minPixelCol/I:minPixelRow/I",
257  bufsize);
258  SiPixelLorentzAngleTreeBarrel_->Branch("rechit", &rechit_, "x/F:y/F", bufsize);
259  SiPixelLorentzAngleTreeBarrel_->Branch("rechit_corr", &rechitCorr_, "x/F:y/F", bufsize);
260  SiPixelLorentzAngleTreeBarrel_->Branch("trackhitcorr_x", &trackhitCorrX_, "trackhitcorr_x/F", bufsize);
261  SiPixelLorentzAngleTreeBarrel_->Branch("trackhitcorr_y", &trackhitCorrY_, "trackhitcorr_y/F", bufsize);
262  SiPixelLorentzAngleTreeBarrel_->Branch("qScale", &qScale_, "qScale/F", bufsize);
263  SiPixelLorentzAngleTreeBarrel_->Branch("rQmQt", &rQmQt_, "rQmQt/F", bufsize);
264  // Forward pixel
265 
267  std::make_unique<TTree>("SiPixelLorentzAngleTreeForward_", "SiPixel LorentzAngle tree forward", bufsize);
268  SiPixelLorentzAngleTreeForward_->Branch("run", &run_, "run/I", bufsize);
269  SiPixelLorentzAngleTreeForward_->Branch("event", &event_, "event/l", bufsize);
270  SiPixelLorentzAngleTreeForward_->Branch("lumiblock", &lumiblock_, "lumiblock/I", bufsize);
271  SiPixelLorentzAngleTreeForward_->Branch("bx", &bx_, "bx/I", bufsize);
272  SiPixelLorentzAngleTreeForward_->Branch("orbit", &orbit_, "orbit/I", bufsize);
273  SiPixelLorentzAngleTreeForward_->Branch("side", &sideF_, "side/I", bufsize);
274  SiPixelLorentzAngleTreeForward_->Branch("disk", &diskF_, "disk/I", bufsize);
275  SiPixelLorentzAngleTreeForward_->Branch("blade", &bladeF_, "blade/I", bufsize);
276  SiPixelLorentzAngleTreeForward_->Branch("panel", &panelF_, "panel/I", bufsize);
277  SiPixelLorentzAngleTreeForward_->Branch("module", &moduleF_, "module/I", bufsize);
278  SiPixelLorentzAngleTreeForward_->Branch("pt", &pt_, "pt/F", bufsize);
279  SiPixelLorentzAngleTreeForward_->Branch("eta", &eta_, "eta/F", bufsize);
280  SiPixelLorentzAngleTreeForward_->Branch("phi", &phi_, "phi/F", bufsize);
281  SiPixelLorentzAngleTreeForward_->Branch("chi2", &chi2_, "chi2/D", bufsize);
282  SiPixelLorentzAngleTreeForward_->Branch("ndof", &ndof_, "ndof/D", bufsize);
283  SiPixelLorentzAngleTreeForward_->Branch("trackhit", &trackhitF_, "x/F:y/F:alpha/D:beta/D:gamma_/D", bufsize);
284  SiPixelLorentzAngleTreeForward_->Branch("npix", &pixinfoF_.npix, "npix/I", bufsize);
285  SiPixelLorentzAngleTreeForward_->Branch("rowpix", pixinfoF_.row, "row[npix]/F", bufsize);
286  SiPixelLorentzAngleTreeForward_->Branch("colpix", pixinfoF_.col, "col[npix]/F", bufsize);
287  SiPixelLorentzAngleTreeForward_->Branch("adc", pixinfoF_.adc, "adc[npix]/F", bufsize);
288  SiPixelLorentzAngleTreeForward_->Branch("xpix", pixinfoF_.x, "x[npix]/F", bufsize);
289  SiPixelLorentzAngleTreeForward_->Branch("ypix", pixinfoF_.y, "y[npix]/F", bufsize);
290 
292  "clust",
293  &clustF_,
294  "x/F:y/F:charge/F:size_x/I:size_y/I:maxPixelCol/I:maxPixelRow:minPixelCol/I:minPixelRow/I",
295  bufsize);
296  SiPixelLorentzAngleTreeForward_->Branch("rechit", &rechitF_, "x/F:y/F", bufsize);
297  SiPixelLorentzAngleTreeForward_->Branch("rechit_corr", &rechitCorrF_, "x/F:y/F", bufsize);
298  SiPixelLorentzAngleTreeForward_->Branch("trackhitcorr_x", &trackhitCorrXF_, "trackhitcorr_x/F", bufsize);
299  SiPixelLorentzAngleTreeForward_->Branch("trackhitcorr_y", &trackhitCorrYF_, "trackhitcorr_y/F", bufsize);
300  SiPixelLorentzAngleTreeForward_->Branch("qScale", &qScaleF_, "qScale/F", bufsize);
301  SiPixelLorentzAngleTreeForward_->Branch("rQmQt", &rQmQtF_, "rQmQt/F", bufsize);
302  }
303 }
304 
305 //
306 // member functions
307 //
308 
309 // ------------ method called for each event ------------
310 
312  static constexpr float cmToum = 10000.;
313 
314  // Retrieve tracker topology from geometry
315  const TrackerTopology* const tTopo = &iSetup.getData(topoPerEventEsToken_);
316 
317  // Retrieve track geometry
318  const TrackerGeometry* tracker = &iSetup.getData(geomPerEventEsToken_);
319 
320  // get the association map between tracks and trajectories
321  edm::Handle<TrajTrackAssociationCollection> trajTrackCollectionHandle;
322  iEvent.getByToken(t_trajTrack, trajTrackCollectionHandle);
323 
324  module_ = -1;
325  layer_ = -1;
326  ladder_ = -1;
327  isflipped_ = -1;
328  pt_ = -999;
329  eta_ = 999;
330  phi_ = 999;
331  pixinfo_.npix = 0;
332 
333  run_ = iEvent.id().run();
334  event_ = iEvent.id().event();
335  lumiblock_ = iEvent.luminosityBlock();
336  bx_ = iEvent.bunchCrossing();
337  orbit_ = iEvent.orbitNumber();
338 
339  if (!trajTrackCollectionHandle->empty()) {
340  for (TrajTrackAssociationCollection::const_iterator it = trajTrackCollectionHandle->begin();
341  it != trajTrackCollectionHandle->end();
342  ++it) {
343  const reco::Track& track = *it->val;
344  const Trajectory& traj = *it->key;
345 
346  // get the trajectory measurements
347  std::vector<TrajectoryMeasurement> tmColl = traj.measurements();
348  pt_ = track.pt();
349  eta_ = track.eta();
350  phi_ = track.phi();
351  chi2_ = traj.chiSquared();
352  ndof_ = traj.ndof();
353 
354  if (pt_ < ptmin_)
355  continue;
356 
361  iHists.h_tracks_->Fill(0);
362  bool pixeltrack = false;
363 
364  // iterate over trajectory measurements
365  for (const auto& itTraj : tmColl) {
366  if (!itTraj.updatedState().isValid())
367  continue;
368  const TransientTrackingRecHit::ConstRecHitPointer& recHit = itTraj.recHit();
369  if (!recHit->isValid() || recHit->geographicalId().det() != DetId::Tracker)
370  continue;
371  unsigned int subDetID = (recHit->geographicalId().subdetId());
372  if (subDetID == PixelSubdetector::PixelBarrel || subDetID == PixelSubdetector::PixelEndcap) {
373  if (!pixeltrack) {
374  iHists.h_tracks_->Fill(1);
375  }
376  pixeltrack = true;
377  }
378 
379  if (subDetID == PixelSubdetector::PixelBarrel) {
380  DetId detIdObj = recHit->geographicalId();
381  const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(tracker->idToDet(detIdObj));
382  if (!theGeomDet)
383  continue;
384 
385  const PixelTopology* topol = &(theGeomDet->specificTopology());
386 
387  float ypitch_ = topol->pitch().second;
388  float width_ = theGeomDet->surface().bounds().thickness();
389 
390  if (!topol)
391  continue;
392 
393  layer_ = tTopo->pxbLayer(detIdObj);
394  ladder_ = tTopo->pxbLadder(detIdObj);
395  module_ = tTopo->pxbModule(detIdObj);
396 
397  float tmp1 = theGeomDet->surface().toGlobal(Local3DPoint(0., 0., 0.)).perp();
398  float tmp2 = theGeomDet->surface().toGlobal(Local3DPoint(0., 0., 1.)).perp();
399 
400  isflipped_ = (tmp2 < tmp1) ? 1 : 0;
401 
402  const SiPixelRecHit* recHitPix = dynamic_cast<const SiPixelRecHit*>((*recHit).hit());
403  if (!recHitPix)
404  continue;
405  rechit_.x = recHitPix->localPosition().x();
406  rechit_.y = recHitPix->localPosition().y();
407  SiPixelRecHit::ClusterRef const& cluster = recHitPix->cluster();
408 
409  pixinfo_ = fillPix(*cluster, topol);
410 
411  // fill entries in clust_
412 
413  clust_.x = (cluster)->x();
414  clust_.y = (cluster)->y();
415  clust_.charge = (cluster->charge()) / 1000.; // clust_.charge: in the unit of 1000e
416  clust_.size_x = cluster->sizeX();
417  clust_.size_y = cluster->sizeY();
418  clust_.maxPixelCol = cluster->maxPixelCol();
419  clust_.maxPixelRow = cluster->maxPixelRow();
420  clust_.minPixelCol = cluster->minPixelCol();
421  clust_.minPixelRow = cluster->minPixelRow();
422 
423  // fill the trackhit info
424  TrajectoryStateOnSurface tsos = itTraj.updatedState();
425  if (!tsos.isValid()) {
426  edm::LogWarning("SiPixelLorentzAnglePCLWorker") << "tsos not valid";
427  continue;
428  }
429  LocalVector trackdirection = tsos.localDirection();
430  LocalPoint trackposition = tsos.localPosition();
431 
432  if (trackdirection.z() == 0)
433  continue;
434  // the local position and direction
435  trackhit_.alpha = atan2(trackdirection.z(), trackdirection.x());
436  trackhit_.beta = atan2(trackdirection.z(), trackdirection.y());
437  trackhit_.gamma = atan2(trackdirection.x(), trackdirection.y());
438  trackhit_.x = trackposition.x();
439  trackhit_.y = trackposition.y();
440 
441  // get qScale_ = templ.qscale() and templ.r_qMeas_qTrue();
442  float cotalpha = trackdirection.x() / trackdirection.z();
443  float cotbeta = trackdirection.y() / trackdirection.z();
444  float cotbeta_min = clustSizeYMin_[layer_ - 1] * ypitch_ / width_;
445  if (fabs(cotbeta) <= cotbeta_min)
446  continue;
447  double drdz = sqrt(1. + cotalpha * cotalpha + cotbeta * cotbeta);
448  double clusterCharge_cut = clustChargeMaxPerLength_ * drdz;
449 
450  auto detId = detIdObj.rawId();
451  int DetId_index = -1;
452 
453  const auto& newModIt = (std::find(iHists.BPixnewDetIds_.begin(), iHists.BPixnewDetIds_.end(), detId));
454  bool isNewMod = (newModIt != iHists.BPixnewDetIds_.end());
455  if (isNewMod) {
456  DetId_index = std::distance(iHists.BPixnewDetIds_.begin(), newModIt);
457  }
458 
459  if (notInPCL_) {
460  // fill the template from the store (from dqmBeginRun)
461  SiPixelTemplate theTemplate(thePixelTemp_);
462 
463  float locBx = (cotbeta < 0.) ? -1 : 1.;
464  float locBz = (cotalpha < 0.) ? -locBx : locBx;
465 
466  int TemplID = templateDBobject_->getTemplateID(detId);
467  theTemplate.interpolate(TemplID, cotalpha, cotbeta, locBz, locBx);
468  qScale_ = theTemplate.qscale();
469  rQmQt_ = theTemplate.r_qMeas_qTrue();
470  }
471 
472  // Surface deformation
473  const auto& lp_pair = surface_deformation(topol, tsos, recHitPix);
474 
475  LocalPoint lp_track = lp_pair.first;
476  LocalPoint lp_rechit = lp_pair.second;
477 
478  rechitCorr_.x = lp_rechit.x();
479  rechitCorr_.y = lp_rechit.y();
480  trackhitCorrX_ = lp_track.x();
481  trackhitCorrY_ = lp_track.y();
482 
483  if (notInPCL_) {
485  }
486 
487  // is one pixel in cluster a large pixel ? (hit will be excluded)
488  bool large_pix = false;
489  for (int j = 0; j < pixinfo_.npix; j++) {
490  int colpos = static_cast<int>(pixinfo_.col[j]);
491  if (pixinfo_.row[j] == 0 || pixinfo_.row[j] == 79 || pixinfo_.row[j] == 80 || pixinfo_.row[j] == 159 ||
492  colpos % 52 == 0 || colpos % 52 == 51) {
493  large_pix = true;
494  }
495  }
496 
497  double residualsq = (trackhitCorrX_ - rechitCorr_.x) * (trackhitCorrX_ - rechitCorr_.x) +
499 
500  double xlim1 = trackhitCorrX_ - width_ * cotalpha / 2.;
501  double hypitch_ = ypitch_ / 2.;
502  double ylim1 = trackhitCorrY_ - width_ * cotbeta / 2.;
503  double ylim2 = trackhitCorrY_ + width_ * cotbeta / 2.;
504 
505  int clustSizeY_cut = clustSizeYMin_[layer_ - 1];
506 
507  if (!large_pix && (chi2_ / ndof_) < normChi2Max_ && cluster->sizeY() >= clustSizeY_cut &&
508  residualsq < residualMax_ * residualMax_ && cluster->charge() < clusterCharge_cut &&
509  cluster->sizeX() < clustSizeXMax_) {
510  // iterate over pixels in hit
511  for (int j = 0; j < pixinfo_.npix; j++) {
512  // use trackhits and include bowing correction
513  float ypixlow = pixinfo_.y[j] - hypitch_;
514  float ypixhigh = pixinfo_.y[j] + hypitch_;
515  if (cotbeta > 0.) {
516  if (ylim1 > ypixlow)
517  ypixlow = ylim1;
518  if (ylim2 < ypixhigh)
519  ypixhigh = ylim2;
520  } else {
521  if (ylim2 > ypixlow)
522  ypixlow = ylim2;
523  if (ylim1 < ypixhigh)
524  ypixhigh = ylim1;
525  }
526  float ypixavg = 0.5 * (ypixlow + ypixhigh);
527 
528  float dx = (pixinfo_.x[j] - xlim1) * cmToum; // dx: in the unit of micrometer
529  float dy = (ypixavg - ylim1) * cmToum; // dy: in the unit of micrometer
530  float depth = dy * tan(trackhit_.beta);
531  float drift = dx - dy * tan(trackhit_.gamma);
532 
533  if (isNewMod == false) {
534  int i_index = module_ + (layer_ - 1) * iHists.nModules_[layer_ - 1];
535  iHists.h_drift_depth_adc_.at(i_index)->Fill(drift, depth, pixinfo_.adc[j]);
536  iHists.h_drift_depth_adc2_.at(i_index)->Fill(drift, depth, pixinfo_.adc[j] * pixinfo_.adc[j]);
537  iHists.h_drift_depth_noadc_.at(i_index)->Fill(drift, depth, 1.);
538  iHists.h_bySectOccupancy_->Fill(i_index - 1); // histogram starts at 0
539 
540  if (tracker->getDetectorType(subDetID) == TrackerGeometry::ModuleType::Ph1PXB) {
541  if ((module_ == 3 || module_ == 5) && (layer_ == 3 || layer_ == 4)) {
542  int i_index_merge = i_index + 1;
543  iHists.h_drift_depth_adc_.at(i_index_merge)->Fill(drift, depth, pixinfo_.adc[j]);
544  iHists.h_drift_depth_adc2_.at(i_index_merge)->Fill(drift, depth, pixinfo_.adc[j] * pixinfo_.adc[j]);
545  iHists.h_drift_depth_noadc_.at(i_index_merge)->Fill(drift, depth, 1.);
546  iHists.h_bySectOccupancy_->Fill(i_index_merge - 1);
547  }
548  if ((module_ == 4 || module_ == 6) && (layer_ == 3 || layer_ == 4)) {
549  int i_index_merge = i_index - 1;
550  iHists.h_drift_depth_adc_.at(i_index_merge)->Fill(drift, depth, pixinfo_.adc[j]);
551  iHists.h_drift_depth_adc2_.at(i_index_merge)->Fill(drift, depth, pixinfo_.adc[j] * pixinfo_.adc[j]);
552  iHists.h_drift_depth_noadc_.at(i_index_merge)->Fill(drift, depth, 1.);
553  iHists.h_bySectOccupancy_->Fill(i_index_merge - 1);
554  }
555  }
556 
557  } else {
558  int new_index = iHists.nModules_[iHists.nlay - 1] +
559  (iHists.nlay - 1) * iHists.nModules_[iHists.nlay - 1] + 1 + DetId_index;
560 
561  iHists.h_drift_depth_adc_.at(new_index)->Fill(drift, depth, pixinfo_.adc[j]);
562  iHists.h_drift_depth_adc2_.at(new_index)->Fill(drift, depth, pixinfo_.adc[j] * pixinfo_.adc[j]);
563  iHists.h_drift_depth_noadc_.at(new_index)->Fill(drift, depth, 1.);
564  iHists.h_bySectOccupancy_->Fill(new_index - 1); // histogram starts at 0
565  }
566  }
567  }
568  } else if (subDetID == PixelSubdetector::PixelEndcap) {
569  DetId detIdObj = recHit->geographicalId();
570  const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(tracker->idToDet(detIdObj));
571  if (!theGeomDet)
572  continue;
573 
574  const PixelTopology* topol = &(theGeomDet->specificTopology());
575 
576  if (!topol)
577  continue;
578 
579  sideF_ = tTopo->pxfSide(detIdObj);
580  diskF_ = tTopo->pxfDisk(detIdObj);
581  bladeF_ = tTopo->pxfBlade(detIdObj);
582  panelF_ = tTopo->pxfPanel(detIdObj);
583  moduleF_ = tTopo->pxfModule(detIdObj);
584 
585  const SiPixelRecHit* recHitPix = dynamic_cast<const SiPixelRecHit*>((*recHit).hit());
586  if (!recHitPix)
587  continue;
588  rechitF_.x = recHitPix->localPosition().x();
589  rechitF_.y = recHitPix->localPosition().y();
590  SiPixelRecHit::ClusterRef const& cluster = recHitPix->cluster();
591 
592  pixinfoF_ = fillPix(*cluster, topol);
593 
594  // fill entries in clust_
595 
596  clustF_.x = (cluster)->x();
597  clustF_.y = (cluster)->y();
598  clustF_.charge = (cluster->charge()) / 1000.; // clustF_.charge: in the unit of 1000e
599  clustF_.size_x = cluster->sizeX();
600  clustF_.size_y = cluster->sizeY();
601  clustF_.maxPixelCol = cluster->maxPixelCol();
602  clustF_.maxPixelRow = cluster->maxPixelRow();
603  clustF_.minPixelCol = cluster->minPixelCol();
604  clustF_.minPixelRow = cluster->minPixelRow();
605 
606  // fill the trackhit info
607  TrajectoryStateOnSurface tsos = itTraj.updatedState();
608  if (!tsos.isValid()) {
609  edm::LogWarning("SiPixelLorentzAnglePCLWorker") << "tsos not valid";
610  continue;
611  }
612  LocalVector trackdirection = tsos.localDirection();
613  LocalPoint trackposition = tsos.localPosition();
614 
615  if (trackdirection.z() == 0)
616  continue;
617  // the local position and direction
618  trackhitF_.alpha = atan2(trackdirection.z(), trackdirection.x());
619  trackhitF_.beta = atan2(trackdirection.z(), trackdirection.y());
620  trackhitF_.gamma = atan2(trackdirection.x(), trackdirection.y());
621  trackhitF_.x = trackposition.x();
622  trackhitF_.y = trackposition.y();
623 
624  float cotalpha = trackdirection.x() / trackdirection.z();
625  float cotbeta = trackdirection.y() / trackdirection.z();
626 
627  auto detId = detIdObj.rawId();
628 
629  if (notInPCL_) {
630  // fill the template from the store (from dqmBeginRun)
631  SiPixelTemplate theTemplate(thePixelTemp_);
632 
633  float locBx = (cotbeta < 0.) ? -1 : 1.;
634  float locBz = (cotalpha < 0.) ? -locBx : locBx;
635 
636  int TemplID = templateDBobject_->getTemplateID(detId);
637  theTemplate.interpolate(TemplID, cotalpha, cotbeta, locBz, locBx);
638  qScaleF_ = theTemplate.qscale();
639  rQmQtF_ = theTemplate.r_qMeas_qTrue();
640  }
641 
642  // Surface deformation
643  const auto& lp_pair = surface_deformation(topol, tsos, recHitPix);
644 
645  LocalPoint lp_track = lp_pair.first;
646  LocalPoint lp_rechit = lp_pair.second;
647 
648  rechitCorrF_.x = lp_rechit.x();
649  rechitCorrF_.y = lp_rechit.y();
650  trackhitCorrXF_ = lp_track.x();
651  trackhitCorrYF_ = lp_track.y();
652  if (notInPCL_) {
654  }
655  }
656  } //end iteration over trajectory measurements
657  } //end iteration over trajectories
658  }
659 }
660 
662  // geometry
663  const TrackerGeometry* geom = &iSetup.getData(geomEsToken_);
664  const TrackerTopology* tTopo = &iSetup.getData(topoEsToken_);
665 
666  if (notInPCL_) {
667  // Initialize 1D templates
668  if (watchSiPixelTemplateRcd_.check(iSetup)) {
671  edm::LogError("SiPixelLorentzAnglePCLWorker")
672  << "Templates not filled correctly. Check the sqlite file. Using SiPixelTemplateDBObject version "
673  << (*templateDBobject_).version();
674  }
675  }
676  }
677 
678  PixelTopologyMap map = PixelTopologyMap(geom, tTopo);
680  iHists.nModules_.resize(iHists.nlay);
681  for (int i = 0; i < iHists.nlay; i++) {
682  iHists.nModules_[i] = map.getPXBModules(i + 1);
683  }
684 
685  // list of modules already filled, then return (we already entered here)
686  if (!iHists.BPixnewDetIds_.empty() || !iHists.FPixnewDetIds_.empty())
687  return;
688 
689  if (!newmodulelist_.empty()) {
690  for (auto const& modulename : newmodulelist_) {
691  if (modulename.find("BPix_") != std::string::npos) {
692  PixelBarrelName bn(modulename, true);
693  const auto& detId = bn.getDetId(tTopo);
694  iHists.BPixnewmodulename_.push_back(modulename);
695  iHists.BPixnewDetIds_.push_back(detId.rawId());
696  iHists.BPixnewModule_.push_back(bn.moduleName());
697  iHists.BPixnewLayer_.push_back(bn.layerName());
698  } else if (modulename.find("FPix_") != std::string::npos) {
699  PixelEndcapName en(modulename, true);
700  const auto& detId = en.getDetId(tTopo);
701  iHists.FPixnewmodulename_.push_back(modulename);
702  iHists.FPixnewDetIds_.push_back(detId.rawId());
703  iHists.FPixnewDisk_.push_back(en.diskName());
704  iHists.FPixnewBlade_.push_back(en.bladeName());
705  }
706  }
707  }
708 }
709 
711  edm::Run const& run,
712  edm::EventSetup const& iSetup) {
713  // book the by partition monitoring
714  const auto maxSect = iHists.nlay * iHists.nModules_[iHists.nlay - 1] + (int)iHists.BPixnewDetIds_.size();
715 
716  iBooker.setCurrentFolder(fmt::sprintf("%s/SectorMonitoring", folder_.data()));
717  iHists.h_bySectOccupancy_ = iBooker.book1D(
718  "h_bySectorOccupancy", "hit occupancy by sector;pixel sector;hits on track", maxSect, -0.5, maxSect - 0.5);
719 
720  iBooker.setCurrentFolder(folder_);
721  static constexpr double min_depth_ = -100.;
722  static constexpr double max_depth_ = 400.;
723  static constexpr double min_drift_ = -500.;
724  static constexpr double max_drift_ = 500.;
725 
726  // book the mean values projections and set the bin names of the by sector monitoring
727  char name[128];
728  char title[256];
729  for (int i_layer = 1; i_layer <= iHists.nlay; i_layer++) {
730  for (int i_module = 1; i_module <= iHists.nModules_[i_layer - 1]; i_module++) {
731  unsigned int i_index = i_module + (i_layer - 1) * iHists.nModules_[i_layer - 1];
732  std::string binName = fmt::sprintf("BPix Layer%i Module %i", i_layer, i_module);
733  LogDebug("SiPixelLorentzAnglePCLWorker") << " i_index: " << i_index << " bin name: " << binName
734  << " (i_layer: " << i_layer << " i_module:" << i_module << ")";
735 
736  iHists.h_bySectOccupancy_->setBinLabel(i_index, binName);
737 
738  sprintf(name, "h_mean_layer%i_module%i", i_layer, i_module);
739  sprintf(title,
740  "average drift vs depth layer%i module%i; production depth [#mum]; #LTdrift#GT [#mum]",
741  i_layer,
742  i_module);
743  iHists.h_mean_[i_index] = iBooker.book1D(name, title, hist_depth_, min_depth_, max_depth_);
744  }
745  }
746  for (int i = 0; i < (int)iHists.BPixnewDetIds_.size(); i++) {
747  sprintf(name, "h_BPixnew_mean_%s", iHists.BPixnewmodulename_[i].c_str());
748  sprintf(title,
749  "average drift vs depth %s; production depth [#mum]; #LTdrift#GT [#mum]",
750  iHists.BPixnewmodulename_[i].c_str());
751  int new_index = iHists.nModules_[iHists.nlay - 1] + (iHists.nlay - 1) * iHists.nModules_[iHists.nlay - 1] + 1 + i;
752  iHists.h_mean_[new_index] = iBooker.book1D(name, title, hist_depth_, min_depth_, max_depth_);
753 
754  LogDebug("SiPixelLorentzAnglePCLWorker") << "i_index" << new_index << " bin name: " << iHists.BPixnewmodulename_[i];
755 
757  }
758 
759  //book the 2D histograms
760  for (int i_layer = 1; i_layer <= iHists.nlay; i_layer++) {
761  iBooker.setCurrentFolder(fmt::sprintf("%s/BPix/BPixLayer%i", folder_.data(), i_layer));
762  for (int i_module = 1; i_module <= iHists.nModules_[i_layer - 1]; i_module++) {
763  unsigned int i_index = i_module + (i_layer - 1) * iHists.nModules_[i_layer - 1];
764 
765  sprintf(name, "h_drift_depth_adc_layer%i_module%i", i_layer, i_module);
766  sprintf(title, "depth vs drift (ADC) layer%i module%i; drift [#mum]; production depth [#mum]", i_layer, i_module);
767  iHists.h_drift_depth_adc_[i_index] =
768  iBooker.book2D(name, title, hist_drift_, min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
769 
770  sprintf(name, "h_drift_depth_adc2_layer%i_module%i", i_layer, i_module);
771  sprintf(
772  title, "depth vs drift (ADC^{2}) layer%i module%i; drift [#mum]; production depth [#mum]", i_layer, i_module);
773  iHists.h_drift_depth_adc2_[i_index] =
774  iBooker.book2D(name, title, hist_drift_, min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
775 
776  sprintf(name, "h_drift_depth_noadc_layer%i_module%i", i_layer, i_module);
777  sprintf(
778  title, "depth vs drift (no ADC) layer%i module%i; drift [#mum]; production depth [#mum]", i_layer, i_module);
779  iHists.h_drift_depth_noadc_[i_index] =
780  iBooker.book2D(name, title, hist_drift_, min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
781 
782  sprintf(name, "h_drift_depth_layer%i_module%i", i_layer, i_module);
783  sprintf(title, "depth vs drift layer%i module%i; drift [#mum]; production depth [#mum]", i_layer, i_module);
784  iHists.h_drift_depth_[i_index] =
785  iBooker.book2D(name, title, hist_drift_, min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
786  }
787  }
788 
789  // book the "new" modules
790  iBooker.setCurrentFolder(fmt::sprintf("%s/BPix/NewModules", folder_.data()));
791  for (int i = 0; i < (int)iHists.BPixnewDetIds_.size(); i++) {
792  int new_index = iHists.nModules_[iHists.nlay - 1] + (iHists.nlay - 1) * iHists.nModules_[iHists.nlay - 1] + 1 + i;
793 
794  sprintf(name, "h_BPixnew_drift_depth_adc_%s", iHists.BPixnewmodulename_[i].c_str());
795  sprintf(
796  title, "depth vs drift (ADC) %s; drift [#mum]; production depth [#mum]", iHists.BPixnewmodulename_[i].c_str());
797  iHists.h_drift_depth_adc_[new_index] =
798  iBooker.book2D(name, title, hist_drift_, min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
799 
800  sprintf(name, "h_BPixnew_drift_depth_adc2_%s", iHists.BPixnewmodulename_[i].c_str());
801  sprintf(title,
802  "depth vs drift (ADC^{2}) %s; drift [#mum]; production depth [#mum]",
803  iHists.BPixnewmodulename_[i].c_str());
804  iHists.h_drift_depth_adc2_[new_index] =
805  iBooker.book2D(name, title, hist_drift_, min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
806 
807  sprintf(name, "h_BPixnew_drift_depth_noadc_%s", iHists.BPixnewmodulename_[i].c_str());
808  sprintf(title,
809  "depth vs drift (no ADC)%s; drift [#mum]; production depth [#mum]",
810  iHists.BPixnewmodulename_[i].c_str());
811  iHists.h_drift_depth_noadc_[new_index] =
812  iBooker.book2D(name, title, hist_drift_, min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
813 
814  sprintf(name, "h_BPixnew_drift_depth_%s", iHists.BPixnewmodulename_[i].c_str());
815  sprintf(title, "depth vs drift %s; drift [#mum]; production depth [#mum]", iHists.BPixnewmodulename_[i].c_str());
816  iHists.h_drift_depth_[new_index] =
817  iBooker.book2D(name, title, hist_drift_, min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
818  }
819 
820  // book the track monitoring plots
821  iBooker.setCurrentFolder(fmt::sprintf("%s/TrackMonitoring", folder_.data()));
822  iHists.h_tracks_ = iBooker.book1D("h_tracks", ";tracker volume;tracks", 2, -0.5, 1.5);
823  iHists.h_tracks_->setBinLabel(1, "all tracks", 1);
824  iHists.h_tracks_->setBinLabel(2, "has pixel hits", 1);
825  iHists.h_trackEta_ = iBooker.book1D("h_trackEta", ";track #eta; #tracks", 30, -3., 3.);
826  iHists.h_trackPhi_ = iBooker.book1D("h_trackPhi", ";track #phi; #tracks", 48, -M_PI, M_PI);
827  iHists.h_trackPt_ = iBooker.book1D("h_trackPt", ";track p_{T} [GeV]; #tracks", 100, 0., 100.);
828  iHists.h_trackChi2_ = iBooker.book1D("h_trackChi2ndof", ";track #chi^{2}/ndof; #tracks", 100, 0., 10.);
829 }
830 
832  if (notInPCL_) {
833  hFile_->cd();
834  hFile_->Write();
835  hFile_->Close();
836  }
837 }
838 
839 // method used to fill per pixel info
841  Pixinfo pixinfo;
842  const std::vector<SiPixelCluster::Pixel>& pixvector = LocPix.pixels();
843  pixinfo.npix = 0;
844  for (std::vector<SiPixelCluster::Pixel>::const_iterator itPix = pixvector.begin(); itPix != pixvector.end();
845  itPix++) {
846  pixinfo.row[pixinfo.npix] = itPix->x;
847  pixinfo.col[pixinfo.npix] = itPix->y;
848  pixinfo.adc[pixinfo.npix] = itPix->adc;
849  LocalPoint lp = topol->localPosition(MeasurementPoint(itPix->x + 0.5, itPix->y + 0.5));
850  pixinfo.x[pixinfo.npix] = lp.x();
851  pixinfo.y[pixinfo.npix] = lp.y();
852  pixinfo.npix++;
853  }
854  return pixinfo;
855 }
856 
857 // method used to correct for the surface deformation
858 const std::pair<LocalPoint, LocalPoint> SiPixelLorentzAnglePCLWorker::surface_deformation(
859  const PixelTopology* topol, TrajectoryStateOnSurface& tsos, const SiPixelRecHit* recHitPix) const {
860  LocalPoint trackposition = tsos.localPosition();
861  const LocalTrajectoryParameters& ltp = tsos.localParameters();
862  const Topology::LocalTrackAngles localTrackAngles(ltp.dxdz(), ltp.dydz());
863 
864  std::pair<float, float> pixels_track = topol->pixel(trackposition, localTrackAngles);
865  std::pair<float, float> pixels_rechit = topol->pixel(recHitPix->localPosition(), localTrackAngles);
866 
867  LocalPoint lp_track = topol->localPosition(MeasurementPoint(pixels_track.first, pixels_track.second));
868 
869  LocalPoint lp_rechit = topol->localPosition(MeasurementPoint(pixels_rechit.first, pixels_rechit.second));
870 
871  std::pair<LocalPoint, LocalPoint> lps = std::make_pair(lp_track, lp_rechit);
872  return lps;
873 }
874 
875 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
878  desc.setComment("Worker module of the SiPixel Lorentz Angle PCL monitoring workflow");
879  desc.add<std::string>("folder", "AlCaReco/SiPixelLorentzAngle")->setComment("directory of PCL Worker output");
880  desc.add<bool>("notInPCL", false)->setComment("create TTree (true) or not (false)");
881  desc.add<std::string>("fileName", "testrun.root")->setComment("name of the TTree file if notInPCL = true");
882  desc.add<std::vector<std::string>>("newmodulelist", {})->setComment("the list of DetIds for new sensors");
883  desc.add<edm::InputTag>("src", edm::InputTag("TrackRefitter"))->setComment("input track collections");
884  desc.add<double>("ptMin", 3.)->setComment("minimum pt on tracks");
885  desc.add<double>("normChi2Max", 2.)->setComment("maximum reduced chi squared");
886  desc.add<std::vector<int>>("clustSizeYMin", {4, 4, 3, 2})
887  ->setComment("minimum cluster size on Y axis for all Barrel Layers");
888  desc.add<int>("clustSizeXMax", 5)->setComment("maximum cluster size on X axis");
889  desc.add<double>("residualMax", 0.005)->setComment("maximum residual");
890  desc.add<double>("clustChargeMaxPerLength", 50000)
891  ->setComment("maximum cluster charge per unit length of pixel depth (z)");
892  desc.add<int>("binsDepth", 50)->setComment("# bins for electron production depth axis");
893  desc.add<int>("binsDrift", 100)->setComment("# bins for electron drift axis");
894  descriptions.addWithDefaultLabel(desc);
895 }
896 
897 // define this as a plug-in
RunNumber_t run() const
Definition: EventID.h:38
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
EventNumber_t event() const
Definition: EventID.h:40
void setComment(std::string const &value)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
~SiPixelLorentzAnglePCLWorker() override=default
T perp() const
Definition: PV3DBase.h:69
std::vector< SiPixelTemplateStore > thePixelTemp_
virtual std::pair< float, float > pixel(const LocalPoint &p) const =0
float x[maxpix]
std::string folder_
bool interpolate(int id, float cotalpha, float cotbeta, float locBz, float locBx)
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
const LocalTrajectoryParameters & localParameters() const
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
int moduleName() const
module id (index in z)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
short getTemplateID(const uint32_t &detid) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoPerEventEsToken_
unsigned int pxfDisk(const DetId &id) const
LocalVector localDirection() const
float y[maxpix]
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:36
unsigned int pxbLadder(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
T y() const
Definition: PV3DBase.h:60
int bunchCrossing() const
Definition: EventBase.h:64
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomPerEventEsToken_
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
const Bounds & bounds() const
Definition: Surface.h:87
unsigned int pxbModule(const DetId &id) const
const std::pair< LocalPoint, LocalPoint > surface_deformation(const PixelTopology *topol, TrajectoryStateOnSurface &tsos, const SiPixelRecHit *recHitPix) const
edm::ESWatcher< SiPixelTemplateDBObjectESProducerRcd > watchSiPixelTemplateRcd_
Log< level::Error, false > LogError
float r_qMeas_qTrue()
ratio of measured to true cluster charge
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
unsigned int numberOfLayers(int subdet) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void Fill(long long x)
virtual float thickness() const =0
bool getData(T &iHolder) const
Definition: EventSetup.h:128
double beta
int bladeName() const
blade id
DataContainer const & measurements() const
Definition: Trajectory.h:178
void setComment(std::string const &value)
float qscale()
charge scaling factor
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
int iEvent
Definition: GenABIO.cc:224
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
const SiPixelTemplateDBObject * templateDBobject_
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
const unsigned getPXBModules(unsigned int lay) const
T sqrt(T t)
Definition: SSEVec.h:19
double pt() const
track transverse momentum
Definition: TrackBase.h:637
T z() const
Definition: PV3DBase.h:61
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoEsToken_
std::unique_ptr< TTree > SiPixelLorentzAngleTreeBarrel_
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::vector< std::string > newmodulelist_
Transition
Definition: Transition.h:12
int orbitNumber() const
Definition: EventBase.h:65
ModuleType getDetectorType(DetId) const
SiPixelLorentzAnglePCLWorker(const edm::ParameterSet &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
const TrackerGeomDet * idToDet(DetId) const override
PXFDetId getDetId()
return DetId
unsigned int pxfModule(const DetId &id) const
#define M_PI
unsigned int pxbLayer(const DetId &id) const
float adc[maxpix]
Definition: DetId.h:17
int ndof(bool bon=true) const
Definition: Trajectory.cc:97
double alpha
ClusterRef cluster() const
Definition: SiPixelRecHit.h:47
SiPixelLorentzAngleCalibrationHistograms iHists
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomEsToken_
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
int layerName() const
layer id
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
static bool pushfile(int filenum, std::vector< SiPixelTemplateStore > &pixelTemp, std::string dir="CalibTracker/SiPixelESProducers/data/")
float chiSquared() const
Definition: Trajectory.h:241
float col[maxpix]
edm::ESGetToken< SiPixelTemplateDBObject, SiPixelTemplateDBObjectESProducerRcd > siPixelTemplateEsToken_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::EventID id() const
Definition: EventBase.h:59
Pixel cluster – collection of neighboring pixels above threshold.
LocalPoint localPosition() const override
static const int maxpix
edm::EDGetTokenT< TrajTrackAssociationCollection > t_trajTrack
unsigned int pxfSide(const DetId &id) const
int diskName() const
disk id
double gamma
virtual std::pair< float, float > pitch() const =0
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
static constexpr float cmToum
T x() const
Definition: PV3DBase.h:59
PXBDetId getDetId()
return the DetId
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
unsigned int pxfPanel(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
void dqmEndRun(edm::Run const &, edm::EventSetup const &)
const std::vector< Pixel > pixels() const
void analyze(edm::Event const &, edm::EventSetup const &) override
Definition: Run.h:45
float row[maxpix]
const Pixinfo fillPix(const SiPixelCluster &LocPix, const PixelTopology *topol) const
Our base class.
Definition: SiPixelRecHit.h:23
#define LogDebug(id)
std::unique_ptr< TTree > SiPixelLorentzAngleTreeForward_
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9