Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove some functions in StRHICfFunction #533

Merged
merged 2 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 1 addition & 92 deletions StRoot/StRHICfUtil/StRHICfFunction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,8 @@
#include "StRHICfFunction.h"

StRHICfFunction::StRHICfFunction()
{
initChecker();
}

void StRHICfFunction::initChecker()
{
mRunType = 999;
mGSOBarNum = 0;
std::fill(mLeakageNum, mLeakageNum+3, 0);
std::fill(mValueForRecoNum, mValueForRecoNum+5, 0);
}

StRHICfFunction::~StRHICfFunction()
Expand Down Expand Up @@ -117,87 +109,4 @@ float StRHICfFunction::rescaleEnergyFactor(int tower, int layer)
if(layer > 8){rescaleFactor = factorByTowerTOP[tower];}
}
return rescaleFactor;
}

bool StRHICfFunction::checkGSOBarEnergy(float val)
{
if(val > -900.){mGSOBarNum += 1;}
if(mGSOBarNum == kRHICfNtower*kRHICfNlayer*kRHICfNxy*kRHICfNbarLarge-kRHICfNlayer*kRHICfNxy*kRHICfNbarSmall){
return kRHICfOk;
}
else{return kRHICfFatal;}
}

bool StRHICfFunction::checkGSOBarTable(float val)
{
if(val > -900.){mGSOBarTableNum += 1;}
if(mGSOBarTableNum == kRHICfNtower*kRHICfNlayer*kRHICfNxy*kRHICfNbarLarge-kRHICfNlayer*kRHICfNxy*kRHICfNbarSmall){
return kRHICfOk;
}
else{return kRHICfFatal;}
}

bool StRHICfFunction::checkPlateEnergy(float val)
{
if(val > -900.){mPlateNum += 1;}
if(mPlateNum == kRHICfNtower*kRHICfNplate){
return kRHICfOk;
}
else{return kRHICfFatal;}
}

bool StRHICfFunction::checkRecoValue(string opt, float val)
{
transform(opt.begin(), opt.end(), opt.begin(), ::tolower);
if(opt=="resulthitpos"){
if(val > -900.){mValueForRecoNum[0] += 1;}
if(mValueForRecoNum[0] == kRHICfNtower*kRHICfNxy){return kRHICfOk;}
else{return kRHICfFatal;}
}
else if(opt=="resulthitnum"){
if(val > -900.){mValueForRecoNum[1] += 1;}
if(mValueForRecoNum[1] == kRHICfNtower){return kRHICfOk;}
else{return kRHICfFatal;}
}
else if(opt=="multihitpos"){
if(val > -900.){mValueForRecoNum[2] += 1;}
if(mValueForRecoNum[2] == kRHICfNtower*2*kRHICfNxy*2){return kRHICfOk;}
else{return kRHICfFatal;}
}
else if(opt=="multipeakheight"){
if(val > -900.){mValueForRecoNum[3] += 1;}
if(mValueForRecoNum[3] == kRHICfNtower*2*kRHICfNxy*2){return kRHICfOk;}
else{return kRHICfFatal;}
}
else if(opt=="overlap"){
if(val > -900.){mValueForRecoNum[4] += 1;}
if(mValueForRecoNum[4] == kRHICfNtower*kRHICfNxy){return kRHICfOk;}
else{return kRHICfFatal;}
}
else if(opt=="runtype"){
if(val < 3){return kRHICfOk;}
else{return kRHICfFatal;}
}
return kRHICfFatal;
}

bool StRHICfFunction::checkLeakageTable(string opt, bool val)
{
transform(opt.begin(), opt.end(), opt.begin(), ::tolower);
if(opt=="photonin"){
if(val == true){mLeakageNum[0] += 1;}
if(mLeakageNum[0] == kRHICfNtower*kRHICfNplate){return kRHICfOk;}
else{return kRHICfFatal;}
}
else if(opt=="photonout"){
if(val == true){mLeakageNum[1] += 1;}
if(mLeakageNum[1] == kRHICfNtower*kRHICfNplate){return kRHICfOk;}
else{return kRHICfFatal;}
}
else if(opt=="neutronout"){
if(val == true){mLeakageNum[2] += 1;}
if(mLeakageNum[2] == kRHICfNtower){return kRHICfOk;}
else{return kRHICfFatal;}
}
return kRHICfFatal;
}
}
14 changes: 0 additions & 14 deletions StRoot/StRHICfUtil/StRHICfFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,14 @@ class StRHICfFunction
StRHICfFunction();
virtual ~StRHICfFunction();

void initChecker();

void setRunType(int type){mRunType = type;}
int getRunType(){return mRunType;}
int checkRunTypeForRHICf2017(int runNum);
int checkGSOBarSize(int tower); // 0 = small, 1 = large

float rescaleEnergyFactor(int tower, int layer);

bool checkGSOBarEnergy(float val);
bool checkGSOBarTable(float val);
bool checkPlateEnergy(float val);
bool checkRecoValue(string opt, float val);
bool checkLeakageTable(string opt, bool val);

private:
int mRunType;
int mGSOBarNum;
int mGSOBarTableNum;
int mPlateNum;
int mValueForRecoNum[5]; // in StRHICfRecoEnergy, check setting parameter[ResultHitPos, ResultHitNum, MultiHitPos, MultiPeakHeight, Overlap]
int mLeakageNum[3];
};

#endif