Commit 0cfd03a2 authored by Kostyleva D.A's avatar Kostyleva D.A

AEvent::FindFrontProperties is modified to suit DRS4, script for drawing...

AEvent::FindFrontProperties is modified to suit DRS4, script for drawing correlation is complemented
parent a596d4e9
......@@ -82,15 +82,13 @@ int main(int argc, char* argv[])
for(Long64_t i = 0; i < nentries; i++) {
tr->GetEntry(i);
if ( !(tr->GetEntry(i)%100) ) {
printf("Found event #%d\n", tr->GetEntry(i));
}
for (Int_t j = 0; j<noBranches; j++) {
wevent[j]->Reset();
wevent[j]->ProcessEvent(); //here all the analysis is going on so far
}
if ( !(i%100) ) { printf("Found event #%d\n", i); }
tw->Fill();
}
......
......@@ -79,9 +79,9 @@ void AEvent::Reset() {
fAmpCFD[i] = 0;
}
EdgeSlope=0.;
t_10=0.;
t_90=0.;
fEdgeSlope=0.;
fTime10=0.;
fTime90=0.;
fAmpMax = 0.;
fTimeAmpMax = 0.;
fTimeCFD = 0.;
......@@ -171,26 +171,29 @@ void AEvent::SetCFD() {
/////// trying to create method
void AEvent::FindFrontProperties() {
Int_t NumM = 0.;
if (!fGraphSignal) {
Warning("AEvent::FindZeroLevel", "Graph was not set");
return;
}
Int_t NumM = fTimeAmpMax*10;
if(fNPoints == 1000) { NumM = fTimeAmpMax*10.; } //10 = 1000 points / 100 ns
if(fNPoints == 1024) { NumM = fTimeAmpMax*5.; } //5 = 1024 points / 204.8 ns
for(Int_t i=NumM;i>0;i--)
{
if( fAmpPos[i]<0.1*fAmpMax ) {t_10 = fTime[i+1];break;}
if( fAmpPos[i]<0.1*fAmpMax ) {fTime10 = fTime[i+1];break;}
}
for(Int_t i=NumM;i>0;i--)
{
if( fAmpPos[i]<0.9*fAmpMax ) {t_90 = fTime[i+1];break;}
if( fAmpPos[i]<0.9*fAmpMax ) {fTime90 = fTime[i+1];break;}
}
TF1 *fit1 = new TF1("fit1","[1]*x+[0]"); //function for one parameter fitting in the range of pmin-pmax
fit1->SetRange(t_10,t_90);
fGraphSignal->Fit(fit1,"R","goff");
EdgeSlope = fit1->GetParameter(1);
fit1->SetRange(fTime10,fTime90);
fGraphSignal->Fit(fit1,"RQN","goff");
fEdgeSlope = fit1->GetParameter(1);
delete fit1;
}
......@@ -247,15 +250,16 @@ Double_t AEvent::GetOnefAmpPos(Int_t i) {
}
Double_t AEvent::GetT_10() {
return t_10;
return fTime10;
}
Double_t AEvent::GetT_90() {
return t_90;
return fTime90;
}
Double_t AEvent::GetEdgeSlope() {
return EdgeSlope;
return fEdgeSlope;
}
void AEvent::SetMaxAmplitudes() {
Double_t maxAmp = 0.;
......
......@@ -39,9 +39,9 @@ private:
Double_t fAmpMax;
Double_t fTimeAmpMax;
Double_t fZeroLevel;
Double_t EdgeSlope;
Double_t t_10;
Double_t t_90;
Double_t fEdgeSlope; //slope coefficient for the rising edge of the signal
Double_t fTime10; //time of 10% of rising edge amplitude in ns
Double_t fTime90; //time of 10% of rising edge amplitude in ns
TArrayD fAmpCFD; //array for CFD amplitudes (attenuated, inversed and delayed)
Double_t fTimeCFD; //zero-crossing time
......@@ -65,8 +65,14 @@ public:
ClassDef(AEvent,1);
Double_t GetT_10();
//returns time of 10% of rising edge amplitude in ns
Double_t GetT_90();
//returns time of 90% of rising edge amplitude in ns
Double_t GetEdgeSlope();
//returns slope coefficient for the rising edge of the signal
Double_t GetfCFD();
Double_t GetOnefTime(Int_t i);
Double_t GetOnefAmpPos(Int_t i);
......
//#include "TCanvas.h"
void histCorr(const Bool_t can1 = 1, const Bool_t can2 = 1)
void histCorr(const Bool_t can1 = 1, const Bool_t can2 = 1, const Bool_t can3 = 1)
{
gSystem->Load("../libData.so");
TFile *f = new TFile("../data/dataDSR4/analysis_07_8.root");
......@@ -82,4 +82,29 @@ void histCorr(const Bool_t can1 = 1, const Bool_t can2 = 1)
c2->Update();
}
if (can3) {
TCanvas *c3 = new TCanvas("c3", "Correlation pictures: rising edge times");
c3->Divide(1,2);
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, 300, 10, 1e-10);
c3->cd(1);
t->Draw("Ach0.fTime90 - Ach0.fTime10 >> h7","","col");
//x
h7->GetXaxis()->SetTitle("\\Delta t_{0} [ns]");
h7->GetXaxis()->CenterTitle();
c3->cd(2);
t->Draw(" Ach0.fChargeCFD : ( Ach0.fTime90 - Ach0.fTime10 ) >> h8","","col");
//x
h8->GetXaxis()->SetTitle("\\Delta t_{0} [ns]");
h8->GetXaxis()->CenterTitle();
//y
h8->GetYaxis()->SetTitle("Q_{0} [C]");
h8->GetYaxis()->CenterTitle();
c3->Update();
}
}
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