Fork me on GitHub

Changeset 410f3a2 in git


Ignore:
Timestamp:
Sep 16, 2015, 12:42:15 AM (9 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
a097e98
Parents:
93da593
Message:

fixed charge variable in JetFakeParticle module

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/JetFakeParticle.cc

    r93da593 r410f3a2  
    176176        if(TMath::Abs(pdgCodeOut) == 11 || TMath::Abs(pdgCodeOut) == 13)
    177177        {
    178           // for electrons and muons fake use the jet charge (if non-zero, otherwise randomly assign sign)
    179 
    180178          if(candidate->Charge != 0)
    181179          {
    182             fake->PID = -(candidate->Charge)*TMath::Abs(pdgCodeOut);
     180            fake->Charge = candidate->Charge/TMath::Abs(candidate->Charge);
    183181          }
    184182          else
    185183          {
    186184            rs = gRandom->Uniform();
    187             fake->PID = (rs < 0.5) ? -TMath::Abs(pdgCodeOut) : TMath::Abs(pdgCodeOut);
     185            fake->Charge = (rs < 0.5) ? -1 : 1;
     186           
    188187          }
    189188        }
Note: See TracChangeset for help on using the changeset viewer.