Changeset 8565 for trunk/MagicSoft/Mars/mpedestal/MPedestalSubtract.cc
- Timestamp:
- 06/16/07 23:10:47 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mpedestal/MPedestalSubtract.cc
r8502 r8565 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1. 5 2007-05-14 09:53:15tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1.6 2007-06-16 22:05:27 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 129 129 } 130 130 131 void MPedestalSubtract::Memcpy(void *dest, Int_t offset, void *src, Int_t cnt) const 132 { 133 memcpy(dest+offset, src, cnt); 134 /* 135 if (fRawEvt->GetNumBytesPerSample()==2) 136 memcpy((UShort_t*)dest+offset, src, cnt*2); 137 else 138 { 139 const Byte_t *b = (Byte_t*)src+offset; 140 for (USample_t *ptr=(USample_t*)dest; ptr<(USample_t*)dest+cnt; ptr++) 141 *ptr = *b++; 142 } 143 */ 144 } 145 131 146 // -------------------------------------------------------------------------- 132 147 // … … 137 152 const Int_t numh = fRawEvt->GetNumHiGainSamples(); 138 153 const Int_t numl = fRawEvt->GetNumLoGainSamples(); 154 155 const UInt_t scale = fRawEvt->GetScale(); 139 156 140 157 // initialize fSignal … … 154 171 } 155 172 // Get pointer were to store merged raw data 156 Byte_t *sample = fSignal->GetSamplesRaw(pixidx);173 USample_t *sample = fSignal->GetSamplesRaw(pixidx); 157 174 158 175 // copy hi- and lo-gains samples together 159 memcpy(sample,pixel.GetHiGainSamples(), numh);160 memcpy(sample+numh, pixel.GetLoGainSamples(), numl);176 Memcpy(sample, 0, pixel.GetHiGainSamples(), numh); 177 Memcpy(sample, numh, pixel.GetLoGainSamples(), numl); 161 178 162 179 // start of destination array, end of hi-gain destination array … … 165 182 Float_t *end = beg + fSignal->GetNumSamples(); 166 183 167 const Byte_t *src = sample;184 const USample_t *src = sample; 168 185 169 186 // if no pedestals are given just convert the data into … … 172 189 { 173 190 while (beg<end) 174 *beg++ = *src ++;191 *beg++ = *src;//Float_t(*src++)/scale; 175 192 continue; 176 193 } … … 191 208 // FIXME: Shell we really subtract the pedestal from saturating slices??? 192 209 for (Float_t *ptr=beg; ptr<end; ptr++) 193 *ptr = (Float_t)*src++- mean[(ptr-beg)&1];210 *ptr = Float_t(*src++)/scale - mean[(ptr-beg)&1]; 194 211 } 195 212
Note:
See TracChangeset
for help on using the changeset viewer.