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

#include <NswT0Data.h>

Collaboration diagram for NswT0Data:

Public Member Functions

 NswT0Data (const Muon::IMuonIdHelperSvc *idHelperSvc)
 
 ~NswT0Data ()=default
 
void setData (const Identifier &channelId, const float channelT0)
 
bool getT0 (const Identifier &channelId, float &channelT0) const
 

Private Types

using ChannelArray = std::vector< std::vector< float > >
 

Private Member Functions

unsigned int identToModuleIdx (const Identifier &chan_id) const
 

Private Attributes

const Muon::IMuonIdHelperSvcm_idHelperSvc {}
 
ChannelArray m_data_mmg {}
 
ChannelArray m_data_stg {}
 

Detailed Description

Definition at line 16 of file NswT0Data.h.

Member Typedef Documentation

◆ ChannelArray

using NswT0Data::ChannelArray = std::vector<std::vector<float> >
private

Definition at line 35 of file NswT0Data.h.

Constructor & Destructor Documentation

◆ NswT0Data()

NswT0Data::NswT0Data ( const Muon::IMuonIdHelperSvc idHelperSvc)

Definition at line 12 of file NswT0Data.cxx.

12  :
13  m_idHelperSvc{idHelperSvc} {
14  if (m_idHelperSvc->hasMM()) {
15  const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
16  m_data_mmg.resize((idHelper.detectorElement_hash_max()+1)*idHelper.gasGapMax());
17  }
18  if (m_idHelperSvc->hasSTGC()) {
19  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
20  m_data_stg.resize((idHelper.detectorElement_hash_max() +1)*(idHelper.gasGapMax()*3 /*3 channel types*/));
21 
22  }
23 }

◆ ~NswT0Data()

NswT0Data::~NswT0Data ( )
default

Member Function Documentation

◆ getT0()

bool NswT0Data::getT0 ( const Identifier channelId,
float &  channelT0 
) const

Definition at line 55 of file NswT0Data.cxx.

55  {
57  if (m_idHelperSvc->isMM(id)) {
58  if (m_data_mmg.size() <= idx) return false;
61  return true;
62  }
64  if(m_data_stg.size() <= idx) return false;
65  if(m_data_stg[idx].size() <= idx) return false;
67  return true;
68 }

◆ identToModuleIdx()

unsigned int NswT0Data::identToModuleIdx ( const Identifier chan_id) const
private

Definition at line 25 of file NswT0Data.cxx.

25  {
27  if (m_idHelperSvc->isMM(chan_id)) {
28  const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
29  return static_cast<unsigned int>(hash)*(idHelper.gasGapMax()) + (idHelper.gasGap(chan_id) -1);
30  } else if (m_idHelperSvc->issTgc(chan_id)) {
31  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
32  return static_cast<unsigned int>(hash)*(idHelper.gasGapMax() * 3 /*3 channel types*/) +
33  (idHelper.gasGap(chan_id) -1 + idHelper.gasGapMax() * idHelper.channelType(chan_id));
34  }
35  THROW_EXCEPTION("NswT0Data() - No MM or sTGC identifier");
36  return -1;
37 }

◆ setData()

void NswT0Data::setData ( const Identifier channelId,
const float  channelT0 
)

Definition at line 39 of file NswT0Data.cxx.

39  {
42  uint channelIdx{0};
43  if(m_idHelperSvc->isMM(id)){
44  const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
45  if(data.at(idx).empty()) data.at(idx).resize(idHelper.channelMax(id), 0.f);
46  channelIdx = idHelper.channel(id) -1;
47  } else {
48  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
49  if(data.at(idx).empty()) data.at(idx).resize(idHelper.channelMax(id), 0.f);
50  channelIdx = idHelper.channel(id) -1;
51  }
52  data.at(idx).at(channelIdx) = value;
53 }

Member Data Documentation

◆ m_data_mmg

ChannelArray NswT0Data::m_data_mmg {}
private

Definition at line 36 of file NswT0Data.h.

◆ m_data_stg

ChannelArray NswT0Data::m_data_stg {}
private

Definition at line 37 of file NswT0Data.h.

◆ m_idHelperSvc

const Muon::IMuonIdHelperSvc* NswT0Data::m_idHelperSvc {}
private

Definition at line 33 of file NswT0Data.h.


The documentation for this class was generated from the following files:
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Muon::IMuonIdHelperSvc::stgcIdHelper
virtual const sTgcIdHelper & stgcIdHelper() const =0
access to TgcIdHelper
athena.value
value
Definition: athena.py:124
NswT0Data::m_data_stg
ChannelArray m_data_stg
Definition: NswT0Data.h:37
THROW_EXCEPTION
#define THROW_EXCEPTION(MSG)
Definition: MMReadoutElement.cxx:48
Muon::IMuonIdHelperSvc::mmIdHelper
virtual const MmIdHelper & mmIdHelper() const =0
access to CscIdHelper
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
NswT0Data::m_data_mmg
ChannelArray m_data_mmg
Definition: NswT0Data.h:36
sTgcIdHelper::channel
int channel(const Identifier &id) const override
Definition: sTgcIdHelper.cxx:1027
NswT0Data::ChannelArray
std::vector< std::vector< float > > ChannelArray
Definition: NswT0Data.h:35
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
NswT0Data::identToModuleIdx
unsigned int identToModuleIdx(const Identifier &chan_id) const
Definition: NswT0Data.cxx:25
Muon::IMuonIdHelperSvc::isMM
virtual bool isMM(const Identifier &id) const =0
returns whether this is a MM Identifier or not
sTgcIdHelper
Definition: sTgcIdHelper.h:55
Muon::IMuonIdHelperSvc::hasMM
virtual bool hasMM() const =0
returns whether the Mircomegas identifiers are loaded
MmIdHelper::channel
int channel(const Identifier &id) const override
Definition: MmIdHelper.cxx:800
MmIdHelper
Definition: MmIdHelper.h:54
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
NswT0Data::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition: NswT0Data.h:33
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
Muon::IMuonIdHelperSvc::issTgc
virtual bool issTgc(const Identifier &id) const =0
returns whether this is a sTGC Identifier or not
Muon::IMuonIdHelperSvc::detElementHash
virtual IdentifierHash detElementHash(const Identifier &id) const =0
Returns the detector element hash associated to an Identifier.
Muon::IMuonIdHelperSvc::hasSTGC
virtual bool hasSTGC() const =0
returns whether the sTGC identifiers are loaded