CMS 3D CMS Logo

PFBlockElementGsfTrack.cc
Go to the documentation of this file.
6 
7 #include <iomanip>
8 
9 using namespace reco;
10 using namespace std;
11 
13  const math::XYZTLorentzVector& Pin,
14  const math::XYZTLorentzVector& Pout)
15  : PFBlockElement(GSF),
16  GsftrackRefPF_(gsfref),
17  GsftrackRef_(gsfref->gsfTrackRef()),
18  Pin_(Pin),
19  Pout_(Pout),
20  trackType_(0) {
21  if (gsfref.isNull())
22  throw cms::Exception("NullRef") << " PFBlockElementGsfTrack constructed from a null reference to PFGsfRecTrack.";
23  const reco::PFTrajectoryPoint& atECAL = gsfref->extrapolatedPoint(reco::PFTrajectoryPoint::ECALEntrance);
24  if (atECAL.isValid())
25  positionAtECALEntrance_.SetCoordinates(atECAL.position().x(), atECAL.position().y(), atECAL.position().z());
26 
27  setTrackType(DEFAULT, true);
28 }
29 
30 void PFBlockElementGsfTrack::Dump(ostream& out, const char* tab) const {
31  if (!out)
32  return;
33 
34  if (!GsftrackRefPF_.isNull()) {
35  // double charge = trackPF().charge;
36  double charge = GsftrackRefPF_->charge();
39  double ptin = pin.pt();
40  double etain = pin.eta();
41  double phiin = pin.phi();
42  double ptout = pout.pt();
43  double etaout = pout.eta();
44  double phiout = pout.phi();
45  out << setprecision(0);
46  out << tab << setw(7) << "charge=" << setw(3) << charge;
47  out << setprecision(3);
48  out << setiosflags(ios::right);
49  out << setiosflags(ios::fixed);
50  out << ", Inner pT =" << setw(7) << ptin;
51  out << " Inner (eta,phi)= (";
52  out << etain << ",";
53  out << phiin << ")";
54  out << ", Outer pT =" << setw(7) << ptout;
55  out << " Outer (eta,phi)= (";
56  out << etaout << ",";
57  out << phiout << ")";
58  out << resetiosflags(ios::right | ios::fixed);
59  }
60 }
Abstract base class for a PFBlock element (track, cluster...)
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float charge(ConstView const &tracks, int32_t i)
Definition: TracksSoA.h:73
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
bool isValid() const
is this point valid ?
bool isNull() const
Checks for null.
Definition: Ref.h:229
void Dump(std::ostream &out=std::cout, const char *tab=" ") const override
print the object inside the element
const math::XYZPoint & position() const
cartesian position (x, y, z)
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance
math::XYZTLorentzVector Pin_
The CorrespondingKFTrackRef is needeed.
void setTrackType(TrackType trType, bool value) override
the trackType
fixed size matrix
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
GsfPFRecTrackRef GsftrackRefPF_
reference to the corresponding GSF track (transient)