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 }
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
reco::PFBlockElementGsfTrack::GsftrackRefPF_
GsfPFRecTrackRef GsftrackRefPF_
reference to the corresponding GSF track (transient)
Definition: PFBlockElementGsfTrack.h:59
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
reco::PFBlockElementGsfTrack::Pin_
math::XYZTLorentzVector Pin_
The CorrespondingKFTrackRef is needeed.
Definition: PFBlockElementGsfTrack.h:65
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::PFBlockElementGsfTrack::Pout_
math::XYZTLorentzVector Pout_
Definition: PFBlockElementGsfTrack.h:66
edm::Ref< GsfPFRecTrackCollection >
Track.h
reco::PFBlockElementGsfTrack::PFBlockElementGsfTrack
PFBlockElementGsfTrack()
Definition: PFBlockElementGsfTrack.h:20
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
reco::PFTrajectoryPoint::position
const math::XYZPoint & position() const
cartesian position (x, y, z)
Definition: PFTrajectoryPoint.h:100
reco::PFBlockElement::DEFAULT
Definition: PFBlockElement.h:47
reco::PFBlockElementGsfTrack::setTrackType
void setTrackType(TrackType trType, bool value) override
\set the trackType
Definition: PFBlockElementGsfTrack.h:34
PFRecTrack.h
reco::PFTrajectoryPoint::isValid
bool isValid() const
is this point valid ?
Definition: PFTrajectoryPoint.h:84
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition: PFBlockElement.h:26
reco::PFTrajectoryPoint::ECALEntrance
ECAL front face.
Definition: PFTrajectoryPoint.h:43
std
Definition: JetResolutionObject.h:76
Ref.h
reco::PFBlockElementGsfTrack::positionAtECALEntrance_
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance
Definition: PFBlockElementGsfTrack.h:70
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
reco::PFTrajectoryPoint
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
Definition: PFTrajectoryPoint.h:26
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
reco::PFBlockElementGsfTrack::Dump
void Dump(std::ostream &out=std::cout, const char *tab=" ") const override
print the object inside the element
Definition: PFBlockElementGsfTrack.cc:30
cms::Exception
Definition: Exception.h:70
PFBlockElementGsfTrack.h
PFTrajectoryPoint.h