diff --git a/include/MSubModuleStripTrigger.h b/include/MSubModuleStripTrigger.h index a6d73171..1781e559 100644 --- a/include/MSubModuleStripTrigger.h +++ b/include/MSubModuleStripTrigger.h @@ -122,9 +122,6 @@ class MSubModuleStripTrigger : public MSubModule //! Process strip hits for deadtime and trigger determination bool ProcessStripHits(MReadOutAssembly* Event); - //! Helper function for getting count rate (including nearest neighbor) - bool CountRate(vector ASICChannels, vector CountTime); - //! Check if at least one strip exists on each side of each detector bool CheckTriggerConditions(MReadOutAssembly* Event); @@ -209,11 +206,6 @@ class MSubModuleStripTrigger : public MSubModule //! Stores trigger counts for each detector vector m_NumStripTriggers; - //! Event strip times for counting (should be removed later) - vector m_EventStripTimes; - //! Event strip IDs for counting (should be removed later) - vector m_EventStripIDs; - #ifdef ___CLING___ public: ClassDef(MSubModuleStripTrigger, 0) // no description diff --git a/src/MSubModuleStripTrigger.cxx b/src/MSubModuleStripTrigger.cxx index ec1f4a63..4698fbe8 100644 --- a/src/MSubModuleStripTrigger.cxx +++ b/src/MSubModuleStripTrigger.cxx @@ -27,7 +27,6 @@ #include "MSubModuleStripTrigger.h" // Standard libs: -#include #include // ROOT libs: @@ -148,7 +147,7 @@ void MSubModuleStripTrigger::ApplyFastClearDeadtime(const MTime& ShieldVetoTime) double MSubModuleStripTrigger::CalculateASICDeadtime(vector ASICChannels) { - // Calculate deadtime for GeD ASICs including nearest neighbor readout + // Calculate deadtime for GeD ASICs from the unique channels that were read out (including nearest neighbor) double deadtime = 0; // temporary deadtime variable int countUnique = 0; // temporary unique channel counter @@ -159,27 +158,8 @@ double MSubModuleStripTrigger::CalculateASICDeadtime(vector ASICChannels) unordered_set ASICChannelsSet; - // Sort ASICChannels to process channels in ascending order - sort(ASICChannels.begin(), ASICChannels.end()); - - // Loop through each channel ID and add nearest neighbors for (int ID : ASICChannels) { - if (ID == 64) { - ASICChannelsSet.insert(ID); - } else if (ID == 0 || ID == 32) { - // Edge case: If ID is 0 or 32, add the channel and the next channel - ASICChannelsSet.insert(ID); - ASICChannelsSet.insert(ID + 1); - } else if (ID == 31 || ID == 63) { - // Edge case: If ID is 31 or 63, add the previous channel and the channel itself - ASICChannelsSet.insert(ID - 1); - ASICChannelsSet.insert(ID); - } else { - // General case: Add the previous channel, the channel itself, and the next channel - ASICChannelsSet.insert(ID - 1); - ASICChannelsSet.insert(ID); - ASICChannelsSet.insert(ID + 1); - } + ASICChannelsSet.insert(ID); } // Count the number of unique channels read out @@ -195,60 +175,6 @@ double MSubModuleStripTrigger::CalculateASICDeadtime(vector ASICChannels) //////////////////////////////////////////////////////////////////////////////// -bool MSubModuleStripTrigger::CountRate(vector ASICChannels, vector CountTime) -{ - // Helper function for getting count rate (including nearest neighbor) - - if (ASICChannels.empty()) { - return false; - } - - unordered_set ASICChannelsSet; - vector CountTimeVec; - - // Sort ASICChannels to process channels in ascending order - sort(ASICChannels.begin(), ASICChannels.end()); - - // Loop through each channel ID - for (size_t i = 0; i < ASICChannels.size(); i++) { - int ID = ASICChannels[i]; - size_t temp_size = ASICChannelsSet.size(); - - if (ID == 64) { - // ASICChannelsSet.insert(ID); - continue; // Do not include GR hits in count rate calculation as it has its own readout and does not cause nearest neighbor readout - } else if (ID == 0 || ID == 32) { - ASICChannelsSet.insert(ID); - ASICChannelsSet.insert(ID + 1); - } else if (ID == 31 || ID == 63) { - ASICChannelsSet.insert(ID - 1); - ASICChannelsSet.insert(ID); - } else { - ASICChannelsSet.insert(ID - 1); - ASICChannelsSet.insert(ID); - ASICChannelsSet.insert(ID + 1); - } - - size_t new_size = ASICChannelsSet.size(); - for (size_t j = 0; j < (new_size - temp_size); j++) { - CountTimeVec.push_back(CountTime[i]); - } - } - - int h = 0; - for (int k : ASICChannelsSet) { - m_EventStripIDs.push_back(k); - m_EventStripTimes.push_back(CountTimeVec[h]); - h++; - } - - return true; -} - - -//////////////////////////////////////////////////////////////////////////////// - - bool MSubModuleStripTrigger::CheckTriggerConditions(MReadOutAssembly* Event) { // Check if at least one strip exists on each side of each detector @@ -368,7 +294,6 @@ bool MSubModuleStripTrigger::ProcessStripHits(MReadOutAssembly* Event) if (!ASICFirstHitAfterDead) { for (int d = 0; d < nDets; d++) { for (int a = 0; a < nASICs; a++) { - CountRate(m_ASICHitStripID[d][a], m_TempEvtTimes[d][a]); m_ASICHitStripID_noDT[d][a].clear(); m_ASICHitStripID[d][a].clear(); m_TempEvtTimes[d][a].clear();