ATLAS Offline Software
CTPUtil.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #ifndef TRIGT1CTP_CTPUTIL_H
7 #define TRIGT1CTP_CTPUTIL_H
8 
9 // standard include(s):
10 #include <stdint.h>
11 
12 // STL include(s):
13 #include <vector>
14 #include <string>
15 #include <bitset>
16 
17 // forward declarations
18 namespace ROIB {
19  class CTPRoI;
20 }
21 
22 namespace LVL1CTP {
23 
39  class CTPUtil {
40 
41  public:
42  // Functions extracting multiplicities when using the legacy configuration objects:
43  static int getMuonMult( unsigned int word, int threshold );
44  static int getEMTMult( unsigned int word, int threshold );
45  static int getJetMult( unsigned int word, int threshold );
46  static int getFJetMult( unsigned int word, int threshold );
47  static int getJetEMult( unsigned int word, int threshold );
48  static int getETMult( unsigned int word, int threshold );
49  static int getTMMult( unsigned int word, int threshold );
50 
52  static int getMult( uint64_t word, unsigned int startbit, unsigned int endbit );
53  static int getMuonMult( const std::vector<unsigned int>& words, unsigned int startbit, unsigned int endbit );
54  static int getOptMult( std::bitset<128> bits, unsigned int startbit, unsigned int endbit );
55 
57  static unsigned int getMultTopo( uint64_t word, unsigned int startbit, unsigned int endbit, unsigned int clock );
58 
59  // Some additional helper functions:
60  static unsigned int alignBits( int value, int startbit, int endbit );
61  static unsigned int createMask( int startbit, int endbit );
62  static std::bitset<512> convertToLargeBitset(const std::vector<uint32_t>& words);
63  static std::bitset<256> convertToBitset(const std::vector<uint32_t>& words);
64  static std::bitset<512> convertToLargeBitset(const std::vector<ROIB::CTPRoI>& words);
65  static std::bitset<256> convertToBitset(const std::vector<ROIB::CTPRoI>& words);
66 
67  // helper for output
68  static std::string printHex(const std::vector<uint32_t>& rhs, const std::string& delimiter = ",");
69 
70  }; // class CTPUtil
71 
72 } // namespace LVL1CTP
73 
74 #endif // TRIGT1CTP_CTPUTIL_H
LVL1CTP::CTPUtil::createMask
static unsigned int createMask(int startbit, int endbit)
create mask
Definition: CTPUtil.cxx:154
LVL1CTP::CTPUtil::getJetMult
static int getJetMult(unsigned int word, int threshold)
get Jet multiplicty in legacy mode
Definition: CTPUtil.cxx:34
LVL1CTP::CTPUtil::getFJetMult
static int getFJetMult(unsigned int word, int threshold)
get Forward Jet multiplicty in legacy mode
Definition: CTPUtil.cxx:40
LVL1CTP::CTPUtil::getTMMult
static int getTMMult(unsigned int word, int threshold)
get missing Et multiplicty in legacy mode
Definition: CTPUtil.cxx:58
athena.value
value
Definition: athena.py:124
LVL1CTP::CTPUtil
Class grouping useful functions together.
Definition: CTPUtil.h:39
ROIB
Namespace of the LVL1 RoIB simulation.
Definition: ILvl1ResultAccessTool.h:19
LVL1CTP::CTPUtil::getMult
static int getMult(uint64_t word, unsigned int startbit, unsigned int endbit)
extract multiplicities using new trigger configuration interface
Definition: CTPUtil.cxx:64
python.AthDsoLogger.delimiter
delimiter
Definition: AthDsoLogger.py:71
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
LVL1CTP::CTPUtil::printHex
static std::string printHex(const std::vector< uint32_t > &rhs, const std::string &delimiter=",")
print vector in hex format
Definition: CTPUtil.cxx:170
LVL1CTP::CTPUtil::convertToBitset
static std::bitset< 256 > convertToBitset(const std::vector< uint32_t > &words)
convert list of words into bitset
Definition: CTPUtil.cxx:97
LVL1CTP::CTPUtil::getEMTMult
static int getEMTMult(unsigned int word, int threshold)
get EmTau multiplicty in legacy mode
Definition: CTPUtil.cxx:28
LVL1CTP::CTPUtil::getOptMult
static int getOptMult(std::bitset< 128 > bits, unsigned int startbit, unsigned int endbit)
Definition: CTPUtil.cxx:77
LVL1CTP::CTPUtil::getJetEMult
static int getJetEMult(unsigned int word, int threshold)
get Jet Energy multiplicty in legacy mode
Definition: CTPUtil.cxx:46
threshold
Definition: chainparser.cxx:74
LVL1CTP::CTPUtil::getMuonMult
static int getMuonMult(unsigned int word, int threshold)
get Muon multiplicty in legacy mode
Definition: CTPUtil.cxx:22
LVL1CTP::CTPUtil::convertToLargeBitset
static std::bitset< 512 > convertToLargeBitset(const std::vector< uint32_t > &words)
convert list of words into bitset
Definition: CTPUtil.cxx:118
LVL1CTP::CTPUtil::getETMult
static int getETMult(unsigned int word, int threshold)
get transverse energy multiplicty in legacy mode
Definition: CTPUtil.cxx:52
LVL1CTP::CTPUtil::getMultTopo
static unsigned int getMultTopo(uint64_t word, unsigned int startbit, unsigned int endbit, unsigned int clock)
extract multiplicities from Topo words, were the encoding is different
Definition: CTPUtil.cxx:83
LVL1CTP::CTPUtil::alignBits
static unsigned int alignBits(int value, int startbit, int endbit)
align bits
Definition: CTPUtil.cxx:138
LVL1CTP
Definition: Lvl1ResultAccessTool.h:20
checkFileSG.words
words
Definition: checkFileSG.py:76