|
| 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 | + |
| 12 | +/// \file Cluster.h |
| 13 | +/// \brief Definition of ECal cluster class |
| 14 | +/// |
| 15 | +/// \author Evgeny Kryshen <evgeny.kryshen@cern.ch> |
| 16 | + |
| 17 | +#ifndef ALICEO2_ECAL_CLUSTER_H |
| 18 | +#define ALICEO2_ECAL_CLUSTER_H |
| 19 | +#include <map> |
| 20 | +#include <vector> |
| 21 | +#include <Rtypes.h> |
| 22 | +#include <TLorentzVector.h> |
| 23 | + |
| 24 | +namespace o2 |
| 25 | +{ |
| 26 | +namespace ecal |
| 27 | +{ |
| 28 | +class Cluster |
| 29 | +{ |
| 30 | + public: |
| 31 | + Cluster() = default; |
| 32 | + Cluster(const Cluster& clu) = default; |
| 33 | + ~Cluster() = default; |
| 34 | + |
| 35 | + // setters |
| 36 | + void addDigit(int digitIndex, int towerId, double energy); |
| 37 | + void setNLM(int nMax) { mNLM = nMax; } |
| 38 | + void setE(float energy) { mE = energy; } |
| 39 | + void setX(float x) { mX = x; } |
| 40 | + void setY(float y) { mY = y; } |
| 41 | + void setZ(float z) { mZ = z; } |
| 42 | + void setChi2(float chi2) { mChi2 = chi2; } |
| 43 | + void setEdgeFlag(bool isEdge) { mEdge = isEdge; } |
| 44 | + void addMcTrackID(int mcTrackID, float energy) { mMcTrackEnergy[mcTrackID] += energy; } |
| 45 | + |
| 46 | + // getters |
| 47 | + const std::map<int, float>& getMcTrackEnergy() { return mMcTrackEnergy; } |
| 48 | + int getMultiplicity() const { return mDigitIndex.size(); } |
| 49 | + int getDigitIndex(int i) const { return mDigitIndex[i]; } |
| 50 | + int getDigitTowerId(int i) const { return mDigitTowerId[i]; } |
| 51 | + float getDigitEnergy(int i) const { return mDigitEnergy[i]; } |
| 52 | + float getNLM() const { return mNLM; } |
| 53 | + float getTime() const { return mTime; } |
| 54 | + float getE() const { return mE; } |
| 55 | + float getX() const { return mX; } |
| 56 | + float getY() const { return mY; } |
| 57 | + float getZ() const { return mZ; } |
| 58 | + float getR() const { return std::sqrt(mX*mX + mY*mY); } |
| 59 | + float getTheta() const { return std::atan2(getR(), mZ); } |
| 60 | + float getEta() const { return -std::log(std::tan(getTheta()/2.)); } |
| 61 | + float getPhi() const { return std::atan2(mY, mX); } |
| 62 | + float getChi2() const { return mChi2; } |
| 63 | + bool isAtTheEdge() const { return mEdge; } |
| 64 | + int getMcTrackID() const; |
| 65 | + TLorentzVector getMomentum() const; |
| 66 | + |
| 67 | + private: |
| 68 | + std::vector<int> mDigitIndex; // vector of digit indices in digits vector |
| 69 | + std::vector<int> mDigitTowerId; // vector of corresponding digit tower Ids |
| 70 | + std::vector<float> mDigitEnergy; // vector of corresponding digit energies |
| 71 | + std::map<int, float> mMcTrackEnergy; // MC track indices and corresponding energies |
| 72 | + int mNLM = 0; // number of local maxima in the initial cluster |
| 73 | + float mTime = 0; // cluster time |
| 74 | + float mE = 0; // cluster energy |
| 75 | + float mX = 0; // estimated x-coordinate |
| 76 | + float mY = 0; // estimated y-ccordinate |
| 77 | + float mZ = 0; // estimated z-ccordinate |
| 78 | + float mChi2 = 0; // chi2 wrt EM shape |
| 79 | + bool mEdge = 0; // set to true if one of cluster digits is at the chamber edge |
| 80 | + ClassDefNV(Cluster, 1); |
| 81 | +}; |
| 82 | +} // namespace ecal |
| 83 | +} // namespace o2 |
| 84 | + |
| 85 | +#endif // ALICEO2_ECAL_CLUSTER_H |
0 commit comments