Since all analysis files now use the same range finding functions, moved them to jungfrauCommonFunctions.
This commit is contained in:
@ -11,54 +11,6 @@
|
||||
#include "TPaveStats.h"
|
||||
#include "TLegend.h"
|
||||
|
||||
double highestPointBeforeSwitching(const vector<double> &lower_filter, const vector<double> &higher_filter) {
|
||||
|
||||
double highest_point_before_switching;
|
||||
|
||||
if (higher_filter.size() > 0) {
|
||||
// find the highest value in lower_filter that is lower than all entries in higher_filter
|
||||
highest_point_before_switching = *min_element(lower_filter.begin(),lower_filter.end())-1;
|
||||
|
||||
double lowest_entry_in_higher_filter = *min_element(higher_filter.begin(),higher_filter.end());
|
||||
for(vector<double>::const_iterator it = lower_filter.begin(); it != lower_filter.end(); ++it) {
|
||||
if (*it < lowest_entry_in_higher_filter) {
|
||||
if (*it > highest_point_before_switching) {
|
||||
highest_point_before_switching = *it;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
highest_point_before_switching = *max_element(lower_filter.begin(),lower_filter.end());
|
||||
}
|
||||
|
||||
return highest_point_before_switching;
|
||||
|
||||
}
|
||||
|
||||
double lowestPointAfterSwitching(const vector<double> &higher_filter, const vector<double> &lower_filter) {
|
||||
|
||||
double lowest_point_after_switching;
|
||||
|
||||
if (lower_filter.size() > 0) {
|
||||
// find the lowest value in higher_filter that is higher than all entries in lower_filter
|
||||
lowest_point_after_switching = *max_element(higher_filter.begin(),higher_filter.end())+1;
|
||||
|
||||
double highest_entry_in_lower_filter = *max_element(lower_filter.begin(),lower_filter.end());
|
||||
for(vector<double>::const_iterator it = higher_filter.begin(); it != higher_filter.end(); ++it) {
|
||||
if (*it > highest_entry_in_lower_filter) {
|
||||
if (*it < lowest_point_after_switching) {
|
||||
lowest_point_after_switching = *it;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
lowest_point_after_switching = *min_element(higher_filter.begin(),higher_filter.end());
|
||||
}
|
||||
|
||||
return lowest_point_after_switching;
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
jungfrauStyle();
|
||||
gROOT->SetBatch(1);
|
||||
|
Reference in New Issue
Block a user