Skip to content
Snippets Groups Projects
Commit 6ca2daac authored by Vardan Tadevosyan's avatar Vardan Tadevosyan Committed by Stephen A. Wood
Browse files

Correct THcShowerArray pedestal calculations.

parent bb34f8ec
No related branches found
No related tags found
No related merge requests found
...@@ -101,7 +101,6 @@ Int_t THcShowerArray::ReadDatabase( const TDatime& date ) ...@@ -101,7 +101,6 @@ Int_t THcShowerArray::ReadDatabase( const TDatime& date )
// Here read the 2-D arrays of pedestals, gains, etc. // Here read the 2-D arrays of pedestals, gains, etc.
// Pedestal limits per channel. // Pedestal limits per channel.
fPedLimit = new Int_t [fNelem]; fPedLimit = new Int_t [fNelem];
THcShower* fParent; THcShower* fParent;
...@@ -136,6 +135,15 @@ Int_t THcShowerArray::ReadDatabase( const TDatime& date ) ...@@ -136,6 +135,15 @@ Int_t THcShowerArray::ReadDatabase( const TDatime& date )
cout << " Layer #" << fLayerNum << ", number of elements " << fNelem cout << " Layer #" << fLayerNum << ", number of elements " << fNelem
<< endl; << endl;
cout << " Columns " << fNColumns << ", Rows " << fNRows << endl;
cout << " Using FADC " << fUsingFADC << endl;
if (fUsingFADC) {
cout << " FADC pedestal sample low = " << fPedSampLow << ", high = "
<< fPedSampHigh << endl;
cout << " FADC data sample low = " << fDataSampLow << ", high = "
<< fDataSampHigh << endl;
}
// cout << " Origin of Layer at X = " << fOrigin.X() // cout << " Origin of Layer at X = " << fOrigin.X()
// << " Y = " << fOrigin.Y() << " Z = " << fOrigin.Z() << endl; // << " Y = " << fOrigin.Y() << " Z = " << fOrigin.Z() << endl;
...@@ -322,12 +330,17 @@ Int_t THcShowerArray::AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit) ...@@ -322,12 +330,17 @@ Int_t THcShowerArray::AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit)
THcRawShowerHit* hit = (THcRawShowerHit *) rawhits->At(ihit); THcRawShowerHit* hit = (THcRawShowerHit *) rawhits->At(ihit);
// OK for hit list sorted by layer. // OK for hit list sorted by layer.
if(hit->fPlane > fLayerNum) { // if(hit->fPlane > fLayerNum) {
break; // break;
} // }
Int_t element = hit->fCounter - 1; // Should check if in range Int_t element = hit->fCounter - 1; // Should check if in range
Int_t adc = hit->GetData(0);
Int_t adc = fUsingFADC ?
hit->GetData(0,fPedSampLow,fPedSampHigh,fDataSampLow,fDataSampHigh)
:
hit->GetData(0);
if(adc <= fPedLimit[element]) { if(adc <= fPedLimit[element]) {
fPedSum[element] += adc; fPedSum[element] += adc;
...@@ -355,15 +368,15 @@ Int_t THcShowerArray::AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit) ...@@ -355,15 +368,15 @@ Int_t THcShowerArray::AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit)
THcRawShowerHit* hit = (THcRawShowerHit *) rawhits->At(ih); THcRawShowerHit* hit = (THcRawShowerHit *) rawhits->At(ih);
// OK for hit list sorted by layer. Int_t adc = fUsingFADC ?
if(hit->fPlane > fLayerNum) { hit->GetData(0,fPedSampLow,fPedSampHigh,fDataSampLow,fDataSampHigh)
break; :
} hit->GetData(0);
cout << " hit " << ih << ":" cout << " hit " << ih << ":"
<< " plane = " << hit->fPlane << " plane = " << hit->fPlane
<< " counter = " << hit->fCounter << " counter = " << hit->fCounter
<< " ADC = " << hit->GetData(0) << " ADC = " << adc
<< endl; << endl;
} }
......
...@@ -97,7 +97,6 @@ protected: ...@@ -97,7 +97,6 @@ protected:
virtual Int_t ReadDatabase( const TDatime& date ); virtual Int_t ReadDatabase( const TDatime& date );
virtual Int_t DefineVariables( EMode mode = kDefine ); virtual Int_t DefineVariables( EMode mode = kDefine );
//virtual void InitializePedestals( );
ClassDef(THcShowerArray,0); // Fly;s Eye calorimeter array ClassDef(THcShowerArray,0); // Fly;s Eye calorimeter array
}; };
#endif #endif
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