CMS 3D CMS Logo

OverlapValidation.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Alignment/OfflineValidation
4 // Class: OverlapValidation
5 //
11 //
12 // Original Authors: Wolfgang Adam, Keith Ulmer
13 // Created: Thu Oct 11 14:53:32 CEST 2007
14 // $Id: OverlapValidation.cc,v 1.16 2009/11/04 19:40:27 kaulmer Exp $
15 //
16 //
17 
18 // system include files
19 #include <memory>
20 
21 // user include files
24 
31 
39 
43 
49 
67 
77 #include "TFile.h"
78 #include "TTree.h"
79 
80 #include <vector>
81 #include <utility>
82 
83 using namespace std;
84 //
85 // class decleration
86 //
87 
89 public:
90  explicit OverlapValidation(const edm::ParameterSet&);
91  ~OverlapValidation() override;
92 
93 private:
94  typedef vector<Trajectory> TrajectoryCollection;
95 
98  void analyze(const edm::Event&, const edm::EventSetup&) override;
99  void endJob() override;
100 
101  virtual void analyze(const Trajectory&, const Propagator&, TrackerHitAssociator&, const TrackerTopology* const tTopo);
102  int layerFromId(const DetId&, const TrackerTopology* const tTopo) const;
103 
104  // ----------member data ---------------------------
105 
109 
113  bool doSimHit_;
116 
118  int overlapCounts_[3];
119 
120  TTree* rootTree_;
123  const bool addExtraBranches_;
124  const int minHitsCut_;
125  const float chi2ProbCut_;
126 
129  unsigned short hitCounts_[2];
130  float chi2_[2];
131  unsigned int overlapIds_[2];
132  float predictedPositions_[3][2];
133  float predictedLocalParameters_[5][2];
134  float predictedLocalErrors_[5][2];
139  float hitPositions_[2];
140  float hitErrors_[2];
141  float hitPositionsY_[2];
142  float hitErrorsY_[2];
143  float simHitPositions_[2];
144  float simHitPositionsY_[2];
145  float clusterWidthX_[2];
146  float clusterWidthY_[2];
147  float clusterSize_[2];
149  int edge_[2];
150 
151  vector<bool> acceptLayer;
152  float momentum_;
155 
156  //added by Heshy and Jared
157  float moduleX_[2];
158  float moduleY_[2];
159  float moduleZ_[2];
160  int subdetID;
164  //added by Jason
165  float localxdotglobalphi_[2];
166  float localxdotglobalr_[2];
167  float localxdotglobalz_[2];
168  float localxdotglobalx_[2];
169  float localxdotglobaly_[2];
170  float localydotglobalphi_[2];
171  float localydotglobalr_[2];
172  float localydotglobalz_[2];
173  float localydotglobalx_[2];
174  float localydotglobaly_[2];
175 };
176 
177 //
178 // constants, enums and typedefs
179 //
180 
181 //
182 // static data member definitions
183 //
184 
185 using std::vector;
186 //
187 // constructors and destructor
188 //
190  : geomToken_(esConsumes()),
191  magFieldToken_(esConsumes()),
192  topoToken_(esConsumes()),
193  config_(iConfig),
194  rootTree_(nullptr),
195  FileInPath_("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"),
196  compressionSettings_(iConfig.getUntrackedParameter<int>("compressionSettings", -1)),
197  addExtraBranches_(false),
198  minHitsCut_(6),
199  chi2ProbCut_(0.001) {
201  //now do what ever initialization is needed
202  trajectoryTag_ = iConfig.getParameter<edm::InputTag>("trajectories");
204  doSimHit_ = iConfig.getParameter<bool>("associateStrip");
206 
207  overlapCounts_[0] = 0; // #trajectories
208  overlapCounts_[1] = 0; // #hits
209  overlapCounts_[2] = 0; // #overlap hits
210  acceptLayer.resize(7, false);
211  acceptLayer[PixelSubdetector::PixelBarrel] = iConfig.getParameter<bool>("usePXB");
212  acceptLayer[PixelSubdetector::PixelEndcap] = iConfig.getParameter<bool>("usePXF");
213  acceptLayer[StripSubdetector::TIB] = iConfig.getParameter<bool>("useTIB");
214  acceptLayer[StripSubdetector::TOB] = iConfig.getParameter<bool>("useTOB");
215  acceptLayer[StripSubdetector::TID] = iConfig.getParameter<bool>("useTID");
216  acceptLayer[StripSubdetector::TEC] = iConfig.getParameter<bool>("useTEC");
217  barrelOnly_ = iConfig.getParameter<bool>("barrelOnly");
218 
220  //
221  // root output
222  //
223  if (compressionSettings_ > 0) {
224  fs->file().SetCompressionSettings(compressionSettings_);
225  }
226 
227  rootTree_ = fs->make<TTree>("Overlaps", "Overlaps");
228  if (addExtraBranches_) {
229  rootTree_->Branch("hitCounts", hitCounts_, "found/s:lost/s");
230  rootTree_->Branch("chi2", chi2_, "chi2/F:ndf/F");
231  rootTree_->Branch("path", &overlapPath_, "path/F");
232  }
233  rootTree_->Branch("layer", &layer_, "layer/i");
234  rootTree_->Branch("detids", overlapIds_, "id[2]/i");
235  rootTree_->Branch("predPos", predictedPositions_, "gX[2]/F:gY[2]/F:gZ[2]/F");
236  rootTree_->Branch("predPar", predictedLocalParameters_, "predQP[2]/F:predDX[2]/F:predDY[2]/F:predX[2]/F:predY[2]/F");
237  rootTree_->Branch("predErr", predictedLocalErrors_, "predEQP[2]/F:predEDX[2]/F:predEDY[2]/F:predEX[2]/F:predEY[2]/F");
238  rootTree_->Branch("predEDeltaX", &predictedDeltaXError_, "sigDeltaX/F");
239  rootTree_->Branch("predEDeltaY", &predictedDeltaYError_, "sigDeltaY/F");
240  rootTree_->Branch("relSignX", &relativeXSign_, "relSignX/B");
241  rootTree_->Branch("relSignY", &relativeYSign_, "relSignY/B");
242  rootTree_->Branch("hitX", hitPositions_, "hitX[2]/F");
243  rootTree_->Branch("hitEX", hitErrors_, "hitEX[2]/F");
244  rootTree_->Branch("hitY", hitPositionsY_, "hitY[2]/F");
245  rootTree_->Branch("hitEY", hitErrorsY_, "hitEY[2]/F");
246  if (addExtraBranches_) {
247  rootTree_->Branch("simX", simHitPositions_, "simX[2]/F");
248  rootTree_->Branch("simY", simHitPositionsY_, "simY[2]/F");
249  rootTree_->Branch("clusterSize", clusterSize_, "clusterSize[2]/F");
250  rootTree_->Branch("clusterWidthX", clusterWidthX_, "clusterWidthX[2]/F");
251  rootTree_->Branch("clusterWidthY", clusterWidthY_, "clusterWidthY[2]/F");
252  rootTree_->Branch("clusterCharge", clusterCharge_, "clusterCharge[2]/i");
253  rootTree_->Branch("edge", edge_, "edge[2]/I");
254  }
255  rootTree_->Branch("momentum", &momentum_, "momentum/F");
256  rootTree_->Branch("run", &run_, "run/i");
257  rootTree_->Branch("event", &event_, "event/i");
258  rootTree_->Branch("subdetID", &subdetID, "subdetID/I");
259  rootTree_->Branch("moduleX", moduleX_, "moduleX[2]/F");
260  rootTree_->Branch("moduleY", moduleY_, "moduleY[2]/F");
261  rootTree_->Branch("moduleZ", moduleZ_, "moduleZ[2]/F");
262  rootTree_->Branch("localxdotglobalphi", localxdotglobalphi_, "localxdotglobalphi[2]/F");
263  rootTree_->Branch("localxdotglobalr", localxdotglobalr_, "localxdotglobalr[2]/F");
264  rootTree_->Branch("localxdotglobalz", localxdotglobalz_, "localxdotglobalz[2]/F");
265  rootTree_->Branch("localxdotglobalx", localxdotglobalx_, "localxdotglobalx[2]/F");
266  rootTree_->Branch("localxdotglobaly", localxdotglobaly_, "localxdotglobaly[2]/F");
267  rootTree_->Branch("localydotglobalphi", localydotglobalphi_, "localydotglobalphi[2]/F");
268  rootTree_->Branch("localydotglobalr", localydotglobalr_, "localydotglobalr[2]/F");
269  rootTree_->Branch("localydotglobalz", localydotglobalz_, "localydotglobalz[2]/F");
270  rootTree_->Branch("localydotglobalx", localydotglobalx_, "localydotglobalx[2]/F");
271  rootTree_->Branch("localydotglobaly", localydotglobaly_, "localydotglobaly[2]/F");
272 }
273 
275  edm::LogWarning w("Overlaps");
276  // do anything here that needs to be done at desctruction time
277  // (e.g. close files, deallocate resources etc.)
278 
279  w << "Counters =";
280  w << " Number of tracks: " << overlapCounts_[0];
281  w << " Number of valid hits: " << overlapCounts_[1];
282  w << " Number of overlaps: " << overlapCounts_[2];
283 }
284 
285 //
286 // member functions
287 //
288 
289 // ------------ method called to for each event ------------
291  using namespace edm;
292  //
293  // mag field & search tracker
294  //
295  const MagneticField* magField_ = &iSetup.getData(magFieldToken_);
296  //
297  // propagator
298  //
300  //
301  // geometry
302  //
304  //
305  // make associator for SimHits
306  //
308  if (doSimHit_) {
310  associator = new TrackerHitAssociator(iEvent, hitassociatorconfig);
311  } else {
312  associator = nullptr;
313  }
314 
315  //if(doSimHit_) associator = new TrackerHitAssociator(iEvent, config_); else associator = 0;
316 
317  //
318  // trajectories (from refit)
319  //
320  //typedef vector<Trajectory> TrajectoryCollection;
321  edm::Handle<TrajectoryCollection> trajectoryCollectionHandle;
322  iEvent.getByToken(trajectoryToken_, trajectoryCollectionHandle);
323  const TrajectoryCollection* const trajectoryCollection = trajectoryCollectionHandle.product();
324 
325  //
326  // loop over trajectories from refit
327  const TrackerTopology* const tTopo = &iSetup.getData(topoToken_);
328  for (const auto& trajectory : *trajectoryCollection)
329  analyze(trajectory, propagator, *associator, tTopo);
330 
331  run_ = iEvent.id().run();
332  event_ = iEvent.id().event();
333 }
334 
335 void OverlapValidation::analyze(const Trajectory& trajectory,
336  const Propagator& propagator,
338  const TrackerTopology* const tTopo) {
339  typedef std::pair<const TrajectoryMeasurement*, const TrajectoryMeasurement*> Overlap;
340  typedef vector<Overlap> OverlapContainer;
341  ++overlapCounts_[0];
342 
343  OverlapContainer overlapHits;
344 
345  // quality cuts on trajectory
346  // min. # hits / matched hits
347 
348  if (trajectory.foundHits() < minHitsCut_)
349  return;
350  if (ChiSquaredProbability((double)(trajectory.chiSquared()), (double)(trajectory.ndof(false))) < chi2ProbCut_)
351  return;
352  //
353  // loop over measurements in the trajectory and calculate residuals
354  //
355 
356  vector<TrajectoryMeasurement> measurements(trajectory.measurements());
357  for (vector<TrajectoryMeasurement>::const_iterator itm = measurements.begin(); itm != measurements.end(); ++itm) {
358  //
359  // skip "invalid" (i.e. missing) hits
360  //
361  ConstRecHitPointer hit = itm->recHit();
362  DetId id = hit->geographicalId();
363  int layer(layerFromId(id, tTopo));
364  int subDet = id.subdetId();
365 
366  if (!hit->isValid()) {
367  edm::LogVerbatim("OverlapValidation") << "Invalid";
368  continue;
369  }
370  if (barrelOnly_ && (subDet == StripSubdetector::TID || subDet == StripSubdetector::TEC))
371  return;
372 
373  //edm::LogVerbatim("OverlapValidation") << "Check " <<subDet << ", layer = " << layer<<" stereo: "<< ((subDet > 2)?(SiStripDetId(id).stereo()):2);
374  //cout << "Check SubID " <<subDet << ", layer = " << layer<<" stereo: "<< ((subDet > 2)?(SiStripDetId(id).stereo()):2) << endl;
375 
376  //
377  // check for overlap: same subdet-id && layer number for
378  // two consecutive hits
379  //
380  ++overlapCounts_[1];
381  if ((layer != -1) && (acceptLayer[subDet])) {
382  for (vector<TrajectoryMeasurement>::const_iterator itmCompare = itm - 1;
383  itmCompare >= measurements.begin() && itmCompare > itm - 4;
384  --itmCompare) {
385  DetId compareId = itmCompare->recHit()->geographicalId();
386 
387  if (subDet != compareId.subdetId() || layer != layerFromId(compareId, tTopo))
388  break;
389  if (!itmCompare->recHit()->isValid())
390  continue;
391  if ((subDet == PixelSubdetector::PixelBarrel || subDet == PixelSubdetector::PixelEndcap) ||
392  (SiStripDetId(id).stereo() == SiStripDetId(compareId).stereo())) {
393  overlapHits.push_back(std::make_pair(&(*itmCompare), &(*itm)));
394  //edm::LogVerbatim("OverlapValidation") << "adding pair "<< ((subDet > 2)?(SiStripDetId(id).stereo()) : 2)
395  // << " from layer = " << layer;
396  //cout << "adding pair "<< ((subDet > 2)?(SiStripDetId(id).stereo()) : 2) << " from subDet = " << subDet << " and layer = " << layer;
397  //cout << " \t"<<run_<< "\t"<<event_<<"\t";
398  //cout << min(id.rawId(),compareId.rawId())<<"\t"<<max(id.rawId(),compareId.rawId())<<endl;
399  if (SiStripDetId(id).glued() == id.rawId())
400  edm::LogInfo("Overlaps") << "BAD GLUED: Have glued layer with id = " << id.rawId()
401  << " and glued id = " << SiStripDetId(id).glued()
402  << " and stereo = " << SiStripDetId(id).stereo() << endl;
403  if (SiStripDetId(compareId).glued() == compareId.rawId())
404  edm::LogInfo("Overlaps") << "BAD GLUED: Have glued layer with id = " << compareId.rawId()
405  << " and glued id = " << SiStripDetId(compareId).glued()
406  << " and stereo = " << SiStripDetId(compareId).stereo() << endl;
407  break;
408  }
409  }
410  }
411  }
412 
413  //
414  // Loop over all overlap pairs.
415  //
416  hitCounts_[0] = trajectory.foundHits();
417  hitCounts_[1] = trajectory.lostHits();
418  chi2_[0] = trajectory.chiSquared();
419  chi2_[1] = trajectory.ndof(false);
420 
421  for (const auto& overlapHit : overlapHits) {
422  //
423  // create reference state @ module 1 (no info from overlap hits)
424  //
425  ++overlapCounts_[2];
426  // backward predicted state at module 1
427  TrajectoryStateOnSurface bwdPred1 = overlapHit.first->backwardPredictedState();
428  if (!bwdPred1.isValid())
429  continue;
430  //cout << "momentum from backward predicted state = " << bwdPred1.globalMomentum().mag() << endl;
431  // forward predicted state at module 2
432  TrajectoryStateOnSurface fwdPred2 = overlapHit.second->forwardPredictedState();
433  //cout << "momentum from forward predicted state = " << fwdPred2.globalMomentum().mag() << endl;
434  if (!fwdPred2.isValid())
435  continue;
436  // extrapolate fwdPred2 to module 1
437  TrajectoryStateOnSurface fwdPred2At1 = propagator.propagate(fwdPred2, bwdPred1.surface());
438  if (!fwdPred2At1.isValid())
439  continue;
440  // combine fwdPred2At1 with bwdPred1 (ref. state, best estimate without hits 1 and 2)
441  TrajectoryStateOnSurface comb1 = combiner_.combine(bwdPred1, fwdPred2At1);
442  if (!comb1.isValid())
443  continue;
444  //
445  // propagation of reference parameters to module 2
446  //
447  std::pair<TrajectoryStateOnSurface, double> tsosWithS = propagator.propagateWithPath(comb1, fwdPred2.surface());
448  TrajectoryStateOnSurface comb1At2 = tsosWithS.first;
449  if (!comb1At2.isValid())
450  continue;
451  //distance of propagation from one surface to the next==could cut here
452  overlapPath_ = tsosWithS.second;
453  if (abs(overlapPath_) > 15)
454  continue; //cut to remove hit pairs > 15 cm apart
455  // global position on module 1
457  predictedPositions_[0][0] = position.x();
458  predictedPositions_[1][0] = position.y();
459  predictedPositions_[2][0] = position.z();
460  momentum_ = comb1.globalMomentum().mag();
461  //cout << "momentum from combination = " << momentum_ << endl;
462  //cout << "magnetic field from TSOS = " << comb1.magneticField()->inTesla(position).mag() << endl;
463  // local parameters and errors on module 1
464  AlgebraicVector5 pars = comb1.localParameters().vector();
465  AlgebraicSymMatrix55 errs = comb1.localError().matrix();
466  for (int i = 0; i < 5; ++i) {
467  predictedLocalParameters_[i][0] = pars[i];
468  predictedLocalErrors_[i][0] = sqrt(errs(i, i));
469  }
470  // global position on module 2
471  position = comb1At2.globalPosition();
472  predictedPositions_[0][1] = position.x();
473  predictedPositions_[1][1] = position.y();
474  predictedPositions_[2][1] = position.z();
475  // local parameters and errors on module 2
476  pars = comb1At2.localParameters().vector();
477  errs = comb1At2.localError().matrix();
478  for (int i = 0; i < 5; ++i) {
479  predictedLocalParameters_[i][1] = pars[i];
480  predictedLocalErrors_[i][1] = sqrt(errs(i, i));
481  }
482 
483  //print out local errors in X to check
484  //cout << "Predicted local error in X at 1 = " << predictedLocalErrors_[3][0] << " and predicted local error in X at 2 is = " << predictedLocalErrors_[3][1] << endl;
485  //cout << "Predicted local error in Y at 1 = " << predictedLocalErrors_[4][0] << " and predicted local error in Y at 2 is = " << predictedLocalErrors_[4][1] << endl;
486 
487  //
488  // jacobians (local-to-global@1,global 1-2,global-to-local@2)
489  //
490  JacobianLocalToCurvilinear jacLocToCurv(comb1.surface(), comb1.localParameters(), *magField_);
491  AnalyticalCurvilinearJacobian jacCurvToCurv(
492  comb1.globalParameters(), comb1At2.globalPosition(), comb1At2.globalMomentum(), tsosWithS.second);
493  JacobianCurvilinearToLocal jacCurvToLoc(comb1At2.surface(), comb1At2.localParameters(), *magField_);
494  // combined jacobian local-1-to-local-2
495  AlgebraicMatrix55 jacobian = jacLocToCurv.jacobian() * jacCurvToCurv.jacobian() * jacCurvToLoc.jacobian();
496  // covariance on module 1
497  AlgebraicSymMatrix55 covComb1 = comb1.localError().matrix();
498  // variance and correlations for predicted local_x on modules 1 and 2
499  double c00 = covComb1(3, 3);
500  double c10(0.);
501  double c11(0.);
502  for (int i = 1; i < 5; ++i) {
503  c10 += jacobian(3, i) * covComb1(i, 3);
504  for (int j = 1; j < 5; ++j)
505  c11 += jacobian(3, i) * covComb1(i, j) * jacobian(3, j);
506  }
507  // choose relative sign in order to minimize error on difference
508  double diff = c00 - 2 * fabs(c10) + c11;
509  diff = diff > 0 ? sqrt(diff) : -sqrt(-diff);
511  relativeXSign_ = c10 > 0 ? -1 : 1;
512  //
513  // now find variance and correlations for predicted local_y
514  double c00Y = covComb1(4, 4);
515  double c10Y(0.);
516  double c11Y(0.);
517  for (int i = 1; i < 5; ++i) {
518  c10Y += jacobian(4, i) * covComb1(i, 4);
519  for (int j = 1; j < 5; ++j)
520  c11Y += jacobian(4, i) * covComb1(i, j) * jacobian(4, j);
521  }
522  double diffY = c00Y - 2 * fabs(c10Y) + c11Y;
523  diffY = diffY > 0 ? sqrt(diffY) : -sqrt(-diffY);
524  predictedDeltaYError_ = diffY;
525  relativeYSign_ = c10Y > 0 ? -1 : 1;
526 
527  // information on modules and hits
528  overlapIds_[0] = overlapHit.first->recHit()->geographicalId().rawId();
529  overlapIds_[1] = overlapHit.second->recHit()->geographicalId().rawId();
530 
531  //added by Heshy and Jared
532  moduleX_[0] = overlapHit.first->recHit()->det()->surface().position().x();
533  moduleX_[1] = overlapHit.second->recHit()->det()->surface().position().x();
534  moduleY_[0] = overlapHit.first->recHit()->det()->surface().position().y();
535  moduleY_[1] = overlapHit.second->recHit()->det()->surface().position().y();
536  moduleZ_[0] = overlapHit.first->recHit()->det()->surface().position().z();
537  moduleZ_[1] = overlapHit.second->recHit()->det()->surface().position().z();
538  subdetID = overlapHit.first->recHit()->geographicalId().subdetId();
539  localxdotglobalphi_[0] = overlapHit.first->recHit()->det()->surface().toGlobal(onezero).phi() -
540  overlapHit.first->recHit()->det()->surface().toGlobal(zerozero).phi();
541  localxdotglobalphi_[1] = overlapHit.second->recHit()->det()->surface().toGlobal(onezero).phi() -
542  overlapHit.second->recHit()->det()->surface().toGlobal(zerozero).phi();
543  //added by Jason
544  localxdotglobalr_[0] = overlapHit.first->recHit()->det()->surface().toGlobal(onezero).perp() -
545  overlapHit.first->recHit()->det()->surface().toGlobal(zerozero).perp();
546  localxdotglobalr_[1] = overlapHit.second->recHit()->det()->surface().toGlobal(onezero).perp() -
547  overlapHit.second->recHit()->det()->surface().toGlobal(zerozero).perp();
548  localxdotglobalz_[0] = overlapHit.first->recHit()->det()->surface().toGlobal(onezero).z() -
549  overlapHit.first->recHit()->det()->surface().toGlobal(zerozero).z();
550  localxdotglobalz_[1] = overlapHit.second->recHit()->det()->surface().toGlobal(onezero).z() -
551  overlapHit.second->recHit()->det()->surface().toGlobal(zerozero).z();
552  localxdotglobalx_[0] = overlapHit.first->recHit()->det()->surface().toGlobal(onezero).x() -
553  overlapHit.first->recHit()->det()->surface().toGlobal(zerozero).x();
554  localxdotglobalx_[1] = overlapHit.second->recHit()->det()->surface().toGlobal(onezero).x() -
555  overlapHit.second->recHit()->det()->surface().toGlobal(zerozero).x();
556  localxdotglobaly_[0] = overlapHit.first->recHit()->det()->surface().toGlobal(onezero).y() -
557  overlapHit.first->recHit()->det()->surface().toGlobal(zerozero).y();
558  localxdotglobaly_[1] = overlapHit.second->recHit()->det()->surface().toGlobal(onezero).y() -
559  overlapHit.second->recHit()->det()->surface().toGlobal(zerozero).y();
560  localydotglobalr_[0] = overlapHit.first->recHit()->det()->surface().toGlobal(zeroone).perp() -
561  overlapHit.first->recHit()->det()->surface().toGlobal(zerozero).perp();
562  localydotglobalr_[1] = overlapHit.second->recHit()->det()->surface().toGlobal(zeroone).perp() -
563  overlapHit.second->recHit()->det()->surface().toGlobal(zerozero).perp();
564  localydotglobalz_[0] = overlapHit.first->recHit()->det()->surface().toGlobal(zeroone).z() -
565  overlapHit.first->recHit()->det()->surface().toGlobal(zerozero).z();
566  localydotglobalz_[1] = overlapHit.second->recHit()->det()->surface().toGlobal(zeroone).z() -
567  overlapHit.second->recHit()->det()->surface().toGlobal(zerozero).z();
568  localydotglobalx_[0] = overlapHit.first->recHit()->det()->surface().toGlobal(zeroone).x() -
569  overlapHit.first->recHit()->det()->surface().toGlobal(zerozero).x();
570  localydotglobalx_[1] = overlapHit.second->recHit()->det()->surface().toGlobal(zeroone).x() -
571  overlapHit.second->recHit()->det()->surface().toGlobal(zerozero).x();
572  localydotglobaly_[0] = overlapHit.first->recHit()->det()->surface().toGlobal(zeroone).y() -
573  overlapHit.first->recHit()->det()->surface().toGlobal(zerozero).y();
574  localydotglobaly_[1] = overlapHit.second->recHit()->det()->surface().toGlobal(zeroone).y() -
575  overlapHit.second->recHit()->det()->surface().toGlobal(zerozero).y();
576  localydotglobalphi_[0] = overlapHit.first->recHit()->det()->surface().toGlobal(zeroone).phi() -
577  overlapHit.first->recHit()->det()->surface().toGlobal(zerozero).phi();
578  localydotglobalphi_[1] = overlapHit.second->recHit()->det()->surface().toGlobal(zeroone).phi() -
579  overlapHit.second->recHit()->det()->surface().toGlobal(zerozero).phi();
580 
581  if (overlapHit.first->recHit()->geographicalId().subdetId() == StripSubdetector::TIB)
582  layer_ = layerFromId(overlapHit.first->recHit()->geographicalId().rawId(), tTopo);
583  else if (overlapHit.first->recHit()->geographicalId().subdetId() == StripSubdetector::TOB)
584  layer_ = layerFromId(overlapHit.first->recHit()->geographicalId().rawId(), tTopo) + 4;
585  else if (overlapHit.first->recHit()->geographicalId().subdetId() == StripSubdetector::TID)
586  layer_ = layerFromId(overlapHit.first->recHit()->geographicalId().rawId(), tTopo) + 10;
587  else if (overlapHit.first->recHit()->geographicalId().subdetId() == StripSubdetector::TEC)
588  layer_ = layerFromId(overlapHit.first->recHit()->geographicalId().rawId(), tTopo) + 13;
589  else if (overlapHit.first->recHit()->geographicalId().subdetId() == PixelSubdetector::PixelBarrel)
590  layer_ = layerFromId(overlapHit.first->recHit()->geographicalId().rawId(), tTopo) + 20;
591  else if (overlapHit.first->recHit()->geographicalId().subdetId() == PixelSubdetector::PixelEndcap)
592  layer_ = layerFromId(overlapHit.first->recHit()->geographicalId().rawId(), tTopo) + 30;
593  else
594  layer_ = 99;
595 
596  if (overlapIds_[0] == SiStripDetId(overlapHit.first->recHit()->geographicalId()).glued())
597  edm::LogWarning("Overlaps") << "BAD GLUED: First Id = " << overlapIds_[0] << " has glued = "
598  << SiStripDetId(overlapHit.first->recHit()->geographicalId()).glued()
599  << " and stereo = "
600  << SiStripDetId(overlapHit.first->recHit()->geographicalId()).stereo() << endl;
601  if (overlapIds_[1] == SiStripDetId(overlapHit.second->recHit()->geographicalId()).glued())
602  edm::LogWarning("Overlaps") << "BAD GLUED: Second Id = " << overlapIds_[1] << " has glued = "
603  << SiStripDetId(overlapHit.second->recHit()->geographicalId()).glued()
604  << " and stereo = "
605  << SiStripDetId(overlapHit.second->recHit()->geographicalId()).stereo() << endl;
606 
607  const TransientTrackingRecHit::ConstRecHitPointer firstRecHit = overlapHit.first->recHit();
608  const TransientTrackingRecHit::ConstRecHitPointer secondRecHit = overlapHit.second->recHit();
609  hitPositions_[0] = firstRecHit->localPosition().x();
610  hitErrors_[0] = sqrt(firstRecHit->localPositionError().xx());
611  hitPositions_[1] = secondRecHit->localPosition().x();
612  hitErrors_[1] = sqrt(secondRecHit->localPositionError().xx());
613 
614  hitPositionsY_[0] = firstRecHit->localPosition().y();
615  hitErrorsY_[0] = sqrt(firstRecHit->localPositionError().yy());
616  hitPositionsY_[1] = secondRecHit->localPosition().y();
617  hitErrorsY_[1] = sqrt(secondRecHit->localPositionError().yy());
618 
619  //cout << "printing local X hit position and error for the overlap hits. Hit 1 = " << hitPositions_[0] << "+-" << hitErrors_[0] << " and hit 2 is " << hitPositions_[1] << "+-" << hitErrors_[1] << endl;
620 
621  DetId id1 = overlapHit.first->recHit()->geographicalId();
622  DetId id2 = overlapHit.second->recHit()->geographicalId();
623  int layer1 = layerFromId(id1, tTopo);
624  int subDet1 = id1.subdetId();
625  int layer2 = layerFromId(id2, tTopo);
626  int subDet2 = id2.subdetId();
627  if (abs(hitPositions_[0]) > 5)
628  edm::LogInfo("Overlaps") << "BAD: Bad hit position: Id = " << id1.rawId()
629  << " stereo = " << SiStripDetId(id1).stereo()
630  << " glued = " << SiStripDetId(id1).glued() << " from subdet = " << subDet1
631  << " and layer = " << layer1 << endl;
632  if (abs(hitPositions_[1]) > 5)
633  edm::LogInfo("Overlaps") << "BAD: Bad hit position: Id = " << id2.rawId()
634  << " stereo = " << SiStripDetId(id2).stereo()
635  << " glued = " << SiStripDetId(id2).glued() << " from subdet = " << subDet2
636  << " and layer = " << layer2 << endl;
637 
638  // get track momentum
639  momentum_ = comb1.globalMomentum().mag();
640 
641  // get cluster size
642  if (!(subDet1 == PixelSubdetector::PixelBarrel || subDet1 == PixelSubdetector::PixelEndcap)) { //strip
643  const TransientTrackingRecHit::ConstRecHitPointer thit1 = overlapHit.first->recHit();
644  const SiStripRecHit1D* hit1 = dynamic_cast<const SiStripRecHit1D*>((*thit1).hit());
645  if (hit1) {
646  //check cluster width
647  const SiStripRecHit1D::ClusterRef& cluster1 = hit1->cluster();
648  clusterSize_[0] = (cluster1->amplitudes()).size();
649  clusterWidthX_[0] = (cluster1->amplitudes()).size();
650  clusterWidthY_[0] = -1;
651 
652  //check if cluster at edge of sensor
653  uint16_t firstStrip = cluster1->firstStrip();
654  uint16_t lastStrip = firstStrip + (cluster1->amplitudes()).size() - 1;
655  unsigned short Nstrips;
656  Nstrips = reader->getNumberOfApvsAndStripLength(id1).first * 128;
657  bool atEdge = false;
658  if (firstStrip == 0 || lastStrip == (Nstrips - 1))
659  atEdge = true;
660  if (atEdge)
661  edge_[0] = 1;
662  else
663  edge_[0] = -1;
664 
665  // get cluster total charge
666  const auto& stripCharges = cluster1->amplitudes();
667  uint16_t charge = 0;
668  for (uint i = 0; i < stripCharges.size(); i++) {
669  charge += stripCharges[i];
670  }
671  clusterCharge_[0] = charge;
672  }
673 
674  const TransientTrackingRecHit::ConstRecHitPointer thit2 = overlapHit.second->recHit();
675  const SiStripRecHit1D* hit2 = dynamic_cast<const SiStripRecHit1D*>((*thit2).hit());
676  if (hit2) {
677  const SiStripRecHit1D::ClusterRef& cluster2 = hit2->cluster();
678  clusterSize_[1] = (cluster2->amplitudes()).size();
679  clusterWidthX_[1] = (cluster2->amplitudes()).size();
680  clusterWidthY_[1] = -1;
681 
682  uint16_t firstStrip = cluster2->firstStrip();
683  uint16_t lastStrip = firstStrip + (cluster2->amplitudes()).size() - 1;
684  unsigned short Nstrips;
685  Nstrips = reader->getNumberOfApvsAndStripLength(id2).first * 128;
686  bool atEdge = false;
687  if (firstStrip == 0 || lastStrip == (Nstrips - 1))
688  atEdge = true;
689  if (atEdge)
690  edge_[1] = 1;
691  else
692  edge_[1] = -1;
693 
694  // get cluster total charge
695  const auto& stripCharges = cluster2->amplitudes();
696  uint16_t charge = 0;
697  for (uint i = 0; i < stripCharges.size(); i++) {
698  charge += stripCharges[i];
699  }
700  clusterCharge_[1] = charge;
701  }
702  //cout << "strip cluster size2 = " << clusterWidthX_[0] << " and size 2 = " << clusterWidthX_[1] << endl;
703  }
704 
705  if (subDet2 == PixelSubdetector::PixelBarrel || subDet2 == PixelSubdetector::PixelEndcap) { //pixel
706 
707  const TransientTrackingRecHit::ConstRecHitPointer thit1 = overlapHit.first->recHit();
708  const SiPixelRecHit* recHitPix1 = dynamic_cast<const SiPixelRecHit*>((*thit1).hit());
709  if (recHitPix1) {
710  // check for cluster size and width
711  SiPixelRecHit::ClusterRef const& cluster1 = recHitPix1->cluster();
712 
713  clusterSize_[0] = cluster1->size();
714  clusterWidthX_[0] = cluster1->sizeX();
715  clusterWidthY_[0] = cluster1->sizeY();
716 
717  // check for cluster at edge
718  const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>((*trackerGeometry_).idToDet(id1));
719  const PixelTopology* topol = (&(theGeomDet->specificTopology()));
720 
721  int minPixelRow = cluster1->minPixelRow(); //x
722  int maxPixelRow = cluster1->maxPixelRow();
723  int minPixelCol = cluster1->minPixelCol(); //y
724  int maxPixelCol = cluster1->maxPixelCol();
725 
726  bool edgeHitX = (topol->isItEdgePixelInX(minPixelRow)) || (topol->isItEdgePixelInX(maxPixelRow));
727  bool edgeHitY = (topol->isItEdgePixelInY(minPixelCol)) || (topol->isItEdgePixelInY(maxPixelCol));
728  if (edgeHitX || edgeHitY)
729  edge_[0] = 1;
730  else
731  edge_[0] = -1;
732 
733  clusterCharge_[0] = (uint)cluster1->charge();
734 
735  } else {
736  edm::LogWarning("Overlaps") << "didn't find pixel cluster" << endl;
737  continue;
738  }
739 
740  const TransientTrackingRecHit::ConstRecHitPointer thit2 = overlapHit.second->recHit();
741  const SiPixelRecHit* recHitPix2 = dynamic_cast<const SiPixelRecHit*>((*thit2).hit());
742  if (recHitPix2) {
743  SiPixelRecHit::ClusterRef const& cluster2 = recHitPix2->cluster();
744 
745  clusterSize_[1] = cluster2->size();
746  clusterWidthX_[1] = cluster2->sizeX();
747  clusterWidthY_[1] = cluster2->sizeY();
748  //cout << "second pixel cluster is " << clusterSize_[1] << " pixels with x width = " << clusterWidthX_[1] << " and y width = " << clusterWidthY_[1] << endl;
749 
750  const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>((*trackerGeometry_).idToDet(id2));
751  const PixelTopology* topol = (&(theGeomDet->specificTopology()));
752 
753  int minPixelRow = cluster2->minPixelRow(); //x
754  int maxPixelRow = cluster2->maxPixelRow();
755  int minPixelCol = cluster2->minPixelCol(); //y
756  int maxPixelCol = cluster2->maxPixelCol();
757 
758  bool edgeHitX = (topol->isItEdgePixelInX(minPixelRow)) || (topol->isItEdgePixelInX(maxPixelRow));
759  bool edgeHitY = (topol->isItEdgePixelInY(minPixelCol)) || (topol->isItEdgePixelInY(maxPixelCol));
760  if (edgeHitX || edgeHitY)
761  edge_[1] = 1;
762  else
763  edge_[1] = -1;
764 
765  clusterCharge_[1] = (uint)cluster2->charge();
766 
767  } else {
768  edm::LogWarning("Overlaps") << "didn't find pixel cluster" << endl;
769  continue;
770  }
771  }
772 
773  //also check for edge pixels
774 
775  //try writing out the SimHit info (for MC only)
776  if (doSimHit_) {
777  std::vector<PSimHit> psimHits1;
778  std::vector<PSimHit> psimHits2;
779  //calculate layer
780  DetId id = overlapHit.first->recHit()->geographicalId();
781  int layer(-1);
782  layer = layerFromId(id, tTopo);
783  int subDet = id.subdetId();
784  edm::LogVerbatim("OverlapValidation") << "Subdet = " << subDet << " ; layer = " << layer;
785 
786  psimHits1 = associator.associateHit(*(firstRecHit->hit()));
787  edm::LogVerbatim("OverlapValidation") << "single hit ";
788  edm::LogVerbatim("OverlapValidation") << "length of psimHits1: " << psimHits1.size();
789  if (!psimHits1.empty()) {
790  float closest_dist = 99999.9;
791  std::vector<PSimHit>::const_iterator closest_simhit = psimHits1.begin();
792  for (std::vector<PSimHit>::const_iterator m = psimHits1.begin(); m < psimHits1.end(); m++) {
793  //find closest simHit to the recHit
794  float simX = (*m).localPosition().x();
795  float dist = fabs(simX - (overlapHit.first->recHit()->localPosition().x()));
796  edm::LogVerbatim("OverlapValidation")
797  << "simHit1 simX = " << simX << " hitX = " << overlapHit.first->recHit()->localPosition().x()
798  << " distX = " << dist << " layer = " << layer;
799  if (dist < closest_dist) {
800  //cout << "found newest closest dist for simhit1" << endl;
801  closest_dist = dist;
802  closest_simhit = m;
803  }
804  }
805  //if glued layer, convert sim hit position to matchedhit surface
806  //layer index from 1-4 for TIB, 1-6 for TOB
807  // Are the sim hits on the glued layers or are they split???
808  if (subDet > 2 && !SiStripDetId(id).glued()) {
809  const GluedGeomDet* gluedDet =
810  (const GluedGeomDet*)(*trackerGeometry_).idToDet((*firstRecHit).hit()->geographicalId());
811  const StripGeomDetUnit* stripDet = (StripGeomDetUnit*)gluedDet->monoDet();
812  GlobalPoint gp = stripDet->surface().toGlobal((*closest_simhit).localPosition());
813  LocalPoint lp = gluedDet->surface().toLocal(gp);
814  LocalVector localdirection = (*closest_simhit).localDirection();
815  GlobalVector globaldirection = stripDet->surface().toGlobal(localdirection);
816  LocalVector direction = gluedDet->surface().toLocal(globaldirection);
817  float scale = -lp.z() / direction.z();
818  LocalPoint projectedPos = lp + scale * direction;
819  simHitPositions_[0] = projectedPos.x();
820  edm::LogVerbatim("OverlapValidation") << "simhit position from matched layer = " << simHitPositions_[0];
821  simHitPositionsY_[0] = projectedPos.y();
822  } else {
823  simHitPositions_[0] = (*closest_simhit).localPosition().x();
824  simHitPositionsY_[0] = (*closest_simhit).localPosition().y();
825  edm::LogVerbatim("OverlapValidation") << "simhit position from non-matched layer = " << simHitPositions_[0];
826  }
827  edm::LogVerbatim("OverlapValidation") << "hit position = " << hitPositions_[0];
828  } else {
829  simHitPositions_[0] = -99.;
830  simHitPositionsY_[0] = -99.;
831  //cout << " filling simHitX: " << -99 << endl;
832  }
833 
834  psimHits2 = associator.associateHit(*(secondRecHit->hit()));
835  if (!psimHits2.empty()) {
836  float closest_dist = 99999.9;
837  std::vector<PSimHit>::const_iterator closest_simhit = psimHits2.begin();
838  for (std::vector<PSimHit>::const_iterator m = psimHits2.begin(); m < psimHits2.end(); m++) {
839  float simX = (*m).localPosition().x();
840  float dist = fabs(simX - (overlapHit.second->recHit()->localPosition().x()));
841  if (dist < closest_dist) {
842  closest_dist = dist;
843  closest_simhit = m;
844  }
845  }
846  //if glued layer, convert sim hit position to matchedhit surface
847  // if no sim hits on matched layers then this section can be removed
848  if (subDet > 2 && !SiStripDetId(id).glued()) {
849  const GluedGeomDet* gluedDet =
850  (const GluedGeomDet*)(*trackerGeometry_).idToDet((*secondRecHit).hit()->geographicalId());
851  const StripGeomDetUnit* stripDet = (StripGeomDetUnit*)gluedDet->monoDet();
852  GlobalPoint gp = stripDet->surface().toGlobal((*closest_simhit).localPosition());
853  LocalPoint lp = gluedDet->surface().toLocal(gp);
854  LocalVector localdirection = (*closest_simhit).localDirection();
855  GlobalVector globaldirection = stripDet->surface().toGlobal(localdirection);
856  LocalVector direction = gluedDet->surface().toLocal(globaldirection);
857  float scale = -lp.z() / direction.z();
858  LocalPoint projectedPos = lp + scale * direction;
859  simHitPositions_[1] = projectedPos.x();
860  simHitPositionsY_[1] = projectedPos.y();
861  } else {
862  simHitPositions_[1] = (*closest_simhit).localPosition().x();
863  simHitPositionsY_[1] = (*closest_simhit).localPosition().y();
864  }
865  } else {
866  simHitPositions_[1] = -99.;
867  simHitPositionsY_[1] = -99.;
868  }
869  }
870  rootTree_->Fill();
871  }
872 }
873 
874 int OverlapValidation::layerFromId(const DetId& id, const TrackerTopology* const tTopo) const {
875  TrackerAlignableId aliid;
876  std::pair<int, int> subdetandlayer = aliid.typeAndLayerFromDetId(id, tTopo);
877  int layer = subdetandlayer.second;
878 
879  return layer;
880 }
881 
883  if (rootTree_) {
884  rootTree_->GetDirectory()->cd();
885  rootTree_->Write();
886  delete rootTree_;
887  }
888 }
889 
890 //define this as a plug-in
Vector3DBase< float, LocalTag >
TrajectoryStateCombiner.h
OverlapValidation::reader
SiStripDetInfoFileReader * reader
Definition: OverlapValidation.cc:112
change_name.diff
diff
Definition: change_name.py:13
OverlapValidation::relativeYSign_
char relativeYSign_
Definition: OverlapValidation.cc:138
Point2DBase< float, LocalTag >
TrackExtra.h
OverlapValidation::onezero
const Point2DBase< float, LocalTag > onezero
Definition: OverlapValidation.cc:162
OverlapValidation
Definition: OverlapValidation.cc:88
OverlapValidation::predictedDeltaYError_
float predictedDeltaYError_
Definition: OverlapValidation.cc:136
OverlapValidation::zeroone
const Point2DBase< float, LocalTag > zeroone
Definition: OverlapValidation.cc:163
OverlapValidation::subdetID
int subdetID
Definition: OverlapValidation.cc:160
EDAnalyzer.h
mps_fire.i
i
Definition: mps_fire.py:428
anyDirection
Definition: PropagationDirection.h:4
AnalyticalCurvilinearJacobian
Definition: AnalyticalCurvilinearJacobian.h:21
MessageLogger.h
OverlapValidation::localydotglobalx_
float localydotglobalx_[2]
Definition: OverlapValidation.cc:173
funct::false
false
Definition: Factorize.h:29
TrackExtraFwd.h
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
TrackerGeometry.h
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
edm::Handle::product
T const * product() const
Definition: Handle.h:70
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
OverlapValidation::localydotglobaly_
float localydotglobaly_[2]
Definition: OverlapValidation.cc:174
OverlapValidation::minHitsCut_
const int minHitsCut_
Definition: OverlapValidation.cc:124
RectangularPixelTopology.h
Trajectory::chiSquared
float chiSquared() const
Definition: Trajectory.h:241
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
edm::EDGetTokenT< TrajectoryCollection >
ChiSquaredProbability
float ChiSquaredProbability(double chiSquared, double nrDOF)
Definition: ChiSquaredProbability.cc:13
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackerTopology
Definition: TrackerTopology.h:16
TFileService::file
TFile & file() const
return opened TFile
Definition: TFileService.h:37
globals_cff.id1
id1
Definition: globals_cff.py:33
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
OverlapValidation::trajectoryTag_
edm::InputTag trajectoryTag_
Definition: OverlapValidation.cc:111
GeomDetType.h
OverlapValidation::combiner_
TrajectoryStateCombiner combiner_
Definition: OverlapValidation.cc:117
OverlapValidation::topoToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Definition: OverlapValidation.cc:108
GluedGeomDet::monoDet
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:19
GluedGeomDet.h
ChiSquaredProbability.h
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:46
SiStripDetId.h
TransientTrackingRecHit.h
AnalyticalCurvilinearJacobian.h
TrackerHitAssociator.h
LocalTrajectoryError::matrix
const AlgebraicSymMatrix55 & matrix() const
Definition: LocalTrajectoryError.h:60
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
Trajectory::foundHits
int foundHits() const
Definition: Trajectory.h:206
TrackerHitAssociator::Config
Definition: TrackerHitAssociator.h:57
SiStripDetInfoFileReader
Definition: SiStripDetInfoFileReader.h:30
OverlapValidation::momentum_
float momentum_
Definition: OverlapValidation.cc:152
edm::Handle
Definition: AssociativeIterator.h:50
SiPixelRecHit::cluster
ClusterRef cluster() const
Definition: SiPixelRecHit.h:47
OverlapValidation::moduleY_
float moduleY_[2]
Definition: OverlapValidation.cc:158
parallelization.uint
uint
Definition: parallelization.py:124
OverlapValidation::hitPositions_
float hitPositions_[2]
Definition: OverlapValidation.cc:139
ESGetToken.h
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
Trajectory::lostHits
int lostHits() const
Definition: Trajectory.h:217
OverlapValidation::clusterSize_
float clusterSize_[2]
Definition: OverlapValidation.cc:147
SiPixelRecHit
Our base class.
Definition: SiPixelRecHit.h:23
OverlapValidation::localxdotglobaly_
float localxdotglobaly_[2]
Definition: OverlapValidation.cc:169
edm::Ref
Definition: AssociativeIterator.h:58
FileInPath.h
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
Propagator
Definition: Propagator.h:44
DetId
Definition: DetId.h:17
edm::FileInPath
Definition: FileInPath.h:64
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
OverlapValidation::magFieldToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
Definition: OverlapValidation.cc:107
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
MakerMacros.h
OverlapValidation::relativeXSign_
char relativeXSign_
Definition: OverlapValidation.cc:137
OverlapValidation::event_
uint event_
Definition: OverlapValidation.cc:153
TrackingRecHit.h
OverlapValidation::endJob
void endJob() override
Definition: OverlapValidation.cc:882
OverlapValidation::predictedDeltaXError_
float predictedDeltaXError_
Definition: OverlapValidation.cc:135
JacobianCurvilinearToLocal
Definition: JacobianCurvilinearToLocal.h:19
PSimHit.h
Track.h
TrackFwd.h
AlgebraicMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
Definition: AlgebraicROOTObjects.h:55
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
JacobianLocalToCurvilinear.h
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
OverlapValidation::trackerGeometry_
const TrackerGeometry * trackerGeometry_
Definition: OverlapValidation.cc:114
Service.h
OverlapValidation::localxdotglobalx_
float localxdotglobalx_[2]
Definition: OverlapValidation.cc:168
sistrip::extrainfo::clusterCharge_
static const char clusterCharge_[]
Definition: ConstantsForDqm.h:59
w
const double w
Definition: UKUtility.cc:23
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
OverlapValidation::predictedPositions_
float predictedPositions_[3][2]
Definition: OverlapValidation.cc:132
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
OverlapValidation::overlapPath_
float overlapPath_
Definition: OverlapValidation.cc:127
OverlapValidation::hitErrorsY_
float hitErrorsY_[2]
Definition: OverlapValidation.cc:142
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
IdealMagneticFieldRecord.h
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
LocalTrajectoryParameters::vector
AlgebraicVector5 vector() const
Definition: LocalTrajectoryParameters.h:120
OverlapValidation::hitCounts_
unsigned short hitCounts_[2]
Definition: OverlapValidation.cc:129
SiStripDetInfoFileReader.h
ctfWithMaterialTrackMCMatch_cfi.associator
associator
Definition: ctfWithMaterialTrackMCMatch_cfi.py:7
ProjectedRecHit2D.h
HLT_FULL_cff.Overlap
Overlap
Definition: HLT_FULL_cff.py:11442
Point3DBase< float, GlobalTag >
PixelTopology
Definition: PixelTopology.h:10
EDGetToken.h
PixelGeomDetType.h
GluedGeomDet
Definition: GluedGeomDet.h:7
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
OverlapValidation::chi2_
float chi2_[2]
Definition: OverlapValidation.cc:130
OverlapValidation::ConstRecHitPointer
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
Definition: OverlapValidation.cc:97
TrackerAlignableId::typeAndLayerFromDetId
std::pair< int, int > typeAndLayerFromDetId(const DetId &detId, const TrackerTopology *tTopo) const
Definition: TrackerAlignableId.cc:17
OverlapValidation::predictedLocalParameters_
float predictedLocalParameters_[5][2]
Definition: OverlapValidation.cc:133
AnalyticalPropagator_cfi.AnalyticalPropagator
AnalyticalPropagator
Definition: AnalyticalPropagator_cfi.py:3
OverlapValidation::clusterWidthY_
float clusterWidthY_[2]
Definition: OverlapValidation.cc:146
TFileService.h
TrajectoryStateOnSurface::localParameters
const LocalTrajectoryParameters & localParameters() const
Definition: TrajectoryStateOnSurface.h:73
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
OverlapValidation::edge_
int edge_[2]
Definition: OverlapValidation.cc:149
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
TrackerDigiGeometryRecord.h
OverlapValidation::moduleX_
float moduleX_[2]
Definition: OverlapValidation.cc:157
TrajectoryStateCombiner
Definition: TrajectoryStateCombiner.h:13
edm::ParameterSet
Definition: ParameterSet.h:47
Trajectory::ndof
int ndof(bool bon=true) const
Definition: Trajectory.cc:97
OverlapValidation::FileInPath_
edm::FileInPath FileInPath_
Definition: OverlapValidation.cc:121
OverlapValidation::simHitPositionsY_
float simHitPositionsY_[2]
Definition: OverlapValidation.cc:144
Event.h
OverlapValidation::localydotglobalz_
float localydotglobalz_[2]
Definition: OverlapValidation.cc:172
PixelGeomDetUnit::specificTopology
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
Definition: PixelGeomDetUnit.cc:17
OverlapValidation::clusterWidthX_
float clusterWidthX_[2]
Definition: OverlapValidation.cc:145
OverlapValidation::hitPositionsY_
float hitPositionsY_[2]
Definition: OverlapValidation.cc:141
OverlapValidation::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: OverlapValidation.cc:290
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
OverlapValidation::config_
edm::ParameterSet config_
Definition: OverlapValidation.cc:110
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
event_
void event_()
OverlapValidation::TrajectoryCollection
vector< Trajectory > TrajectoryCollection
Definition: OverlapValidation.cc:94
TrackingRecHit::ConstRecHitPointer
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
Definition: TrackingRecHit.h:25
edm::Service< TFileService >
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
OverlapValidation::magField_
const MagneticField * magField_
Definition: OverlapValidation.cc:115
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
OverlapValidation::geomToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Definition: OverlapValidation.cc:106
analyze
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
SiStripRecHit1D::cluster
ClusterRef cluster() const
Definition: SiStripRecHit1D.h:18
OverlapValidation::hitErrors_
float hitErrors_[2]
Definition: OverlapValidation.cc:140
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:57
AnalyticalPropagator.h
JacobianCurvilinearToLocal::jacobian
const AlgebraicMatrix55 & jacobian() const
Definition: JacobianCurvilinearToLocal.h:37
SiStripRecHit1D
Definition: SiStripRecHit1D.h:8
AlgebraicVector5
ROOT::Math::SVector< double, 5 > AlgebraicVector5
Definition: AlgebraicROOTObjects.h:14
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord >
SiStripDetId::glued
uint32_t glued() const
Definition: SiStripDetId.h:163
Trajectory::measurements
DataContainer const & measurements() const
Definition: Trajectory.h:178
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
OverlapValidation::chi2ProbCut_
const float chi2ProbCut_
Definition: OverlapValidation.cc:125
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
Trajectory.h
TrackerHitAssociator
Definition: TrackerHitAssociator.h:55
OverlapValidation::localydotglobalphi_
float localydotglobalphi_[2]
Definition: OverlapValidation.cc:170
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
GeomDet.h
TrackerAlignableId
Definition: TrackerAlignableId.h:22
std
Definition: JetResolutionObject.h:76
SiStripDetInfoFileReader::getNumberOfApvsAndStripLength
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
Definition: SiStripDetInfoFileReader.cc:101
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
TSiStripMatchedRecHit.h
DetId.h
Trajectory
Definition: Trajectory.h:38
Frameworkfwd.h
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
LocalPoint.h
OverlapValidation::rootTree_
TTree * rootTree_
Definition: OverlapValidation.cc:120
GloballyPositioned::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Definition: GloballyPositioned.h:98
OverlapValidation::trajectoryToken_
edm::EDGetTokenT< TrajectoryCollection > trajectoryToken_
Definition: OverlapValidation.cc:96
OverlapValidation::overlapCounts_
int overlapCounts_[3]
Definition: OverlapValidation.cc:118
TrajectoryStateCombiner::combine
TSOS combine(const TSOS &pTsos1, const TSOS &pTsos2) const
Definition: TrajectoryStateCombiner.cc:6
OverlapValidation::overlapIds_
unsigned int overlapIds_[2]
Definition: OverlapValidation.cc:131
OverlapValidation::predictedLocalErrors_
float predictedLocalErrors_[5][2]
Definition: OverlapValidation.cc:134
PixelGeomDetUnit.h
OverlapValidation::layer_
uint layer_
Definition: OverlapValidation.cc:128
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
OverlapValidation::~OverlapValidation
~OverlapValidation() override
Definition: OverlapValidation.cc:274
EventSetup.h
OverlapValidation::moduleZ_
float moduleZ_[2]
Definition: OverlapValidation.cc:159
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
OverlapValidation::localxdotglobalz_
float localxdotglobalz_[2]
Definition: OverlapValidation.cc:167
OverlapValidation::simHitPositions_
float simHitPositions_[2]
Definition: OverlapValidation.cc:143
TrajectoryStateOnSurface::surface
const SurfaceType & surface() const
Definition: TrajectoryStateOnSurface.h:78
OverlapValidation::acceptLayer
vector< bool > acceptLayer
Definition: OverlapValidation.cc:151
JacobianCurvilinearToLocal.h
OverlapValidation::localydotglobalr_
float localydotglobalr_[2]
Definition: OverlapValidation.cc:171
OverlapValidation::zerozero
const Point2DBase< float, LocalTag > zerozero
Definition: OverlapValidation.cc:161
OverlapValidation::layerFromId
int layerFromId(const DetId &, const TrackerTopology *const tTopo) const
Definition: OverlapValidation.cc:874
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TrajectoryStateOnSurface::globalParameters
const GlobalTrajectoryParameters & globalParameters() const
Definition: TrajectoryStateOnSurface.h:64
OverlapValidation::compressionSettings_
const int compressionSettings_
Definition: OverlapValidation.cc:122
ParameterSet.h
SiStripDetId
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
PXBDetId.h
OverlapValidation::OverlapValidation
OverlapValidation(const edm::ParameterSet &)
Definition: OverlapValidation.cc:189
globals_cff.id2
id2
Definition: globals_cff.py:34
PXFDetId.h
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
OverlapValidation::doSimHit_
bool doSimHit_
Definition: OverlapValidation.cc:113
JacobianLocalToCurvilinear
Definition: JacobianLocalToCurvilinear.h:21
edm::Event
Definition: Event.h:73
TrajectoryStateOnSurface::localError
const LocalTrajectoryError & localError() const
Definition: TrajectoryStateOnSurface.h:77
MagneticField
Definition: MagneticField.h:19
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
edm::Log
Definition: MessageLogger.h:70
GlobalPoint.h
StripSubdetector.h
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
OverlapValidation::clusterCharge_
uint clusterCharge_[2]
Definition: OverlapValidation.cc:148
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163
OverlapValidation::localxdotglobalphi_
float localxdotglobalphi_[2]
Definition: OverlapValidation.cc:165
hit
Definition: SiStripHitEffFromCalibTree.cc:88
OverlapValidation::run_
uint run_
Definition: OverlapValidation.cc:153
SiStripDetId::stereo
uint32_t stereo() const
Definition: SiStripDetId.h:168
OverlapValidation::localxdotglobalr_
float localxdotglobalr_[2]
Definition: OverlapValidation.cc:166
OverlapValidation::addExtraBranches_
const bool addExtraBranches_
Definition: OverlapValidation.cc:123
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
StripGeomDetUnit
Definition: StripGeomDetUnit.h:15
TrackerGeometry
Definition: TrackerGeometry.h:14
OverlapValidation::barrelOnly_
bool barrelOnly_
Definition: OverlapValidation.cc:154
TrackerAlignableId.h