Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Commit

Permalink
This fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-popov committed Jan 14, 2014
1 parent 771bb58 commit ba0dca2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
8 changes: 7 additions & 1 deletion core/include/PECReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,13 @@ class PECReader
*/
bool BuildAndSelectEvent();

/// Calculate event weights (including systematics)
/**
* \brief Calculate event weights (including systematics)
*
* The method is called for both simulation and real data. However, only trigger weight is
* evaluated in the latter case; it is needed to allow an additional event selection via
* TriggerRange::PassEventSelection.
*/
void CalculateEventWeights();

/// Stores particles from the hard interaction in hardParticles collection
Expand Down
14 changes: 13 additions & 1 deletion core/src/PECReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,21 @@ bool PECReader::BuildAndSelectEvent()

void PECReader::CalculateEventWeights()
{
// Calculate different components of an event weight
// Calculate weight due to trigger selection. This is the only event weight that can make
//sense for real data (e.g. if there is an additional selection specified in a TriggerRange
//object). However, with real data this weight is either 0. or 1.
double const weightTrigger = (triggerSelection) ? triggerSelection->GetWeight(*this) : 1.;

if (not dataset.IsMC())
{
// Don't forget to update the central weight
weightCentral = weightTrigger;

return;
}


// Reweighting for the pile-up
WeightPileUpInterface::Weights weightPileUp;

if (puReweighter)
Expand All @@ -690,6 +701,7 @@ void PECReader::CalculateEventWeights()
weightPileUp.Set(1., 1., 1.);


// Reweighting for b-tagging
double const weightBTagging =
(bTagReweighter) ? bTagReweighter->CalcWeight(goodJets, WeightBTag::Variation::Central) : 1.;

Expand Down

0 comments on commit ba0dca2

Please sign in to comment.