Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:52

0001 #include "DataFormats/ParticleFlowReco/interface/PFBlockElementBrem.h"
0002 #include "DataFormats/ParticleFlowReco/interface/PFRecTrack.h"
0003 #include "DataFormats/Common/interface/Ref.h"
0004 #include "DataFormats/TrackReco/interface/Track.h"
0005 #include "DataFormats/ParticleFlowReco/interface/PFTrajectoryPoint.h"
0006 
0007 #include <iomanip>
0008 
0009 using namespace reco;
0010 using namespace std;
0011 
0012 PFBlockElementBrem::PFBlockElementBrem(const GsfPFRecTrackRef& gsfref,
0013                                        const double DeltaP,
0014                                        const double SigmaDeltaP,
0015                                        const unsigned int indTrajPoint)
0016     : PFBlockElement(BREM),
0017       GsftrackRefPF_(gsfref),
0018       GsftrackRef_(gsfref->gsfTrackRef()),
0019       deltaP_(DeltaP),
0020       sigmadeltaP_(SigmaDeltaP),
0021       indPoint_(indTrajPoint) {
0022   const reco::PFTrajectoryPoint& atECAL =
0023       ((*GsftrackRefPF()).PFRecBrem()[(indPoint_ - 2)]).extrapolatedPoint(reco::PFTrajectoryPoint::ECALEntrance);
0024   if (atECAL.isValid())
0025     positionAtECALEntrance_.SetCoordinates(atECAL.position().x(), atECAL.position().y(), atECAL.position().z());
0026 }
0027 
0028 void PFBlockElementBrem::Dump(ostream& out, const char* tab) const {
0029   if (!out)
0030     return;
0031 
0032   if (!GsftrackRefPF_.isNull()) {
0033     double charge = 0.;
0034     double dp = deltaP_;
0035     double sigmadp = sigmadeltaP_;
0036     int indextrj = (indPoint_ - 2);
0037     out << setprecision(0);
0038     out << tab << setw(7) << "charge=" << setw(3) << charge;
0039     out << setprecision(3);
0040     out << setiosflags(ios::right);
0041     out << setiosflags(ios::fixed);
0042     out << ", DeltaP=  " << dp;
0043     out << ", SigmaDeltaP=  " << sigmadp;
0044     out << ", Traj Point=  " << indextrj;
0045     out << resetiosflags(ios::right | ios::fixed);
0046   }
0047 }