Changeset 3925
- Timestamp:
- 05/01/04 12:34:15 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3924 r3925 31 31 the "low-gain" slices instead. This is necessary for the March 32 32 data! 33 34 * mjobs/MJCalibration.[h,cc] 35 - accept arrival time extractors deriving from MTimeExtractor 33 36 34 37 -
trunk/MagicSoft/Mars/macros/calibration.C
r3913 r3925 57 57 static const TString inpath = "/mnt/Data/rootdata/Miscellaneous/2004_03_03/"; 58 58 static const Int_t pedrun = 20123; 59 static const Int_t calrun1 = 2012 6;59 static const Int_t calrun1 = 20125; 60 60 static const Int_t calrun2 = 0; 61 61 … … 63 63 { 64 64 65 66 // 67 // Choose the signal Extractor: 68 // 65 69 MExtractFixedWindowPeakSearch extractor; 66 // extractor.SetRange(0,14,0,14); 70 // MExtractSlidingWindow extractor; 71 // MExtractFixedWindow extractor; 67 72 68 // MExtractSlidingWindow extractor; 69 // MExtractFixedWindow extractor; 73 // 74 // Set Ranges or Windows 75 // 76 // extractor.SetRange(2,14,5,14); 77 // extractor.SetWindows(8,8); 70 78 79 // 80 // Choose the arrival time Extractor: 81 // 71 82 MExtractTimeHighestIntegral timeext; 83 // MExtractTimeSpline timeext; 84 // 85 // Set Ranges or Windows 86 // 87 // timeext.SetRange(0,14,6,14); 72 88 73 // MExtractTimeSpline timeext; 74 // timeext.SetRange(0,14,6,14); 89 // 90 // Tell if you want to calibrate times: 91 // 92 Bool_t useTimes = kTRUE; 93 // Bool_t calibrateTimes = kFALSE; 75 94 76 95 MRunIter pruns; … … 103 122 // an ascii-file with the corr. pixel numbers (see MBadPixelsCam) 104 123 // 105 //badcam.AsciiRead("badpixels.dat");124 badcam.AsciiRead("badpixels.dat"); 106 125 107 126 MJPedestal pedloop; … … 133 152 // If you want to calibrate the times as well, choose: 134 153 // 135 calloop.SetRelTimeCalibration( );154 calloop.SetRelTimeCalibration(useTimes); 136 155 calloop.SetExtractor(&extractor); 137 156 calloop.SetTimeExtractor(&timeext); … … 162 181 testloop.SetDisplay(display); 163 182 testloop.SetBadPixels(calloop.GetBadPixels()); 164 if (!testloop.ProcessD(pedloop.GetPedestalCam(),calloop.GetCalibrationCam(),calloop.GetQECam())) 165 return; 166 183 testloop.ProcessD(pedloop.GetPedestalCam(),calloop.GetCalibrationCam(),calloop.GetQECam()); 184 167 185 } 168 186 -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r3913 r3925 113 113 #include "MHCalibrationRelTimeCam.h" 114 114 #include "MCalibrationRelTimeCam.h" 115 #include "MCalibrationRelTimeCalc.h" 115 116 116 117 #include "MReadMarsFile.h" … … 775 776 // 13) MCalibrationChargeCalc 776 777 // 14) MFillH("MHCalibrationRelTimeCam", "MArrivalTimeCam") (only if flag fRelTimes is chosen) 778 // 15) MCalibrationRelTimeCalc 777 779 // - Execute MEvtLoop 778 780 // - DisplayResult() … … 841 843 MExtractTimeSpline timespline; 842 844 MCalibrationChargeCalc calcalc; 845 MCalibrationRelTimeCalc timecalc; 843 846 844 847 // … … 902 905 903 906 if (fRelTimes) 904 tlist.AddToList(&filltme); 907 { 908 tlist.AddToList(&filltme); 909 tlist.AddToList(&timecalc); 910 } 911 905 912 906 913 // Create and setup the eventloop -
trunk/MagicSoft/Mars/msignal/MExtractFixedWindowPeakSearch.cc
r3887 r3925 16 16 ! 17 17 ! 18 ! Author(s): Abelardo Moralejo, 19 ! Markus Gaug , 18 ! Author(s): Abelardo Moralejo,04/2004 <mailto:moralejo@pd.infn.it> 19 ! Markus Gaug ,04/2004 <mailto:markus@ifae.es> 20 20 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! … … 75 75 using namespace std; 76 76 77 const Byte_t MExtractFixedWindowPeakSearch::fgHiGainWindowSize = 6;78 const Byte_t MExtractFixedWindowPeakSearch::fgLoGainWindowSize = 6;79 const Byte_t MExtractFixedWindowPeakSearch::fgPeakSearchWindowSize = 4;80 77 const Byte_t MExtractFixedWindowPeakSearch::fgHiGainFirst = 0; 81 78 const Byte_t MExtractFixedWindowPeakSearch::fgHiGainLast = 14; 82 79 const Byte_t MExtractFixedWindowPeakSearch::fgLoGainFirst = 3; 83 80 const Byte_t MExtractFixedWindowPeakSearch::fgLoGainLast = 14; 81 const Byte_t MExtractFixedWindowPeakSearch::fgHiGainWindowSize = 6; 82 const Byte_t MExtractFixedWindowPeakSearch::fgLoGainWindowSize = 6; 83 const Byte_t MExtractFixedWindowPeakSearch::fgPeakSearchWindowSize = 4; 84 const Byte_t MExtractFixedWindowPeakSearch::fgOffsetFromPeak = 2; 84 85 // -------------------------------------------------------------------------- 85 86 // … … 92 93 // 93 94 // Calls: 95 // - SetOffsetFromPeak() 94 96 // - SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast) 95 97 // … … 103 105 fTitle = title ? title : "Task to extract the signal from the FADC slices"; 104 106 107 SetOffsetFromPeak(); 105 108 SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast); 106 109 } … … 171 174 } 172 175 176 173 177 if (fWindowSizeLoGain > availlorange) 174 178 { … … 200 204 } 201 205 202 203 206 fNumHiGainSamples = (Float_t)fWindowSizeHiGain; 204 207 fNumLoGainSamples = (Float_t)fWindowSizeLoGain; … … 271 274 // - If *ptr is greater than fSaturationLimit, raise sat by 1 272 275 // 273 void MExtractFixedWindowPeakSearch::FindSignalHiGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const 274 { 276 void MExtractFixedWindowPeakSearch::FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &sum, Byte_t &sat) const 277 { 278 279 Byte_t *end = ptr + fWindowSizeHiGain-fHiLoLast; 280 275 281 // 276 282 // Calculate the sum of the "window" slices starting in ptr 277 283 // 278 sum = 0; 279 sat = 0; 280 Byte_t *p = ptr; 281 282 while (p<ptr+fWindowSizeHiGain) 283 { 284 while (ptr<end) 285 { 286 sum += *ptr; 287 if (*ptr++ >= fSaturationLimit) 288 sat++; 289 } 290 291 // 292 // If part of the "low-Gain" slices are used, 293 // repeat steps one and two for the logain part until fHiLoLast 294 // 295 Byte_t *p = logain; 296 end = logain + fHiLoLast; 297 while (p<end) 298 { 299 284 300 sum += *p; 285 301 if (*p++ >= fSaturationLimit) 286 302 sat++; 287 303 } 288 304 … … 323 339 // "startslice" will mark the slice at which the highest sum begins for that pixel. 324 340 // Then define the beginning of the integration window for ALL pixels as the slice 325 // before that: startslice- 1 (this is somehow arbitrary), unless of course startslice=0,341 // before that: startslice-fOffsetFraomPeak, unless of course startslice-fOffsetFromPeak<=0, 326 342 // in which case we start at 0. We will also check that the integration window does not 327 343 // go beyond the FADC limits. … … 348 364 { 349 365 maxsumhi = sumhi; 350 if ( startslice> 0)351 hiGainFirst = fHiGainFirst + startslice - 1;366 if ((startslice-fOffsetFromPeak) > 0) 367 hiGainFirst = fHiGainFirst + startslice - fOffsetFromPeak; 352 368 else 353 369 hiGainFirst = fHiGainFirst; … … 360 376 // Make sure we will not integrate beyond the hi gain limit: 361 377 if (hiGainFirst+fWindowSizeHiGain > pixel.GetNumHiGainSamples()) 362 hiGainFirst = pixel.GetNumHiGainSamples()-fWindowSizeHiGain; 378 fHiLoLast = hiGainFirst+fWindowSizeHiGain - pixel.GetNumHiGainSamples(); 379 // hiGainFirst = pixel.GetNumHiGainSamples()-fWindowSizeHiGain; 363 380 364 381 // Make sure we will not integrate beyond the lo gain limit: … … 375 392 // Find signal in hi- and lo-gain 376 393 // 377 Int_t sumhi ;378 Byte_t sathi ;379 380 FindSignalHiGain(pixel.GetHiGainSamples()+hiGainFirst, sumhi, sathi);394 Int_t sumhi=0; 395 Byte_t sathi=0; 396 397 FindSignalHiGain(pixel.GetHiGainSamples()+hiGainFirst, pixel.GetLoGainSamples(), sumhi, sathi); 381 398 382 399 Int_t sumlo=0; -
trunk/MagicSoft/Mars/msignal/MExtractFixedWindowPeakSearch.h
r3887 r3925 14 14 static const Byte_t fgLoGainFirst; 15 15 static const Byte_t fgLoGainLast; 16 static const Byte_t fgHiGainWindowSize; // The extraction window Hi-Gain 17 static const Byte_t fgLoGainWindowSize; // The extraction window Lo-Gain 18 static const Byte_t fgPeakSearchWindowSize; // The window in which the global peak is searched for 19 16 static const Byte_t fgHiGainWindowSize; // Default for fWindowSizeHiGain (now set to: 6) 17 static const Byte_t fgLoGainWindowSize; // Default for fWindowSizeLoGain (now set to: 6) 18 static const Byte_t fgPeakSearchWindowSize; // Default for fPeakSearchWindowSize (now set to: 4) 19 static const Byte_t fgOffsetFromPeak; // Default for fOffsetFromPeak (now set to: 2) 20 20 21 Byte_t fWindowSizeHiGain; // Number of Hi Gain slices in window 21 22 Byte_t fWindowSizeLoGain; // Number of Lo Gain slices in window 22 23 Byte_t fPeakSearchWindowSize; // Size of FADC window in the search for the highest peak of all pixels. 24 Byte_t fOffsetFromPeak; // Number of slices to start extraction from global peak 23 25 24 25 void FindSignalHiGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const; 26 void FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &sum, Byte_t &sat) const; 26 27 void FindSignalLoGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const; 27 28 … … 29 30 30 31 Int_t Process(); 31 32 32 33 public: 33 34 … … 37 38 void SetWindows(Byte_t windowh=fgHiGainWindowSize, Byte_t windowl=fgLoGainWindowSize, 38 39 Byte_t peaksearchwindow=fgPeakSearchWindowSize); 39 40 void SetOffsetFromPeak(Byte_t offset=fgOffsetFromPeak) { fOffsetFromPeak = offset; } 41 40 42 ClassDef(MExtractFixedWindowPeakSearch, 0) // Signal Extractor for fixed size trigger-corrected extraction window 41 43 }; -
trunk/MagicSoft/Mars/msignal/MExtractPINDiode.cc
r3911 r3925 129 129 MExtractor::SetRange(hifirst,hilast,lofirst,lolast); 130 130 131 132 fNumHiGainSamples = (Float_t)(fHiGainLast-fHiGainFirst+1); 133 fNumLoGainSamples = (Float_t)(fLoGainLast-fLoGainFirst+1); 134 135 fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples); 136 fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples); 137 131 138 fNumSamples = fHiGainLast-fHiGainFirst+1+fLoGainLast-fLoGainFirst+1; 132 139 fSqrtSamples = TMath::Sqrt((Float_t)fNumSamples); -
trunk/MagicSoft/Mars/msignal/MExtractSlidingWindow.cc
r3886 r3925 194 194 // - Check if the sum has become bigger and store it in case yes. 195 195 // 196 void MExtractSlidingWindow::FindSignalHiGain(Byte_t *ptr, Int_t &max, Byte_t &sat) const196 void MExtractSlidingWindow::FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &max, Byte_t &sat) const 197 197 { 198 198 const Byte_t *end = ptr + fHiGainLast - fHiGainFirst + 1; … … 205 205 sat = 0; 206 206 Byte_t *p = ptr; 207 while (p<ptr+fWindowSizeHiGain) 207 208 while (p<ptr+fWindowSizeHiGain-fHiLoLast) 208 209 { 209 210 sum += *p; … … 218 219 if (*p++ >= fSaturationLimit) 219 220 sat++; 221 222 // 223 // If part of the "low-Gain" slices are used, 224 // repeat steps one and two for the logain part until fHiLoLast 225 // 226 Byte_t *l = logain; 227 while (l<logain+fHiLoLast) 228 { 229 sum += *l; 230 if (*l++ >= fSaturationLimit) 231 sat++; 232 } 233 220 234 221 235 // … … 225 239 // 226 240 max=sum; 227 for (p=ptr; p+fWindowSizeHiGain <end; p++)228 { 229 sum += *(p+fWindowSizeHiGain ) - *p;241 for (p=ptr; p+fWindowSizeHiGain-fHiLoLast<end; p++) 242 { 243 sum += *(p+fWindowSizeHiGain-fHiLoLast) - *p; 230 244 if (sum>max) 231 245 max = sum; 232 246 } 247 248 for (l=logain; l<logain+fHiLoLast; l++) 249 { 250 sum += *l - *p++; 251 if (sum>max) 252 max = sum; 253 } 254 233 255 } 234 256
Note:
See TracChangeset
for help on using the changeset viewer.