Changeset 5504 for trunk/MagicSoft/Mars
- Timestamp:
- 11/29/04 16:45:57 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc
r5496 r5504 150 150 ///////////////////////////////////////////////////////////////////////////// 151 151 #include "MExtractPedestal.h" 152 #include "MExtractTimeAndCharge.h" 152 153 153 154 #include "MParList.h" … … 355 356 356 357 *fLog << inf; 357 Print();358 358 359 359 return kTRUE; … … 419 419 } 420 420 421 421 if (fExtractor) 422 fExtractor->InitArrays(); 423 424 Print(); 425 422 426 return kTRUE; 423 427 } -
trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc
r5498 r5504 100 100 // fCheckWinFirst = fgCheckWinFirst = 0 101 101 // fCheckWinLast = fgCheckWinLast = 29 102 // fExtractWinFirst = fgExtractWinFirst = 0102 // fExtractWinFirst = fgExtractWinFirst = 15 103 103 // fExtractWinSize = fgExtractWinSize = 6 104 104 // fMaxSignalVar = fgMaxSignalVar = 40; … … 108 108 // to set the Window in which a signal is searched 109 109 // 110 // SetExtractWindow(fExtractWin dFirst,fExtractWinSize);110 // SetExtractWindow(fExtractWinFirst,fExtractWinSize); 111 111 // to set the Window from which a signal is extracted 112 112 // … … 239 239 const UShort_t losamples = fRunHeader->GetNumSamplesLoGain(); 240 240 241 UShort_t lastavailable = hisamples+losamples-1; 242 241 243 if (fExtractor) 242 SetExtractWindow(hisamples+fExtractor->GetHiGainFirst(),hisamples+fExtractor->GetHiGainLast()); 243 244 { 245 SetExtractWindow(fExtractor->GetHiGainFirst(),(Int_t)fExtractor->GetNumHiGainSamples()); 246 lastavailable = losamples-1; 247 } 248 244 249 // If the size is not yet set, set the size 245 250 if (fSumx.GetSize()==0) … … 250 255 } 251 256 252 MExtractPedestal::ReInit(pList); 253 254 UShort_t lastavailable = hisamples+losamples-1; 255 256 if (fExtractWinLast > lastavailable) //changed to override check 257 if (fExtractWinLast > lastavailable) //changed to override check 257 258 { 258 259 const UShort_t diff = fExtractWinLast - lastavailable; … … 264 265 fExtractWinSize -= diff; 265 266 } 266 267 lastavailable = fRunHeader->GetNumSamplesHiGain()-1;268 267 268 lastavailable = hisamples + losamples -1; 269 269 270 if (fCheckWinLast > lastavailable) //changed to override check 270 {271 { 271 272 *fLog << warn << GetDescriptor(); 272 273 *fLog << " - WARNING: Last Check Window slice out of range...adjusting to last available slice "; 273 274 *fLog << lastavailable << endl; 274 275 275 276 fCheckWinLast = lastavailable; 276 } 277 277 } 278 279 MExtractPedestal::ReInit(pList); 280 278 281 return kTRUE; 279 282 } … … 488 491 489 492 fPedestalsOut->SetReadyToSave(); 493 490 494 return kTRUE; 491 495 } -
trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc
r5487 r5504 202 202 Bool_t MPedCalcPedRun::ReInit(MParList *pList) 203 203 { 204 205 if (fExtractor) 206 SetExtractWindow(fExtractor->GetHiGainFirst(),(Int_t)fExtractor->GetNumHiGainSamples()); 204 207 205 208 MExtractPedestal::ReInit(pList); … … 291 294 CalcSums( &pixel, sum, ab0, ab1); 292 295 293 const Float_t msum = (Float_t)sum; 294 295 fSumx[idx] += msum; 296 fAreaSumx[aidx] += msum; 297 fSectorSumx[sector] += msum; 298 299 const Float_t sqrsum = msum*msum; 296 fSumx[idx] += sum; 297 fAreaSumx[aidx] += sum; 298 fSectorSumx[sector] += sum; 299 300 const Float_t sqrsum = sum*sum; 300 301 fSumx2[idx] += sqrsum; 301 302 fAreaSumx2[aidx] += sqrsum; … … 316 317 return kTRUE; 317 318 } 318 319 320 319 321 320 void MPedCalcPedRun::CalcExtractor( MRawEvtPixelIter *pixel, Float_t &sum, MPedestalPix &ped) … … 328 327 Float_t dummy; 329 328 fExtractor->FindTimeAndChargeHiGain(first,logain,sum,dummy,dummy,dummy,sat,ped,abflag); 329 330 330 } 331 331 … … 458 458 Bool_t MPedCalcPedRun::IsPedBitSet() 459 459 { 460 460 461 if (fRunHeader->GetRunNumber() < gkFirstRunWithFinalBits) 461 462 return kFALSE; -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc
r5499 r5504 127 127 // - MArrivalTimeCam::SetUsedFADCSlices(fHiGainFirst, fHiGainLast, fNumHiGainSamples, 128 128 // fLoGainFirst, fLoGainLast, fNumLoGainSamples); 129 // - InitArrays(); 129 130 // 130 131 Bool_t MExtractTimeAndCharge::ReInit(MParList *pList) … … 138 139 fLoGainFirst, fLoGainLast, fNumLoGainSamples); 139 140 140 *fLog << dec << endl; 141 *fLog << inf << "Taking " << fNumHiGainSamples 142 << " HiGain samples from slice " << (Int_t)fHiGainFirst 143 << " to " << (Int_t)(fHiGainLast+fHiLoLast) << " incl" << endl; 144 *fLog << inf << "Taking " << fNumLoGainSamples 145 << " LoGain samples from slice " << (Int_t)fLoGainFirst 146 << " to " << (Int_t)fLoGainLast << " incl" << endl; 147 141 InitArrays(); 142 Print(); 143 148 144 return kTRUE; 149 145 } 150 151 void MExtractTimeAndCharge::FindTimeAndChargeHiGain(Byte_t *firstused, Byte_t *logain, Float_t &sum, Float_t &dsum,152 Float_t &time, Float_t &dtime,153 Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag)154 {155 return;156 }157 158 void MExtractTimeAndCharge::FindTimeAndChargeLoGain(Byte_t *firstused, Float_t &sum, Float_t &dsum,159 Float_t &time, Float_t &dtime,160 Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag)161 {162 return;163 }164 165 146 166 147 // -------------------------------------------------------------------------- … … 261 242 void MExtractTimeAndCharge::Print(Option_t *o) const 262 243 { 263 *fLog << all; 264 if (IsA()==MExtractTimeAndCharge::Class()) 265 *fLog << GetDescriptor() << ":" << endl; 266 267 *fLog << " LoGainStartShift: " << fLoGainStartShift << endl; 268 MExtractTime::Print(o); 269 } 244 245 *fLog << all; 246 if (IsA()==MExtractTimeAndCharge::Class()) 247 *fLog << GetDescriptor() << ":" << endl; 248 249 *fLog << dec << endl; 250 *fLog << inf << "Taking " << fNumHiGainSamples 251 << " HiGain samples from slice " << (Int_t)fHiGainFirst 252 << " to " << (Int_t)(fHiGainLast+fHiLoLast) << " incl" << endl; 253 *fLog << inf << "Taking " << fNumLoGainSamples 254 << " LoGain samples from slice " << (Int_t)fLoGainFirst 255 << " to " << (Int_t)fLoGainLast << " incl" << endl; 256 257 *fLog << " LoGainStartShift: " << fLoGainStartShift << endl; 258 MExtractTime::Print(o); 259 } -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.h
r5483 r5504 18 18 protected: 19 19 20 Int_t fWindowSizeHiGain; // Window Size High-Gain 21 Int_t fWindowSizeLoGain; // Window Size Low-Gain 22 20 23 Int_t PreProcess(MParList *pList); 24 Int_t Process(); 21 25 Bool_t ReInit(MParList *pList); 22 Int_t Process();23 26 24 27 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); … … 28 31 MExtractTimeAndCharge(const char *name=NULL, const char *title=NULL); 29 32 33 Int_t GetWindowSizeHiGain() const { return fWindowSizeHiGain; } 34 Int_t GetWindowSizeLoGain() const { return fWindowSizeLoGain; } 35 36 void Print(Option_t *o="") const; 37 30 38 void SetLoGainStartShift( const Float_t f=fgLoGainStartShift ) { fLoGainStartShift = f + fOffsetLoGain; } 31 32 void Print(Option_t *o) const;39 virtual void SetWindowSize(Int_t windowh, Int_t windowl) { fWindowSizeHiGain = windowh; 40 fWindowSizeLoGain = windowl; } 33 41 42 virtual void InitArrays() {} 43 34 44 virtual void FindTimeAndChargeHiGain(Byte_t *firstused, Byte_t *logain, Float_t &sum, Float_t &dsum, 35 45 Float_t &time, Float_t &dtime, 36 Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag); 46 Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag) { } 47 37 48 virtual void FindTimeAndChargeLoGain(Byte_t *firstused, Float_t &sum, Float_t &dsum, 38 49 Float_t &time, Float_t &dtime, 39 Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag) ;50 Byte_t &sat, const MPedestalPix &ped, const Bool_t abflag) { } 40 51 41 52 ClassDef(MExtractTimeAndCharge, 1) // Time And Charge Extractor Base Class -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
r5495 r5504 193 193 return kFALSE; 194 194 195 Print();196 197 195 return MExtractTimeAndCharge::PreProcess(pList); 198 196 } … … 208 206 Bool_t MExtractTimeAndChargeDigitalFilter::ReInit(MParList *pList) 209 207 { 210 if (!MExtractTimeAndCharge::ReInit(pList)) 211 return kFALSE; 212 213 fHiGainSignal.Set(fHiGainLast - fHiGainFirst + 1 + fHiLoLast); 214 fLoGainSignal.Set(fLoGainLast - fLoGainFirst + 1); 215 216 fTimeShiftHiGain = (Float_t)fHiGainFirst + 0.5 + 1./fBinningResolutionHiGain; 217 fTimeShiftLoGain = (Float_t)fLoGainFirst + 0.5 + 1./fBinningResolutionLoGain; 218 219 return kTRUE; 208 if (!MExtractTimeAndCharge::ReInit(pList)) 209 return kFALSE; 210 211 fTimeShiftHiGain = (Float_t)fHiGainFirst + 0.5 + 1./fBinningResolutionHiGain; 212 fTimeShiftLoGain = (Float_t)fLoGainFirst + 0.5 + 1./fBinningResolutionLoGain; 213 214 return kTRUE; 220 215 } 221 216 222 217 // -------------------------------------------------------------------------- 218 // 219 // InitArrays 220 // 221 // Gets called in the ReInit() and initialized the arrays 222 // 223 void MExtractTimeAndChargeDigitalFilter::InitArrays() 224 { 225 fHiGainSignal.Set(fHiGainLast - fHiGainFirst + 1 + fHiLoLast); 226 fLoGainSignal.Set(fLoGainLast - fLoGainFirst + 1); 227 } 228 229 // -------------------------------------------------------------------------- 230 // 231 // Apply the digital filter algorithm to the high-gain slices. 232 // 223 233 void MExtractTimeAndChargeDigitalFilter::FindTimeAndChargeHiGain(Byte_t *ptr, Byte_t *logain, Float_t &sum, Float_t &dsum, 224 234 Float_t &time, Float_t &dtime, … … 378 388 } 379 389 390 // -------------------------------------------------------------------------- 391 // 392 // Apply the digital filter algorithm to the low-gain slices. 393 // 380 394 void MExtractTimeAndChargeDigitalFilter::FindTimeAndChargeLoGain(Byte_t *ptr, Float_t &sum, Float_t &dsum, 381 395 Float_t &time, Float_t &dtime, … … 987 1001 *fLog << GetDescriptor() << ":" << endl; 988 1002 1003 MExtractTimeAndCharge::Print(o); 989 1004 *fLog << " Time Shift HiGain: " << fTimeShiftHiGain << endl; 990 1005 *fLog << " Time Shift LoGain: " << fTimeShiftLoGain << endl; … … 994 1009 *fLog << " Binning Res LoGain: " << fBinningResolutionHiGain << endl; 995 1010 1011 TString opt(o); 1012 if (!opt.Contains("weights")) 1013 return; 1014 996 1015 *fLog << endl; 997 1016 *fLog << inf << "Using the following weights: " << endl; … … 1004 1023 *fLog << " " << fAmpWeightsLoGain[i] << " \t " << fTimeWeightsLoGain[i] << endl; 1005 1024 1006 MExtractTimeAndCharge::Print(o);1007 1025 } -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.h
r5494 r5504 38 38 Int_t fSignalStartBinLoGain; //! Start bin from when on to apply weights 39 39 40 Int_t fWindowSizeHiGain; // Weights Window Size High-Gain41 Int_t fWindowSizeLoGain; // Weights Window Size Low-Gain42 43 40 Int_t fBinningResolutionHiGain; // Number of weights per bin High-Gain 44 41 Int_t fBinningResolutionHalfHiGain; // Half Number of weights per bin High-Gain … … 57 54 Int_t PreProcess(MParList *pList); 58 55 56 void InitArrays(); 57 59 58 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 60 59 … … 70 69 71 70 void SetNameWeightsFile( TString s = fgNameWeightsFile ) { fNameWeightsFile = s; } 72 void SetWindowSize(Int_t windowh=fgWindowSizeHiGain,73 Int_t windowl=fgWindowSizeLoGain);74 71 75 72 void SetBinningResolution(const Int_t rh=fgBinningResolutionHiGain, const Int_t rl=fgBinningResolutionLoGain) { … … 80 77 } 81 78 82 83 79 void SetSignalStartBin( const Int_t sh=fgSignalStartBinHiGain, const Int_t sl=fgSignalStartBinLoGain) { 84 80 fSignalStartBinHiGain = sh; 85 81 fSignalStartBinLoGain = sl; 86 82 } 83 84 void SetWindowSize( Int_t windowh=fgWindowSizeHiGain, Int_t windowl=fgWindowSizeLoGain); 87 85 88 86 const char* GetNameWeightsFile() const { return fNameWeightsFile.Data(); } -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSlidingWindow.cc
r5416 r5504 89 89 // 90 90 MExtractTimeAndChargeSlidingWindow::MExtractTimeAndChargeSlidingWindow(const char *name, const char *title) 91 : fWindowSizeHiGain(fgHiGainWindowSize),92 fWindowSizeLoGain(fgLoGainWindowSize),93 fHiGainSignal(NULL), fLoGainSignal(NULL)94 91 { 95 92 … … 97 94 fTitle = title ? title : "Calculate arrival times and charges using a sliding window"; 98 95 96 fWindowSizeHiGain = fgHiGainWindowSize; 97 fWindowSizeLoGain = fgLoGainWindowSize; 98 99 99 SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast); 100 }101 102 103 // --------------------------------------------------------------------------104 //105 // Destructor: Deletes the arrays106 //107 MExtractTimeAndChargeSlidingWindow::~MExtractTimeAndChargeSlidingWindow()108 {109 110 if (fHiGainSignal)111 delete [] fHiGainSignal;112 if (fLoGainSignal)113 delete [] fLoGainSignal;114 115 100 } 116 101 … … 147 132 // - fSqrtLoGainSamples to: TMath::Sqrt(fNumLoGainSamples) 148 133 // 149 void MExtractTimeAndChargeSlidingWindow::SetWindowSize( Byte_t windowh, Byte_t windowl)134 void MExtractTimeAndChargeSlidingWindow::SetWindowSize(Int_t windowh, Int_t windowl) 150 135 { 151 136 … … 153 138 fWindowSizeLoGain = windowl; 154 139 155 const Byte_t availhirange = fHiGainLast-fHiGainFirst+1;140 const Int_t availhirange = (Int_t)(fHiGainLast-fHiGainFirst+1); 156 141 157 142 if (fWindowSizeHiGain > availhirange) … … 173 158 if (fLoGainLast != 0 && fWindowSizeLoGain != 0) 174 159 { 175 const Byte_t availlorange = fLoGainLast-fLoGainFirst+1;160 const Int_t availlorange = (Int_t)(fLoGainLast-fLoGainFirst+1); 176 161 177 162 if (fWindowSizeLoGain > availlorange) … … 196 181 // -------------------------------------------------------------------------- 197 182 // 198 // ReInit 199 // 200 // Calls: 201 // - MExtractTimeAndCharge::ReInit(pList); 202 // - Deletes all arrays, if not NULL 203 // - Creates new arrays according to the extraction range 204 // 205 Bool_t MExtractTimeAndChargeSlidingWindow::ReInit(MParList *pList) 206 { 207 208 if (!MExtractTimeAndCharge::ReInit(pList)) 209 return kFALSE; 210 211 if (fHiGainSignal) 212 delete [] fHiGainSignal; 213 if (fLoGainSignal) 214 delete [] fLoGainSignal; 215 216 Int_t range = fHiGainLast - fHiGainFirst + 1 + fHiLoLast; 217 218 fHiGainSignal = new Float_t[range]; 219 memset(fHiGainSignal,0,range*sizeof(Float_t)); 220 221 range = fLoGainLast - fLoGainFirst + 1; 222 223 fLoGainSignal = new Float_t[range]; 224 memset(fLoGainSignal,0,range*sizeof(Float_t)); 225 226 return kTRUE; 183 // InitArrays 184 // 185 // Gets called in the ReInit() and initialized the arrays 186 // 187 void MExtractTimeAndChargeSlidingWindow::InitArrays() 188 { 189 fHiGainSignal.Set(fHiGainLast - fHiGainFirst + 1 + fHiLoLast); 190 fLoGainSignal.Set(fLoGainLast - fLoGainFirst + 1); 227 191 } 228 192 -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSlidingWindow.h
r5483 r5504 4 4 #ifndef MARS_MExtractTimeAndCharge 5 5 #include "MExtractTimeAndCharge.h" 6 #endif 7 8 #ifndef MARS_MArrayF 9 #include "MArrayF.h" 6 10 #endif 7 11 … … 19 23 static const Byte_t fgLoGainWindowSize; //! The extraction window Lo-Gain 20 24 21 Byte_t fWindowSizeHiGain; // Number of Hi Gain slices in window22 25 Float_t fHiGainWindowSizeSqrt; // Square root of number of gains in window 23 Byte_t fWindowSizeLoGain; // Number of Lo Gain slices in window24 26 Float_t fLoGainWindowSizeSqrt; // Square root of number of gains in window 25 27 26 Float_t *fHiGainSignal; //! Need fast access to the pedestal subtracted signals27 Float_t *fLoGainSignal;//! Store them in separate arrays28 MArrayF fHiGainSignal; //! Need fast access to the signals in a float way 29 MArrayF fLoGainSignal; //! Store them in separate arrays 28 30 29 Bool_t ReInit( MParList *pList);31 void InitArrays(); 30 32 31 33 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); … … 34 36 35 37 MExtractTimeAndChargeSlidingWindow(const char *name=NULL, const char *title=NULL); 36 ~MExtractTimeAndChargeSlidingWindow(); 37 38 Byte_t GetWindowSizeHiGain() const { return fWindowSizeHiGain; } 39 Byte_t GetWindowSizeLoGain() const { return fWindowSizeLoGain; } 38 ~MExtractTimeAndChargeSlidingWindow() {} 40 39 41 40 void SetRange ( Byte_t hifirst=0, Byte_t hilast=0, Byte_t lofirst=0, Byte_t lolast=0 ); 42 void SetWindowSize( Byte_t windowh=fgHiGainWindowSize,43 Byte_t windowl=fgLoGainWindowSize);41 void SetWindowSize(Int_t windowh=fgHiGainWindowSize, 42 Int_t windowl=fgLoGainWindowSize); 44 43 45 44 void FindTimeAndChargeHiGain(Byte_t *first, Byte_t *logain, Float_t &sum, Float_t &dsum, -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc
r5497 r5504 177 177 // 178 178 MExtractTimeAndChargeSpline::MExtractTimeAndChargeSpline(const char *name, const char *title) 179 : fHiGainSignal(NULL), fLoGainSignal(NULL), 180 fHiGainFirstDeriv(NULL), fLoGainFirstDeriv(NULL), 181 fHiGainSecondDeriv(NULL), fLoGainSecondDeriv(NULL), 182 fAbMax(0.), fAbMaxPos(0.), fHalfMax(0.) 179 : fAbMax(0.), fAbMaxPos(0.), fHalfMax(0.) 183 180 { 184 181 … … 197 194 } 198 195 199 // --------------------------------------------------------------------------200 //201 // Destructor: Deletes the arrays202 //203 MExtractTimeAndChargeSpline::~MExtractTimeAndChargeSpline()204 {205 206 if (fHiGainSignal)207 delete [] fHiGainSignal;208 if (fLoGainSignal)209 delete [] fLoGainSignal;210 if (fHiGainFirstDeriv)211 delete [] fHiGainFirstDeriv;212 if (fLoGainFirstDeriv)213 delete [] fLoGainFirstDeriv;214 if (fHiGainSecondDeriv)215 delete [] fHiGainSecondDeriv;216 if (fLoGainSecondDeriv)217 delete [] fLoGainSecondDeriv;218 219 }220 196 221 197 //------------------------------------------------------------------- … … 273 249 } 274 250 275 276 251 // -------------------------------------------------------------------------- 277 252 // … … 286 261 { 287 262 288 if (fHiGainSignal)289 delete [] fHiGainSignal;290 if (fLoGainSignal)291 delete [] fLoGainSignal;292 if (fHiGainFirstDeriv)293 delete [] fHiGainFirstDeriv;294 if (fLoGainFirstDeriv)295 delete [] fLoGainFirstDeriv;296 if (fHiGainSecondDeriv)297 delete [] fHiGainSecondDeriv;298 if (fLoGainSecondDeriv)299 delete [] fLoGainSecondDeriv;300 301 Int_t range = fHiGainLast - fHiGainFirst + 1 + fHiLoLast;302 303 fHiGainSignal = new Float_t[range];304 memset(fHiGainSignal,0,range*sizeof(Float_t));305 fHiGainFirstDeriv = new Float_t[range];306 memset(fHiGainFirstDeriv,0,range*sizeof(Float_t));307 fHiGainSecondDeriv = new Float_t[range];308 memset(fHiGainSecondDeriv,0,range*sizeof(Float_t));309 310 range = fLoGainLast - fLoGainFirst + 1;311 312 fLoGainSignal = new Float_t[range];313 memset(fLoGainSignal,0,range*sizeof(Float_t));314 fLoGainFirstDeriv = new Float_t[range];315 memset(fLoGainFirstDeriv,0,range*sizeof(Float_t));316 fLoGainSecondDeriv = new Float_t[range];317 memset(fLoGainSecondDeriv,0,range*sizeof(Float_t));318 319 263 if (IsExtractionType(kAmplitude)) 320 264 { … … 323 267 fSqrtHiGainSamples = 1.; 324 268 fSqrtLoGainSamples = 1.; 269 fWindowSizeHiGain = 1; 270 fWindowSizeLoGain = 1; 325 271 } 326 272 … … 331 277 fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples); 332 278 fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples); 279 fWindowSizeHiGain = (Int_t)(fRiseTime + fFallTime); 280 fWindowSizeLoGain = (Int_t)(fRiseTime + fFallTime+1); 333 281 } 334 282 … … 339 287 } 340 288 289 // -------------------------------------------------------------------------- 290 // 291 // InitArrays 292 // 293 // Gets called in the ReInit() and initialized the arrays 294 // 295 void MExtractTimeAndChargeSpline::InitArrays() 296 { 297 298 Int_t range = fHiGainLast - fHiGainFirst + 1 + fHiLoLast; 299 300 fHiGainSignal .Set(range); 301 fHiGainFirstDeriv .Set(range); 302 fHiGainSecondDeriv.Set(range); 303 304 range = fLoGainLast - fLoGainFirst + 1; 305 306 fLoGainSignal .Set(range); 307 fLoGainFirstDeriv .Set(range); 308 fLoGainSecondDeriv.Set(range); 309 310 fHiGainSignal .Reset(); 311 fHiGainFirstDeriv .Reset(); 312 fHiGainSecondDeriv.Reset(); 313 314 fLoGainSignal .Reset(); 315 fLoGainFirstDeriv .Reset(); 316 fLoGainSecondDeriv.Reset(); 317 318 } 341 319 342 320 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.h
r5497 r5504 4 4 #ifndef MARS_MExtractTimeAndCharge 5 5 #include "MExtractTimeAndCharge.h" 6 #endif 7 8 #ifndef MARS_MArrayF 9 #include "MArrayF.h" 6 10 #endif 7 11 … … 20 24 static const Float_t fgFallTime; //! Default for fFallTime (now set to: 4.5) 21 25 22 Float_t *fHiGainSignal; //! Need fast access to the signals in a float way23 Float_t *fLoGainSignal; //! Store them in separate arrays24 Float_t *fHiGainFirstDeriv; //!25 Float_t *fLoGainFirstDeriv; //!26 Float_t *fHiGainSecondDeriv; //!27 Float_t *fLoGainSecondDeriv; //!26 MArrayF fHiGainSignal; //! Need fast access to the signals in a float way 27 MArrayF fLoGainSignal; //! Store them in separate arrays 28 MArrayF fHiGainFirstDeriv; //! High-gain discretized first derivatives 29 MArrayF fLoGainFirstDeriv; //! Low-gain discretized first derivatives 30 MArrayF fHiGainSecondDeriv; //! High-gain discretized second derivatives 31 MArrayF fLoGainSecondDeriv; //! Low-gain discretized second derivatives 28 32 29 33 Float_t fAbMax; //! Current maximum of the spline … … 41 45 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 42 46 47 void InitArrays(); 48 43 49 void CalcIntegralHiGain(Float_t &sum, Int_t startslice, Int_t lastslice); 44 50 void CalcIntegralLoGain(Float_t &sum, Int_t startslice, Int_t lastslice); … … 56 62 57 63 MExtractTimeAndChargeSpline(const char *name=NULL, const char *title=NULL); 58 ~MExtractTimeAndChargeSpline() ;64 ~MExtractTimeAndChargeSpline() {} 59 65 60 66 Float_t GetRiseTime() const { return fRiseTime; }
Note:
See TracChangeset
for help on using the changeset viewer.