diff --git a/convertRawToAnalyzed/analyse.cpp b/convertRawToAnalyzed/analyse.cpp index a5762e050cdda2e19de8eec61f929abafeb66b4f..636bef4f7546cc7a56adaf68e215a2407ee3c342 100644 --- a/convertRawToAnalyzed/analyse.cpp +++ b/convertRawToAnalyzed/analyse.cpp @@ -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; jReset(); wevent[j]->ProcessEvent(); //here all the analysis is going on so far } + if ( !(i%100) ) { printf("Found event #%d\n", i); } tw->Fill(); } diff --git a/dataClasses/AEvent.cpp b/dataClasses/AEvent.cpp index 7d23ddd74bc3e018ec7dabd672d419d83a0fa5c3..3a19e490d5e45e2834a24fed09c017ac04332bbc 100644 --- a/dataClasses/AEvent.cpp +++ b/dataClasses/AEvent.cpp @@ -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.; diff --git a/dataClasses/AEvent.h b/dataClasses/AEvent.h index 968e9e2455d577ff6fb41231d09990902b6ae7c9..e6d996cb3fab4123fb13825228c20b0510520566 100644 --- a/dataClasses/AEvent.h +++ b/dataClasses/AEvent.h @@ -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); diff --git a/macros/histCorr.C b/macros/histCorr.C index 6436555f3aecf33d48f165eff6dc8627fa13d084..63134a2ef9f707cc3eba6dea634f684f43b6fac6 100644 --- a/macros/histCorr.C +++ b/macros/histCorr.C @@ -1,6 +1,6 @@ //#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(); + } + }