ATLAS Offline Software
TileL2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //*****************************************************************************
6 // Filename : TileL2.cxx
7 // Author : Aranzazu Ruiz
8 // Created : March 2006
9 //
10 // DESCRIPTION:
11 // Implementation comments only. Class level comments go in .h file.
12 //
13 // HISTORY:
14 //
15 // BUGS:
16 //
17 //
18 //*****************************************************************************
19 
20 #include "TileEvent/TileL2.h"
21 
22 #include <iostream>
23 #include <sstream>
24 #include <iomanip>
25 #include <cmath>
26 
27 const float DELTA_PHI_DRAWER = M_PI / 32.;
28 
30  : m_ID (id)
31 {
32  setphi();
33 }
34 
35 TileL2::TileL2(int id, float /* phi */)
36  : m_ID (id)
37 {
38  setphi();
39 }
40 
42 {
43  int drawer = (m_ID&0x3F);
45  m_cosphi = cos(m_phi);
46  m_sinphi = sin(m_phi);
47 }
48 
49 void TileL2::print() const
50 {
51  std::cout << (std::string) (*this) << std::endl;
52 }
53 
54 TileL2::operator std::string() const
55 {
56  std::ostringstream text(std::ostringstream::out);
57 
58  text << whoami();
59  text << " Id = " << std::hex << "0x" << m_ID << std::dec;
60  text << " phi = " << m_phi;
61 
62  if (m_sumE.size()>0 ) {
63  text << " sumEt = " << m_sumE[0];
64  if (m_sumE.size()>1 ) {
65  text << " sumEz = " << m_sumE[1];
66  if (m_sumE.size()>2 ) {
67  text << " sumE = " << m_sumE[2];
68  if (m_sumE.size()>3 ) {
69  text << " others = ";
70  for (unsigned int i=3; i<m_sumE.size(); ++i) text << " " << m_sumE[i];
71  }
72  }
73  }
74  } else {
75  text << " sumE: none";
76  }
77 
78  text << " NMuons = " << m_eta.size();
79 
80  if (m_eta.size() ) {
81 
82  text << " eta =";
83  for (unsigned int i=0; i<m_eta.size(); ++i) text << " " << m_eta[i];
84 
85  text << " enemu0 =";
86  for (unsigned int i=0; i<m_enemu0.size(); ++i) text << " " << m_enemu0[i];
87 
88  text << " enemu1 =";
89  for (unsigned int i=0; i<m_enemu1.size(); ++i) text << " " << m_enemu1[i];
90 
91  text << " enemu2 =";
92  for (unsigned int i=0; i<m_enemu2.size(); ++i) text << " " << m_enemu2[i];
93 
94  text << " qual =";
95  for (unsigned int i=0; i<m_quality_factor.size(); ++i) text << " " << m_quality_factor[i];
96 
97  text << " val =";
98  for (unsigned int i=0; i<m_val.size(); ++i) text << " " << m_val[i];
99  }
100 
101  return text.str();
102 }
103 
105 {
106  m_sumE.clear();
107  if (m_eta.size()) {
108  m_eta.clear();
109  m_enemu0.clear();
110  m_enemu1.clear();
111  m_enemu2.clear();
112  m_quality_factor.clear();
113  m_val.clear();
114  }
115 }
DELTA_PHI_DRAWER
const float DELTA_PHI_DRAWER
Definition: TileL2.cxx:27
TileL2::m_eta
std::vector< float > m_eta
Muon eta.
Definition: TileL2.h:188
TileL2::m_quality_factor
std::vector< unsigned int > m_quality_factor
Quality flag for tight and loose muon selection.
Definition: TileL2.h:200
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
M_PI
#define M_PI
Definition: ActiveFraction.h:11
TileL2::m_cosphi
float m_cosphi
Definition: TileL2.h:181
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
TileL2::m_enemu1
std::vector< float > m_enemu1
Energy deposited by the muons in TileCal central layer.
Definition: TileL2.h:194
TileL2::print
void print(void) const
Printing for debugging.
Definition: TileL2.cxx:49
TileL2::m_ID
int m_ID
Drawer ID: 0x100-0x13F, 0x200-0x23F, 0x300-0x33F, 0x400-0x43F.
Definition: TileL2.h:174
lumiFormat.i
int i
Definition: lumiFormat.py:85
TileL2.h
TileL2::clear
void clear()
Clear all vectors in TileL2.
Definition: TileL2.cxx:104
TileL2::TileL2
TileL2()
Constructor.
Definition: TileL2.h:38
TileL2::m_sinphi
float m_sinphi
Definition: TileL2.h:182
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
TileL2::m_val
std::vector< unsigned int > m_val
32-bit words (packed muon info)
Definition: TileL2.h:203
TileL2::m_phi
float m_phi
drawer phi
Definition: TileL2.h:180
TileL2::m_enemu0
std::vector< float > m_enemu0
Energy deposited by the muons in TileCal innermost layer.
Definition: TileL2.h:191
TileL2::m_sumE
std::vector< float > m_sumE
sumEt, sumEz, sumE energy per TileCal superdrawer
Definition: TileL2.h:185
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
TileL2::setphi
void setphi()
function to set phi from ID
Definition: TileL2.cxx:41
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
TileL2::m_enemu2
std::vector< float > m_enemu2
Energy deposited by the muons in TileCal outermost layer.
Definition: TileL2.h:197