ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCondUtils Class Reference

Static class providing utility functions. More...

#include <CaloCondUtils.h>

Collaboration diagram for CaloCondUtils:

Public Types

enum  SYSTEM {
  EMECZNEG = 0 , EMBZNEG = 1 , EMBZPOS = 2 , EMECZPOS = 3 ,
  HEC =16 , FCAL =32 , TILE =48
}

Static Public Member Functions

static unsigned int getCoolChannelId (const SYSTEM sys)
 Returns the cool channel id associated with a given system.
static unsigned int getNCells (const SYSTEM sys)
 Returns the number of cells for a given system.
static std::string getFullTag (const std::string &folder, const std::string &tag)
 Returns the full tag string, composed of camelized folder name and tag part.
static unsigned int getDbCaloGain (int caloGain)
 Returns the non-negative gainId to be used with the COOL DB.

Detailed Description

Static class providing utility functions.

Author
Nils Gollub nils..nosp@m.goll.nosp@m.ub@ce.nosp@m.rn.c.nosp@m.h

Definition at line 16 of file CaloCondUtils.h.

Member Enumeration Documentation

◆ SYSTEM

Enumerator
EMECZNEG 
EMBZNEG 
EMBZPOS 
EMECZPOS 
HEC 
FCAL 
TILE 

Definition at line 19 of file CaloCondUtils.h.

Member Function Documentation

◆ getCoolChannelId()

unsigned int CaloCondUtils::getCoolChannelId ( const SYSTEM sys)
static

Returns the cool channel id associated with a given system.

Parameters
sysThe SYSTEM id

Definition at line 18 of file CaloCondUtils.cxx.

19{
20 return static_cast<unsigned int>(sys);
21}

◆ getDbCaloGain()

unsigned int CaloCondUtils::getDbCaloGain ( int caloGain)
static

Returns the non-negative gainId to be used with the COOL DB.

The CaloGain enumertor is negative for Tile Cells. Negative gains can not be used as an index. This function provides a non-negative index for each CaloGain

Parameters
caloGainInput caloGain

Definition at line 86 of file CaloCondUtils.cxx.

97{
98
99 //=== do nothing for LAr gains
100 if(caloGain>=0 && caloGain<=2) return static_cast<unsigned int>(caloGain);
101
102 //=== translate tile gains
103 if(caloGain==-16) return 0; //LOWLOW
104 if(caloGain==-15) return 1; //LOWHIGH
105 if(caloGain==-12) return 2; //HIGHLOW
106 if(caloGain==-11) return 3; //HIGHHIGH
107 if(caloGain== -4) return 0; //ONELOW
108 if(caloGain== -3) return 3; //ONEHIGH
109
110 //=== invalid gain
111 {
112 MsgStream log(Athena::getMessageSvc(), "CaloCondUtils::getDbCaloGain");
113 log << MSG::WARNING << "invalid gain found... probably corrupted data /badly decoded ? returns DbCaloGain 0" << endmsg;
114 return 0;
115 }
116 //throw CaloCond::InvalidCaloGain("CaloCondUtils::getDbCaloGain()", caloGain);
117}
#define endmsg
IMessageSvc * getMessageSvc(bool quiet=false)

◆ getFullTag()

std::string CaloCondUtils::getFullTag ( const std::string & folder,
const std::string & tag )
static

Returns the full tag string, composed of camelized folder name and tag part.

The tag name conventions are outline at https://twiki.cern.ch/twiki/bin/view/Atlas/CoolTagging.

Parameters
folderThe full COOL folder path capitalized, eg. "/CALO/V01/NOISE"
tagThe tag part, eg. "XX-YYY"

Definition at line 71 of file CaloCondUtils.cxx.

72{
73 std::string folderTag("");
74 //Copy folder name, ommiting slashes
75 for (const char i : folder) {
76 if (i!='/') {
77 folderTag+=i;
78 }
79 }
80 return (folderTag+"-"+tag);
81}

◆ getNCells()

unsigned int CaloCondUtils::getNCells ( const SYSTEM sys)
static

Returns the number of cells for a given system.

Parameters
sysThe SYSTEM id

Definition at line 26 of file CaloCondUtils.cxx.

27{
28 /*
29 //=== initialize on first usage
30 if(!m_nCells.size()){
31 m_nCells[EMECZNEG] = 31872;
32 m_nCells[EMBZNEG ] = 54784;
33 m_nCells[EMBZPOS ] = 54784;
34 m_nCells[EMECZPOS] = 31872;
35 m_nCells[HEC ] = 5632;
36 m_nCells[FCAL ] = 3524;
37 m_nCells[TILE ] = 5184;
38 }
39 */
40
41 switch (sys) {
42 case EMBZNEG:
43 return 54784;
44 break;
45 case EMBZPOS:
46 return 54784;
47 break;
48 case EMECZNEG:
49 return 31872;
50 break;
51 case EMECZPOS:
52 return 31872;
53 break;
54 case HEC:
55 return 5632;
56 break;
57 case TILE:
58 return 5184;
59 break;
60 case FCAL:
61 return 3524;
62 break;
63 }
64
65 return 0;
66}

The documentation for this class was generated from the following files: