diff --git a/dataClasses/AEvent.cpp b/dataClasses/AEvent.cpp index 71bf043bc278cf9a20e891657c2320989dceb2a9..2d97aa58938625f5ab45379335815384484af331 100644 --- a/dataClasses/AEvent.cpp +++ b/dataClasses/AEvent.cpp @@ -64,6 +64,7 @@ void AEvent::ProcessEvent() { SetGraphs(); FindFrontProperties(); + SetGraphs(); SetCFD(); SetChargeCFD(); @@ -80,6 +81,7 @@ void AEvent::Reset() { } fEdgeSlope=0.; + fEdgeSlope=-100.; fTime10=0.; fTime90=0.; fAmpMax = 0.; @@ -176,7 +178,7 @@ void AEvent::FindFrontProperties() { const Double_t maxHeight = 0.9; const Double_t timeStep = 0.05; //in ns - Double_t time = fTimeAmpMax; //in ns + Double_t time = 0; //in ns // Int_t NumM = 0.; if (!fGraphSignal) { @@ -186,26 +188,29 @@ void AEvent::FindFrontProperties() { //TODO search of minimum should be done from the lower edge on the time axis // cout << "Event!!!!!!!!!!!!!" << endl; - while( fGraphSignal->Eval(time) >= minHeight*fAmpMax && time>0) { +// while( fGraphSignal->Eval(time) >= minHeight*fAmpMax && time>0) { + while (fGraphSignal->Eval(time) <= maxHeight*fAmpMax && time<200.) { // cout << fAmpMax << "\t" << fGraphSignal->Eval(time) << "\t" << fTimeAmpMax << "\t" << time << endl; - fTime10 = time; - time = time - timeStep; - } -// cout << "Found time10 " << fTime10 << endl; - - time = fTimeAmpMax; - while( fGraphSignal->Eval(time) >= maxHeight*fAmpMax && time>0) { fTime90 = time; + time = time + timeStep; + }; + + time = fTime90; + while( fGraphSignal->Eval(time) >= minHeight*fAmpMax && time>0) { + fTime10 = time; time = time - timeStep; } -// cout << "Found time90 " << fTime90 << endl; +// cout << "Found time10 " << fTime10 << "\t" << fGraphSignal->Eval(fTime10) << "\t" << minHeight*fAmpMax << "\t" << fAmpMax << endl; +// cout << "Found time10 " << fTime10 << "\t" << TMath::Abs(fGraphSignal->Eval(fTime10) - minHeight*fAmpMax) / fAmpMax * 100 << endl; +// cout << "Found time90 " << fTime90 << "\t" << GetT_90() << endl; // cout<< "Time90 - time10 "<< fTime90 - fTime10 << endl; // if(fTime90 - fTime10 == 0.25 ) { cout<< "Zero !!"<SetRange(fTime10,fTime90); - fGraphSignal->Fit(fit1,"RQ","goff"); +// fGraphSignal->Fit(fit1,"RQ","goff"); + fGraphSignal->Fit(fit1,"RQN","goff"); fEdgeSlope = fit1->GetParameter(1); delete fit1; diff --git a/macros/histCorr.C b/macros/histCorr.C index 6c66d3306338cb00d395a5e88bc6eef852cca48f..27fd1e8455738f3b0db237ee84c141406d83ef01 100644 --- a/macros/histCorr.C +++ b/macros/histCorr.C @@ -93,9 +93,10 @@ void histCorr(const Bool_t can1 = 1, const Bool_t can2 = 1, const Bool_t can3 = TH1F *h7 = new TH1F("h7", "Time difference between 90 and 10 percent of the rising edge ampl", 100, 0, 5); TH2F *h8 = new TH2F("h8", "Time difference between 90 and 10 percent vs integral", 100, 0., 5., 100, 0., 3e-9); + TH2F *h9 = new TH2F("h9", "Time difference between 90 and 10: ch0 vs ch1", 100, 0., 5., 100, 0., 5.); c3->cd(1); - t->Draw("Ach0.fTime90 - Ach0.fTime10 >> h7","(Ach0.fTime90-Ach0.fTime10)>0","col"); + t->Draw("Ach0.fTime90 - Ach0.fTime10 >> h7","(Ach0.fTime90-Ach0.fTime10)>=0","col"); // t->Draw("Ach0.fTime90 - Ach0.fTime10 >> h7","","col"); //x h7->GetXaxis()->SetTitle("\\Delta \\tau_{0}^{(rise)} [ns]"); @@ -112,6 +113,14 @@ void histCorr(const Bool_t can1 = 1, const Bool_t can2 = 1, const Bool_t can3 = h8->GetYaxis()->CenterTitle(); c3->Update(); + c3->cd(2); + t->Draw(" (Ach1.fTime90 - Ach1.fTime10) : (Ach0.fTime90 - Ach0.fTime10) >> h9","(Ach0.fTime90 - Ach0.fTime10)>0","col"); + //x + h9->GetXaxis()->SetTitle("\\Delta \\tau_{0}^{(rise)} [ns]"); + h9->GetXaxis()->CenterTitle(); + //y + h9->GetYaxis()->SetTitle("\\Delta \\tau_{1}^{(rise)} [ns]"); + h9->GetYaxis()->CenterTitle(); c3->Update(); } diff --git a/macros/testShowGraphs.cxx b/macros/testShowGraphs.cxx index 270b6e7e927102fcc2990781d4222a50ee1532dc..c0ca2a46bf69539c60a689d1339334ca9e20610f 100644 --- a/macros/testShowGraphs.cxx +++ b/macros/testShowGraphs.cxx @@ -6,7 +6,8 @@ void testShowGraphs() const Long64_t kFirstEvent = 50; // TFile fr("../data/dataDSR4/analysis_07_1.root"); - TFile fr("../data/dataDSR4/analysis_07_8.root"); +// TFile fr("../data/dataDSR4/analysis_07_8.root"); + TFile fr("../data/dataDSR4/analysis_08_2.root"); // TFile fr("../data/dataTektronix/analysisExp7.root"); TTree *tr = (TTree*)fr.Get("atree"); @@ -14,6 +15,8 @@ void testShowGraphs() cout << tr->SetBranchAddress("Ach0.",&revent) << endl; TGraph *gr[10]; + Double_t t10[10]; + Double_t t90[10]; // cout << "warning" << endl; @@ -22,12 +25,21 @@ void testShowGraphs() //loop over events for (Long64_t i = 0; i < 10; i++) { gr[i] = 0; + t10[i] = 0; + t90[i] = 0; // cout << "warning 1" << endl; - cout << i+kFirstEvent << endl; +// cout << i+kFirstEvent << endl; tr->GetEntry(i+kFirstEvent); // tr->GetEntry(i); // cout << "warning 2" << endl; gr[i] = new TGraph(*revent->GetGraphSignal()); + t10[i] = revent->GetT_10(); + t90[i] = revent->GetT_90(); + +// cout << t10[i] << "\t" << t90[i] << endl; +// cout << revent->GetEdgeSlope() << endl; + + }//for over events // cout << "warning 3" << endl; @@ -35,9 +47,16 @@ void testShowGraphs() TCanvas *c1 = new TCanvas("c1","test",10,10,1000,600); c1->Divide(3,2); + TF1 *f1 = new TF1("f1name", "[0]+x*[1]"); +// TF1 *f1 = new TF1("pol1", ); + for (Int_t k = 0; k < 6; k++) { c1->cd(k+1); - gr[k]->Draw(); + gr[k]->Draw("AL*"); + + cout << t10[k] << "\t" << t90[k] << endl; + f1->SetRange(t10[k], t90[k]); + gr[k]->Fit(f1, "RQ"); } // c1->cd(2);