CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackDetMatchInfo.cc
Go to the documentation of this file.
1 #include <map>
3 #include "DetIdInfo.h"
11 #include "Math/VectorUtil.h"
12 #include <algorithm>
13 
14 
16 
17 std::string TrackDetMatchInfo::dumpGeometry( const DetId& id )
18 {
19  if ( ! caloGeometry.isValid() ||
20  ! caloGeometry->getSubdetectorGeometry(id) ||
21  ! caloGeometry->getSubdetectorGeometry(id)->getGeometry(id) ) {
22  throw cms::Exception("FatalError") << "Failed to access geometry for DetId: " << id.rawId();
23  }
24  std::ostringstream oss;
25 
26  const CaloCellGeometry::CornersVec& points = caloGeometry->getSubdetectorGeometry(id)->getGeometry(id)->getCorners();
28  point != points.end(); ++point)
29  oss << "(" << point->z() << ", " << point->perp() << ", " << point->eta() << ", " << point->phi() << "), \t";
30  return oss.str();
31 }
32 
33 
35 {
36  // this part might be slow
37  if ( ! caloGeometry.isValid() ||
38  ! caloGeometry->getSubdetectorGeometry(id) ||
39  ! caloGeometry->getSubdetectorGeometry(id)->getGeometry(id) ) {
40  throw cms::Exception("FatalError") << "Failed to access geometry for DetId: " << id.rawId();
41  return GlobalPoint(0,0,0);
42  }
43  return caloGeometry->getSubdetectorGeometry(id)->getGeometry(id)->getPosition();
44 }
45 
46 
48 {
49  double energy(0);
50  switch (type) {
51  case EcalRecHits:
52  {
53  for(std::vector<const EcalRecHit*>::const_iterator hit=crossedEcalRecHits.begin(); hit!=crossedEcalRecHits.end(); hit++)
54  energy += (*hit)->energy();
55  }
56  break;
57  case HcalRecHits:
58  {
59  for(std::vector<const HBHERecHit*>::const_iterator hit = crossedHcalRecHits.begin(); hit != crossedHcalRecHits.end(); hit++)
60  energy += (*hit)->energy();
61  }
62  break;
63  case HORecHits:
64  {
65  for(std::vector<const HORecHit*>::const_iterator hit = crossedHORecHits.begin(); hit != crossedHORecHits.end(); hit++)
66  energy += (*hit)->energy();
67  }
68  break;
69  case TowerTotal:
70  {
71  for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
72  energy += (*hit)->energy();
73  }
74  break;
75  case TowerEcal:
76  {
77  for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
78  energy += (*hit)->emEnergy();
79  }
80  break;
81  case TowerHcal:
82  {
83  for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
84  energy += (*hit)->hadEnergy();
85  }
86  break;
87  case TowerHO:
88  {
89  for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
90  energy += (*hit)->outerEnergy();
91  }
92  break;
93  default:
94  throw cms::Exception("FatalError") << "Unknown calo energy type: " << type;
95  }
96  return energy;
97 }
98 
99 bool TrackDetMatchInfo::insideCone(const DetId& id, const double dR) {
100  GlobalPoint idPosition = getPosition(id);
101  if (idPosition.mag()<0.01) return false;
102 
103  math::XYZVector idPositionRoot( idPosition.x(), idPosition.y(), idPosition.z() );
105  return ROOT::Math::VectorUtil::DeltaR(trackP3, idPositionRoot) < 0.5;
106 }
107 
109 {
110  double energy(0);
111  switch (type) {
112  case EcalRecHits:
113  {
114  for(std::vector<const EcalRecHit*>::const_iterator hit=ecalRecHits.begin(); hit!=ecalRecHits.end(); hit++)
115  if (insideCone((*hit)->detid(),dR)) energy += (*hit)->energy();
116  }
117  break;
118  case HcalRecHits:
119  {
120  for(std::vector<const HBHERecHit*>::const_iterator hit = hcalRecHits.begin(); hit != hcalRecHits.end(); hit++)
121  if (insideCone((*hit)->detid(),dR)) energy += (*hit)->energy();
122  }
123  break;
124  case HORecHits:
125  {
126  for(std::vector<const HORecHit*>::const_iterator hit = hoRecHits.begin(); hit != hoRecHits.end(); hit++)
127  if (insideCone((*hit)->detid(),dR)) energy += (*hit)->energy();
128  }
129  break;
130  case TowerTotal:
131  {
132  for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
133  if (insideCone((*hit)->id(),dR)) energy += (*hit)->energy();
134  }
135  break;
136  case TowerEcal:
137  {
138  for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
139  if (insideCone((*hit)->id(),dR)) energy += (*hit)->emEnergy();
140  }
141  break;
142  case TowerHcal:
143  {
144  for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
145  if (insideCone((*hit)->id(),dR)) energy += (*hit)->hadEnergy();
146  }
147  break;
148  case TowerHO:
149  {
150  for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
151  if (insideCone((*hit)->id(),dR)) energy += (*hit)->outerEnergy();
152  }
153  break;
154  default:
155  throw cms::Exception("FatalError") << "Unknown calo energy type: " << type;
156  }
157  return energy;
158 }
159 
160 
162 
163 double TrackDetMatchInfo::nXnEnergy(const DetId& id, EnergyType type, int gridSize)
164 {
165  double energy(0);
166  if ( id.rawId() == 0 ) return 0.;
167  switch (type) {
168  case TowerTotal:
169  case TowerHcal:
170  case TowerEcal:
171  case TowerHO:
172  {
173  if ( id.det() != DetId::Calo ) {
174  throw cms::Exception("FatalError") << "Wrong DetId. Expected CaloTower, but found:\n" <<
175  DetIdInfo::info(id)<<"\n";
176  }
177  CaloTowerDetId centerId(id);
178  for(std::vector<const CaloTower*>::const_iterator hit=towers.begin(); hit!=towers.end(); hit++) {
179  CaloTowerDetId neighborId((*hit)->id());
180  int dEta = abs( (centerId.ieta()<0?centerId.ieta()+1:centerId.ieta() )
181  -(neighborId.ieta()<0?neighborId.ieta()+1:neighborId.ieta() ) ) ;
182  int dPhi = abs( centerId.iphi()-neighborId.iphi() );
183  if ( abs(72-dPhi) < dPhi ) dPhi = 72-dPhi;
184  if( dEta <= gridSize && dPhi <= gridSize ) {
185  switch (type) {
186  case TowerTotal:
187  energy += (*hit)->energy();
188  break;
189  case TowerEcal:
190  energy += (*hit)->emEnergy();
191  break;
192  case TowerHcal:
193  energy += (*hit)->hadEnergy();
194  break;
195  case TowerHO:
196  energy += (*hit)->outerEnergy();
197  break;
198  default:
199  throw cms::Exception("FatalError") << "Unknown calo tower energy type: " << type;
200  }
201  }
202  }
203  }
204  break;
205  case EcalRecHits:
206  {
207  if( id.det() != DetId::Ecal || (id.subdetId() != EcalBarrel && id.subdetId() != EcalEndcap) ) {
208  throw cms::Exception("FatalError") << "Wrong DetId. Expected EcalBarrel or EcalEndcap, but found:\n" <<
209  DetIdInfo::info(id)<<"\n";
210  }
211  // Since the ECAL granularity is small and the gap between EE and EB is significant,
212  // energy is computed only within the system that contains the central element
213  if( id.subdetId() == EcalBarrel ) {
214  EBDetId centerId(id);
215  for(std::vector<const EcalRecHit*>::const_iterator hit=ecalRecHits.begin(); hit!=ecalRecHits.end(); hit++) {
216  if ((*hit)->id().subdetId() != EcalBarrel) continue;
217  EBDetId neighborId((*hit)->id());
218  int dEta = abs( (centerId.ieta()<0?centerId.ieta()+1:centerId.ieta() )
219  -(neighborId.ieta()<0?neighborId.ieta()+1:neighborId.ieta() ) ) ;
220  int dPhi = abs( centerId.iphi()-neighborId.iphi() );
221  if ( abs(360-dPhi) < dPhi ) dPhi = 360-dPhi;
222  if( dEta <= gridSize && dPhi <= gridSize ) {
223  energy += (*hit)->energy();
224  }
225  }
226  } else {
227  // Endcap
228  EEDetId centerId(id);
229  for(std::vector<const EcalRecHit*>::const_iterator hit=ecalRecHits.begin(); hit!=ecalRecHits.end(); hit++) {
230  if ((*hit)->id().subdetId() != EcalEndcap) continue;
231  EEDetId neighborId((*hit)->id());
232  if( centerId.zside() == neighborId.zside() &&
233  abs(centerId.ix()-neighborId.ix()) <= gridSize &&
234  abs(centerId.iy()-neighborId.iy()) <= gridSize ) {
235  energy += (*hit)->energy();
236  }
237  }
238  }
239  }
240  break;
241  case HcalRecHits:
242  {
243  if( id.det() != DetId::Hcal || (id.subdetId() != HcalBarrel && id.subdetId() != HcalEndcap) ) {
244  throw cms::Exception("FatalError") << "Wrong DetId. Expected HE or HB, but found:\n" <<
245  DetIdInfo::info(id)<<"\n";
246  }
247  HcalDetId centerId(id);
248  for(std::vector<const HBHERecHit*>::const_iterator hit=hcalRecHits.begin(); hit!=hcalRecHits.end(); hit++) {
249  HcalDetId neighborId((*hit)->id());
250  int dEta = abs( (centerId.ieta()<0?centerId.ieta()+1:centerId.ieta() )
251  -(neighborId.ieta()<0?neighborId.ieta()+1:neighborId.ieta() ) ) ;
252  int dPhi = abs( centerId.iphi()-neighborId.iphi() );
253  if ( abs(72-dPhi) < dPhi ) dPhi = 72-dPhi;
254  if( dEta <= gridSize && dPhi <= gridSize ){
255  energy += (*hit)->energy();
256  }
257  }
258  }
259  break;
260  case HORecHits:
261  {
262  if( id.det() != DetId::Hcal || (id.subdetId() != HcalOuter) ) {
263  throw cms::Exception("FatalError") << "Wrong DetId. Expected HO, but found:\n" <<
264  DetIdInfo::info(id)<<"\n";
265  }
266  HcalDetId centerId(id);
267  for(std::vector<const HORecHit*>::const_iterator hit=hoRecHits.begin(); hit!=hoRecHits.end(); hit++) {
268  HcalDetId neighborId((*hit)->id());
269  int dEta = abs( (centerId.ieta()<0?centerId.ieta()+1:centerId.ieta() )
270  -(neighborId.ieta()<0?neighborId.ieta()+1:neighborId.ieta() ) ) ;
271  int dPhi = abs( centerId.iphi()-neighborId.iphi() );
272  if ( abs(72-dPhi) < dPhi ) dPhi = 72-dPhi;
273  if( dEta <= gridSize && dPhi <= gridSize ) {
274  energy += (*hit)->energy();
275  }
276  }
277  }
278  break;
279  default:
280  throw cms::Exception("FatalError") << "Unkown or not implemented energy type requested, type:" << type;
281  }
282  return energy;
283 }
284 
286 {
287  switch (type) {
288  case TowerTotal:
289  case TowerHcal:
290  case TowerEcal:
291  case TowerHO:
292  if( crossedTowerIds.empty() ) return 0;
293  return nXnEnergy(crossedTowerIds.front(), type, gridSize);
294  break;
295  case EcalRecHits:
296  if( crossedEcalIds.empty() ) return 0;
297  return nXnEnergy(crossedEcalIds.front(), type, gridSize);
298  break;
299  case HcalRecHits:
300  if( crossedHcalIds.empty() ) return 0;
301  return nXnEnergy(crossedHcalIds.front(), type, gridSize);
302  break;
303  case HORecHits:
304  if( crossedHOIds.empty() ) return 0;
305  return nXnEnergy(crossedHOIds.front(), type, gridSize);
306  break;
307  default:
308  throw cms::Exception("FatalError") << "Unkown or not implemented energy type requested, type:" << type;
309  }
310  return -999;
311 }
312 
313 
315  trkGlobPosAtEcal(0,0,0)
316  , trkGlobPosAtHcal(0,0,0)
317  , trkGlobPosAtHO(0,0,0)
318  , trkMomAtEcal(0,0,0)
319  , trkMomAtHcal(0,0,0)
320  , trkMomAtHO(0,0,0)
321  , isGoodEcal(false)
322  , isGoodHcal(false)
323  , isGoodCalo(false)
324  , isGoodHO(false)
325  , isGoodMuon(false)
326  , simTrack(0)
327  , ecalTrueEnergy(-999)
328  , hcalTrueEnergy(-999)
329 {
330 }
331 
333 {
334  DetId id;
335  float maxEnergy = -9999;
336  switch (type) {
337  case EcalRecHits:
338  {
339  for(std::vector<const EcalRecHit*>::const_iterator hit=ecalRecHits.begin(); hit!=ecalRecHits.end(); hit++)
340  if ( (*hit)->energy() > maxEnergy ) {
341  maxEnergy = (*hit)->energy();
342  id = (*hit)->detid();
343  }
344  }
345  break;
346  case HcalRecHits:
347  {
348  for(std::vector<const HBHERecHit*>::const_iterator hit=hcalRecHits.begin(); hit!=hcalRecHits.end(); hit++)
349  if ( (*hit)->energy() > maxEnergy ) {
350  maxEnergy = (*hit)->energy();
351  id = (*hit)->detid();
352  }
353  }
354  break;
355  case HORecHits:
356  {
357  for(std::vector<const HORecHit*>::const_iterator hit=hoRecHits.begin(); hit!=hoRecHits.end(); hit++)
358  if ( (*hit)->energy() > maxEnergy ) {
359  maxEnergy = (*hit)->energy();
360  id = (*hit)->detid();
361  }
362  }
363  break;
364  case TowerTotal:
365  case TowerEcal:
366  case TowerHcal:
367  {
368  for(std::vector<const CaloTower*>::const_iterator hit=towers.begin(); hit!=towers.end(); hit++)
369  {
370  double energy = 0;
371  switch (type) {
372  case TowerTotal:
373  energy = (*hit)->energy();
374  break;
375  case TowerEcal:
376  energy = (*hit)->emEnergy();
377  break;
378  case TowerHcal:
379  energy = (*hit)->hadEnergy();
380  break;
381  case TowerHO:
382  energy = (*hit)->energy();
383  break;
384  default:
385  throw cms::Exception("FatalError") << "Unknown calo tower energy type: " << type;
386  }
387  if ( energy > maxEnergy ) {
388  maxEnergy = energy;
389  id = (*hit)->id();
390  }
391  }
392  }
393  default:
394  throw cms::Exception("FatalError") << "Maximal energy deposition: unkown or not implemented energy type requested, type:" << type;
395  }
396  return id;
397 }
398 
400 {
401  double energy_max(0);
402  DetId id_max;
403  if ( id.rawId() == 0 ) return id_max;
404  switch (type) {
405  case TowerTotal:
406  case TowerHcal:
407  case TowerEcal:
408  case TowerHO:
409  {
410  if ( id.det() != DetId::Calo ) {
411  throw cms::Exception("FatalError") << "Wrong DetId. Expected CaloTower, but found:\n" <<
412  DetIdInfo::info(id)<<"\n";
413  }
414  CaloTowerDetId centerId(id);
415  for(std::vector<const CaloTower*>::const_iterator hit=towers.begin(); hit!=towers.end(); hit++) {
416  CaloTowerDetId neighborId((*hit)->id());
417  int dEta = abs( (centerId.ieta()<0?centerId.ieta()+1:centerId.ieta() )
418  -(neighborId.ieta()<0?neighborId.ieta()+1:neighborId.ieta() ) ) ;
419  int dPhi = abs( centerId.iphi()-neighborId.iphi() );
420  if ( abs(72-dPhi) < dPhi ) dPhi = 72-dPhi;
421  if( dEta <= gridSize && dPhi <= gridSize ) {
422  switch (type) {
423  case TowerTotal:
424  if ( energy_max < (*hit)->energy() ){
425  energy_max = (*hit)->energy();
426  id_max = (*hit)->id();
427  }
428  break;
429  case TowerEcal:
430  if ( energy_max < (*hit)->emEnergy() ){
431  energy_max = (*hit)->emEnergy();
432  id_max = (*hit)->id();
433  }
434  break;
435  case TowerHcal:
436  if ( energy_max < (*hit)->hadEnergy() ){
437  energy_max = (*hit)->hadEnergy();
438  id_max = (*hit)->id();
439  }
440  break;
441  case TowerHO:
442  if ( energy_max < (*hit)->outerEnergy() ){
443  energy_max = (*hit)->outerEnergy();
444  id_max = (*hit)->id();
445  }
446  break;
447  default:
448  throw cms::Exception("FatalError") << "Unknown calo tower energy type: " << type;
449  }
450  }
451  }
452  }
453  break;
454  case EcalRecHits:
455  {
456  if( id.det() != DetId::Ecal || (id.subdetId() != EcalBarrel && id.subdetId() != EcalEndcap) ) {
457  throw cms::Exception("FatalError") << "Wrong DetId. Expected EcalBarrel or EcalEndcap, but found:\n" <<
458  DetIdInfo::info(id)<<"\n";
459  }
460  // Since the ECAL granularity is small and the gap between EE and EB is significant,
461  // energy is computed only within the system that contains the central element
462  if( id.subdetId() == EcalBarrel ) {
463  EBDetId centerId(id);
464  for(std::vector<const EcalRecHit*>::const_iterator hit=ecalRecHits.begin(); hit!=ecalRecHits.end(); hit++) {
465  if ((*hit)->id().subdetId() != EcalBarrel) continue;
466  EBDetId neighborId((*hit)->id());
467  int dEta = abs( (centerId.ieta()<0?centerId.ieta()+1:centerId.ieta() )
468  -(neighborId.ieta()<0?neighborId.ieta()+1:neighborId.ieta() ) ) ;
469  int dPhi = abs( centerId.iphi()-neighborId.iphi() );
470  if ( abs(360-dPhi) < dPhi ) dPhi = 360-dPhi;
471  if( dEta <= gridSize && dPhi <= gridSize ) {
472  if ( energy_max < (*hit)->energy() ){
473  energy_max = (*hit)->energy();
474  id_max = (*hit)->id();
475  }
476  }
477  }
478  } else {
479  // Endcap
480  EEDetId centerId(id);
481  for(std::vector<const EcalRecHit*>::const_iterator hit=ecalRecHits.begin(); hit!=ecalRecHits.end(); hit++) {
482  if ((*hit)->id().subdetId() != EcalEndcap) continue;
483  EEDetId neighborId((*hit)->id());
484  if( centerId.zside() == neighborId.zside() &&
485  abs(centerId.ix()-neighborId.ix()) <= gridSize &&
486  abs(centerId.iy()-neighborId.iy()) <= gridSize ) {
487  if ( energy_max < (*hit)->energy() ){
488  energy_max = (*hit)->energy();
489  id_max = (*hit)->id();
490  }
491  }
492  }
493  }
494  }
495  break;
496  case HcalRecHits:
497  {
498  if( id.det() != DetId::Hcal || (id.subdetId() != HcalBarrel && id.subdetId() != HcalEndcap) ) {
499  throw cms::Exception("FatalError") << "Wrong DetId. Expected HE or HB, but found:\n" <<
500  DetIdInfo::info(id)<<"\n";
501  }
502  HcalDetId centerId(id);
503  for(std::vector<const HBHERecHit*>::const_iterator hit=hcalRecHits.begin(); hit!=hcalRecHits.end(); hit++) {
504  HcalDetId neighborId((*hit)->id());
505  int dEta = abs( (centerId.ieta()<0?centerId.ieta()+1:centerId.ieta() )
506  -(neighborId.ieta()<0?neighborId.ieta()+1:neighborId.ieta() ) ) ;
507  int dPhi = abs( centerId.iphi()-neighborId.iphi() );
508  if ( abs(72-dPhi) < dPhi ) dPhi = 72-dPhi;
509  if( dEta <= gridSize && dPhi <= gridSize ){
510  if ( energy_max < (*hit)->energy() ){
511  energy_max = (*hit)->energy();
512  id_max = (*hit)->id();
513  }
514  }
515  }
516  }
517  break;
518  case HORecHits:
519  {
520  if( id.det() != DetId::Hcal || (id.subdetId() != HcalOuter) ) {
521  throw cms::Exception("FatalError") << "Wrong DetId. Expected HO, but found:\n" <<
522  DetIdInfo::info(id)<<"\n";
523  }
524  HcalDetId centerId(id);
525  for(std::vector<const HORecHit*>::const_iterator hit=hoRecHits.begin(); hit!=hoRecHits.end(); hit++) {
526  HcalDetId neighborId((*hit)->id());
527  int dEta = abs( (centerId.ieta()<0?centerId.ieta()+1:centerId.ieta() )
528  -(neighborId.ieta()<0?neighborId.ieta()+1:neighborId.ieta() ) ) ;
529  int dPhi = abs( centerId.iphi()-neighborId.iphi() );
530  if ( abs(72-dPhi) < dPhi ) dPhi = 72-dPhi;
531  if( dEta <= gridSize && dPhi <= gridSize ) {
532  if ( energy_max < (*hit)->energy() ){
533  energy_max = (*hit)->energy();
534  id_max = (*hit)->id();
535  }
536  }
537  }
538  }
539  break;
540  default:
541  throw cms::Exception("FatalError") << "Unkown or not implemented energy type requested, type:" << type;
542  }
543  return id_max;
544 }
545 
547 {
548  DetId id_max;
549  switch (type) {
550  case TowerTotal:
551  case TowerHcal:
552  case TowerEcal:
553  case TowerHO:
554  if( crossedTowerIds.empty() ) return id_max;
555  return findMaxDeposition(crossedTowerIds.front(), type, gridSize);
556  break;
557  case EcalRecHits:
558  if( crossedEcalIds.empty() ) return id_max;
559  return findMaxDeposition(crossedEcalIds.front(), type, gridSize);
560  break;
561  case HcalRecHits:
562  if( crossedHcalIds.empty() ) return id_max;
563  return findMaxDeposition(crossedHcalIds.front(), type, gridSize);
564  break;
565  case HORecHits:
566  if( crossedHOIds.empty() ) return id_max;
567  return findMaxDeposition(crossedHOIds.front(), type, gridSize);
568  break;
569  default:
570  throw cms::Exception("FatalError") << "Unkown or not implemented energy type requested, type:" << type;
571  }
572  return id_max;
573 }
574 
576 // Obsolete
577 //
578 
579 
580 
582 {
583  return coneEnergy (999, EcalRecHits );
584 }
585 
587 {
588  return coneEnergy (999, HcalRecHits );
589 }
590 
592 {
593  return coneEnergy (999, HcalRecHits );
594 }
595 
597 {
598  return crossedEnergy( EcalRecHits );
599 }
600 
602 {
603  return crossedEnergy( HcalRecHits );
604 }
605 
607 {
608  return crossedEnergy( HORecHits );
609 }
610 
611 
613  int numSegments = 0;
614  for(std::vector<TAMuonChamberMatch>::const_iterator chamber=chambers.begin(); chamber!=chambers.end(); chamber++)
615  numSegments += chamber->segments.size();
616  return numSegments;
617 }
618 
620  int numSegments = 0;
621  for(std::vector<TAMuonChamberMatch>::const_iterator chamber=chambers.begin(); chamber!=chambers.end(); chamber++)
622  if(chamber->station()==station) numSegments += chamber->segments.size();
623  return numSegments;
624 }
625 
627  int numSegments = 0;
628  for(std::vector<TAMuonChamberMatch>::const_iterator chamber=chambers.begin(); chamber!=chambers.end(); chamber++)
629  if(chamber->station()==station&&chamber->detector()==detector) numSegments += chamber->segments.size();
630  return numSegments;
631 }
632 
634  int numSegments = 0;
635  for(std::vector<TAMuonChamberMatch>::const_iterator chamber=chambers.begin(); chamber!=chambers.end(); chamber++)
636  if(chamber->detector()==detector) numSegments += chamber->segments.size();
637  return numSegments;
638 }
type
Definition: HCALResponse.h:22
double coneEnergy(double dR, EnergyType)
GlobalPoint getPosition(const DetId &)
int ix() const
Definition: EEDetId.h:71
std::vector< const CaloTower * > crossedTowers
std::vector< const CaloTower * > towers
std::vector< const HBHERecHit * > crossedHcalRecHits
std::vector< DetId > crossedTowerIds
std::vector< const EcalRecHit * > ecalRecHits
hits in the cone
std::vector< DetId > crossedEcalIds
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:62
DetId findMaxDeposition(EnergyType)
Find detector elements with highest energy deposition.
#define abs(x)
Definition: mlp_lapack.h:159
const_iterator begin() const
Definition: EZArrayFL.h:63
std::vector< DetId > crossedHcalIds
std::vector< const EcalRecHit * > crossedEcalRecHits
hits in detector elements crossed by a track
double nXnEnergy(const DetId &, EnergyType, int gridSize=1)
get energy of the NxN shape (N = 2*gridSize + 1) around given detector element
edm::ESHandle< CaloGeometry > caloGeometry
FreeTrajectoryState stateAtIP
track info
int iphi() const
get the crystal iphi
Definition: EBDetId.h:46
int numberOfSegments() const
T mag() const
Definition: PV3DBase.h:66
std::string dumpGeometry(const DetId &)
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
T z() const
Definition: PV3DBase.h:63
std::vector< TAMuonChamberMatch > chambers
std::vector< const HBHERecHit * > hcalRecHits
int ieta() const
get the cell ieta
Definition: HcalDetId.h:38
int zside() const
Definition: EEDetId.h:65
std::vector< DetId > crossedHOIds
int iphi() const
get the tower iphi
int iy() const
Definition: EEDetId.h:77
static std::string info(const DetId &)
Definition: DetIdInfo.cc:28
int ieta() const
get the crystal ieta
Definition: EBDetId.h:44
double crossedEnergy(EnergyType)
energy in detector elements crossed by the track by types
GlobalVector momentum() const
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
int iphi() const
get the cell iphi
Definition: HcalDetId.h:40
Definition: DetId.h:20
int numberOfSegmentsInDetector(int detector) const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
MgrType::const_iterator const_iterator
Definition: EZArrayFL.h:27
const_iterator end() const
Definition: EZArrayFL.h:64
std::vector< const HORecHit * > crossedHORecHits
bool insideCone(const DetId &, const double)
int ieta() const
get the tower ieta
bool isValid() const
Definition: ESHandle.h:37
std::vector< const HORecHit * > hoRecHits
T x() const
Definition: PV3DBase.h:61
int numberOfSegmentsInStation(int station) const
*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