KaliVeda
Toolkit for HIC analysis
KVZmax.h
1 #ifndef KVZmax_h
2 #define KVZmax_h
3 #include "KVUnownedList.h"
4 #include "KVVarGlob.h"
5 
35 class KVZmax: public KVVarGlob {
36 
38 
39  void init();
40 protected:
41  void fill(const KVNucleus* c) override
42  {
44  heaviest.Add(const_cast<KVNucleus*>(c));
45  }
46 
47  Double_t getvalue_int(Int_t i) const override
48  {
53 
54  if (!GetZmax(i))
55  return -1.0;
56  return (Double_t) GetZmax(i)->GetZ();
57  }
58 
59 public:
60  ROOT_FULL_SET_WITH_INIT(KVZmax, KVVarGlob)
61 
62  void Copy(TObject& obj) const override;
63  void Init() override
64  {
66  }
67  void Calculate() override
68  {
70  heaviest.Sort();
71  }
72  void Reset() override
73  {
75  heaviest.Clear();
76  }
78  {
80 
81  return (KVNucleus*) heaviest.At(i);
82  }
86  Int_t GetMult() const
87  {
88  return heaviest.GetEntries();
89  }
90 
91  std::vector<Double_t> GetValueVector(void) const override;
92 
93  ClassDefOverride(KVZmax, 1)//Rank fragments by charge and return Z or pointer of i_th heaviest fragment
94 };
95 #endif
int Int_t
#define c(i)
double Double_t
#define ClassDefOverride(name, id)
void Sort(Bool_t order=kSortAscending)
Definition: KVList.h:35
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:123
Int_t GetZ() const
Return the number of proton / atomic number.
Definition: KVNucleus.cpp:763
void Add(TObject *obj) override
void Clear(Option_t *option="") override
TObject * At(Int_t idx) const override
Extended TList class which does not own its objects by default.
Definition: KVUnownedList.h:17
Base class for all global variable implementations.
Definition: KVVarGlob.h:233
Global variable used to sort particles in order of decreasing atomic number
Definition: KVZmax.h:35
KVNucleus * GetZmax(Int_t i) const
Definition: KVZmax.h:77
void fill(const KVNucleus *c) override
Definition: KVZmax.h:41
KVUnownedList heaviest
sorted list of pointers to nuclei, sorted by decreasing Z
Definition: KVZmax.h:37
void Init() override
Definition: KVZmax.h:63
void Copy(TObject &obj) const override
Definition: KVZmax.cpp:22
Double_t getvalue_int(Int_t i) const override
Definition: KVZmax.h:47
std::vector< Double_t > GetValueVector(void) const override
Definition: KVZmax.cpp:36
void init()
set up list of indices
Definition: KVZmax.cpp:9
void Reset() override
Definition: KVZmax.h:72
void Calculate() override
Definition: KVZmax.h:67
Int_t GetMult() const
Definition: KVZmax.h:86
virtual Int_t GetEntries() const