Changeset 5795 for trunk/MagicSoft/Mars/msignal
- Timestamp:
- 01/10/05 23:24:35 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/msignal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc
r5748 r5795 98 98 // time search. 99 99 // 2) If Charge Type: kIntegral was chosen, sum the fHiGainSignal between: 100 // (Int_t)(fAbMaxPos - fRiseTime ) and101 // (Int_t)(fAbMaxPos + fFallTime )100 // (Int_t)(fAbMaxPos - fRiseTimeHiGain) and 101 // (Int_t)(fAbMaxPos + fFallTimeHiGain) 102 102 // (default: fRiseTime: 1.5, fFallTime: 4.5) 103 // 103 // sum the fLoGainSignal between: 104 // (Int_t)(fAbMaxPos - fRiseTimeHiGain*fLoGainStretch) and 105 // (Int_t)(fAbMaxPos + fFallTimeHiGain*fLoGainStretch) 106 // (default: fLoGainStretch: 1.5) 107 // 104 108 // The values: fNumHiGainSamples and fNumLoGainSamples are set to: 105 109 // 1) If Charge Type: kAmplitude was chosen: 1. 106 // 2) If Charge Type: kIntegral was chosen: fRiseTime + fFallTime107 // or: f RiseTime + fFallTime + 1.in the case of the low-gain110 // 2) If Charge Type: kIntegral was chosen: fRiseTimeHiGain + fFallTimeHiGain 111 // or: fNumHiGainSamples*fLoGainStretch in the case of the low-gain 108 112 // 109 113 // Call: SetRange(fHiGainFirst, fHiGainLast, fLoGainFirst, fLoGainLast) … … 127 131 // --> no further function evaluation needed 128 132 // - SetChargeType(MExtractTimeAndChargeSpline::kIntegral) for the 129 // computation of the integral beneith the spline between fRiseTime 130 // from the position of the maximum to fFallTime after the position of133 // computation of the integral beneith the spline between fRiseTimeHiGain 134 // from the position of the maximum to fFallTimeHiGain after the position of 131 135 // the maximum. The Low Gain is computed with half a slice more at the rising 132 136 // edge and half a slice more at the falling edge. … … 146 150 using namespace std; 147 151 148 const Byte_t MExtractTimeAndChargeSpline::fgHiGainFirst = 2; 149 const Byte_t MExtractTimeAndChargeSpline::fgHiGainLast = 14; 150 const Byte_t MExtractTimeAndChargeSpline::fgLoGainFirst = 2; 151 const Byte_t MExtractTimeAndChargeSpline::fgLoGainLast = 14; 152 const Float_t MExtractTimeAndChargeSpline::fgResolution = 0.05; 153 const Float_t MExtractTimeAndChargeSpline::fgRiseTime = 1.5; 154 const Float_t MExtractTimeAndChargeSpline::fgFallTime = 4.5; 152 const Byte_t MExtractTimeAndChargeSpline::fgHiGainFirst = 2; 153 const Byte_t MExtractTimeAndChargeSpline::fgHiGainLast = 14; 154 const Byte_t MExtractTimeAndChargeSpline::fgLoGainFirst = 2; 155 const Byte_t MExtractTimeAndChargeSpline::fgLoGainLast = 14; 156 const Float_t MExtractTimeAndChargeSpline::fgResolution = 0.05; 157 const Float_t MExtractTimeAndChargeSpline::fgRiseTimeHiGain = 1.5; 158 const Float_t MExtractTimeAndChargeSpline::fgFallTimeHiGain = 4.5; 159 const Float_t MExtractTimeAndChargeSpline::fgLoGainStretch = 1.5; 160 const Float_t MExtractTimeAndChargeSpline::fgOffsetLoGain = 1.7; // 5 ns 155 161 // -------------------------------------------------------------------------- 156 162 // … … 161 167 // 162 168 // Initializes: 163 // - fResolution to fgResolution 164 // - fRiseTime to fgRiseTime 165 // - fFallTime to fgFallTime 166 // - Time Extraction Type to kMaximum 169 // - fResolution to fgResolution 170 // - fRiseTimeHiGain to fgRiseTimeHiGain 171 // - fFallTimeHiGain to fgFallTimeHiGain 167 172 // - Charge Extraction Type to kAmplitude 173 // - fLoGainStretch to fgLoGainStretch 168 174 // 169 175 MExtractTimeAndChargeSpline::MExtractTimeAndChargeSpline(const char *name, const char *title) … … 175 181 176 182 SetResolution(); 177 SetRiseTime(); 178 SetFallTime(); 183 184 SetRiseTimeHiGain(); 185 SetFallTimeHiGain(); 179 186 180 187 SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast); 181 188 182 189 SetChargeType(); 183 190 SetLoGainStretch(); 191 192 SetOffsetLoGain(fgOffsetLoGain); 184 193 } 185 194 … … 263 272 if (IsExtractionType(kIntegral)) 264 273 { 265 fNumHiGainSamples = fRiseTime + fFallTime; 266 fNumLoGainSamples = fLoGainLast ? fNumHiGainSamples + 1. : 0.; 267 fNumLoGainSamples *= 0.75; 274 275 fRiseTimeLoGain = fRiseTimeHiGain * fLoGainStretch; 276 fFallTimeLoGain = fFallTimeHiGain * fLoGainStretch; 277 278 fNumHiGainSamples = fRiseTimeHiGain + fFallTimeHiGain; 279 fNumLoGainSamples = fLoGainLast ? fRiseTimeLoGain + fFallTimeLoGain : 0.; 280 // fNumLoGainSamples *= 0.75; 268 281 269 282 fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples); 270 283 fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples); 271 fWindowSizeHiGain = (Int_t)(fRiseTime + fFallTime);272 fWindowSizeLoGain = (Int_t)(fRiseTime + fFallTime+1);284 fWindowSizeHiGain = (Int_t)(fRiseTimeHiGain + fFallTimeHiGain); 285 fWindowSizeLoGain = (Int_t)(fRiseTimeLoGain + fFallTimeLoGain); 273 286 } 274 287 … … 392 405 { 393 406 Float_t start = 2. + nsx; 394 Float_t last = start + fRiseTime + fFallTime;407 Float_t last = start + fRiseTimeHiGain + fFallTimeHiGain; 395 408 396 409 if (int(last) > range) … … 423 436 424 437 if (maxpos > range - 2) 425 CalcIntegralHiGain(sum, (Float_t)range - fRiseTime - fFallTime, (Float_t)range - 0.001);438 CalcIntegralHiGain(sum, (Float_t)range - fRiseTimeHiGain - fFallTimeHiGain, (Float_t)range - 0.001); 426 439 else 427 CalcIntegralHiGain(sum, 0.001, fRiseTime + fFallTime);440 CalcIntegralHiGain(sum, 0.001, fRiseTimeHiGain + fFallTimeHiGain); 428 441 429 442 time = (Float_t)(fHiGainFirst + maxpos - 1); … … 650 663 // 651 664 652 Float_t start = fAbMaxPos - fRiseTime ;653 Float_t last = fAbMaxPos + fFallTime ;665 Float_t start = fAbMaxPos - fRiseTimeHiGain; 666 Float_t last = fAbMaxPos + fFallTimeHiGain; 654 667 655 668 const Int_t diff = int(last) - range; … … 750 763 { 751 764 Float_t start = 2. + nsx; 752 Float_t last = start + fRiseTime + fFallTime +1.;765 Float_t last = start + fRiseTimeLoGain + fFallTimeLoGain; 753 766 754 767 if (int(last) > range) … … 769 782 // Don't start if the maxpos is too close to the limits. 770 783 // 771 if (sat || maxpos < TMath::Ceil(fRiseTime +0.45) || maxpos > range-2)784 if (sat || maxpos < TMath::Ceil(fRiseTimeLoGain) || maxpos > range-2) 772 785 { 773 786 dtime = 0.5; … … 780 793 781 794 if (maxpos > range-2) 782 CalcIntegralLoGain(sum, (Float_t)range - fRiseTime - fFallTime-1., (Float_t)range - 0.001);795 CalcIntegralLoGain(sum, (Float_t)range - fRiseTimeLoGain - fFallTimeLoGain -1., (Float_t)range - 0.001); 783 796 else 784 CalcIntegralLoGain(sum, 0.001, fRiseTime + fFallTime+ 1.);797 CalcIntegralLoGain(sum, 0.001, fRiseTimeLoGain + fFallTimeLoGain + 1.); 785 798 786 799 time = (Float_t)(fLoGainFirst + maxpos - 1); … … 1010 1023 // Now integrate the whole thing! 1011 1024 // 1012 Float_t start = fAbMaxPos - fRiseTime - 0.5;1013 Float_t last = fAbMaxPos + fFallTime + 0.5;1025 Float_t start = fAbMaxPos - fRiseTimeLoGain; 1026 Float_t last = fAbMaxPos + fFallTimeLoGain; 1014 1027 1015 1028 const Int_t diff = int(last) - range; … … 1156 1169 rc = kTRUE; 1157 1170 } 1158 if (IsEnvDefined(env, prefix, "RiseTime ", print))1159 { 1160 SetRiseTime (GetEnvValue(env, prefix, "RiseTime", fRiseTime));1171 if (IsEnvDefined(env, prefix, "RiseTimeHiGain", print)) 1172 { 1173 SetRiseTimeHiGain(GetEnvValue(env, prefix, "RiseTimeHiGain", fRiseTimeHiGain)); 1161 1174 rc = kTRUE; 1162 1175 } 1163 if (IsEnvDefined(env, prefix, "FallTime", print)) 1164 { 1165 SetFallTime(GetEnvValue(env, prefix, "FallTime", fFallTime)); 1176 if (IsEnvDefined(env, prefix, "FallTimeHiGain", print)) 1177 { 1178 SetFallTimeHiGain(GetEnvValue(env, prefix, "FallTimeHiGain", fFallTimeHiGain)); 1179 rc = kTRUE; 1180 } 1181 if (IsEnvDefined(env, prefix, "LoGainStretch", print)) 1182 { 1183 SetLoGainStretch(GetEnvValue(env, prefix, "LoGainStretch", fLoGainStretch)); 1166 1184 rc = kTRUE; 1167 1185 } -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.h
r5794 r5795 24 24 static const Float_t fgFallTimeHiGain; //! Default for fFallTime (now set to: 4.5) 25 25 static const Float_t fgLoGainStretch; //! Default for fLoGainStretch (now set to: 1.5) 26 static const Float_t fgOffsetLoGain; //! Default for fOffsetLoGain (now set to 1. 2)26 static const Float_t fgOffsetLoGain; //! Default for fOffsetLoGain (now set to 1.7) 27 27 28 28 MArrayF fHiGainSignal; //! Need fast access to the signals in a float way
Note:
See TracChangeset
for help on using the changeset viewer.