Skip to content

Commit

Permalink
Merge pull request #16632 from dildick/fix-ME0-pseudo-digi-bx-mixing-…
Browse files Browse the repository at this point in the history
…window

ME0 pseudo digitizer: Fix the BX mixing window + enable bkg scaling with lumi
  • Loading branch information
cmsbuild committed Nov 24, 2016
2 parents 63a8566 + c0408bf commit 1e597a6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions SimMuon/GEMDigitizer/interface/ME0PreRecoGaussianModel.h
Expand Up @@ -46,6 +46,8 @@ class ME0PreRecoGaussianModel: public ME0DigiPreRecoModel
int minBunch_;
int maxBunch_;

double instLumi_;

// params for the simple pol6 model of neutral bkg for ME0:
std::vector<double> neuBkg, eleBkg;

Expand Down
1 change: 1 addition & 0 deletions SimMuon/GEMDigitizer/python/muonME0DigisPreReco_cfi.py
Expand Up @@ -19,5 +19,6 @@
simulateNeutralBkg = cms.bool(True), # True - will simulate neutral (n+g) background
minBunch = cms.int32(-5), # [x 25 ns], forms the readout window together with maxBunch,
maxBunch = cms.int32(3), # we should think of shrinking this window ...
instLumi = cms.double(5.0), # in units of 1E34 cm^-2 s^-1
mixLabel = cms.string('mix'),
)
16 changes: 12 additions & 4 deletions SimMuon/GEMDigitizer/src/ME0PreRecoGaussianModel.cc
Expand Up @@ -33,9 +33,11 @@ ME0PreRecoGaussianModel::ME0PreRecoGaussianModel(const edm::ParameterSet& config
simulateElectronBkg_(config.getParameter<bool>("simulateElectronBkg")),
simulateNeutralBkg_(config.getParameter<bool>("simulateNeutralBkg")),
minBunch_(config.getParameter<int>("minBunch")),
maxBunch_(config.getParameter<int>("maxBunch"))
maxBunch_(config.getParameter<int>("maxBunch")),
instLumi_(config.getParameter<double>("instLumi"))
{
// polynomial parametrisation of neutral (n+g) and electron background
// This is the background for an Instantaneous Luminosity of L = 5E34 cm^-2 s^-1
neuBkg.push_back(899644.0); neuBkg.push_back(-30841.0); neuBkg.push_back(441.28);
neuBkg.push_back(-3.3405); neuBkg.push_back(0.0140588); neuBkg.push_back(-3.11473e-05); neuBkg.push_back(2.83736e-08);
eleBkg.push_back(4.68590e+05); eleBkg.push_back(-1.63834e+04); eleBkg.push_back(2.35700e+02);
Expand All @@ -53,8 +55,8 @@ for (const auto & hit: simHits)
// Digitize only Muons?
if (std::abs(hit.particleType()) != 13 && digitizeOnlyMuons_) continue;
// Digitize only in [minBunch,maxBunch] window
// window is: [(2n-1)*bxw/2, (2n+1)*bxw/2], n = [minBunch, maxBunch]
if(hit.timeOfFlight() < (2*minBunch_-1)*bxwidth*1.0/2 || hit.timeOfFlight() > (2*maxBunch_+1)*bxwidth*1.0/2) continue;
// window is: [(2n+1)*bxw/2, (2n+3)*bxw/2], n = [minBunch, maxBunch]
if(hit.timeOfFlight() < (2*minBunch_+1)*bxwidth*1.0/2 || hit.timeOfFlight() > (2*maxBunch_+3)*bxwidth*1.0/2) continue;
// is GEM efficient?
if (CLHEP::RandFlat::shoot(engine) > averageEfficiency_) continue;
// create digi
Expand Down Expand Up @@ -161,7 +163,10 @@ void ME0PreRecoGaussianModel::simulateNoise(const ME0EtaPartition* roll, CLHEP::
double averageElectronRatePerRoll = 0.0;
double yy_helper = 1.0;
for(int j=0; j<7; ++j) { averageElectronRatePerRoll += eleBkg[j]*yy_helper; yy_helper *= yy_glob; }


// Scale up/down for desired instantaneous lumi (reference is 5E34, double from config is in units of 1E34)
averageElectronRatePerRoll *= instLumi_*1.0/5;

// Rate [Hz/cm^2] * Nbx * 25*10^-9 [s] * Area [cm] = # hits in this roll in this bx
const double averageElecRate(averageElectronRatePerRoll * (maxBunch_-minBunch_+1)*(bxwidth*1.0e-9) * areaIt);

Expand Down Expand Up @@ -209,6 +214,9 @@ void ME0PreRecoGaussianModel::simulateNoise(const ME0EtaPartition* roll, CLHEP::
double averageNeutralRatePerRoll = 0.0;
double yy_helper = 1.0;
for(int j=0; j<7; ++j) { averageNeutralRatePerRoll += neuBkg[j]*yy_helper; yy_helper *= yy_glob; }

// Scale up/down for desired instantaneous lumi (reference is 5E34, double from config is in units of 1E34)
averageNeutralRatePerRoll *= instLumi_*1.0/5;

// Rate [Hz/cm^2] * Nbx * 25*10^-9 [s] * Area [cm] = # hits in this roll
const double averageNeutrRate(averageNeutralRatePerRoll * (maxBunch_-minBunch_+1)*(bxwidth*1.0e-9) * areaIt);
Expand Down

0 comments on commit 1e597a6

Please sign in to comment.