CMS 3D CMS Logo

PFBlockElementTrack.cc
Go to the documentation of this file.
6 
7 #include <iomanip>
8 
9 using namespace reco;
10 using namespace std;
11 
13  : PFBlockElement(TRACK), trackRefPF_(ref), trackRef_(ref->trackRef()), trackType_(0) {
14  if (ref.isNull())
15  throw cms::Exception("NullRef") << " PFBlockElementTrack constructed from a null reference to PFRecTrack.";
16 
17  const reco::PFTrajectoryPoint& atECAL = ref->extrapolatedPoint(reco::PFTrajectoryPoint::ECALEntrance);
18 
19  if (atECAL.isValid())
20  positionAtECALEntrance_.SetCoordinates(atECAL.position().x(), atECAL.position().y(), atECAL.position().z());
21  // if the position at ecal entrance is invalid,
22  // positionAtECALEntrance_ is initialized by default to 0,0,0
23 
24  setTrackType(DEFAULT, true);
25 }
26 
27 void PFBlockElementTrack::Dump(ostream& out, const char* tab) const {
28  if (!out)
29  return;
30 
31  if (!trackRef_.isNull()) {
32  double charge = trackRef_->charge();
33  double pt = trackRef_->pt();
34  double p = trackRef_->p();
35  string s = " at vertex";
36  double tracketa = trackRef_->eta();
37  double trackphi = trackRef_->phi();
38 
39  // COLIN
40  // the following lines rely on the presence of the PFRecTrack,
41  // which for most people is not there (PFRecTracks are transient)
42  // commented these lines out to remove the spurious error message
43  // for the missing PFRecTrack product
44  // const reco::PFTrajectoryPoint& atECAL
45  // = trackRefPF_->extrapolatedPoint( reco::PFTrajectoryPoint::ECALShowerMax );
46  // // check if reach ecal Shower max
47  // if( atECAL.isValid() ) {
48  // s = " at ECAL shower max";
49  // tracketa = atECAL.position().Eta();
50  // trackphi = atECAL.position().Phi();
51  // }
52 
53  out << setprecision(0);
54  out << tab << setw(7) << "charge=" << setw(3) << charge;
55  out << setprecision(3);
56  out << setiosflags(ios::right);
57  out << setiosflags(ios::fixed);
58  out << ", pT =" << setw(7) << pt;
59  out << ", p =" << setw(7) << p;
60  out << " (eta,phi)= (";
61  out << tracketa << ",";
62  out << trackphi << ")" << s;
63 
64  out << resetiosflags(ios::right | ios::fixed);
65  }
66 }
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
reco::PFBlockElementTrack::trackRef_
reco::TrackRef trackRef_
reference to the corresponding track
Definition: PFBlockElementTrack.h:113
reco::PFBlockElementTrack::setTrackType
void setTrackType(TrackType trType, bool value) override
\set the trackType
Definition: PFBlockElementTrack.h:31
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Ref< PFRecTrackCollection >
reco::PFBlockElementTrack::Dump
void Dump(std::ostream &out=std::cout, const char *tab=" ") const override
print the object inside the element
Definition: PFBlockElementTrack.cc:27
alignCSCRings.s
s
Definition: alignCSCRings.py:92
Track.h
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
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::PFTrajectoryPoint
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
Definition: PFTrajectoryPoint.h:26
reco::PFBlockElementTrack::positionAtECALEntrance_
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance
Definition: PFBlockElementTrack.h:118
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
cms::Exception
Definition: Exception.h:70
PFBlockElementTrack.h
reco::PFBlockElementTrack::PFBlockElementTrack
PFBlockElementTrack()
Definition: PFBlockElementTrack.h:19
PFTrajectoryPoint.h