ATLAS Offline Software
|
#include <L1CaloCoolChannelId.h>
Public Member Functions | |
L1CaloCoolChannelId () | |
Create a L1CaloCoolChannelId from the integer ID field. More... | |
L1CaloCoolChannelId (unsigned int crate, L1CaloModuleType mType, unsigned int module, unsigned int submodule, unsigned int channel, bool logical=true) | |
Create a L1CaloCoolChannelId from its component fields. More... | |
L1CaloCoolChannelId (unsigned int id) | |
Create a L1CaloCoolChannelId from the integer ID field. More... | |
L1CaloCoolChannelId (const L1CaloCoolChannelId &id) | |
Copy a L1CaloCoolChannelId. More... | |
~L1CaloCoolChannelId ()=default | |
unsigned int | crate () const |
L1CaloModuleType | moduleType () const |
Return module type of this channel ID. More... | |
unsigned int | module (bool logical=true) const |
unsigned int | subModule () const |
unsigned int | channel () const |
unsigned int | id () const |
L1CaloCoolChannelId & | operator= (const L1CaloCoolChannelId &id) |
bool | operator== (const L1CaloCoolChannelId &id) const |
bool | operator< (const L1CaloCoolChannelId &id) const |
Private Member Functions | |
unsigned int | logicalToPhysicalModule (L1CaloModuleType mType, unsigned int module) const |
unsigned int | physicalToLogicalModule (L1CaloModuleType mType, unsigned int module) const |
void | setId (unsigned int crate, L1CaloModuleType mType, unsigned int module, unsigned int submodule, unsigned int channel) |
Set the CoolChannelId value from its component fields. More... | |
Private Attributes | |
unsigned int | m_id |
Friends | |
std::ostream & | operator<< (std::ostream &output, const L1CaloCoolChannelId &r) |
Encapsulates the ID of one channel of conditions data in COOL, ie the ID of a row in a table.
At present, COOL can only handle integer IDs, so we encode crate, module type, module in crate, submodule, and channel with module or submodule into a 32 bit quantity as follows:
This class is a very close adaptation of the online coolL1Calo/L1CaloCoolChannelId class
Definition at line 10 of file L1CaloCoolChannelId.h.
L1CaloCoolChannelId::L1CaloCoolChannelId | ( | ) |
Create a L1CaloCoolChannelId from the integer ID field.
Definition at line 34 of file L1CaloCoolChannelId.cxx.
L1CaloCoolChannelId::L1CaloCoolChannelId | ( | unsigned int | crate, |
L1CaloModuleType | mType, | ||
unsigned int | module, | ||
unsigned int | submodule, | ||
unsigned int | channel, | ||
bool | logical = true |
||
) |
Create a L1CaloCoolChannelId from its component fields.
Definition at line 45 of file L1CaloCoolChannelId.cxx.
L1CaloCoolChannelId::L1CaloCoolChannelId | ( | unsigned int | id | ) |
Create a L1CaloCoolChannelId from the integer ID field.
Definition at line 66 of file L1CaloCoolChannelId.cxx.
L1CaloCoolChannelId::L1CaloCoolChannelId | ( | const L1CaloCoolChannelId & | id | ) |
Copy a L1CaloCoolChannelId.
Definition at line 77 of file L1CaloCoolChannelId.cxx.
|
default |
|
inline |
Definition at line 30 of file L1CaloCoolChannelId.h.
|
inline |
Definition at line 25 of file L1CaloCoolChannelId.h.
|
inline |
Definition at line 32 of file L1CaloCoolChannelId.h.
|
private |
unsigned int L1CaloCoolChannelId::module | ( | bool | logical = true | ) | const |
L1CaloModuleType L1CaloCoolChannelId::moduleType | ( | ) | const |
Return module type of this channel ID.
Definition at line 120 of file L1CaloCoolChannelId.cxx.
bool L1CaloCoolChannelId::operator< | ( | const L1CaloCoolChannelId & | id | ) | const |
Definition at line 205 of file L1CaloCoolChannelId.cxx.
L1CaloCoolChannelId & L1CaloCoolChannelId::operator= | ( | const L1CaloCoolChannelId & | id | ) |
Convert a typeId to a L1CaloModuleType \return L1CaloModuleType ‍/
L1CaloModuleType L1CaloCoolChannelId::moduleType(unsigned int mTypeId) const { L1CaloModuleType mType = L1CaloModuleType::None; if (mTypeId == 1) { mType = L1CaloModuleType::Ppm; } else if (mTypeId == 2) { mType = L1CaloModuleType::Cpm; } else if (mTypeId == 3) { mType = L1CaloModuleType::Jem; } else if (mTypeId == 4) { mType = L1CaloModuleType::Cmm; } else if (mTypeId == 5) { mType = L1CaloModuleType::Tcm; } else if (mTypeId == 6) { mType = L1CaloModuleType::L1CaloRod; } else if (mTypeId == 7) { mType = L1CaloModuleType::Cam; } return mType; }
/*! Convert a L1CaloModuleType to a typeId
unsigned int L1CaloCoolChannelId::module(bool logical) const { unsigned int logicalIndex = (m_id & 0x000f0000) >> 16; if(logical) { return logicalIndex; } else { return this->logicalToPhysicalModule(this->moduleType(), logicalIndex); } }
unsigned int L1CaloCoolChannelId::logicalToPhysicalModule(L1CaloModuleType mType, unsigned int module) const { if (mType == L1CaloModuleType::Ppm) { return module + 5; } //Ppm else if (mType == L1CaloModuleType::Cpm) { return module + 5; } //Cpm else if (mType == L1CaloModuleType::Jem) { return module + 4; } //Jem else { std::cout<<"The physical position of module type: "<<mType.toString()<<" is not known. Returning the logical index instead !"<<std::endl; return module; } }
unsigned int L1CaloCoolChannelId::physicalToLogicalModule(L1CaloModuleType mType, unsigned int module) const { if (mType == L1CaloModuleType::Ppm) { return module - 5; } //Ppm else if (mType == L1CaloModuleType::Cpm) { return module - 5; } //Cpm else if (mType == L1CaloModuleType::Jem) { return module - 4; } //Jem else { std::cout<<"The physical position of module type: "<<mType.toString()<<" is not known. Returning the logical index instead !"<<std::endl; return module; } }
/*! Copy a L1CaloCoolChannelId.
Definition at line 199 of file L1CaloCoolChannelId.cxx.
bool L1CaloCoolChannelId::operator== | ( | const L1CaloCoolChannelId & | id | ) | const |
Definition at line 209 of file L1CaloCoolChannelId.cxx.
|
private |
|
private |
Set the CoolChannelId value from its component fields.
Definition at line 89 of file L1CaloCoolChannelId.cxx.
|
inline |
Definition at line 29 of file L1CaloCoolChannelId.h.
|
friend |
|
private |
Definition at line 51 of file L1CaloCoolChannelId.h.