CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFBlockElementGsfTrack.cc
Go to the documentation of this file.
6 
7 #include <iomanip>
8 
9 using namespace reco;
10 using namespace std;
11 
12 
14  const math::XYZTLorentzVector& Pin,
15  const math::XYZTLorentzVector& Pout ) :
16  PFBlockElement( GSF ),
17  GsftrackRefPF_( gsfref ),
18  GsftrackRef_( gsfref->gsfTrackRef() ),
19  Pin_(Pin),
20  Pout_(Pout),
21  trackType_(0){
22 
23  if(gsfref.isNull() )
24  throw cms::Exception("NullRef")
25  <<" PFBlockElementGsfTrack constructed from a null reference to PFGsfRecTrack.";
26  const reco::PFTrajectoryPoint& atECAL
27  = gsfref->extrapolatedPoint( reco::PFTrajectoryPoint::ECALEntrance );
28  if( atECAL.isValid() )
29  positionAtECALEntrance_.SetCoordinates( atECAL.position().x(),
30  atECAL.position().y(),
31  atECAL.position().z() );
32 
33 
34  setTrackType( DEFAULT, true );
35 }
36 
38  const char* tab ) const {
39 
40  if(! out ) return;
41 
42  if( !GsftrackRefPF_.isNull() ) {
43 
44  // double charge = trackPF().charge;
45  double charge = GsftrackRefPF_->charge();
48  double ptin = pin.pt();
49  double etain = pin.eta();
50  double phiin = pin.phi();
51  double ptout = pout.pt();
52  double etaout = pout.eta();
53  double phiout = pout.phi();
54  out<<setprecision(0);
55  out<<tab<<setw(7)<<"charge="<<setw(3)<<charge;
56  out<<setprecision(3);
57  out<<setiosflags(ios::right);
58  out<<setiosflags(ios::fixed);
59  out<<", Inner pT ="<<setw(7)<<ptin;
60  out<<" Inner (eta,phi)= (";
61  out<< etain <<",";
62  out<< phiin <<")";
63  out<<", Outer pT ="<<setw(7)<<ptout;
64  out<<" Outer (eta,phi)= (";
65  out<< etaout <<",";
66  out<< phiout <<")";
67  out<<resetiosflags(ios::right|ios::fixed); }
68 
69 }
70 
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
const math::XYZPoint & position() const
cartesian position (x, y, z)
double charge(const std::vector< uint8_t > &Ampls)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
bool isNull() const
Checks for null.
Definition: Ref.h:247
tuple tab
Definition: accesses.py:4
virtual void setTrackType(TrackType trType, bool value)
the trackType
tuple out
Definition: dbtoconf.py:99
math::XYZPointF positionAtECALEntrance_
position at ECAL entrance
bool isValid() const
is this point valid ?
math::XYZTLorentzVector Pin_
The CorrespondingKFTrackRef is needeed.
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)