Commit 3bb4c319 authored by Vratislav Chudoba's avatar Vratislav Chudoba

AEvent::FindFrontProperties modified.

parent 1f2e4d36
...@@ -64,6 +64,7 @@ void AEvent::ProcessEvent() { ...@@ -64,6 +64,7 @@ void AEvent::ProcessEvent() {
SetGraphs(); SetGraphs();
FindFrontProperties(); FindFrontProperties();
SetGraphs();
SetCFD(); SetCFD();
SetChargeCFD(); SetChargeCFD();
...@@ -80,6 +81,7 @@ void AEvent::Reset() { ...@@ -80,6 +81,7 @@ void AEvent::Reset() {
} }
fEdgeSlope=0.; fEdgeSlope=0.;
fEdgeSlope=-100.;
fTime10=0.; fTime10=0.;
fTime90=0.; fTime90=0.;
fAmpMax = 0.; fAmpMax = 0.;
...@@ -176,7 +178,7 @@ void AEvent::FindFrontProperties() { ...@@ -176,7 +178,7 @@ void AEvent::FindFrontProperties() {
const Double_t maxHeight = 0.9; const Double_t maxHeight = 0.9;
const Double_t timeStep = 0.05; //in ns const Double_t timeStep = 0.05; //in ns
Double_t time = fTimeAmpMax; //in ns Double_t time = 0; //in ns
// Int_t NumM = 0.; // Int_t NumM = 0.;
if (!fGraphSignal) { if (!fGraphSignal) {
...@@ -186,26 +188,29 @@ void AEvent::FindFrontProperties() { ...@@ -186,26 +188,29 @@ void AEvent::FindFrontProperties() {
//TODO search of minimum should be done from the lower edge on the time axis //TODO search of minimum should be done from the lower edge on the time axis
// cout << "Event!!!!!!!!!!!!!" << endl; // 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; // 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; fTime90 = time;
time = time + timeStep;
};
time = fTime90;
while( fGraphSignal->Eval(time) >= minHeight*fAmpMax && time>0) {
fTime10 = time;
time = time - timeStep; 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; // cout<< "Time90 - time10 "<< fTime90 - fTime10 << endl;
// if(fTime90 - fTime10 == 0.25 ) { cout<< "Zero !!"<<endl; } // if(fTime90 - fTime10 == 0.25 ) { cout<< "Zero !!"<<endl; }
TF1 *fit1 = new TF1("fit1","[1]*x+[0]"); //function for one parameter fitting in the range of pmin-pmax TF1 *fit1 = new TF1("fit1","[1]*x+[0]"); //function for one parameter fitting in the range of pmin-pmax
fit1->SetRange(fTime10,fTime90); fit1->SetRange(fTime10,fTime90);
fGraphSignal->Fit(fit1,"RQ","goff"); // fGraphSignal->Fit(fit1,"RQ","goff");
fGraphSignal->Fit(fit1,"RQN","goff");
fEdgeSlope = fit1->GetParameter(1); fEdgeSlope = fit1->GetParameter(1);
delete fit1; delete fit1;
......
...@@ -93,9 +93,10 @@ void histCorr(const Bool_t can1 = 1, const Bool_t can2 = 1, const Bool_t can3 = ...@@ -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); 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 *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); 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"); // t->Draw("Ach0.fTime90 - Ach0.fTime10 >> h7","","col");
//x //x
h7->GetXaxis()->SetTitle("\\Delta \\tau_{0}^{(rise)} [ns]"); 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 = ...@@ -112,6 +113,14 @@ void histCorr(const Bool_t can1 = 1, const Bool_t can2 = 1, const Bool_t can3 =
h8->GetYaxis()->CenterTitle(); h8->GetYaxis()->CenterTitle();
c3->Update(); 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(); c3->Update();
} }
......
...@@ -6,7 +6,8 @@ void testShowGraphs() ...@@ -6,7 +6,8 @@ void testShowGraphs()
const Long64_t kFirstEvent = 50; const Long64_t kFirstEvent = 50;
// TFile fr("../data/dataDSR4/analysis_07_1.root"); // 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"); // TFile fr("../data/dataTektronix/analysisExp7.root");
TTree *tr = (TTree*)fr.Get("atree"); TTree *tr = (TTree*)fr.Get("atree");
...@@ -14,6 +15,8 @@ void testShowGraphs() ...@@ -14,6 +15,8 @@ void testShowGraphs()
cout << tr->SetBranchAddress("Ach0.",&revent) << endl; cout << tr->SetBranchAddress("Ach0.",&revent) << endl;
TGraph *gr[10]; TGraph *gr[10];
Double_t t10[10];
Double_t t90[10];
// cout << "warning" << endl; // cout << "warning" << endl;
...@@ -22,12 +25,21 @@ void testShowGraphs() ...@@ -22,12 +25,21 @@ void testShowGraphs()
//loop over events //loop over events
for (Long64_t i = 0; i < 10; i++) { for (Long64_t i = 0; i < 10; i++) {
gr[i] = 0; gr[i] = 0;
t10[i] = 0;
t90[i] = 0;
// cout << "warning 1" << endl; // cout << "warning 1" << endl;
cout << i+kFirstEvent << endl; // cout << i+kFirstEvent << endl;
tr->GetEntry(i+kFirstEvent); tr->GetEntry(i+kFirstEvent);
// tr->GetEntry(i); // tr->GetEntry(i);
// cout << "warning 2" << endl; // cout << "warning 2" << endl;
gr[i] = new TGraph(*revent->GetGraphSignal()); 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 }//for over events
// cout << "warning 3" << endl; // cout << "warning 3" << endl;
...@@ -35,9 +47,16 @@ void testShowGraphs() ...@@ -35,9 +47,16 @@ void testShowGraphs()
TCanvas *c1 = new TCanvas("c1","test",10,10,1000,600); TCanvas *c1 = new TCanvas("c1","test",10,10,1000,600);
c1->Divide(3,2); 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++) { for (Int_t k = 0; k < 6; k++) {
c1->cd(k+1); 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); // c1->cd(2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment