Skip to content
Snippets Groups Projects
Commit 4385d584 authored by Theodore Efremov's avatar Theodore Efremov :hibiscus:
Browse files

Creation of link function between peaks

parent 8a2d754c
No related branches found
No related tags found
1 merge request!27Draft: [Epic] Preparation of the environement for the new GaseousDetectorScorers...
Pipeline #376882 passed
...@@ -65,13 +65,13 @@ void PeakFinder(vector<TSpectrum*> *sPeak , vector<int> *vPeak, TH2F *h, vector< ...@@ -65,13 +65,13 @@ void PeakFinder(vector<TSpectrum*> *sPeak , vector<int> *vPeak, TH2F *h, vector<
for(int peaks = 0 ; peaks < nPeaks ; peaks++){ for(int peaks = 0 ; peaks < nPeaks ; peaks++){
vector<Double_t> Position(2); vector<Double_t> Position(2);
Position.at(0) = (double(i) - double(step)/2.0) * h->GetXaxis()->GetBinWidth(4) ; //Retrieve E position Position.at(0) = (double(i) - double(step)/2.0) * h->GetXaxis()->GetBinWidth(4) ; //Retrieve E position
Position.at(1) = *PeakFinder->GetPositionX(); Position.at(1) = PeakFinder->GetPositionX()[peaks];
LinePos->push_back(Position); LinePos->push_back(Position);
} }
//Test //Test
if (true && iter ==58){ if (true && iter ==90){
// Draw the histogram // Draw the histogram
TCanvas* c = new TCanvas(Form("c%d",i), Form("Histogram with Peaks%d",i), 800, 600); TCanvas* c = new TCanvas(Form("c%d",i), Form("Histogram with Peaks%d",i), 800, 600);
projY->Draw(); projY->Draw();
...@@ -88,7 +88,7 @@ vector<vector<vector<Double_t>>> PeakLinker(vector<vector<Double_t>> *LinePos){ ...@@ -88,7 +88,7 @@ vector<vector<vector<Double_t>>> PeakLinker(vector<vector<Double_t>> *LinePos){
//Retrieve position of peaks //Retrieve position of peaks
for (int ipeak; ipeak<LinePos->size() ; ipeak ++){ for (int ipeak; ipeak<LinePos->size() ; ipeak ++){
X.push_back(LinePos->at(ipeak).at(0)); X.push_back(LinePos->at(ipeak).at(0));
Y.push_back(LinePos->at(ipeak).at(1)); Y.push_back(LinePos->at(ipeak).at(1));
} }
// Start from the lowest position in Y // Start from the lowest position in Y
...@@ -104,7 +104,31 @@ vector<vector<vector<Double_t>>> PeakLinker(vector<vector<Double_t>> *LinePos){ ...@@ -104,7 +104,31 @@ vector<vector<vector<Double_t>>> PeakLinker(vector<vector<Double_t>> *LinePos){
//To do so we will get the peaks from the same X and get their distance in Y //To do so we will get the peaks from the same X and get their distance in Y
//This will be our threshold //This will be our threshold
} //Create a sub set of data with only same X
vector<Double_t> YSub;
for (int index= 0 ; index < Y.size() ; index ++){
if (X.at(index) == X.at(indexMin)){
YSub.push_back(Y.at(index));
}
}
for (int index=0 ; index < YSub.size(); index++){
cout << " Ysub " << YSub.at(index) << endl;
}
//Sort the vec
sort(YSub.begin(),YSub.end());
Double_t Threshold = YSub.at(10) - YSub.at(9) ;
//cout << YSub.at(0) << " " << Y.at(indexMin) << endl; //it works
for (int Point ; Point < Y.size() ; Point ++){
// We will start with the first point
// We need to store all point that are linked together
}
} //end min Y
return Res; return Res;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment