Skip to content

Commit

Permalink
Remove some functions in StRHICfFunction (#533)
Browse files Browse the repository at this point in the history
all of the checking function is removed
these functions are NOT necessary to RHICf reconstruction. 
In more detail, see the comment below,  (in PR #519 )


-----------------------------------------------------------------------------------------------------------------------
> All of the input data-checking functions for RHICf come from the
StRHICfFunction class. However, when someone uses a merged RHICf tool,
those functions or codes will always be frozen.
> 
> Furthermore, all input data checkers simply ensure that the total
number of input data is correct. For example, they check that the
setPlateEnergy() function has been called as many times as there are
plate energy arrays.
> 
> For this reason, I don’t think these checkers need to be included in
all of the RHICf tools, so I plan to remove them from all RHICf tools
soon.
Commit[d92b32d](d92b32d)
was made for the same reason.

-------------------------------------------------------------------------------------------------------------------------
  • Loading branch information
ggfdsa10 authored May 19, 2023
1 parent 5c714aa commit 46f3a78
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 106 deletions.
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

0 comments on commit 46f3a78

Please # to comment.