Skip to content

Commit

Permalink
replace 1e-6 with zero
Browse files Browse the repository at this point in the history
  • Loading branch information
syuvivida committed Jan 30, 2017
1 parent 4350f79 commit 65ba14d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions SimDataFormats/GeneratorProducts/src/GenFilterInfo.cc
Expand Up @@ -86,7 +86,7 @@ double GenFilterInfo::filterEfficiency(int idwtup) const {
eff = numEventsTotal() > 0 ? (double) numEventsPassed() / (double) numEventsTotal(): -1;
break;
default:
eff = sumWeights() > 1e-6? sumPassWeights()/sumWeights(): -1;
eff = sumWeights() > 0? sumPassWeights()/sumWeights(): -1;
break;
}
return eff;
Expand All @@ -99,14 +99,14 @@ double GenFilterInfo::filterEfficiencyError(int idwtup) const {
switch(idwtup) {
case 3: case -3:
{
double effp = numTotalPositiveEvents() > 1e-6?
double effp = numTotalPositiveEvents() > 0?
(double)numPassPositiveEvents()/(double)numTotalPositiveEvents():0;
double effp_err2 = numTotalPositiveEvents() > 1e-6?
double effp_err2 = numTotalPositiveEvents() > 0?
(1-effp)*effp/(double)numTotalPositiveEvents(): 0;

double effn = numTotalNegativeEvents() > 1e-6?
double effn = numTotalNegativeEvents() > 0?
(double)numPassNegativeEvents()/(double)numTotalNegativeEvents():0;
double effn_err2 = numTotalNegativeEvents() > 1e-6?
double effn_err2 = numTotalNegativeEvents() > 0?
(1-effn)*effn/(double)numTotalNegativeEvents(): 0;

efferr = numEventsTotal() > 0 ? sqrt (
Expand All @@ -122,7 +122,7 @@ double GenFilterInfo::filterEfficiencyError(int idwtup) const {
double numerator =
sumPassWeights2() * sumFailWeights()* sumFailWeights() +
sumFailWeights2() * sumPassWeights()* sumPassWeights();
efferr = denominator>1e-6?
efferr = denominator>0?
sqrt(numerator/denominator):-1;
break;
}
Expand Down

0 comments on commit 65ba14d

Please sign in to comment.