diff --git a/convertRawToAnalyzed/analyse.cpp b/convertRawToAnalyzed/analyse.cpp index 35e99dfbb29380a8f5a5b3bf3a10fb155bc40f6f..1462b8e038a52b20732e35ad5f6aea33afba3981 100644 --- a/convertRawToAnalyzed/analyse.cpp +++ b/convertRawToAnalyzed/analyse.cpp @@ -15,8 +15,8 @@ int main(int argc, char* argv[]) //to be extracted from the source as parameters const Int_t noBranches = 4; - const Double_t cfRatio = 0.7; - const Double_t cfTD = 3; + const Double_t cfRatio = 0.2; + const Double_t cfTD = 0.6; //in ns Double_t noiseMin = 5; Double_t noiseMax = 25; @@ -86,7 +86,7 @@ int main(int argc, char* argv[]) for(Long64_t i = 0; i < nentries; i++) { tr->GetEntry(i); - + //cout<<" i "<Reset(); wevent[j]->ProcessEvent(); //here all the analysis is going on so far diff --git a/dataClasses/AEvent.cpp b/dataClasses/AEvent.cpp index 54e7aec6406a2908661c0d6b44a17cf9fd42baa8..79601b861a07cee908e7277ff2b52e55983cf502 100644 --- a/dataClasses/AEvent.cpp +++ b/dataClasses/AEvent.cpp @@ -134,15 +134,44 @@ void AEvent::SetCFD() { // Double_t level = 100.; //is necessary to find cfd amplitude value closest to zero Double_t time = 0; + Double_t mytime = fCFtimeDelay; fGraphCFD->Set(fNPoints); //working variables Double_t maxCFD = 0., minCFD = 0.; Double_t TmaxCFD = 0., TminCFD = 0.; -// Int_t imax = 0, imin = 0; - const Double_t timeStep = 0.05; + Double_t ampCFD; + const Double_t timeStep = 0.1; + Int_t i = 0; - for (Int_t i=0; iEval(mytime)*fCFratio*(-1); + //cout<<"jncfe "<Eval(mytime)*fCFratio*(-1)<Eval(mytime)*fCFratio*(-1) + fGraphSignal->Eval(mytime - 0.6) + ampCFD = fGraphSignal->Eval(mytime)*fCFratio*(-1) + fGraphSignal->Eval(mytime - fCFtimeDelay); + fGraphCFD->SetPoint(i, mytime, ampCFD); + + //point for max CFD amplitude + if( ampCFD > maxCFD) { + maxCFD = ampCFD; + TmaxCFD = mytime; + } + + //point for min CFD amplitude + if( ampCFD < minCFD) { + minCFD = ampCFD; + TminCFD = mytime; + } + + i++; + mytime = mytime + timeStep; + } +// + +/* for (Int_t i=0; ifCFtimeDelay) { // условие, чтобы не выскочить из размера массива ( обрезает границы на fCFtimeDelay) @@ -165,7 +194,7 @@ void AEvent::SetCFD() { // imin = i; } - } + }*/ /* //finding "zero" of CFD amplitude for(Int_t j = imin; j < imax; j++) { @@ -177,7 +206,7 @@ void AEvent::SetCFD() { */ //I want to find zero of CFD using graph and eval time = TminCFD; - while( (fGraphCFD->Eval(time) <= 0) && (time <= TmaxCFD) && (time >= TminCFD) ) { + while( (fGraphCFD->Eval(time) <= 0) && (time <= TmaxCFD) /*&& (time >= TminCFD)*/ ) { fTimeCFD = time; time = time + timeStep; } diff --git a/macros/histCorr.C b/macros/histCorr.C index 88cf54decaf8007a474031058f3a2a898b6eacc1..ff9c4b9a45f697f32a1125a3a703b5e052496b25 100644 --- a/macros/histCorr.C +++ b/macros/histCorr.C @@ -7,7 +7,7 @@ void histCorr( const char *foldername = "8_2", // const char *ext = ".eps", const char *ext = ".gif", - const Bool_t can1 = 1, const Bool_t can2 = 1, const Bool_t can3 = 1, const Bool_t can4 = 0, const Bool_t can5 = 0) + const Bool_t can1 = 1, const Bool_t can2 = 1, const Bool_t can3 = 1, const Bool_t can4 = 1, const Bool_t can5 = 1) { gSystem->Load("../libData.so"); TFile *f = new TFile(Form("../data/dataDSR4/%s", filename)); @@ -25,7 +25,7 @@ void histCorr( TH2F *h4 = new TH2F("h4", "Time difference between two channels vs amplitude of the second channel",125, -100., 100., 125, 0., 0.5); c1->cd(1); - t->Draw("Ach0.fChargeCFD : ( Ach0.fTimeCFD - Ach1.fTimeCFD ) >> h1","","col"); + t->Draw("Ach0.fChargeCFD : ( Ach0.fTimeCFD - Ach1.fTimeCFD ) >> h1","Ach0.fChargeCFD > 0.2e-9","col"); //x h1->GetXaxis()->SetTitle("\\Delta \\tau_{0-1} [ns]"); h1->GetXaxis()->CenterTitle(); @@ -164,7 +164,7 @@ void histCorr( h11->GetYaxis()->SetTitle("fEdgeXi"); h11->GetYaxis()->CenterTitle(); c4->Update(); - c4->Print(Form("../macros/picsDRS4/file%s/XiSquares%s", foldername, ext)); + //c4->Print(Form("../macros/picsDRS4/file%s/XiSquares%s", foldername, ext)); } @@ -184,7 +184,7 @@ void histCorr( gStyle->SetOptFit(); c5->Update(); - c5->Print(Form("../macros/picsDRS4/file%s/TimeDiffCFD_0.7_3%s", foldername, ext)); + //c5->Print(Form("../macros/picsDRS4/file%s/TimeDiffCFD_0.7_3%s", foldername, ext)); } diff --git a/macros/testShowCFD.cxx b/macros/testShowCFD.cxx index e47693d149ada380fb4745370485b3a2bc320ee5..281bc5ea360369745717752ca2c1aedbf221c609 100644 --- a/macros/testShowCFD.cxx +++ b/macros/testShowCFD.cxx @@ -5,16 +5,16 @@ void testShowCFD() const Long64_t kFirstEvent = 128; - TFile fr("../data/dataDSR4/analysis_08_2_CFD07_3.root"); + TFile fr("../data/dataDSR4/analysis_08_2_CFD02_06.root"); TTree *tr = (TTree*)fr.Get("atree"); AEvent *revent = new AEvent(); tr->SetBranchAddress("Ach0.",&revent); - TGraph *gr[10]; + TGraph *gr[12]; //loop over events - for (Int_t i = 0; i < 10; i++) { + for (Int_t i = 0; i < 12; i++) { gr[i] = 0; tr->GetEntry(i+kFirstEvent); gr[i] = new TGraph(*revent->GetGraphCFD()); @@ -22,9 +22,9 @@ void testShowCFD() TCanvas *c1 = new TCanvas("c1","CFD implementation",10,10,1000,600); - c1->Divide(3,2); + c1->Divide(3,4); - for (Int_t i = 0; i < 6; i++) { + for (Int_t i = 0; i < 12; i++) { c1->cd(i+1); gr[i]->Draw(""); } diff --git a/macros/testShowGraphs.cxx b/macros/testShowGraphs.cxx index 5b7d0947d97ae7b7730a37b1724a38d0f494396b..acfebc5c9fdc6c3417873165b30b00b4d25b6eec 100644 --- a/macros/testShowGraphs.cxx +++ b/macros/testShowGraphs.cxx @@ -3,7 +3,7 @@ void testShowGraphs() gSystem->Load("../libData.so"); - const Long64_t kFirstEvent = 50; + const Long64_t kFirstEvent = 128; TFile fr("../data/dataDSR4/analysis_08_2.root"); // TFile fr("../data/dataDSR4/analysis_07_8.root"); @@ -14,16 +14,16 @@ void testShowGraphs() AEvent *revent = new AEvent(); cout << tr->SetBranchAddress("Ach0.",&revent) << endl; - TGraph *gr[10]; - Double_t t10[10]; - Double_t t90[10]; + TGraph *gr[13]; + Double_t t10[13]; + Double_t t90[13]; // cout << "warning" << endl; cout << tr->GetEntries() << endl; //loop over events - for (Long64_t i = 0; i < 10; i++) { + for (Long64_t i = 0; i < 13; i++) { gr[i] = 0; t10[i] = 0; t90[i] = 0; @@ -45,12 +45,12 @@ void testShowGraphs() // cout << "warning 3" << endl; TCanvas *c1 = new TCanvas("c1","test",10,10,1000,600); - c1->Divide(3,2); + c1->Divide(3,4); TF1 *f1 = new TF1("f1name", "[0]+x*[1]"); // TF1 *f1 = new TF1("pol1", ); - for (Int_t k = 0; k < 6; k++) { + for (Int_t k = 0; k < 12; k++) { c1->cd(k+1); gr[k]->Draw("AL*");