Skip to content

Separate TAC calibration and cuts - #194

Open
NicoleRodriguezCavero wants to merge 15 commits into
cositools:develop/emfrom
NicoleRodriguezCavero:taccal_separated
Open

Separate TAC calibration and cuts#194
NicoleRodriguezCavero wants to merge 15 commits into
cositools:develop/emfrom
NicoleRodriguezCavero:taccal_separated

Conversation

@NicoleRodriguezCavero

@NicoleRodriguezCavero NicoleRodriguezCavero commented Aug 14, 2026

Copy link
Copy Markdown

Currently, MModuleTACCut performs the TAC calibration and applied the TAC cuts all within the AnalyzeEvent() functions. This PR:

  • Separates the ApplyTACCal() and ApplyTACCuts() functions and calls them in AnalyzeEvent()
  • No longer requires a taccut file and instead has a GUI option to set the coincidence window used in the TAC cuts
  • All non-GR events regardless of whether they have slow or fast timing are now calibrated to ns
  • Renames module from MModuleTACCut to MModuleTACCalibration
  • Renames XMLtags from TACcut to TACcalibration addressing part of Consistent use of XML tags #193

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TAC cal window now looks like this:
Image

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can now do the TAC calibration with or without applying TAC cuts.
For non-GR hits with fast timing:
Image

@NicoleRodriguezCavero

NicoleRodriguezCavero commented Aug 14, 2026

Copy link
Copy Markdown
Author
  • Create separate function for TAC calibrationApplyTACCal() and call that within AnalyzeEvent()

@fhagemann

Copy link
Copy Markdown

The unit tests fail because the changes seem to affect the end-to-end test results on both 406-1 and 542-1.
(I updated the .cfg files locally, but I'm also getting different results now)

@fhagemann

Copy link
Copy Markdown

Pushing some changes to the nuclearizer config file to work with the new XML tags.

</XmlTagTACcut>
<ApplyTACCuts>true</ApplyTACCuts>
<TACCut>
<CoincidenceWindow>600</CoincidenceWindow>

@fhagemann fhagemann Aug 14, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comment on the 600: I know the previous taccut files had 500 in them, but that value was never used (previously, the coincidence value was always set to the hard-coded value of 600 in the code). So this setting will make sure that the unit tests are run with the same settings as before.

@NicoleRodriguezCavero
NicoleRodriguezCavero marked this pull request as ready for review August 14, 2026 21:50
Comment thread src/MModuleTACcal.cxx Outdated
Comment thread src/MModuleTACcal.cxx Outdated
Comment thread src/MModuleTACcal.cxx Outdated
Comment thread src/MModuleTACcal.cxx Outdated
Comment thread src/MModuleTACcal.cxx Outdated
Comment thread src/MModuleTACcal.cxx Outdated
Comment thread include/MModuleTACCalibration.h
Comment thread include/MAssembly.h Outdated

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tabs were relabeled because they show the TAC distribution and energy spectra after TAC cuts (not calibrations) are applied

Image

@fhagemann fhagemann added the cleanup Code cleanup label Aug 18, 2026
@fhagemann fhagemann linked an issue Aug 18, 2026 that may be closed by this pull request

@ckierans ckierans left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice rework, @NicoleRodriguezCavero! I just have a few questions about the error messages, and the ordering of the modules.

Will this PR close either Issue #64 or #63 ?

MModuleTACcut TACcut;
TACcut.SetTACCalFileName(m_TACCalFileName);
if (TACcut.LoadTACCalFile(m_TACCalFileName) == true) {
MModuleTACCalibration TACcal;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicky, but maybe use TACCal vs TACcal as the MModuleTACCalibration instance to be consistent with the capitalization of the "C" in Cal

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to call this variable TACCalibration ;)


// Set all modules, which can follow this module
AddSucceedingModuleType(MAssembly::c_StripPairing);
AddSucceedingModuleType(MAssembly::c_DepthCorrection);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DepthCorrection module isn't actually allowable here since it has it's own dependance that StripPairing must be performed first, so I think this can be removed.


// Set all modules, which have to be done before this module
AddPreceedingModuleType(MAssembly::c_EventLoader);
AddPreceedingModuleType(MAssembly::c_EnergyCalibration);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So now we're enforcing the EnergyCalibration to happen before the TAC Calibration? This is different than what we previously had where we left it up to the user (I think I've always done TAC first then Energy), which is probably the wrong approach! Have we confirmed there is not change of behavior with TAC Calibration -> Energy Calibration vs Energy Calibration -> TAC Calibration? I don't think it should necessarily matter, but I want to make sure we're being intentional about the order.

Honestly, this got me looking at the other Nuclearizer dependancies, and I do think we should enforce only one option for the order for TAC/Energy, so I'm happy to see this change!

<<" on side "<<Side
<<" does not have enough TAC calibration parameters - skipping event"
<<endl;
return false;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean to use return false or continue here? Return false will stop the whole Nuclearizer run if one of these conditions are met, it won't just skip the event. continue will just skip the event currently being processed. See for example lines 168 -- 174 in the MModuleEnergyCalibration for when there is no valid energy calibration for a striphit. If we want to not throw a full error and stop Nuclearizer if a TAC Calibration for a single strip is unknown, then we probably should introduce a TACCalibrationError flag, similar to the EnergyCalibrationError flag, and downgrade this to a Warning vs an Error.

I'm also wondering if it makes more sense to combine the valid calibration parameters + at least two parameters describing the calibration into one warning/error.

Take a closer look at these error messages and think about when we really need to stop Nuclearizer, and when we just need a flag for an event.

if (Passed == true) {
++i;
} else {
Event->RemoveStripHit(i);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to track the events for which we've removed striphits with the TAC cut? Does this give any indication of the quality of the event, or any information about the rest of the striphits?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consistent use of XML tags

3 participants