-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clock jump defaults #719
Merged
YannickSoehngen
merged 46 commits into
star-bnl:main
from
YannickSoehngen:clock-jump-defaults
Dec 18, 2024
Merged
Clock jump defaults #719
Changes from 45 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
9a72c75
ClockJump_correction update and new method for Hit manipulation on co…
9889653
added missing etofHelperFunctions
ffa9088
addressed suggested changes
febf3f7
Merge branch 'main' into ClockJumpCorrection-and-CounterMod-update
plexoos c62c0a9
Merge branch 'main' into ClockJumpCorrection-and-CounterMod-update
plexoos 8551432
2nd round of comments
0923a14
Merge branch 'ClockJumpCorrection-and-CounterMod-update' of https://g…
b9dcf39
change white space
plexoos 7cd0372
3d round of comments
fa5e2c5
Merge branch 'ClockJumpCorrection-and-CounterMod-update' of https://g…
9a8fd38
4th round of comments
a38037f
Merge branch 'main' into ClockJumpCorrection-and-CounterMod-update
plexoos eda3e89
5th round of comments
e10c291
Merge branch 'ClockJumpCorrection-and-CounterMod-update' of https://g…
79f22f2
bug fix in HitMaker
ef9e5b6
Clean up white space according to coding guidelines
plexoos 98f1101
remove undefined class method
plexoos 7139608
Revert "bug fix in HitMaker"
plexoos fa6331e
Tweak StETofGeometry::init() default params
plexoos 4c77e07
renamed variables and replaced 6.25 by etofConstant
591ab4e
Merge branch 'ClockJumpCorrection-and-CounterMod-update' of https://g…
9e25945
removed unused variable
b9b1559
adjusted default electronics dead-time
63f2ad4
Merge remote-tracking branch 'origin' into MaskCountersForProduction
fdd2424
add set method in MatchMaker, fix HitMaker for masking counters
84cd1e5
fixed PulserCorrection, added set method for AfterpulseCorrection
e5e1adf
StatusFlag Fix and implementation of SingleSidedMatches
a86d3ad
incremented ClassDef
b7b6d86
Merge branch 'main' into MatchUpdate-and-EventFlagFix
plexoos 32cb6b6
removed unnecessary if statement
ab90434
Merge branch 'main' into MatchUpdate-and-EventFlagFix
YannickSoehngen ac94c47
removed unused variable
d92ae2b
adressed compiler warnings
cb80b34
fix match flag and efficiency
37deacc
clock jump calibration update
b93bd0e
get4Pair default jump state
b8f3a14
Merge branch 'main' into clock-jump-defaults
YannickSoehngen 1e43cbe
Update StETofCalibMaker.cxx
YannickSoehngen 8740219
Update StETofCalibMaker.cxx
YannickSoehngen 1b66851
Update StRoot/StETofHitMaker/StETofHitMaker.cxx
YannickSoehngen 1a2b0c3
Update StRoot/StETofCalibMaker/StETofCalibMaker.cxx
YannickSoehngen e155cd6
Update StRoot/StETofHitMaker/StETofHitMaker.cxx
YannickSoehngen 8f7d238
Update StRoot/StETofCalibMaker/StETofCalibMaker.cxx
YannickSoehngen 936e8b8
Update StRoot/StETofCalibMaker/StETofCalibMaker.h
YannickSoehngen 959f595
Update StRoot/StETofCalibMaker/StETofCalibMaker.cxx
YannickSoehngen cd0bd6b
Update StETofCalibMaker.cxx
YannickSoehngen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -127,7 +127,9 @@ StETofCalibMaker::StETofCalibMaker( const char* name ) | |||||
mStateMapStop(0), | ||||||
mDbEntryStart(0), | ||||||
mDbEntryStop(0), | ||||||
mGlobalCounter(1) | ||||||
mGlobalCounter(1), | ||||||
mCalState(false) | ||||||
|
||||||
|
||||||
{ | ||||||
/// default constructor | ||||||
|
@@ -201,7 +203,12 @@ StETofCalibMaker::InitRun( Int_t runnumber ) | |||||
// -------------------------------------------------------------------------------------------- | ||||||
|
||||||
//Get4 status map | ||||||
|
||||||
for(int i=0; i < eTofConst::nGet4sInSystem; i++){ | ||||||
mGet4StateMap[i] = 0; | ||||||
if(i < (eTofConst::nGet4sInSystem/2)){ | ||||||
mGet4DefaultStateMap[i] = 0; | ||||||
} | ||||||
} | ||||||
readGet4State(mGlobalCounter , 0); | ||||||
|
||||||
// electronics-to-hardware map | ||||||
|
@@ -1459,7 +1466,7 @@ StETofCalibMaker::processMuDst() | |||||
if (hasPulsersVec.size() == 108){ | ||||||
etofHeader->setHasPulsersVec(hasPulsersVec); | ||||||
} | ||||||
|
||||||
//fill good event flag into header | ||||||
for( unsigned int iGet4 = 0; iGet4 < 1728; iGet4++){ | ||||||
goodEventFlagVec.push_back(!etofHeader->missMatchFlagVec().at(iGet4)); | ||||||
|
@@ -2168,7 +2175,10 @@ StETofCalibMaker::applyCalibration( StETofDigi* aDigi, StETofHeader* etofHeader | |||||
double stateCorr =0; | ||||||
if(mGet4StateMap[get4Id] == 1) stateCorr = 6.25; | ||||||
else if(mGet4StateMap[get4Id] == 2) stateCorr = -6.25; | ||||||
// else if(mGet4StateMap[get4Id] == 3) stateCorr = 0.0; | ||||||
|
||||||
// only calibrate here if flag is set | ||||||
if(!mCalState) stateCorr = 0; | ||||||
|
||||||
|
||||||
double calibTime = aDigi->rawTime() - mResetTime | ||||||
- resetTimeCorr() | ||||||
|
@@ -2689,12 +2699,12 @@ void StETofCalibMaker::readGet4State(int fileNr, short forward){ | |||||
std::vector< unsigned long int > intVec; | ||||||
|
||||||
//first read | ||||||
if(forward == 0) mGlobalCounter = 1; | ||||||
if(forward == 0) mGlobalCounter = 0; | ||||||
//jump forward | ||||||
else if(forward > 0) mGlobalCounter++; | ||||||
else if(forward > 0){ mGlobalCounter++; | ||||||
//jump backward | ||||||
else mGlobalCounter--; // forward < 0 | ||||||
}else {mGlobalCounter--;} // forward < 0 | ||||||
|
||||||
if(mGlobalCounter == 0){ | ||||||
mGlobalCounter++; | ||||||
fileZero = true; | ||||||
|
@@ -2743,7 +2753,7 @@ void StETofCalibMaker::readGet4State(int fileNr, short forward){ | |||||
std::map<unsigned long int,vector<int>> stateVec; | ||||||
std::map<unsigned long int ,vector<int>> get4IdVec; | ||||||
|
||||||
decodeInt(intVec , mGet4StateMap , mGet4ZeroStateMap , startVec , mMasterStartVec , stateVec , get4IdVec); | ||||||
decodeInt(intVec , startVec , stateVec , get4IdVec); | ||||||
|
||||||
// fill stateMap & steering vecs with EvtZero entries: read in first 1728 states & times | ||||||
for(int i = 0; i< eTofConst::nGet4sInSystem;i++){ | ||||||
|
@@ -2858,9 +2868,11 @@ void StETofCalibMaker::checkGet4State(unsigned long int eventNr){ | |||||
|
||||||
} | ||||||
//----------------------------------------------------- | ||||||
void StETofCalibMaker::decodeInt( std::vector<unsigned long int> intVec ,std::map<int , short>& mGet4StateMap ,std::map<int , short>& mGet4ZeroStateMap ,std::vector<unsigned long int>& startVec ,std::vector<unsigned long int>& mMasterStartVec ,std::map<unsigned long int,vector<int>>& stateVec ,std::map<unsigned long int,vector<int>>& get4IdVec){ | ||||||
void StETofCalibMaker::decodeInt( std::vector<unsigned long int>& intVec ,std::vector<unsigned long int>& startVec ,std::map<unsigned long int,vector<int>>& stateVec ,std::map<unsigned long int,vector<int>>& get4IdVec){ | ||||||
|
||||||
unsigned long int lastEvtId =0; | ||||||
std::map<int, std::vector< stateStruct > > stateMap; | ||||||
|
||||||
|
||||||
for(unsigned int i = 0; i < intVec.size(); i++){ | ||||||
|
||||||
|
@@ -2873,9 +2885,40 @@ void StETofCalibMaker::decodeInt( std::vector<unsigned long int> intVec ,std::ma | |||||
int Get4Id2; | ||||||
int get4state2; | ||||||
|
||||||
// decode nonZero/stateChange ints ( int = 42.xxx.xxx.xxx = 2 states only) | ||||||
stateStruct struct1; | ||||||
stateStruct struct2; | ||||||
|
||||||
switch (intVec.at(i) / 100000000) { | ||||||
|
||||||
|
||||||
//decode default jump states | ||||||
case 39 : | ||||||
|
||||||
tmp = intVec.at(i) % 3900000000; | ||||||
stateInt1 = tmp / 10000; | ||||||
stateInt2 = tmp % 10000; | ||||||
|
||||||
Get4Id1 = -1; | ||||||
get4state1 = -1; | ||||||
Get4Id2 = -1; | ||||||
get4state2 = -1; | ||||||
|
||||||
if(stateInt1 < 6912){ | ||||||
Get4Id1 = stateInt1 % (eTofConst::nGet4sInSystem/2); | ||||||
get4state1 = stateInt1 / (eTofConst::nGet4sInSystem/2); | ||||||
} | ||||||
if(stateInt2 < 6912){ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
Get4Id2 = stateInt2 % (eTofConst::nGet4sInSystem/2); | ||||||
get4state2 = stateInt2 / (eTofConst::nGet4sInSystem/2); | ||||||
} | ||||||
|
||||||
if(i < (eTofConst::nGet4sInSystem/4) ){ | ||||||
mGet4DefaultStateMap[Get4Id1] = get4state1; | ||||||
mGet4DefaultStateMap[Get4Id2] = get4state2; | ||||||
} | ||||||
|
||||||
break; | ||||||
|
||||||
// decode nonZero/stateChange ints ( int = 42.xxx.xxx.xxx = 2 states only) | ||||||
case 42 : | ||||||
tmp = intVec.at(i) % 4200000000; | ||||||
stateInt1 = tmp / 10000; | ||||||
|
@@ -2895,7 +2938,8 @@ void StETofCalibMaker::decodeInt( std::vector<unsigned long int> intVec ,std::ma | |||||
get4state2 = stateInt2 / eTofConst::nGet4sInSystem; | ||||||
} | ||||||
|
||||||
if(i < 864){ | ||||||
if(i >= (eTofConst::nGet4sInSystem/4) && i < ((eTofConst::nGet4sInSystem/4) + (eTofConst::nGet4sInSystem/2))){ | ||||||
|
||||||
mGet4StateMap[Get4Id1] = get4state1; | ||||||
mGet4StateMap[Get4Id2] = get4state2; | ||||||
mGet4ZeroStateMap[Get4Id1] = get4state1; | ||||||
|
@@ -2906,6 +2950,18 @@ void StETofCalibMaker::decodeInt( std::vector<unsigned long int> intVec ,std::ma | |||||
stateVec[lastEvtId].push_back(get4state2); | ||||||
get4IdVec[lastEvtId].push_back(Get4Id2); | ||||||
|
||||||
//stateStruct struct1; | ||||||
struct1.get4Id = Get4Id1; | ||||||
struct1.state = get4state1; | ||||||
struct1.evtId = lastEvtId; | ||||||
//stateStruct struct2; | ||||||
struct2.get4Id = Get4Id2; | ||||||
struct2.state = get4state2; | ||||||
struct2.evtId = lastEvtId; | ||||||
|
||||||
stateMap[Get4Id1].push_back(struct1); | ||||||
stateMap[Get4Id2].push_back(struct2); | ||||||
|
||||||
break; | ||||||
|
||||||
//decode eventnumber ( int = 40.xxx.xxx.xxx = event number ) | ||||||
|
@@ -2936,10 +2992,37 @@ void StETofCalibMaker::decodeInt( std::vector<unsigned long int> intVec ,std::ma | |||||
stateVec[lastEvtId].push_back(get4state1); | ||||||
get4IdVec[lastEvtId].push_back(Get4Id1); | ||||||
|
||||||
//stateStruct struct1; | ||||||
struct1.get4Id = Get4Id1; | ||||||
struct1.state = get4state1; | ||||||
struct1.evtId = lastEvtId; | ||||||
|
||||||
stateMap[Get4Id1].push_back(struct1); | ||||||
|
||||||
break; | ||||||
|
||||||
default: | ||||||
LOG_ERROR << "Get4 state not well defined -> Check db / state file !" << endm; | ||||||
} | ||||||
} | ||||||
|
||||||
//sort vecs (necessary due to get4 splitting) | ||||||
std::sort(startVec.begin(), startVec.end()); | ||||||
std::sort(mMasterStartVec.begin(), mMasterStartVec.end()); | ||||||
|
||||||
for(unsigned int i=0; i< eTofConst::nGet4sInSystem;i++){ | ||||||
|
||||||
std::vector<stateStruct> tmpVec = stateMap.at(i); | ||||||
|
||||||
for(unsigned int j=0; j < stateMap.at(i).size();j++){ | ||||||
tmpVec.push_back(stateMap.at(i).at(j)); | ||||||
} | ||||||
std::sort(tmpVec.begin(), tmpVec.end(), [] (stateStruct x, stateStruct y) { return x.evtId < y.evtId; } ); | ||||||
|
||||||
for(unsigned int j=0; j< tmpVec.size();j++){ | ||||||
|
||||||
stateVec[tmpVec.at(j).evtId].push_back(tmpVec.at(j).state); | ||||||
get4IdVec[tmpVec.at(j).evtId].push_back(tmpVec.at(j).get4Id); | ||||||
} | ||||||
} | ||||||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.