39 #include "StSvtPedSub.h"
40 #include "StSequence.hh"
41 #include "StSvtClassLibrary/StSvtHybridData.hh"
42 #include "StSvtClassLibrary/StSvtHybridPed.hh"
43 #include "StSvtClassLibrary/StSvtHybridCollection.hh"
44 #include "StMessMgr.h"
58 int StSvtPedSub::SubtractPed(
StSvtHybridData* fData,
int Index,
int PedOffset)
62 int nAnodes, anodeID, nSeq, iseq, time, newAdc, status;
68 nAnodes = fData->getAnodeList(anodeList);
73 for (
int ianode=0;ianode<nAnodes;ianode++) {
75 anodeID = anodeList[ianode];
79 status = fData->getSequences(anodeID,nSeq,Seq);
80 for (iseq=0;iseq<nSeq;iseq++) {
81 for (time=0; time<Seq[iseq].length; time++) {
88 newAdc= (int)Seq[iseq].firstAdc[time]-
89 (
int) mPed->getPixelContent(anodeID,Seq[iseq].startTimeBin+time)
93 if( newAdc < 0) newAdc=0;
94 else if( newAdc >= 256) newAdc=255;
95 Seq[iseq].firstAdc[time]= newAdc;