Project
Loading...
Searching...
No Matches
MCLabel.h
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
12// Declaration of a transient MC label class for PHOS
13
14#ifndef ALICEO2_PHOS_MCLABEL_H_
15#define ALICEO2_PHOS_MCLABEL_H_
16
18
19namespace o2
20{
21namespace phos
22{
24{
25 private:
26 float mEdep = 0; // deposited energy
27
28 public:
29 MCLabel() = default;
30 MCLabel(Int_t trackID, Int_t eventID, Int_t srcID, bool fake, float edep) : o2::MCCompLabel(trackID, eventID, srcID, fake), mEdep(edep) {}
31
35 bool operator==(const MCLabel& other) const { return compare(other) >= 0; }
36
37 MCLabel& operator=(const MCLabel& other) = default;
38
39 // /// \brief Add deposited energy of a thack, do not check if track the same
40 // /// \param another PHOS MCLabel
41 void add(const MCLabel& other, float scale) { mEdep += other.mEdep * scale; }
42
43 void scale(float s) { mEdep *= s; }
44
45 float getEdep() const { return mEdep; }
46
47 double getAmplitudeFraction() const { return mEdep; }
48
50};
51} // namespace phos
52} // namespace o2
53
54#endif
int compare(const MCCompLabel &other) const
Definition MCCompLabel.h:85
ClassDefNV(MCLabel, 2)
void add(const MCLabel &other, float scale)
Definition MCLabel.h:41
MCLabel(Int_t trackID, Int_t eventID, Int_t srcID, bool fake, float edep)
Definition MCLabel.h:30
double getAmplitudeFraction() const
Definition MCLabel.h:47
float getEdep() const
Definition MCLabel.h:45
bool operator==(const MCLabel &other) const
Comparison oparator, based on track, event and src Id.
Definition MCLabel.h:35
MCLabel & operator=(const MCLabel &other)=default
void scale(float s)
Definition MCLabel.h:43
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
VectorOfTObjectPtrs other