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  }
48  case PFBlockElement::PS2:
49  {
50  const reco::PFBlockElementCluster& ec =
51  dynamic_cast<const reco::PFBlockElementCluster &>( element );
52  ec.Dump(out);
53  break;
54  }
56  {
58  dynamic_cast<const reco::PFBlockElementGsfTrack &>( element );
59  eg.Dump(out);
60  out<<" from gsf;";
61  break;
62  }
64  {
65  const reco::PFBlockElementBrem& em =
66  dynamic_cast<const reco::PFBlockElementBrem &>( element );
67  em.Dump(out);
68  out<<" from brem;";
69  break;
70  }
71  case PFBlockElement::SC:
72  {
74  dynamic_cast<const reco::PFBlockElementSuperCluster &>( element );
75  sc.Dump(out);
76  out<<" from SuperCluster;";
77  break;
78  }
79  default:
80  out<<" unknown type"<<std::endl;
81  break;
82  }
83  }
84  catch( std::exception& err) {
85  out<<err.what()<<std::endl;
86  }
87 
88  return out;
89 }
90 
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:72
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