Commit 182bd869 authored by Kostyleva D.A's avatar Kostyleva D.A

In AEvent class the point where front fit crosses zero level (fTimeFront) is added

parent 2553b20f
......@@ -86,7 +86,7 @@ int main(int argc, char* argv[])
for(Long64_t i = 0; i < nentries; i++) {
tr->GetEntry(i);
//cout<<" i "<<i<<endl;
//cout<<" Event "<<i<<endl;
for (Int_t j = 0; j<noBranches; j++) {
wevent[j]->Reset();
wevent[j]->ProcessEvent(); //here all the analysis is going on so far
......
......@@ -81,6 +81,7 @@ void AEvent::Reset() {
fZeroLevel = 0.;
fChargeCFD = -10.;
fChargeLED = -10.;
fTimeFront = -100.;
}
void AEvent::SetInputEvent(RawEvent** event) {
......@@ -173,6 +174,7 @@ void AEvent::FindFrontProperties() {
const Double_t timeStep = 0.05; //in ns
Double_t time = 0; //in ns
Double_t mytime = 0.;
if (!fGraphSignal) {
Warning("AEvent::FindFrontProperties", "Graph was not set");
......@@ -196,9 +198,28 @@ void AEvent::FindFrontProperties() {
fit1->SetRange(fTime10,fTime90);
fGraphSignal->Fit(fit1,"RQN","goff");
fEdgeSlope = fit1->GetParameter(1);
fEdgeXi = fit1->GetChisquare();
//adding point where fit function crosses zero
Double_t a = 0, b = 0;
TF1 *line = new TF1("line","[1]*x + [0]");
a = fit1->GetParameter(1);
b = fit1->GetParameter(0);
line->SetParameter(0,b);
line->SetParameter(1,a);
//cout<<"par 0 "<<b<<endl;
//cout<<"par 1 "<<a<<endl;
if( a!= 0. && b!= 0. ) { //in case of fit data is empty
while(line->Eval(mytime) <= 0 && mytime <= 200.) {
//cout<< "mytime "<<mytime<<endl;
fTimeFront = mytime;
mytime = mytime + timeStep;
}
}
delete fit1;
}
......
......@@ -50,6 +50,7 @@ private:
Double_t fChargeLED; //charge of the signal in Coulomb
Double_t fTimeLED; //time of LED threshold crossing
Double_t fTimeFront; //time of front fit crossing zero level
TGraph *fGraphSignal;
TGraph *fGraphCFD;
......
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