Changeset 3924
- Timestamp:
- 05/01/04 12:28:43 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3923 r3924 22 22 * macros/dohtml.C 23 23 - include directory mpedestal 24 25 * msignal/MExtractFixedWindow.[h,cc] 26 * msignal/MExtractSlidingWindow.[h,cc] 27 * msignal/MExtractFixedWindowPeakSearch.[h,cc] 28 * msignal/MExtractor.[h,cc] 29 - include the possibility to set the range for the hi-gain outside 30 the range of MRawEvtPixelIter::GetNumHiGainSamples() and to take 31 the "low-gain" slices instead. This is necessary for the March 32 data! 24 33 25 34 -
trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc
r3884 r3924 61 61 // Default constructor. 62 62 // 63 // Calls:64 // - SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast)65 //66 63 MExtractFixedWindow::MExtractFixedWindow(const char *name, const char *title) 67 64 { 68 65 fName = name ? name : "MExtractFixedWindow"; 69 66 fTitle = title ? title : "Signal Extractor for a fixed FADC window"; 70 71 67 72 68 SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast); … … 154 150 // - If *ptr is greater than fSaturationLimit, raise sat by 1 155 151 // 156 void MExtractFixedWindow::FindSignalHiGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const152 void MExtractFixedWindow::FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &sum, Byte_t &sat) const 157 153 { 158 154 … … 169 165 sat++; 170 166 } 167 168 if (fHiLoLast == 0) 169 return; 170 171 end = logain + fHiLoLast; 172 while (logain<end) 173 { 174 sum += *logain; 175 176 if (*logain++ >= fSaturationLimit) 177 sat++; 178 } 179 171 180 } 172 181 -
trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.h
r3883 r3924 22 22 static const Byte_t fgLoGainLast; // Last FADC slice Lo-Gain (currently set to: 14) 23 23 24 void FindSignalHiGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const;24 void FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &sum, Byte_t &sat) const; 25 25 void FindSignalLoGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const; 26 26 -
trunk/MagicSoft/Mars/msignal/MExtractSlidingWindow.h
r3883 r3924 20 20 Byte_t fWindowSizeLoGain; // Number of Lo Gain slices in window 21 21 22 void FindSignalHiGain(Byte_t *ptr, Int_t &max, Byte_t &sat) const;22 void FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &max, Byte_t &sat) const; 23 23 void FindSignalLoGain(Byte_t *ptr, Int_t &max, Byte_t &sat) const; 24 24 -
trunk/MagicSoft/Mars/msignal/MExtractor.cc
r3893 r3924 85 85 MExtractor::MExtractor(const char *name, const char *title) 86 86 : fPedestals(NULL), fSignals(NULL), fRawEvt(NULL), fRunHeader(NULL), 87 fNumHiGainSamples(0.), fNumLoGainSamples(0.), fSaturationLimit(fgSaturationLimit) 87 fHiLoLast(0), fNumHiGainSamples(0.), fNumLoGainSamples(0.), 88 fSaturationLimit(fgSaturationLimit) 88 89 { 89 90 … … 158 159 // - MRawRunHeader::GetNumSamplesLoGain() 159 160 // 160 // In case that the variable s fHiGainLast and fLoGainLast aresmaller than161 // In case that the variable fLoGainLast is smaller than 161 162 // the even part of the number of samples obtained from the run header, a 162 163 // warning is given an the range is set back accordingly. A call to: 163 // - SetRange(fHiGainFirst, fHiGainLast-diff, fLoGainFirst, fLoGainLast) or164 164 // - SetRange(fHiGainFirst, fHiGainLast, fLoGainFirst, fLoGainLast-diff) 165 165 // is performed in that case. The variable diff means here the difference 166 // between the requested range (f HiGainLast) and the available one. Note that166 // between the requested range (fLoGainLast) and the available one. Note that 167 167 // the functions SetRange() are mostly overloaded and perform more checks, 168 168 // modifying the ranges again, if necessary. 169 // 170 // In case that the variable fHiGainLast is smaller than the available range 171 // obtained from the run header, a warning is given that a part of the low-gain 172 // samples are used for the extraction of the high-gain signal. 169 173 // 170 174 // Call: … … 175 179 { 176 180 177 Int_t lastdesired = (Int_t)fHiGainLast; 178 Int_t lastavailable = (Int_t)fRunHeader->GetNumSamplesHiGain()-1; 179 180 if (lastdesired > lastavailable) 181 { 182 const Int_t diff = lastdesired - lastavailable; 183 *fLog << endl; 184 *fLog << warn << GetDescriptor() 185 << Form("%s%2i%s%2i%s%2i%s",": Selected Hi Gain FADC Window [", 186 (int)fHiGainFirst,",",lastdesired, 187 "] ranges out of the available limits: [0,",lastavailable,"].") << endl; 188 *fLog << GetDescriptor() << ": Will reduce the upper edge to " << (int)(fHiGainLast - diff) << endl; 189 SetRange(fHiGainFirst, fHiGainLast-diff, fLoGainFirst, fLoGainLast); 190 } 191 192 lastdesired = (Int_t)(fLoGainLast); 193 lastavailable = (Int_t)fRunHeader->GetNumSamplesLoGain()-1; 181 Int_t lastdesired = (Int_t)(fLoGainLast); 182 Int_t lastavailable = (Int_t)fRunHeader->GetNumSamplesLoGain()-1; 194 183 195 184 if (lastdesired > lastavailable) … … 205 194 } 206 195 207 fSignals->SetUsedFADCSlices(fHiGainFirst, fHiGainLast, fNumHiGainSamples, 196 lastdesired = (Int_t)fHiGainLast; 197 lastavailable = (Int_t)fRunHeader->GetNumSamplesHiGain()-1; 198 199 if (lastdesired > lastavailable) 200 { 201 const Int_t diff = lastdesired - lastavailable; 202 *fLog << endl; 203 *fLog << warn << GetDescriptor() 204 << Form("%s%2i%s%2i%s%2i%s",": Selected Hi Gain FADC Window [", 205 (int)fHiGainFirst,",",lastdesired, 206 "] ranges out of the available limits: [0,",lastavailable,"].") << endl; 207 *fLog << warn << GetDescriptor() 208 << Form("%s%2i%s",": Will use ",diff," samples from the Low-Gain for the High-Gain extraction") 209 << endl; 210 fHiGainLast -= diff; 211 fHiLoLast = diff; 212 } 213 214 215 fSignals->SetUsedFADCSlices(fHiGainFirst, fHiGainLast+fHiLoLast, fNumHiGainSamples, 208 216 fLoGainFirst, fLoGainLast, fNumLoGainSamples); 209 217 … … 213 221 214 222 215 void MExtractor::FindSignalHiGain(Byte_t *firstused, Int_t &sum, Byte_t &sat) const223 void MExtractor::FindSignalHiGain(Byte_t *firstused, Byte_t *logain, Int_t &sum, Byte_t &sat) const 216 224 { 217 225 return; … … 239 247 Byte_t sathi; 240 248 241 FindSignalHiGain(pixel.GetHiGainSamples()+fHiGainFirst, sumhi, sathi);249 FindSignalHiGain(pixel.GetHiGainSamples()+fHiGainFirst, pixel.GetLoGainSamples(), sumhi, sathi); 242 250 243 251 Int_t sumlo = 0; -
trunk/MagicSoft/Mars/msignal/MExtractor.h
r3880 r3924 31 31 MRawRunHeader *fRunHeader; // RunHeader information 32 32 33 Byte_t fHiGainFirst;34 Byte_t fLoGainFirst;33 Byte_t fHiGainFirst; 34 Byte_t fLoGainFirst; 35 35 36 Byte_t fHiGainLast;37 Byte_t fLoGainLast;36 Byte_t fHiGainLast; 37 Byte_t fLoGainLast; 38 38 39 Byte_t fHiLoLast; 40 39 41 Float_t fNumHiGainSamples; 40 42 Float_t fNumLoGainSamples; … … 45 47 Byte_t fSaturationLimit; 46 48 47 virtual void FindSignalHiGain(Byte_t *firstused, Int_t &sum, Byte_t &sat) const;49 virtual void FindSignalHiGain(Byte_t *firstused, Byte_t *lowgain, Int_t &sum, Byte_t &sat) const; 48 50 virtual void FindSignalLoGain(Byte_t *firstused, Int_t &sum, Byte_t &sat) const; 49 51
Note:
See TracChangeset
for help on using the changeset viewer.