CMS 3D CMS Logo

CaloPropagateTrack.cc
Go to the documentation of this file.
8 
10 
13 
14 #include <iostream>
15 
16 //#define EDM_ML_DEBUG
17 
18 namespace spr {
19 
20  std::vector<spr::propagatedTrackID> propagateCosmicCALO(edm::Handle<reco::TrackCollection>& trkCollection,
21  const CaloGeometry* geo,
22  const MagneticField* bField,
23  const std::string& theTrackQuality,
24  bool debug) {
28  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
29  std::vector<spr::propagatedTrackID> vdets;
30 
31  unsigned int indx;
32  reco::TrackCollection::const_iterator trkItr;
33  for (trkItr = trkCollection->begin(), indx = 0; trkItr != trkCollection->end(); ++trkItr, indx++) {
34  const reco::Track* pTrack = &(*trkItr);
36  vdet.trkItr = trkItr;
37  vdet.ok = (trackQuality_ != reco::TrackBase::undefQuality) ? (pTrack->quality(trackQuality_)) : true;
38  vdet.detIdECAL = DetId(0);
39  vdet.detIdHCAL = DetId(0);
40  vdet.detIdEHCAL = DetId(0);
41 #ifdef EDM_ML_DEBUG
42  if (debug)
43  std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi "
44  << trkItr->phi() << " Flag " << vdet.ok << std::endl;
45 #endif
47  GlobalVector momentum;
48  int charge(pTrack->charge());
49  if (((pTrack->innerPosition()).Perp2()) < ((pTrack->outerPosition()).Perp2())) {
51  ((pTrack->innerPosition()).X()), ((pTrack->innerPosition()).Y()), ((pTrack->innerPosition()).Z()));
52  momentum = GlobalVector(
53  ((pTrack->innerMomentum()).X()), ((pTrack->innerMomentum()).Y()), ((pTrack->innerMomentum()).Z()));
54  } else {
56  ((pTrack->outerPosition()).X()), ((pTrack->outerPosition()).Y()), ((pTrack->outerPosition()).Z()));
57  momentum = GlobalVector(
58  ((pTrack->outerMomentum()).X()), ((pTrack->outerMomentum()).Y()), ((pTrack->outerMomentum()).Z()));
59  }
60 #ifdef EDM_ML_DEBUG
61  if (debug)
62  std::cout << "Track charge " << charge << " p " << momentum << " position " << vertex << std::endl;
63 #endif
64  std::pair<math::XYZPoint, bool> info = spr::propagateECAL(vertex, momentum, charge, bField, debug);
65 #ifdef EDM_ML_DEBUG
66  if (debug)
67  std::cout << "Propagate to ECAL " << info.second << " at (" << info.first.x() << ", " << info.first.y() << ", "
68  << info.first.z() << ")\n";
69 #endif
70 
71  vdet.okECAL = info.second;
72  if (vdet.okECAL) {
73  const GlobalPoint point(info.first.x(), info.first.y(), info.first.z());
74  vdet.etaECAL = point.eta();
75  vdet.phiECAL = point.phi();
76  if (std::abs(point.eta()) < spr::etaBEEcal) {
77  vdet.detIdECAL = barrelGeom->getClosestCell(point);
78  } else {
79  if (endcapGeom)
80  vdet.detIdECAL = endcapGeom->getClosestCell(point);
81  else
82  vdet.okECAL = false;
83  }
84  vdet.detIdEHCAL = gHB->getClosestCell(point);
85 #ifdef EDM_ML_DEBUG
86  if (debug) {
87  std::cout << "Point at ECAL (" << vdet.etaECAL << ", " << vdet.phiECAL << " ";
88  if (std::abs(point.eta()) < spr::etaBEEcal)
89  std::cout << EBDetId(vdet.detIdECAL);
90  else
91  std::cout << EEDetId(vdet.detIdECAL);
92  std::cout << " " << HcalDetId(vdet.detIdEHCAL) << std::endl;
93  }
94 #endif
95  }
97 #ifdef EDM_ML_DEBUG
98  if (debug)
99  std::cout << "Propagate to HCAL " << info.second << " at (" << info.first.x() << ", " << info.first.y() << ", "
100  << info.first.z() << ")\n";
101 #endif
102  vdet.okHCAL = info.second;
103  if (vdet.okHCAL) {
104  const GlobalPoint point(info.first.x(), info.first.y(), info.first.z());
105  vdet.etaHCAL = point.eta();
106  vdet.phiHCAL = point.phi();
107  vdet.detIdHCAL = gHB->getClosestCell(point);
108  }
109 #ifdef EDM_ML_DEBUG
110  if (debug) {
111  std::cout << "Track [" << indx << "] Flag: " << vdet.ok << " ECAL (" << vdet.okECAL << ") ";
112  if (vdet.detIdECAL.subdetId() == EcalBarrel)
113  std::cout << (EBDetId)(vdet.detIdECAL);
114  else
115  std::cout << (EEDetId)(vdet.detIdECAL);
116  std::cout << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL) << " Or "
117  << (HcalDetId)(vdet.detIdEHCAL) << std::endl;
118  }
119 #endif
120  vdets.push_back(vdet);
121  }
122 
123 #ifdef EDM_ML_DEBUG
124  if (debug) {
125  std::cout << "propagateCALO:: for " << vdets.size() << " tracks" << std::endl;
126  for (unsigned int i = 0; i < vdets.size(); ++i) {
127  std::cout << "Track [" << i << "] Flag: " << vdets[i].ok << " ECAL (" << vdets[i].okECAL << ") ";
128  if (vdets[i].detIdECAL.subdetId() == EcalBarrel) {
129  std::cout << (EBDetId)(vdets[i].detIdECAL);
130  } else {
131  std::cout << (EEDetId)(vdets[i].detIdECAL);
132  }
133  std::cout << " HCAL (" << vdets[i].okHCAL << ") " << (HcalDetId)(vdets[i].detIdHCAL) << " Or "
134  << (HcalDetId)(vdets[i].detIdEHCAL) << std::endl;
135  }
136  }
137 #endif
138  return vdets;
139  }
140 
141  std::vector<spr::propagatedTrackID> propagateCALO(edm::Handle<reco::TrackCollection>& trkCollection,
142  const CaloGeometry* geo,
143  const MagneticField* bField,
144  const std::string& theTrackQuality,
145  bool debug) {
146  std::vector<spr::propagatedTrackID> vdets;
147  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality, vdets, debug);
148  return vdets;
149  }
150 
152  const CaloGeometry* geo,
153  const MagneticField* bField,
154  const std::string& theTrackQuality,
155  std::vector<spr::propagatedTrackID>& vdets,
156  bool debug) {
160  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
161 
162  unsigned int indx;
163  reco::TrackCollection::const_iterator trkItr;
164  for (trkItr = trkCollection->begin(), indx = 0; trkItr != trkCollection->end(); ++trkItr, indx++) {
165  const reco::Track* pTrack = &(*trkItr);
167  vdet.trkItr = trkItr;
168  vdet.ok = (trackQuality_ != reco::TrackBase::undefQuality) ? (pTrack->quality(trackQuality_)) : true;
169  vdet.detIdECAL = DetId(0);
170  vdet.detIdHCAL = DetId(0);
171  vdet.detIdEHCAL = DetId(0);
172 #ifdef EDM_ML_DEBUG
173  if (debug)
174  std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi "
175  << trkItr->phi() << " Flag " << vdet.ok << std::endl;
176 #endif
177  std::pair<math::XYZPoint, bool> info = spr::propagateECAL(pTrack, bField, debug);
178  vdet.okECAL = info.second;
179  if (vdet.okECAL) {
180  const GlobalPoint point(info.first.x(), info.first.y(), info.first.z());
181  vdet.etaECAL = point.eta();
182  vdet.phiECAL = point.phi();
183  if (std::abs(point.eta()) < spr::etaBEEcal) {
184  vdet.detIdECAL = barrelGeom->getClosestCell(point);
185  } else {
186  if (endcapGeom)
187  vdet.detIdECAL = endcapGeom->getClosestCell(point);
188  else
189  vdet.okECAL = false;
190  }
191  vdet.detIdEHCAL = gHB->getClosestCell(point);
192  }
193  info = spr::propagateHCAL(pTrack, bField, debug);
194  vdet.okHCAL = info.second;
195  if (vdet.okHCAL) {
196  const GlobalPoint point(info.first.x(), info.first.y(), info.first.z());
197  vdet.etaHCAL = point.eta();
198  vdet.phiHCAL = point.phi();
199  vdet.detIdHCAL = gHB->getClosestCell(point);
200  }
201 #ifdef EDM_ML_DEBUG
202  if (debug) {
203  std::cout << "Track [" << indx << "] Flag: " << vdet.ok << " ECAL (" << vdet.okECAL << ") ";
204  if (vdet.detIdECAL.subdetId() == EcalBarrel)
205  std::cout << (EBDetId)(vdet.detIdECAL);
206  else
207  std::cout << (EEDetId)(vdet.detIdECAL);
208  std::cout << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL) << " Or "
209  << (HcalDetId)(vdet.detIdEHCAL) << std::endl;
210  }
211 #endif
212  vdets.push_back(vdet);
213  }
214 #ifdef EDM_ML_DEBUG
215  if (debug) {
216  std::cout << "propagateCALO:: for " << vdets.size() << " tracks" << std::endl;
217  for (unsigned int i = 0; i < vdets.size(); ++i) {
218  std::cout << "Track [" << i << "] Flag: " << vdets[i].ok << " ECAL (" << vdets[i].okECAL << ") ";
219  if (vdets[i].detIdECAL.subdetId() == EcalBarrel) {
220  std::cout << (EBDetId)(vdets[i].detIdECAL);
221  } else {
222  std::cout << (EEDetId)(vdets[i].detIdECAL);
223  }
224  std::cout << " HCAL (" << vdets[i].okHCAL << ") " << (HcalDetId)(vdets[i].detIdHCAL) << " Or "
225  << (HcalDetId)(vdets[i].detIdEHCAL) << std::endl;
226  }
227  }
228 #endif
229  }
230 
232  const CaloGeometry* geo,
233  const MagneticField* bField,
234  const std::string& theTrackQuality,
235  std::vector<spr::propagatedTrackDirection>& trkDir,
236  bool debug) {
240  reco::TrackBase::TrackQuality trackQuality_ = reco::TrackBase::qualityByName(theTrackQuality);
241 
242  unsigned int indx;
243  reco::TrackCollection::const_iterator trkItr;
244  for (trkItr = trkCollection->begin(), indx = 0; trkItr != trkCollection->end(); ++trkItr, indx++) {
245  const reco::Track* pTrack = &(*trkItr);
247  trkD.trkItr = trkItr;
248  trkD.ok = (trackQuality_ != reco::TrackBase::undefQuality) ? (pTrack->quality(trackQuality_)) : true;
249  trkD.detIdECAL = DetId(0);
250  trkD.detIdHCAL = DetId(0);
251  trkD.detIdEHCAL = DetId(0);
252 #ifdef EDM_ML_DEBUG
253  if (debug)
254  std::cout << "Propagate track " << indx << " p " << trkItr->p() << " eta " << trkItr->eta() << " phi "
255  << trkItr->phi() << " Flag " << trkD.ok << std::endl;
256 #endif
258  GlobalPoint point(info.point.x(), info.point.y(), info.point.z());
259  trkD.okECAL = info.ok;
260  trkD.pointECAL = point;
261  trkD.directionECAL = info.direction;
262  if (trkD.okECAL) {
263  if (std::abs(info.point.eta()) < spr::etaBEEcal) {
264  trkD.detIdECAL = barrelGeom->getClosestCell(point);
265  } else {
266  if (endcapGeom)
267  trkD.detIdECAL = endcapGeom->getClosestCell(point);
268  else
269  trkD.okECAL = false;
270  }
271  trkD.detIdEHCAL = gHB->getClosestCell(point);
272  }
274  point = GlobalPoint(info.point.x(), info.point.y(), info.point.z());
275  trkD.okHCAL = info.ok;
276  trkD.pointHCAL = point;
277  trkD.directionHCAL = info.direction;
278  if (trkD.okHCAL) {
279  trkD.detIdHCAL = gHB->getClosestCell(point);
280  }
281  trkDir.push_back(trkD);
282  }
283 #ifdef EDM_ML_DEBUG
284  if (debug) {
285  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
286  for (unsigned int i = 0; i < trkDir.size(); ++i) {
287  std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
288  if (trkDir[i].okECAL) {
289  std::cout << " point " << trkDir[i].pointECAL << " direction " << trkDir[i].directionECAL << " ";
290  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
291  std::cout << (EBDetId)(trkDir[i].detIdECAL);
292  } else {
293  std::cout << (EEDetId)(trkDir[i].detIdECAL);
294  }
295  }
296  std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
297  if (trkDir[i].okHCAL) {
298  std::cout << " point " << trkDir[i].pointHCAL << " direction " << trkDir[i].directionHCAL << " "
299  << (HcalDetId)(trkDir[i].detIdHCAL);
300  }
301  std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
302  }
303  }
304 #endif
305  }
306 
308  const CaloGeometry* geo,
309  const MagneticField* bField,
310  bool debug) {
314 
316  vdet.ok = true;
317  vdet.detIdECAL = DetId(0);
318  vdet.detIdHCAL = DetId(0);
319  vdet.detIdEHCAL = DetId(0);
320 #ifdef EDM_ML_DEBUG
321  if (debug)
322  std::cout << "Propagate track: p " << pTrack->p() << " eta " << pTrack->eta() << " phi " << pTrack->phi()
323  << " Flag " << vdet.ok << std::endl;
324 #endif
325  std::pair<math::XYZPoint, bool> info = spr::propagateECAL(pTrack, bField, debug);
326  vdet.okECAL = info.second;
327  if (vdet.okECAL) {
328  const GlobalPoint point(info.first.x(), info.first.y(), info.first.z());
329  vdet.etaECAL = point.eta();
330  vdet.phiECAL = point.phi();
331  if (std::abs(point.eta()) < spr::etaBEEcal) {
332  vdet.detIdECAL = barrelGeom->getClosestCell(point);
333  } else {
334  if (endcapGeom)
335  vdet.detIdECAL = endcapGeom->getClosestCell(point);
336  else
337  vdet.okECAL = false;
338  }
339  vdet.detIdEHCAL = gHB->getClosestCell(point);
340  }
341  info = spr::propagateHCAL(pTrack, bField, debug);
342  vdet.okHCAL = info.second;
343  if (vdet.okHCAL) {
344  const GlobalPoint point(info.first.x(), info.first.y(), info.first.z());
345  vdet.etaHCAL = point.eta();
346  vdet.phiHCAL = point.phi();
347  vdet.detIdHCAL = gHB->getClosestCell(point);
348  }
349 #ifdef EDM_ML_DEBUG
350  if (debug) {
351  std::cout << "propagateCALO:: for 1 track" << std::endl;
352  std::cout << "Track [0] Flag: " << vdet.ok << " ECAL (" << vdet.okECAL << ") ";
353  if (vdet.detIdECAL.subdetId() == EcalBarrel) {
354  std::cout << (EBDetId)(vdet.detIdECAL);
355  } else {
356  std::cout << (EEDetId)(vdet.detIdECAL);
357  }
358  std::cout << " HCAL (" << vdet.okHCAL << ") " << (HcalDetId)(vdet.detIdHCAL) << " Or "
359  << (HcalDetId)(vdet.detIdEHCAL) << std::endl;
360  }
361 #endif
362  return vdet;
363  }
364 
365  std::vector<spr::propagatedGenTrackID> propagateCALO(const HepMC::GenEvent* genEvent,
367  const CaloGeometry* geo,
368  const MagneticField* bField,
369  double etaMax,
370  bool debug) {
374 
375  std::vector<spr::propagatedGenTrackID> trkDir;
376  unsigned int indx;
377  HepMC::GenEvent::particle_const_iterator p;
378  for (p = genEvent->particles_begin(), indx = 0; p != genEvent->particles_end(); ++p, ++indx) {
380  trkD.trkItr = p;
381  trkD.detIdECAL = DetId(0);
382  trkD.detIdHCAL = DetId(0);
383  trkD.detIdEHCAL = DetId(0);
384  trkD.pdgId = ((*p)->pdg_id());
385  trkD.charge = ((pdt->particle(trkD.pdgId))->ID().threeCharge()) / 3;
386  const GlobalVector momentum = GlobalVector((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz());
387 #ifdef EDM_ML_DEBUG
388  if (debug)
389  std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p "
390  << momentum << std::endl;
391 #endif
392  // consider stable particles
393  if ((*p)->status() == 1 && std::abs((*p)->momentum().eta()) < etaMax) {
394  const GlobalPoint vertex = GlobalPoint(0.1 * (*p)->production_vertex()->position().x(),
395  0.1 * (*p)->production_vertex()->position().y(),
396  0.1 * (*p)->production_vertex()->position().z());
397  trkD.ok = true;
400  GlobalPoint point(info.point.x(), info.point.y(), info.point.z());
401  trkD.okECAL = info.ok;
402  trkD.pointECAL = point;
403  trkD.directionECAL = info.direction;
404  if (trkD.okECAL) {
405  if (std::abs(info.point.eta()) < spr::etaBEEcal) {
406  trkD.detIdECAL = barrelGeom->getClosestCell(point);
407  } else {
408  if (endcapGeom)
409  trkD.detIdECAL = endcapGeom->getClosestCell(point);
410  else
411  trkD.okECAL = false;
412  }
413  trkD.detIdEHCAL = gHB->getClosestCell(point);
414  }
415 
418  point = GlobalPoint(info.point.x(), info.point.y(), info.point.z());
419  trkD.okHCAL = info.ok;
420  trkD.pointHCAL = point;
421  trkD.directionHCAL = info.direction;
422  if (trkD.okHCAL) {
423  trkD.detIdHCAL = gHB->getClosestCell(point);
424  }
425  }
426  trkDir.push_back(trkD);
427  }
428 #ifdef EDM_ML_DEBUG
429  if (debug) {
430  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
431  for (unsigned int i = 0; i < trkDir.size(); ++i) {
432  if (trkDir[i].okECAL)
433  std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
434  if (trkDir[i].okECAL) {
435  std::cout << " point " << trkDir[i].pointECAL << " direction " << trkDir[i].directionECAL << " ";
436  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
437  std::cout << (EBDetId)(trkDir[i].detIdECAL);
438  } else {
439  std::cout << (EEDetId)(trkDir[i].detIdECAL);
440  }
441  }
442  if (trkDir[i].okECAL)
443  std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
444  if (trkDir[i].okHCAL) {
445  std::cout << " point " << trkDir[i].pointHCAL << " direction " << trkDir[i].directionHCAL << " "
446  << (HcalDetId)(trkDir[i].detIdHCAL);
447  }
448  if (trkDir[i].okECAL)
449  std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
450  }
451  }
452 #endif
453  return trkDir;
454  }
455 
456  std::vector<spr::propagatedGenParticleID> propagateCALO(edm::Handle<reco::GenParticleCollection>& genParticles,
458  const CaloGeometry* geo,
459  const MagneticField* bField,
460  double etaMax,
461  bool debug) {
465 
466  std::vector<spr::propagatedGenParticleID> trkDir;
467  unsigned int indx;
468  reco::GenParticleCollection::const_iterator p;
469  for (p = genParticles->begin(), indx = 0; p != genParticles->end(); ++p, ++indx) {
471  trkD.trkItr = p;
472  trkD.detIdECAL = DetId(0);
473  trkD.detIdHCAL = DetId(0);
474  trkD.detIdEHCAL = DetId(0);
475  trkD.pdgId = (p->pdgId());
476  trkD.charge = p->charge();
477  const GlobalVector momentum = GlobalVector(p->momentum().x(), p->momentum().y(), p->momentum().z());
478 #ifdef EDM_ML_DEBUG
479  if (debug)
480  std::cout << "Propagate track " << indx << " pdg " << trkD.pdgId << " charge " << trkD.charge << " p "
481  << momentum << std::endl;
482 #endif
483  // consider stable particles
484  if (p->status() == 1 && std::abs(momentum.eta()) < etaMax) {
485  const GlobalPoint vertex = GlobalPoint(p->vertex().x(), p->vertex().y(), p->vertex().z());
486  trkD.ok = true;
489  GlobalPoint point(info.point.x(), info.point.y(), info.point.z());
490  trkD.okECAL = info.ok;
491  trkD.pointECAL = point;
492  trkD.directionECAL = info.direction;
493  if (trkD.okECAL) {
494  if (std::abs(info.point.eta()) < spr::etaBEEcal) {
495  trkD.detIdECAL = barrelGeom->getClosestCell(point);
496  } else {
497  if (endcapGeom)
498  trkD.detIdECAL = endcapGeom->getClosestCell(point);
499  else
500  trkD.okECAL = false;
501  }
502  trkD.detIdEHCAL = gHB->getClosestCell(point);
503  }
504 
507  point = GlobalPoint(info.point.x(), info.point.y(), info.point.z());
508  trkD.okHCAL = info.ok;
509  trkD.pointHCAL = point;
510  trkD.directionHCAL = info.direction;
511  if (trkD.okHCAL) {
512  trkD.detIdHCAL = gHB->getClosestCell(point);
513  }
514  }
515  trkDir.push_back(trkD);
516  }
517 #ifdef EDM_ML_DEBUG
518  if (debug) {
519  std::cout << "propagateCALO:: for " << trkDir.size() << " tracks" << std::endl;
520  for (unsigned int i = 0; i < trkDir.size(); ++i) {
521  if (trkDir[i].okECAL)
522  std::cout << "Track [" << i << "] Flag: " << trkDir[i].ok << " ECAL (" << trkDir[i].okECAL << ")";
523  if (trkDir[i].okECAL) {
524  std::cout << " point " << trkDir[i].pointECAL << " direction " << trkDir[i].directionECAL << " ";
525  if (trkDir[i].detIdECAL.subdetId() == EcalBarrel) {
526  std::cout << (EBDetId)(trkDir[i].detIdECAL);
527  } else {
528  std::cout << (EEDetId)(trkDir[i].detIdECAL);
529  }
530  }
531  if (trkDir[i].okECAL)
532  std::cout << " HCAL (" << trkDir[i].okHCAL << ")";
533  if (trkDir[i].okHCAL) {
534  std::cout << " point " << trkDir[i].pointHCAL << " direction " << trkDir[i].directionHCAL << " "
535  << (HcalDetId)(trkDir[i].detIdHCAL);
536  }
537  if (trkDir[i].okECAL)
538  std::cout << " Or " << (HcalDetId)(trkDir[i].detIdEHCAL) << std::endl;
539  }
540  }
541 #endif
542  return trkDir;
543  }
544 
548  const CaloGeometry* geo,
549  const MagneticField* bField,
550  bool debug) {
554 
555  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
557  trkD.ok = trk.ok;
558  trkD.detIdECAL = DetId(0);
559  trkD.detIdHCAL = DetId(0);
560  trkD.detIdEHCAL = DetId(0);
561 #ifdef EDM_ML_DEBUG
562  if (debug)
563  std::cout << "Propagate track " << thisTrk << " charge " << trk.charge << " position " << trk.position << " p "
564  << trk.momentum << " Flag " << trkD.ok << std::endl;
565 #endif
566  if (trkD.ok) {
569  GlobalPoint point(info.point.x(), info.point.y(), info.point.z());
570  trkD.okECAL = info.ok;
571  trkD.pointECAL = point;
572  trkD.directionECAL = info.direction;
573  if (trkD.okECAL) {
574  if (std::abs(info.point.eta()) < spr::etaBEEcal) {
575  trkD.detIdECAL = barrelGeom->getClosestCell(point);
576  } else {
577  if (endcapGeom)
578  trkD.detIdECAL = endcapGeom->getClosestCell(point);
579  else
580  trkD.okECAL = false;
581  }
582  trkD.detIdEHCAL = gHB->getClosestCell(point);
583  }
584 
587  point = GlobalPoint(info.point.x(), info.point.y(), info.point.z());
588  trkD.okHCAL = info.ok;
589  trkD.pointHCAL = point;
590  trkD.directionHCAL = info.direction;
591  if (trkD.okHCAL) {
592  trkD.detIdHCAL = gHB->getClosestCell(point);
593  }
594  }
595 #ifdef EDM_ML_DEBUG
596  if (debug) {
597  std::cout << "propagateCALO:: for track [" << thisTrk << "] Flag: " << trkD.ok << " ECAL (" << trkD.okECAL
598  << ") HCAL (" << trkD.okHCAL << ")" << std::endl;
599  if (trkD.okECAL) {
600  std::cout << "ECAL point " << trkD.pointECAL << " direction " << trkD.directionECAL << " ";
601  if (trkD.detIdECAL.subdetId() == EcalBarrel) {
602  std::cout << (EBDetId)(trkD.detIdECAL);
603  } else {
604  std::cout << (EEDetId)(trkD.detIdECAL);
605  }
606  }
607  if (trkD.okHCAL) {
608  std::cout << " HCAL point " << trkD.pointHCAL << " direction " << trkD.directionHCAL << " "
609  << (HcalDetId)(trkD.detIdHCAL);
610  }
611  if (trkD.okECAL)
612  std::cout << " Or " << (HcalDetId)(trkD.detIdEHCAL);
613  std::cout << std::endl;
614  }
615 #endif
616  return trkD;
617  }
618 
622  const CaloGeometry* geo,
623  const MagneticField* bField,
624  bool debug) {
626  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
628  trkD.ok = trk.ok;
629  trkD.detIdECAL = DetId(0);
630  trkD.detIdHCAL = DetId(0);
631  trkD.detIdEHCAL = DetId(0);
632 #ifdef EDM_ML_DEBUG
633  if (debug)
634  std::cout << "Propagate track " << thisTrk << " charge " << trk.charge << " position " << trk.position << " p "
635  << trk.momentum << " Flag " << trkD.ok << std::endl;
636 #endif
637  if (trkD.ok) {
640  const GlobalPoint point = GlobalPoint(info.point.x(), info.point.y(), info.point.z());
641  trkD.okHCAL = info.ok;
642  trkD.pointHCAL = point;
643  trkD.directionHCAL = info.direction;
644  if (trkD.okHCAL) {
645  trkD.detIdHCAL = gHB->getClosestCell(point);
646  }
647  }
648 #ifdef EDM_ML_DEBUG
649  if (debug) {
650  std::cout << "propagateCALO:: for track [" << thisTrk << "] Flag: " << trkD.ok << " ECAL (" << trkD.okECAL
651  << ") HCAL (" << trkD.okHCAL << ")" << std::endl;
652  if (trkD.okHCAL) {
653  std::cout << " HCAL point " << trkD.pointHCAL << " direction " << trkD.directionHCAL << " "
654  << (HcalDetId)(trkD.detIdHCAL);
655  }
656  }
657 #endif
658  return trkD;
659  }
660 
661  std::pair<bool, HcalDetId> propagateHCALBack(const reco::Track* track,
662  const CaloGeometry* geo,
663  const MagneticField* bField,
664  bool debug) {
666  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
667  const GlobalVector momentum(track->px(), track->py(), track->pz());
668  int charge(track->charge());
671  if (info.ok) {
672  const GlobalPoint point = GlobalPoint(info.point.x(), info.point.y(), info.point.z());
673  return std::pair<bool, HcalDetId>(true, HcalDetId(gHB->getClosestCell(point)));
674  } else {
675  return std::pair<bool, HcalDetId>(false, HcalDetId());
676  }
677  }
678 
680  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
681  const GlobalVector momentum(track->px(), track->py(), track->pz());
682  int charge(track->charge());
684  }
685 
686  propagatedTrack propagateTrackToECAL(unsigned int thisTrk,
689  const MagneticField* bfield,
690  bool debug) {
691  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
693  if (trk.ok)
694  ptrk = spr::propagateCalo(
696  return ptrk;
697  }
698 
699  std::pair<math::XYZPoint, bool> propagateECAL(const reco::Track* track, const MagneticField* bfield, bool debug) {
700  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
701  const GlobalVector momentum(track->px(), track->py(), track->pz());
702  int charge(track->charge());
703  return spr::propagateECAL(vertex, momentum, charge, bfield, debug);
704  }
705 
706  std::pair<DetId, bool> propagateIdECAL(const HcalDetId& id,
707  const CaloGeometry* geo,
708  const MagneticField* bField,
709  bool debug) {
710  const HcalGeometry* gHB = static_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(DetId::Hcal, HcalBarrel));
711  const GlobalPoint vertex(0, 0, 0);
712  const GlobalPoint hit(gHB->getPosition(id));
713  const GlobalVector momentum = GlobalVector(hit.x(), hit.y(), hit.z());
714  std::pair<math::XYZPoint, bool> info = propagateECAL(vertex, momentum, 0, bField, debug);
715  DetId eId(0);
716  if (info.second) {
717  const GlobalPoint point(info.first.x(), info.first.y(), info.first.z());
718  if (std::abs(point.eta()) < spr::etaBEEcal) {
720  eId = barrelGeom->getClosestCell(point);
721  } else {
723  if (endcapGeom)
724  eId = endcapGeom->getClosestCell(point);
725  else
726  info.second = false;
727  }
728  }
729  return std::pair<DetId, bool>(eId, info.second);
730  }
731 
732  std::pair<math::XYZPoint, bool> propagateECAL(
733  const GlobalPoint& vertex, const GlobalVector& momentum, int charge, const MagneticField* bfield, bool debug) {
736  return std::pair<math::XYZPoint, bool>(track.point, track.ok);
737  }
738 
740  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
741  const GlobalVector momentum(track->px(), track->py(), track->pz());
742  int charge(track->charge());
744  }
745 
749  const MagneticField* bfield,
750  bool debug) {
751  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
753  if (trk.ok)
754  ptrk = spr::propagateCalo(
756  return ptrk;
757  }
758 
759  std::pair<math::XYZPoint, bool> propagateHCAL(const reco::Track* track, const MagneticField* bfield, bool debug) {
760  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
761  const GlobalVector momentum(track->px(), track->py(), track->pz());
762  int charge(track->charge());
763  return spr::propagateHCAL(vertex, momentum, charge, bfield, debug);
764  }
765 
766  std::pair<math::XYZPoint, bool> propagateHCAL(
767  const GlobalPoint& vertex, const GlobalVector& momentum, int charge, const MagneticField* bfield, bool debug) {
770  return std::pair<math::XYZPoint, bool>(track.point, track.ok);
771  }
772 
773  std::pair<math::XYZPoint, bool> propagateTracker(const reco::Track* track, const MagneticField* bfield, bool debug) {
774  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
775  const GlobalVector momentum(track->px(), track->py(), track->pz());
776  int charge(track->charge());
777  spr::propagatedTrack track1 =
779  return std::pair<math::XYZPoint, bool>(track1.point, track1.ok);
780  }
781 
782  std::pair<math::XYZPoint, double> propagateTrackerEnd(const reco::Track* track,
783  const MagneticField* bField,
784  bool
785 #ifdef EDM_ML_DEBUG
786  debug
787 #endif
788  ) {
789 
790  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
791  const GlobalVector momentum(track->px(), track->py(), track->pz());
792  int charge(track->charge());
793  float radius = track->outerPosition().Rho();
794  float zdist = track->outerPosition().Z();
795 #ifdef EDM_ML_DEBUG
796  if (debug)
797  std::cout << "propagateTrackerEnd:: Vertex " << vertex << " Momentum " << momentum << " Charge " << charge
798  << " Radius " << radius << " Z " << zdist << std::endl;
799 #endif
800  FreeTrajectoryState fts(vertex, momentum, charge, bField);
804 
806 
807  TrajectoryStateOnSurface tsose = myAP.propagate(fts, *endcap);
808  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
809 
810  math::XYZPoint point(-999., -999., -999.);
811  bool ok = false;
812  GlobalVector direction(0, 0, 1);
813  if (tsosb.isValid() && std::abs(zdist) < spr::zFrontTE) {
814  point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
815  direction = tsosb.globalDirection();
816  ok = true;
817  } else if (tsose.isValid()) {
818  point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
819  direction = tsose.globalDirection();
820  ok = true;
821  }
822 
823  double length = -1;
824  if (ok) {
825  math::XYZPoint vDiff(point.x() - vertex.x(), point.y() - vertex.y(), point.z() - vertex.z());
826  double dphi = direction.phi() - momentum.phi();
827  double rdist = std::sqrt(vDiff.x() * vDiff.x() + vDiff.y() * vDiff.y());
828  double rat = 0.5 * dphi / std::sin(0.5 * dphi);
829  double dZ = vDiff.z();
830  double dS = rdist * rat; //dZ*momentum.z()/momentum.perp();
831  length = std::sqrt(dS * dS + dZ * dZ);
832 #ifdef EDM_ML_DEBUG
833  if (debug)
834  std::cout << "propagateTracker:: Barrel " << tsosb.isValid() << " Endcap " << tsose.isValid() << " OverAll "
835  << ok << " Point " << point << " RDist " << rdist << " dS " << dS << " dS/pt "
836  << rdist * rat / momentum.perp() << " zdist " << dZ << " dz/pz " << dZ / momentum.z() << " Length "
837  << length << std::endl;
838 #endif
839  }
840 
841  return std::pair<math::XYZPoint, double>(point, length);
842  }
843 
845  const GlobalVector& tpMomentum,
846  int tpCharge,
847  const MagneticField* bField,
848  float zdist,
849  float radius,
850  float corner,
851  bool
852 #ifdef EDM_ML_DEBUG
853  debug
854 #endif
855  ) {
856 
858 #ifdef EDM_ML_DEBUG
859  if (debug)
860  std::cout << "propagateCalo:: Vertex " << tpVertex << " Momentum " << tpMomentum << " Charge " << tpCharge
861  << " Radius " << radius << " Z " << zdist << " Corner " << corner << std::endl;
862 #endif
863  FreeTrajectoryState fts(tpVertex, tpMomentum, tpCharge, bField);
864 
867 
870 
872 
874  if (tpMomentum.eta() < 0) {
875  tsose = myAP.propagate(fts, *lendcap);
876  } else {
877  tsose = myAP.propagate(fts, *rendcap);
878  }
879 
880  TrajectoryStateOnSurface tsosb = myAP.propagate(fts, *barrel);
881 
882  track.ok = true;
883  if (tsose.isValid() && tsosb.isValid()) {
884  float absEta = std::abs(tsosb.globalPosition().eta());
885  if (absEta < corner) {
886  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
887  track.direction = tsosb.globalDirection();
888  } else {
889  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
890  track.direction = tsose.globalDirection();
891  }
892  } else if (tsose.isValid()) {
893  track.point.SetXYZ(tsose.globalPosition().x(), tsose.globalPosition().y(), tsose.globalPosition().z());
894  track.direction = tsose.globalDirection();
895  } else if (tsosb.isValid()) {
896  track.point.SetXYZ(tsosb.globalPosition().x(), tsosb.globalPosition().y(), tsosb.globalPosition().z());
897  track.direction = tsosb.globalDirection();
898  } else {
899  track.point.SetXYZ(-999., -999., -999.);
900  track.direction = GlobalVector(0, 0, 1);
901  track.ok = false;
902  }
903 #ifdef EDM_ML_DEBUG
904  if (debug) {
905  std::cout << "propagateCalo:: Barrel " << tsosb.isValid() << " Endcap " << tsose.isValid() << " OverAll "
906  << track.ok << " Point " << track.point << " Direction " << track.direction << std::endl;
907  if (track.ok) {
908  math::XYZPoint vDiff(
909  track.point.x() - tpVertex.x(), track.point.y() - tpVertex.y(), track.point.z() - tpVertex.z());
910  double dphi = track.direction.phi() - tpMomentum.phi();
911  double rdist = std::sqrt(vDiff.x() * vDiff.x() + vDiff.y() * vDiff.y());
912  double pt = tpMomentum.perp();
913  double rat = 0.5 * dphi / std::sin(0.5 * dphi);
914  std::cout << "RDist " << rdist << " pt " << pt << " r/pt " << rdist * rat / pt << " zdist " << vDiff.z()
915  << " pz " << tpMomentum.z() << " z/pz " << vDiff.z() / tpMomentum.z() << std::endl;
916  }
917  }
918 #endif
919  return track;
920  }
921 
922  spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk,
925  bool
926 #ifdef EDM_ML_DEBUG
927  debug
928 #endif
929  ) {
930 
931  spr::trackAtOrigin trk;
932 
933  edm::SimTrackContainer::const_iterator itr = SimTk->end();
934  for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
935  if (simTrkItr->trackId() == thisTrk) {
936 #ifdef EDM_ML_DEBUG
937  if (debug)
938  std::cout << "matched trackId (maximum occurance) " << thisTrk << " type " << simTrkItr->type() << std::endl;
939 #endif
940  itr = simTrkItr;
941  break;
942  }
943  }
944 
945  if (itr != SimTk->end()) {
946  int vertIndex = itr->vertIndex();
947  if (vertIndex != -1 && vertIndex < (int)SimVtx->size()) {
948  edm::SimVertexContainer::const_iterator simVtxItr = SimVtx->begin();
949  for (int iv = 0; iv < vertIndex; iv++)
950  simVtxItr++;
951  const math::XYZTLorentzVectorD pos = simVtxItr->position();
952  const math::XYZTLorentzVectorD mom = itr->momentum();
953  trk.ok = true;
954  trk.charge = (int)(itr->charge());
955  trk.position = GlobalPoint(pos.x(), pos.y(), pos.z());
956  trk.momentum = GlobalVector(mom.x(), mom.y(), mom.z());
957  }
958  }
959 #ifdef EDM_ML_DEBUG
960  if (debug)
961  std::cout << "Track flag " << trk.ok << " Position " << trk.position << " Momentum " << trk.momentum << std::endl;
962 #endif
963  return trk;
964  }
965 
967  const CaloGeometry* geo,
968  const MagneticField* bField,
969  bool typeRZ,
970  const std::pair<double, double> rz,
971  bool debug) {
972  const GlobalPoint vertex(track->vx(), track->vy(), track->vz());
973  const GlobalVector momentum(track->px(), track->py(), track->pz());
974  int charge(track->charge());
975 #ifdef EDM_ML_DEBUG
976  if (debug)
977  std::cout << "Propagate track with charge " << charge << " position " << vertex << " p " << momentum << std::endl;
978 #endif
979  std::pair<HcalDetId, HcalDetId> ids = propagateHCAL(geo, bField, vertex, momentum, charge, typeRZ, rz, debug);
980  bool ok = ((ids.first != HcalDetId()) && (ids.first.ieta() == ids.second.ieta()) &&
981  (ids.first.iphi() == ids.second.iphi()));
982  return ok;
983  }
984 
985  bool propagateHCAL(unsigned int thisTrk,
988  const CaloGeometry* geo,
989  const MagneticField* bField,
990  bool typeRZ,
991  const std::pair<double, double> rz,
992  bool debug) {
993  spr::trackAtOrigin trk = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
994 #ifdef EDM_ML_DEBUG
995  if (debug)
996  std::cout << "Propagate track " << thisTrk << " charge " << trk.charge << " position " << trk.position << " p "
997  << trk.momentum << std::endl;
998 #endif
999  std::pair<HcalDetId, HcalDetId> ids =
1000  propagateHCAL(geo, bField, trk.position, trk.momentum, trk.charge, typeRZ, rz, debug);
1001  bool ok = ((ids.first != HcalDetId()) && (ids.first.ieta() == ids.second.ieta()) &&
1002  (ids.first.iphi() == ids.second.iphi()));
1003  return ok;
1004  }
1005 
1006  std::pair<HcalDetId, HcalDetId> propagateHCAL(const CaloGeometry* geo,
1007  const MagneticField* bField,
1008  const GlobalPoint& vertex,
1009  const GlobalVector& momentum,
1010  int charge,
1011  bool typeRZ,
1012  const std::pair<double, double> rz,
1013  bool
1014 #ifdef EDM_ML_DEBUG
1015  debug
1016 #endif
1017  ) {
1018 
1019 #ifdef EDM_ML_DEBUG
1020  if (debug)
1021  std::cout << "propagateCalo:: Vertex " << vertex << " Momentum " << momentum << " Charge " << charge << " R/Z "
1022  << rz.first << " : " << rz.second << " Type " << typeRZ << std::endl;
1023 #endif
1025  FreeTrajectoryState fts(vertex, momentum, charge, bField);
1027 
1028  HcalDetId id1, id2;
1029  for (int k = 0; k < 2; ++k) {
1031  double rzv = (k == 0) ? rz.first : rz.second;
1032  if (typeRZ) {
1035  tsos = myAP.propagate(fts, *barrel);
1036  } else {
1038  tsos = myAP.propagate(fts, *endcap);
1039  }
1040 
1041  if (tsos.isValid()) {
1042  GlobalPoint point = tsos.globalPosition();
1043  if (k == 0)
1044  id1 = gHB->getClosestCell(point);
1045  else
1046  id2 = gHB->getClosestCell(point);
1047 #ifdef EDM_ML_DEBUG
1048  if (debug) {
1049  std::cout << "Iteration " << k << " Point " << point << " ID ";
1050  if (k == 0)
1051  std::cout << id1;
1052  else
1053  std::cout << id2;
1054  std::cout << std::endl;
1055  }
1056 #endif
1057  }
1058  }
1059 #ifdef EDM_ML_DEBUG
1060  if (debug)
1061  std::cout << "propagateCalo:: Front " << id1 << " Back " << id2 << std::endl;
1062 #endif
1063  return std::pair<HcalDetId, HcalDetId>(id1, id2);
1064  }
1065 } // namespace spr
reco::Track::outerPosition
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:62
Vector3DBase
Definition: Vector3DBase.h:8
reco::Track::outerMomentum
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:65
spr::propagatedTrackID::phiECAL
double phiECAL
Definition: CaloPropagateTrack.h:49
TrajectoryStateOnSurface::globalDirection
GlobalVector globalDirection() const
Definition: TrajectoryStateOnSurface.h:67
TkRotation< float >
spr::propagatedGenParticleID::pdgId
int pdgId
Definition: CaloPropagateTrack.h:88
TrajectoryStateOnSurface.h
mps_fire.i
i
Definition: mps_fire.py:428
spr::propagatedGenTrackID::charge
int charge
Definition: CaloPropagateTrack.h:75
spr
Definition: CaloConstants.h:6
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
genParticles2HepMC_cfi.genParticles
genParticles
Definition: genParticles2HepMC_cfi.py:4
Cylinder.h
spr::propagatedTrack
Definition: CaloPropagateTrack.h:33
hit::y
double y
Definition: SiStripHitEffFromCalibTree.cc:90
spr::propagatedTrackID::detIdEHCAL
DetId detIdEHCAL
Definition: CaloPropagateTrack.h:47
spr::propagateIdECAL
std::pair< DetId, bool > propagateIdECAL(const HcalDetId &id, const CaloGeometry *geo, const MagneticField *, bool debug=false)
Definition: CaloPropagateTrack.cc:706
spr::rFrontEB
static const double rFrontEB
Definition: CaloConstants.h:10
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
reco::TrackBase::p
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
X
#define X(str)
Definition: MuonsGrabber.cc:38
spr::propagatedGenTrackID::directionHCAL
GlobalVector directionHCAL
Definition: CaloPropagateTrack.h:74
EBDetId
Definition: EBDetId.h:17
CaloConstants.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
reco::TrackBase::undefQuality
Definition: TrackBase.h:151
math::XYZTLorentzVectorD
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
globals_cff.id1
id1
Definition: globals_cff.py:33
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
gather_cfg.cout
cout
Definition: gather_cfg.py:144
pos
Definition: PixelAliasList.h:18
EBDetId.h
EEDetId.h
DetId::Hcal
Definition: DetId.h:28
spr::propagateCosmicCALO
std::vector< spr::propagatedTrackID > propagateCosmicCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
Definition: CaloPropagateTrack.cc:20
distTCMET_cfi.corner
corner
Definition: distTCMET_cfi.py:38
spr::propagatedGenParticleID::pointECAL
GlobalPoint pointECAL
Definition: CaloPropagateTrack.h:86
spr::zBackHE
static const double zBackHE
Definition: CaloConstants.h:16
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
reco::TrackBase::TrackQuality
TrackQuality
track quality
Definition: TrackBase.h:150
spr::propagateTracker
std::pair< math::XYZPoint, bool > propagateTracker(const reco::Track *, const MagneticField *, bool debug=false)
Definition: CaloPropagateTrack.cc:773
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
spr::propagateTrackToECAL
spr::propagatedTrack propagateTrackToECAL(const reco::Track *, const MagneticField *, bool debug=false)
Definition: CaloPropagateTrack.cc:679
ReferenceCountingPointer< Plane >
spr::propagatedGenTrackID::pdgId
int pdgId
Definition: CaloPropagateTrack.h:75
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
HcalBarrel
Definition: HcalAssistant.h:33
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
spr::propagatedGenParticleID::trkItr
reco::GenParticleCollection::const_iterator trkItr
Definition: CaloPropagateTrack.h:89
edm::Handle< reco::TrackCollection >
EcalBarrel
Definition: EcalSubdetector.h:10
distTCMET_cfi.zdist
zdist
Definition: distTCMET_cfi.py:37
HcalGeometry.h
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
spr::propagateCalo
spr::propagatedTrack propagateCalo(const GlobalPoint &vertex, const GlobalVector &momentum, int charge, const MagneticField *, float zdist, float radius, float corner, bool debug=false)
Definition: CaloPropagateTrack.cc:844
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
DetId
Definition: DetId.h:17
spr::propagatedTrackID::ok
bool ok
Definition: CaloPropagateTrack.h:46
Plane.h
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
CaloGeometry
Definition: CaloGeometry.h:21
reco::Track::innerMomentum
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:59
debug
#define debug
Definition: HDRShower.cc:19
spr::propagatedGenTrackID::detIdEHCAL
DetId detIdEHCAL
Definition: CaloPropagateTrack.h:72
spr::propagatedGenParticleID::directionECAL
GlobalVector directionECAL
Definition: CaloPropagateTrack.h:87
spr::propagatedGenParticleID::okECAL
bool okECAL
Definition: CaloPropagateTrack.h:84
spr::propagatedTrackDirection::okECAL
bool okECAL
Definition: CaloPropagateTrack.h:59
spr::propagatedTrackID::okECAL
bool okECAL
Definition: CaloPropagateTrack.h:46
spr::propagatedGenTrackID
Definition: CaloPropagateTrack.h:66
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::Track
Definition: Track.h:27
edm::ESHandle< ParticleDataTable >
spr::zFrontEE
static const double zFrontEE
Definition: CaloConstants.h:9
spr::trackAtOrigin
Definition: CaloPropagateTrack.h:92
spr::propagatedGenParticleID::directionHCAL
GlobalVector directionHCAL
Definition: CaloPropagateTrack.h:87
spr::propagatedTrackID::etaECAL
double etaECAL
Definition: CaloPropagateTrack.h:48
reco::TrackBase::charge
int charge() const
track electric charge
Definition: TrackBase.h:596
spr::etaBEEcal
static const double etaBEEcal
Definition: CaloConstants.h:12
EDM_ML_DEBUG
#define EDM_ML_DEBUG
Definition: HcalHBHEMuonSimAnalyzer.cc:41
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
dqmdumpme.k
k
Definition: dqmdumpme.py:60
Point3DBase< float, GlobalTag >
reco::TrackBase::phi
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
hit::z
double z
Definition: SiStripHitEffFromCalibTree.cc:91
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
spr::propagateECAL
std::pair< math::XYZPoint, bool > propagateECAL(const reco::Track *, const MagneticField *, bool debug=false)
Definition: CaloPropagateTrack.cc:699
EEDetId
Definition: EEDetId.h:14
spr::propagatedGenParticleID::charge
int charge
Definition: CaloPropagateTrack.h:88
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalEndcap
Definition: EcalSubdetector.h:10
Plane::build
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
spr::propagatedTrackID::detIdHCAL
DetId detIdHCAL
Definition: CaloPropagateTrack.h:47
spr::propagatedTrackDirection::pointHCAL
GlobalPoint pointHCAL
Definition: CaloPropagateTrack.h:61
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
align::ID
uint32_t ID
Definition: Definitions.h:24
spr::propagatedTrackID::detIdECAL
DetId detIdECAL
Definition: CaloPropagateTrack.h:47
HcalGeometry::getPosition
GlobalPoint getPosition(const DetId &id) const
Definition: HcalGeometry.cc:179
spr::zFrontTE
static const double zFrontTE
Definition: CaloConstants.h:20
spr::propagatedTrackDirection::detIdHCAL
DetId detIdHCAL
Definition: CaloPropagateTrack.h:60
spr::trackAtOrigin::ok
bool ok
Definition: CaloPropagateTrack.h:94
spr::propagatedGenParticleID::detIdHCAL
DetId detIdHCAL
Definition: CaloPropagateTrack.h:85
HcalDetId.h
spr::propagatedTrackID::etaHCAL
double etaHCAL
Definition: CaloPropagateTrack.h:48
reco::TrackBase::eta
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
Cylinder::build
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
Definition: Cylinder.h:45
spr::propagatedTrackID::trkItr
reco::TrackCollection::const_iterator trkItr
Definition: CaloPropagateTrack.h:50
reco::Track::innerPosition
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:56
HcalDetId
Definition: HcalDetId.h:12
createfilelist.int
int
Definition: createfilelist.py:10
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
spr::rFrontHB
static const double rFrontHB
Definition: CaloConstants.h:14
spr::propagatedGenParticleID::ok
bool ok
Definition: CaloPropagateTrack.h:84
AnalyticalPropagator.h
CaloSubdetectorGeometry::getClosestCell
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: CaloSubdetectorGeometry.cc:44
spr::simTrackAtOrigin
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
Definition: CaloPropagateTrack.cc:922
DetId::Ecal
Definition: DetId.h:27
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:29
spr::propagatedTrackDirection::directionECAL
GlobalVector directionECAL
Definition: CaloPropagateTrack.h:62
spr::propagatedTrackID::okHCAL
bool okHCAL
Definition: CaloPropagateTrack.h:46
spr::propagatedGenTrackID::okECAL
bool okECAL
Definition: CaloPropagateTrack.h:71
spr::propagatedTrackDirection::directionHCAL
GlobalVector directionHCAL
Definition: CaloPropagateTrack.h:62
spr::propagatedGenParticleID::okHCAL
bool okHCAL
Definition: CaloPropagateTrack.h:84
spr::propagatedGenTrackID::detIdECAL
DetId detIdECAL
Definition: CaloPropagateTrack.h:72
spr::propagateCALO
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
Definition: CaloPropagateTrack.cc:141
reco::TrackBase::qualityByName
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
spr::propagatedTrackDirection::ok
bool ok
Definition: CaloPropagateTrack.h:59
spr::etaBETrak
static const double etaBETrak
Definition: CaloConstants.h:23
spr::trackAtOrigin::position
GlobalPoint position
Definition: CaloPropagateTrack.h:96
AnalyticalPropagator
Definition: AnalyticalPropagator.h:22
spr::propagatedGenTrackID::okHCAL
bool okHCAL
Definition: CaloPropagateTrack.h:71
spr::propagatedGenParticleID
Definition: CaloPropagateTrack.h:79
spr::propagatedTrackDirection::pointECAL
GlobalPoint pointECAL
Definition: CaloPropagateTrack.h:61
spr::propagateHCALBack
spr::propagatedTrackDirection propagateHCALBack(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const CaloGeometry *geo, const MagneticField *bField, bool debug=false)
Definition: CaloPropagateTrack.cc:619
spr::rBackTB
static const double rBackTB
Definition: CaloConstants.h:22
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
Calorimetry_cff.bField
bField
Definition: Calorimetry_cff.py:292
spr::propagateTrackerEnd
std::pair< math::XYZPoint, double > propagateTrackerEnd(const reco::Track *, const MagneticField *, bool debug=false)
Definition: CaloPropagateTrack.cc:782
genWeightsTable_cfi.genEvent
genEvent
Definition: genWeightsTable_cfi.py:4
spr::trackAtOrigin::charge
int charge
Definition: CaloPropagateTrack.h:95
CaloPropagateTrack.h
spr::zFrontHE
static const double zFrontHE
Definition: CaloConstants.h:13
spr::trackAtOrigin::momentum
GlobalVector momentum
Definition: CaloPropagateTrack.h:97
spr::propagatedTrackID
Definition: CaloPropagateTrack.h:40
spr::propagatedTrackDirection::detIdECAL
DetId detIdECAL
Definition: CaloPropagateTrack.h:60
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
spr::propagatedTrackDirection::detIdEHCAL
DetId detIdEHCAL
Definition: CaloPropagateTrack.h:60
ALCARECOTkAlBeamHalo_cff.etaMax
etaMax
Definition: ALCARECOTkAlBeamHalo_cff.py:33
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
spr::propagateHCAL
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
Definition: CaloPropagateTrack.cc:759
spr::propagatedGenTrackID::pointHCAL
GlobalPoint pointHCAL
Definition: CaloPropagateTrack.h:73
BeamSpotPI::Y
Definition: BeamSpotPayloadInspectorHelper.h:31
spr::propagatedTrackID::phiHCAL
double phiHCAL
Definition: CaloPropagateTrack.h:49
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
spr::etaBEHcal
static const double etaBEHcal
Definition: CaloConstants.h:15
BeamSpotPI::Z
Definition: BeamSpotPayloadInspectorHelper.h:32
spr::propagatedGenParticleID::detIdEHCAL
DetId detIdEHCAL
Definition: CaloPropagateTrack.h:85
globals_cff.id2
id2
Definition: globals_cff.py:34
spr::zBackTE
static const double zBackTE
Definition: CaloConstants.h:21
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
spr::propagatedGenTrackID::trkItr
HepMC::GenEvent::particle_const_iterator trkItr
Definition: CaloPropagateTrack.h:76
MagneticField
Definition: MagneticField.h:19
spr::propagatedGenParticleID::pointHCAL
GlobalPoint pointHCAL
Definition: CaloPropagateTrack.h:86
HcalGeometry
Definition: HcalGeometry.h:17
spr::propagatedTrackDirection::okHCAL
bool okHCAL
Definition: CaloPropagateTrack.h:59
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
reco::TrackBase::quality
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
spr::propagatedGenTrackID::detIdHCAL
DetId detIdHCAL
Definition: CaloPropagateTrack.h:72
spr::propagatedTrackDirection
Definition: CaloPropagateTrack.h:53
alongMomentum
Definition: PropagationDirection.h:4
spr::propagatedGenTrackID::pointECAL
GlobalPoint pointECAL
Definition: CaloPropagateTrack.h:73
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
spr::propagatedTrackDirection::trkItr
reco::TrackCollection::const_iterator trkItr
Definition: CaloPropagateTrack.h:63
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
hit
Definition: SiStripHitEffFromCalibTree.cc:88
spr::propagatedGenTrackID::ok
bool ok
Definition: CaloPropagateTrack.h:71
AnalyticalPropagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
spr::rBackHB
static const double rBackHB
Definition: CaloConstants.h:17
spr::propagatedGenTrackID::directionECAL
GlobalVector directionECAL
Definition: CaloPropagateTrack.h:74
spr::propagateTrackToHCAL
spr::propagatedTrack propagateTrackToHCAL(const reco::Track *, const MagneticField *, bool debug=false)
Definition: CaloPropagateTrack.cc:739
spr::propagatedGenParticleID::detIdECAL
DetId detIdECAL
Definition: CaloPropagateTrack.h:85