ATLAS Offline Software
Trigger
TrigT1
TrigT1CaloUtils
src
Parity.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
Parity.cpp - description
6
-------------------
7
begin : Fri Jun 28 2002
8
email : moyse@zanzibar
9
***************************************************************************/
10
11
12
#include "
TrigT1CaloUtils/Parity.h
"
13
14
Parity::Parity
(){
15
}
16
Parity::~Parity
(){
17
}
19
unsigned
int
Parity::even
(
unsigned
int
word)
const
{
20
unsigned
int
numOfBits=0;
21
for
(
unsigned
int
bit=0; bit<
sizeof
(word); bit++){
22
if
(word&(1<<bit)) numOfBits++;
23
}
24
return
(numOfBits%2);
25
}
27
unsigned
int
Parity::odd
(
unsigned
int
word)
const
{
28
return
(1-
even
(word) );
29
}
Parity::~Parity
~Parity()
Definition:
Parity.cxx:16
Parity::even
unsigned int even(unsigned int word) const
returns even parity of passed word i.e.
Definition:
Parity.cxx:19
Parity::odd
unsigned int odd(unsigned int word) const
returns the odd parity of the passed word i.e.
Definition:
Parity.cxx:27
Parity.h
Parity::Parity
Parity()
Definition:
Parity.cxx:14
Generated on Fri Jan 10 2025 21:15:39 for ATLAS Offline Software by
1.8.18