mirror of
https://github.com/sesps/SPS_SABRE_EventBuilder.git
synced 2024-11-26 11:38:49 -05:00
Bugfix to cut logic. CutHandler did not accurately reflect case of empty cutlist, and SFPPlotter did not properly handle case where cut list was not appropriately constructed.
This commit is contained in:
parent
1c9c97983f
commit
17cb297310
|
@ -42,7 +42,6 @@ class SFPPlotter {
|
|||
|
||||
/*Cuts*/
|
||||
CutHandler cutter;
|
||||
bool cutFlag;
|
||||
|
||||
TChain *chain;
|
||||
|
||||
|
|
|
@ -52,7 +52,11 @@ void CutHandler::SetCuts(const std::string& filename) {
|
|||
}
|
||||
}
|
||||
|
||||
validFlag = true;
|
||||
if(cut_array.size() > 0) {
|
||||
validFlag = true;
|
||||
} else {
|
||||
validFlag = false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -16,7 +16,6 @@ SFPPlotter::SFPPlotter() {
|
|||
rootObj->SetOwner(false);//THashTable doesnt own members; avoid double delete
|
||||
event_address = new ProcessedEvent();
|
||||
chain = new TChain("SPSTree");
|
||||
cutFlag = false;
|
||||
m_pb = NULL;
|
||||
}
|
||||
|
||||
|
@ -51,7 +50,6 @@ void SFPPlotter::MyFill(const string& name, int binsx, double minx, double maxx,
|
|||
|
||||
void SFPPlotter::ApplyCutlist(const string& listname) {
|
||||
cutter.SetCuts(listname);
|
||||
cutFlag = true;
|
||||
}
|
||||
|
||||
/*Makes histograms where only rejection is unset data*/
|
||||
|
@ -158,7 +156,6 @@ void SFPPlotter::MakeUncutHistograms(ProcessedEvent ev) {
|
|||
|
||||
/*Makes histograms with cuts & gates implemented*/
|
||||
void SFPPlotter::MakeCutHistograms(ProcessedEvent ev) {
|
||||
if(!cutter.IsValid()) return;
|
||||
if(cutter.IsInside(&ev)) {
|
||||
MyFill("x1_bothplanes_Cut",600,-300,300,ev.x1);
|
||||
MyFill("x2_bothplanes_Cut",600,-300,300,ev.x2);
|
||||
|
@ -265,12 +262,12 @@ void SFPPlotter::Run(vector<TString> files, const string& output) {
|
|||
}
|
||||
chain->GetEntry(i);
|
||||
MakeUncutHistograms(*event_address);
|
||||
if(cutFlag) MakeCutHistograms(*event_address);
|
||||
if(cutter.IsValid()) MakeCutHistograms(*event_address);
|
||||
}
|
||||
cout<<endl;
|
||||
outfile->cd();
|
||||
rootObj->Write();
|
||||
if(cutFlag && cutter.IsValid()) {
|
||||
if(cutter.IsValid()) {
|
||||
auto clist = cutter.GetCuts();
|
||||
for(unsigned int i=0; i<clist.size(); i++) {
|
||||
clist[i]->Write();
|
||||
|
|
Loading…
Reference in New Issue
Block a user