KaliVeda
Toolkit for HIC analysis
KVDataQualityAudit.h
1 #ifndef __KVDATAQUALITYAUDIT_H
2 #define __KVDATAQUALITYAUDIT_H
3 
4 #include "KVBase.h"
5 
6 #include <KVNumberList.h>
7 #include <KVReconstructedNucleus.h>
8 #include <KVUniqueNameList.h>
9 
40 class KVDataQualityAudit : public KVBase {
41 private:
43 
45 
46 public:
48  KVDataQualityAudit(const Char_t* name, const Char_t* title = "")
49  : KVBase(name, title)
50  {
52  }
53  virtual ~KVDataQualityAudit() {}
54  void Add(const KVReconstructedNucleus& N);
55  void Print(Option_t* opt = "") const;
57  {
58  return &telescopes;
59  }
60  Bool_t HasTelescope(const TString& tel_name) const
61  {
62  return telescopes.FindObject(tel_name) != nullptr;
63  }
65 
66  struct isotope {
69  Float_t emin{-1.0};
70  UShort_t A{0};
71  void add(const KVReconstructedNucleus& N);
72  void print() const;
73  void merge(const isotope& isoto)
74  {
77  if (emin > 0) {
78  if (isoto.emin > 0) emin = std::min(emin, isoto.emin);
79  }
80  else if (isoto.emin > 0) emin = isoto.emin;
81  counts += isoto.counts;
82  }
83 
84  ClassDef(isotope, 1)
85  };
86  struct element {
89  Float_t emin{-1.0};
90  UShort_t A{0};// default (calculated) mass given when no isotopic identification available
91  UChar_t Z{0};
92  std::map<int, isotope> isotopes;
93  void add(const KVReconstructedNucleus& N);
94  void print() const;
95  void merge(const element&);
97  {
98  return !isotopes.empty();
99  }
100  Bool_t HasIsotope(int A) const
101  {
102  return isotopes.find(A) != std::end(isotopes);
103  }
104  const isotope& GetIsotope(int A) const
105  {
106  return isotopes.at(A);
107  }
109  {
111  KVNumberList l;
112  for (auto& p : isotopes) l.Add(p.first);
113  return l;
114  }
115  double get_mean_isotopic_mass() const;
116  int get_max_isotopic_mass() const;
117  std::map<int, double> get_isotopic_distribution() const;
118  int get_min_isotopic_mass() const;
120  int get_default_mass() const
121  {
122  return A;
123  }
124 
125  ClassDef(element, 1)
126  };
127  class idtelescope : public TNamed {
128  std::map<int, element> elements;
129  public:
130  idtelescope(const TString& name = "") : TNamed(name, name) {}
131  virtual ~idtelescope() {}
132  ROOT_COPY_CTOR(idtelescope, TNamed)
133  ROOT_COPY_ASSIGN_OP(idtelescope)
134  void Copy(TObject& o) const
135  {
137  TNamed::Copy(o);
138  idtelescope& other = (idtelescope&)o;
139  other.elements = elements;
140  }
141  void add(const KVReconstructedNucleus& N);
142  void Print(Option_t* opt = "") const;
143  void merge(const idtelescope*);
144  Bool_t HasElement(int Z) const
145  {
146  return elements.find(Z) != std::end(elements);
147  }
148  const element& GetElement(int Z) const
149  {
150  return elements.at(Z);
151  }
153  {
155 
156  KVNumberList l;
157  for (auto& p : elements) l.Add(p.first);
158  return l;
159  }
160  std::map<int, double> get_element_distribution() const;
161  double get_mean_Z() const;
162  int get_max_Z() const;
163  double get_mean_A() const;
164  int get_max_A() const;
165  int get_min_A() const;
166  int get_min_Z() const;
167  int get_max_Z_with_isotopes() const;
168 
170  };
171 
172  Bool_t HasTelescope(const idtelescope* idt) const
173  {
174  return HasTelescope(idt->GetName());
175  }
176  idtelescope* GetTelescope(const TString& tel_name) const
177  {
178  return (idtelescope*)telescopes.FindObject(tel_name);
179  }
181  {
182  return GetTelescope(idt->GetName());
183  }
184 
185 private:
186  void add(const idtelescope*);
187 
188  ClassDef(KVDataQualityAudit, 1) //Audit of experimental data identification and calibrations
189 };
190 
191 #endif
bool Bool_t
unsigned short UShort_t
unsigned char UChar_t
char Char_t
float Float_t
double Double_t
const char Option_t
#define ClassDef(name, id)
winID h TVirtualViewer3D TVirtualGLPainter p
char name[80]
Base class for KaliVeda framework.
Definition: KVBase.h:142
void add(const KVReconstructedNucleus &N)
void Print(Option_t *opt="") const
std::map< int, element > elements
void merge(const idtelescope *)
const element & GetElement(int Z) const
std::map< int, double > get_element_distribution() const
idtelescope(const TString &name="")
Audit of experimental data identification and calibrations.
Long64_t merge(KVDataQualityAudit *)
void Print(Option_t *opt="") const
Long64_t Merge(TCollection *)
Bool_t HasTelescope(const TString &tel_name) const
KVDataQualityAudit(const Char_t *name, const Char_t *title="")
idtelescope * GetTelescope(const TString &tel_name) const
KVUniqueNameList telescopes
const KVSeqCollection * GetTelescopeList() const
Bool_t HasTelescope(const idtelescope *idt) const
void Add(const KVReconstructedNucleus &N)
Add this reconstructed nucleus to the audit.
void add(const idtelescope *)
Add copy of idtelescope data to this audit.
idtelescope * GetTelescope(const idtelescope *idt) const
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:85
Nuclei reconstructed from data measured by a detector array .
KaliVeda extensions to ROOT collection classes.
virtual void SetOwner(Bool_t enable=kTRUE)
virtual TObject * FindObject(const char *name) const
Optimised list in which named objects can only be placed once.
void Copy(TObject &named) const override
const char * GetName() const override
long long Long64_t
double get_mean_isotopic_mass() const
calculate and return mean mass of isotopes measured for this element
KVNumberList GetIsotopeList() const
const isotope & GetIsotope(int A) const
double get_minimum_isotopic_threshold_mev_per_nuc() const
std::map< int, double > get_isotopic_distribution() const
std::map< int, isotope > isotopes
Double_t counts
watch the alignment !
Bool_t HasIsotope(int A) const
int get_min_isotopic_mass() const
return min A of isotopes measured for this element
void add(const KVReconstructedNucleus &N)
int get_max_isotopic_mass() const
return max A of isotopes measured for this element
void add(const KVReconstructedNucleus &N)
Double_t counts
watch the alignment !
void merge(const isotope &isoto)
TLine l