diff --git a/convertRawToAnalyzed/analyse.cpp b/convertRawToAnalyzed/analyse.cpp index 1462b8e038a52b20732e35ad5f6aea33afba3981..174cef2b38aadeb994f8b4316e7d97306f988309 100644 --- a/convertRawToAnalyzed/analyse.cpp +++ b/convertRawToAnalyzed/analyse.cpp @@ -15,8 +15,8 @@ int main(int argc, char* argv[]) //to be extracted from the source as parameters const Int_t noBranches = 4; - const Double_t cfRatio = 0.2; - const Double_t cfTD = 0.6; //in ns + const Double_t cfRatio = 0.3; + const Double_t cfTD = 1.5; //in ns Double_t noiseMin = 5; Double_t noiseMax = 25; diff --git a/dataClasses/AEvent.cpp b/dataClasses/AEvent.cpp index 368374cbf7904dc8813acc45deda04e544fd9ccd..70b5f98f543d6b5647166f3ac5006ee12da2402c 100644 --- a/dataClasses/AEvent.cpp +++ b/dataClasses/AEvent.cpp @@ -55,7 +55,7 @@ void AEvent::ProcessEvent() { SetLED(); // SetGraphs(); SetCFD(); -// SetChargeCFD(); + SetChargeCFD(); SetChargeLED(); return; @@ -69,7 +69,7 @@ void AEvent::Reset() { fTime[i] = 0; fAmpCFD[i] = 0; } - fTimeLED = 0.; + fTimeLED = -100.; fEdgeSlope=0.; fEdgeXi=0.; fEdgeSlope=-100.; @@ -77,10 +77,10 @@ void AEvent::Reset() { fTime90=0.; fAmpMax = 0.; fTimeAmpMax = 0.; - fTimeCFD = 0.; + fTimeCFD = -100.; fZeroLevel = 0.; - fChargeCFD = 0.; - fChargeLED = 0.; + fChargeCFD = -10.; + fChargeLED = -10.; } void AEvent::SetInputEvent(RawEvent** event) { @@ -228,11 +228,20 @@ void AEvent::SetChargeCFD(Int_t tmin, Int_t tmax) { // tmin = -3, tmax = 17 const Double_t res = 50.; //resistance 50 Om time_sig = (double)(-tmin + tmax)*(1e-9); - for(Int_t i = 0; i < fNPoints; i++) { + /*for(Int_t i = 0; i < fNPoints; i++) { if( fTime[i] > (fTimeCFD + tmin) && fTime[i] < (fTimeCFD + tmax) ) { integral = integral + fAmpPos[i]; } - } + }*/ + + Int_t imin = 0, imax = 0; + + Int_t i = 0; + while ( fTime[i] < (fTimeCFD + tmin) && (i < (fGraphSignal->GetN()-1)) ) { imin = i; i++; } + while ( fTime[i] < (fTimeCFD + tmax) && (i < (fGraphSignal->GetN()-1)) ) { imax = i; i++; } + + integral = fGraphSignal->Integral(imin, imax); + fChargeCFD = integral*time_sig/res; return; @@ -256,7 +265,7 @@ void AEvent::SetChargeLED(Int_t tmin, Int_t tmax) { // tmin = -3, tmax = 17 Int_t i = 0; while ( fTime[i] < (fTimeLED + tmin) && (i < (fGraphSignal->GetN()-1)) ) { imin = i; i++; } - i = 0; +// i = 0; while ( fTime[i] < (fTimeLED + tmax) && (i < (fGraphSignal->GetN()-1)) ) { imax = i; i++; } integral = fGraphSignal->Integral(imin, imax); diff --git a/dataClasses/AEvent.h b/dataClasses/AEvent.h index b0c33631bc1327f8614248c310301f86daf99df6..eefc60de81c417af4b56cb0cb3bc05865458357b 100644 --- a/dataClasses/AEvent.h +++ b/dataClasses/AEvent.h @@ -128,7 +128,7 @@ public: //void SetLED(Double_t threshold = 0.001); - void SetLED(Double_t threshold = 0.002); + void SetLED(Double_t threshold = 0.02); //leading edge discriminator diff --git a/macros/histCorr.C b/macros/histCorr.C index 3ac72af814cbfc636be2b2c645f34df387e72bf4..87314cacb3f832b0c5ecda996591f71628ec22ca 100644 --- a/macros/histCorr.C +++ b/macros/histCorr.C @@ -2,13 +2,16 @@ void histCorr( // const char *filename = "Neurad_7_08_NEW.root", - const char *filename = "analysis_08_2.root", +// const char *filename = "analysis_08_2.root", + const char *filename = "analysis_07_8.root", const char *foldername = "7_8", // const char *foldername = "8_2", // const char *ext = ".eps", const char *ext = ".gif", - const Bool_t can1 = 0, const Bool_t can2 = 0, const Bool_t can3 = 0, const Bool_t can4 = 0, const Bool_t can5 = 0, const Bool_t can6 = 1) + const Bool_t can1 = 0, const Bool_t can2 = 0, + const Bool_t can3 = 0, const Bool_t can4 = 0, + const Bool_t can5 = 0, const Bool_t can6 = 1) { gSystem->Load("../libData.so"); TFile *f = new TFile(Form("../data/dataDSR4/%s", filename)); @@ -209,9 +212,9 @@ void histCorr( c6->cd(1); //TH2F *h13 = new TH2F("h13", "leading edge vs charge",100, 130., 145., 100, -2e-9, 6e-9); - TH1F *h20 = new TH1F("h20", "hist led - cfd", 100, -5, 200.); + TH1F *h20 = new TH1F("h20", "delta Tau CFD", 100, -20., 0.); //t->Draw("Ach0.fTimeCFD - Ach0.fTimeLED >> h20","Ach0.fTimeCFD - Ach0.fTimeLED > 0.3 && Ach0.fTimeCFD - Ach0.fTimeLED <1.3",""); - t->Draw("Ach0.fTimeLED >> h20","Ach0.fTimeLED > 120 && Ach0.fTimeLED < 150"); + t->Draw("Ach1.fTimeCFD - Ach0.fTimeCFD >> h20","Ach0.fTimeCFD >0. && Ach1.fTimeCFD >0."); //t->Draw("Ach0.fChargeCFD : Ach0.fChargeCFD >> h13","","col");; //x /* h13->GetYaxis()->SetTitle("fChargeCFD"); @@ -222,38 +225,63 @@ void histCorr( c6->Update(); c6->cd(3); - TH2F *h14 = new TH2F("h14", "fTIMECFD vs fTIMELED",100, 110., 140., 100, 110, 160); - t->Draw("Ach0.fTimeCFD : Ach0.fTimeLED >> h14","","col"); +// TH2F *h14 = new TH2F("h14", "fTIMECFD vs fTIMELED",100, 110., 140., 100, 110, 160); +// TH1F *h14 = new TH1F("h14", "delta Tau LED", 100, -20., 0.); + TH1F *h14 = new TH1F("h14", "delta Tau LED", 50, -8., 10.); +// TH1F *h140 = new TH1F("h140", "delta Tau LED", 100, -20., 0.); + TH1F *h140 = new TH1F("h140", "delta Tau LED", 50, -8., 10.); +// t->Draw("Ach0.fTimeLED - Ach0.fTimeLED >> h14","",""); +// t->Draw("Ach2.fTimeLED - Ach0.fTimeLED >> h14","",""); + t->Draw("Ach1.fTimeLED - Ach0.fTimeLED >> h14","",""); +// t->SetLineColor(kRed); +// cout << t->Draw("Ach0.fTimeLED - Ach0.fTimeLED >> h140","Ach1.fChargeLED > 0.04e-9","same") << endl; +// cout << t->Draw("Ach2.fTimeLED - Ach0.fTimeLED >> h140","Ach2.fChargeLED > 0.04e-9","same") << endl; + cout << t->Draw("Ach1.fTimeLED - Ach0.fTimeLED >> h140","Ach1.fChargeLED > 0.04e-9","same") << endl; + h140->SetLineColor(kRed); + //t->Draw("Ach0.fChargeCFD : Ach0.fChargeCFD >> h13","","col");; //x - h14->GetYaxis()->SetTitle("fTimeCFD"); + + h14->GetYaxis()->SetTitle("N"); h14->GetYaxis()->CenterTitle(); //y - h14->GetXaxis()->SetTitle("fTimeLED"); + h14->GetXaxis()->SetTitle("delta tau"); h14->GetXaxis()->CenterTitle(); + +// h14->Fit("gaus", "", "", -13, -6); +// h140->Fit("gaus", "", "", -13, -6); + h14->Fit("gaus", "", "", -2, 6); + h140->Fit("gaus", "", "", -2, 6); + + gStyle->SetOptFit(); + c6->Update(); c6->cd(2); - TH2F *h15 = new TH2F("h15", "leading edge vs charge",100, 100., 180.,100, -0.02e-10, 1e-10); - t->Draw("Ach1.fChargeCFD : Ach1.fTimeLED >> h15","Ach1.fChargeCFD>0","col"); + TH2F *h15 = new TH2F("h15", "leading edge vs charge",50, 120., 140.,200, -0.02e-10, 4e-10); + t->Draw("Ach1.fChargeLED : Ach1.fTimeLED >> h15","Ach1.fChargeLED>0","col"); +// t->Draw("Ach1.fChargeLED : Ach1.fTimeLED","Ach1.fChargeLED>0.02e-10 && Ach1.fChargeLED<4e-10 && Ach1.fTimeLED>120. && Ach1.fTimeLED<140.",""); //t->Draw("Ach0.fChargeCFD : Ach0.fChargeCFD >> h13","","col");; //x - h15->GetYaxis()->SetTitle("fChargeCFD"); + h15->GetYaxis()->SetTitle("fChargeLED"); h15->GetYaxis()->CenterTitle(); //y h15->GetXaxis()->SetTitle("fTimeLED"); h15->GetXaxis()->CenterTitle(); c6->Update(); + + c6->cd(4); - TH2F *h16 = new TH2F("h16", "FtimeCFD vs charge", 100, 100., 180.,100, 0, 1e-10); - t->Draw("Ach1.fChargeCFD : Ach1.fTimeCFD >> h16","Ach1.fChargeCFD>3e-12","col"); + TH2F *h16 = new TH2F("h16", "delta timeLED vs charge", 200, -20., 0.,100, 0, 10e-10); +// t->Draw("Ach1.fChargeLED : Ach1.fTimeLED - Ach0.fTimeLED >> h16","Ach1.fChargeLED>3e-12","col"); + t->Draw("Ach1.fChargeLED : Ach1.fTimeLED - Ach0.fTimeLED >> h16","Ach1.fTimeLED - Ach0.fTimeLED > -20. && Ach1.fTimeLED - Ach0.fTimeLED < 0. && Ach1.fChargeLED<10e-10","col"); //t->Draw("Ach0.fChargeCFD : Ach0.fChargeCFD >> h13","","col");; //x - h16->GetYaxis()->SetTitle("fChargeCFD"); + h16->GetYaxis()->SetTitle("fChargeLED"); h16->GetYaxis()->CenterTitle(); //y - h16->GetXaxis()->SetTitle("fTimeCFD"); + h16->GetXaxis()->SetTitle("delta tau LED"); h16->GetXaxis()->CenterTitle(); c6->Update(); //c4->Print(Form("../macros/picsDRS4/file%s/XiSquares%s", foldername, ext)); diff --git a/macros/testShowCFD.cxx b/macros/testShowCFD.cxx index 281bc5ea360369745717752ca2c1aedbf221c609..af19fa9c7f6eb1f73d36a69f9169df80009cefed 100644 --- a/macros/testShowCFD.cxx +++ b/macros/testShowCFD.cxx @@ -5,7 +5,8 @@ void testShowCFD() const Long64_t kFirstEvent = 128; - TFile fr("../data/dataDSR4/analysis_08_2_CFD02_06.root"); +// TFile fr("../data/dataDSR4/analysis_08_2_CFD02_06.root"); + TFile fr("../data/dataDSR4/analysis_08_2.root"); TTree *tr = (TTree*)fr.Get("atree"); AEvent *revent = new AEvent(); diff --git a/macros/testShowGraphs.cxx b/macros/testShowGraphs.cxx index 1b6edfe036f43006c0aedf7d71b28d118fe42626..686430a56c9ac8e8b634379c75a2461d08d6bdfa 100644 --- a/macros/testShowGraphs.cxx +++ b/macros/testShowGraphs.cxx @@ -6,8 +6,9 @@ void testShowGraphs() const Long64_t kFirstEvent = 128; - TFile fr("../data/dataDSR4/Neurad_7_08_NEW.root"); +// TFile fr("../data/dataDSR4/Neurad_7_08_NEW.root"); // TFile fr("../data/dataDSR4/analysis_07_8.root"); + TFile fr("../data/dataDSR4/analysis_08_2.root"); // TFile fr("../data/dataDSR4/Neurad_081216_2NEW.root"); // TFile fr("../data/dataTektronix/exp18.root"); // TFile fr("../data/dataTektronix/analysisExp7.root");