Changeset 4896 for trunk/MagicSoft/Mars/msignal
- Timestamp:
- 09/09/04 16:55:42 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/msignal
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.cc
r4771 r4896 260 260 } 261 261 262 const Int_t firstdesired = (Int_t)fHiGainFirst; 263 Int_t lastavailable = (Int_t)fRunHeader->GetNumSamplesHiGain()-1; 264 265 if (firstdesired > lastavailable) 266 { 267 const Int_t diff = firstdesired - lastavailable; 268 *fLog << endl; 269 *fLog << warn << "First Hi Gain slice " << (int)fHiGainFirst << " out of range [0,"; 270 *fLog << lastavailable << "]... start at slice " << diff << " of the Lo Gain " << endl; 271 272 fHiLoFirst = diff; 273 } 274 275 const Int_t lastdesired = (Int_t)fHiGainLast; 276 262 const Int_t higainsamples = fRunHeader->GetNumSamplesHiGain(); 263 const Int_t logainsamples = fRunHeader->GetNumSamplesLoGain(); 264 Int_t lastavailable = higainsamples-1; 265 266 if (logainsamples) 267 { 268 // 269 // If the signal is searched entirely in the low-gain range, have 270 // to skip the higain completely. This is steered by the variable fHiLoFirst 271 // 272 const Int_t firstdesired = (Int_t)fHiGainFirst; 273 274 if (firstdesired > lastavailable) 275 { 276 const Int_t diff = firstdesired - lastavailable; 277 *fLog << endl; 278 *fLog << warn << "First Hi Gain slice " << (int)fHiGainFirst << " out of range [0,"; 279 *fLog << lastavailable << "]... start at slice " << diff << " of the Lo Gain " << endl; 280 281 fHiLoFirst = diff; 282 } 283 } 284 285 const Int_t lastdesired = (Int_t)fHiGainLast; 286 277 287 if (lastdesired > lastavailable) 278 288 { 279 Int_t diff = lastdesired - lastavailable;280 lastavailable += (Int_t)fRunHeader->GetNumSamplesLoGain()-1;289 Int_t diff = lastdesired - lastavailable; 290 lastavailable += logainsamples ? logainsamples-1 : 0; 281 291 282 292 if (lastdesired > lastavailable) … … 285 295 *fLog << "Last Hi Gain slice " << (int)fHiGainLast << " out of range [0,"; 286 296 *fLog << lastavailable << "]... reduce upper limit by " << diff << endl; 287 diff = (Int_t)fRunHeader->GetNumSamplesLoGain();288 } 289 290 fHiGainLast = (Int_t)fRunHeader->GetNumSamplesHiGain()- 1;291 fHiLoLast = diff;297 diff = logainsamples; 298 } 299 300 fHiGainLast = higainsamples - 1; 301 fHiLoLast = logainsamples ? diff : 0; 292 302 } 293 303 … … 669 679 670 680 sum = 0; 671 FindSignalFilter(pixel.GetLoGainSamples(), sum, sat); 681 if (pixel.HasLoGain()) 682 FindSignalFilter(pixel.GetLoGainSamples(), sum, sat); 672 683 673 684 /* -
trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc
r4766 r4896 99 99 100 100 const Byte_t windowhi = hilast-hifirst+1; 101 const Byte_t windowlo = lolast-lofirst+1;102 103 101 const Byte_t whieven = windowhi & ~1; 104 const Byte_t wloeven = windowlo & ~1;105 102 106 103 if (whieven != windowhi) … … 112 109 } 113 110 114 if (wloeven != windowlo)115 {116 *fLog << warn << GetDescriptor()117 << Form("%s%2i%s%2i",": Lo Gain window size has to be even, set last slice from "118 ,(int)lolast," to ",(int)(lolast-1)) << endl;119 lolast -= 1;120 }121 122 111 if (whieven<2) 123 112 { … … 128 117 } 129 118 130 if (wloeven<2) 131 { 132 *fLog << warn << GetDescriptor() 119 120 if (lolast != 0) 121 { 122 const Byte_t windowlo = lolast-lofirst+1; 123 const Byte_t wloeven = windowlo & ~1; 124 125 if (wloeven != windowlo) 126 { 127 *fLog << warn << GetDescriptor() 128 << Form("%s%2i%s%2i",": Lo Gain window size has to be even, set last slice from " 129 ,(int)lolast," to ",(int)(lolast-1)) << endl; 130 lolast -= 1; 131 } 132 133 if (wloeven<2) 134 { 135 *fLog << warn << GetDescriptor() 133 136 << Form("%s%2i%s%2i",": Lo Gain window is smaller than 2 FADC sampes, set last slice from" 134 137 ,(int)lolast," to ",(int)(lofirst+1)) << endl; 135 lolast = lofirst+1;136 }137 138 lolast = lofirst+1; 139 } 140 } 138 141 139 142 MExtractor::SetRange(hifirst,hilast,lofirst,lolast); 140 143 141 144 fNumHiGainSamples = (Float_t)(fHiGainLast-fHiGainFirst+1); 142 fNumLoGainSamples = (Float_t)(fLoGainLast-fLoGainFirst+1); 145 if (fLoGainLast != 0) 146 fNumLoGainSamples = (Float_t)(fLoGainLast-fLoGainFirst+1); 147 else 148 fNumLoGainSamples = 0.; 143 149 144 150 fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples); … … 166 172 *fLog << inf << GetDescriptor() << ": Taking " << fNumHiGainSamples 167 173 << " HiGain samples from slice " << (Int_t)fHiGainFirst 168 << " to " << (Int_t)(fHiGainLast+fHiLoLast) << " incl" << endl;174 << " to " << (Int_t)(fHiGainLast+fHiLoLast) << " incl" << endl; 169 175 *fLog << inf << GetDescriptor() << ": Taking " << fNumLoGainSamples 170 176 << " LoGain samples from slice " << (Int_t)fLoGainFirst 171 << " to " << (Int_t)fLoGainLast << " incl" << endl;177 << " to " << (Int_t)fLoGainLast << " incl" << endl; 172 178 return kTRUE; 173 179 -
trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.h
r4723 r4896 27 27 28 28 Bool_t ReInit(MParList *pList); 29 29 30 30 public: 31 31 -
trunk/MagicSoft/Mars/msignal/MExtractPINDiode.cc
r3962 r4896 128 128 MExtractor::SetRange(hifirst,hilast,lofirst,lolast); 129 129 130 131 130 fNumHiGainSamples = (Float_t)(fHiGainLast-fHiGainFirst+1); 132 fNumLoGainSamples = ( Float_t)(fLoGainLast-fLoGainFirst+1);131 fNumLoGainSamples = (fLoGainLast == 0) ? 0. : (Float_t)(fLoGainLast-fLoGainFirst+1); 133 132 134 133 fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples); 135 134 fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples); 136 135 137 fNumSamples = fHiGainLast-fHiGainFirst+1+fLoGainLast-fLoGainFirst+1; 136 fNumSamples = (fLoGainLast == 0) 137 ? fHiGainLast-fHiGainFirst+1 138 : fHiGainLast-fHiGainFirst+1+fLoGainLast-fLoGainFirst+1; 138 139 fSqrtSamples = TMath::Sqrt((Float_t)fNumSamples); 139 140 … … 260 261 261 262 FindSignalandVarianceHiGain(pixel.GetHiGainSamples()+fHiGainFirst,sum,sum2,sat); 262 FindSignalandVarianceLoGain(pixel.GetLoGainSamples()+fLoGainFirst,sum,sum2,sat); 263 if (pixel.HasLoGain()) 264 FindSignalandVarianceLoGain(pixel.GetLoGainSamples()+fLoGainFirst,sum,sum2,sat); 263 265 264 266 const Float_t var = ((Float_t)sum2 - (Float_t)sum*sum/fNumSamples)/(fNumSamples-1); -
trunk/MagicSoft/Mars/msignal/MExtractTimeHighestIntegral.cc
r4732 r4896 79 79 MExtractor::SetRange(hifirst,hilast,lofirst,lolast); 80 80 81 82 81 Int_t range = fHiGainLast - fHiGainFirst + 1; 83 82 … … 92 91 } 93 92 94 range = fLoGainLast - fLoGainFirst + 1; 95 96 if (range < 2) 97 { 98 *fLog << warn << GetDescriptor() 99 << Form("%s%2i%s%2i%s",": Lo-Gain Extraction range [",(int)fLoGainFirst,"," 100 ,fLoGainLast,"] too small, ") << endl; 101 *fLog << warn << GetDescriptor() 102 << " will move logher limit to obtain 4 slices " << endl; 103 SetRange(fHiGainFirst, fHiGainLast,fLoGainFirst,fLoGainLast+4-range); 104 } 105 93 if (fLoGainLast != 0) 94 { 95 range = fLoGainLast - fLoGainFirst + 1; 96 97 if (range < 2) 98 { 99 *fLog << warn << GetDescriptor() 100 << Form("%s%2i%s%2i%s",": Lo-Gain Extraction range [",(int)fLoGainFirst,"," 101 ,fLoGainLast,"] too small, ") << endl; 102 *fLog << warn << GetDescriptor() 103 << " will move lower limit to obtain 4 slices " << endl; 104 SetRange(fHiGainFirst, fHiGainLast,fLoGainFirst,fLoGainLast+4-range); 105 } 106 } 106 107 107 108 SetWindowSize(fHiGainWindowSize,fLoGainWindowSize); 108 109 109 110 fNumHiGainSamples = fHiGainLast-fHiGainFirst+1; 110 fNumLoGainSamples = fLoGainLast -fLoGainFirst+1;111 fNumLoGainSamples = fLoGainLast ? fLoGainLast-fLoGainFirst+1 : 0; 111 112 112 113 } -
trunk/MagicSoft/Mars/msignal/MExtractor.cc
r4723 r4896 191 191 Bool_t MExtractor::ReInit(MParList *pList) 192 192 { 193 Int_t lastdesired = (Int_t)(fLoGainLast); 194 Int_t lastavailable = (Int_t)fRunHeader->GetNumSamplesLoGain()-1; 195 196 if (lastavailable < 0) 193 194 const Int_t logainsamples = fRunHeader->GetNumSamplesLoGain(); 195 196 Int_t lastdesired; 197 Int_t lastavailable; 198 199 if (logainsamples) 200 { 201 202 lastdesired = (Int_t)(fLoGainLast); 203 lastavailable = logainsamples-1; 204 205 if (lastavailable < 0) 197 206 *fLog << warn << GetDescriptor() << " - WARNING: Number of available Low-Gain Slices is smaller than or equal zero!" << endl; 198 207 199 208 if (lastdesired > lastavailable) 200 {209 { 201 210 const Int_t diff = lastdesired - lastavailable; 202 211 203 212 *fLog << endl; 204 213 *fLog << warn << GetDescriptor() << ": Selected Lo Gain FADC Window ["; … … 207 216 *fLog << GetDescriptor() << ": Will reduce the upper edge to " << (int)(fLoGainLast - diff) << endl; 208 217 SetRange(fHiGainFirst, fHiGainLast, fLoGainFirst, fLoGainLast-diff); 209 } 210 211 lastdesired = (Int_t)fHiGainLast; 212 lastavailable = (Int_t)fRunHeader->GetNumSamplesHiGain()-1; 213 214 if (lastavailable < 0) 215 { 216 *fLog << err << GetDescriptor(); 217 *fLog << " - ERROR: Number of available High-Gain Slices is smaller than or equal zero!" << endl; 218 return kFALSE; 219 } 220 218 } 219 } 220 else 221 SetRange(fHiGainFirst, fHiGainLast, 0,0); 222 223 const Int_t higainsamples = fRunHeader->GetNumSamplesHiGain(); 224 225 if (higainsamples <= 0) 226 { 227 *fLog << err << GetDescriptor(); 228 *fLog << " - ERROR: Number of available High-Gain Slices is smaller than or equal zero!" << endl; 229 return kFALSE; 230 } 231 232 lastdesired = (Int_t)fHiGainLast; 233 lastavailable = higainsamples-1; 234 221 235 if (lastdesired > lastavailable) 222 {236 { 223 237 const Int_t diff = lastdesired - lastavailable; 224 238 225 239 *fLog << endl; 226 240 *fLog << warn << GetDescriptor() << ": Selected Hi Gain FADC Window ["; … … 230 244 *fLog << Form("%2i", diff) << " samples from the Low-Gain for the High-Gain extraction"; 231 245 *fLog << endl; 232 246 233 247 fHiGainLast -= diff; 234 248 fHiLoLast = diff; 235 }236 249 } 250 237 251 return kTRUE; 238 252 }
Note:
See TracChangeset
for help on using the changeset viewer.