1#include "KVDataQualityAudit.h"
14 tel =
new idtelescope(
N.GetIdentifyingTelescope()->GetName());
49 while ((o = next())) {
105 if (
N.IsCalibrated() && ((
emin < 0) || (
N.GetEnergy() <
emin)))
emin =
N.GetEnergy();
114 std::cout <<
"\t\tA=" << A <<
"\t\t[E>" << emin <<
"]" << std::endl;
133 if (
N.GetZ() > 0) Z =
N.GetZ();
135 if (
N.IsCalibrated() && ((emin < 0) || (
N.GetEnergy() < emin))) emin =
N.GetEnergy();
136 if (
N.IsAMeasured()) {
137 isotopes[
N.GetA()].add(
N);
139 else if (
N.GetA() > 0) A =
N.GetA();
148 std::cout <<
"\tZ=" << (int)Z <<
"\t\t[E>" << emin <<
"]";
149 if (A > 0) std::cout <<
" default A=" << A;
150 if (!HasIsotopes()) {
151 std::cout << std::endl;
154 std::cout <<
"\t\tIsotopes: " << GetIsotopeList().AsString() << std::endl;
155 for (
auto i : isotopes) i.second.print();
178 if (elem.
emin > 0) emin = std::min(emin, elem.
emin);
180 else if (elem.
emin > 0) emin = elem.
emin;
181 A = std::max(A, elem.
A);
186 [&](
const std::pair<int, isotope>& isotop) {
187 if (HasIsotope(isotop.first)) {
188 isotopes[isotop.first].merge(isotop.second);
191 isotopes[isotop.first] = isotop.second;
206 if (isotopes.empty())
return 0;
207 double sum{0}, weight{0};
208 std::for_each(std::begin(isotopes), std::end(isotopes),
209 [&](
const std::pair<int, isotope>& count) {
210 sum += count.second.counts;
211 weight += count.first * count.second.counts;
214 if (
sum > 0)
return weight /
sum;
227 if (isotopes.empty())
return 0;
228 auto last = isotopes.rbegin();
229 return (*last).first;
241 if (isotopes.empty())
return 0;
242 auto first = isotopes.begin();
243 return (*first).first;
254 if (isotopes.empty())
return -1;
256 for (
auto&
p : isotopes) {
257 double myE =
p.second.emin /
p.first;
258 if ((myE > 0) && (myE < minE)) minE = myE;
260 if (minE < 9999)
return minE;
275 std::for_each(std::begin(isotopes), std::end(isotopes),
276 [&](
const std::pair<int, isotope>& count) {
277 sum += count.second.counts;
280 std::map<int, double> proba;
281 for (
auto&
p : isotopes) {
282 proba[
p.first] =
p.second.counts /
sum;
293 elements[
N.GetZ()].add(
N);
302 std::cout <<
GetName() <<
" :" << std::endl;
303 std::cout <<
"Elements: " << GetElementList().AsString() << std::endl;
304 for (
auto e : elements)
e.second.print();
321 [&](
const std::pair<int, element>& elem) {
322 if (HasElement(elem.first)) {
323 elements[elem.first].merge(elem.second);
326 elements[elem.first] = elem.second;
342 std::for_each(std::begin(elements), std::end(elements),
343 [&](
const std::pair<int, element>& count) {
344 sum += count.second.counts;
347 std::map<int, double> proba;
348 for (
auto&
p : elements) {
349 proba[
p.first] =
p.second.counts /
sum;
362 double sum{0}, weight{0};
363 std::for_each(std::begin(elements), std::end(elements),
364 [&](
const std::pair<int, element>& count) {
365 sum += count.second.counts;
366 weight += count.second.counts * count.first;
380 auto last = elements.rbegin();
381 return (*last).first;
391 auto it = elements.rbegin();
392 while (it != elements.rend()) {
393 if ((*it).second.HasIsotopes())
return (*it).first;
406 auto first = elements.begin();
407 return (*first).first;
418 double sum{0}, weight{0};
419 std::for_each(std::begin(elements), std::end(elements),
420 [&](
const std::pair<int, element>& count) {
421 sum += count.second.counts;
422 weight += count.second.counts * count.second.get_mean_isotopic_mass();
437 for (
auto&
e : elements) {
438 max = std::max(
max,
e.second.get_max_isotopic_mass());
452 for (
auto&
e : elements) {
453 if (
auto other_A =
e.second.get_min_isotopic_mass())
454 min = std::min(
min, other_A);
winID h TVirtualViewer3D TVirtualGLPainter p
void add(const KVReconstructedNucleus &N)
void Print(Option_t *opt="") const
std::map< int, element > elements
void merge(const idtelescope *)
double get_mean_A() const
int get_max_Z_with_isotopes() const
std::map< int, double > get_element_distribution() const
double get_mean_Z() const
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
KVUniqueNameList telescopes
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 TString &tel_name) const
Nuclei reconstructed from data measured by a detector array .
T * get_object(const TString &name) const
virtual void Add(TObject *obj)
const char * GetName() const override
virtual void Print(Option_t *option="") const
double min(double x, double y)
double max(double x, double y)
void merge(const element &)
double get_mean_isotopic_mass() const
calculate and return mean mass of isotopes measured for this element
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 !