-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCross_correlation.h
executable file
·46 lines (36 loc) · 1.17 KB
/
Cross_correlation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <algorithm> // copy
#include <atomic>
#include <iomanip>
#include <iostream>
#include <mutex>
#include <string>
#include <vector>
// Root
#include "TApplication.h"
#include "TF1.h"
#include "TGraph.h"
#include "TH1D.h"
#include "TSpline.h"
#include "variables.h"
class CrossCorrel
{
public:
CrossCorrel() = delete;
CrossCorrel(VarManager *v, ResCont **ResV) : V(v), ResVec(ResV){};
void Process(unsigned int thread_id, std::atomic<int> *thread_task, std::mutex &mtx_task, std::mutex &mtx_fit);
private:
int current_task;
double norm;
double dp;
int retval;
std::vector<double> dp_vec;
VarManager *V;
ResCont **ResVec;
void ROIAnalysis(const int ROI, const int time, std::mutex &mtx_fit);
int Normalize(std::vector<double> &v);
double DotProduct(std::vector<double> &v1, std::vector<double> &v2);
void SaveToContainer(const int time, const int ROI, std::mutex &mtx_fit);
std::vector<double> GetDataVec(const int ROI, const int time);
void FitControlGaussian(double &rchi2, double &sigma, double &mu);
void GetShift(double &shift, double &dp, std::mutex &mtx_fit);
};