Skip to content
Snippets Groups Projects
Commit 43a133a2 authored by Mark K Jones's avatar Mark K Jones Committed by GitHub
Browse files

Merge pull request #165 from MarkKJones/shower

Modify ShowerPlane and ShowerArray ProcessHits Methods
parents b14cd4bf adbc3aec
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)
// Initialize variables.
Int_t nADCHits=0;
fADCHits->Clear();
frAdcPedRaw->Clear();
......@@ -709,35 +708,33 @@ Int_t THcShowerArray::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
++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
if (fUsingFADC) {
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);
}
fA[hit->fCounter-1] = adc;
threshold=hit->GetRawAdcHitPos().GetPedRaw()+100;
if(fA[hit->fCounter-1] > threshold) {
ngood++;
}
// 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]) {
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];
fA_p[hit->fCounter-1] = adc_pedsub;
fE[hit->fCounter-1] += fA_p[hit->fCounter-1] * fGain[hit->fCounter-1];
}
......
......@@ -98,7 +98,15 @@ protected:
Double_t** fYPos; // block Y coordinates
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 fDataSampLow; // Sample range for
Int_t fDataSampHigh; // sample integration
......
......@@ -362,8 +362,6 @@ Int_t THcShowerPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
// Initialize variables.
Int_t nPosADCHits=0;
Int_t nNegADCHits=0;
fPosADCHits->Clear();
fNegADCHits->Clear();
......@@ -451,32 +449,45 @@ Int_t THcShowerPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
++nrNegAdcHits;
}
// Should probably check that counter # is in range
if (fUsingFADC) {
fA_Pos[hit->fCounter-1] = hit->GetRawAdcHitPos().GetData(
fPedSampLow, fPedSampHigh, fDataSampLow, fDataSampHigh
);
fA_Neg[hit->fCounter-1] = hit->GetRawAdcHitNeg().GetData(
fPedSampLow, fPedSampHigh, fDataSampLow, fDataSampHigh
);
}
else {
fA_Pos[hit->fCounter-1] = hit->GetData(0);
fA_Neg[hit->fCounter-1] = hit->GetData(1);
}
fADCMode=kADCDynamicPedestal;
Double_t adc_pos;
Double_t adc_neg;
Double_t adc_pos_pedsub;
Double_t adc_neg_pedsub;
if(fADCMode == kADCDynamicPedestal) {
adc_pos_pedsub = hit->GetRawAdcHitPos().GetPulseInt();
adc_neg_pedsub = hit->GetRawAdcHitNeg().GetPulseInt();
adc_pos = hit->GetRawAdcHitPos().GetPulseIntRaw();
adc_neg = hit->GetRawAdcHitNeg().GetPulseIntRaw();
} else if (fADCMode == kADCSampleIntegral) {
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
// 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];
thresh_pos =0;
if(fA_Pos[hit->fCounter-1] > thresh_pos) {
THcSignalHit *sighit =
(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];
fA_Pos_p[hit->fCounter-1] =adc_pos_pedsub ;
// 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]*
fParent->GetGain(hit->fCounter-1,fLayerNum-1,0);
}
......@@ -485,13 +496,11 @@ Int_t THcShowerPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
// energy depostion from negative side for the counter.
Double_t thresh_neg = fNegThresh[hit->fCounter -1];
thresh_neg=0;
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]*
fParent->GetGain(hit->fCounter-1,fLayerNum-1,1);
......
......@@ -110,7 +110,15 @@ protected:
// Flash ADC parameters
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 fDataSampLow; // Sample range for
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