Skip to content
Snippets Groups Projects
Commit b26acb29 authored by Mark Jones's avatar Mark Jones
Browse files

Fix bug in CalcFpTime and set fpTime = -10000. in Clear

In CalcFptime changes for loop to use  fNScinGoodHits
In calcFptime if not a good hit ( both PMT within time window) set to -10000.
In Clear set fpTime=-10000.
parent 2ae73d5a
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,6 @@ THcScintillatorPlane::THcScintillatorPlane( const char* name, ...@@ -45,7 +45,6 @@ THcScintillatorPlane::THcScintillatorPlane( const char* name,
fNScinHits = 0; fNScinHits = 0;
// //
fMaxHits=53; fMaxHits=53;
fpTime = -1.e5;
fpTimes = new Double_t [fMaxHits]; fpTimes = new Double_t [fMaxHits];
fScinTime = new Double_t [fMaxHits]; fScinTime = new Double_t [fMaxHits];
fScinSigma = new Double_t [fMaxHits]; fScinSigma = new Double_t [fMaxHits];
...@@ -73,7 +72,6 @@ THcScintillatorPlane::THcScintillatorPlane( const char* name, ...@@ -73,7 +72,6 @@ THcScintillatorPlane::THcScintillatorPlane( const char* name,
fNScinHits = 0; fNScinHits = 0;
// //
fMaxHits=53; fMaxHits=53;
fpTime = -1.e5;
fpTimes = new Double_t [fMaxHits]; fpTimes = new Double_t [fMaxHits];
fScinTime = new Double_t [fMaxHits]; fScinTime = new Double_t [fMaxHits];
fScinSigma = new Double_t [fMaxHits]; fScinSigma = new Double_t [fMaxHits];
...@@ -241,6 +239,7 @@ void THcScintillatorPlane::Clear( Option_t* ) ...@@ -241,6 +239,7 @@ void THcScintillatorPlane::Clear( Option_t* )
frNegTDCHits->Clear(); frNegTDCHits->Clear();
frPosADCHits->Clear(); frPosADCHits->Clear();
frNegADCHits->Clear(); frNegADCHits->Clear();
fpTime = -1.e4;
} }
//_____________________________________________________________________________ //_____________________________________________________________________________
...@@ -678,7 +677,7 @@ Double_t THcScintillatorPlane::CalcFpTime() ...@@ -678,7 +677,7 @@ Double_t THcScintillatorPlane::CalcFpTime()
{ {
Double_t tmp=0; Double_t tmp=0;
Int_t i,counter=0; Int_t i,counter=0;
for (i=0;i<fNScinHits;i++) { for (i=0;i<fNScinGoodHits;i++) {
if (TMath::Abs(fpTimes[i]-((THcHodoscope *)GetParent())->GetStartTimeCenter())<=((THcHodoscope *)GetParent())->GetStartTimeSlop()) { if (TMath::Abs(fpTimes[i]-((THcHodoscope *)GetParent())->GetStartTimeCenter())<=((THcHodoscope *)GetParent())->GetStartTimeSlop()) {
tmp+=fpTimes[i]; tmp+=fpTimes[i];
counter++; counter++;
...@@ -687,7 +686,7 @@ Double_t THcScintillatorPlane::CalcFpTime() ...@@ -687,7 +686,7 @@ Double_t THcScintillatorPlane::CalcFpTime()
if (counter>0) { if (counter>0) {
fpTime=tmp/counter; fpTime=tmp/counter;
} else { } else {
fpTime=((THcHodoscope *)GetParent())->GetStartTimeCenter(); fpTime=-10000.;
} }
return fpTime; return fpTime;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment