diff --git a/dataClasses/AEvent.cpp b/dataClasses/AEvent.cpp index 79601b861a07cee908e7277ff2b52e55983cf502..1baa662e57cbcc62a3a5cebd83af577ae6914ab5 100644 --- a/dataClasses/AEvent.cpp +++ b/dataClasses/AEvent.cpp @@ -27,18 +27,6 @@ AEvent::~AEvent() { delete fInputEvent; } -void AEvent::SetRawDataFile(const char* inprawfile, const char* treename) { - - TString iFileName = inprawfile; - TFile *fraw = new TFile(iFileName.Data()); - if ( !fraw->IsOpen() ) { - Error("SetRawDataFile", "File %s was not opened and won't be processed", iFileName.Data()); - } - TTree *traw = (TTree*)fraw->Get(treename); - if (!traw) { - Error("SetRawDataFile", "Tree %s was not found in file %s", treename, iFileName.Data()); - } -} void AEvent::ProcessEvent() { @@ -132,7 +120,6 @@ void AEvent::SetGraphs() { 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); @@ -142,15 +129,11 @@ void AEvent::SetCFD() { Double_t TmaxCFD = 0., TminCFD = 0.; Double_t ampCFD; const Double_t timeStep = 0.1; - Int_t i = 0; - -//вместо цикла по точкам нужно сделать "цикл" по графику - + Int_t i = 0; //for graph + + //while goes by the graph with the step of timeStep while( mytime < (200. - fCFtimeDelay) ) { - // fAmpCFD[i] = fGraphSignal->Eval(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); @@ -169,42 +152,8 @@ void AEvent::SetCFD() { i++; mytime = mytime + timeStep; } -// - -/* for (Int_t i=0; ifCFtimeDelay) { // условие, чтобы не выскочить из размера массива ( обрезает границы на fCFtimeDelay) - fAmpCFD[i] = fAmpPos[i]*fCFratio*(-1); - fAmpCFD[i] = fAmpCFD[i] + fAmpPos[i - fCFtimeDelay]; - fGraphCFD->SetPoint(i, fTime[i], fAmpCFD[i]); - } - - //point for max CFD amplitude - if(fAmpCFD[i] > maxCFD) { - maxCFD = fAmpCFD[i]; - TmaxCFD = fTime[i]; -// imax = i; - } - //point for min CFD amplitude - if(fAmpCFD[i] < minCFD) { - minCFD = fAmpCFD[i]; - TminCFD = fTime[i]; -// imin = i; - } - - }*/ - -/* //finding "zero" of CFD amplitude - for(Int_t j = imin; j < imax; j++) { - if(abs(fAmpCFD[j]) < level) { - level = abs(fAmpCFD[j]); - fTimeCFD = fTime[j]; - } - } -*/ - //I want to find zero of CFD using graph and eval + //looking for the first point with the closest values to 0 and writing to fTimeCFD time = TminCFD; while( (fGraphCFD->Eval(time) <= 0) && (time <= TmaxCFD) /*&& (time >= TminCFD)*/ ) { fTimeCFD = time; @@ -221,7 +170,6 @@ void AEvent::FindFrontProperties() { const Double_t timeStep = 0.05; //in ns Double_t time = 0; //in ns -// Int_t NumM = 0.; if (!fGraphSignal) { Warning("AEvent::FindFrontProperties", "Graph was not set"); @@ -229,10 +177,8 @@ 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) <= maxHeight*fAmpMax && time<200.) { -// cout << fAmpMax << "\t" << fGraphSignal->Eval(time) << "\t" << fTimeAmpMax << "\t" << time << endl; fTime90 = time; time = time + timeStep; }; @@ -242,23 +188,17 @@ void AEvent::FindFrontProperties() { fTime10 = time; time = time - timeStep; } -// 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,"RQN","goff"); fEdgeSlope = fit1->GetParameter(1); fEdgeXi = fit1->GetChisquare(); delete fit1; } -//////// + Double_t AEvent::FindZeroLevel() { SetGraphs(); @@ -291,8 +231,6 @@ void AEvent::SetChargeCFD(Int_t tmin, Int_t tmax) { } } fChargeCFD = integral*time_sig/res; -// cout<Load("../libData.so"); TFile *f = new TFile(Form("../data/dataDSR4/%s", filename)); @@ -170,6 +170,8 @@ void histCorr( if (can5) { TCanvas *c5 = new TCanvas("c5", "Changing CFD parameters"); + c5->Divide(1,2); + c5->cd(1); TH1F *h12 = new TH1F("h12", "Delta tau CFD",100, -10., 30.); @@ -183,6 +185,19 @@ void histCorr( h12->Fit(fGaus, "R"); gStyle->SetOptFit(); + c5->cd(2); + TH3F *h3d = new TH3F("h3d","3d histo", 100, -10, 30, 125, 0, 5e-9, 125, 0, 5e-9); + t->Draw("Ach1.fChargeCFD : Ach0.fChargeCFD : (Ach0.fTimeCFD - Ach1.fTimeCFD) >> h3d","",""); + + h3d->GetXaxis()->SetTitle("\\Delta \\tau_{0-1} [ns]"); + h3d->GetXaxis()->CenterTitle(); + + h3d->GetYaxis()->SetTitle("Q_{0} [C]"); + h3d->GetYaxis()->CenterTitle(); + + h3d->GetZaxis()->SetTitle("Q_{1} [C]"); + h3d->GetZaxis()->CenterTitle(); + c5->Update(); //c5->Print(Form("../macros/picsDRS4/file%s/TimeDiffCFD_0.7_3%s", foldername, ext));