ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCalib::HistogramId Class Reference

Identifier class for drift time histograms. More...

#include <HistogramId.h>

Collaboration diagram for MuonCalib::HistogramId:

Public Member Functions

 HistogramId ()
 constructor - does nothing
void Initialize (const MuonFixedId &id, int sort_by)
 initialize
bool operator> (const HistogramId &other) const
 comparision operator defined so that this class can be used as a map index.
bool operator< (const HistogramId &other) const
 comparision operator defined so that this class can be used as a map index.
int getIdInt () const
 get numberic id
const std::string & HistogramName () const
 get ascii histogram name

Static Public Attributes

static const int TUBE = 4
 valid values of the sort_by argument of the Initialize function
static const int LAYER = 2
static const int MULTILAYER = 1
static const int CHAMBER = 0
static const int MEZZ_CARD = 3

Private Attributes

std::pair< int, int > m_id
 integer identity - value depends on the sort_by argument of the Initialize-Function
std::string m_histogram_name
 ascii histogram name

Detailed Description

Identifier class for drift time histograms.

The class can be switched to the identification of single tubes, and different types of groupes of tubes.

Author
Felix.nosp@m..Rau.nosp@m.scher.nosp@m.@Phy.nosp@m.sik.U.nosp@m.ni-M.nosp@m.uench.nosp@m.en.d.nosp@m.e

Definition at line 24 of file HistogramId.h.

Constructor & Destructor Documentation

◆ HistogramId()

MuonCalib::HistogramId::HistogramId ( )
inline

constructor - does nothing

Definition at line 27 of file HistogramId.h.

27: m_id(0, 0) {}
std::pair< int, int > m_id
integer identity - value depends on the sort_by argument of the Initialize-Function
Definition HistogramId.h:53

Member Function Documentation

◆ getIdInt()

int MuonCalib::HistogramId::getIdInt ( ) const
inline

get numberic id

Definition at line 47 of file HistogramId.h.

47{ return m_id.second; }

◆ HistogramName()

const std::string & MuonCalib::HistogramId::HistogramName ( ) const
inline

get ascii histogram name

Definition at line 49 of file HistogramId.h.

49{ return m_histogram_name; }
std::string m_histogram_name
ascii histogram name
Definition HistogramId.h:55

◆ Initialize()

void MuonCalib::HistogramId::Initialize ( const MuonFixedId & id,
int sort_by )

initialize

Parameters
idMuonCalibFixedId of the tube
sort_by(HistogramId :: TUBE, HistogramId :: LAYER ..)

Definition at line 18 of file HistogramId.cxx.

18 {
19 m_id.first = sort_by;
20 static const unsigned int kStationNameShift = 24;
21
22 static const unsigned int kStationEtaShift = 19;
23
24 static const unsigned int kStationPhiShift = 13;
25
26 // Mdt specific code
27
28 static const unsigned int kMdtMultilayerShift = 9;
29
30 static const unsigned int kMdtTubeLayerShift = 7;
31
32 // static const unsigned int kMdtTubeShift = 0;
33 switch (sort_by) {
34 case TUBE: {
35 m_id.second = id.getIdInt();
36 break;
37 }
38 case LAYER: {
39 m_id.second = (id.stationNameIndex() << kStationNameShift) | (id.etaIndex() << kStationEtaShift) |
40 (id.phiIndex() << kStationPhiShift) | (id.mdtMultilayerIndex() << kMdtMultilayerShift) |
41 (id.mdtTubeLayerIndex() << kMdtTubeLayerShift);
42 break;
43 }
44 case MULTILAYER: {
45 m_id.second = (id.stationNameIndex() << kStationNameShift) | (id.etaIndex() << kStationEtaShift) |
46 (id.phiIndex() << kStationPhiShift) | (id.mdtMultilayerIndex() << kMdtMultilayerShift);
47 break;
48 }
49 case CHAMBER: {
50 m_id.second = (id.stationNameIndex() << kStationNameShift) | (id.etaIndex() << kStationEtaShift) |
51 (id.phiIndex() << kStationPhiShift);
52 break;
53 }
54 case MEZZ_CARD: {
55 // first part is like multilayer
56 m_id.second = id.mdtMezzanine();
57 break;
58 }
59 default: {
60 MsgStream log(Athena::getMessageSvc(), "HistogramId");
61 log << MSG::WARNING << "HistogramId :: Initialize: sort_by arguemnt is invalid!" << endmsg;
62 }
63 }
64 // create histogram name
65 std::ostringstream os;
66 if (m_id.second == -999999) {
67 os << "Summary";
68 } else {
69 // chamber name
70 os << id.stationNumberToFixedStationString(id.stationName()) << "_eta";
71 if (id.eta() < 0)
72 os << "C";
73 else
74 os << "A";
75 os << std::abs(id.eta()) << "_phi" << id.phi();
76 // multilayer name
77 if (sort_by != CHAMBER) os << "_ml" << id.mdtMultilayer();
78 // layer name
79 if (sort_by != CHAMBER && sort_by != MULTILAYER && sort_by != MEZZ_CARD) os << "_ly" << id.mdtTubeLayer();
80 // tube name
81 if (sort_by == TUBE) os << "_tb" << id.mdtTube();
82 // mezz-id
83 if (sort_by == MEZZ_CARD) { os << "_mez" << (id.mdtMezzanine() % 100); }
84 // numeric_id
85 os << "_num" << m_id.second << "_" << sort_by;
86 }
87 // store
88 m_histogram_name = os.str();
89 MsgStream log(Athena::getMessageSvc(), "HistogramId");
90 log << MSG::INFO << sort_by << " " << m_histogram_name << endmsg;
91 }
Scalar eta() const
pseudorapidity method
#define endmsg
static const int LAYER
Definition HistogramId.h:45
static const int TUBE
valid values of the sort_by argument of the Initialize function
Definition HistogramId.h:45
static const int MEZZ_CARD
Definition HistogramId.h:45
static const int MULTILAYER
Definition HistogramId.h:45
static const int CHAMBER
Definition HistogramId.h:45
IMessageSvc * getMessageSvc(bool quiet=false)

◆ operator<()

bool MuonCalib::HistogramId::operator< ( const HistogramId & other) const
inline

comparision operator defined so that this class can be used as a map index.

The behaviour depends on the setting of the sort_by parameter of the Initialize function.

Definition at line 43 of file HistogramId.h.

43{ return m_id < other.m_id; }

◆ operator>()

bool MuonCalib::HistogramId::operator> ( const HistogramId & other) const
inline

comparision operator defined so that this class can be used as a map index.

The behaviour depends on the setting of the sort_by parameter of the Initialize function.

Definition at line 38 of file HistogramId.h.

38{ return m_id > other.m_id; }

Member Data Documentation

◆ CHAMBER

const int MuonCalib::HistogramId::CHAMBER = 0
static

Definition at line 45 of file HistogramId.h.

◆ LAYER

const int MuonCalib::HistogramId::LAYER = 2
static

Definition at line 45 of file HistogramId.h.

◆ m_histogram_name

std::string MuonCalib::HistogramId::m_histogram_name
private

ascii histogram name

Definition at line 55 of file HistogramId.h.

◆ m_id

std::pair<int, int> MuonCalib::HistogramId::m_id
private

integer identity - value depends on the sort_by argument of the Initialize-Function

Definition at line 53 of file HistogramId.h.

◆ MEZZ_CARD

const int MuonCalib::HistogramId::MEZZ_CARD = 3
static

Definition at line 45 of file HistogramId.h.

◆ MULTILAYER

const int MuonCalib::HistogramId::MULTILAYER = 1
static

Definition at line 45 of file HistogramId.h.

◆ TUBE

const int MuonCalib::HistogramId::TUBE = 4
static

valid values of the sort_by argument of the Initialize function

Definition at line 45 of file HistogramId.h.


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