Skip to content

Commit

Permalink
[EMCAL-39, ALIROOT-7708] Check for active TRU
Browse files Browse the repository at this point in the history
Implement check of the TRU status based on the status in
the STU region.
  • Loading branch information
mfasDa authored and ktf committed Aug 29, 2019
1 parent e1ce1ae commit 4d75612
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions EMCAL/EMCALbase/AliEMCALTriggerDCSConfig.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "AliEMCALTriggerDCSConfig.h"
#include "AliEMCALTriggerSTUDCSConfig.h"
#include "AliEMCALTriggerTRUDCSConfig.h"
#include <bitset>
#include <iostream>
#include <sstream>

Expand Down Expand Up @@ -73,6 +74,15 @@ bool AliEMCALTriggerDCSConfig::operator==(const AliEMCALTriggerDCSConfig & other
return isequal;
}

bool AliEMCALTriggerDCSConfig::IsTRUEnabled(int itru) const {
if(itru < 32){
if(fSTUObj) return std::bitset<32>(fSTUObj->GetRegion()).test(itru);
} else {
if(fSTUDCAL) return std::bitset<32>(fSTUDCAL->GetRegion()).test(itru-32);
}
return false;
}

std::ostream &operator<<(std::ostream &stream, const AliEMCALTriggerDCSConfig &config) {
stream << "EMCAL trigger DCS config:" << std::endl;
stream << "================================" << std::endl;
Expand Down
12 changes: 12 additions & 0 deletions EMCAL/EMCALbase/AliEMCALTriggerDCSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ class AliEMCALTriggerDCSConfig : public TObject
inline AliEMCALTriggerSTUDCSConfig* GetSTUDCSConfig(Bool_t isDCAL = false) const;
AliEMCALTriggerTRUDCSConfig* GetTRUDCSConfig(Int_t iTRU) const { return (AliEMCALTriggerTRUDCSConfig*)fTRUArr->At(iTRU); }

/**
* @brief Check whether TRU is enabled
*
* Enabled-status defined via presence of the TRU in the STU region: TRU
* is enabled if the corresponding bit is set in the STU region
*
* @param iTRU Global index of the TRU to be checked
* @return true TRU is enabled
* @return false TRU is not enabled
*/
bool IsTRUEnabled(int iTRU) const;

private:

AliEMCALTriggerDCSConfig (const AliEMCALTriggerDCSConfig &cd); // Not implemented
Expand Down

0 comments on commit 4d75612

Please sign in to comment.