ATLAS Offline Software
Loading...
Searching...
No Matches
JetEtRoIDecoder.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4/***************************************************************************
5 JetEtRoIDecoder.cxx - description
6 -------------------
7 begin : Fri Apr 19 2002
8 email : moyse@ph.qmw.ac.uk
9***************************************************************************/
10
11
12#include <cmath>
13#include <iostream>
14
16
17namespace LVL1 {
18
22
26
28 unsigned int JetEtRoIDecoder::energy( unsigned int roiWord ) const {
29 return roiWord & 0xF;
30 }
31
33 unsigned int JetEtRoIDecoder::extractBits( unsigned int word, const unsigned int start, const unsigned int length ) const {
34
35 // this works as follows. Imagine start=3, bits=4 and word=11011100
36 // so this routine should return 0111
37 // now:
38 // word>>(first-1) = 110111
39 // (1<<length) = 010000
40 // (1<<length)-1 = 001111
41 word = ( word >> ( start - 1 ) );
42
43 unsigned int bitmask = ( 1 << length ) - 1;
44 // and finally:
45 // 110111&001111 = 0111
46 return ( word & bitmask ); // return only bits in bitmask
47 }
48
49} // namespace LVL1
double length(const pvec &v)
unsigned int extractBits(unsigned int word, const unsigned int start, const unsigned int length) const
returns the value of bits in word between bit "start" and bit "start" + "length"
unsigned int energy(unsigned int roiWord) const
returns a 4b number which represents the Jet Et energy in GeV
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...