Changeset 7844 for trunk/MagicSoft
- Timestamp:
- 08/04/06 10:16:57 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7842 r7844 41 41 - allow to setup different password for differend users and different 42 42 users for different databases in sql.rc 43 44 * mcalib/MCalibrateRelTimes.cc: 45 - implemented a workaround to mark pixels bad for extraction of 46 hi- and lo-gain failed. (Before MCalibrateData just assigned 47 a weird value) 48 49 * msignal/MArrivalTimePix.h: 50 - added some member functions 51 52 * msignal/MExtractTimeAndCharge.cc: 53 - added some comments which contain future code 54 - invalidate hi- and lo-gain if both could not be extracted properly 55 (FIXME: We need a cut on the number of unsuitable pixels per event) 56 - changed handling of sathi to make the detection of hi-gain 57 saturation work properly 58 59 * msignal/MExtractTimeAndChargeDigitalFilter.cc: 60 - changed fgLoGainOffset from 1.05 to 0.95 (comming out of the 61 latest plots) 62 - fixed assignment of sat in hi-gain extraction to make sure 63 the the satuartion information can be returned properly 64 65 * msignal/MExtractTimeAndChargeSpline.cc: 66 - changed fgLoGainStartShift according to BCN cvs to -2.4 (FIXME 67 this should be checked!) 68 - adapted handling of sat in hi-gain extraction to changes 69 above 43 70 44 71 -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc
r7832 r7844 179 179 180 180 while (pixel.Next()) 181 { 181 { 182 // COPY HERE PRODUCING ARRAY WITH SAMPLES 183 184 /* 185 const MPedestalPix &ped = (*fPedestals)[pixidx]; 186 187 const Float_t pedes = ped.GetPedestal(); 188 const Float_t ABoffs = ped.GetPedestalABoffset(); 189 190 const Float_t pedmean[2] = { pedes + ABoffs, pedes - ABoffs }; 191 192 const Int_t num = pixel.GetNumHiGainSamples()+pixel.GetNumLoGainSamples(); 193 194 MArrayF sample(num); 195 196 const Int_t abflag = pixel.HasABFlag() ? 1 : 0; 197 const Int_t ids0 = fHiGainFirst + abflag; 198 199 Int_t ids = ids0; 200 201 Float_t null = 0; // Starting value for maxpos 202 Float_t *maxpos = &null; // Position of maximum 203 Float_t *sat1 = 0; // First saturating slice 204 Float_t *sat2 = 0; // Last saturating slice 205 206 const Float_t *beg = sample.GetArray(); 207 const Float_t *end = beg + num; 208 209 Float_t *ptr = beg; 210 while (ptr<end) 211 { 212 *sample++ = (Float_t)*ptr - pedmean[ids++&0x1]; 213 214 // This extraction must be done independant for lo- and hi-gain 215 // if (*ptr > *maxpos) 216 // maxpos = ptr; 217 // 218 // if (*ptr >= fSaturationLimit) 219 // { 220 // sat2 = ptr; 221 // if (!sat1) 222 // sat1 = ptr; 223 // } 224 // 225 // ptr++; 226 } 227 */ 228 182 229 // 183 230 // Find signal in hi- and lo-gain … … 210 257 // Adapt the low-gain extraction range from the obtained high-gain time 211 258 // 212 if (pixel.HasLoGain() && (fMaxBinContent > fLoGainSwitch) ) 259 260 // IN THIS CASE THE PIXEL SHOULD BE MARKED BAD!!!! 261 // MEANS: Hi gain has saturated, but it is too early to extract 262 // the lo-gain properly 263 // THIS produces pulse positions ~= -1 264 // The signal might be handled in MCalibrateData, but hwat's about 265 // the arrival times in MCalibrateRelTime 266 if (sathi && fMaxBinContent<=fLoGainSwitch) 267 deltasumlo=deltasumhi=deltatimelo=deltatimehi=-1; 268 269 // FIXME: What to do with the pixel if it saturates too early??? 270 if (pixel.HasLoGain() && (fMaxBinContent > fLoGainSwitch /*|| sathi>0*/) ) 213 271 { 214 272 deltasumlo = 0; // make logain of MExtractedSignalPix valid … … 217 275 fLoGainFirstSave = fLoGainFirst; 218 276 219 const Float_t pos = sathi==0 ? timehi : sathi; 277 // sathi is the number (not index!) of the first saturating slice 278 // 0 indicates that no saturation was found 279 // FIMXME: Is 3 an accurate value? 280 281 const Float_t pos = sathi==0 ? timehi : (int)(sathi)-3; 220 282 221 283 if (pos>-fLoGainStartShift) … … 225 287 fLoGainFirst = fLoGainFirstSave; 226 288 227 if ( 289 if (fLoGainFirst <= fLoGainLast-fWindowSizeLoGain) 228 290 { 229 291 const Bool_t logainabflag = (higainabflag + pixel.GetNumHiGainSamples()) & 0x1; -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
r7832 r7844 24 24 ! 25 25 \* ======================================================================== */ 26 26 27 ////////////////////////////////////////////////////////////////////////////// 27 28 // … … 88 89 const Int_t MExtractTimeAndChargeDigitalFilter::fgSignalStartBinHiGain = 4; 89 90 const Int_t MExtractTimeAndChargeDigitalFilter::fgSignalStartBinLoGain = 4; 90 const Float_t MExtractTimeAndChargeDigitalFilter::fgOffsetLoGain = 1.05;91 const Float_t MExtractTimeAndChargeDigitalFilter::fgOffsetLoGain = 0.95; 91 92 const Float_t MExtractTimeAndChargeDigitalFilter::fgLoGainStartShift = -1.8; 92 93 … … 329 330 const Byte_t *end = ptr + range; 330 331 Byte_t *p = ptr; 331 Byte_t maxpos = 0;332 332 333 333 // … … 352 352 if (*p > fMaxBinContent) 353 353 { 354 maxpos = p-ptr; 354 Byte_t maxpos = p-ptr; 355 356 // range-fWindowSizeHiGain+1 == fHiLoLast isn't it? 355 357 if (maxpos > 1 && maxpos < (range - fWindowSizeHiGain + 1)) 356 358 fMaxBinContent = *p; … … 359 361 if (*p++ >= fSaturationLimit) 360 362 if (!sat) 361 sat = ids- 3;363 sat = ids-fHiGainFirst; 362 364 } 363 365 … … 391 393 if (*logain++ >= fSaturationLimit) 392 394 if (!sat) 393 sat = ids- 3;395 sat = ids-fHiGainFirst; 394 396 } 395 397 } -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc
r7188 r7844 160 160 const Float_t MExtractTimeAndChargeSpline::fgLoGainStretch = 1.5; 161 161 const Float_t MExtractTimeAndChargeSpline::fgOffsetLoGain = 1.39; // 5 ns 162 const Float_t MExtractTimeAndChargeSpline::fgLoGainStartShift = - 1.8;162 const Float_t MExtractTimeAndChargeSpline::fgLoGainStartShift = -2.4; 163 163 164 164 // -------------------------------------------------------------------------- … … 404 404 if (*p++ >= fSaturationLimit) 405 405 if (!sat) 406 sat = ids- 3;406 sat = ids-fHiGainFirst; 407 407 408 408 } … … 426 426 if (*logain++ >= fSaturationLimit) 427 427 if (!sat) 428 sat = ids- 3;428 sat = ids-fHiGainFirst; 429 429 430 430 range++;
Note:
See TracChangeset
for help on using the changeset viewer.