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 
16 
17 using namespace reco;
18 
19 // int PFBlockElement::instanceCounter_ = 0;
20 
21 // int PFBlockElement::instanceCounter() {
22 // return instanceCounter_;
23 // }
24 
25 void PFBlockElement::Dump(std::ostream& out,
26  const char* pad) const {
27  if(!out) return;
28  out<<pad<<"base element";
29 }
30 
31 std::ostream& reco::operator<<( std::ostream& out,
32  const PFBlockElement& element ) {
33 
34  if(! out) return out;
35 
36  out<<"element "<<element.index()<<"- type "<<element.type_<<" ";
37 
38  try {
39  switch(element.type_) {
41  {
42  const reco::PFBlockElementTrack& et =
43  dynamic_cast<const reco::PFBlockElementTrack &>( element );
44  et.Dump(out);
45  if( et.trackType(PFBlockElement::T_FROM_DISP) ) out<<" from displaced;";
46  if( et.trackType(PFBlockElement::T_TO_DISP) ) out<<" to displaced;";
47  if( et.trackType(PFBlockElement::T_FROM_GAMMACONV) ) out<<" from gammaconv;";
48  if( et.trackType(PFBlockElement::T_FROM_V0) ) out<<" from v0 decay;";
49  break;
50  }
53  case PFBlockElement::HO:
57  case PFBlockElement::PS2:
58  {
59  const reco::PFBlockElementCluster& ec =
60  dynamic_cast<const reco::PFBlockElementCluster &>( element );
61  ec.Dump(out);
62  break;
63  }
65  {
67  dynamic_cast<const reco::PFBlockElementGsfTrack &>( element );
68  eg.Dump(out);
69  out<<" from gsf;";
70  break;
71  }
73  {
74  const reco::PFBlockElementBrem& em =
75  dynamic_cast<const reco::PFBlockElementBrem &>( element );
76  em.Dump(out);
77  out<<" from brem;";
78  break;
79  }
80  case PFBlockElement::SC:
81  {
83  dynamic_cast<const reco::PFBlockElementSuperCluster &>( element );
84  sc.Dump(out);
85  out<<" from SuperCluster;";
86  break;
87  }
88  default:
89  out<<" unknown type"<<std::endl;
90  break;
91  }
92  }
93  catch( std::exception& err) {
94  out<<err.what()<<std::endl;
95  }
96 
97  return out;
98 }
99 
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
edm::RefVector< ConversionCollection > ConversionRefVector
vector of objects in the same collection of Conversion objects
Definition: ConversionFwd.h:21
static const MuonRef nullMuon_
static const PFRecTrackRef nullPFRecTrack_
static const PFDisplacedTrackerVertexRef nullPFDispVertex_
edm::Ref< VertexCompositeCandidateCollection > VertexCompositeCandidateRef
persistent reference to an object in a collection of Candidate objects
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:71
unsigned index() const
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
Definition: PFClusterFwd.h:15
edm::Ref< PFRecTrackCollection > PFRecTrackRef
persistent reference to PFRecTrack objects
Definition: PFRecTrackFwd.h:15
edm::Ref< PFDisplacedTrackerVertexCollection > PFDisplacedTrackerVertexRef
persistent reference to a DisplacedTrackerVertex
edm::Ref< MuonCollection > MuonRef
presistent reference to a Muon
Definition: MuonFwd.h:13
void Dump(std::ostream &out=std::cout, const char *tab=" ") const
print the object inside the element
static const PFClusterRef nullPFCluster_
tuple out
Definition: dbtoconf.py:99
static const ConversionRefVector nullConv_
virtual bool trackType(TrackType trType) const
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
static const reco::TrackRef nullTrack_
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
static const VertexCompositeCandidateRef nullVertex_