- Timestamp:
- 12/11/03 13:58:40 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2637 r2640 4 4 5 5 -*-*- END OF LINE -*-*- 6 2003/12/11: Markus Gaug 7 * manalysis/MExtractSignal, MExtractedSignalPix 8 - Store number of used FADC slices (HIGain, LoGAin) 9 - calculate signal with only 6 most significant slices (2 before, 4 after the maximum) 10 11 6 12 2003/12/11: Thomas Bretz 7 13 -
trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc
r2631 r2640 57 57 // 58 58 MExtractSignal::MExtractSignal(const char *name, const char *title) 59 : fSaturationLimit(255), 60 fConversionHiLo(10.) 59 : fBefore(2), fAfter(4), fSaturationLimit(254), fConversionHiLo(10.) 61 60 { 62 61 … … 123 122 } 124 123 125 fNumHiGainSamples = fRunHeader->GetNumSamplesHiGain(); 126 fNumLoGainSamples = fRunHeader->GetNumSamplesLoGain(); 127 fSqrtHiGainSamples = TMath::Sqrt((float)fNumHiGainSamples); 128 fSqrtLoGainSamples = TMath::Sqrt((float)fNumLoGainSamples); 124 //fNumHiGainSamples = fRunHeader->GetNumSamplesHiGain(); 125 //fNumLoGainSamples = fRunHeader->GetNumSamplesLoGain(); 126 fNumHiGainSamples = fAfter+fBefore; 127 fNumLoGainSamples = fAfter+fBefore; 128 129 fSqrtHiGainSamples = TMath::Sqrt((float)fNumHiGainSamples); 130 fSqrtLoGainSamples = TMath::Sqrt((float)fNumLoGainSamples); 129 131 130 132 // … … 156 158 UShort_t satHi = 0; 157 159 UShort_t satLo = 0; 158 Float_t sum = 0.; 159 Float_t sumerr = 0.; 160 161 Byte_t *ptr = pixel.GetHiGainSamples(); 162 Byte_t *max = ptr + pixel.GetIdxMaxHiGainSample(); 163 Byte_t *end = ptr + fRawEvt->GetNumHiGainSamples(); 164 Byte_t *first; 165 Byte_t *last; 166 167 UInt_t sumHi = 0; 168 UInt_t sumLo = 0; 160 169 161 170 const Int_t pixid = pixel.GetPixelId(); … … 165 174 const Float_t pedes = ped.GetPedestal(); 166 175 const Float_t pedrms = ped.GetPedestalRms(); 176 177 if (max-3 < ptr) 178 { 179 first = ptr+3; 180 last = ptr+3+fAfter+fBefore; 181 } 182 else if (max+fAfter-1 > end) 183 { 184 first = end-fAfter-fBefore-1; 185 last = end-1; 186 } 187 else 188 { 189 first = max-fBefore; 190 last = max+fAfter; 191 } 192 193 for (ptr=first;ptr<last;ptr++) 194 { 195 sumHi += *ptr; 196 if (*ptr >= fSaturationLimit) 197 satHi++; 198 } 199 200 ptr = pixel.GetLoGainSamples(); 201 max = ptr+pixel.GetIdxMaxLoGainSample(); 202 end = ptr+fRawEvt->GetNumLoGainSamples(); 203 204 if (max-4 < ptr) 205 { 206 first = ptr+4; 207 last = ptr+4+fAfter+fBefore; 208 } 209 else if (max+fAfter > end) 210 { 211 first = end-fAfter-fBefore; 212 last = end; 213 } 214 else 215 { 216 first = max-fBefore; 217 last = max+fAfter; 218 } 219 220 for (ptr=first;ptr<last;ptr++) 221 { 222 sumLo += *ptr; 223 if (*ptr >= fSaturationLimit) 224 { 225 *fLog << err << dbginf 226 << "Warning: Saturation of Lo Gain reached in pixel: " 227 << pixid << " " << " sum = " << sumLo << endl; 228 satLo++; 229 } 230 } 167 231 168 232 // … … 171 235 // 172 236 173 UInt_t max = pixel.GetMaxHiGainSample(); 174 175 if (max <= fSaturationLimit) // take Hi Gain, no saturation 176 { 177 sum = (float)pixel.GetSumHiGainSamples() - pedes*fNumHiGainSamples; 178 sumerr = pedrms*fSqrtHiGainSamples; 179 } 180 else // Lo Gain 181 { 182 183 satHi++; 184 185 sum = (float)pixel.GetSumLoGainSamples() - pedes*fNumLoGainSamples ; 186 sum *= fConversionHiLo; 187 188 sumerr = pedrms*fSqrtLoGainSamples; 189 190 max = pixel.GetMaxLoGainSample(); 191 192 if (max > fSaturationLimit) 193 { 194 *fLog << err << dbginf 195 << "Warning: Saturation of Lo Gain reached in pixel: " 196 << pixid << " " << " sum = " << sum << endl; 197 satLo++; 198 } 199 200 } 201 202 pix.SetGainSaturation((satHi),(satHi),(satLo)); 203 pix.SetExtractedSignal(sum,sumerr); 237 pix.SetExtractedSignal((float)sumHi - pedes*(float)fNumHiGainSamples, 238 pedrms*fSqrtHiGainSamples, 239 ((float)sumLo - pedes*(float)fNumLoGainSamples)*fConversionHiLo, 240 pedrms*fSqrtLoGainSamples 241 ); 242 243 pix.SetGainSaturation((satHi),satHi,satLo); 204 244 205 245 } /* while (pixel.Next()) */ 206 246 247 248 fSignals->SetNumUsedFADCSlices(fNumHiGainSamples); 207 249 fSignals->SetReadyToSave(); 208 250 -
trunk/MagicSoft/Mars/manalysis/MExtractSignal.h
r2634 r2640 37 37 Float_t fSqrtLoGainSamples; 38 38 39 Byte_t fBefore; 40 Byte_t fAfter; 41 39 42 Byte_t fSaturationLimit; 40 43 Float_t fConversionHiLo; -
trunk/MagicSoft/Mars/manalysis/MExtractedSignalCam.cc
r2627 r2640 133 133 { 134 134 case 0: 135 val = (*this)[idx].GetExtractedSignal ();135 val = (*this)[idx].GetExtractedSignalHiGain(); 136 136 break; 137 137 case 1: 138 val = (*this)[idx].GetExtractedSignalError(); 138 val = (*this)[idx].GetExtractedSignalHiGainError(); 139 break; 140 case 2: 141 val = (*this)[idx].GetExtractedSignalLoGain(); 142 break; 143 case 3: 144 val = (*this)[idx].GetExtractedSignalLoGainError(); 139 145 break; 140 146 default: -
trunk/MagicSoft/Mars/manalysis/MExtractedSignalCam.h
r2627 r2640 16 16 TClonesArray *fArray; // FIXME: Change TClonesArray away from a pointer? 17 17 18 Byte_t fNumUsedHiGainFADCSlices; 19 Byte_t fNumUsedLoGainFADCSlices; 20 18 21 public: 19 22 … … 25 28 void InitSize(const UInt_t i); 26 29 Int_t GetSize() const; 30 31 Byte_t GetNumUsedFADCSlices() { return fNumUsedHiGainFADCSlices; } 32 Byte_t GetNumUsedHiGainFADCSlices() { return fNumUsedHiGainFADCSlices; } 33 Byte_t GetNumUsedLoGainFADCSlices() { return fNumUsedLoGainFADCSlices; } 34 SetNumUsedHiGainFADCSlices(Byte_t numh, Byte_t numl) 35 { 36 fNumUsedHiGainFADCSlices = numh; 37 fNumUsedLoGainFADCSlices = numl; 38 } 27 39 28 40 MExtractedSignalPix &operator[](Int_t i);
Note:
See TracChangeset
for help on using the changeset viewer.