KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
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
40class KVDataQualityAudit : public KVBase {
41private:
43
45
46public:
48 KVDataQualityAudit(const Char_t* name, const Char_t* title = "")
49 : KVBase(name, title)
50 {
52 }
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 {
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
85 };
86 struct element {
90 UShort_t A{0};// default (calculated) mass given when no isotopic identification available
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 {
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;
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
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
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
185private:
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
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
const KVSeqCollection * GetTelescopeList() const
Long64_t Merge(TCollection *)
Bool_t HasTelescope(const TString &tel_name) const
idtelescope * GetTelescope(const idtelescope *idt) const
KVDataQualityAudit(const Char_t *name, const Char_t *title="")
KVUniqueNameList telescopes
Bool_t HasTelescope(const idtelescope *idt) const
void add(const idtelescope *)
Add copy of idtelescope data to this audit.
idtelescope * GetTelescope(const TString &tel_name) const
Strings used to represent a set of ranges of values.
Nuclei reconstructed from data measured by a detector array .
KaliVeda extensions to ROOT collection classes.
virtual TObject * FindObject(const char *name) const
virtual void SetOwner(Bool_t enable=kTRUE)
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
const isotope & GetIsotope(int A) const
KVNumberList GetIsotopeList() 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 !
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