CMS 3D CMS Logo

PFBlockElement.cc
Go to the documentation of this file.
7 
15 
16 using namespace reco;
17 
18 // int PFBlockElement::instanceCounter_ = 0;
19 
20 // int PFBlockElement::instanceCounter() {
21 // return instanceCounter_;
22 // }
23 
24 void PFBlockElement::Dump(std::ostream& out, const char* pad) const {
25  if (!out)
26  return;
27  out << pad << "base element";
28 }
29 
30 std::ostream& reco::operator<<(std::ostream& out, const PFBlockElement& element) {
31  if (!out)
32  return out;
33 
34  out << "element " << element.index() << "- type " << element.type() << " ";
35 
36  try {
37  switch (element.type()) {
38  case PFBlockElement::TRACK: {
39  const reco::PFBlockElementTrack& et = dynamic_cast<const reco::PFBlockElementTrack&>(element);
40  et.Dump(out);
41  if (et.trackType(PFBlockElement::T_FROM_DISP))
42  out << " from displaced;";
43  if (et.trackType(PFBlockElement::T_TO_DISP))
44  out << " to displaced;";
45  if (et.trackType(PFBlockElement::T_FROM_GAMMACONV))
46  out << " from gammaconv;";
47  if (et.trackType(PFBlockElement::T_FROM_V0))
48  out << " from v0 decay;";
49  break;
50  }
54  case PFBlockElement::HO:
58  case PFBlockElement::PS2: {
59  const reco::PFBlockElementCluster& ec = dynamic_cast<const reco::PFBlockElementCluster&>(element);
60  ec.Dump(out);
61  break;
62  }
63  case PFBlockElement::GSF: {
64  const reco::PFBlockElementGsfTrack& eg = dynamic_cast<const reco::PFBlockElementGsfTrack&>(element);
65  eg.Dump(out);
66  out << " from gsf;";
67  break;
68  }
69  case PFBlockElement::BREM: {
70  const reco::PFBlockElementBrem& em = dynamic_cast<const reco::PFBlockElementBrem&>(element);
71  em.Dump(out);
72  out << " from brem;";
73  break;
74  }
75  case PFBlockElement::SC: {
76  const reco::PFBlockElementSuperCluster& sc = dynamic_cast<const reco::PFBlockElementSuperCluster&>(element);
77  sc.Dump(out);
78  out << " from SuperCluster;";
79  break;
80  }
81  default:
82  out << " unknown type" << std::endl;
83  break;
84  }
85  } catch (std::exception& err) {
86  out << err.what() << std::endl;
87  }
88 
89  return out;
90 }
Abstract base class for a PFBlock element (track, cluster...)
edm::RefVector< ConversionCollection > ConversionRefVector
vector of objects in the same collection of Conversion objects
Definition: ConversionFwd.h:21
static const MuonRef nullMuon_
void Dump(std::ostream &out=std::cout, const char *tab=" ") const override
print the object inside the element
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:66
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
Definition: PFClusterFwd.h:15
unsigned index() const
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
static const PFClusterRef nullPFCluster_
static const ConversionRefVector nullConv_
void Dump(std::ostream &out=std::cout, const char *tab=" ") const override
print the object inside the element
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
virtual void Dump(std::ostream &out=std::cout, const char *tab=" ") const
print the object inside the element
static const reco::TrackRef nullTrack_
fixed size matrix
static const VertexCompositeCandidateRef nullVertex_
void Dump(std::ostream &out=std::cout, const char *tab=" ") const override
print the object inside the element
void Dump(std::ostream &out=std::cout, const char *tab=" ") const override
print the object inside the element