Changeset 6742 for trunk/MagicSoft/Mars/msignal
- Timestamp:
- 03/04/05 11:36:43 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/msignal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc
r6706 r6742 176 176 : fAbMax(0.), fAbMaxPos(0.), fHalfMax(0.), 177 177 fRiseTimeHiGain(fgRiseTimeHiGain), fFallTimeHiGain(fgFallTimeHiGain), 178 fRandomIter(0) 178 fRandomIter(0), fExtractionType(kIntegral) 179 179 { 180 180 … … 186 186 SetOffsetLoGain(fgOffsetLoGain); 187 187 188 SetChargeType();189 188 SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast); 190 189 } … … 203 202 MExtractor::SetRange(hifirst, hilast, lofirst, lolast); 204 203 205 if (IsExtractionType(kIntegral)) 206 SetChargeType(kIntegral); 207 if (IsExtractionType(kAmplitude)) 208 SetChargeType(kAmplitude); 209 204 SetChargeType(fExtractionType); 210 205 } 211 206 … … 221 216 { 222 217 223 CLRBIT(fFlags,kAmplitude); 224 CLRBIT(fFlags,kIntegral ); 225 226 SETBIT(fFlags,typ); 227 228 if (IsExtractionType(kAmplitude)) 218 fExtractionType = typ; 219 220 if (fExtractionType == kAmplitude) 229 221 { 230 222 fNumHiGainSamples = 1.; … … 239 231 } 240 232 241 if ( IsExtractionType(kIntegral))233 if (fExtractionType == kIntegral) 242 234 { 243 235 … … 283 275 fLoGainSecondDeriv.Reset(); 284 276 285 if ( IsExtractionType(kAmplitude))277 if (fExtractionType == kAmplitude) 286 278 { 287 279 fNumHiGainSamples = 1.; … … 297 289 fFallTimeLoGain = fFallTimeHiGain * fLoGainStretch; 298 290 299 if ( IsExtractionType(kIntegral))291 if (fExtractionType == kIntegral) 300 292 { 301 293 … … 416 408 const Float_t nsx = fRandomIter * fResolution; 417 409 418 if ( IsExtractionType(kAmplitude))410 if (fExtractionType == kAmplitude) 419 411 { 420 412 const Float_t b = nsx; … … 453 445 454 446 dtime = 1.0; 455 if ( IsExtractionType(kAmplitude))447 if (fExtractionType == kAmplitude) 456 448 { 457 449 sum = fAbMax; … … 615 607 } 616 608 617 if ( IsExtractionType(kAmplitude))609 if (fExtractionType == kAmplitude) 618 610 { 619 611 time = fAbMaxPos + (Int_t)fHiGainFirst; … … 775 767 const Float_t nsx = fRandomIter * fResolution; 776 768 777 if ( IsExtractionType(kAmplitude))769 if (fExtractionType == kAmplitude) 778 770 { 779 771 const Float_t b = nsx; … … 811 803 812 804 dtime = 1.0; 813 if ( IsExtractionType(kAmplitude))805 if (fExtractionType == kAmplitude) 814 806 { 815 807 time = (Float_t)(fLoGainFirst + maxpos); … … 976 968 } 977 969 978 if ( IsExtractionType(kAmplitude))970 if (fExtractionType == kAmplitude) 979 971 { 980 972 time = fAbMaxPos + (Int_t)fLoGainFirst; … … 1214 1206 } 1215 1207 1216 Bool_t b = kFALSE;1217 1218 if (IsEnvDefined(env, prefix, "Amplitude", print))1219 {1220 b = GetEnvValue(env, prefix, "Amplitude", IsExtractionType(kAmplitude));1221 if (b)1222 SetChargeType(kAmplitude);1223 rc = kTRUE;1224 }1225 if (IsEnvDefined(env, prefix, "Integral", print))1226 {1227 b = GetEnvValue(env, prefix, "Integral", IsExtractionType(kIntegral));1228 if (b)1229 SetChargeType(kIntegral);1230 rc = kTRUE;1231 }1232 1233 1208 if (IsEnvDefined(env, prefix, "ExtractionType", print)) 1234 1209 { … … 1240 1215 if (type==(TString)"integral") 1241 1216 SetChargeType(kIntegral); 1242 if (type==(TString)"maximum")1243 SetChargeType(kMaximum);1244 if (type==(TString)"halfmaximum")1245 SetChargeType(kHalfMaximum);1246 1217 rc=kTRUE; 1247 1218 } 1248 1219 1249 1250 1251 1252 1220 return MExtractTimeAndCharge::ReadEnv(env, prefix, print) ? kTRUE : rc; 1253 1221 -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.h
r6366 r6742 48 48 Int_t fRandomIter; // Counter used to randomize weights for noise calculation 49 49 50 Byte_t fFlags; // Bit-field to hold the time extraction types 51 52 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 50 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 53 51 54 Bool_t InitArrays();52 Bool_t InitArrays(); 55 53 56 54 void CalcIntegralHiGain(Float_t &sum, Float_t start, Float_t last); 57 55 void CalcIntegralLoGain(Float_t &sum, Float_t start, Float_t last); 58 56 59 public: 60 61 enum ExtractionType_t { kMaximum, kHalfMaximum, 62 kAmplitude, kIntegral }; //! Possible time and charge extraction types 57 public: 58 enum ExtractionType_t { kAmplitude, kIntegral }; //! Possible time and charge extraction types 63 59 64 60 private: 61 62 ExtractionType_t fExtractionType; 65 63 66 Bool_t IsExtractionType ( ExtractionType_t typ ) { return TESTBIT(fFlags, typ); }67 68 64 public: 69 65 … … 95 91 void SetLoGainStretch ( const Float_t f=fgLoGainStretch ) { fLoGainStretch = f; } 96 92 97 void SetChargeType ( const ExtractionType_t typ=k Amplitude);93 void SetChargeType ( const ExtractionType_t typ=kIntegral); 98 94 99 95 void FindTimeAndChargeHiGain(Byte_t *first, Byte_t *logain, Float_t &sum, Float_t &dsum,
Note:
See TracChangeset
for help on using the changeset viewer.