ATLAS Offline Software
Public Member Functions | Private Types | Private Attributes | List of all members
LArAutoCorrTotal Class Reference

#include <LArAutoCorrTotal.h>

Collaboration diagram for LArAutoCorrTotal:

Public Member Functions

 LArAutoCorrTotal ()=delete
 
 LArAutoCorrTotal (const LArOnlineID_Base *onlineID, const LArOnOffIdMapping *cabling, const size_t nGains)
 
 ~LArAutoCorrTotal ()
 
bool set (const IdentifierHash &hid, const int gain, std::vector< float > &autocorrtotal)
 
const std::vector< double > computeAutoCorr (const std::vector< float > &terms, float Nminbias) const
 
const std::vector< double > autoCorrTotal (const IdentifierHash &hid, int gain, float Nminbias) const
 
const std::vector< double > autoCorrTotal (const HWIdentifier &hwid, int gain, float Nminbias) const
 
const std::vector< double > autoCorrTotal (const Identifier &id, int gain, float Nminbias) const
 
const std::vector< double > computeRMS (const std::vector< float > &terms, float Nminbias) const
 
const std::vector< double > samplRMS (const IdentifierHash &hid, int gain, float Nminbias) const
 
const std::vector< double > samplRMS (const HWIdentifier &hwid, int gain, float Nminbias) const
 
const std::vector< double > samplRMS (const Identifier &id, int gain, float Nminbias) const
 

Private Types

typedef std::vector< std::vector< float > > vecAutoCorrTotal
 

Private Attributes

std::array< vecAutoCorrTotal, CaloGain::LARNGAINm_AutoCorrTotal
 
const LArOnlineID_Basem_onlineID
 
const LArOnOffIdMappingm_cabling
 

Detailed Description

Definition at line 19 of file LArAutoCorrTotal.h.

Member Typedef Documentation

◆ vecAutoCorrTotal

typedef std::vector<std::vector<float> > LArAutoCorrTotal::vecAutoCorrTotal
private

Definition at line 62 of file LArAutoCorrTotal.h.

Constructor & Destructor Documentation

◆ LArAutoCorrTotal() [1/2]

LArAutoCorrTotal::LArAutoCorrTotal ( )
delete

◆ LArAutoCorrTotal() [2/2]

LArAutoCorrTotal::LArAutoCorrTotal ( const LArOnlineID_Base onlineID,
const LArOnOffIdMapping cabling,
const size_t  nGains 
)

Definition at line 9 of file LArAutoCorrTotal.cxx.

11  : m_onlineID(onlineID), m_cabling(cabling) {
12 
13  assert(m_onlineID);
14  assert(CaloGain::LARNGAIN <= 3 && nGains > 0);
15 
16  for (size_t i = 0; i < nGains; ++i) {
17  m_AutoCorrTotal[i].resize(onlineID->channelHashMax());
18  }
19 }

◆ ~LArAutoCorrTotal()

LArAutoCorrTotal::~LArAutoCorrTotal ( )

Definition at line 21 of file LArAutoCorrTotal.cxx.

21 {}

Member Function Documentation

◆ autoCorrTotal() [1/3]

const std::vector< double > LArAutoCorrTotal::autoCorrTotal ( const HWIdentifier hwid,
int  gain,
float  Nminbias 
) const

Definition at line 66 of file LArAutoCorrTotal.cxx.

66  {
67  const IdentifierHash hid = m_onlineID->channel_Hash(hwid);
68  return this->autoCorrTotal(hid, gain, Nminbias);
69 }

◆ autoCorrTotal() [2/3]

const std::vector< double > LArAutoCorrTotal::autoCorrTotal ( const Identifier id,
int  gain,
float  Nminbias 
) const

Definition at line 71 of file LArAutoCorrTotal.cxx.

71  {
72  const HWIdentifier hwid = m_cabling->createSignalChannelID(offid);
73  return this->autoCorrTotal(hwid, gain, Nminbias);
74 }

◆ autoCorrTotal() [3/3]

const std::vector< double > LArAutoCorrTotal::autoCorrTotal ( const IdentifierHash hid,
int  gain,
float  Nminbias 
) const

Definition at line 58 of file LArAutoCorrTotal.cxx.

59  {
60  //FIXME we should check if the vector<float> of index "hid" exists before trying to compute it!
61  //but we already have resized the vector<vector<float>> to size channelHashMax in the ctor
62 
63  return (this->computeAutoCorr(m_AutoCorrTotal[gain][hid], Nminbias));
64 }

◆ computeAutoCorr()

const std::vector< double > LArAutoCorrTotal::computeAutoCorr ( const std::vector< float > &  terms,
float  Nminbias 
) const

Definition at line 35 of file LArAutoCorrTotal.cxx.

36  {
37 
38  std::vector<double> vResult;
39  int tsize = int(sqrt(terms.size()));
40  int nsize_tot = (tsize - 1) * (tsize) / 2;
41  vResult.reserve(nsize_tot);
42  for (int i1 = 0; i1 < tsize - 1; i1++) {
43  for (int i2 = i1 + 1; i2 < tsize; i2++) {
44 
45  int index = i1 * tsize - i1 * (i1 + 1) / 2 + i2 - (i1 + 1);
46 
47  vResult.push_back((terms[index] + Nminbias * terms[nsize_tot + index]) /
48  sqrt((1. + Nminbias * terms[2 * nsize_tot + i1]) *
49  (1. + Nminbias * terms[2 * nsize_tot + i2])));
50  }
51  }
52  return (vResult);
53 }

◆ computeRMS()

const std::vector< double > LArAutoCorrTotal::computeRMS ( const std::vector< float > &  terms,
float  Nminbias 
) const

Definition at line 77 of file LArAutoCorrTotal.cxx.

78  {
79 
80  std::vector<double> vResult;
81  int tsize = int(sqrt(terms.size()));
82  vResult.reserve(tsize);
83  int nsize_tot = (tsize - 1) * (tsize) / 2;
84  for (int i = 0; i < tsize; i++) {
85  vResult.push_back(sqrt(1. + Nminbias * terms[2 * nsize_tot + i]));
86  }
87  return (vResult);
88 }

◆ samplRMS() [1/3]

const std::vector< double > LArAutoCorrTotal::samplRMS ( const HWIdentifier hwid,
int  gain,
float  Nminbias 
) const

Definition at line 96 of file LArAutoCorrTotal.cxx.

98  {
99  const IdentifierHash hid = m_onlineID->channel_Hash(hwid);
100  return this->samplRMS(hid, gain, Nminbias);
101 }

◆ samplRMS() [2/3]

const std::vector< double > LArAutoCorrTotal::samplRMS ( const Identifier id,
int  gain,
float  Nminbias 
) const

Definition at line 103 of file LArAutoCorrTotal.cxx.

105  {
106  const HWIdentifier hwid = m_cabling->createSignalChannelID(offid);
107  return this->samplRMS(hwid, gain, Nminbias);
108 }

◆ samplRMS() [3/3]

const std::vector< double > LArAutoCorrTotal::samplRMS ( const IdentifierHash hid,
int  gain,
float  Nminbias 
) const

Definition at line 90 of file LArAutoCorrTotal.cxx.

92  {
93  return (this->computeRMS(m_AutoCorrTotal[gain][hid], Nminbias));
94 }

◆ set()

bool LArAutoCorrTotal::set ( const IdentifierHash hid,
const int  gain,
std::vector< float > &  autocorrtotal 
)

Definition at line 23 of file LArAutoCorrTotal.cxx.

24  {
25  if (gain >= CaloGain::LARNGAIN || hid >= m_AutoCorrTotal[gain].size()) {
26  return false;
27  }
28 
29  m_AutoCorrTotal[gain][hid].swap(autocorrtotal);
30  return true;
31 }

Member Data Documentation

◆ m_AutoCorrTotal

std::array<vecAutoCorrTotal, CaloGain::LARNGAIN> LArAutoCorrTotal::m_AutoCorrTotal
private

Definition at line 66 of file LArAutoCorrTotal.h.

◆ m_cabling

const LArOnOffIdMapping* LArAutoCorrTotal::m_cabling
private

Definition at line 69 of file LArAutoCorrTotal.h.

◆ m_onlineID

const LArOnlineID_Base* LArAutoCorrTotal::m_onlineID
private

Definition at line 68 of file LArAutoCorrTotal.h.


The documentation for this class was generated from the following files:
LArAutoCorrTotal::m_onlineID
const LArOnlineID_Base * m_onlineID
Definition: LArAutoCorrTotal.h:68
LArOnlineID_Base::channel_Hash
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
Definition: LArOnlineID_Base.cxx:1636
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
index
Definition: index.py:1
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
HWIdentifier
Definition: HWIdentifier.h:13
CaloGain::LARNGAIN
@ LARNGAIN
Definition: CaloGain.h:19
LArAutoCorrTotal::autoCorrTotal
const std::vector< double > autoCorrTotal(const IdentifierHash &hid, int gain, float Nminbias) const
Definition: LArAutoCorrTotal.cxx:58
LArAutoCorrTotal::m_cabling
const LArOnOffIdMapping * m_cabling
Definition: LArAutoCorrTotal.h:69
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
LArAutoCorrTotal::computeRMS
const std::vector< double > computeRMS(const std::vector< float > &terms, float Nminbias) const
Definition: LArAutoCorrTotal.cxx:77
LArAutoCorrTotal::computeAutoCorr
const std::vector< double > computeAutoCorr(const std::vector< float > &terms, float Nminbias) const
Definition: LArAutoCorrTotal.cxx:35
lumiFormat.i
int i
Definition: lumiFormat.py:92
LArAutoCorrTotal::samplRMS
const std::vector< double > samplRMS(const IdentifierHash &hid, int gain, float Nminbias) const
Definition: LArAutoCorrTotal.cxx:90
LArOnOffIdMapping::createSignalChannelID
HWIdentifier createSignalChannelID(const Identifier &id) const
create a HWIdentifier from an Identifier (not inline)
Definition: LArOnOffIdMapping.h:126
LArOnlineID_Base::channelHashMax
size_type channelHashMax(void) const
Define channel hash tables max size.
Definition: LArOnlineID_Base.cxx:1901
atlasStyleMacro.tsize
float tsize
Definition: atlasStyleMacro.py:37
IdentifierHash
Definition: IdentifierHash.h:38
LArAutoCorrTotal::m_AutoCorrTotal
std::array< vecAutoCorrTotal, CaloGain::LARNGAIN > m_AutoCorrTotal
Definition: LArAutoCorrTotal.h:66