Changeset 8478 for trunk/MagicSoft/Mars/msignal
- Timestamp:
- 05/09/07 13:15:53 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/msignal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc
r8368 r8478 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndChargeSpline.cc,v 1.6 7 2007-03-05 08:55:09tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndChargeSpline.cc,v 1.68 2007-05-09 12:15:53 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 20 20 ! Author(s): Markus Gaug 09/2004 <mailto:markus@ifae.es> 21 21 ! 22 ! Copyright: MAGIC Software Development, 2002-200 622 ! Copyright: MAGIC Software Development, 2002-2007 23 23 ! 24 24 ! … … 145 145 #include "MExtractTimeAndChargeSpline.h" 146 146 147 #include "MExtralgoSpline.h"148 149 147 #include "MPedestalPix.h" 150 148 … … 181 179 // 182 180 MExtractTimeAndChargeSpline::MExtractTimeAndChargeSpline(const char *name, const char *title) 183 : f ExtractionType(kIntegral)181 : fHeightTm(0.5), fExtractionType(MExtralgoSpline::kIntegralRel) 184 182 { 185 183 … … 220 218 // second derivative to zero, there. 221 219 // 222 void MExtractTimeAndChargeSpline::SetChargeType( ExtractionType_t typ)220 void MExtractTimeAndChargeSpline::SetChargeType(MExtralgoSpline::ExtractionType_t typ) 223 221 { 224 222 fExtractionType = typ; … … 228 226 switch (fExtractionType) 229 227 { 230 case kAmplitude:228 case MExtralgoSpline::kAmplitude: 231 229 SetResolutionPerPheHiGain(0.053); 232 230 SetResolutionPerPheLoGain(0.016); 233 231 return; 234 232 235 case kIntegral: 233 case MExtralgoSpline::kIntegralRel: 234 case MExtralgoSpline::kIntegralAbs: 236 235 switch (fWindowSizeHiGain) 237 236 { … … 305 304 switch (fExtractionType) 306 305 { 307 case kAmplitude:306 case MExtralgoSpline::kAmplitude: 308 307 fNumHiGainSamples = 1.; 309 308 fNumLoGainSamples = fLoGainLast ? 1. : 0.; … … 315 314 break; 316 315 317 case kIntegral: 316 case MExtralgoSpline::kIntegralAbs: 317 case MExtralgoSpline::kIntegralRel: 318 318 fNumHiGainSamples = fRiseTimeHiGain + fFallTimeHiGain; 319 319 fNumLoGainSamples = fLoGainLast ? fRiseTimeLoGain + fFallTimeLoGain : 0.; … … 336 336 MExtralgoSpline s(ptr, num, fHiGainFirstDeriv.GetArray(), fHiGainSecondDeriv.GetArray()); 337 337 338 s.SetExtractionType(fExtractionType); 339 s.SetHeightTm(fHeightTm); 338 340 s.SetRiseFallTime(fRiseTimeHiGain, fFallTimeHiGain); 339 341 … … 357 359 MExtralgoSpline s(ptr, num, fLoGainFirstDeriv.GetArray(), fLoGainSecondDeriv.GetArray()); 358 360 361 s.SetExtractionType(fExtractionType); 362 s.SetHeightTm(fHeightTm); 359 363 s.SetRiseFallTime(fRiseTimeLoGain, fFallTimeLoGain); 360 364 … … 404 408 rc = kTRUE; 405 409 } 406 410 if (IsEnvDefined(env, prefix, "HeightTm", print)) 411 { 412 fHeightTm = GetEnvValue(env, prefix, "HeightTm", fHeightTm); 413 rc = kTRUE; 414 } 415 407 416 if (IsEnvDefined(env, prefix, "ExtractionType", print)) 408 417 { … … 411 420 type = type.Strip(TString::kBoth); 412 421 if (type==(TString)"amplitude") 413 SetChargeType(kAmplitude); 414 if (type==(TString)"integral") 415 SetChargeType(kIntegral); 422 SetChargeType(MExtralgoSpline::kAmplitude); 423 if (type==(TString)"integralabsolute") 424 SetChargeType(MExtralgoSpline::kIntegralAbs); 425 if (type==(TString)"integralrelative") 426 SetChargeType(MExtralgoSpline::kIntegralRel); 416 427 rc=kTRUE; 417 428 } -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.h
r8304 r8478 4 4 #ifndef MARS_MExtractTimeAndCharge 5 5 #include "MExtractTimeAndCharge.h" 6 #endif 7 8 #ifndef MARS_MExtralgoSpline 9 #include "MExtralgoSpline.h" 6 10 #endif 7 11 … … 41 45 42 46 Float_t fLoGainStretch; // The stretch of the low-gain w.r.t. the high-gain pulse 47 Float_t fHeightTm; 43 48 44 49 // Int_t fRandomIter; //! Counter used to randomize weights for noise calculation … … 47 52 Bool_t InitArrays(Int_t n); 48 53 49 public:50 enum ExtractionType_t { kAmplitude, kIntegral }; //! Possible time and charge extraction types51 52 54 private: 53 ExtractionType_t fExtractionType;55 MExtralgoSpline::ExtractionType_t fExtractionType; 54 56 55 57 public: 56 58 MExtractTimeAndChargeSpline(const char *name=NULL, const char *title=NULL); 57 ~MExtractTimeAndChargeSpline() {}58 59 59 60 Float_t GetRiseTimeHiGain() const { return fRiseTimeHiGain; } … … 83 84 void SetLoGainStretch(const Float_t f=fgLoGainStretch) { fLoGainStretch = f; } 84 85 85 void SetChargeType(const ExtractionType_t typ=kIntegral);86 void SetChargeType(const MExtralgoSpline::ExtractionType_t typ=MExtralgoSpline::kIntegralRel); 86 87 /* 87 88 void FindTimeAndChargeHiGain(Byte_t *first, Byte_t *logain, Float_t &sum, Float_t &dsum, … … 100 101 Byte_t sat, Int_t maxpos) const; 101 102 102 ClassDef(MExtractTimeAndChargeSpline, 4) // Task to Extract Arrival Times and Charges using a Cubic Spline103 ClassDef(MExtractTimeAndChargeSpline, 5) // Task to Extract Arrival Times and Charges using a Cubic Spline 103 104 }; 104 105
Note:
See TracChangeset
for help on using the changeset viewer.