ATLAS Offline Software
Loading...
Searching...
No Matches
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
27const float DELTA_PHI_DRAWER = M_PI / 32.;
28
30 : m_ID (id)
31{
32 setphi();
33}
34
35TileL2::TileL2(int id, float /* phi */)
36 : m_ID (id)
37{
38 setphi();
39}
40
42{
43 int drawer = (m_ID&0x3F);
44 m_phi = (drawer<32?(drawer+0.5)*DELTA_PHI_DRAWER:(drawer-63.5)*DELTA_PHI_DRAWER);
45 m_cosphi = cos(m_phi);
46 m_sinphi = sin(m_phi);
47}
48
49void TileL2::print() const
50{
51 std::cout << (std::string) (*this) << std::endl;
52}
53
54TileL2::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}
#define M_PI
const float DELTA_PHI_DRAWER
Definition TileL2.cxx:27
std::vector< float > m_sumE
sumEt, sumEz, sumE energy per TileCal superdrawer
Definition TileL2.h:185
float m_phi
drawer phi
Definition TileL2.h:180
std::vector< float > m_enemu1
Energy deposited by the muons in TileCal central layer.
Definition TileL2.h:194
std::vector< float > m_enemu0
Energy deposited by the muons in TileCal innermost layer.
Definition TileL2.h:191
TileL2()
Constructor.
Definition TileL2.h:38
float m_cosphi
Definition TileL2.h:181
int m_ID
Drawer ID: 0x100-0x13F, 0x200-0x23F, 0x300-0x33F, 0x400-0x43F.
Definition TileL2.h:174
std::vector< unsigned int > m_val
32-bit words (packed muon info)
Definition TileL2.h:203
void print(void) const
Printing for debugging.
Definition TileL2.cxx:49
std::string whoami(void) const
Return identification.
Definition TileL2.h:157
float m_sinphi
Definition TileL2.h:182
std::vector< float > m_eta
Muon eta.
Definition TileL2.h:188
void setphi()
function to set phi from ID
Definition TileL2.cxx:41
void clear()
Clear all vectors in TileL2.
Definition TileL2.cxx:104
std::vector< unsigned int > m_quality_factor
Quality flag for tight and loose muon selection.
Definition TileL2.h:200
std::vector< float > m_enemu2
Energy deposited by the muons in TileCal outermost layer.
Definition TileL2.h:197