Project
Loading...
Searching...
No Matches
AnalysisCluster.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
13
14#include <fairlogger/Logger.h>
15#include <gsl/span>
16#include <array>
17#include <TLorentzVector.h>
19
20using namespace o2::emcal;
21
22//_______________________________________________________________________
24{
25 //if(mTracksMatched) delete mTracksMatched;
26 //mTracksMatched = 0;
27 mCellsAmpFraction.clear();
28 mCellsIndices.clear();
29}
30
31//_______________________________________________________________________
32TLorentzVector AnalysisCluster::getMomentum(std::array<const float, 3> vertex) const
33{
34
35 TLorentzVector p;
36
37 float pos[3] = {mGlobalPos.X(), mGlobalPos.Y(), mGlobalPos.Z()};
38 pos[0] -= vertex[0];
39 pos[1] -= vertex[1];
40 pos[2] -= vertex[2];
41
42 float r = TMath::Sqrt(pos[0] * pos[0] + pos[1] * pos[1] + pos[2] * pos[2]);
43
44 if (r > 0) {
45 p.SetPxPyPzE(mEnergy * pos[0] / r, mEnergy * pos[1] / r, mEnergy * pos[2] / r, mEnergy);
46 } else {
47 LOG(info) << "Null cluster radius, momentum calculation not possible";
48 }
49
50 return p;
51}
52
53//______________________________________________________________________________
55{
56 mGlobalPos.SetX(x.X());
57 mGlobalPos.SetY(x.Y());
58 mGlobalPos.SetZ(x.Z());
59}
60
61//______________________________________________________________________________
63{
64 mLocalPos.SetX(x.X());
65 mLocalPos.SetY(x.Y());
66 mLocalPos.SetZ(x.Z());
67}
uint64_t vertex
Definition RawEventData.h:9
uint16_t pos
Definition RawData.h:3
math_utils::Point3D< float > mGlobalPos
Position in global coordinate system (cm).
void setGlobalPosition(math_utils::Point3D< float > x)
Set the cluster global position.
float mEnergy
Energy measured by calorimeter in GeV.
math_utils::Point3D< float > mLocalPos
Local position in the sub-detector coordinate.
TLorentzVector getMomentum(std::array< const float, 3 > vertexPosition) const
std::vector< float > mCellsAmpFraction
std::vector< unsigned short > mCellsIndices
Array of cell indices contributing to this cluster.
void setLocalPosition(math_utils::Point3D< float > x)
GLint GLenum GLint x
Definition glcorearb.h:403
GLboolean r
Definition glcorearb.h:1233
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"