diff --git a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/CPRoIDecoder.h b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/CPRoIDecoder.h index 6a8411527998c577d446079277bb691e547bcb34..2d02c45257d9c6bf29e09d1cb151d67b2df80822 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/CPRoIDecoder.h +++ b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/CPRoIDecoder.h @@ -1,6 +1,6 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** CPRoIDecoder.h - description @@ -39,28 +39,18 @@ namespace LVL1 { TrigT1CaloDefs::RoIType roiType( unsigned int word ) const; /** RoI coordinate information */ - CoordinateRange coordinate( const unsigned int roiWord ); - unsigned int crate( const unsigned int roiWord ); - unsigned int module( const unsigned int roiWord ); - unsigned int chip( const unsigned int roiWord ); - unsigned int localcoord( const unsigned int roiWord ); + virtual CoordinateRange coordinate( const unsigned int roiWord ) const override; + unsigned int crate( const unsigned int roiWord ) const; + unsigned int module( const unsigned int roiWord ) const; + unsigned int chip( const unsigned int roiWord ) const; + unsigned int localcoord( const unsigned int roiWord ) const; /** Thresholds passed (Run 1 RoIs) */ - const std::vector< unsigned int >& thresholdsPassed( const unsigned int word ); + const std::vector< unsigned int > thresholdsPassed( const unsigned int word ) const; /** ET and Isolation information (Run 2 RoIs) */ - unsigned int et( const unsigned int roiWord ); - unsigned int isolationWord( const unsigned int roiWord ); - - protected: - /** get information from CP RoI word and store in member variables. */ - void decodeWord( const unsigned int word ); - - private: - unsigned int m_cpm; - unsigned int m_cp; - unsigned int m_lc; - + unsigned int et( const unsigned int roiWord ) const; + unsigned int isolationWord( const unsigned int roiWord ) const; }; // class CPRoIDecoder } // namespace LVL1 diff --git a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/JEPRoIDecoder.h b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/JEPRoIDecoder.h index e90fb62c17287df0dcebce1174175fbbb5dd13c5..0969e074d926c49fcdf0d46da8a0360c2a585719 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/JEPRoIDecoder.h +++ b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/JEPRoIDecoder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** JEPRoIDecoder.h - description @@ -37,85 +37,63 @@ namespace LVL1 { unsigned int jetRoIVersion( unsigned int word ) const; /** Return eta/phi coordinate object */ - CoordinateRange coordinate( const unsigned int roiWord ); + virtual CoordinateRange coordinate( const unsigned int roiWord ) const override; /** Return hardware coordinates */ - unsigned int crate( const unsigned int word ); - unsigned int module( const unsigned int word ); - unsigned int row( const unsigned int word ); - unsigned int column( const unsigned int word ); + unsigned int crate( const unsigned int word ) const; + unsigned int module( const unsigned int word ) const; + unsigned int row( const unsigned int word ) const; + unsigned int column( const unsigned int word ) const; /** returns a vector containing the numbers of threshold passed i.e. if the vector contains 1,3,5 it means that this RoI passed thresholds 1,3 and 5.*/ - const std::vector< unsigned int >& thresholdsPassed( const unsigned int word ); - std::vector<unsigned int>& fwdThresholdsPassed( const unsigned int word ); + const std::vector< unsigned int > thresholdsPassed( const unsigned int word ) const; + const std::vector<unsigned int> fwdThresholdsPassed( const unsigned int word ) const; /** Return ET values from Run 2 Jet RoIs */ - unsigned int etLarge( const unsigned int word ); - unsigned int etSmall( const unsigned int word ); + unsigned int etLarge( const unsigned int word ) const; + unsigned int etSmall( const unsigned int word ) const; /** returns the (signed) Ex energy projection. If the RoIWord looks invalid, then zero will be returned. */ - int energyX( unsigned int energyRoIWord0 ); + int energyX( unsigned int energyRoIWord0 ) const; /** returns the (signed) Ex energy projection. If the RoIWord looks invalid, then zero will be returned. */ - int energyY( unsigned int energyRoIWord1 ); + int energyY( unsigned int energyRoIWord1 ) const; /** returns the (signed) Ex energy projection. If the RoIWord looks invalid, then zero will be returned. */ - int energyT( unsigned int energyRoIWord2 ); + int energyT( unsigned int energyRoIWord2 ) const; /** returns overflow flag energy RoIWord */ - bool energyOverflow( unsigned int energyRoIWord ); + bool energyOverflow( unsigned int energyRoIWord ) const; /** returns a vector containing the numbers of threshold passed i.e. if the vector contains 1,3,5 it means that this RoI passed thresholds 1,3 and 5.*/ - std::vector<unsigned int>& mEtSigThresholdsPassed( const unsigned int energyRoIWord0 ); + std::vector<unsigned int> mEtSigThresholdsPassed( const unsigned int energyRoIWord0 ) const; /** returns a vector containing the numbers of threshold passed i.e. if the vector contains 1,3,5 it means that this RoI passed thresholds 1,3 and 5.*/ - std::vector<unsigned int>& etSumThresholdsPassed( const unsigned int energyRoIWord1 ); + std::vector<unsigned int> etSumThresholdsPassed( const unsigned int energyRoIWord1 ) const; /** returns a vector containing the numbers of threshold passed i.e. if the vector contains 1,3,5 it means that this RoI passed thresholds 1,3 and 5.*/ - std::vector<unsigned int>& etMissThresholdsPassed( const unsigned int energyRoIWord2 ); + std::vector<unsigned int> etMissThresholdsPassed( const unsigned int energyRoIWord2 ) const; /** returns true if thresh is passed*/ - bool mEtSigThresholdPassed( const unsigned int energyRoIWord0, const unsigned int thresh ); + bool mEtSigThresholdPassed( const unsigned int energyRoIWord0, const unsigned int thresh ) const; /** returns true if thresh is passed*/ - bool sumEtThresholdPassed( const unsigned int energyRoIWord1, const unsigned int thresh ); + bool sumEtThresholdPassed( const unsigned int energyRoIWord1, const unsigned int thresh ) const; /** returns true if thresh is passed*/ - bool etMissThresholdPassed( const unsigned int energyRoIWord2, const unsigned int thresh ); + bool etMissThresholdPassed( const unsigned int energyRoIWord2, const unsigned int thresh ) const; - protected: - /** get information from Jet RoI word and store in member variables. */ - void decodeWord( const unsigned int word ); - /** No descriptions */ - void decodeEnergyWord0( const unsigned int energyRoIWord0 ); - /** No descriptions */ - void decodeEnergyWord1( const unsigned int energyRoIWord1 ); - /** No descriptions */ - void decodeEnergyWord2( const unsigned int energyRoIWord2 ); + private: + unsigned int mEtSigThresholdsFlags( const unsigned int energyRoIWord0 ) const; + unsigned int sumEtThresholdsFlags( const unsigned int energyRoIWord1 ) const; + unsigned int missEtThresholdsFlags( const unsigned int energyRoIWord1 ) const; + /** No descriptions */ int decodeEnergyComponent( const unsigned int energyRoIWord ) const; - private: /** return a CoordinateRange for the JEMs coving -2.4<eta<2.4 */ - CoordinateRange midJEMCoordinate() const; + CoordinateRange midJEMCoordinate(const unsigned int jem, const unsigned int roiWord) const; /** returns a CoordinateRange for the end JEMs, i.e. 2.4<eta<4.9 */ - CoordinateRange leftEndJEMCoordinate() const; + CoordinateRange leftEndJEMCoordinate(const unsigned int jem, const unsigned int roiWord) const; /** returns a CoordinateRange for the end JEMs, i.e. 2.4<eta<4.9 */ - CoordinateRange rightEndJEMCoordinate() const; + CoordinateRange rightEndJEMCoordinate(const unsigned int jem, const unsigned int roiWord) const; /** set phi coords for Jet RoI */ - void setPhiCoords( double& phiMin, double& phiMax ) const; - - unsigned int m_fwdThresholdsPassed; - unsigned int m_jem; - unsigned int m_row; - unsigned int m_col; - unsigned int m_mEtSigThresholdsPassed; - unsigned int m_sumEtThresholdsPassed; - unsigned int m_missEtThresholdsPassed; - unsigned int m_etLarge; - unsigned int m_etSmall; - int m_ex; - int m_ey; - int m_et; - std::vector<unsigned int> m_mEtSigThreshPassedVec; - std::vector<unsigned int> m_sumEtThreshPassedVec; - std::vector<unsigned int> m_missEtThreshPassedVec; - std::vector<unsigned int> m_fwdThreshPassedVec; - + void setPhiCoords( const unsigned int jem, const unsigned int roiWord, + double& phiMin, double& phiMax ) const; }; // class JEPRoIDecoder } // namespace LVL1 diff --git a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/RoIDecoder.h b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/RoIDecoder.h index 6535cbb9314a3f0b7ae640fa8f1d27d22c8275f6..ac8810af827e24c93ffa2f8ef1f82f1f27e08d96 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/RoIDecoder.h +++ b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/RoIDecoder.h @@ -1,7 +1,7 @@ // Dear emacs, this is -*- c++ -*- // $Id: RoIDecoder.h 187728 2009-05-27 16:18:06Z krasznaa $ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** RoIDecoder.h - description @@ -43,31 +43,13 @@ namespace LVL1 { public: RoIDecoder(); virtual ~RoIDecoder(); - virtual CoordinateRange coordinate( const unsigned int word ) = 0; - /** returns the crate associated with the RoI word */ - unsigned int crate( const unsigned int word ); - /** returns a vector containing the numbers of threshold passed i.e. if the - vector contains 1,3,5 it means that this RoI passed thresholds 1,3 and 5.*/ - const std::vector< unsigned int >& thresholdsPassed( const unsigned int word ); - /** examines an 32bit RoI word, extracts the RoI type and returns one of: - - CpRoIWordType, - - JetRoIWordType, - - JetEtRoIWordType, - - EnergyRoIWordType*/ - TrigT1CaloDefs::RoIType roiType( unsigned int word ) const; + virtual CoordinateRange coordinate( const unsigned int word ) const = 0; protected: - /** get information from CP RoI word and store in member variables. */ - virtual void decodeWord( const unsigned int word ) = 0; /** returns the value of bits in word between bit "start" and bit "start" + "length" */ unsigned int extractBits( unsigned int word, const unsigned int start, const unsigned int length ) const; - /** print thresholds passed */ - void dumpThresholdsPassed() const; - unsigned int m_crate; - unsigned int m_thresholdsPassed; - std::vector< unsigned int > m_threshPassedVec; bool m_DEBUG; }; // class RoIDecoder diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/CPRoIDecoder.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/CPRoIDecoder.cxx index 476e339c917518c94ac33720830cc1969c926440..62aa87b74086bb2646abee430969d77c28c6ffcb 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/src/CPRoIDecoder.cxx +++ b/Trigger/TrigT1/TrigT1Interfaces/src/CPRoIDecoder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** CPRoIDecoder.cxx - description @@ -13,13 +13,13 @@ #include "TrigT1Interfaces/CPRoIDecoder.h" -using namespace std; +using std::cout; +using std::endl; namespace LVL1 { CPRoIDecoder::CPRoIDecoder() - : m_cpm( 0 ), m_cp( 0 ), m_lc( 0 ) { - + { } CPRoIDecoder::~CPRoIDecoder() { @@ -47,9 +47,7 @@ namespace LVL1 { /** Return coordinate information for RoI */ - CoordinateRange CPRoIDecoder::coordinate( const unsigned int roiWord ) { - - decodeWord( roiWord ); + CoordinateRange CPRoIDecoder::coordinate( const unsigned int roiWord ) const { //phi const double cratePhiSize = M_PI / 2.0; @@ -66,27 +64,32 @@ namespace LVL1 { // (where each cell is 0.1x0.1) // so - unsigned int top = ( m_lc & 2 ) >> 1; // top=1, bot=0 - double localCoordEta = ( ( ( m_lc & 4 ) >> 1 ) + ( m_lc & 1 ) ) * localCoordEtaSize; + unsigned int crate = this->crate (roiWord); + unsigned int cpm = this->module (roiWord); + unsigned int cp = this->chip (roiWord); + unsigned int lc = this->localcoord (roiWord); + + unsigned int top = ( lc & 2 ) >> 1; // top=1, bot=0 + double localCoordEta = ( ( ( lc & 4 ) >> 1 ) + ( lc & 1 ) ) * localCoordEtaSize; - double phiMin = ( static_cast< double >( m_crate ) * cratePhiSize ) + - ( static_cast< double >( m_cp ) * fpgaPhiSize ) + ( top * localCoordPhiSize ); - double phiMax = ( static_cast< double >( m_crate ) * cratePhiSize ) + - ( static_cast< double >( m_cp ) * fpgaPhiSize ) + ( top * localCoordPhiSize ) + 2. * localCoordPhiSize; - double etaMin = ( ( static_cast< double >( static_cast< int >( m_cpm ) - 8 ) ) * cpmEtaSize ) + localCoordEta; + double phiMin = ( static_cast< double >( crate ) * cratePhiSize ) + + ( static_cast< double >( cp ) * fpgaPhiSize ) + ( top * localCoordPhiSize ); + double phiMax = ( static_cast< double >( crate ) * cratePhiSize ) + + ( static_cast< double >( cp ) * fpgaPhiSize ) + ( top * localCoordPhiSize ) + 2. * localCoordPhiSize; + double etaMin = ( ( static_cast< double >( static_cast< int >( cpm ) - 8 ) ) * cpmEtaSize ) + localCoordEta; - double etaMax = ( static_cast< double >( static_cast< int >( m_cpm ) - 8 ) * cpmEtaSize ) + localCoordEta + 2. * localCoordEtaSize; + double etaMax = ( static_cast< double >( static_cast< int >( cpm ) - 8 ) * cpmEtaSize ) + localCoordEta + 2. * localCoordEtaSize; if ( RoIDecoder::m_DEBUG ) { cout << "phiMin : " << phiMin << "phiMax : " << phiMax << endl << "etaMin : " << etaMin << "etaMax : " << etaMax << endl << "Phi" << endl << "===" << endl - << "Crate phi min : " << ( m_crate * cratePhiSize ) << " (size: " << ( cratePhiSize ) << ")" << endl - << "CP FPGA phi min : " << ( m_cp * fpgaPhiSize ) << " (size: " << ( fpgaPhiSize ) << ")" << endl + << "Crate phi min : " << ( crate * cratePhiSize ) << " (size: " << ( cratePhiSize ) << ")" << endl + << "CP FPGA phi min : " << ( cp * fpgaPhiSize ) << " (size: " << ( fpgaPhiSize ) << ")" << endl << "Local coord min : " << ( top * localCoordPhiSize ) << " (size: " << ( localCoordPhiSize ) << ")" << endl << "Eta" << endl << "===" << endl - << "CPM eta min : " << ( ( m_cpm - 8 ) * cpmEtaSize ) << " (size: " << ( cpmEtaSize ) << ")" << endl + << "CPM eta min : " << ( ( cpm - 8 ) * cpmEtaSize ) << " (size: " << ( cpmEtaSize ) << ")" << endl << "CP FPGA phi min : " << localCoordEta << " (size: " << ( localCoordEtaSize ) << ")" << endl; } @@ -98,57 +101,35 @@ namespace LVL1 { } /** Decode crate number from RoI word */ - unsigned int CPRoIDecoder::crate( const unsigned int roiWord ) { - decodeWord( roiWord ); - return m_crate; + unsigned int CPRoIDecoder::crate( const unsigned int roiWord ) const { + int offset = 0; + if (roiType( roiWord ) == TrigT1CaloDefs::CpRoIWordType) offset = 2; + return extractBits( roiWord, 27+offset, 2 ); } /** Decode module number from RoI word */ - unsigned int CPRoIDecoder::module( const unsigned int roiWord ) { - decodeWord( roiWord ); - return m_cpm; + unsigned int CPRoIDecoder::module( const unsigned int roiWord ) const { + int offset = 0; + if (roiType( roiWord ) == TrigT1CaloDefs::CpRoIWordType) offset = 2; + return extractBits( roiWord, 23+offset, 4 ); } /** Decode CP chip number from RoI word */ - unsigned int CPRoIDecoder::chip( const unsigned int roiWord ) { - decodeWord( roiWord ); - return m_cp; + unsigned int CPRoIDecoder::chip( const unsigned int roiWord ) const { + int offset = 0; + if (roiType( roiWord ) == TrigT1CaloDefs::CpRoIWordType) offset = 2; + return extractBits( roiWord, 20+offset, 3 ); } /** Decode local coordinate from RoI word */ - unsigned int CPRoIDecoder::localcoord( const unsigned int roiWord ) { - decodeWord( roiWord ); - return m_lc; - } - - /** get information from RoI word and store in member variables. */ - void CPRoIDecoder::decodeWord( const unsigned int word ) { - + unsigned int CPRoIDecoder::localcoord( const unsigned int roiWord ) const { int offset = 0; - if (roiType( word ) == TrigT1CaloDefs::CpRoIWordType) offset = 2; - - m_thresholdsPassed = extractBits( word, 1, 16 ); - m_crate = extractBits( word, 27+offset, 2 ); - m_cpm = extractBits( word, 23+offset, 4 ); - m_cp = extractBits( word, 20+offset, 3 ); - m_lc = extractBits( word, 17+offset, 3 ); - - if ( RoIDecoder::m_DEBUG ) { - - cout << "CPRoIDecoder: RoIWord being analysed - " << hex << word << dec << endl; - cout << "Crate : " << m_crate << endl - << "CPM : " << m_cpm << endl - << "CP : " << m_cp << endl - << "LC : " << m_lc << endl; - - } - - return; - + if (roiType( roiWord ) == TrigT1CaloDefs::CpRoIWordType) offset = 2; + return extractBits( roiWord, 17+offset, 3 ); } - + /** Extract cluster ET from Run 2 RoI word */ - unsigned int CPRoIDecoder::et( const unsigned int roiWord ) { + unsigned int CPRoIDecoder::et( const unsigned int roiWord ) const { unsigned int type = roiType( roiWord ); if ( type == TrigT1CaloDefs::EMRoIWordType || type == TrigT1CaloDefs::TauRoIWordType ) @@ -158,7 +139,7 @@ namespace LVL1 { } /** Extract isolation results from Run 2 RoI word */ - unsigned int CPRoIDecoder::isolationWord( const unsigned int roiWord ) { + unsigned int CPRoIDecoder::isolationWord( const unsigned int roiWord ) const { unsigned int type = roiType( roiWord ); if ( type == TrigT1CaloDefs::EMRoIWordType || type == TrigT1CaloDefs::TauRoIWordType ) @@ -169,20 +150,20 @@ namespace LVL1 { /** Override default version by adding a check on Run 1/Run 2*/ - const std::vector<unsigned int>& CPRoIDecoder::thresholdsPassed( const unsigned int word ) { + const std::vector<unsigned int> CPRoIDecoder::thresholdsPassed( const unsigned int word ) const { - m_threshPassedVec.clear(); + std::vector<unsigned int> threshPassedVec; if (roiType(word) == TrigT1CaloDefs::CpRoIWordType) { unsigned int hitmask = word&0xffff; for ( unsigned int thresh = 0; thresh < 16; ++thresh ) { if ( ( 1 << thresh ) & hitmask ) { - m_threshPassedVec.push_back( thresh + 1 ); + threshPassedVec.push_back( thresh + 1 ); } } } - return m_threshPassedVec; + return threshPassedVec; } diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/JEPRoIDecoder.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/JEPRoIDecoder.cxx index 630f3ba0f19f69d46d42e52dcb0913474a61d1e3..af29afac4b90dfa1de100c99e8c54cd671e6c6d7 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/src/JEPRoIDecoder.cxx +++ b/Trigger/TrigT1/TrigT1Interfaces/src/JEPRoIDecoder.cxx @@ -15,15 +15,13 @@ #include "TrigT1Interfaces/JEPRoIDecoder.h" #include "TrigT1Interfaces/TrigT1CaloDefs.h" -using namespace std; +using std::cout; +using std::endl; namespace LVL1 { JEPRoIDecoder::JEPRoIDecoder() - : m_fwdThresholdsPassed( 0 ), m_jem( 0 ), m_row( 0 ), m_col( 0 ), - m_mEtSigThresholdsPassed( 0 ), m_sumEtThresholdsPassed( 0 ), m_missEtThresholdsPassed( 0 ), - m_etLarge(0), m_etSmall(0), m_ex( 0 ), m_ey( 0 ), m_et( 0 ) { - + { } JEPRoIDecoder::~JEPRoIDecoder() { @@ -65,141 +63,108 @@ unsigned int LVL1::JEPRoIDecoder::jetRoIVersion( unsigned int word ) const { else return 999; } - CoordinateRange JEPRoIDecoder::coordinate( const unsigned int roiWord ) { + CoordinateRange JEPRoIDecoder::coordinate( const unsigned int roiWord ) const { - decodeWord( roiWord ); - unsigned int temp = m_jem % 8; + const unsigned int jem = this->module (roiWord); + unsigned int temp = jem % 8; if ( temp == 0 ){ - return leftEndJEMCoordinate(); + return leftEndJEMCoordinate(jem, roiWord); } else if( temp == 7 ){ - return rightEndJEMCoordinate(); - } else return midJEMCoordinate(); + return rightEndJEMCoordinate(jem, roiWord); + } else return midJEMCoordinate(jem, roiWord); } /** Extract crate number from Jet RoI word */ - unsigned int JEPRoIDecoder::crate( const unsigned int roiWord ) { - decodeWord( roiWord ); - return m_crate; + unsigned int JEPRoIDecoder::crate( const unsigned int roiWord ) const { + return extractBits( roiWord, 29, 1 ); } /** Extract module number from Jet RoI word */ - unsigned int JEPRoIDecoder::module( const unsigned int roiWord ) { - decodeWord( roiWord ); - return m_jem; + unsigned int JEPRoIDecoder::module( const unsigned int roiWord ) const { + return extractBits( roiWord, 25, 4 ); } /** Extract RoI row number within module from Jet RoI word */ - unsigned int JEPRoIDecoder::row( const unsigned int roiWord ) { - decodeWord( roiWord ); - return m_row; + unsigned int JEPRoIDecoder::row( const unsigned int roiWord ) const { + unsigned int rl = extractBits( roiWord, 20, 2 ); + unsigned int frame = extractBits( roiWord, 22, 3 ); + return ( frame & 3 ) * 2 + ( rl >> 1 ); } /** Extract RoI column number within module from Jet RoI word */ - unsigned int JEPRoIDecoder::column( const unsigned int roiWord ) { - decodeWord( roiWord ); - return m_col; + unsigned int JEPRoIDecoder::column( const unsigned int roiWord ) const { + unsigned int rl = extractBits( roiWord, 20, 2 ); + unsigned int frame = extractBits( roiWord, 22, 3 ); + return ( frame >> 2 ) * 2 + ( rl & 1 ); } - /** Override default version by adding a check on Run 1/Run 2*/ - const std::vector<unsigned int>& JEPRoIDecoder::thresholdsPassed( const unsigned int word ) { + /** Check on Run 1/Run 2*/ + const std::vector<unsigned int> JEPRoIDecoder::thresholdsPassed( const unsigned int word ) const { - m_threshPassedVec.clear(); + std::vector<unsigned int> threshPassedVec; if (jetRoIVersion(word) == 1) { - decodeWord( word ); + unsigned int thresholdsPassed = extractBits( word, 1, 8 ); for ( unsigned int thresh = 0; thresh < 16; ++thresh ) { - if ( ( 1 << thresh ) & m_thresholdsPassed ) { - m_threshPassedVec.push_back( thresh + 1 ); + if ( ( 1 << thresh ) & thresholdsPassed ) { + threshPassedVec.push_back( thresh + 1 ); } } } - return m_threshPassedVec; + return threshPassedVec; } /** returns a vector containing the numbers of threshold passed i.e. if the vector contains 1,3,5 it means that this RoI passed thresholds 1,3 and 5.*/ - std::vector<unsigned int>& JEPRoIDecoder::fwdThresholdsPassed( const unsigned int word ) { + const std::vector<unsigned int> JEPRoIDecoder::fwdThresholdsPassed( const unsigned int word ) const { - m_fwdThreshPassedVec.clear(); + std::vector<unsigned int> fwdThreshPassedVec; if (jetRoIVersion(word) == 1) { - decodeWord( word ); + unsigned int fwdThresholdsPassed = extractBits( word, 9, 4 ); for ( unsigned int thresh = 0; thresh < 4;thresh++ ) { - if ( ( 1 << thresh ) & m_fwdThresholdsPassed ) { - m_fwdThreshPassedVec.push_back( thresh + 1 ); + if ( ( 1 << thresh ) & fwdThresholdsPassed ) { + fwdThreshPassedVec.push_back( thresh + 1 ); } } //endfor } - return m_fwdThreshPassedVec; + return fwdThreshPassedVec; } /** Extract larger cluster ET value from Jet RoI word */ - unsigned int JEPRoIDecoder::etLarge( const unsigned int word ) { + unsigned int JEPRoIDecoder::etLarge( const unsigned int word ) const { if (jetRoIVersion(word) == 1) return 0; - decodeWord( word ); - return m_etLarge; + return extractBits( word, 1, 10 ); } /** Extract smaller cluster ET value from Jet RoI word */ - unsigned int JEPRoIDecoder::etSmall( const unsigned int word ) { + unsigned int JEPRoIDecoder::etSmall( const unsigned int word ) const { if (jetRoIVersion(word) == 1) return 0; - decodeWord( word ); - return m_etSmall; - } - - - /** get information from RoI word and store in member variables. */ - void JEPRoIDecoder::decodeWord( const unsigned int word ) { - - // Run 1 data - m_thresholdsPassed = extractBits( word, 1, 8 ); - m_fwdThresholdsPassed = extractBits( word, 9, 4 ); - - // Run 2 data - m_etLarge = extractBits( word, 1, 10 ); - m_etSmall = extractBits( word, 11, 9 ); - - // Common to both - unsigned int rl = extractBits( word, 20, 2 ); - unsigned int frame = extractBits( word, 22, 3 ); - m_jem = extractBits( word, 25, 4 ); - m_crate = extractBits( word, 29, 1 ); - - m_col = ( frame >> 2 ) * 2 + ( rl & 1 ); - m_row = ( frame & 3 ) * 2 + ( rl >> 1 ); - - - if ( RoIDecoder::m_DEBUG ) { - cout << "JEPRoIDecoder: RoIWord being analysed - " << hex << word << dec << endl; - cout << "Crate : " << m_crate << endl - << "jem : " << m_jem << endl - << "row : " << m_row << endl - << "col : " << m_col << endl; - } //end debug output - - return; + return extractBits( word, 11, 9 ); } /** return a CoordinateRange for the JEMs coving -2.4<eta<2.4 */ - CoordinateRange JEPRoIDecoder::midJEMCoordinate() const { + CoordinateRange JEPRoIDecoder::midJEMCoordinate(const unsigned int jem, + const unsigned int roiWord) const { double phiMin = 0.0; double phiMax = 0.0; - setPhiCoords( phiMin, phiMax ); + setPhiCoords( jem, roiWord, phiMin, phiMax ); //eta const double JEMEtaSize = 0.8; const double jeEtaSize = 0.2; - int etaBin = ( m_jem % 8 ) - 4; //bins range from -4 to +3 - double etaMin = ( etaBin * JEMEtaSize ) + ( jeEtaSize * m_col ); + const unsigned int col = this->column (roiWord); + int etaBin = ( jem % 8 ) - 4; //bins range from -4 to +3 + double etaMin = ( etaBin * JEMEtaSize ) + ( jeEtaSize * col ); double etaMax = etaMin + 2. * jeEtaSize; // there is one nasty "special case" as well @@ -211,14 +176,15 @@ unsigned int LVL1::JEPRoIDecoder::jetRoIVersion( unsigned int word ) const { } /** returns a CoordinateRange for the end JEMs, i.e. 2.4<eta<4.9 */ - CoordinateRange JEPRoIDecoder::leftEndJEMCoordinate() const { + CoordinateRange JEPRoIDecoder::leftEndJEMCoordinate(const unsigned int jem, + const unsigned int roiWord) const { double phiMin = 0.0; double phiMax = 0.0; - setPhiCoords( phiMin, phiMax ); + setPhiCoords( jem, roiWord, phiMin, phiMax ); double etaMin = 0.0; double etaMax = 0.0; - switch ( m_col ) { + switch ( this->column (roiWord) ) { case 0: etaMin = -4.9; etaMax = -2.9; break; @@ -238,13 +204,14 @@ unsigned int LVL1::JEPRoIDecoder::jetRoIVersion( unsigned int word ) const { } /** returns a CoordinateRange for the end JEMs, i.e. 2.4<eta<4.9 */ - CoordinateRange JEPRoIDecoder::rightEndJEMCoordinate() const { + CoordinateRange JEPRoIDecoder::rightEndJEMCoordinate(const unsigned int jem, + const unsigned int roiWord) const { double phiMin = 0.0; double phiMax = 0.0; - setPhiCoords( phiMin, phiMax ); + setPhiCoords( jem, roiWord, phiMin, phiMax ); double etaMin = 0.0; double etaMax = 0.0; - switch ( m_col ) { + switch ( this->column (roiWord) ) { case 0: etaMin = 2.4; etaMax = 2.9; break; @@ -264,43 +231,44 @@ unsigned int LVL1::JEPRoIDecoder::jetRoIVersion( unsigned int word ) const { } /** set phi coords for Jet RoI */ - void JEPRoIDecoder::setPhiCoords( double& phiMin, double& phiMax ) const { + void JEPRoIDecoder::setPhiCoords( const unsigned int jem, const unsigned int roiWord, + double& phiMin, double& phiMax ) const { + + const unsigned int row = this->row (roiWord); + const unsigned int crate = this->crate (roiWord); const double jemPhiSize = M_PI / 2; const double jePhiSize = M_PI / 16; - int crateModifier = ( m_jem / 8 ) * 2; //=0 or 2 - phiMin = ( m_crate + crateModifier ) * jemPhiSize + ( jePhiSize * m_row ); + int crateModifier = ( jem / 8 ) * 2; //=0 or 2 + phiMin = ( crate + crateModifier ) * jemPhiSize + ( jePhiSize * row ); phiMax = phiMin + 2. * jePhiSize; return; } /** returns the (signed) Ex energy projection. If the RoIWord looks invalid, then zero will be returned. */ - int JEPRoIDecoder::energyX( unsigned int energyRoIWord0 ) { + int JEPRoIDecoder::energyX( unsigned int energyRoIWord0 ) const { if ( roiType( energyRoIWord0 ) != TrigT1CaloDefs::EnergyRoIWordType0 ) return 0; // wrong type of word - decodeEnergyWord0( energyRoIWord0 ); - return m_ex; + return decodeEnergyComponent( energyRoIWord0 ); } /** returns the (signed) Ey energy projection. If the RoIWord looks invalid, then zero will be returned. */ - int JEPRoIDecoder::energyY( unsigned int energyRoIWord1 ) { + int JEPRoIDecoder::energyY( unsigned int energyRoIWord1 ) const { if ( roiType( energyRoIWord1 ) != TrigT1CaloDefs::EnergyRoIWordType1 ) return 0; // wrong type of word - decodeEnergyWord1( energyRoIWord1 ); - return m_ey; + return decodeEnergyComponent( energyRoIWord1 ); } /** returns the ETSum value. If the RoIWord looks invalid, then zero will be returned. */ - int JEPRoIDecoder::energyT( unsigned int energyRoIWord2 ) { + int JEPRoIDecoder::energyT( unsigned int energyRoIWord2 ) const { if ( roiType( energyRoIWord2 ) != TrigT1CaloDefs::EnergyRoIWordType2 ) return 0; // wrong type of word - decodeEnergyWord2( energyRoIWord2 ); - return m_et; + return extractBits( energyRoIWord2, 1, 15 ); } /** returns the overflow flag for an Energy RoIWord */ - bool JEPRoIDecoder::energyOverflow( unsigned int energyRoIWord ) { + bool JEPRoIDecoder::energyOverflow( unsigned int energyRoIWord ) const { if ( extractBits( energyRoIWord, 16, 1 ) != 0 ) { return true; @@ -311,86 +279,80 @@ unsigned int LVL1::JEPRoIDecoder::jetRoIVersion( unsigned int word ) const { /** returns a vector containing the numbers of threshold passed i.e. if the vector contains 1,3,5 it means that this RoI passed thresholds 1,3 and 5.*/ - std::vector<unsigned int>& JEPRoIDecoder::mEtSigThresholdsPassed( const unsigned int energyRoIWord0 ) { + std::vector<unsigned int> JEPRoIDecoder::mEtSigThresholdsPassed( const unsigned int energyRoIWord0 ) const { - m_mEtSigThreshPassedVec.clear(); + std::vector<unsigned int> mEtSigThreshPassedVec; + unsigned int passed = mEtSigThresholdsFlags( energyRoIWord0 ); for ( unsigned int thresh = 0; thresh < TrigT1CaloDefs::numOfMEtSigThresholds; thresh++ ) { - if ( mEtSigThresholdPassed( energyRoIWord0, thresh ) ) { - m_mEtSigThreshPassedVec.push_back( thresh + 1 ); + if ( passed & (1<<thresh)) { + mEtSigThreshPassedVec.push_back( thresh + 1 ); } } //endfor - return m_mEtSigThreshPassedVec; + return mEtSigThreshPassedVec; } /** returns a vector containing the numbers of threshold passed i.e. if the vector contains 1,3,5 it means that this RoI passed thresholds 1,3 and 5.*/ - std::vector<unsigned int>& JEPRoIDecoder::etSumThresholdsPassed( const unsigned int energyRoIWord1 ) { + std::vector<unsigned int> JEPRoIDecoder::etSumThresholdsPassed( const unsigned int energyRoIWord1 ) const { - m_sumEtThreshPassedVec.clear(); - for ( unsigned int thresh = 0; thresh < TrigT1CaloDefs::numOfSumEtThresholds; thresh++ ) { - if ( sumEtThresholdPassed( energyRoIWord1, thresh ) ) { - m_sumEtThreshPassedVec.push_back( thresh + 1 ); + std::vector<unsigned int> sumEtThreshPassedVec; + unsigned int passed = sumEtThresholdsFlags( energyRoIWord1 ); +for ( unsigned int thresh = 0; thresh < TrigT1CaloDefs::numOfSumEtThresholds; thresh++ ) { + if ( passed & (1<<thresh)) { + sumEtThreshPassedVec.push_back( thresh + 1 ); } } //endfor - return m_sumEtThreshPassedVec; + return sumEtThreshPassedVec; } /** returns a vector containing the numbers of threshold passed i.e. if the vector contains 1,3,5 it means that this RoI passed thresholds 1,3 and 5.*/ - std::vector<unsigned int>& JEPRoIDecoder::etMissThresholdsPassed( const unsigned int energyRoIWord2 ) { + std::vector<unsigned int> JEPRoIDecoder::etMissThresholdsPassed( const unsigned int energyRoIWord2 ) const { - m_missEtThreshPassedVec.clear(); + std::vector<unsigned int> missEtThreshPassedVec; + unsigned int passed = missEtThresholdsFlags( energyRoIWord2 ); for ( unsigned int thresh = 0; thresh < TrigT1CaloDefs::numOfMissingEtThresholds; thresh++ ) { - if ( etMissThresholdPassed( energyRoIWord2, thresh ) ) { - m_missEtThreshPassedVec.push_back( thresh + 1 ); + if ( passed & (1<<thresh)) { + missEtThreshPassedVec.push_back( thresh + 1 ); } } //endfor - return m_missEtThreshPassedVec; + return missEtThreshPassedVec; } /** returns true if thresh is passed*/ - bool JEPRoIDecoder::mEtSigThresholdPassed( const unsigned int energyRoIWord0, const unsigned int thresh ) { + bool JEPRoIDecoder::mEtSigThresholdPassed( const unsigned int energyRoIWord0, const unsigned int thresh ) const { - decodeEnergyWord0( energyRoIWord0 ); - return ( ( 1 << thresh ) & m_mEtSigThresholdsPassed ); + return ( ( 1 << thresh ) & mEtSigThresholdsFlags( energyRoIWord0 ) ); } /** returns true if thresh is passed*/ - bool JEPRoIDecoder::sumEtThresholdPassed( const unsigned int energyRoIWord1, const unsigned int thresh ) { + bool JEPRoIDecoder::sumEtThresholdPassed( const unsigned int energyRoIWord1, const unsigned int thresh ) const { - decodeEnergyWord1( energyRoIWord1 ); - return ( ( 1 << thresh ) & m_sumEtThresholdsPassed ); + return ( ( 1 << thresh ) & sumEtThresholdsFlags( energyRoIWord1) ); } /** returns true if thresh is passed*/ - bool JEPRoIDecoder::etMissThresholdPassed( const unsigned int energyRoIWord2, const unsigned int thresh ) { + bool JEPRoIDecoder::etMissThresholdPassed( const unsigned int energyRoIWord2, const unsigned int thresh ) const { - decodeEnergyWord2( energyRoIWord2 ); - return ( ( 1 << thresh ) & m_missEtThresholdsPassed ); + return ( ( 1 << thresh ) & missEtThresholdsFlags( energyRoIWord2 ) ); } - void JEPRoIDecoder::decodeEnergyWord0( const unsigned int energyRoIWord0 ) { + unsigned int JEPRoIDecoder::mEtSigThresholdsFlags( const unsigned int energyRoIWord0 ) const { - m_ex = decodeEnergyComponent( energyRoIWord0 ); - m_mEtSigThresholdsPassed = extractBits( energyRoIWord0, 17, TrigT1CaloDefs::numOfMEtSigThresholds ); - return; + return extractBits( energyRoIWord0, 17, TrigT1CaloDefs::numOfMEtSigThresholds ); } - void JEPRoIDecoder::decodeEnergyWord1( const unsigned int energyRoIWord1 ) { + unsigned int JEPRoIDecoder::sumEtThresholdsFlags( const unsigned int energyRoIWord1 ) const { - m_ey = decodeEnergyComponent( energyRoIWord1 ); - m_sumEtThresholdsPassed = extractBits( energyRoIWord1, 17, TrigT1CaloDefs::numOfSumEtThresholds ); - return; + return extractBits( energyRoIWord1, 17, TrigT1CaloDefs::numOfSumEtThresholds ); } - void JEPRoIDecoder::decodeEnergyWord2( const unsigned int energyRoIWord2 ) { + unsigned int JEPRoIDecoder::missEtThresholdsFlags( const unsigned int energyRoIWord2 ) const { - m_et = extractBits( energyRoIWord2, 1, 15 ); - m_missEtThresholdsPassed = extractBits( energyRoIWord2, 17, TrigT1CaloDefs::numOfMissingEtThresholds ); - return; + return extractBits( energyRoIWord2, 17, TrigT1CaloDefs::numOfMissingEtThresholds ); } int JEPRoIDecoder::decodeEnergyComponent( const unsigned int energyRoIWord ) const { diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/RecEmTauRoI.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/RecEmTauRoI.cxx index b86338e0a3902eaf5cde0f48f4dcdcc9698ce506..33c6103289fad7e3fa446b5833378cefed6cbad9 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/src/RecEmTauRoI.cxx +++ b/Trigger/TrigT1/TrigT1Interfaces/src/RecEmTauRoI.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id: RecEmTauRoI.cxx 796120 2017-02-08 03:20:47Z ssnyder $ /*************************************************************************** @@ -91,7 +91,7 @@ void RecEmTauRoI::constructRun1( m_hadCoreIsolation.clear(); m_thresholdType.clear(); - const vector<unsigned int> &passed_thresholds = + const vector<unsigned int> passed_thresholds = m_decoder->thresholdsPassed(m_roiWord); // diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/RecEnergyRoI.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/RecEnergyRoI.cxx index e6c13aba14123a6a38fa3659dc8572c7aa767b7b..de77ceb00f5e07872afea6539d3fd5a1af0e0f13 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/src/RecEnergyRoI.cxx +++ b/Trigger/TrigT1/TrigT1Interfaces/src/RecEnergyRoI.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id: RecEnergyRoI.cxx 342657 2011-01-28 23:42:18Z watsona $ /*************************************************************************** @@ -164,11 +164,8 @@ namespace LVL1 { vector< unsigned int >* RecEnergyRoI::etMissThresholdsPassed() const { JEPRoIDecoder get; - vector< unsigned int >* newVec = new std::vector< unsigned int >; - for( vector< unsigned int >::const_iterator i = get.etMissThresholdsPassed( m_roiWord2 ).begin(); - i != get.etMissThresholdsPassed( m_roiWord2 ).end(); ++i ) { - newVec->push_back( *i ); - } + vector< unsigned int >* newVec = new std::vector< unsigned int > + ( get.etMissThresholdsPassed( m_roiWord2 ) ); return newVec; } @@ -177,11 +174,8 @@ namespace LVL1 { vector< unsigned int >* RecEnergyRoI::sumEtThresholdsPassed() const { JEPRoIDecoder get; - vector< unsigned int >* newVec = new std::vector< unsigned int >; - for( vector< unsigned int >::const_iterator i = get.etSumThresholdsPassed( m_roiWord1 ).begin(); - i != get.etSumThresholdsPassed( m_roiWord1 ).end(); ++i ) { - newVec->push_back( *i ); - } + vector< unsigned int >* newVec = new std::vector< unsigned int > + ( get.etSumThresholdsPassed( m_roiWord1 ) ); return newVec; } @@ -190,11 +184,8 @@ namespace LVL1 { vector< unsigned int >* RecEnergyRoI::mEtSigThresholdsPassed() const { JEPRoIDecoder get; - vector< unsigned int >* newVec = new std::vector< unsigned int >; - for( vector< unsigned int >::const_iterator i = get.mEtSigThresholdsPassed( m_roiWord0 ).begin(); - i != get.mEtSigThresholdsPassed( m_roiWord0 ).end(); ++i ) { - newVec->push_back( *i ); - } + vector< unsigned int >* newVec = new std::vector< unsigned int > + (get.mEtSigThresholdsPassed( m_roiWord0 )); return newVec; } diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/RecJetRoI.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/RecJetRoI.cxx index c4d5d646617119e20578bdc7a6ef4736d008769e..7cf57a9c736112359769f7575ab7a8d5668bf281 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/src/RecJetRoI.cxx +++ b/Trigger/TrigT1/TrigT1Interfaces/src/RecJetRoI.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id: RecJetRoI.cxx 796120 2017-02-08 03:20:47Z ssnyder $ /*************************************************************************** @@ -96,7 +96,7 @@ void RecJetRoI::constructRun1( // // Extract the properties of the passed thresholds: // - const vector<unsigned int> &passed_thresholds = + const vector<unsigned int> passed_thresholds = (this->isForwardJet() ? m_decoder->fwdThresholdsPassed(m_roiWord) : m_decoder->thresholdsPassed(m_roiWord)); diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/RoIDecoder.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/RoIDecoder.cxx index fa19e6fa58d75da23b893e936a9225e2f71ce39e..3dff53cade6c4d0c0306a8b7b39a9a29d837a635 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/src/RoIDecoder.cxx +++ b/Trigger/TrigT1/TrigT1Interfaces/src/RoIDecoder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id: RoIDecoder.cxx 187728 2009-05-27 16:18:06Z krasznaa $ /*************************************************************************** @@ -22,7 +22,7 @@ #include <iostream> LVL1::RoIDecoder::RoIDecoder(): - m_crate( 0 ), m_thresholdsPassed( 0 ), m_DEBUG( false ) { + m_DEBUG( false ) { } @@ -48,69 +48,3 @@ unsigned int LVL1::RoIDecoder::extractBits( unsigned int word, const unsigned in return ( word & bitmask ); // return only bits in bitmask } -/** print thresholds passed */ -void LVL1::RoIDecoder::dumpThresholdsPassed() const{ - - for( unsigned int thresh = 0; thresh < 16; ++thresh ) { - if( ( 1 << thresh ) & m_thresholdsPassed ) { - std::cout << "Threshold " << ( thresh + 1 ) << " : passed" << std::endl; - } - } - return; -} - -/** returns the crate associated with the RoI word */ -unsigned int LVL1::RoIDecoder::crate( const unsigned int word ){ - decodeWord(word); - return m_crate; -} - -/** returns a vector containing the numbers of threshold passed i.e. if the vector - contains 1,3,5 it means that this RoI passed thresholds 1,3 and 5.*/ -const std::vector< unsigned int >& LVL1::RoIDecoder::thresholdsPassed( const unsigned int word ) { - - decodeWord( word ); - m_threshPassedVec.clear(); - for( unsigned int thresh = 0; thresh < 16; ++thresh ){ - if( ( 1 << thresh ) & m_thresholdsPassed ) { - m_threshPassedVec.push_back( thresh + 1 ); - } - } - return m_threshPassedVec; -} - -/** examines an 32bit RoI word, extracts the RoI type and returns it*/ -LVL1::TrigT1CaloDefs::RoIType LVL1::RoIDecoder::roiType( unsigned int word ) const{ - unsigned int temp=extractBits(word, 31, 2); - if (temp == TrigT1CaloDefs::cpRoIType) { - return TrigT1CaloDefs::CpRoIWordType; - } - else if (temp == TrigT1CaloDefs::jetRoIType) { - unsigned int temp2 = extractBits(word, 30, 1); - if (temp2 == TrigT1CaloDefs::jetRoI) { - return TrigT1CaloDefs::JetRoIWordType; - } - else if (temp2 == TrigT1CaloDefs::jetEtRoI) { - return TrigT1CaloDefs::JetEtRoIWordType; - } - else { - return TrigT1CaloDefs::RoIWordTypeError; - } - } - else if (temp == TrigT1CaloDefs::energyRoIType) { - unsigned int temp2 = extractBits(word, 29, 2); - if (temp2 == TrigT1CaloDefs::energyRoI0) { - return TrigT1CaloDefs::EnergyRoIWordType0; - } - else if (temp2 == TrigT1CaloDefs::energyRoI1) { - return TrigT1CaloDefs::EnergyRoIWordType1; - } - else if (temp2 == TrigT1CaloDefs::energyRoI2) { - return TrigT1CaloDefs::EnergyRoIWordType2; - } - else { - return TrigT1CaloDefs::RoIWordTypeError; - } - } - return TrigT1CaloDefs::RoIWordTypeError; -}