Skip to content

Commit

Permalink
Merge pull request #23 from beaudett/topic-propagationfix-fbrem
Browse files Browse the repository at this point in the history
fbrem and propagation fix

Will leave #22 in conflict, which will need updating
  • Loading branch information
clelange committed May 4, 2017
2 parents 2af7a22 + ad35074 commit 117832d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
8 changes: 5 additions & 3 deletions HGCalAnalysis/interface/AObData.h
Expand Up @@ -8,12 +8,13 @@ class AGenPart : public TObject
{
public:

AGenPart(): eta(-1000.),phi(-1000.),pt(-1000.),energy(-1000.),dvx(0.),dvy(0.),dvz(0.),pid(0),gen(-1),reachedEE(-1)
AGenPart(): eta(-1000.),phi(-1000.),pt(-1000.),energy(-1000.),dvx(0.),dvy(0.),dvz(0.),fbrem(-1.),pid(0),gen(-1),reachedEE(-1)
{
}
AGenPart(float i_eta, float i_phi, float i_pt, float i_energy,
float i_dvx, float i_dvy,float i_dvz, int i_pid,int i_gen=-1,int i_reachedEE=-1, bool i_fromBeamPipe=true) :
eta(i_eta),phi(i_phi),pt(i_pt),energy(i_energy),dvx(i_dvx),dvy(i_dvy),dvz(i_dvz),pid(i_pid),gen(i_gen),reachedEE(i_reachedEE),fromBeamPipe(i_fromBeamPipe)
float i_dvx, float i_dvy,float i_dvz, float i_fbrem, int i_pid,int i_gen=-1,int i_reachedEE=-1, bool i_fromBeamPipe=true) :
eta(i_eta),phi(i_phi),pt(i_pt),energy(i_energy),dvx(i_dvx),dvy(i_dvy),dvz(i_dvz),fbrem(i_fbrem), pid(i_pid),gen(i_gen),reachedEE(i_reachedEE),
fromBeamPipe(i_fromBeamPipe)
{
}

Expand All @@ -30,6 +31,7 @@ class AGenPart : public TObject
float dvx;
float dvy;
float dvz;
float fbrem;
int pid;
int gen;
int reachedEE;
Expand Down
11 changes: 9 additions & 2 deletions HGCalAnalysis/plugins/HGCalAnalysis.cc
Expand Up @@ -345,11 +345,12 @@ HGCalAnalysis::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
math::XYZTLorentzVectorD vtx(0,0,0,0);

int reachedEE=0; // compute the extrapolations for the particles reaching EE and for the gen particles
double fbrem=-1.;
if (myTrack.noEndVertex() || myTrack.genpartIndex()>=0)
{

RawParticle part(myTrack.momentum(),myTrack.vertex().position());
part.setID(myTrack.id());
part.setID(myTrack.type());
BaseParticlePropagator myPropag(part,160,layerPositions[0],3.8);
myPropag.propagate();
unsigned result=myPropag.getSuccess();
Expand All @@ -359,6 +360,12 @@ HGCalAnalysis::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
if (myTrack.noEndVertex()) {
if (result==2 && vtx.Rho()> 25) {
reachedEE=2;
double dpt=0;

for(int i=0;i<myTrack.nDaughters();++i)
dpt+=myTrack.daughter(i).momentum().pt();
if(abs(myTrack.type())==11)
fbrem = dpt/myTrack.momentum().pt();
}
if (result==1) reachedEE=1;
}
Expand All @@ -381,7 +388,7 @@ HGCalAnalysis::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
vtx = myTrack.endVertex().position();
}

AGenPart part(myTrack.momentum().eta(),myTrack.momentum().phi(),myTrack.momentum().pt(),myTrack.momentum().energy(),vtx.x(),vtx.y(),vtx.z(),myTrack.type(),myTrack.genpartIndex(),reachedEE);
AGenPart part(myTrack.momentum().eta(),myTrack.momentum().phi(),myTrack.momentum().pt(),myTrack.momentum().energy(),vtx.x(),vtx.y(),vtx.z(),fbrem,myTrack.type(),myTrack.genpartIndex(),reachedEE);
part.setExtrapolations(xp,yp,zp);
agpc->push_back(part);
}
Expand Down

0 comments on commit 117832d

Please sign in to comment.