Skip to content

Commit

Permalink
Merge pull request #20 from malgeri/tracking_studies
Browse files Browse the repository at this point in the history
Bug fix propagation of reconstructed tracks (charge!)
  • Loading branch information
clelange authored Mar 20, 2017
2 parents 1aabc5a + a226a6b commit 2af7a22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions HGCalAnalysis/interface/AObData.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{}


Expand All @@ -280,6 +280,7 @@ class ATrack : public TObject
}

float pt, eta, phi, energy;
int charge;
std::vector<float> posx;
std::vector<float> posy;
std::vector<float> posz;
Expand Down
4 changes: 2 additions & 2 deletions HGCalAnalysis/plugins/HGCalAnalysis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,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;il<layerPositions.size();++il) {
float xp_curr=0;
Expand Down Expand Up @@ -745,7 +745,7 @@ HGCalAnalysis::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
} // closes conditions pt>3

// 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);

Expand Down

0 comments on commit 2af7a22

Please sign in to comment.