9 double min = binEdges.at(0);
10 for (
unsigned i = 1; i < binEdges.size(); i++){
12 double val = binEdges.at(i);
14 ERROR_LOG <<
"CyclicPhaseBins::CyclicPhaseBins The bin edges MUST increase" << std::endl;
16 if ( val > min + TMath::Pi()*2.0 ){
17 ERROR_LOG <<
"CyclicPhaseBins::CyclicPhaseBins This bin edge is more than 2pi bigger than the smallest bin edge!" << std::endl;
30 bool tooSmall = (phase - min) < 0.0;
31 bool tooBig = (phase - min) > TMath::Pi()*2.0;
33 while (tooSmall || tooBig){
35 phase += 2.0*TMath::Pi();
36 tooSmall = (phase - min) < 0.0;
39 phase -= 2.0*TMath::Pi();
40 tooBig = (phase - min) > TMath::Pi()*2.0;
44 for (
unsigned i = 1; i <
_binEdges.size(); i++){
45 if (phase <
_binEdges.at(i))
return i - 1;
54 std::vector<double> binEdges;
56 for (
int i = 0; i < 2*nBinPairs; i++){
57 binEdges.push_back( - TMath::Pi() + (TMath::Pi()/
double(nBinPairs))*i );
75 double highEdge = 0.0;
78 highEdge =
_binEdges.at(0) + TMath::Pi()*2.0;
93 while (phase < lowEdge){
94 lowEdge -= TMath::Pi()*2.0;
97 while (phase > lowEdge + TMath::Pi()*2.0){
98 lowEdge += TMath::Pi()*2.0;
110 while (phase > highEdge){
111 highEdge += TMath::Pi()*2.0;
114 while (phase < highEdge - TMath::Pi()*2.0){
115 highEdge -= TMath::Pi()*2.0;
void setBinEdges(std::vector< double > binEdges)
double getHighBinBoundary(int bin) const
double getLowBinBoundary(int bin) const
int getBinNumber(double phase) const
std::vector< double > _binEdges
void setUniformCiSiBins(int nBinPairs)