// counters
int max = AliEMCALGeoParams::fgkSampleMin, min = AliEMCALGeoParams::fgkSampleMax; // min and max sample values
-
+ int nsamples = 0;
+
// for the pedestal calculation
int sampleSum = 0; // sum of samples
int squaredSampleSum = 0; // sum of samples squared
while (in->NextBunch()) {
const UShort_t *sig = in->GetSignals();
startBin = in->GetStartTimeBin();
+ nsamples += in->GetBunchLength();
for (i = 0; i < in->GetBunchLength(); i++) {
sample = sig[i];
time = startBin--;
} // loop over samples in bunch
} // loop over bunches
+ if (nsamples > 0) { // this check is needed for when we have zero-supp. on, but not sparse readout
+
// calculate pedesstal estimate: mean of possibly selected samples
if (nSum > 0) {
mean = sampleSum / (1.0 * nSum);
}
}//end if valid gain
-
+ } // nsamples>0 check, some data found for this channel; not only trailer/header
}// end while over channel
}//end while over DDL's, of input stream
// counters
int max = AliEMCALGeoParams::fgkSampleMin, min = AliEMCALGeoParams::fgkSampleMax; // min and max sample values
-
+ int nsamples = 0;
+
while (in->NextBunch()) {
const UShort_t *sig = in->GetSignals();
+ nsamples += in->GetBunchLength();
for (Int_t i = 0; i < in->GetBunchLength(); i++) {
sample = sig[i];
} // loop over samples in bunch
} // loop over bunches
+ if (nsamples > 0) { // this check is needed for when we have zero-supp. on, but not sparse readout
+
gain = -1; // init to not valid value
//If we're here then we're done with this tower
if ( in->IsLowGain() ) {
RefNum = GetRefNum(arrayPos, in->GetColumn(), gain);
LEDAmpVal[RefNum] = max - min;
} // end of LED ref
-
+
+ } // nsamples>0 check, some data found for this channel; not only trailer/header
} // end while over channel
}//end while over DDL's, of input stream
if(fSMInstalled[in.GetModule()]==kFALSE) continue;
+ // loop over samples
+ int nsamples = 0;
+ Int_t maxSample = 0;
+ while (in.NextBunch()) {
+ const UShort_t *sig = in.GetSignals();
+ nsamples += in.GetBunchLength();
+ for (Int_t i = 0; i < in.GetBunchLength(); i++) {
+ if (sig[i] > maxSample) maxSample = sig[i];
+ }
+ } // bunches
+
+ if (nsamples > 0) { // this check is needed for when we have zero-supp. on, but not sparse readout
+
// indices
Int_t mod = in.GetModule();
Int_t col = in.GetColumn();
sprintf(hname,"mod%d",mod);
fAmpProf[mod] = new TProfile(hname,hname,nEvtBins,0.,nEvtBins);
}
-
- // loop over samples
- Int_t maxSample = 0;
- while (in.NextBunch()) {
- const UShort_t *sig = in.GetSignals();
- for (Int_t i = 0; i < in.GetBunchLength(); i++) {
- if (sig[i] > maxSample) maxSample = sig[i];
- }
- } // bunches
-
+
//Fill histogram/profile
if(HighGainFlag) {
fAmpHisto[mod][col][row]->Fill(maxSample);
fAmpProf[mod]->Fill(evtbin, maxSample);
}
+
+ } // nsamples>0 check, some data found for this channel; not only trailer/header
+
} // channels
} // DDL's
while (in.NextDDL()) {
while (in.NextChannel()) {
- id = fGeom->GetAbsCellIdFromCellIndexes(in.GetModule(), in.GetRow(), in.GetColumn()) ;
- caloFlag = in.GetCaloFlag();
- lowGain = in.IsLowGain();
-
// There can be zero-suppression in the raw data,
// so set up the TGraph in advance
for (i=0; i < GetRawFormatTimeBins(); i++) {
}
Int_t maxTime = 0;
-
+ int nsamples = 0;
while (in.NextBunch()) {
const UShort_t *sig = in.GetSignals();
startBin = in.GetStartTimeBin();
AliWarning(Form("Invalid time bin %d",maxTime));
maxTime = GetRawFormatTimeBins();
}
-
+ nsamples += in.GetBunchLength();
for (i = 0; i < in.GetBunchLength(); i++) {
time = startBin--;
gSig->SetPoint(time, time, sig[i]) ;
}
} // loop over bunches
+ if (nsamples > 0) { // this check is needed for when we have zero-supp. on, but not sparse readout
+
+ id = fGeom->GetAbsCellIdFromCellIndexes(in.GetModule(), in.GetRow(), in.GetColumn()) ;
+ caloFlag = in.GetCaloFlag();
+ lowGain = in.IsLowGain();
+
gSig->Set(maxTime+1);
FitRaw(gSig, signalF, amp, time) ;
// Reset starting parameters for fit function
signalF->SetParameters(10.,0.,fTau,fOrder,5.); //reset all defaults just to be safe
+ } // nsamples>0 check, some data found for this channel; not only trailer/header
} // end while over channel
} //end while over DDL's, of input stream