Fork me on GitHub

Changes in / [629e819:b3bd4d2] in git


Ignore:
Location:
modules
Files:
2 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//------------------------------------------------------------------------------
  • modules/MomentumSmearing.h

    r629e819 rb3bd4d2  
    4747private:
    4848
     49  Double_t LogNormal(Double_t mean, Double_t sigma);
     50
    4951  DelphesFormula *fFormula; //!
    5052
Note: See TracChangeset for help on using the changeset viewer.