Changeset 1557 for trunk/MagicSoft/Mars/manalysis/MCerPhotAnal.cc
- Timestamp:
- 10/29/02 13:58:25 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCerPhotAnal.cc
r1396 r1557 123 123 124 124 while (pixel.Next()) 125 125 { 126 126 Byte_t *ptr = pixel.GetHiGainSamples(); 127 127 const Byte_t *end = ptr + fRawEvt->GetNumHiGainSamples(); … … 134 134 Int_t slicelocal=0; 135 135 136 Float_t nphot;137 Float_t pedes, sigmaped; 138 139 do 140 { 141 sumlocal = 0; 142 for(Int_t i = 0; i<5;i++)143 sumlocal+=*(ptr+i); 144 if (sumpeak < sumlocal){ 145 slice=slicelocal;146 sumpeak = sumlocal; 147 } 148 136 do 137 { 138 sumlocal = 0; 139 for (Int_t i = 0; i<5;i++) 140 sumlocal += *(ptr+i); 141 142 if (sumpeak < sumlocal) 143 { 144 slice=slicelocal; 145 sumpeak = sumlocal; 146 } 147 148 slicelocal++; 149 149 sum += *ptr; 150 } 151 while (++ptr != limit); 152 153 do sum += *ptr; 154 while (++ptr != end); 155 156 pedes = (Float_t)(sum-sumpeak)/(fRawEvt->GetNumHiGainSamples()-5); 157 nphot=(Float_t)sumpeak - 5.0*pedes; 158 sigmaped=0; 159 sumlocal=0; 160 slicelocal=0; 150 } while (++ptr != limit); 151 152 do sum += *ptr; 153 while (++ptr != end); 154 155 Float_t pedes = (Float_t)(sum-sumpeak)/(fRawEvt->GetNumHiGainSamples()-5); 156 Float_t nphot = (Float_t)sumpeak - 5.0*pedes; 157 158 Float_t sigmaped=0; 159 160 slicelocal=0; 161 sumlocal = 0; 161 162 162 163 ptr = pixel.GetHiGainSamples(); 163 do { 164 if (slicelocal==slice) 165 ptr+=4; 166 else{ 167 sumlocal=*ptr; 168 sigmaped+=((Float_t)sumlocal-pedes)*((Float_t)sumlocal-pedes); 169 } 170 slicelocal++; 164 do 165 { 166 if (slicelocal==slice) 167 ptr += 4; 168 else 169 { 170 sumlocal = *ptr; 171 172 const Float_t d = (Float_t)sumlocal-pedes; 173 sigmaped += d*d; 174 } 175 slicelocal++; 171 176 } 172 while(++ptr != end); 173 sigmaped/=(fRawEvt->GetNumHiGainSamples()-5); 174 sigmaped=sqrt(sumlocal); 177 while (++ptr != end); 178 179 sigmaped /= (fRawEvt->GetNumHiGainSamples()-5); 180 sigmaped = sqrt(sumlocal); 175 181 176 182 const UInt_t pixid = pixel.GetPixelId(); … … 188 194 189 195 fCerPhotEvt->AddPixel(pixid, nphot, sigmaped/2.236); 190 ped.SetPedestal(pedes, sigmaped);196 ped.SetPedestal(pedes, sigmaped); 191 197 ped.SetPedestalRms(sigmaped/sqrt(fRawEvt->GetNumHiGainSamples()-5), 192 198 sigmaped/sqrt(2*(fRawEvt->GetNumHiGainSamples()-5)));
Note:
See TracChangeset
for help on using the changeset viewer.