From b4b68b4826b8e6b46811e96d3296a55449f8bb96 Mon Sep 17 00:00:00 2001 From: nicolerodriguezcavero Date: Thu, 13 Aug 2026 11:33:12 -0700 Subject: [PATCH 01/15] Requiring Ecal preceeding module --- src/MModuleTACcut.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MModuleTACcut.cxx b/src/MModuleTACcut.cxx index afb37775..cce99437 100644 --- a/src/MModuleTACcut.cxx +++ b/src/MModuleTACcut.cxx @@ -64,7 +64,7 @@ MModuleTACcut::MModuleTACcut() : MModule() // Set all modules, which have to be done before this module AddPreceedingModuleType(MAssembly::c_EventLoader); - //AddPreceedingModuleType(MAssembly::c_EnergyCalibration); + AddPreceedingModuleType(MAssembly::c_EnergyCalibration); // Set all types this modules handles AddModuleType(MAssembly::c_TACcut); From ab759420d99bd1b67765dae081729ce9a0db9877 Mon Sep 17 00:00:00 2001 From: nicolerodriguezcavero Date: Fri, 14 Aug 2026 12:12:29 -0700 Subject: [PATCH 02/15] Separate TAC calibration from TAC cuts --- apps/TrappingCorrection.cxx | 16 +- apps/TrappingCorrectionAm241.cxx | 14 +- include/MAssembly.h | 41 +- ...GUIOptionsTACcut.h => MGUIOptionsTACcal.h} | 32 +- include/{MModuleTACcut.h => MModuleTACcal.h} | 88 ++-- src/MAssembly.cxx | 4 +- src/MGUIOptionsTACcut.cxx | 153 ++++++- src/MModuleTACcut.cxx | 427 +++++++++--------- src/MSubModuleDepthReadout.cxx | 10 +- 9 files changed, 453 insertions(+), 332 deletions(-) rename include/{MGUIOptionsTACcut.h => MGUIOptionsTACcal.h} (71%) rename include/{MModuleTACcut.h => MModuleTACcal.h} (68%) diff --git a/apps/TrappingCorrection.cxx b/apps/TrappingCorrection.cxx index 5c43d86e..ee53a42b 100644 --- a/apps/TrappingCorrection.cxx +++ b/apps/TrappingCorrection.cxx @@ -64,7 +64,7 @@ using namespace ROOT::Minuit2; #include "MModuleEventFilter.h" #include "MModuleStripPairingChiSquare.h" #include "MModuleStripPairingMultiRoundChiSquare.h" -#include "MModuleTACcut.h" +#include "MModuleTACcal.h" #include "MAssembly.h" @@ -153,7 +153,6 @@ class TrappingCorrection MString m_FileName; MString m_EcalFile; MString m_TACCalFile; - MString m_TACCutFile; MString m_StripMapFile; //! output file names MString m_OutFile; @@ -277,7 +276,6 @@ bool TrappingCorrection::ParseCommandLine(int argc, char** argv) Usage<<" --emax: maximum Event energy (default 5000 kev)"< i+1) && (argv[i+1][0] != '-' || isalpha(argv[i+1][1]) == 0))){ cout<<"Error: Option "<SetTACCalFileName(m_TACCalFile); - TACCalibrator->SetTACCutFileName(m_TACCutFile); S->SetModule(TACCalibrator, MNumber); ++MNumber; diff --git a/apps/TrappingCorrectionAm241.cxx b/apps/TrappingCorrectionAm241.cxx index dadf4894..1a6412fb 100644 --- a/apps/TrappingCorrectionAm241.cxx +++ b/apps/TrappingCorrectionAm241.cxx @@ -60,7 +60,7 @@ using namespace std; #include "MModuleEventFilter.h" #include "MModuleStripPairingChiSquare.h" #include "MModuleStripPairingMultiRoundChiSquare.h" -#include "MModuleTACcut.h" +#include "MModuleTACcal.h" #include "MAssembly.h" @@ -106,7 +106,6 @@ class TrappingCorrectionAm241 MString m_LVFileName; MString m_EcalFile; MString m_TACCalFile; - MString m_TACCutFile; MString m_StripMapFile; //! output file names MString m_OutFile; @@ -159,7 +158,6 @@ bool TrappingCorrectionAm241::ParseCommandLine(int argc, char** argv) Usage<<" --emax: maximum Event energy (default 70 kev)"<SetTACCalFileName(m_TACCalFile); - TACCalibrator->SetTACCutFileName(m_TACCutFile); S->SetModule(TACCalibrator, MNumber); ++MNumber; - + cout<<"Creating energy calibrator"<SetFileName(m_EcalFile); diff --git a/include/MAssembly.h b/include/MAssembly.h index 396f5b13..eafbae78 100644 --- a/include/MAssembly.h +++ b/include/MAssembly.h @@ -53,26 +53,27 @@ class MAssembly static const uint64_t c_EventLoaderMeasurement = (1 << 2); // = 4 static const uint64_t c_EventOrdering = (1 << 3); // = 8 static const uint64_t c_Coincidence = (1 << 4); // = 16 - static const uint64_t c_TACcut = (1 << 5); // = 32 - static const uint64_t c_NearestNeighbor = (1 << 6); // = 32 - static const uint64_t c_DetectorEffectsEngine = (1 << 7); - static const uint64_t c_EventFilter = (1 << 8); - static const uint64_t c_EnergyCalibration = (1 << 9); - static const uint64_t c_ChargeSharingCorrection = (1 << 10); - static const uint64_t c_DepthCorrection = (1 << 11); - static const uint64_t c_StripPairing = (1 << 12); - static const uint64_t c_Aspect = (1 << 13); - static const uint64_t c_CrosstalkCorrection = (1 << 14); - static const uint64_t c_EventReconstruction = (1 << 15); - static const uint64_t c_Else = (1 << 16); - static const uint64_t c_NoRestriction = (1 << 17); - static const uint64_t c_EventSaver = (1 << 18); - static const uint64_t c_EventTransmitter = (1 << 19); - static const uint64_t c_PositionDetermiation = (1 << 20); - static const uint64_t c_Statistics = (1 << 21); - static const uint64_t c_FlagHits = (1 << 22); - static const uint64_t c_Diagnostics = (1 << 23); - static const uint64_t c_ResponseGeneration = (1 << 24); + static const uint64_t c_TACcal = (1 << 5); // = 32 + static const uint64_t c_TACcut = (1 << 6); // = 64 + static const uint64_t c_NearestNeighbor = (1 << 7); // = 128 + static const uint64_t c_DetectorEffectsEngine = (1 << 8); + static const uint64_t c_EventFilter = (1 << 9); + static const uint64_t c_EnergyCalibration = (1 << 10); + static const uint64_t c_ChargeSharingCorrection = (1 << 11); + static const uint64_t c_DepthCorrection = (1 << 12); + static const uint64_t c_StripPairing = (1 << 13); + static const uint64_t c_Aspect = (1 << 14); + static const uint64_t c_CrosstalkCorrection = (1 << 15); + static const uint64_t c_EventReconstruction = (1 << 16); + static const uint64_t c_Else = (1 << 17); + static const uint64_t c_NoRestriction = (1 << 18); + static const uint64_t c_EventSaver = (1 << 19); + static const uint64_t c_EventTransmitter = (1 << 20); + static const uint64_t c_PositionDetermiation = (1 << 21); + static const uint64_t c_Statistics = (1 << 22); + static const uint64_t c_FlagHits = (1 << 23); + static const uint64_t c_Diagnostics = (1 << 24); + static const uint64_t c_ResponseGeneration = (1 << 25); // IMPORTANT: diff --git a/include/MGUIOptionsTACcut.h b/include/MGUIOptionsTACcal.h similarity index 71% rename from include/MGUIOptionsTACcut.h rename to include/MGUIOptionsTACcal.h index d83df4cd..38cc9d76 100644 --- a/include/MGUIOptionsTACcut.h +++ b/include/MGUIOptionsTACcal.h @@ -1,5 +1,5 @@ /* - * MGUIOptionsTACcut.h + * MGUIOptionsTACcal.h * * Copyright (C) 2008-2010 by Jau-Shian Liang. * All rights reserved. @@ -9,8 +9,8 @@ */ -#ifndef __MGUIOptionsTACcut__ -#define __MGUIOptionsTACcut__ +#ifndef __MGUIOptionsTACcal__ +#define __MGUIOptionsTACcal__ //////////////////////////////////////////////////////////////////////////////// @@ -43,14 +43,14 @@ class MGUIEEntry; //////////////////////////////////////////////////////////////////////////////// -class MGUIOptionsTACcut : public MGUIOptions +class MGUIOptionsTACcal : public MGUIOptions { // public Session: public: //! Default constructor - MGUIOptionsTACcut(MModule* Module); + MGUIOptionsTACcal(MModule* Module); //! Default destructor - virtual ~MGUIOptionsTACcut(); + virtual ~MGUIOptionsTACcal(); //! Process all button, etc. messages virtual bool ProcessMessage(long Message, long Parameter1, long Parameter2); @@ -58,13 +58,22 @@ class MGUIOptionsTACcut : public MGUIOptions //! The creation part which gets overwritten virtual void Create(); + // protected methods: protected: //! Actions after the Apply or OK button has been pressed virtual bool OnApply(); + //! Toggle TAC cut radio buttons and coincidence window entry + void ToggleRadioButtons(int WidgetID); + //! Widget IDs + enum { + c_TACCutIgnore = 120, + c_TACCutApply = 121 + }; + // protected members: protected: //! The detector IDs as a string @@ -73,9 +82,14 @@ class MGUIOptionsTACcut : public MGUIOptions //! Select TAC Calibration file to load, converts readout timing to nanoseconds MGUIEFileSelector* m_TACCalFileSelector; - //! Select TAC Cut file to load, which specifies the parameters for removing strip hits - MGUIEFileSelector* m_TACCutFileSelector; + //! Do not apply TAC cuts + TGRadioButton* m_TACCutRBIgnore; + + //! Apply TAC cuts + TGRadioButton* m_TACCutRBApply; + //! TAC coincidence window in ns + MGUIEEntry* m_CoincidenceWindow; // private members: private: @@ -83,7 +97,7 @@ class MGUIOptionsTACcut : public MGUIOptions #ifdef ___CLING___ public: - ClassDef(MGUIOptionsTACcut, 1) // basic class for dialog windows + ClassDef(MGUIOptionsTACcal, 1) // basic class for dialog windows #endif }; diff --git a/include/MModuleTACcut.h b/include/MModuleTACcal.h similarity index 68% rename from include/MModuleTACcut.h rename to include/MModuleTACcal.h index 5dcd29ac..58bbee7d 100644 --- a/include/MModuleTACcut.h +++ b/include/MModuleTACcal.h @@ -1,5 +1,5 @@ /* - * MModuleTACcut.h + * MModuleTACcal.h * * Copyright (C) by Andreas Zoglauer. * All rights reserved. @@ -9,90 +9,100 @@ */ -#ifndef __MModuleTACcut__ -#define __MModuleTACcut__ +#ifndef __MModuleTACcal__ +#define __MModuleTACcal__ //////////////////////////////////////////////////////////////////////////////// // Standard libs: -#include - -// ROOT libs: -#include "TGClient.h" -#include "TH1.h" // MEGAlib libs: #include "MGlobal.h" #include "MModule.h" -#include "MGUIExpoTACcut.h" -#include "MGUIExpoPlotSpectrum.h" // Forward declarations: +class MGUIExpoTACcut; +class MGUIExpoPlotSpectrum; //////////////////////////////////////////////////////////////////////////////// -class MModuleTACcut : public MModule +class MModuleTACcal : public MModule { // public interface: public: //! Default constructor - MModuleTACcut(); + MModuleTACcal(); //! Default destructor - virtual ~MModuleTACcut(); + virtual ~MModuleTACcal(); //! Create a new object of this class - virtual MModuleTACcut* Clone() { return new MModuleTACcut(); } + virtual MModuleTACcal* Clone() { return new MModuleTACcal(); } //! Initialize the module virtual bool Initialize(); - //! Create expos - virtual void CreateExpos(); - //! Finalize the module virtual void Finalize(); - //! Main data analysis routine, which updates the event to a new level - virtual bool AnalyzeEvent(MReadOutAssembly* Event); + //! Create Expos + virtual void CreateExpos(); //! Show the options GUI virtual void ShowOptionsGUI(); + //! Main data analysis routine, which updates the event to a new level + virtual bool AnalyzeEvent(MReadOutAssembly* Event); //! Read the configuration data from an XML node virtual bool ReadXmlConfiguration(MXmlNode* Node); + //! Create an XML node tree from the configuration virtual MXmlNode* CreateXmlConfiguration(); - ///////////// Creating functions that will update and get the min/max TAC values ////////////////////////// - //! Set filename for TAC calibration void SetTACCalFileName( const MString& FileName) {m_TACCalFile = FileName;} + //! Get filename for TAC calibration MString GetTACCalFileName() const {return m_TACCalFile;} - //! Set filename for TAC cut - void SetTACCutFileName( const MString& FileName) {m_TACCutFile = FileName;} - //! Get filename for TAC cut - MString GetTACCutFileName() const {return m_TACCutFile;} - //! Load the TAC calibration file bool LoadTACCalFile(MString FName); - //! Load the TAC cut file - bool LoadTACCutFile(MString FName); - //! Set the TAC calibration parameters void SetTACCalParameters(unordered_map>>> TACCal) { m_TACCal = TACCal; } //! Get the TAC calibration parameters unordered_map>>> GetTACCalParameters() { return m_TACCal; } + //! Enable or disable TAC cuts + void SetApplyTACCuts(bool ApplyTACCuts) + { + m_ApplyTACCuts = ApplyTACCuts; + } + + //! Return whether TAC cuts are enabled + bool GetApplyTACCuts() const + { + return m_ApplyTACCuts; + } + + //! Set TAC coincidence window in ns + void SetCoincidenceWindow(double CoincidenceWindow) + { + m_CoincidenceWindow = CoincidenceWindow; + } + + //! Get TAC coincidence window in ns + double GetCoincidenceWindow() const + { + return m_CoincidenceWindow; + } + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -104,6 +114,8 @@ class MModuleTACcut : public MModule // private methods: private: + //! Apply TAC cuts to calibrated strip hits + bool ApplyTACCuts(MReadOutAssembly* Event); // protected members: @@ -115,29 +127,29 @@ class MModuleTACcut : public MModule //! TAC calibration parameter file name MString m_TACCalFile; - //! TAC cut parameter files - MString m_TACCutFile; - //! Map DetID -> Side (LV=0, HV=1) -> Strip ID -> TAC calibration parameters unordered_map>>> m_TACCal; - //! Map DetID -> Side (LV=0, HV=1) -> Strip ID -> TAC cut parameters - unordered_map>>> m_TACCut; - - //! Map characters representing sides of the detectors indices to avoid mistakes + //! Map characters representing detector sides to LV/HV indices unordered_map m_SideToIndex; //! Vector of Detector IDs vector m_DetectorIDs; - MGUIExpoTACcut* m_ExpoTACcut; + //! TAC coincidence window in ns + double m_CoincidenceWindow; + //! Option to apply TAC cuts after TAC calibration + bool m_ApplyTACCuts; + + //! TAC distribution and energy spectra + MGUIExpoTACcut* m_ExpoTACcut; MGUIExpoPlotSpectrum* m_ExpoEnergySpectrum; #ifdef ___CLING___ public: - ClassDef(MModuleTACcut, 0) // no description + ClassDef(MModuleTACcal, 0) // no description #endif }; diff --git a/src/MAssembly.cxx b/src/MAssembly.cxx index eb778940..68ac5d38 100644 --- a/src/MAssembly.cxx +++ b/src/MAssembly.cxx @@ -74,7 +74,7 @@ using namespace std; #include "MModuleSaverMeasurementsFITS.h" #include "MModuleResponseGenerator.h" #include "MModuleRevan.h" -#include "MModuleTACcut.h" +#include "MModuleTACcal.h" // #include "MModuleNearestNeighbor.h" #include "MModuleDiagnostics.h" #include "MModuleDiagnosticsEnergyPerStrip.h" @@ -145,7 +145,7 @@ MAssembly::MAssembly() m_Supervisor->AddAvailableModule(new MModuleTransmitterRealta()); m_Supervisor->AddAvailableModule(new MModuleResponseGenerator()); m_Supervisor->AddAvailableModule(new MModuleRevan()); - m_Supervisor->AddAvailableModule(new MModuleTACcut()); + m_Supervisor->AddAvailableModule(new MModuleTACcal()); // m_Supervisor->AddAvailableModule(new MModuleNearestNeighbor()); m_Supervisor->AddAvailableModule(new MModuleDiagnostics()); diff --git a/src/MGUIOptionsTACcut.cxx b/src/MGUIOptionsTACcut.cxx index 3b953acf..139d52a1 100644 --- a/src/MGUIOptionsTACcut.cxx +++ b/src/MGUIOptionsTACcut.cxx @@ -1,6 +1,5 @@ /* - * MGUIOptionsTACcut -.cxx + * MGUIOptionsTACcal.cxx * * * Copyright (C) by Andreas Zoglauer, Nicole Rodriguez Cavero @@ -19,7 +18,7 @@ // Include the header: -#include "MGUIOptionsTACcut.h" +#include "MGUIOptionsTACcal.h" // Standard libs: @@ -38,14 +37,14 @@ #include "MGUIEEntry.h" // Nuclearizer libs: -#include "MModuleTACcut.h" +#include "MModuleTACcal.h" //////////////////////////////////////////////////////////////////////////////// #ifdef ___CLING___ -ClassImp(MGUIOptionsTACcut +ClassImp(MGUIOptionsTACcal ) #endif @@ -53,7 +52,7 @@ ClassImp(MGUIOptionsTACcut //////////////////////////////////////////////////////////////////////////////// -MGUIOptionsTACcut::MGUIOptionsTACcut(MModule* Module) +MGUIOptionsTACcal::MGUIOptionsTACcal(MModule* Module) : MGUIOptions(Module) { // standard constructor @@ -63,7 +62,7 @@ MGUIOptionsTACcut::MGUIOptionsTACcut(MModule* Module) //////////////////////////////////////////////////////////////////////////////// -MGUIOptionsTACcut::~MGUIOptionsTACcut() +MGUIOptionsTACcal::~MGUIOptionsTACcal() { // kDeepCleanup is activated } @@ -72,20 +71,93 @@ MGUIOptionsTACcut::~MGUIOptionsTACcut() //////////////////////////////////////////////////////////////////////////////// -void MGUIOptionsTACcut::Create() +void MGUIOptionsTACcal::Create() { PreCreate(); - m_TACCalFileSelector = new MGUIEFileSelector(m_OptionsFrame, "Select a TAC Calibration file:", dynamic_cast(m_Module)->GetTACCalFileName()); + m_TACCalFileSelector = new MGUIEFileSelector( + m_OptionsFrame, + "Select a TAC Calibration file:", + dynamic_cast(m_Module)->GetTACCalFileName() + ); + m_TACCalFileSelector->SetFileType("TAC", "*.csv"); - TGLayoutHints* TACCalLayout = new TGLayoutHints(kLHintsTop | kLHintsCenterX | kLHintsExpandX, 10, 10, 10, 10); + + TGLayoutHints* TACCalLayout = + new TGLayoutHints( + kLHintsTop | kLHintsCenterX | kLHintsExpandX, + 10, 10, 10, 10 + ); + m_OptionsFrame->AddFrame(m_TACCalFileSelector, TACCalLayout); - m_TACCutFileSelector = new MGUIEFileSelector(m_OptionsFrame, "Select a TAC Cut file:", dynamic_cast(m_Module)->GetTACCutFileName()); - m_TACCutFileSelector->SetFileType("TAC", "*.csv"); - TGLayoutHints* TACCutLayout = new TGLayoutHints(kLHintsTop | kLHintsCenterX | kLHintsExpandX, 10, 10, 10, 10); - m_OptionsFrame->AddFrame(m_TACCutFileSelector, TACCutLayout); - + TGLayoutHints* LabelLayout = + new TGLayoutHints( + kLHintsTop | kLHintsLeft, + 10, 10, 10, 5 + ); + + TGLayoutHints* RBLayout = + new TGLayoutHints( + kLHintsTop | kLHintsLeft, + 20, 10, 5, 5 + ); + + TGLayoutHints* RBOptionLayout = + new TGLayoutHints( + kLHintsTop | kLHintsLeft | kLHintsExpandX, + 40, 10, 5, 10 + ); + + TGLabel* TACCutLabel = + new TGLabel(m_OptionsFrame, + "Please choose how to handle TAC cuts:"); + + m_OptionsFrame->AddFrame(TACCutLabel, LabelLayout); + + m_TACCutRBIgnore = + new TGRadioButton( + m_OptionsFrame, + "Do not apply TAC cuts", + c_TACCutIgnore + ); + + m_TACCutRBIgnore->Associate(this); + m_OptionsFrame->AddFrame(m_TACCutRBIgnore, RBLayout); + + m_TACCutRBApply = + new TGRadioButton( + m_OptionsFrame, + "Apply TAC cuts", + c_TACCutApply + ); + + m_TACCutRBApply->Associate(this); + m_OptionsFrame->AddFrame(m_TACCutRBApply, RBLayout); + + m_CoincidenceWindow = + new MGUIEEntry( + m_OptionsFrame, + "Set coincidence window [ns]:", + false, + dynamic_cast(m_Module)->GetCoincidenceWindow(), + true, + 0.0 + ); + + m_OptionsFrame->AddFrame( + m_CoincidenceWindow, + RBOptionLayout + ); + + bool ApplyTACCuts = dynamic_cast(m_Module)->GetApplyTACCuts(); + + if (ApplyTACCuts == true) { + ToggleRadioButtons(c_TACCutApply); + } else { + ToggleRadioButtons(c_TACCutIgnore); + } + PostCreate(); } @@ -93,7 +165,7 @@ void MGUIOptionsTACcut::Create() //////////////////////////////////////////////////////////////////////////////// -bool MGUIOptionsTACcut::ProcessMessage(long Message, long Parameter1, long Parameter2) +bool MGUIOptionsTACcal::ProcessMessage(long Message, long Parameter1, long Parameter2) { // Modify here if you have more buttons @@ -104,6 +176,14 @@ bool MGUIOptionsTACcut::ProcessMessage(long Message, long Parameter1, long Param switch (GET_SUBMSG(Message)) { case kCM_BUTTON: break; + + case kCM_RADIOBUTTON: + ToggleRadioButtons(Parameter1); + break; + + case kCM_CHECKBUTTON: + break; + default: break; } @@ -124,15 +204,48 @@ bool MGUIOptionsTACcut::ProcessMessage(long Message, long Parameter1, long Param //////////////////////////////////////////////////////////////////////////////// -bool MGUIOptionsTACcut::OnApply() +bool MGUIOptionsTACcal::OnApply() { // Store the data in the module - dynamic_cast(m_Module)->SetTACCalFileName(m_TACCalFileSelector->GetFileName()); - dynamic_cast(m_Module)->SetTACCutFileName(m_TACCutFileSelector->GetFileName()); + dynamic_cast(m_Module)->SetTACCalFileName(m_TACCalFileSelector->GetFileName()); + + // Apply TAC cuts or not + if (m_TACCutRBIgnore->GetState() == kButtonDown) { + dynamic_cast(m_Module)-> + SetApplyTACCuts(false); + } else if (m_TACCutRBApply->GetState() == kButtonDown) { + dynamic_cast(m_Module)-> + SetApplyTACCuts(true); + } + // Coincidence window + dynamic_cast(m_Module)-> + SetCoincidenceWindow( + m_CoincidenceWindow->GetAsDouble() + ); return true; } +//////////////////////////////////////////////////////////////////////////////// + +void MGUIOptionsTACcal::ToggleRadioButtons(int WidgetID) +{ + if (WidgetID == c_TACCutIgnore) { + + m_TACCutRBIgnore->SetState(kButtonDown); + m_TACCutRBApply->SetState(kButtonUp); + + m_CoincidenceWindow->SetEnabled(false); + + } else if (WidgetID == c_TACCutApply) { + + m_TACCutRBIgnore->SetState(kButtonUp); + m_TACCutRBApply->SetState(kButtonDown); + + m_CoincidenceWindow->SetEnabled(true); + } +} + -// MGUIOptionsTACcut: the end... +// MGUIOptionsTACcal: the end... //////////////////////////////////////////////////////////////////////////////// diff --git a/src/MModuleTACcut.cxx b/src/MModuleTACcut.cxx index cce99437..ac8c3dbf 100644 --- a/src/MModuleTACcut.cxx +++ b/src/MModuleTACcut.cxx @@ -1,5 +1,5 @@ /* - * MModuleTACcut.cxx + * MModuleTACcal.cxx * * * Copyright (C) by Andreas Zoglauer, Nicole Rodriquez Cavero @@ -19,40 +19,42 @@ //////////////////////////////////////////////////////////////////////////////// // -// MModuleTACcut +// MModuleTACcal // //////////////////////////////////////////////////////////////////////////////// // Include the header: -#include "MModuleTACcut.h" +#include "MModuleTACcal.h" +#include "MGUIExpoTACcut.h" +#include "MGUIExpoPlotSpectrum.h" +#include "MGUIOptionsTACcal.h" // Standard libs: +#include +#include // ROOT libs: -#include "TGClient.h" + // MEGAlib libs: #include "MModule.h" -#include "MGUIOptionsTACcut.h" -#include "MGUIExpoTACcut.h" -#include "MGUIExpoPlotSpectrum.h" //////////////////////////////////////////////////////////////////////////////// #ifdef ___CLING___ -ClassImp(MModuleTACcut) +ClassImp(MModuleTACcal) #endif //////////////////////////////////////////////////////////////////////////////// -MModuleTACcut::MModuleTACcut() : MModule() +MModuleTACcal::MModuleTACcal() : MModule() { - // Construct an instance of MModuleTACcut + // Construct an instance of MModuleTACcal // Set all module relevant information @@ -60,14 +62,14 @@ MModuleTACcut::MModuleTACcut() : MModule() m_Name = "TAC Calibration"; // Set the XML tag --- has to be unique --- no spaces allowed - m_XmlTag = "XmlTagTACcut"; + m_XmlTag = "XmlTagTACcal"; // Set all modules, which have to be done before this module AddPreceedingModuleType(MAssembly::c_EventLoader); AddPreceedingModuleType(MAssembly::c_EnergyCalibration); // Set all types this modules handles - AddModuleType(MAssembly::c_TACcut); + AddModuleType(MAssembly::c_TACcal); // Set all modules, which can follow this module AddSucceedingModuleType(MAssembly::c_StripPairing); @@ -76,7 +78,7 @@ MModuleTACcut::MModuleTACcut() : MModule() // Set if this module has an options GUI // Overwrite ShowOptionsGUI() with the call to the GUI! m_HasOptionsGUI = true; - // If true, you have to derive a class from MGUIOptions (use MGUIOptionsTACcut) + // If true, you have to derive a class from MGUIOptions (use MGUIOptionsTACcal) // and implement all your GUI options // Can the program be run multi-threaded @@ -85,23 +87,30 @@ MModuleTACcut::MModuleTACcut() : MModule() // Can we use multiple instances of this class m_AllowMultipleInstances = true; + // Applying taccuts by default + m_ApplyTACCuts = true; + + // Default coincidence window in ns + m_CoincidenceWindow = 600.0; + m_SideToIndex = {{'l', 0}, {'h', 1}, {'0', 0}, {'1', 1}, {'p', 0}, {'n', 1}}; + } //////////////////////////////////////////////////////////////////////////////// -MModuleTACcut::~MModuleTACcut() +MModuleTACcal::~MModuleTACcal() { - // Delete this instance of MModuleTACcut + // Delete this instance of MModuleTACcal } //////////////////////////////////////////////////////////////////////////////// -bool MModuleTACcut::Initialize() +bool MModuleTACcal::Initialize() { // Initialize the module @@ -110,157 +119,215 @@ bool MModuleTACcut::Initialize() return false; } - if (LoadTACCutFile(m_TACCutFile) == false) { - cout<SetTACHistogramArrangement(m_DetectorIDs); + for (unsigned int i = 0; i < m_DetectorIDs.size(); ++i) { unsigned int DetID = m_DetectorIDs[i]; m_ExpoTACcut->SetTACHistogramParameters(DetID, 200, 0, 6000); } + m_Expos.push_back(m_ExpoTACcut); - - // Set the energy histogram display + m_ExpoEnergySpectrum = new MGUIExpoPlotSpectrum(this); m_Expos.push_back(m_ExpoEnergySpectrum); } //////////////////////////////////////////////////////////////////////////////// +void MModuleTACcal::ShowOptionsGUI() +{ + MGUIOptionsTACcal* Options = + new MGUIOptionsTACcal(this); + + Options->Create(); + gClient->WaitForUnmap(Options); +} + +//////////////////////////////////////////////////////////////////////////////// -bool MModuleTACcut::AnalyzeEvent(MReadOutAssembly* Event) +bool MModuleTACcal::AnalyzeEvent(MReadOutAssembly* Event) { - // Start with sanity checks: + if (HasExpos()) { + for (unsigned int i = 0; i < Event->GetNStripHits(); ++i) { + + MStripHit* SH = Event->GetStripHit(i); + + m_ExpoEnergySpectrum->AddEnergyInitial( + SH->GetEnergy(), + SH->IsNearestNeighbor(), + SH->IsLowVoltageStrip() + ); + } + } + + // Loop through all strip hits in the event for (unsigned int i = 0; i < Event->GetNStripHits(); ++i) { + // Get the current strip hit MStripHit* SH = Event->GetStripHit(i); - int DetID = SH->GetDetectorID(); - int StripID = SH->GetStripID(); - char Side = SH->IsLowVoltageStrip() ? 'l' : 'h'; - - // This captures every single hit before we delete any of them. - if (HasExpos()) { - m_ExpoEnergySpectrum->AddEnergyInitial(SH->GetEnergy(), SH->IsNearestNeighbor(), SH->IsLowVoltageStrip()); - } + // Guard rings are intentionally not TAC calibrated + if (SH->IsGuardRing() == false) { - if (DetID >= m_TACCal.size()) { - cout<IsGuardRing() == false) { - cout<= m_TACCal[DetID][m_SideToIndex[Side]].size()) && (SH->IsGuardRing()==false)) { - cout<= m_TACCut.size()) { - cout<GetDetectorID(); + int StripID = SH->GetStripID(); + char Side = SH->IsLowVoltageStrip() ? 'l' : 'h'; + + // Check that this detector exists in the TAC calibration + if (m_TACCal.find(DetID) == m_TACCal.end()) { + cout<GetTAC(); + + // Convert TAC value into timing in ns + double ns_timing = + TAC_timing*m_TACCal[DetID][SideIndex][StripID][0] + + m_TACCal[DetID][SideIndex][StripID][1]; + + // Store calibrated timing + SH->SetTiming(ns_timing); } - if (m_TACCut[DetID][m_SideToIndex[Side]][StripID].size() == 0 && SH->IsGuardRing()==false) { - cout<SetAnalysisProgress(MAssembly::c_TACcal); + + if (m_ApplyTACCuts == true) { + if (ApplyTACCuts(Event) == false) { return false; } - if ((StripID >= m_TACCut[DetID][m_SideToIndex[Side]].size()) && (SH->IsGuardRing()==false)) { - cout<GetNStripHits(); ++i) { + + MStripHit* SH = Event->GetStripHit(i); + + m_ExpoEnergySpectrum->AddEnergyFinal( + SH->GetEnergy(), + SH->IsNearestNeighbor(), + SH->IsLowVoltageStrip() + ); + + if ((SH->IsGuardRing() == false) && + (SH->HasFastTiming() == true)) { + + m_ExpoTACcut->AddTAC( + SH->GetDetectorID(), + SH->GetTiming() + ); + } } } + + return true; +} + +//////////////////////////////////////////////////////////////////////////////// +bool MModuleTACcal::ApplyTACCuts(MReadOutAssembly* Event) +{ + // Find the max timing value for non-NN hits of an event + // This will be used for the coincidence window double MaxTAC = -numeric_limits::max(); + for (unsigned int i = 0; i < Event->GetNStripHits(); ++i) { MStripHit* SH = Event->GetStripHit(i); - double TAC_timing = SH->GetTAC(); - double ns_timing = 0; - int DetID = SH->GetDetectorID(); - int StripID = SH->GetStripID(); - char Side = SH->IsLowVoltageStrip() ? 'l' : 'h'; - if ((TAC_timing == 0) || (SH->IsGuardRing() == true)) { - SH->HasCalibratedTiming(false); - } else { - ns_timing = TAC_timing*m_TACCal[DetID][m_SideToIndex[Side]][StripID][0] + m_TACCal[DetID][m_SideToIndex[Side]][StripID][1]; - SH->HasCalibratedTiming(true); - } - SH->SetTiming(ns_timing); - if ((SH->HasCalibratedTiming()==true) && (ns_timing > MaxTAC) && (SH->HasFastTiming()==true) && (SH->IsNearestNeighbor()==false)) { - MaxTAC = ns_timing; + + if ((SH->IsGuardRing() == false) && (SH->HasFastTiming() == true) && (SH ->IsNearestNeighbor()==false)){ + double ns_timing = SH->GetTiming(); + + if (ns_timing> MaxTAC) { + MaxTAC = ns_timing; + } } } - + // 200ns appears to be the minimum acceptable timing value for Nearest Neighbor hits constexpr double c_MinNearestNeighborTiming = 200.0; + // TotalOffset: Earliest time (in ns) after which valid timing hits can appear, start of the allowed timing window + constexpr double TotalOffset = 3000.0; + + // Apply TAC cuts + for (unsigned int i = 0; i < Event->GetNStripHits();) { MStripHit* SH = Event->GetStripHit(i); bool Passed = true; - if ((SH->IsNearestNeighbor() == true) && (SH->HasCalibratedTiming() == false)) { // Nearest neighbor with slow timing + + // Nearest neighbor hit with slow timing + if ((SH->IsNearestNeighbor() == true) && (SH->HasFastTiming() == false)) { double SHTiming = SH->GetTiming(); if (SHTiming <= c_MinNearestNeighborTiming) { Passed = false; } - } else if ((SH->HasCalibratedTiming() == true) && (SH->IsGuardRing()==false)) { + + // All other non guard ring hits + } else if (SH->IsGuardRing()==false) { double SHTiming = SH->GetTiming(); - int DetID = SH->GetDetectorID(); - int StripID = SH->GetStripID(); - char Side = SH->IsLowVoltageStrip() ? 'l' : 'h'; - double FLNoiseCut = m_TACCut[DetID][m_SideToIndex[Side]][StripID][4]; - if ((SHTiming < FLNoiseCut)) { - Passed = false; - } else if (SH->HasFastTiming()==true) { - double ShapingOffset = m_TACCut[DetID][m_SideToIndex[Side]][StripID][0]; - double CoincidenceWindow = m_TACCut[DetID][m_SideToIndex[Side]][StripID][1]; - double DisableTime = m_TACCut[DetID][m_SideToIndex[Side]][StripID][2]; - double FlagToEnDelay = m_TACCut[DetID][m_SideToIndex[Side]][StripID][3]; - double FlagDelay = m_TACCut[DetID][m_SideToIndex[Side]][StripID][5]; - // double TotalOffset = ShapingOffset + DisableTime + FlagToEnDelay + FlagDelay; // Changing the total Offset based on data instead - // TotalOffset: Earliest time (in ns) after which valid timing hits can appear, start of the allowed timing window - constexpr double TotalOffset = 3000.0; - // TODO(@NicoleRodriguezCavero): Match TotalOffset with timing contributions from electronics, temporary number is a rough estimate - // HardCoincidenceWindow: Width of the valid coincidence region (after TotalOffset) during which multiple strip hits are considered part of the same event - constexpr double HardCoincidenceWindow = 600.0; - // TODO(@NicoleRodriguezCavero): Coincidence window subject to change pending more analysis - // if ((SHTiming > TotalOffset + CoincidenceWindow) || (SHTiming < TotalOffset) || (SHTiming < MaxTAC - CoincidenceWindow)) { - // Passed = false; - // } else if (HasExpos()==true) { - // m_ExpoTACcut->AddTAC(DetID, SHTiming); - // } - if ((SHTiming < TotalOffset) || (SHTiming < MaxTAC - HardCoincidenceWindow)) { //Eliminating the upper boundary condition and just using one cut based on the coincidence window + + //Fast-timing hits must satisfy true and chance coincidence cuts + if (SH->HasFastTiming()==true) { + + if ((SHTiming < TotalOffset) || (SHTiming < MaxTAC - m_CoincidenceWindow)) { Passed = false; - } else if (HasExpos()==true) { - m_ExpoTACcut->AddTAC(DetID, SHTiming); - m_ExpoEnergySpectrum->AddEnergyFinal(SH->GetEnergy(), SH->IsNearestNeighbor(), SH->IsLowVoltageStrip()); } } } + if (Passed == true) { ++i; } else { @@ -274,33 +341,18 @@ bool MModuleTACcut::AnalyzeEvent(MReadOutAssembly* Event) return true; } - //////////////////////////////////////////////////////////////////////////////// -void MModuleTACcut::Finalize() +void MModuleTACcal::Finalize() { MModule::Finalize(); } - //////////////////////////////////////////////////////////////////////////////// -void MModuleTACcut::ShowOptionsGUI() -{ - //! Show the options GUI --- has to be overwritten! - - MGUIOptionsTACcut* Options = new MGUIOptionsTACcut(this); - Options->Create(); - gClient->WaitForUnmap(Options); -} - - -//////////////////////////////////////////////////////////////////////////////// - - -bool MModuleTACcut::ReadXmlConfiguration(MXmlNode* Node) +bool MModuleTACcal::ReadXmlConfiguration(MXmlNode* Node) { //! Read the configuration data from an XML node @@ -309,9 +361,22 @@ bool MModuleTACcut::ReadXmlConfiguration(MXmlNode* Node) SetTACCalFileName(TACCalFileNameNode->GetValue()); } - MXmlNode* TACCutFileNameNode = Node->GetNode("TACCutFileName"); - if (TACCutFileNameNode != nullptr) { - SetTACCutFileName(TACCutFileNameNode->GetValue()); + MXmlNode* ApplyTACCutsNode = Node->GetNode("ApplyTACCuts"); + if (ApplyTACCutsNode != nullptr) { + SetApplyTACCuts(ApplyTACCutsNode->GetValueAsBoolean()); + } + + MXmlNode* TACCutNode = Node->GetNode("TACCut"); + if (TACCutNode != nullptr) { + + MXmlNode* CoincidenceWindowNode = + TACCutNode->GetNode("CoincidenceWindow"); + + if (CoincidenceWindowNode != nullptr) { + SetCoincidenceWindow( + CoincidenceWindowNode->GetValueAsDouble() + ); + } } return true; @@ -321,14 +386,24 @@ bool MModuleTACcut::ReadXmlConfiguration(MXmlNode* Node) //////////////////////////////////////////////////////////////////////////////// -MXmlNode* MModuleTACcut::CreateXmlConfiguration() +MXmlNode* MModuleTACcal::CreateXmlConfiguration() { //! Create an XML node tree from the configuration MXmlNode* Node = new MXmlNode(0, m_XmlTag); new MXmlNode(Node, "TACCalFileName", m_TACCalFile); - new MXmlNode(Node, "TACCutFileName", m_TACCutFile); + + new MXmlNode(Node, "ApplyTACCuts", m_ApplyTACCuts); + + MXmlNode* TACCutNode = + new MXmlNode(Node, "TACCut"); + + new MXmlNode( + TACCutNode, + "CoincidenceWindow", + m_CoincidenceWindow + ); return Node; } @@ -337,7 +412,7 @@ MXmlNode* MModuleTACcut::CreateXmlConfiguration() //////////////////////////////////////////////////////////////////////////////// -bool MModuleTACcut::LoadTACCalFile(MString FName) +bool MModuleTACcal::LoadTACCalFile(MString FName) { // Read in the TAC Calibration file, which should contain for each strip: // DetID, Side (h or l for high or low voltage), TAC cal, TAC cal error, TAC cal offset, TAC offset error @@ -372,6 +447,7 @@ bool MModuleTACcut::LoadTACCalFile(MString FName) vector CalValues; CalValues.push_back(TACCal); CalValues.push_back(Offset); CalValues.push_back(TACCalError); CalValues.push_back(OffsetError); + // If this detector has not been encountered yet, create LV and HV calibration maps for it if (m_TACCal.find(DetID) == m_TACCal.end()) { vector>> TempVector; unordered_map> TempMapLV; @@ -381,10 +457,12 @@ bool MModuleTACcut::LoadTACCalFile(MString FName) m_TACCal[DetID].push_back(TempMapHV); } + // Keep track of detector IDs contained in the calibration if (find(m_DetectorIDs.begin(), m_DetectorIDs.end(), DetID) == m_DetectorIDs.end()) { m_DetectorIDs.push_back(DetID); } + // Store the calibration parameters if (m_SideToIndex.find(Side) != m_SideToIndex.end()) { m_TACCal[DetID][m_SideToIndex[Side]][StripID] = CalValues; } else { @@ -401,90 +479,7 @@ bool MModuleTACcut::LoadTACCalFile(MString FName) return true; } - -//////////////////////////////////////////////////////////////////////////////// - - -bool MModuleTACcut::LoadTACCutFile(MString FName) -{ - // Read in the TAC Cut file, which should contain for each strip: - // DetID, h or l for high or low voltage, StripID, shaping offset, coincidence window - // or new format: - // DetID, h or l for high or low voltage, StripID, shaping offset, coincidence window, disable time, flag-to-enable delay, FL noise cut, flag delay - MFile F; - bool OldFormatMessage = false; - if (F.Open(FName) == false) { - cout< Tokens = Line.Tokenize(","); - if (Tokens.size() >= 5) { - int DetID = Tokens[0].ToInt(); - MString SideString = Tokens[1]; - char Side; - if (SideString.Length()!=1) { - cout< CutParams; - CutParams.push_back(ShapingOffset); CutParams.push_back(CoincidenceWindow); CutParams.push_back(DisableTime); CutParams.push_back(FlagToEnDelay); CutParams.push_back(FLNoiseCut); CutParams.push_back(FlagDelay); - - if (m_TACCut.find(DetID) == m_TACCut.end()) { - vector>> TempVector; - unordered_map> TempMapLV; - unordered_map> TempMapHV; - m_TACCut[DetID] = TempVector; - m_TACCut[DetID].push_back(TempMapLV); - m_TACCut[DetID].push_back(TempMapHV); - } - - if (find(m_DetectorIDs.begin(), m_DetectorIDs.end(), DetID) == m_DetectorIDs.end()) { - m_DetectorIDs.push_back(DetID); - } - - if (m_SideToIndex.find(Side) != m_SideToIndex.end()) { - m_TACCut[DetID][m_SideToIndex[Side]][StripID] = CutParams; - } else { - cout< Date: Fri, 14 Aug 2026 12:53:49 -0700 Subject: [PATCH 03/15] Rename TACcut to TACcal --- src/{MGUIOptionsTACcut.cxx => MGUIOptionsTACcal.cxx} | 0 src/{MModuleTACcut.cxx => MModuleTACcal.cxx} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/{MGUIOptionsTACcut.cxx => MGUIOptionsTACcal.cxx} (100%) rename src/{MModuleTACcut.cxx => MModuleTACcal.cxx} (100%) diff --git a/src/MGUIOptionsTACcut.cxx b/src/MGUIOptionsTACcal.cxx similarity index 100% rename from src/MGUIOptionsTACcut.cxx rename to src/MGUIOptionsTACcal.cxx diff --git a/src/MModuleTACcut.cxx b/src/MModuleTACcal.cxx similarity index 100% rename from src/MModuleTACcut.cxx rename to src/MModuleTACcal.cxx From 5d6765d9e6832012d200c561a3f6bdb228f7c7b0 Mon Sep 17 00:00:00 2001 From: nicolerodriguezcavero Date: Fri, 14 Aug 2026 14:14:16 -0700 Subject: [PATCH 04/15] Renaming MinNearestNeighborTiming to FLNoiseCut --- src/MModuleTACcal.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MModuleTACcal.cxx b/src/MModuleTACcal.cxx index ac8c3dbf..63ccc252 100644 --- a/src/MModuleTACcal.cxx +++ b/src/MModuleTACcal.cxx @@ -297,7 +297,7 @@ bool MModuleTACcal::ApplyTACCuts(MReadOutAssembly* Event) } // 200ns appears to be the minimum acceptable timing value for Nearest Neighbor hits - constexpr double c_MinNearestNeighborTiming = 200.0; + constexpr double c_FLNoiseCut = 200.0; // TotalOffset: Earliest time (in ns) after which valid timing hits can appear, start of the allowed timing window constexpr double TotalOffset = 3000.0; @@ -311,7 +311,7 @@ bool MModuleTACcal::ApplyTACCuts(MReadOutAssembly* Event) // Nearest neighbor hit with slow timing if ((SH->IsNearestNeighbor() == true) && (SH->HasFastTiming() == false)) { double SHTiming = SH->GetTiming(); - if (SHTiming <= c_MinNearestNeighborTiming) { + if (SHTiming <= c_FLNoiseCut) { Passed = false; } From f47bdb808ae7d6d19b39e89e72cc611b42baa345 Mon Sep 17 00:00:00 2001 From: nicolerodriguezcavero Date: Fri, 14 Aug 2026 14:20:11 -0700 Subject: [PATCH 05/15] Applying FL Noise Cut to direct hits with slow timing --- src/MModuleTACcal.cxx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/MModuleTACcal.cxx b/src/MModuleTACcal.cxx index 63ccc252..15815f7e 100644 --- a/src/MModuleTACcal.cxx +++ b/src/MModuleTACcal.cxx @@ -308,20 +308,17 @@ bool MModuleTACcal::ApplyTACCuts(MReadOutAssembly* Event) MStripHit* SH = Event->GetStripHit(i); bool Passed = true; - // Nearest neighbor hit with slow timing - if ((SH->IsNearestNeighbor() == true) && (SH->HasFastTiming() == false)) { - double SHTiming = SH->GetTiming(); - if (SHTiming <= c_FLNoiseCut) { - Passed = false; - } - - // All other non guard ring hits - } else if (SH->IsGuardRing()==false) { + if (SH->IsGuardRing()==false) { double SHTiming = SH->GetTiming(); + // Nearest neighbor and direct hit with slow timing + if (SH->HasFastTiming() == false) { + if (SHTiming <= c_FLNoiseCut) { + Passed = false; + } + //Fast-timing hits must satisfy true and chance coincidence cuts - if (SH->HasFastTiming()==true) { - + } else { if ((SHTiming < TotalOffset) || (SHTiming < MaxTAC - m_CoincidenceWindow)) { Passed = false; } From a7dc24a39b14f0544b5c7d9169c23db6dd38e211 Mon Sep 17 00:00:00 2001 From: Felix Hagemann Date: Fri, 14 Aug 2026 14:24:06 -0700 Subject: [PATCH 06/15] CHG: Update nuclearizer config file in unit tests --- .../406-1/hdf5-to-tra.nuclearizer.cfg | 13 +- .../unittestdata/406-1/hp52406-1.taccut.csv | 131 ------------------ .../542-1/hdf5-to-tra.nuclearizer.cfg | 13 +- .../unittestdata/542-1/hp52542-1.taccut.csv | 131 ------------------ 4 files changed, 18 insertions(+), 270 deletions(-) delete mode 100644 resource/unittestdata/406-1/hp52406-1.taccut.csv delete mode 100644 resource/unittestdata/542-1/hp52542-1.taccut.csv diff --git a/resource/unittestdata/406-1/hdf5-to-tra.nuclearizer.cfg b/resource/unittestdata/406-1/hdf5-to-tra.nuclearizer.cfg index f26a70d2..88e4a59f 100644 --- a/resource/unittestdata/406-1/hdf5-to-tra.nuclearizer.cfg +++ b/resource/unittestdata/406-1/hdf5-to-tra.nuclearizer.cfg @@ -3,7 +3,7 @@ XmlTagMeasurementLoaderHDF EnergyCalibration - XmlTagTACcut + XmlTagTACcal XmlTagStripPairingMultiRoundChiSquare DepthCalibration XmlTagRevan @@ -52,9 +52,14 @@ $(NUCLEARIZER)/resource/unittestdata/406-1/hp52406-1.revan.cfg - + $(NUCLEARIZER)/resource/unittestdata/406-1/hp52406-1.taccal.csv - $(NUCLEARIZER)/resource/unittestdata/406-1/hp52406-1.taccut.csv - + true + + 600 + + + + diff --git a/resource/unittestdata/406-1/hp52406-1.taccut.csv b/resource/unittestdata/406-1/hp52406-1.taccut.csv deleted file mode 100644 index 8a92b7cb..00000000 --- a/resource/unittestdata/406-1/hp52406-1.taccut.csv +++ /dev/null @@ -1,131 +0,0 @@ -# DetID,Strip voltage, StripID, Shaping Offset, Coincidence Window, Disable Time, Flag-to-enable Delay, FL noise cut, Flag delay -0,l,0,2255,500,1400,100,200,200 -0,l,1,2255,500,1400,100,200,200 -0,l,2,2255,500,1400,100,200,200 -0,l,3,2255,500,1400,100,200,200 -0,l,4,2255,500,1400,100,200,200 -0,l,5,2255,500,1400,100,200,200 -0,l,6,2255,500,1400,100,200,200 -0,l,7,2255,500,1400,100,200,200 -0,l,8,2255,500,1400,100,200,200 -0,l,9,2255,500,1400,100,200,200 -0,l,10,2255,500,1400,100,200,200 -0,l,11,2255,500,1400,100,200,200 -0,l,12,2255,500,1400,100,200,200 -0,l,13,2255,500,1400,100,200,200 -0,l,14,2255,500,1400,100,200,200 -0,l,15,2255,500,1400,100,200,200 -0,l,16,2255,500,1400,100,200,200 -0,l,17,2255,500,1400,100,200,200 -0,l,18,2255,500,1400,100,200,200 -0,l,19,2255,500,1400,100,200,200 -0,l,20,2255,500,1400,100,200,200 -0,l,21,2255,500,1400,100,200,200 -0,l,22,2255,500,1400,100,200,200 -0,l,23,2255,500,1400,100,200,200 -0,l,24,2255,500,1400,100,200,200 -0,l,25,2255,500,1400,100,200,200 -0,l,26,2255,500,1400,100,200,200 -0,l,27,2255,500,1400,100,200,200 -0,l,28,2255,500,1400,100,200,200 -0,l,29,2255,500,1400,100,200,200 -0,l,30,2255,500,1400,100,200,200 -0,l,31,2255,500,1400,100,200,200 -0,l,32,2255,500,1400,100,200,200 -0,l,33,2255,500,1400,100,200,200 -0,l,34,2255,500,1400,100,200,200 -0,l,35,2255,500,1400,100,200,200 -0,l,36,2255,500,1400,100,200,200 -0,l,37,2255,500,1400,100,200,200 -0,l,38,2255,500,1400,100,200,200 -0,l,39,2255,500,1400,100,200,200 -0,l,40,2255,500,1400,100,200,200 -0,l,41,2255,500,1400,100,200,200 -0,l,42,2255,500,1400,100,200,200 -0,l,43,2255,500,1400,100,200,200 -0,l,44,2255,500,1400,100,200,200 -0,l,45,2255,500,1400,100,200,200 -0,l,46,2255,500,1400,100,200,200 -0,l,47,2255,500,1400,100,200,200 -0,l,48,2255,500,1400,100,200,200 -0,l,49,2255,500,1400,100,200,200 -0,l,50,2255,500,1400,100,200,200 -0,l,51,2255,500,1400,100,200,200 -0,l,52,2255,500,1400,100,200,200 -0,l,53,2255,500,1400,100,200,200 -0,l,54,2255,500,1400,100,200,200 -0,l,55,2255,500,1400,100,200,200 -0,l,56,2255,500,1400,100,200,200 -0,l,57,2255,500,1400,100,200,200 -0,l,58,2255,500,1400,100,200,200 -0,l,59,2255,500,1400,100,200,200 -0,l,60,2255,500,1400,100,200,200 -0,l,61,2255,500,1400,100,200,200 -0,l,62,2255,500,1400,100,200,200 -0,l,63,2255,500,1400,100,200,200 -0,l,64,2255,500,1400,100,200,200 -0,h,65,2255,500,1400,100,200,200 -0,h,0,2255,500,1400,100,200,200 -0,h,1,2255,500,1400,100,200,200 -0,h,2,2255,500,1400,100,200,200 -0,h,3,2255,500,1400,100,200,200 -0,h,4,2255,500,1400,100,200,200 -0,h,5,2255,500,1400,100,200,200 -0,h,6,2255,500,1400,100,200,200 -0,h,7,2255,500,1400,100,200,200 -0,h,8,2255,500,1400,100,200,200 -0,h,9,2255,500,1400,100,200,200 -0,h,10,2255,500,1400,100,200,200 -0,h,11,2255,500,1400,100,200,200 -0,h,12,2255,500,1400,100,200,200 -0,h,13,2255,500,1400,100,200,200 -0,h,14,2255,500,1400,100,200,200 -0,h,15,2255,500,1400,100,200,200 -0,h,16,2255,500,1400,100,200,200 -0,h,17,2255,500,1400,100,200,200 -0,h,18,2255,500,1400,100,200,200 -0,h,19,2255,500,1400,100,200,200 -0,h,20,2255,500,1400,100,200,200 -0,h,21,2255,500,1400,100,200,200 -0,h,22,2255,500,1400,100,200,200 -0,h,23,2255,500,1400,100,200,200 -0,h,24,2255,500,1400,100,200,200 -0,h,25,2255,500,1400,100,200,200 -0,h,26,2255,500,1400,100,200,200 -0,h,27,2255,500,1400,100,200,200 -0,h,28,2255,500,1400,100,200,200 -0,h,29,2255,500,1400,100,200,200 -0,h,30,2255,500,1400,100,200,200 -0,h,31,2255,500,1400,100,200,200 -0,h,32,2255,500,1400,100,200,200 -0,h,33,2255,500,1400,100,200,200 -0,h,34,2255,500,1400,100,200,200 -0,h,35,2255,500,1400,100,200,200 -0,h,36,2255,500,1400,100,200,200 -0,h,37,2255,500,1400,100,200,200 -0,h,38,2255,500,1400,100,200,200 -0,h,39,2255,500,1400,100,200,200 -0,h,40,2255,500,1400,100,200,200 -0,h,41,2255,500,1400,100,200,200 -0,h,42,2255,500,1400,100,200,200 -0,h,43,2255,500,1400,100,200,200 -0,h,44,2255,500,1400,100,200,200 -0,h,45,2255,500,1400,100,200,200 -0,h,46,2255,500,1400,100,200,200 -0,h,47,2255,500,1400,100,200,200 -0,h,48,2255,500,1400,100,200,200 -0,h,49,2255,500,1400,100,200,200 -0,h,50,2255,500,1400,100,200,200 -0,h,51,2255,500,1400,100,200,200 -0,h,52,2255,500,1400,100,200,200 -0,h,53,2255,500,1400,100,200,200 -0,h,54,2255,500,1400,100,200,200 -0,h,55,2255,500,1400,100,200,200 -0,h,56,2255,500,1400,100,200,200 -0,h,57,2255,500,1400,100,200,200 -0,h,58,2255,500,1400,100,200,200 -0,h,59,2255,500,1400,100,200,200 -0,h,60,2255,500,1400,100,200,200 -0,h,61,2255,500,1400,100,200,200 -0,h,62,2255,500,1400,100,200,200 -0,h,63,2255,500,1400,100,200,200 diff --git a/resource/unittestdata/542-1/hdf5-to-tra.nuclearizer.cfg b/resource/unittestdata/542-1/hdf5-to-tra.nuclearizer.cfg index c7e75bdd..63cb707b 100644 --- a/resource/unittestdata/542-1/hdf5-to-tra.nuclearizer.cfg +++ b/resource/unittestdata/542-1/hdf5-to-tra.nuclearizer.cfg @@ -3,7 +3,7 @@ XmlTagMeasurementLoaderHDF EnergyCalibration - XmlTagTACcut + XmlTagTACcal XmlTagStripPairingMultiRoundChiSquare DepthCalibration XmlTagRevan @@ -52,9 +52,14 @@ $(NUCLEARIZER)/resource/unittestdata/542-1/hp52542-1.revan.cfg - + $(NUCLEARIZER)/resource/unittestdata/542-1/hp52542-1.taccal.csv - $(NUCLEARIZER)/resource/unittestdata/542-1/hp52542-1.taccut.csv - + true + + 600 + + + + diff --git a/resource/unittestdata/542-1/hp52542-1.taccut.csv b/resource/unittestdata/542-1/hp52542-1.taccut.csv deleted file mode 100644 index 8a92b7cb..00000000 --- a/resource/unittestdata/542-1/hp52542-1.taccut.csv +++ /dev/null @@ -1,131 +0,0 @@ -# DetID,Strip voltage, StripID, Shaping Offset, Coincidence Window, Disable Time, Flag-to-enable Delay, FL noise cut, Flag delay -0,l,0,2255,500,1400,100,200,200 -0,l,1,2255,500,1400,100,200,200 -0,l,2,2255,500,1400,100,200,200 -0,l,3,2255,500,1400,100,200,200 -0,l,4,2255,500,1400,100,200,200 -0,l,5,2255,500,1400,100,200,200 -0,l,6,2255,500,1400,100,200,200 -0,l,7,2255,500,1400,100,200,200 -0,l,8,2255,500,1400,100,200,200 -0,l,9,2255,500,1400,100,200,200 -0,l,10,2255,500,1400,100,200,200 -0,l,11,2255,500,1400,100,200,200 -0,l,12,2255,500,1400,100,200,200 -0,l,13,2255,500,1400,100,200,200 -0,l,14,2255,500,1400,100,200,200 -0,l,15,2255,500,1400,100,200,200 -0,l,16,2255,500,1400,100,200,200 -0,l,17,2255,500,1400,100,200,200 -0,l,18,2255,500,1400,100,200,200 -0,l,19,2255,500,1400,100,200,200 -0,l,20,2255,500,1400,100,200,200 -0,l,21,2255,500,1400,100,200,200 -0,l,22,2255,500,1400,100,200,200 -0,l,23,2255,500,1400,100,200,200 -0,l,24,2255,500,1400,100,200,200 -0,l,25,2255,500,1400,100,200,200 -0,l,26,2255,500,1400,100,200,200 -0,l,27,2255,500,1400,100,200,200 -0,l,28,2255,500,1400,100,200,200 -0,l,29,2255,500,1400,100,200,200 -0,l,30,2255,500,1400,100,200,200 -0,l,31,2255,500,1400,100,200,200 -0,l,32,2255,500,1400,100,200,200 -0,l,33,2255,500,1400,100,200,200 -0,l,34,2255,500,1400,100,200,200 -0,l,35,2255,500,1400,100,200,200 -0,l,36,2255,500,1400,100,200,200 -0,l,37,2255,500,1400,100,200,200 -0,l,38,2255,500,1400,100,200,200 -0,l,39,2255,500,1400,100,200,200 -0,l,40,2255,500,1400,100,200,200 -0,l,41,2255,500,1400,100,200,200 -0,l,42,2255,500,1400,100,200,200 -0,l,43,2255,500,1400,100,200,200 -0,l,44,2255,500,1400,100,200,200 -0,l,45,2255,500,1400,100,200,200 -0,l,46,2255,500,1400,100,200,200 -0,l,47,2255,500,1400,100,200,200 -0,l,48,2255,500,1400,100,200,200 -0,l,49,2255,500,1400,100,200,200 -0,l,50,2255,500,1400,100,200,200 -0,l,51,2255,500,1400,100,200,200 -0,l,52,2255,500,1400,100,200,200 -0,l,53,2255,500,1400,100,200,200 -0,l,54,2255,500,1400,100,200,200 -0,l,55,2255,500,1400,100,200,200 -0,l,56,2255,500,1400,100,200,200 -0,l,57,2255,500,1400,100,200,200 -0,l,58,2255,500,1400,100,200,200 -0,l,59,2255,500,1400,100,200,200 -0,l,60,2255,500,1400,100,200,200 -0,l,61,2255,500,1400,100,200,200 -0,l,62,2255,500,1400,100,200,200 -0,l,63,2255,500,1400,100,200,200 -0,l,64,2255,500,1400,100,200,200 -0,h,65,2255,500,1400,100,200,200 -0,h,0,2255,500,1400,100,200,200 -0,h,1,2255,500,1400,100,200,200 -0,h,2,2255,500,1400,100,200,200 -0,h,3,2255,500,1400,100,200,200 -0,h,4,2255,500,1400,100,200,200 -0,h,5,2255,500,1400,100,200,200 -0,h,6,2255,500,1400,100,200,200 -0,h,7,2255,500,1400,100,200,200 -0,h,8,2255,500,1400,100,200,200 -0,h,9,2255,500,1400,100,200,200 -0,h,10,2255,500,1400,100,200,200 -0,h,11,2255,500,1400,100,200,200 -0,h,12,2255,500,1400,100,200,200 -0,h,13,2255,500,1400,100,200,200 -0,h,14,2255,500,1400,100,200,200 -0,h,15,2255,500,1400,100,200,200 -0,h,16,2255,500,1400,100,200,200 -0,h,17,2255,500,1400,100,200,200 -0,h,18,2255,500,1400,100,200,200 -0,h,19,2255,500,1400,100,200,200 -0,h,20,2255,500,1400,100,200,200 -0,h,21,2255,500,1400,100,200,200 -0,h,22,2255,500,1400,100,200,200 -0,h,23,2255,500,1400,100,200,200 -0,h,24,2255,500,1400,100,200,200 -0,h,25,2255,500,1400,100,200,200 -0,h,26,2255,500,1400,100,200,200 -0,h,27,2255,500,1400,100,200,200 -0,h,28,2255,500,1400,100,200,200 -0,h,29,2255,500,1400,100,200,200 -0,h,30,2255,500,1400,100,200,200 -0,h,31,2255,500,1400,100,200,200 -0,h,32,2255,500,1400,100,200,200 -0,h,33,2255,500,1400,100,200,200 -0,h,34,2255,500,1400,100,200,200 -0,h,35,2255,500,1400,100,200,200 -0,h,36,2255,500,1400,100,200,200 -0,h,37,2255,500,1400,100,200,200 -0,h,38,2255,500,1400,100,200,200 -0,h,39,2255,500,1400,100,200,200 -0,h,40,2255,500,1400,100,200,200 -0,h,41,2255,500,1400,100,200,200 -0,h,42,2255,500,1400,100,200,200 -0,h,43,2255,500,1400,100,200,200 -0,h,44,2255,500,1400,100,200,200 -0,h,45,2255,500,1400,100,200,200 -0,h,46,2255,500,1400,100,200,200 -0,h,47,2255,500,1400,100,200,200 -0,h,48,2255,500,1400,100,200,200 -0,h,49,2255,500,1400,100,200,200 -0,h,50,2255,500,1400,100,200,200 -0,h,51,2255,500,1400,100,200,200 -0,h,52,2255,500,1400,100,200,200 -0,h,53,2255,500,1400,100,200,200 -0,h,54,2255,500,1400,100,200,200 -0,h,55,2255,500,1400,100,200,200 -0,h,56,2255,500,1400,100,200,200 -0,h,57,2255,500,1400,100,200,200 -0,h,58,2255,500,1400,100,200,200 -0,h,59,2255,500,1400,100,200,200 -0,h,60,2255,500,1400,100,200,200 -0,h,61,2255,500,1400,100,200,200 -0,h,62,2255,500,1400,100,200,200 -0,h,63,2255,500,1400,100,200,200 From 562c01f7cd8ebb0acbc728d90770eb2ae38b8fef Mon Sep 17 00:00:00 2001 From: nicolerodriguezcavero Date: Fri, 14 Aug 2026 14:38:43 -0700 Subject: [PATCH 07/15] ApplyTACCal is now a function called within AnalyzeEvent --- include/MModuleTACcal.h | 4 +++ src/MModuleTACcal.cxx | 72 ++++++++++++++++++++++++----------------- 2 files changed, 47 insertions(+), 29 deletions(-) diff --git a/include/MModuleTACcal.h b/include/MModuleTACcal.h index 58bbee7d..b0efeecf 100644 --- a/include/MModuleTACcal.h +++ b/include/MModuleTACcal.h @@ -114,7 +114,11 @@ class MModuleTACcal : public MModule // private methods: private: + //! Apply TAC calibration to strip hits + bool ApplyTACCal(MReadOutAssembly* Event); + //! Apply TAC cuts to calibrated strip hits + //! Assumes ApplyTACCal() has already been called for this event bool ApplyTACCuts(MReadOutAssembly* Event); diff --git a/src/MModuleTACcal.cxx b/src/MModuleTACcal.cxx index 15815f7e..a57488cc 100644 --- a/src/MModuleTACcal.cxx +++ b/src/MModuleTACcal.cxx @@ -176,6 +176,47 @@ bool MModuleTACcal::AnalyzeEvent(MReadOutAssembly* Event) } } + // Always apply TAC calibration + if (ApplyTACCal(Event) == false){ + return false; + } + + // Optionally apply TAC cuts + if (m_ApplyTACCuts == true) { + if (ApplyTACCuts(Event) == false) { + return false; + } + } + + if (HasExpos()) { + for (unsigned int i = 0; i < Event->GetNStripHits(); ++i) { + + MStripHit* SH = Event->GetStripHit(i); + + m_ExpoEnergySpectrum->AddEnergyFinal( + SH->GetEnergy(), + SH->IsNearestNeighbor(), + SH->IsLowVoltageStrip() + ); + + if ((SH->IsGuardRing() == false) && + (SH->HasFastTiming() == true)) { + + m_ExpoTACcut->AddTAC( + SH->GetDetectorID(), + SH->GetTiming() + ); + } + } + } + + return true; +} + +//////////////////////////////////////////////////////////////////////////////// + +bool MModuleTACcal::ApplyTACCal(MReadOutAssembly* Event) +{ // Loop through all strip hits in the event for (unsigned int i = 0; i < Event->GetNStripHits(); ++i) { // Get the current strip hit @@ -242,40 +283,13 @@ bool MModuleTACcal::AnalyzeEvent(MReadOutAssembly* Event) SH->SetTiming(ns_timing); } } + // Mark TAC calibration as completed for this event Event->SetAnalysisProgress(MAssembly::c_TACcal); - if (m_ApplyTACCuts == true) { - if (ApplyTACCuts(Event) == false) { - return false; - } - } - - if (HasExpos()) { - for (unsigned int i = 0; i < Event->GetNStripHits(); ++i) { - - MStripHit* SH = Event->GetStripHit(i); - - m_ExpoEnergySpectrum->AddEnergyFinal( - SH->GetEnergy(), - SH->IsNearestNeighbor(), - SH->IsLowVoltageStrip() - ); - - if ((SH->IsGuardRing() == false) && - (SH->HasFastTiming() == true)) { - - m_ExpoTACcut->AddTAC( - SH->GetDetectorID(), - SH->GetTiming() - ); - } - } - } - return true; } - + //////////////////////////////////////////////////////////////////////////////// bool MModuleTACcal::ApplyTACCuts(MReadOutAssembly* Event) From 3e898a859f8e7b473b3e388ea26a1aca28865c9e Mon Sep 17 00:00:00 2001 From: nicolerodriguezcavero Date: Mon, 17 Aug 2026 14:49:08 -0700 Subject: [PATCH 08/15] Resolving Felix's comments --- include/MModuleTACcal.h | 22 ++------- src/MModuleTACcal.cxx | 106 ++++++++++++++++++++-------------------- 2 files changed, 59 insertions(+), 69 deletions(-) diff --git a/include/MModuleTACcal.h b/include/MModuleTACcal.h index b0efeecf..c5b675ba 100644 --- a/include/MModuleTACcal.h +++ b/include/MModuleTACcal.h @@ -65,7 +65,7 @@ class MModuleTACcal : public MModule virtual MXmlNode* CreateXmlConfiguration(); //! Set filename for TAC calibration - void SetTACCalFileName( const MString& FileName) {m_TACCalFile = FileName;} + void SetTACCalFileName( const MString& FileName) { m_TACCalFile = FileName; } //! Get filename for TAC calibration MString GetTACCalFileName() const {return m_TACCalFile;} @@ -80,28 +80,16 @@ class MModuleTACcal : public MModule unordered_map>>> GetTACCalParameters() { return m_TACCal; } //! Enable or disable TAC cuts - void SetApplyTACCuts(bool ApplyTACCuts) - { - m_ApplyTACCuts = ApplyTACCuts; - } + void SetApplyTACCuts(bool ApplyTACCuts) { m_ApplyTACCuts = ApplyTACCuts; } //! Return whether TAC cuts are enabled - bool GetApplyTACCuts() const - { - return m_ApplyTACCuts; - } + bool GetApplyTACCuts() const { return m_ApplyTACCuts; } //! Set TAC coincidence window in ns - void SetCoincidenceWindow(double CoincidenceWindow) - { - m_CoincidenceWindow = CoincidenceWindow; - } + void SetCoincidenceWindow(double CoincidenceWindow) { m_CoincidenceWindow = CoincidenceWindow; } //! Get TAC coincidence window in ns - double GetCoincidenceWindow() const - { - return m_CoincidenceWindow; - } + double GetCoincidenceWindow() const { return m_CoincidenceWindow; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/MModuleTACcal.cxx b/src/MModuleTACcal.cxx index a57488cc..5b846156 100644 --- a/src/MModuleTACcal.cxx +++ b/src/MModuleTACcal.cxx @@ -2,13 +2,13 @@ * MModuleTACcal.cxx * * - * Copyright (C) by Andreas Zoglauer, Nicole Rodriquez Cavero + * Copyright (C) by Andreas Zoglauer, Nicole Rodriguez Cavero * Sean Pike * All rights reserved. * * * This code implementation is the intellectual property of - * Andreas Zoglauer, Nicole Rodriquez Cavero, Sean Pike. + * Andreas Zoglauer, Nicole Rodriguez Cavero, Sean Pike. * * By copying, distributing or modifying the Program (or any work * based on the Program) you indicate your acceptance of this statement, @@ -310,7 +310,7 @@ bool MModuleTACcal::ApplyTACCuts(MReadOutAssembly* Event) } } - // 200ns appears to be the minimum acceptable timing value for Nearest Neighbor hits + // 200ns appears to be the minimum acceptable timing value for all hits constexpr double c_FLNoiseCut = 200.0; // TotalOffset: Earliest time (in ns) after which valid timing hits can appear, start of the allowed timing window @@ -357,6 +357,9 @@ bool MModuleTACcal::ApplyTACCuts(MReadOutAssembly* Event) void MModuleTACcal::Finalize() { + m_TACCal.clear(); + m_DetectorIDs.clear(); + MModule::Finalize(); } @@ -433,59 +436,58 @@ bool MModuleTACcal::LoadTACCalFile(MString FName) if (F.Open(FName) == false) { cout< Tokens = Line.Tokenize(","); - if ((Tokens.size() == 7) || (Tokens.size() == 8)) { - int IndexOffset = Tokens.size() % 7; - int DetID = Tokens[0+IndexOffset].ToInt(); - MString SideString = Tokens[1+IndexOffset].Trim(); - char Side; - if (SideString.Length()!=1) { - cout< CalValues; - CalValues.push_back(TACCal); CalValues.push_back(Offset); CalValues.push_back(TACCalError); CalValues.push_back(OffsetError); - - // If this detector has not been encountered yet, create LV and HV calibration maps for it - if (m_TACCal.find(DetID) == m_TACCal.end()) { - vector>> TempVector; - unordered_map> TempMapLV; - unordered_map> TempMapHV; - m_TACCal[DetID] = TempVector; - m_TACCal[DetID].push_back(TempMapLV); - m_TACCal[DetID].push_back(TempMapHV); - } - - // Keep track of detector IDs contained in the calibration - if (find(m_DetectorIDs.begin(), m_DetectorIDs.end(), DetID) == m_DetectorIDs.end()) { - m_DetectorIDs.push_back(DetID); - } - - // Store the calibration parameters - if (m_SideToIndex.find(Side) != m_SideToIndex.end()) { - m_TACCal[DetID][m_SideToIndex[Side]][StripID] = CalValues; - } else { - cout< Tokens = Line.Tokenize(","); + if ((Tokens.size() == 7) || (Tokens.size() == 8)) { + int IndexOffset = Tokens.size() % 7; + int DetID = Tokens[0+IndexOffset].ToInt(); + MString SideString = Tokens[1+IndexOffset].Trim(); + char Side; + if (SideString.Length()!=1) { + cout< CalValues; + CalValues.push_back(TACCal); CalValues.push_back(Offset); CalValues.push_back(TACCalError); CalValues.push_back(OffsetError); + + // If this detector has not been encountered yet, create LV and HV calibration maps for it + if (m_TACCal.find(DetID) == m_TACCal.end()) { + vector>> TempVector; + unordered_map> TempMapLV; + unordered_map> TempMapHV; + m_TACCal[DetID] = TempVector; + m_TACCal[DetID].push_back(TempMapLV); + m_TACCal[DetID].push_back(TempMapHV); + } + + // Keep track of detector IDs contained in the calibration + if (find(m_DetectorIDs.begin(), m_DetectorIDs.end(), DetID) == m_DetectorIDs.end()) { + m_DetectorIDs.push_back(DetID); + } + + // Store the calibration parameters + if (m_SideToIndex.find(Side) != m_SideToIndex.end()) { + m_TACCal[DetID][m_SideToIndex[Side]][StripID] = CalValues; + } else { + cout< Date: Tue, 18 Aug 2026 10:24:38 -0700 Subject: [PATCH 09/15] Changed module name to match other calibrations --- include/{MModuleTACcal.h => MModuleTACCalibration.h} | 0 src/{MModuleTACcal.cxx => MModuleTACCalibration.cxx} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename include/{MModuleTACcal.h => MModuleTACCalibration.h} (100%) rename src/{MModuleTACcal.cxx => MModuleTACCalibration.cxx} (100%) diff --git a/include/MModuleTACcal.h b/include/MModuleTACCalibration.h similarity index 100% rename from include/MModuleTACcal.h rename to include/MModuleTACCalibration.h diff --git a/src/MModuleTACcal.cxx b/src/MModuleTACCalibration.cxx similarity index 100% rename from src/MModuleTACcal.cxx rename to src/MModuleTACCalibration.cxx From 6543f5ad071d6714ae74d2602e24e8820b4a8ea8 Mon Sep 17 00:00:00 2001 From: nicolerodriguezcavero Date: Tue, 18 Aug 2026 10:27:32 -0700 Subject: [PATCH 10/15] Also updating GUI module name --- include/{MGUIOptionsTACcal.h => MGUIOptionsTACCalibration.h} | 0 src/{MGUIOptionsTACcal.cxx => MGUIOptionsTACCalibration.cxx} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename include/{MGUIOptionsTACcal.h => MGUIOptionsTACCalibration.h} (100%) rename src/{MGUIOptionsTACcal.cxx => MGUIOptionsTACCalibration.cxx} (100%) diff --git a/include/MGUIOptionsTACcal.h b/include/MGUIOptionsTACCalibration.h similarity index 100% rename from include/MGUIOptionsTACcal.h rename to include/MGUIOptionsTACCalibration.h diff --git a/src/MGUIOptionsTACcal.cxx b/src/MGUIOptionsTACCalibration.cxx similarity index 100% rename from src/MGUIOptionsTACcal.cxx rename to src/MGUIOptionsTACCalibration.cxx From 96fe3668a4f5273cb0368ab589fc3cdca5450e69 Mon Sep 17 00:00:00 2001 From: nicolerodriguezcavero Date: Tue, 18 Aug 2026 10:46:04 -0700 Subject: [PATCH 11/15] Changed TACcal to TACCalibration --- apps/TrappingCorrection.cxx | 6 ++-- apps/TrappingCorrectionAm241.cxx | 6 ++-- include/MGUIOptionsTACCalibration.h | 14 ++++----- include/MModuleTACCalibration.h | 16 +++++----- src/MAssembly.cxx | 4 +-- src/MGUIOptionsTACCalibration.cxx | 36 +++++++++++----------- src/MModuleTACCalibration.cxx | 46 ++++++++++++++--------------- src/MSubModuleDepthReadout.cxx | 4 +-- 8 files changed, 66 insertions(+), 66 deletions(-) diff --git a/apps/TrappingCorrection.cxx b/apps/TrappingCorrection.cxx index ee53a42b..d952e0d5 100644 --- a/apps/TrappingCorrection.cxx +++ b/apps/TrappingCorrection.cxx @@ -64,7 +64,7 @@ using namespace ROOT::Minuit2; #include "MModuleEventFilter.h" #include "MModuleStripPairingChiSquare.h" #include "MModuleStripPairingMultiRoundChiSquare.h" -#include "MModuleTACcal.h" +#include "MModuleTACCalibration.h" #include "MAssembly.h" @@ -419,7 +419,7 @@ bool TrappingCorrection::Analyze() MSupervisor* S = MSupervisor::GetSupervisor(); MModuleLoaderMeasurementsHDF* Loader; - MModuleTACcal* TACCalibrator; + MModuleTACCalibration* TACCalibrator; MModuleEnergyCalibration* EnergyCalibrator; MModuleEventFilter* EventFilter; @@ -438,7 +438,7 @@ bool TrappingCorrection::Analyze() ++MNumber; cout<<"Creating TAC calibrator"<SetTACCalFileName(m_TACCalFile); S->SetModule(TACCalibrator, MNumber); ++MNumber; diff --git a/apps/TrappingCorrectionAm241.cxx b/apps/TrappingCorrectionAm241.cxx index 1a6412fb..a873307e 100644 --- a/apps/TrappingCorrectionAm241.cxx +++ b/apps/TrappingCorrectionAm241.cxx @@ -60,7 +60,7 @@ using namespace std; #include "MModuleEventFilter.h" #include "MModuleStripPairingChiSquare.h" #include "MModuleStripPairingMultiRoundChiSquare.h" -#include "MModuleTACcal.h" +#include "MModuleTACCalibration.h" #include "MAssembly.h" @@ -345,7 +345,7 @@ bool TrappingCorrectionAm241::Analyze() MSupervisor* S = MSupervisor::GetSupervisor(); MModuleLoaderMeasurementsHDF* Loader; - MModuleTACcal* TACCalibrator; + MModuleTACCalibration* TACCalibrator; MModuleEnergyCalibration* EnergyCalibrator; MModuleEventFilter* EventFilter; @@ -359,7 +359,7 @@ bool TrappingCorrectionAm241::Analyze() ++MNumber; cout<<"Creating TAC calibrator"<SetTACCalFileName(m_TACCalFile); S->SetModule(TACCalibrator, MNumber); ++MNumber; diff --git a/include/MGUIOptionsTACCalibration.h b/include/MGUIOptionsTACCalibration.h index 38cc9d76..7c5ba401 100644 --- a/include/MGUIOptionsTACCalibration.h +++ b/include/MGUIOptionsTACCalibration.h @@ -1,5 +1,5 @@ /* - * MGUIOptionsTACcal.h + * MGUIOptionsTACCalibration.h * * Copyright (C) 2008-2010 by Jau-Shian Liang. * All rights reserved. @@ -9,8 +9,8 @@ */ -#ifndef __MGUIOptionsTACcal__ -#define __MGUIOptionsTACcal__ +#ifndef __MGUIOptionsTACCalibration__ +#define __MGUIOptionsTACCalibration__ //////////////////////////////////////////////////////////////////////////////// @@ -43,14 +43,14 @@ class MGUIEEntry; //////////////////////////////////////////////////////////////////////////////// -class MGUIOptionsTACcal : public MGUIOptions +class MGUIOptionsTACCalibration : public MGUIOptions { // public Session: public: //! Default constructor - MGUIOptionsTACcal(MModule* Module); + MGUIOptionsTACCalibration(MModule* Module); //! Default destructor - virtual ~MGUIOptionsTACcal(); + virtual ~MGUIOptionsTACCalibration(); //! Process all button, etc. messages virtual bool ProcessMessage(long Message, long Parameter1, long Parameter2); @@ -97,7 +97,7 @@ class MGUIOptionsTACcal : public MGUIOptions #ifdef ___CLING___ public: - ClassDef(MGUIOptionsTACcal, 1) // basic class for dialog windows + ClassDef(MGUIOptionsTACCalibration, 1) // basic class for dialog windows #endif }; diff --git a/include/MModuleTACCalibration.h b/include/MModuleTACCalibration.h index c5b675ba..a56602d5 100644 --- a/include/MModuleTACCalibration.h +++ b/include/MModuleTACCalibration.h @@ -1,5 +1,5 @@ /* - * MModuleTACcal.h + * MModuleTACCalibration.h * * Copyright (C) by Andreas Zoglauer. * All rights reserved. @@ -9,8 +9,8 @@ */ -#ifndef __MModuleTACcal__ -#define __MModuleTACcal__ +#ifndef __MModuleTACCalibration__ +#define __MModuleTACCalibration__ //////////////////////////////////////////////////////////////////////////////// @@ -31,17 +31,17 @@ class MGUIExpoPlotSpectrum; //////////////////////////////////////////////////////////////////////////////// -class MModuleTACcal : public MModule +class MModuleTACCalibration : public MModule { // public interface: public: //! Default constructor - MModuleTACcal(); + MModuleTACCalibration(); //! Default destructor - virtual ~MModuleTACcal(); + virtual ~MModuleTACCalibration(); //! Create a new object of this class - virtual MModuleTACcal* Clone() { return new MModuleTACcal(); } + virtual MModuleTACCalibration* Clone() { return new MModuleTACCalibration(); } //! Initialize the module virtual bool Initialize(); @@ -141,7 +141,7 @@ class MModuleTACcal : public MModule #ifdef ___CLING___ public: - ClassDef(MModuleTACcal, 0) // no description + ClassDef(MModuleTACCalibration, 0) // no description #endif }; diff --git a/src/MAssembly.cxx b/src/MAssembly.cxx index 68ac5d38..2f3ae4cd 100644 --- a/src/MAssembly.cxx +++ b/src/MAssembly.cxx @@ -74,7 +74,7 @@ using namespace std; #include "MModuleSaverMeasurementsFITS.h" #include "MModuleResponseGenerator.h" #include "MModuleRevan.h" -#include "MModuleTACcal.h" +#include "MModuleTACCalibration.h" // #include "MModuleNearestNeighbor.h" #include "MModuleDiagnostics.h" #include "MModuleDiagnosticsEnergyPerStrip.h" @@ -145,7 +145,7 @@ MAssembly::MAssembly() m_Supervisor->AddAvailableModule(new MModuleTransmitterRealta()); m_Supervisor->AddAvailableModule(new MModuleResponseGenerator()); m_Supervisor->AddAvailableModule(new MModuleRevan()); - m_Supervisor->AddAvailableModule(new MModuleTACcal()); + m_Supervisor->AddAvailableModule(new MModuleTACCalibration()); // m_Supervisor->AddAvailableModule(new MModuleNearestNeighbor()); m_Supervisor->AddAvailableModule(new MModuleDiagnostics()); diff --git a/src/MGUIOptionsTACCalibration.cxx b/src/MGUIOptionsTACCalibration.cxx index 139d52a1..a3cbfba4 100644 --- a/src/MGUIOptionsTACCalibration.cxx +++ b/src/MGUIOptionsTACCalibration.cxx @@ -1,5 +1,5 @@ /* - * MGUIOptionsTACcal.cxx + * MGUIOptionsTACCalibration.cxx * * * Copyright (C) by Andreas Zoglauer, Nicole Rodriguez Cavero @@ -18,7 +18,7 @@ // Include the header: -#include "MGUIOptionsTACcal.h" +#include "MGUIOptionsTACCalibration.h" // Standard libs: @@ -37,14 +37,14 @@ #include "MGUIEEntry.h" // Nuclearizer libs: -#include "MModuleTACcal.h" +#include "MModuleTACCalibration.h" //////////////////////////////////////////////////////////////////////////////// #ifdef ___CLING___ -ClassImp(MGUIOptionsTACcal +ClassImp(MGUIOptionsTACCalibration ) #endif @@ -52,7 +52,7 @@ ClassImp(MGUIOptionsTACcal //////////////////////////////////////////////////////////////////////////////// -MGUIOptionsTACcal::MGUIOptionsTACcal(MModule* Module) +MGUIOptionsTACCalibration::MGUIOptionsTACCalibration(MModule* Module) : MGUIOptions(Module) { // standard constructor @@ -62,7 +62,7 @@ MGUIOptionsTACcal::MGUIOptionsTACcal(MModule* Module) //////////////////////////////////////////////////////////////////////////////// -MGUIOptionsTACcal::~MGUIOptionsTACcal() +MGUIOptionsTACCalibration::~MGUIOptionsTACCalibration() { // kDeepCleanup is activated } @@ -71,14 +71,14 @@ MGUIOptionsTACcal::~MGUIOptionsTACcal() //////////////////////////////////////////////////////////////////////////////// -void MGUIOptionsTACcal::Create() +void MGUIOptionsTACCalibration::Create() { PreCreate(); m_TACCalFileSelector = new MGUIEFileSelector( m_OptionsFrame, "Select a TAC Calibration file:", - dynamic_cast(m_Module)->GetTACCalFileName() + dynamic_cast(m_Module)->GetTACCalFileName() ); m_TACCalFileSelector->SetFileType("TAC", "*.csv"); @@ -140,7 +140,7 @@ void MGUIOptionsTACcal::Create() m_OptionsFrame, "Set coincidence window [ns]:", false, - dynamic_cast(m_Module)->GetCoincidenceWindow(), + dynamic_cast(m_Module)->GetCoincidenceWindow(), true, 0.0 ); @@ -150,7 +150,7 @@ void MGUIOptionsTACcal::Create() RBOptionLayout ); - bool ApplyTACCuts = dynamic_cast(m_Module)->GetApplyTACCuts(); + bool ApplyTACCuts = dynamic_cast(m_Module)->GetApplyTACCuts(); if (ApplyTACCuts == true) { ToggleRadioButtons(c_TACCutApply); @@ -165,7 +165,7 @@ void MGUIOptionsTACcal::Create() //////////////////////////////////////////////////////////////////////////////// -bool MGUIOptionsTACcal::ProcessMessage(long Message, long Parameter1, long Parameter2) +bool MGUIOptionsTACCalibration::ProcessMessage(long Message, long Parameter1, long Parameter2) { // Modify here if you have more buttons @@ -204,22 +204,22 @@ bool MGUIOptionsTACcal::ProcessMessage(long Message, long Parameter1, long Param //////////////////////////////////////////////////////////////////////////////// -bool MGUIOptionsTACcal::OnApply() +bool MGUIOptionsTACCalibration::OnApply() { // Store the data in the module - dynamic_cast(m_Module)->SetTACCalFileName(m_TACCalFileSelector->GetFileName()); + dynamic_cast(m_Module)->SetTACCalFileName(m_TACCalFileSelector->GetFileName()); // Apply TAC cuts or not if (m_TACCutRBIgnore->GetState() == kButtonDown) { - dynamic_cast(m_Module)-> + dynamic_cast(m_Module)-> SetApplyTACCuts(false); } else if (m_TACCutRBApply->GetState() == kButtonDown) { - dynamic_cast(m_Module)-> + dynamic_cast(m_Module)-> SetApplyTACCuts(true); } // Coincidence window - dynamic_cast(m_Module)-> + dynamic_cast(m_Module)-> SetCoincidenceWindow( m_CoincidenceWindow->GetAsDouble() ); @@ -228,7 +228,7 @@ bool MGUIOptionsTACcal::OnApply() //////////////////////////////////////////////////////////////////////////////// -void MGUIOptionsTACcal::ToggleRadioButtons(int WidgetID) +void MGUIOptionsTACCalibration::ToggleRadioButtons(int WidgetID) { if (WidgetID == c_TACCutIgnore) { @@ -247,5 +247,5 @@ void MGUIOptionsTACcal::ToggleRadioButtons(int WidgetID) } -// MGUIOptionsTACcal: the end... +// MGUIOptionsTACCalibration: the end... //////////////////////////////////////////////////////////////////////////////// diff --git a/src/MModuleTACCalibration.cxx b/src/MModuleTACCalibration.cxx index 5b846156..5bd5a0d7 100644 --- a/src/MModuleTACCalibration.cxx +++ b/src/MModuleTACCalibration.cxx @@ -1,5 +1,5 @@ /* - * MModuleTACcal.cxx + * MModuleTACCalibration.cxx * * * Copyright (C) by Andreas Zoglauer, Nicole Rodriguez Cavero @@ -19,16 +19,16 @@ //////////////////////////////////////////////////////////////////////////////// // -// MModuleTACcal +// MModuleTACCalibration // //////////////////////////////////////////////////////////////////////////////// // Include the header: -#include "MModuleTACcal.h" +#include "MModuleTACCalibration.h" #include "MGUIExpoTACcut.h" #include "MGUIExpoPlotSpectrum.h" -#include "MGUIOptionsTACcal.h" +#include "MGUIOptionsTACCalibration.h" // Standard libs: #include @@ -45,16 +45,16 @@ #ifdef ___CLING___ -ClassImp(MModuleTACcal) +ClassImp(MModuleTACCalibration) #endif //////////////////////////////////////////////////////////////////////////////// -MModuleTACcal::MModuleTACcal() : MModule() +MModuleTACCalibration::MModuleTACCalibration() : MModule() { - // Construct an instance of MModuleTACcal + // Construct an instance of MModuleTACCalibration // Set all module relevant information @@ -78,7 +78,7 @@ MModuleTACcal::MModuleTACcal() : MModule() // Set if this module has an options GUI // Overwrite ShowOptionsGUI() with the call to the GUI! m_HasOptionsGUI = true; - // If true, you have to derive a class from MGUIOptions (use MGUIOptionsTACcal) + // If true, you have to derive a class from MGUIOptions (use MGUIOptionsTACCalibration) // and implement all your GUI options // Can the program be run multi-threaded @@ -101,16 +101,16 @@ MModuleTACcal::MModuleTACcal() : MModule() //////////////////////////////////////////////////////////////////////////////// -MModuleTACcal::~MModuleTACcal() +MModuleTACCalibration::~MModuleTACCalibration() { - // Delete this instance of MModuleTACcal + // Delete this instance of MModuleTACCalibration } //////////////////////////////////////////////////////////////////////////////// -bool MModuleTACcal::Initialize() +bool MModuleTACCalibration::Initialize() { // Initialize the module @@ -129,7 +129,7 @@ bool MModuleTACcal::Initialize() } //////////////////////////////////////////////////////////////////////////////// -void MModuleTACcal::CreateExpos() +void MModuleTACCalibration::CreateExpos() { if (HasExpos() == true) return; @@ -150,10 +150,10 @@ void MModuleTACcal::CreateExpos() //////////////////////////////////////////////////////////////////////////////// -void MModuleTACcal::ShowOptionsGUI() +void MModuleTACCalibration::ShowOptionsGUI() { - MGUIOptionsTACcal* Options = - new MGUIOptionsTACcal(this); + MGUIOptionsTACCalibration* Options = + new MGUIOptionsTACCalibration(this); Options->Create(); gClient->WaitForUnmap(Options); @@ -161,7 +161,7 @@ void MModuleTACcal::ShowOptionsGUI() //////////////////////////////////////////////////////////////////////////////// -bool MModuleTACcal::AnalyzeEvent(MReadOutAssembly* Event) +bool MModuleTACCalibration::AnalyzeEvent(MReadOutAssembly* Event) { if (HasExpos()) { for (unsigned int i = 0; i < Event->GetNStripHits(); ++i) { @@ -215,7 +215,7 @@ bool MModuleTACcal::AnalyzeEvent(MReadOutAssembly* Event) //////////////////////////////////////////////////////////////////////////////// -bool MModuleTACcal::ApplyTACCal(MReadOutAssembly* Event) +bool MModuleTACCalibration::ApplyTACCal(MReadOutAssembly* Event) { // Loop through all strip hits in the event for (unsigned int i = 0; i < Event->GetNStripHits(); ++i) { @@ -292,7 +292,7 @@ bool MModuleTACcal::ApplyTACCal(MReadOutAssembly* Event) //////////////////////////////////////////////////////////////////////////////// -bool MModuleTACcal::ApplyTACCuts(MReadOutAssembly* Event) +bool MModuleTACCalibration::ApplyTACCuts(MReadOutAssembly* Event) { // Find the max timing value for non-NN hits of an event // This will be used for the coincidence window @@ -355,7 +355,7 @@ bool MModuleTACcal::ApplyTACCuts(MReadOutAssembly* Event) //////////////////////////////////////////////////////////////////////////////// -void MModuleTACcal::Finalize() +void MModuleTACCalibration::Finalize() { m_TACCal.clear(); m_DetectorIDs.clear(); @@ -366,7 +366,7 @@ void MModuleTACcal::Finalize() //////////////////////////////////////////////////////////////////////////////// -bool MModuleTACcal::ReadXmlConfiguration(MXmlNode* Node) +bool MModuleTACCalibration::ReadXmlConfiguration(MXmlNode* Node) { //! Read the configuration data from an XML node @@ -400,7 +400,7 @@ bool MModuleTACcal::ReadXmlConfiguration(MXmlNode* Node) //////////////////////////////////////////////////////////////////////////////// -MXmlNode* MModuleTACcal::CreateXmlConfiguration() +MXmlNode* MModuleTACCalibration::CreateXmlConfiguration() { //! Create an XML node tree from the configuration @@ -426,7 +426,7 @@ MXmlNode* MModuleTACcal::CreateXmlConfiguration() //////////////////////////////////////////////////////////////////////////////// -bool MModuleTACcal::LoadTACCalFile(MString FName) +bool MModuleTACCalibration::LoadTACCalFile(MString FName) { // Read in the TAC Calibration file, which should contain for each strip: // DetID, Side (h or l for high or low voltage), TAC cal, TAC cal error, TAC cal offset, TAC offset error @@ -492,7 +492,7 @@ bool MModuleTACcal::LoadTACCalFile(MString FName) return true; } -// MModuleTACcal.cxx: the end... +// MModuleTACCalibration.cxx: the end... //////////////////////////////////////////////////////////////////////////////// diff --git a/src/MSubModuleDepthReadout.cxx b/src/MSubModuleDepthReadout.cxx index 87249e3d..53b23916 100644 --- a/src/MSubModuleDepthReadout.cxx +++ b/src/MSubModuleDepthReadout.cxx @@ -36,7 +36,7 @@ // Nuclearizer libs: #include "MModuleDepthCalibration.h" -#include "MModuleTACcal.h" +#include "MModuleTACCalibration.h" //////////////////////////////////////////////////////////////////////////////// @@ -98,7 +98,7 @@ bool MSubModuleDepthReadout::Initialize() } // Load TAC calibration parameters - MModuleTACcal TACcal; + MModuleTACCalibration TACcal; TACcal.SetTACCalFileName(m_TACCalFileName); if (TACcal.LoadTACCalFile(m_TACCalFileName) == true) { // Copy TAC cal parameters From d8a5c908aec6226ef9ae115b659aa4d713fa2de1 Mon Sep 17 00:00:00 2001 From: nicolerodriguezcavero Date: Tue, 18 Aug 2026 11:01:27 -0700 Subject: [PATCH 12/15] Changing GUI spectra window labels to TAC cuts --- src/MGUIExpoPlotSpectrum.cxx | 4 ++++ src/MGUIExpoTACcut.cxx | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/MGUIExpoPlotSpectrum.cxx b/src/MGUIExpoPlotSpectrum.cxx index 35ba3acc..ec3b052d 100644 --- a/src/MGUIExpoPlotSpectrum.cxx +++ b/src/MGUIExpoPlotSpectrum.cxx @@ -62,7 +62,11 @@ MGUIExpoPlotSpectrum::MGUIExpoPlotSpectrum(MModule* Module) : MGUIExpo(Module) // Set the new title of the tab here: if (Module != nullptr) { + if (Module->GetName() == "TAC Calibration") { + m_TabTitle = "Energy Spectrum (TAC cuts)"; + } else { m_TabTitle = "Energy Spectrum (" + Module->GetName() + ")"; + } } else { m_TabTitle = "Energy Spectrum"; } diff --git a/src/MGUIExpoTACcut.cxx b/src/MGUIExpoTACcut.cxx index ee6cf47b..66a491fb 100644 --- a/src/MGUIExpoTACcut.cxx +++ b/src/MGUIExpoTACcut.cxx @@ -2,7 +2,7 @@ * MGUIExpoTACcut.cxx * * - * Copyright (C) by Andreas Zoglauer, Nicole Rodriquez Cavero. + * Copyright (C) by Andreas Zoglauer, Nicole Rodriguez Cavero. * All rights reserved. * * @@ -49,7 +49,7 @@ MGUIExpoTACcut::MGUIExpoTACcut(MModule* Module) : MGUIExpo(Module) // standard constructor // Set the new title of the tab here: - m_TabTitle = "TAC Calibration"; + m_TabTitle = "TAC Cuts"; // Set the histogram arrangment // SetTACHistogramArrangement(1, 1); From 69bf6e4e54c49e800c744c12e75dac8dd1f249e3 Mon Sep 17 00:00:00 2001 From: nicolerodriguezcavero Date: Tue, 18 Aug 2026 11:06:38 -0700 Subject: [PATCH 13/15] Updating Xml tag --- src/MModuleTACCalibration.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MModuleTACCalibration.cxx b/src/MModuleTACCalibration.cxx index 5bd5a0d7..da36748a 100644 --- a/src/MModuleTACCalibration.cxx +++ b/src/MModuleTACCalibration.cxx @@ -62,7 +62,7 @@ MModuleTACCalibration::MModuleTACCalibration() : MModule() m_Name = "TAC Calibration"; // Set the XML tag --- has to be unique --- no spaces allowed - m_XmlTag = "XmlTagTACcal"; + m_XmlTag = "XmlTagTACCalibration"; // Set all modules, which have to be done before this module AddPreceedingModuleType(MAssembly::c_EventLoader); From 3969b294c98abc854fcce02b31df32c0023382a7 Mon Sep 17 00:00:00 2001 From: nicolerodriguezcavero Date: Tue, 18 Aug 2026 11:21:06 -0700 Subject: [PATCH 14/15] Updating module type name --- include/MAssembly.h | 41 +++++++++---------- src/MModuleDepthCalibration.cxx | 2 +- src/MModuleEnergyCalibration.cxx | 4 +- src/MModuleStripPairingChiSquare.cxx | 2 +- ...MModuleStripPairingMultiRoundChiSquare.cxx | 2 +- src/MModuleTACCalibration.cxx | 6 +-- 6 files changed, 28 insertions(+), 29 deletions(-) diff --git a/include/MAssembly.h b/include/MAssembly.h index eafbae78..e16eba2c 100644 --- a/include/MAssembly.h +++ b/include/MAssembly.h @@ -53,27 +53,26 @@ class MAssembly static const uint64_t c_EventLoaderMeasurement = (1 << 2); // = 4 static const uint64_t c_EventOrdering = (1 << 3); // = 8 static const uint64_t c_Coincidence = (1 << 4); // = 16 - static const uint64_t c_TACcal = (1 << 5); // = 32 - static const uint64_t c_TACcut = (1 << 6); // = 64 - static const uint64_t c_NearestNeighbor = (1 << 7); // = 128 - static const uint64_t c_DetectorEffectsEngine = (1 << 8); - static const uint64_t c_EventFilter = (1 << 9); - static const uint64_t c_EnergyCalibration = (1 << 10); - static const uint64_t c_ChargeSharingCorrection = (1 << 11); - static const uint64_t c_DepthCorrection = (1 << 12); - static const uint64_t c_StripPairing = (1 << 13); - static const uint64_t c_Aspect = (1 << 14); - static const uint64_t c_CrosstalkCorrection = (1 << 15); - static const uint64_t c_EventReconstruction = (1 << 16); - static const uint64_t c_Else = (1 << 17); - static const uint64_t c_NoRestriction = (1 << 18); - static const uint64_t c_EventSaver = (1 << 19); - static const uint64_t c_EventTransmitter = (1 << 20); - static const uint64_t c_PositionDetermiation = (1 << 21); - static const uint64_t c_Statistics = (1 << 22); - static const uint64_t c_FlagHits = (1 << 23); - static const uint64_t c_Diagnostics = (1 << 24); - static const uint64_t c_ResponseGeneration = (1 << 25); + static const uint64_t c_TACCalibration = (1 << 5); // = 32 + static const uint64_t c_NearestNeighbor = (1 << 6); // = 64 + static const uint64_t c_DetectorEffectsEngine = (1 << 7); + static const uint64_t c_EventFilter = (1 << 8); + static const uint64_t c_EnergyCalibration = (1 << 9); + static const uint64_t c_ChargeSharingCorrection = (1 << 10); + static const uint64_t c_DepthCorrection = (1 << 11); + static const uint64_t c_StripPairing = (1 << 12); + static const uint64_t c_Aspect = (1 << 13); + static const uint64_t c_CrosstalkCorrection = (1 << 14); + static const uint64_t c_EventReconstruction = (1 << 15); + static const uint64_t c_Else = (1 << 16); + static const uint64_t c_NoRestriction = (1 << 17); + static const uint64_t c_EventSaver = (1 << 18); + static const uint64_t c_EventTransmitter = (1 << 19); + static const uint64_t c_PositionDetermiation = (1 << 20); + static const uint64_t c_Statistics = (1 << 21); + static const uint64_t c_FlagHits = (1 << 22); + static const uint64_t c_Diagnostics = (1 << 23); + static const uint64_t c_ResponseGeneration = (1 << 24); // IMPORTANT: diff --git a/src/MModuleDepthCalibration.cxx b/src/MModuleDepthCalibration.cxx index 3d5d3874..78662c0a 100644 --- a/src/MModuleDepthCalibration.cxx +++ b/src/MModuleDepthCalibration.cxx @@ -64,7 +64,7 @@ MModuleDepthCalibration::MModuleDepthCalibration() : MModule() // Set all modules, which have to be done before this module AddPreceedingModuleType(MAssembly::c_EnergyCalibration, true); AddPreceedingModuleType(MAssembly::c_StripPairing, true); - AddPreceedingModuleType(MAssembly::c_TACcut, true); + AddPreceedingModuleType(MAssembly::c_TACCalibration, true); // AddPreceedingModuleType(MAssembly::c_CrosstalkCorrection, false); // Soft requirement // Set all types this modules handles diff --git a/src/MModuleEnergyCalibration.cxx b/src/MModuleEnergyCalibration.cxx index c35817d0..449eb1f4 100644 --- a/src/MModuleEnergyCalibration.cxx +++ b/src/MModuleEnergyCalibration.cxx @@ -74,13 +74,13 @@ MModuleEnergyCalibration::MModuleEnergyCalibration() : MModule() // Set all modules, which have to be done before this module AddPreceedingModuleType(MAssembly::c_EventLoader); - // AddPreceedingModuleType(MAssembly::c_TACcut); + // AddPreceedingModuleType(MAssembly::c_TACCalibration); // Set all types this modules handles AddModuleType(MAssembly::c_EnergyCalibration); // Set all modules, which can follow this module - AddSucceedingModuleType(MAssembly::c_TACcut); + AddSucceedingModuleType(MAssembly::c_TACCalibration); // Set if this module has an options GUI m_HasOptionsGUI = true; diff --git a/src/MModuleStripPairingChiSquare.cxx b/src/MModuleStripPairingChiSquare.cxx index f11fe4bd..d74dced2 100644 --- a/src/MModuleStripPairingChiSquare.cxx +++ b/src/MModuleStripPairingChiSquare.cxx @@ -62,7 +62,7 @@ MModuleStripPairingChiSquare::MModuleStripPairingChiSquare() : MModule() // Set all modules, which have to be done before this module AddPreceedingModuleType(MAssembly::c_EventLoader); AddPreceedingModuleType(MAssembly::c_EnergyCalibration); - AddPreceedingModuleType(MAssembly::c_TACcut); + AddPreceedingModuleType(MAssembly::c_TACCalibration); // Set all types this modules handles AddModuleType(MAssembly::c_StripPairing); diff --git a/src/MModuleStripPairingMultiRoundChiSquare.cxx b/src/MModuleStripPairingMultiRoundChiSquare.cxx index 3b6b00c4..d5ca248d 100644 --- a/src/MModuleStripPairingMultiRoundChiSquare.cxx +++ b/src/MModuleStripPairingMultiRoundChiSquare.cxx @@ -74,7 +74,7 @@ MModuleStripPairingMultiRoundChiSquare::MModuleStripPairingMultiRoundChiSquare() // Set all modules, which have to be done before this module AddPreceedingModuleType(MAssembly::c_EventLoader); AddPreceedingModuleType(MAssembly::c_EnergyCalibration); - AddPreceedingModuleType(MAssembly::c_TACcut); + AddPreceedingModuleType(MAssembly::c_TACCalibration); // Set all types this modules handles AddModuleType(MAssembly::c_StripPairing); diff --git a/src/MModuleTACCalibration.cxx b/src/MModuleTACCalibration.cxx index da36748a..c8f9bb44 100644 --- a/src/MModuleTACCalibration.cxx +++ b/src/MModuleTACCalibration.cxx @@ -69,7 +69,7 @@ MModuleTACCalibration::MModuleTACCalibration() : MModule() AddPreceedingModuleType(MAssembly::c_EnergyCalibration); // Set all types this modules handles - AddModuleType(MAssembly::c_TACcal); + AddModuleType(MAssembly::c_TACCalibration); // Set all modules, which can follow this module AddSucceedingModuleType(MAssembly::c_StripPairing); @@ -285,7 +285,7 @@ bool MModuleTACCalibration::ApplyTACCal(MReadOutAssembly* Event) } // Mark TAC calibration as completed for this event - Event->SetAnalysisProgress(MAssembly::c_TACcal); + Event->SetAnalysisProgress(MAssembly::c_TACCalibration); return true; } @@ -347,7 +347,7 @@ bool MModuleTACCalibration::ApplyTACCuts(MReadOutAssembly* Event) } } - Event->SetAnalysisProgress(MAssembly::c_TACcut); + Event->SetAnalysisProgress(MAssembly::c_TACCalibration); return true; } From 642243f8b94c4442a1d1adf5c8a80582df71b4aa Mon Sep 17 00:00:00 2001 From: Felix Hagemann Date: Tue, 18 Aug 2026 12:15:32 -0700 Subject: [PATCH 15/15] CHG: Update nuclearizer config file in unit tests --- resource/unittestdata/406-1/hdf5-to-tra.nuclearizer.cfg | 6 +++--- resource/unittestdata/542-1/hdf5-to-tra.nuclearizer.cfg | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resource/unittestdata/406-1/hdf5-to-tra.nuclearizer.cfg b/resource/unittestdata/406-1/hdf5-to-tra.nuclearizer.cfg index 88e4a59f..cec6db4d 100644 --- a/resource/unittestdata/406-1/hdf5-to-tra.nuclearizer.cfg +++ b/resource/unittestdata/406-1/hdf5-to-tra.nuclearizer.cfg @@ -3,7 +3,7 @@ XmlTagMeasurementLoaderHDF EnergyCalibration - XmlTagTACcal + XmlTagTACCalibration XmlTagStripPairingMultiRoundChiSquare DepthCalibration XmlTagRevan @@ -52,13 +52,13 @@ $(NUCLEARIZER)/resource/unittestdata/406-1/hp52406-1.revan.cfg - + $(NUCLEARIZER)/resource/unittestdata/406-1/hp52406-1.taccal.csv true 600 - + diff --git a/resource/unittestdata/542-1/hdf5-to-tra.nuclearizer.cfg b/resource/unittestdata/542-1/hdf5-to-tra.nuclearizer.cfg index 63cb707b..4ce9a804 100644 --- a/resource/unittestdata/542-1/hdf5-to-tra.nuclearizer.cfg +++ b/resource/unittestdata/542-1/hdf5-to-tra.nuclearizer.cfg @@ -3,7 +3,7 @@ XmlTagMeasurementLoaderHDF EnergyCalibration - XmlTagTACcal + XmlTagTACCalibration XmlTagStripPairingMultiRoundChiSquare DepthCalibration XmlTagRevan @@ -52,13 +52,13 @@ $(NUCLEARIZER)/resource/unittestdata/542-1/hp52542-1.revan.cfg - + $(NUCLEARIZER)/resource/unittestdata/542-1/hp52542-1.taccal.csv true 600 - +