CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFBlockElement.cc
Go to the documentation of this file.
7 
8 
9 using namespace reco;
10 
11 // int PFBlockElement::instanceCounter_ = 0;
12 
13 // int PFBlockElement::instanceCounter() {
14 // return instanceCounter_;
15 // }
16 
17 void PFBlockElement::Dump(std::ostream& out,
18  const char* pad) const {
19  if(!out) return;
20  out<<pad<<"base element";
21 }
22 
23 std::ostream& reco::operator<<( std::ostream& out,
24  const PFBlockElement& element ) {
25 
26  if(! out) return out;
27 
28  out<<"element "<<element.index()<<"- type "<<element.type_<<" ";
29 
30  try {
31  switch(element.type_) {
33  {
34  const reco::PFBlockElementTrack& et =
35  dynamic_cast<const reco::PFBlockElementTrack &>( element );
36  et.Dump(out);
37  if( et.trackType(PFBlockElement::T_FROM_DISP) ) out<<" from displaced;";
38  if( et.trackType(PFBlockElement::T_TO_DISP) ) out<<" to displaced;";
39  if( et.trackType(PFBlockElement::T_FROM_GAMMACONV) ) out<<" from gammaconv;";
40  if( et.trackType(PFBlockElement::T_FROM_V0) ) out<<" from v0 decay;";
41  break;
42  }
45  case PFBlockElement::HO:
49  case PFBlockElement::PS2:
50  {
51  const reco::PFBlockElementCluster& ec =
52  dynamic_cast<const reco::PFBlockElementCluster &>( element );
53  ec.Dump(out);
54  break;
55  }
57  {
59  dynamic_cast<const reco::PFBlockElementGsfTrack &>( element );
60  eg.Dump(out);
61  out<<" from gsf;";
62  break;
63  }
65  {
66  const reco::PFBlockElementBrem& em =
67  dynamic_cast<const reco::PFBlockElementBrem &>( element );
68  em.Dump(out);
69  out<<" from brem;";
70  break;
71  }
72  case PFBlockElement::SC:
73  {
75  dynamic_cast<const reco::PFBlockElementSuperCluster &>( element );
76  sc.Dump(out);
77  out<<" from SuperCluster;";
78  break;
79  }
80  default:
81  out<<" unknown type"<<std::endl;
82  break;
83  }
84  }
85  catch( std::exception& err) {
86  out<<err.what()<<std::endl;
87  }
88 
89  return out;
90 }
91 
Abstract base class for a PFBlock element (track, cluster...)
void Dump(std::ostream &out=std::cout, const char *tab=" ") const
print the object inside the element
virtual void Dump(std::ostream &out=std::cout, const char *tab=" ") const
print the object inside the element
void Dump(std::ostream &out=std::cout, const char *tab=" ") const
print the object inside the element
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:71
unsigned index() const
void Dump(std::ostream &out=std::cout, const char *tab=" ") const
print the object inside the element
tuple out
Definition: dbtoconf.py:99
virtual bool trackType(TrackType trType) const
void Dump(std::ostream &out=std::cout, const char *tab=" ") const
print the object inside the element
void Dump(std::ostream &out=std::cout, const char *tab=" ") const
print the object inside the element