Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
RawTowerGeomv3.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file RawTowerGeomv3.cc
1
#include "
RawTowerGeomv3.h
"
2
3
#include <cmath>
4
#include <iostream>
5
6
RawTowerGeomv3::RawTowerGeomv3
(
RawTowerDefs::keytype
id
)
7
: _towerid(id)
8
{
9
}
10
11
double
RawTowerGeomv3::get_center_radius
()
const
12
{
13
return
std::sqrt(
_center_x
*
_center_x
+
14
_center_y
*
_center_y
);
15
}
16
17
double
RawTowerGeomv3::get_theta
()
const
18
{
19
double
radius = sqrt(
_center_x
*
_center_x
+
_center_y
*
_center_y
);
20
double
theta
= atan2(radius,
_center_z
);
21
return
theta
;
22
}
23
24
double
RawTowerGeomv3::get_eta
()
const
25
{
26
double
theta
=
get_theta
();
27
double
eta
= -log(tan(theta / 2.));
28
return
eta
;
29
}
30
31
double
RawTowerGeomv3::get_phi
()
const
32
{
33
return
atan2(
_center_y
,
_center_x
);
34
}
35
36
int
RawTowerGeomv3::get_bineta
()
const
37
{
38
RawTowerDefs::CalorimeterId
caloid =
RawTowerDefs::decode_caloid
(
_towerid
);
39
switch
(caloid)
40
{
41
case
RawTowerDefs::LFHCAL
:
42
return
RawTowerDefs::decode_index1v2
(
_towerid
);
43
default
:
44
return
RawTowerDefs::decode_index1
(
_towerid
);
45
}
46
return
-1;
47
}
48
49
int
RawTowerGeomv3::get_binphi
()
const
50
{
51
RawTowerDefs::CalorimeterId
caloid =
RawTowerDefs::decode_caloid
(
_towerid
);
52
switch
(caloid)
53
{
54
case
RawTowerDefs::LFHCAL
:
55
return
RawTowerDefs::decode_index2v2
(
_towerid
);
56
default
:
57
return
RawTowerDefs::decode_index2
(
_towerid
);
58
}
59
return
-1;
60
}
61
62
void
RawTowerGeomv3::identify
(std::ostream&
os
)
const
63
{
64
os <<
"RawTowerGeomv3: x: "
<<
get_center_x
() <<
" y: "
<<
get_center_y
() <<
" z: "
<<
get_center_z
()
65
<<
"\n dx: "
<<
get_size_x
() <<
" dy: "
<<
get_size_y
() <<
" dz: "
<<
get_size_z
()
66
<<
"\n tower_type = "
<<
_tower_type
<< std::endl;
67
}
coresoftware
blob
master
offline
packages
CaloBase
RawTowerGeomv3.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:05
using
1.8.2 with
sPHENIX GitHub integration