Skip to content
Snippets Groups Projects
Commit adbc3aec authored by hallc-online's avatar hallc-online
Browse files

Modify ShowerPlane and ShowerArray ProcessHits Methods

parent b14cd4bf
No related branches found
No related tags found
No related merge requests found
...@@ -653,7 +653,6 @@ Int_t THcShowerArray::ProcessHits(TClonesArray* rawhits, Int_t nexthit) ...@@ -653,7 +653,6 @@ Int_t THcShowerArray::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
// Initialize variables. // Initialize variables.
Int_t nADCHits=0;
fADCHits->Clear(); fADCHits->Clear();
frAdcPedRaw->Clear(); frAdcPedRaw->Clear();
...@@ -709,35 +708,33 @@ Int_t THcShowerArray::ProcessHits(TClonesArray* rawhits, Int_t nexthit) ...@@ -709,35 +708,33 @@ Int_t THcShowerArray::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
++nrAdcHits; ++nrAdcHits;
} }
fADCMode=kADCDynamicPedestal;
Double_t adc;
Double_t adc_pedsub;
if(fADCMode == kADCDynamicPedestal) {
adc_pedsub = hit->GetRawAdcHitPos().GetPulseInt();
adc= hit->GetRawAdcHitPos().GetPulseIntRaw();
} else if (fADCMode == kADCSampleIntegral) {
adc_pedsub = hit->GetRawAdcHitPos().GetSampleIntRaw() - fPed[hit->fCounter -1];
adc = hit->GetRawAdcHitPos().GetSampleIntRaw();
} else if (fADCMode == kADCSampIntDynPed) {
adc = hit->GetRawAdcHitPos().GetSampleInt();
adc_pedsub = hit->GetRawAdcHitPos().GetSampleIntRaw();
} else {
adc_pedsub = hit->GetRawAdcHitPos().GetPulseIntRaw()-fPed[hit->fCounter -1];
adc = hit->GetRawAdcHitPos().GetPulseIntRaw();
}
// Should check that counter # is in range fA[hit->fCounter-1] = adc;
if (fUsingFADC) { threshold=hit->GetRawAdcHitPos().GetPedRaw()+100;
fA[hit->fCounter-1] = hit->GetRawAdcHitPos().GetData(
fPedSampLow, fPedSampHigh, fDataSampLow, fDataSampHigh
);
fP[hit->fCounter-1] = hit->GetRawAdcHitPos().GetAverage(
fPedSampLow, fPedSampHigh
);
}
else {
fA[hit->fCounter-1] = hit->GetData(0);
}
if(fA[hit->fCounter-1] > threshold) { if(fA[hit->fCounter-1] > threshold) {
ngood++; ngood++;
} }
// Sparsify hits, fill the hit list, compute the energy depostion. // Sparsify hits, fill the hit list, compute the energy depostion.
fThresh[hit->fCounter -1] = hit->GetRawAdcHitPos().GetPedRaw()+100;
if(fA[hit->fCounter-1] > fThresh[hit->fCounter -1]) { if(fA[hit->fCounter-1] > fThresh[hit->fCounter -1]) {
fA_p[hit->fCounter-1] = adc_pedsub;
THcSignalHit *sighit = (THcSignalHit*)fADCHits->ConstructedAt(nADCHits++);
sighit->Set(hit->fCounter, fA[hit->fCounter-1]);
fUsingFADC ?
fA_p[hit->fCounter-1] = fA[hit->fCounter-1] :
fA_p[hit->fCounter-1] = fA[hit->fCounter-1] - fPed[hit->fCounter -1];
fE[hit->fCounter-1] += fA_p[hit->fCounter-1] * fGain[hit->fCounter-1]; fE[hit->fCounter-1] += fA_p[hit->fCounter-1] * fGain[hit->fCounter-1];
} }
......
...@@ -98,7 +98,15 @@ protected: ...@@ -98,7 +98,15 @@ protected:
Double_t** fYPos; // block Y coordinates Double_t** fYPos; // block Y coordinates
Int_t fUsingFADC; // != 0 if using FADC in sample mode Int_t fUsingFADC; // != 0 if using FADC in sample mode
Int_t fPedSampLow; // Sample range for Int_t fADCMode; //
// 1 == Use the pulse int - pulse ped
// 2 == Use the sample integral - known ped
// 3 == Use the sample integral - sample ped
static const Int_t kADCStandard=0;
static const Int_t kADCDynamicPedestal=1;
static const Int_t kADCSampleIntegral=2;
static const Int_t kADCSampIntDynPed=3;
Int_t fPedSampLow; // Sample range for
Int_t fPedSampHigh; // dynamic pedestal Int_t fPedSampHigh; // dynamic pedestal
Int_t fDataSampLow; // Sample range for Int_t fDataSampLow; // Sample range for
Int_t fDataSampHigh; // sample integration Int_t fDataSampHigh; // sample integration
......
...@@ -362,8 +362,6 @@ Int_t THcShowerPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit) ...@@ -362,8 +362,6 @@ Int_t THcShowerPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
// Initialize variables. // Initialize variables.
Int_t nPosADCHits=0;
Int_t nNegADCHits=0;
fPosADCHits->Clear(); fPosADCHits->Clear();
fNegADCHits->Clear(); fNegADCHits->Clear();
...@@ -451,32 +449,45 @@ Int_t THcShowerPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit) ...@@ -451,32 +449,45 @@ Int_t THcShowerPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
++nrNegAdcHits; ++nrNegAdcHits;
} }
// Should probably check that counter # is in range fADCMode=kADCDynamicPedestal;
if (fUsingFADC) { Double_t adc_pos;
fA_Pos[hit->fCounter-1] = hit->GetRawAdcHitPos().GetData( Double_t adc_neg;
fPedSampLow, fPedSampHigh, fDataSampLow, fDataSampHigh Double_t adc_pos_pedsub;
); Double_t adc_neg_pedsub;
fA_Neg[hit->fCounter-1] = hit->GetRawAdcHitNeg().GetData( if(fADCMode == kADCDynamicPedestal) {
fPedSampLow, fPedSampHigh, fDataSampLow, fDataSampHigh adc_pos_pedsub = hit->GetRawAdcHitPos().GetPulseInt();
); adc_neg_pedsub = hit->GetRawAdcHitNeg().GetPulseInt();
} adc_pos = hit->GetRawAdcHitPos().GetPulseIntRaw();
else { adc_neg = hit->GetRawAdcHitNeg().GetPulseIntRaw();
fA_Pos[hit->fCounter-1] = hit->GetData(0); } else if (fADCMode == kADCSampleIntegral) {
fA_Neg[hit->fCounter-1] = hit->GetData(1); adc_pos_pedsub = hit->GetRawAdcHitPos().GetSampleIntRaw() - fPosPed[hit->fCounter -1];
} adc_neg_pedsub = hit->GetRawAdcHitNeg().GetSampleIntRaw() - fNegPed[hit->fCounter -1];
adc_pos = hit->GetRawAdcHitPos().GetSampleIntRaw();
adc_neg = hit->GetRawAdcHitNeg().GetSampleIntRaw();
} else if (fADCMode == kADCSampIntDynPed) {
adc_pos = hit->GetRawAdcHitPos().GetSampleInt();
adc_neg = hit->GetRawAdcHitNeg().GetSampleInt();
adc_pos_pedsub = hit->GetRawAdcHitPos().GetSampleIntRaw();
adc_neg_pedsub = hit->GetRawAdcHitNeg().GetSampleIntRaw();
} else {
adc_pos_pedsub = hit->GetRawAdcHitPos().GetPulseIntRaw()-fPosPed[hit->fCounter -1];
adc_neg_pedsub = hit->GetRawAdcHitNeg().GetPulseIntRaw()-fNegPed[hit->fCounter -1];
adc_pos = hit->GetRawAdcHitPos().GetPulseIntRaw();
adc_neg = hit->GetRawAdcHitNeg().GetPulseIntRaw();
}
//
// Sparsify positive side hits, fill the hit list, compute the // Sparsify positive side hits, fill the hit list, compute the
// energy depostion from positive side for the counter. // energy depostion from positive side for the counter.
fA_Pos[hit->fCounter-1] =adc_pos;
fA_Neg[hit->fCounter-1] =adc_neg;
Double_t thresh_pos = fPosThresh[hit->fCounter -1]; Double_t thresh_pos = fPosThresh[hit->fCounter -1];
thresh_pos =0;
if(fA_Pos[hit->fCounter-1] > thresh_pos) { if(fA_Pos[hit->fCounter-1] > thresh_pos) {
THcSignalHit *sighit = fA_Pos_p[hit->fCounter-1] =adc_pos_pedsub ;
(THcSignalHit*) fPosADCHits->ConstructedAt(nPosADCHits++);
sighit->Set(hit->fCounter, fA_Pos[hit->fCounter-1]);
fA_Pos_p[hit->fCounter-1] = fA_Pos[hit->fCounter-1] - fPosPed[hit->fCounter -1];
// cout << " pos " << hit->fCounter << " " << fA_Pos_p[hit->fCounter-1] << " " << fA_Pos[hit->fCounter-1] << " " << fPosPed[hit->fCounter -1] << "" << frNegAdcPulseAmp->ConstructedAt(nrNegAdcHits-1))->Get(padnum)<< endl;
fEpos[hit->fCounter-1] += fA_Pos_p[hit->fCounter-1]* fEpos[hit->fCounter-1] += fA_Pos_p[hit->fCounter-1]*
fParent->GetGain(hit->fCounter-1,fLayerNum-1,0); fParent->GetGain(hit->fCounter-1,fLayerNum-1,0);
} }
...@@ -485,13 +496,11 @@ Int_t THcShowerPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit) ...@@ -485,13 +496,11 @@ Int_t THcShowerPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
// energy depostion from negative side for the counter. // energy depostion from negative side for the counter.
Double_t thresh_neg = fNegThresh[hit->fCounter -1]; Double_t thresh_neg = fNegThresh[hit->fCounter -1];
thresh_neg=0;
if(fA_Neg[hit->fCounter-1] > thresh_neg) { if(fA_Neg[hit->fCounter-1] > thresh_neg) {
THcSignalHit *sighit =
(THcSignalHit*) fNegADCHits->ConstructedAt(nNegADCHits++);
sighit->Set(hit->fCounter, fA_Neg[hit->fCounter-1]);
fA_Neg_p[hit->fCounter-1] = fA_Neg[hit->fCounter-1] - fNegPed[hit->fCounter -1]; fA_Neg_p[hit->fCounter-1] =adc_neg_pedsub ;
fEneg[hit->fCounter-1] += fA_Neg_p[hit->fCounter-1]* fEneg[hit->fCounter-1] += fA_Neg_p[hit->fCounter-1]*
fParent->GetGain(hit->fCounter-1,fLayerNum-1,1); fParent->GetGain(hit->fCounter-1,fLayerNum-1,1);
......
...@@ -110,7 +110,15 @@ protected: ...@@ -110,7 +110,15 @@ protected:
// Flash ADC parameters // Flash ADC parameters
Int_t fUsingFADC; // != 0 if using FADC in sample mode Int_t fUsingFADC; // != 0 if using FADC in sample mode
Int_t fPedSampLow; // Sample range for Int_t fADCMode; //
// 1 == Use the pulse int - pulse ped
// 2 == Use the sample integral - known ped
// 3 == Use the sample integral - sample ped
static const Int_t kADCStandard=0;
static const Int_t kADCDynamicPedestal=1;
static const Int_t kADCSampleIntegral=2;
static const Int_t kADCSampIntDynPed=3;
Int_t fPedSampLow; // Sample range for
Int_t fPedSampHigh; // dynamic pedestal Int_t fPedSampHigh; // dynamic pedestal
Int_t fDataSampLow; // Sample range for Int_t fDataSampLow; // Sample range for
Int_t fDataSampHigh; // sample integration Int_t fDataSampHigh; // sample integration
......
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