-
Notifications
You must be signed in to change notification settings - Fork 64
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
Update clock jump correction, add new method for hit manipulation on counter level #457
Update clock jump correction, add new method for hit manipulation on counter level #457
Conversation
Yannick, thanks for putting this PR out. It seems a few checks broke. Could you please help take some investigations on this? Thanks |
Sure! I forgot to set up a "default" entry in the data base wich is now in place and the checks finished on second attempt.
December 6, 2022 7:56 PM, "Xin Dong" ***@***.*** ***@***.******@***.***>)> wrote:
Yannick, thanks for putting this PR out. It seems a few checks broke. Could you please help take some investigations on this? Thanks
—
Reply to this email directly, view it on GitHub (#457 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AOLELK4E7TCI2BZSXZVL7KLWL6D4LANCNFSM6AAAAAASUUEFLM).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Thank you, Yannick. |
Philipp and Yannick, are we ready to merge? I would still like to see if you have tried a test run with the Run20 FXT data using this for MuDst->picoDst conversion and checked out the output? |
|
||
std::map< Int_t, Int_t > mClockJumpDirection; // stores direction of clock jump for time correction | ||
|
||
std::map< Int_t, int > mModMatrix; // stores mode of modification for hits on striplevel (flip) |
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.
The modes should be represented using an enum
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.
I agree that magic numbers aren't optimal here but I would like to keep the integers as they will allow me to increase the granularity of that method to Get4 level (if need be).
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.
I don't see how an enum would constrain the granularity... You currently have 5 modes modifying the hit coordinates.
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.
Not as the method currently is. But If I'll have to increase it I can stick with our "default integer" naming scheme and wont have to introduce jet another db-table. I dont think those 5 modes will cause too much confusion, but retaining the flexibility here will allow for more easy and consistent solutions in the future.
Hi Yannick, thank you for addressing the comments. |
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.
There are still warnings in StETofHitMaker, please address
if(modMode == 0) {return;} | ||
|
||
if(modMode == 1){ | ||
localX *= -1; | ||
localY *= -1; | ||
} | ||
if(modMode == 2){ | ||
|
||
localX *= -1; | ||
} | ||
if(modMode == 3){ | ||
localY *= -1; | ||
} | ||
if(modMode == 4){ | ||
double x = localX; | ||
double y = localY; | ||
localX = y; | ||
localY = -1*x; | ||
} | ||
if(modMode == 5){ | ||
double x = localX; | ||
double y = localY; | ||
localX = -1*y; | ||
localY = x; | ||
} | ||
if(modMode == 99){ | ||
localX = 9999; | ||
localY = 9999; | ||
} | ||
|
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.
The above suggestions are reasonable. Is there any reason not to take them?
…ithub.com/YannickSoehngen/star-sw into ClockJumpCorrection-and-CounterMod-update
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.
There are warnings in StETofHitMaker, please address
…ithub.com/YannickSoehngen/star-sw into ClockJumpCorrection-and-CounterMod-update
const double safetyMargins[ 2 ] = { 0., 0. }; | ||
mETofGeom->init( gGeoManager, safetyMargins, 0 ); //don't use helix swimmer here. Probably needs an additional include |
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.
const double safetyMargins[ 2 ] = { 0., 0. }; | |
mETofGeom->init( gGeoManager, safetyMargins, 0 ); //don't use helix swimmer here. Probably needs an additional include | |
mETofGeom->init( gGeoManager); |
Looks like you pass default parameters, see
star-sw/StRoot/StETofUtil/StETofGeometry.cxx
Lines 566 to 568 in 81d6a97
void | |
StETofGeometry::init( TGeoManager* geoManager, const double* safetyMargins = initializer_list<double>({0, 0}).begin(), const bool& useHelixSwimmer = false ) | |
{ |
|
||
// -------------------------------------------------------------------------------------------- | ||
// pointer to eTOF hit maker | ||
// -------------------------------------------------------------------------------------------- | ||
|
||
mETofHitMaker = ( StETofHitMaker* ) GetMaker( "etofHit" ); | ||
LOG_DEBUG << "StETofMatchMaker::InitRun() -- pointer to eTOF hit maker: " << mETofHitMaker << endm; | ||
|
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.
No maker should directly access another maker. This would entangle the dependency between makers.
I already asked multiple times (see this thread) to fix the warnings produced by the modified code... Well now it is an error, cannot proceed before it is fixed
|
…ithub.com/YannickSoehngen/star-sw into ClockJumpCorrection-and-CounterMod-update
|
||
void setGet4MinTime( const double& minTime ); |
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.
This is not how I suggested to fix the signature of this function. Adding 'const' is fine but passing a double by reference feels weird and superfluous
mETofGeom->init( gGeoManager); //don't use helix swimmer here. Probably needs an additional include | ||
LOG_DEBUG << " init done " << endm; | ||
const double safetyMargins[ 2 ] = { 0., 0. }; | ||
mETofGeom->init( gGeoManager, safetyMargins, 0 ); //don't use helix swimmer here. Probably needs an additional include |
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.
Why did you decide to revert the changes as I suggested in #457 (comment)? What kind of bug does this fix?
It would be easier to understand your intentions and the problems you are trying to fix if you replied with some comments rather than just making changes
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.
Sorry, 2 of the tets crashed here and I wanted to see if the other changes pass them. The suggested change caused a:
"symbol lookup error: /direct/star+u/ysoehngen/Work/TestHitnew/.sl73_gcc485/lib/libStETofHitMaker.so: undefined symbol: _ZN14StETofGeometry4initEP11TGeoManager"
StMuPrimaryVertex* pVtx = mMuDst->primaryVertex( 0 ); | ||
StThreeVectorD posGlo = mETofGeom->hitLocal2Master( constructedHit ); | ||
StThreeVectorD* posGlo = new StThreeVectorD( mETofGeom->hitLocal2Master( constructedHit )); | ||
|
||
if( pVtx ) { | ||
StThreeVectorD vtxPos = pVtx->position(); | ||
StThreeVectorD* vtxPos = new StThreeVectorD( pVtx->position()); | ||
exptof = tofPathLength(vtxPos , posGlo , 0) / ( nanosecond * c_light ); |
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.
You just introduced a memory leak. This must be fixed. If a function takes a pointer, you can pass the address of a variable.
std::string histName_t0corr_jump = "matchCand_t0corr_jump_s" + std::to_string( matchCand.sector ) + "m" + std::to_string( matchCand.plane ) + "c" + std::to_string( matchCand.counter ); | ||
mHistograms.at( histName_t0corr_jump )->Fill( matchCand.localX, tof - tofpi ); //cutdownYS | ||
|
||
int get4Index = matchCand.sector * 1000 + matchCand.plane * 100 + matchCand.counter * 10 + ( matchCand.localX + 16 ) / 4 + 1; |
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.
Is the '16' in this expression the same as 'mLocalYmax'?
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.
No, this shifts the local x coordinate (-16 to 16) to strip-numbers (32 strips in total)
|
||
Int_t idTruth; | ||
Int_t idTruthHit; | ||
Int_t nHitsFit; | ||
bool isMissMatch; |
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.
I don't see how these new members are used in this PR. Are they needed? If not, please remove, i.e. don't add
} | ||
|
||
if(mGet4doublejumpFlag.at(get4Nr) == 1){ | ||
constructedHit->setTime(constructedHit->time() + 6.25); |
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.
This '6.25' is already defined as a named constant, isn't it?
const double coarseClockCycle = 6.25; // [ns] -- needs to be double otherwise strange things happen ... |
bool IsMissmatch = false; | ||
int IdTruth = 0; |
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.
According to STAR coding guidelines variables should start with a lower case letter: https://star-bnl.github.io/star-coding-guidelines/formatguide.xml#Variable_Names
x = localX; | ||
localX = localY; | ||
localY = -1*x; |
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.
How about this?
x = localX; | |
localX = localY; | |
localY = -1*x; | |
std::swap(localX, localY), localY = -localY; |
This reverts commit 79f22f2.
…ithub.com/YannickSoehngen/star-sw into ClockJumpCorrection-and-CounterMod-update
Dmitri, could you please take a (final?) look at the new commits by Yannick? If OK, I think we are ready to merge this PR to main. |
Xin, if you think it is ready just go ahead and approve. I am away this week and won't have a chance to look at it until later. From the thread it should be clear what's been addressed and what hasn't. |
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.
Thanks everyone for helping on this. To me, it looks ready to be merged.
Added feedback method from Match to Hit-Maker as well as "double-jump" correction and method to modify Hits on counter level steered by Db table