From a226a6b63973438706f44c77b7725bb7d9fa9bd7 Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 14 Mar 2017 09:12:18 +0100 Subject: [PATCH] Bug fix propagation of recontructed tracks not taking into account the charge --- HGCalAnalysis/interface/AObData.h | 7 ++++--- HGCalAnalysis/plugins/HGCalAnalysis.cc | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/HGCalAnalysis/interface/AObData.h b/HGCalAnalysis/interface/AObData.h index e8046d1689f8a..c2eb61e87a553 100644 --- a/HGCalAnalysis/interface/AObData.h +++ b/HGCalAnalysis/interface/AObData.h @@ -263,10 +263,10 @@ class ACaloParticle : public TObject class ATrack : public TObject { public: - ATrack() : pt(0), eta(0), phi(0), energy(0) + ATrack() : pt(0), eta(0), phi(0), energy(0), charge(0) {} - ATrack(float i_pt, float i_eta, float i_phi, float i_energy): - pt(i_pt), eta(i_eta), phi(i_phi), energy(i_energy) + ATrack(float i_pt, float i_eta, float i_phi, float i_energy, int i_charge): + pt(i_pt), eta(i_eta), phi(i_phi), energy(i_energy), charge(i_charge) {} @@ -280,6 +280,7 @@ class ATrack : public TObject } float pt, eta, phi, energy; + int charge; std::vector posx; std::vector posy; std::vector posz; diff --git a/HGCalAnalysis/plugins/HGCalAnalysis.cc b/HGCalAnalysis/plugins/HGCalAnalysis.cc index 8dd04e7c40a13..681713da6f700 100644 --- a/HGCalAnalysis/plugins/HGCalAnalysis.cc +++ b/HGCalAnalysis/plugins/HGCalAnalysis.cc @@ -708,7 +708,7 @@ HGCalAnalysis::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) Plane::PlanePointer startingPlane = Plane::build( Plane::PositionType (it_track->vx(),it_track->vy(),it_track->vz()), Plane::RotationType () ); - TSOS startingStateP(GlobalTrajectoryParameters(startingPosition,startingMomentum, 1, aField), err, *startingPlane); + TSOS startingStateP(GlobalTrajectoryParameters(startingPosition,startingMomentum, it_track->charge(), aField), err, *startingPlane); for(unsigned il=0;il3 // save info in tree - ATrack thistrack(it_track->pt(),it_track->eta(),it_track->phi(),energy); + ATrack thistrack(it_track->pt(),it_track->eta(),it_track->phi(),energy,it_track->charge()); thistrack.setExtrapolations(xp,yp,zp); atrc->push_back(thistrack);