Skip to content

Commit

Permalink
Merge pull request #122 from JeffersonLab/AnalyzeCutAction_Weight
Browse files Browse the repository at this point in the history
add option to do accidental subtraction weighting in AnalyzeCutActions
  • Loading branch information
aaust authored Jun 2, 2020
2 parents 715c7c4 + db8a79c commit 7ba516f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
16 changes: 11 additions & 5 deletions libraries/DSelector/DHistogramActions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ void DHistogramAction_AnalyzeCutActions::Initialize(void)

}

bool DHistogramAction_AnalyzeCutActions::Perform_Action(void)
bool DHistogramAction_AnalyzeCutActions::Perform_Action()
{
double weight = 1.0;
return Perform_ActionWeight(weight);
}

bool DHistogramAction_AnalyzeCutActions::Perform_ActionWeight(double weight = 1.0)
{
bool locComboCut = false;
//double locMass = 0.0;
Expand Down Expand Up @@ -72,16 +78,16 @@ bool DHistogramAction_AnalyzeCutActions::Perform_Action(void)
}

if (locFill)
Fill_Hists(cut_iter.second, locIndexCombos);
Fill_Hists(cut_iter.second, locIndexCombos, weight);
}

if (!locComboCut)
Fill_Hists(dHist_InvariantMass_allcuts, locIndexCombos);
Fill_Hists(dHist_InvariantMass_allcuts, locIndexCombos, weight);

return true;
}

bool DHistogramAction_AnalyzeCutActions::Fill_Hists(TH1I* locHist, set<set<size_t> > locIndexCombos)
bool DHistogramAction_AnalyzeCutActions::Fill_Hists(TH1I* locHist, set<set<size_t> > locIndexCombos, double weight)
{
dPreviouslyHistogrammed.clear();
double locMass = 0.0;
Expand All @@ -94,7 +100,7 @@ bool DHistogramAction_AnalyzeCutActions::Fill_Hists(TH1I* locHist, set<set<size_
if(dPreviouslyHistogrammed.find(locSourceObjects) == dPreviouslyHistogrammed.end())
{
dPreviouslyHistogrammed.insert(locSourceObjects);
locHist->Fill(locMass);
locHist->Fill(locMass, weight);
}
}
return true;
Expand Down
5 changes: 3 additions & 2 deletions libraries/DSelector/DHistogramActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ class DHistogramAction_AnalyzeCutActions : public DAnalysisAction

void Reset_NewEvent(void){dPreviouslyHistogrammed.clear();}; //reset uniqueness tracking
void Initialize(void);
bool Perform_Action(void);
bool Perform_Action();
bool Perform_ActionWeight(double weight);

private:
bool Fill_Hists(TH1I* locHist, set<set<size_t>> locIndexCombos);
bool Fill_Hists(TH1I* locHist, set<set<size_t>> locIndexCombos, double weight);
vector<DAnalysisAction*> dAllAnalysisActions;
Particle_t dInitialPID;
int dStepIndex;
Expand Down

0 comments on commit 7ba516f

Please sign in to comment.