Project
Loading...
Searching...
No Matches
Cluster.cxx
Go to the documentation of this file.
1
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3
// All rights not expressly granted are reserved.
4
//
5
// This software is distributed under the terms of the GNU General Public
6
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7
//
8
// In applying this license CERN does not waive the privileges and immunities
9
// granted to it by virtue of its status as an Intergovernmental Organization
10
// or submit itself to any jurisdiction.
11
16
17
#include <map>
18
#include <vector>
19
#include <
DataFormatsECal/Cluster.h
>
20
#include <
DataFormatsECal/Digit.h
>
21
22
using namespace
o2::ecal
;
23
24
ClassImp
(
Cluster
);
25
26
//==============================================================================
27
void
Cluster::addDigit(
int
digitIndex,
int
towerId,
double
energy)
28
{
29
mE += energy;
30
mDigitIndex.push_back(digitIndex);
31
mDigitTowerId.push_back(towerId);
32
mDigitEnergy.push_back(energy);
33
}
34
35
//==============================================================================
36
int
Cluster::getMcTrackID()
const
37
{
38
float
maxEnergy = 0;
39
int
maxID = 0;
40
for
(
const
auto
& [mcTrackID, energy] : mMcTrackEnergy) {
41
if
(energy > maxEnergy) {
42
maxEnergy = energy;
43
maxID = mcTrackID;
44
}
45
}
46
return
maxID;
47
}
48
49
//==============================================================================
50
TLorentzVector Cluster::getMomentum()
const
51
{
52
double
r
= std::sqrt(mX * mX + mY * mY + mZ * mZ);
53
if
(
r
== 0)
54
return
TLorentzVector();
55
return
TLorentzVector(mE * mX /
r
, mE * mY /
r
, mE * mZ /
r
, mE);
56
}
Cluster.h
Definition of ECal cluster class.
Digit.h
Definition of ECal digit class.
ClassImp
ClassImp(Cluster)
o2::ecal::Cluster
Definition
Cluster.h:29
r
GLboolean r
Definition
glcorearb.h:1233
o2::ecal
Definition
ECalBaseParam.h:26
Detectors
Upgrades
ALICE3
ECal
DataFormatsECal
src
Cluster.cxx
Generated on Fri Oct 3 2025 12:54:26 for Project by
1.9.8