ATLAS Offline Software
Loading...
Searching...
No Matches
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
18namespace ROIB {
19 class CTPRoI;
20}
21
22namespace LVL1CTP {
23
38
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
Class grouping useful functions together.
Definition CTPUtil.h:39
static int getEMTMult(unsigned int word, int threshold)
get EmTau multiplicty in legacy mode
Definition CTPUtil.cxx:28
static int getJetMult(unsigned int word, int threshold)
get Jet multiplicty in legacy mode
Definition CTPUtil.cxx:34
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
static int getOptMult(std::bitset< 128 > bits, unsigned int startbit, unsigned int endbit)
Definition CTPUtil.cxx:77
static std::string printHex(const std::vector< uint32_t > &rhs, const std::string &delimiter=",")
print vector in hex format
Definition CTPUtil.cxx:170
static unsigned int alignBits(int value, int startbit, int endbit)
align bits
Definition CTPUtil.cxx:138
static int getETMult(unsigned int word, int threshold)
get transverse energy multiplicty in legacy mode
Definition CTPUtil.cxx:52
static unsigned int createMask(int startbit, int endbit)
create mask
Definition CTPUtil.cxx:154
static int getJetEMult(unsigned int word, int threshold)
get Jet Energy multiplicty in legacy mode
Definition CTPUtil.cxx:46
static std::bitset< 256 > convertToBitset(const std::vector< uint32_t > &words)
convert list of words into bitset
Definition CTPUtil.cxx:97
static int getTMMult(unsigned int word, int threshold)
get missing Et multiplicty in legacy mode
Definition CTPUtil.cxx:58
static int getFJetMult(unsigned int word, int threshold)
get Forward Jet multiplicty in legacy mode
Definition CTPUtil.cxx:40
static int getMult(uint64_t word, unsigned int startbit, unsigned int endbit)
extract multiplicities using new trigger configuration interface
Definition CTPUtil.cxx:64
static int getMuonMult(unsigned int word, int threshold)
get Muon multiplicty in legacy mode
Definition CTPUtil.cxx:22
static std::bitset< 512 > convertToLargeBitset(const std::vector< uint32_t > &words)
convert list of words into bitset
Definition CTPUtil.cxx:118
ROIB::CTPRoI contains a RoI delivered by the CTP.
Definition CTPRoI.h:28
Namespace of the LVL1 RoIB simulation.