Fork me on GitHub

Changeset b3bd4d2 in git for modules/MomentumSmearing.cc


Ignore:
Timestamp:
Aug 25, 2016, 4:30:15 PM (8 years ago)
Author:
Alexandre Mertens <alexandre.mertens@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
eceb415
Parents:
629e819 (diff), bc58cf5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'dev_01' of https://github.com/delphes/delphes into ValidationWorkWithPavel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/MomentumSmearing.cc

    r629e819 rb3bd4d2  
    109109
    110110    // apply smearing formula
    111     pt = gRandom->Gaus(pt, fFormula->Eval(pt, eta, phi, e) * pt);
     111    //pt = gRandom->Gaus(pt, fFormula->Eval(pt, eta, phi, e) * pt);
     112    pt = LogNormal(pt, fFormula->Eval(pt, eta, phi, e) * pt );
    112113   
    113     if(pt <= 0.0) continue;
     114    //if(pt <= 0.0) continue;
    114115
    115116    mother = candidate;
     
    124125  }
    125126}
     127//----------------------------------------------------------------
     128
     129Double_t MomentumSmearing::LogNormal(Double_t mean, Double_t sigma)
     130{
     131  Double_t a, b;
     132
     133  if(mean > 0.0)
     134  {
     135    b = TMath::Sqrt(TMath::Log((1.0 + (sigma*sigma)/(mean*mean))));
     136    a = TMath::Log(mean) - 0.5*b*b;
     137
     138    return TMath::Exp(a + b*gRandom->Gaus(0.0, 1.0));
     139  }
     140  else
     141  {
     142    return 0.0;
     143  }
     144}
     145
    126146
    127147//------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.