ATLAS Offline Software
Loading...
Searching...
No Matches
TileTTL1Cell.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5//*****************************************************************************
6// Filename : TileTTL1Cell.cxx
7// Author : Monica Dunford
8// Created : Nov, 2009
9//
10// DESCRIPTION:
11// Implementation comments only. Class level comments go in .h file.
12//
13// HISTORY:
14//
15//
16//
17// BUGS:
18//
19//
20//*****************************************************************************
21
24
26#include "CaloDetDescr/CaloDetDescrElement.h"
27
28#include <iostream>
29#include <sstream>
30#include <iomanip>
31
32// get cabling
33namespace {
34const TileCablingService * const s_cabling = TileCablingService::getInstance();
35}
36
37//=========================
38// Constructors
39//=========================
41 float energy, float time, float correction_factor,
42 uint16_t quality)
43 : m_ID(id)
44 , m_eneTower(energy)
45 , m_timeAve(time)
46 , m_corrFactor(correction_factor)
47 , m_quality(quality)
48{
49}
50
51//=========================
52// Set attributes
53//=========================
55{
56 m_eneTower = ene;
57}
58void TileTTL1Cell::setTime(float tave)
59{
60 m_timeAve = tave;
61}
63{
64 m_corrFactor = corrfact;
65}
66void TileTTL1Cell::setQuality(uint16_t qual)
67{
68 m_quality = qual;
69}
70
71//=========================
72// Return attributes
73//=========================
74/* return Identifier */
76 return m_ID;
77}
78
79//=========================
80// Supporting functions
81//=========================
82
84{
85 std::cout << (std::string) (*this) << std::endl;
86}
87
88TileTTL1Cell::operator std::string() const
89{
90 std::ostringstream text(std::ostringstream::out);
91
92 text << whoami();
93 if (s_cabling->getTileTBID()->is_tiletb(m_ID)) {
94 text << "MBTS Id = " << s_cabling->getTileTBID()->to_string(m_ID);
95 } else {
96 text << " Id = " << s_cabling->getCaloLVL1_ID()->show_to_string(m_ID);
97 }
98 text << " tower ene = " << eneTower();
99 text << " ave time = " << timeAve();
100 text << " correction factor = " << corrFactor();
101 text << " qual = " << qualTower();
102
103 return text.str();
104}
105
static const TileCablingService * getInstance()
get pointer to service instance
uint16_t qualTower(void) const
get quality factor for (data member)
float corrFactor(void) const
get tower correction factor (data member)
void setTime(float tave)
set average cell time
const Identifier & TTL1_ID() const
all get methods
float eneTower(void) const
get energy for tower (data member)
uint16_t m_quality
quality = quality bit for cell and PMTs in tower
float m_corrFactor
corrFactor = energy correction factors applied to tower
void setEnergy(float ene)
all set methods
void setQuality(uint16_t qual)
set quality bits for one tower
float m_eneTower
eneTower = sum of cell energies
void setCorrectionFactor(float corrfact)
set correction factor
float timeAve(void) const
get time average for all cells in tower (data member)
float m_timeAve
timeAve = time average of cell times.
Identifier m_ID
ID = trigger tower id.
void print(void) const
print all cell data memebers to stdout
TileTTL1Cell()
default constructor
std::string whoami(void) const
get name of the object