CMS 3D CMS Logo

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  {
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  }
54  case PFBlockElement::HO:
58  case PFBlockElement::PS2:
59  {
61  dynamic_cast<const reco::PFBlockElementCluster &>( element );
62  ec.Dump(out);
63  break;
64  }
66  {
68  dynamic_cast<const reco::PFBlockElementGsfTrack &>( element );
69  eg.Dump(out);
70  out<<" from gsf;";
71  break;
72  }
74  {
75  const reco::PFBlockElementBrem& em =
76  dynamic_cast<const reco::PFBlockElementBrem &>( element );
77  em.Dump(out);
78  out<<" from brem;";
79  break;
80  }
81  case PFBlockElement::SC:
82  {
84  dynamic_cast<const reco::PFBlockElementSuperCluster &>( element );
85  sc.Dump(out);
86  out<<" from SuperCluster;";
87  break;
88  }
89  default:
90  out<<" unknown type"<<std::endl;
91  break;
92  }
93  }
94  catch( std::exception& err) {
95  out<<err.what()<<std::endl;
96  }
97 
98  return out;
99 }
100 
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_
Type type() const
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_
static const ConversionRefVector nullConv_
virtual bool trackType(TrackType trType) const
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
et
define resolution functions of each parameter
static const reco::TrackRef nullTrack_
void Dump(std::ostream &out=std::cout, const char *tab=" ") const
print the object inside the element
fixed size matrix
void Dump(std::ostream &out=std::cout, const char *tab=" ") const
print the object inside the element
static const VertexCompositeCandidateRef nullVertex_