Fork me on GitHub

Changeset 1268 in svn for trunk/modules


Ignore:
Timestamp:
Aug 19, 2013, 3:53:30 PM (11 years ago)
Author:
Pavel Demin
Message:

added PileUpDistribution parameter to the PileUpMerger module

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/PileUpMerger.cc

    r1111 r1268  
    5757  const char *fileName;
    5858
     59  fPileUpDistribution = GetInt("PileUpDistribution", 0);
     60
    5961  fMeanPileUp  = GetDouble("MeanPileUp", 10);
    6062  fZVertexSpread = GetDouble("ZVertexSpread", 0.05)*1.0E3;
     
    8890  Float_t px, py, pz, e;
    8991  Double_t dz, dphi;
    90   Int_t poisson, event;
     92  Int_t numberOfEvents, event;
    9193  Long64_t allEntries, entry;
    9294  Candidate *candidate;
     
    101103  factory = GetFactory();
    102104
    103   poisson = gRandom->Poisson(fMeanPileUp);
     105  switch(fPileUpDistribution)
     106  {
     107    case 0:
     108      numberOfEvents = gRandom->Poisson(fMeanPileUp);
     109      break;
     110    case 1:
     111      numberOfEvents = gRandom->Integer(2*fMeanPileUp + 1);
     112      break;
     113    default:
     114      numberOfEvents = gRandom->Poisson(fMeanPileUp);
     115      break;
     116  }
    104117
    105118  allEntries = fReader->GetEntries();
    106119
    107   for(event = 0; event < poisson; ++event)
     120  for(event = 0; event < numberOfEvents; ++event)
    108121  {
    109122    do
Note: See TracChangeset for help on using the changeset viewer.