diff --git a/src/THcShowerArray.cxx b/src/THcShowerArray.cxx index 63e53574f0b190c6a34ed29b0adbf4cba353c486..6473d6f2ec8be8bad74d0f87bb2856ef6fd95b1f 100644 --- a/src/THcShowerArray.cxx +++ b/src/THcShowerArray.cxx @@ -128,6 +128,7 @@ Int_t THcShowerArray::ReadDatabase( const TDatime& date ) {"cal_arr_ADCMode", &fADCMode, kInt, 0, 1}, {"cal_arr_AdcTimeWindowMin", &fAdcTimeWindowMin, kDouble, 0, 1}, {"cal_arr_AdcTimeWindowMax", &fAdcTimeWindowMax, kDouble, 0, 1}, + {"cal_arr_AdcThreshold", &fAdcThreshold, kDouble, 0, 1}, {"cal_ped_sample_low", &fPedSampLow, kInt, 0, 1}, {"cal_ped_sample_high", &fPedSampHigh, kInt, 0, 1}, {"cal_data_sample_low", &fDataSampLow, kInt, 0, 1}, @@ -138,6 +139,7 @@ Int_t THcShowerArray::ReadDatabase( const TDatime& date ) fADCMode=kADCDynamicPedestal; fAdcTimeWindowMin=0; fAdcTimeWindowMax=10000; + fAdcThreshold=0.; fNelem = fNRows*fNColumns; fXPos = new Double_t* [fNRows]; @@ -791,7 +793,7 @@ Int_t THcShowerArray::ProcessHits(TClonesArray* rawhits, Int_t nexthit) // for (UInt_t thit=0; thit<rawAdcHit.GetNPulses(); ++thit) { ((THcSignalHit*) frAdcPedRaw->ConstructedAt(nrAdcHits))->Set(padnum, rawAdcHit.GetPedRaw()); - fThresh[padnum]=rawAdcHit.GetPedRaw()*rawAdcHit.GetF250_PeakPedestalRatio()+250.; + fThresh[padnum-1]=rawAdcHit.GetPedRaw()*rawAdcHit.GetF250_PeakPedestalRatio()+fAdcThreshold; ((THcSignalHit*) frAdcPed->ConstructedAt(nrAdcHits))->Set(padnum, rawAdcHit.GetPed()); ((THcSignalHit*) frAdcPulseIntRaw->ConstructedAt(nrAdcHits))->Set(padnum, rawAdcHit.GetPulseIntRaw(thit)); diff --git a/src/THcShowerArray.h b/src/THcShowerArray.h index 4b178cbcf9c43ff304b32b7bce40ce3d286ee9e2..9206f771f3c13d790850660a087764925172664c 100644 --- a/src/THcShowerArray.h +++ b/src/THcShowerArray.h @@ -113,6 +113,7 @@ protected: static const Int_t kADCSampIntDynPed=3; Double_t fAdcTimeWindowMin ; Double_t fAdcTimeWindowMax ; + Double_t fAdcThreshold ; Int_t fPedSampLow; // Sample range for Int_t fPedSampHigh; // dynamic pedestal Int_t fDataSampLow; // Sample range for diff --git a/src/THcShowerPlane.cxx b/src/THcShowerPlane.cxx index 0a9452d50ab57599e3a35bcd45242ecb2c193fae..2553ee19f807a0a406ad17f8ea9b9a17743a4161 100644 --- a/src/THcShowerPlane.cxx +++ b/src/THcShowerPlane.cxx @@ -134,13 +134,15 @@ Int_t THcShowerPlane::ReadDatabase( const TDatime& date ) char prefix[2]; prefix[0]=tolower(GetParent()->GetPrefix()[0]); prefix[1]='\0'; - fUsingFADC=0; fPedSampLow=0; fPedSampHigh=9; fDataSampLow=23; fDataSampHigh=49; + fAdcNegThreshold=0.; + fAdcPosThreshold=0.; DBRequest list[]={ - {"cal_using_fadc", &fUsingFADC, kInt, 0, 1}, + {"cal_AdcNegThreshold", &fAdcNegThreshold, kDouble, 0, 1}, + {"cal_AdcPosThreshold", &fAdcPosThreshold, kDouble, 0, 1}, {"cal_ped_sample_low", &fPedSampLow, kInt, 0, 1}, {"cal_ped_sample_high", &fPedSampHigh, kInt, 0, 1}, {"cal_data_sample_low", &fDataSampLow, kInt, 0, 1}, @@ -431,7 +433,8 @@ Int_t THcShowerPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit) THcRawAdcHit& rawPosAdcHit = hit->GetRawAdcHitPos(); for (UInt_t thit=0; thit<rawPosAdcHit.GetNPulses(); ++thit) { ((THcSignalHit*) frPosAdcPedRaw->ConstructedAt(nrPosAdcHits))->Set(padnum, rawPosAdcHit.GetPedRaw()); - fPosThresh[hit->fCounter -1]=rawPosAdcHit.GetPedRaw()*rawPosAdcHit.GetF250_PeakPedestalRatio()+250.; + fPosThresh[hit->fCounter -1]=rawPosAdcHit.GetPedRaw()*rawPosAdcHit.GetF250_PeakPedestalRatio()+fAdcPosThreshold; + ((THcSignalHit*) frPosAdcPed->ConstructedAt(nrPosAdcHits))->Set(padnum, rawPosAdcHit.GetPed()); ((THcSignalHit*) frPosAdcPulseIntRaw->ConstructedAt(nrPosAdcHits))->Set(padnum, rawPosAdcHit.GetPulseIntRaw(thit)); @@ -451,7 +454,7 @@ Int_t THcShowerPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit) THcRawAdcHit& rawNegAdcHit = hit->GetRawAdcHitNeg(); for (UInt_t thit=0; thit<rawNegAdcHit.GetNPulses(); ++thit) { ((THcSignalHit*) frNegAdcPedRaw->ConstructedAt(nrNegAdcHits))->Set(padnum, rawNegAdcHit.GetPedRaw()); - fNegThresh[hit->fCounter -1]=rawNegAdcHit.GetPedRaw()*rawNegAdcHit.GetF250_PeakPedestalRatio()+250.; + fNegThresh[hit->fCounter -1]=rawNegAdcHit.GetPedRaw()*rawNegAdcHit.GetF250_PeakPedestalRatio()+fAdcNegThreshold; ((THcSignalHit*) frNegAdcPed->ConstructedAt(nrNegAdcHits))->Set(padnum, rawNegAdcHit.GetPed()); ((THcSignalHit*) frNegAdcPulseIntRaw->ConstructedAt(nrNegAdcHits))->Set(padnum, rawNegAdcHit.GetPulseIntRaw(thit)); @@ -564,7 +567,7 @@ void THcShowerPlane::FillADC_Standard() Int_t npad = ((THcSignalHit*) frPosAdcPulseIntRaw->ConstructedAt(ielem))->GetPaddleNumber() - 1; Double_t pulseIntRaw = ((THcSignalHit*) frPosAdcPulseIntRaw->ConstructedAt(ielem))->GetData(); fA_Pos[npad] =pulseIntRaw; - if(fA_Pos[npad] > fPosThresh[npad]) { + if(fA_Pos[npad] > fPosThresh[npad]) { fA_Pos_p[npad] =pulseIntRaw-fPosPed[npad] ; fEpos[npad] = fA_Pos_p[npad]*fParent->GetGain(npad,fLayerNum-1,0); fEmean[npad] += fEpos[npad]; diff --git a/src/THcShowerPlane.h b/src/THcShowerPlane.h index fe00766d7e3c1fa6dfe81a52bf934a40b400f147..1c84d1a4cb5a48764e83dda78deea3c67731bba8 100644 --- a/src/THcShowerPlane.h +++ b/src/THcShowerPlane.h @@ -122,6 +122,8 @@ protected: Int_t fPedSampHigh; // dynamic pedestal Int_t fDataSampLow; // Sample range for Int_t fDataSampHigh; // sample integration + Double_t fAdcNegThreshold; // + Double_t fAdcPosThreshold; // Double_t* fA_Pos; // [fNelem] ADC amplitudes of blocks Double_t* fA_Neg; // [fNelem] ADC amplitudes of blocks