Add simple time fitter - #423
Conversation
|
|
||
| void FitTimeProc::BeginOfRun(DS::Run *run) { | ||
| DBLinkPtr table = DB::Get()->GetLink("FIT_COMMON", ""); | ||
| fLightSpeed = table->GetD("light_speed"); |
There was a problem hiding this comment.
This should be updated to:
if (!WasParamSet("light_speed")) fLightSpeed = table->GetD("light_speed");
so that it doesn't overwrite a value set by procset
| fitT->SetEnableTime(true); | ||
|
|
||
| /// Initialize FitResult parameters | ||
| fitT->SetPosition(fPosition); |
There was a problem hiding this comment.
SetPosition() calls SetValidPosition(true), so validposition_fittime is always true, even if the fit fails. I guess the position is the value input by the user, so it is arguably valid. Just wanted to check if this is the desired behavior.
There was a problem hiding this comment.
Yes, this is exactly the intended logic.
| const TVector3 pmtPos = fPMTInfo->GetPosition(pmtid); | ||
|
|
||
| double tt = 0; | ||
| if (fSetWavelength) { |
There was a problem hiding this comment.
The user can set both fWavelength and fLightSpeed, but if they do, only fWavelength is used. I think it should either only allow the user to set one, or it should be stated in the documentation that if both are set, the wavelength and the TransitTimeCalculator are used, and the light speed is ignored.
| @@ -0,0 +1,31 @@ | |||
| # Example macro showing how to use quadfitter | |||
| ``event_position_z`` ``double`` Position of event in mm. Defaults to 0. | ||
| ========================= ========================== =================== | ||
|
|
||
| Position fit information in data structure |
| ========================= ========================== =================== | ||
| **Field** **Type** **Description** | ||
| ========================= ========================== =================== | ||
| ``label`` ``string`` Additional string appended to "fitcentroid" |
|
All my comments have been addressed. Looks good to me. |
This PR supercedes #421 by creating a new processor.
Notably, it uses all available hit times and offers the user a choice between two straight-line light path options:
light_speed(default)TransitTimeCalculatorby specifying the photon wavelength to use.Default:

TransitTimeCalculator:
