1#ifndef TGRIFFINANGLES_H
2#define TGRIFFINANGLES_H
23#include "TCollection.h"
25#include "TGraphErrors.h"
31 explicit TGriffinAngles(
double distance = 145.,
bool folding =
false,
bool grouping =
false,
bool addback =
true);
43 int Index(
double angle);
48 std::advance(it, index);
59 void FoldOrGroup(TGraphErrors* z0, TGraphErrors* z2, TGraphErrors* z4,
bool verbose =
false)
const;
60 std::set<double>::iterator
begin()
const {
return fAngles.begin(); }
61 std::set<double>::iterator
end()
const {
return fAngles.end(); }
66 void Print(Option_t* =
"")
const override;
68 Long64_t
Merge(TCollection* list)
70 for(
auto* griffinAngles : *list) {
Add(
static_cast<TGriffinAngles*
>(griffinAngles)); }
void Add(TGriffinAngles *griffinAngles)
std::set< double > fAngles
set of unique angles, when grouping is used, the largest angle of the group is used!
static void Rounding(const double &val)
TGriffinAngles(TGriffinAngles &&) noexcept=default
Long64_t Merge(TCollection *list)
static double fRounding
we consider any angles whose difference is less than this to be equal
void FoldOrGroup(TGraphErrors *z0, TGraphErrors *z2, TGraphErrors *z4, bool verbose=false) const
bool ExcludeDetector(int detector) const
bool fGrouping
flag indicating whether we group close angles together
std::set< double >::iterator end() const
std::vector< int > fCustomGrouping
list of custom groups
void Print(Option_t *="") const override
double fDistance
distance of detector from center of array in mmm
bool fFolding
flag indicating whether we fold our distribution around 90 degree
bool fAddback
flag indicating whether we use addback
int NumberOfAngles() const
TGriffinAngles(double distance=145., bool folding=false, bool grouping=false, bool addback=true)
TGriffinAngles(const TGriffinAngles &)=default
double Angle(int index) const
static void Verbosity(const EVerbosity &val)
std::map< int, int > fAngleCount
Maps angles (divided by rounding and cast to integers) to number of combinations contributing to it.
static EVerbosity Verbosity()
std::vector< int > fExcludedDetectors
list of detectors that are excluded in calculating the angles
std::map< double, int > fAngleMap
Maps angles to indices. This is fairly straight forward without grouping, but if grouping is used mul...
static EVerbosity fVerbosity
verbosity level
std::vector< int > fExcludedCrystals
list of crystals that are excluded in calculating the angles, the crystals are numbered as 4*(det-1)+...
std::set< double >::iterator begin() const
bool ExcludeCrystal(int detector, int crystal) const
double AverageAngle(int index) const