Changeset 5488
- Timestamp:
- 11/28/04 15:05:10 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5481 r5488 20 20 21 21 -*-*- END OF LINE -*-*- 22 23 2004/11/28: Markus Gaug 24 25 * msignal/MExtractTimeAndChargeDigitalFilter.[h,cc] 26 - fixed documentation of data members 27 - Introduced setter and getter for name of weights file 22 28 23 29 2004/11/26: Markus Gaug -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
r5449 r5488 78 78 const Int_t MExtractTimeAndChargeDigitalFilter::fgSignalStartBinHiGain = 4; 79 79 const Int_t MExtractTimeAndChargeDigitalFilter::fgSignalStartBinLoGain = 4; 80 const TString MExtractTimeAndChargeDigitalFilter::fgNameWeightsFile = "cosmics_weights.dat"; 80 81 // -------------------------------------------------------------------------- 81 82 // … … 90 91 // 91 92 MExtractTimeAndChargeDigitalFilter::MExtractTimeAndChargeDigitalFilter(const char *name, const char *title) 93 : fWeightsSet(kFALSE) 92 94 { 93 95 fName = name ? name : "MExtractTimeAndChargeDigitalFilter"; … … 99 101 SetSignalStartBin(); 100 102 101 ReadWeightsFile("");103 SetNameWeightsFile(); 102 104 } 103 105 … … 187 189 { 188 190 if (!MExtractTimeAndCharge::ReInit(pList)) 191 return kFALSE; 192 193 if (!fWeightsSet) 194 if (!ReadWeightsFile(fNameWeightsFile)); 189 195 return kFALSE; 190 196 … … 566 572 Bool_t MExtractTimeAndChargeDigitalFilter::ReadWeightsFile(TString filename) 567 573 { 574 568 575 // This is a fix for TEnv files edited with windows editors 569 576 filename.ReplaceAll("\015", ""); 577 578 SetNameWeightsFile(filename); 570 579 571 580 fAmpWeightsHiGain .Set(fBinningResolutionHiGain*fWindowSizeHiGain); … … 574 583 fTimeWeightsLoGain.Set(fBinningResolutionLoGain*fWindowSizeLoGain); 575 584 576 if (f ilename.IsNull())585 if (fNameWeightsFile.IsNull()) 577 586 { 578 587 fAmpWeightsHiGain.Reset(1); … … 696 705 *fLog << inf << " File contains " << fWindowSizeLoGain << " lo-gain slices "; 697 706 *fLog << "with a resolution of " << fBinningResolutionLoGain << endl; 707 708 fWeightsSet = kTRUE; 698 709 699 710 return kTRUE; -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.h
r5483 r5488 16 16 { 17 17 private: 18 static const Byte_t fgHiGainFirst; 19 static const Byte_t fgHiGainLast; 20 static const Byte_t fgLoGainFirst; 21 static const Byte_t fgLoGainLast; 22 static const Int_t fgWindowSizeHiGain; 23 static const Int_t fgWindowSizeLoGain; 24 static const Int_t fgBinningResolutionHiGain; 25 static const Int_t fgBinningResolutionLoGain; 26 static const Int_t fgSignalStartBinHiGain; 27 static const Int_t fgSignalStartBinLoGain; 18 19 static const Byte_t fgHiGainFirst; //! Default for fHiGainFirst (now set to: 0) 20 static const Byte_t fgHiGainLast; //! Default for fHiGainLast (now set to:14) 21 static const Byte_t fgLoGainFirst; //! Default for fLoGainFirst (now set to: 3) 22 static const Byte_t fgLoGainLast; //! Default for fLoGainLast (now set to:14) 23 static const Int_t fgWindowSizeHiGain; //! Default for fWindowSizeHiGain (now set to: 6) 24 static const Int_t fgWindowSizeLoGain; //! Default for fWindowSizeLoGain (now set to: 6) 25 static const Int_t fgBinningResolutionHiGain; //! Default for fBinningResolutionHiGain (now set to: 10) 26 static const Int_t fgBinningResolutionLoGain; //! Default for fBinningResolutionLoGain (now set to: 10) 27 static const Int_t fgSignalStartBinHiGain; //! Default for fSignalStartBinHiGain (now set to: 4) 28 static const Int_t fgSignalStartBinLoGain; //! Default for fSignalStartBinLoGain (now set to: 4) 29 static const TString fgNameWeightsFile; //! "cosmics_weights.dat" 30 31 MArrayF fHiGainSignal; //! Need fast access to the signals in a float way 32 MArrayF fLoGainSignal; //! Store them in separate arrays 33 34 Float_t fTimeShiftHiGain; // Time shift from when on to apply the filter 35 Float_t fTimeShiftLoGain; // Time shift from when on to apply the filter 28 36 29 MArrayF fHiGainSignal; //! Need fast access to the signals in a float way30 MArrayF fLoGainSignal; //! Store them in separate arrays37 Int_t fSignalStartBinHiGain; //! Start bin from when on to apply weights 38 Int_t fSignalStartBinLoGain; //! Start bin from when on to apply weights 31 39 32 Float_t fTimeShiftHiGain; 33 Float_t fTimeShiftLoGain; 40 Int_t fWindowSizeHiGain; // Weights Window Size High-Gain 41 Int_t fWindowSizeLoGain; // Weights Window Size Low-Gain 42 43 Int_t fBinningResolutionHiGain; // Number of weights per bin High-Gain 44 Int_t fBinningResolutionHalfHiGain; // Half Number of weights per bin High-Gain 45 Int_t fBinningResolutionLoGain; // Number of weights per bin Low-Gain 46 Int_t fBinningResolutionHalfLoGain; // Half Number of weights per bin Low-Gain 34 47 35 Int_t fSignalStartBinHiGain; //! 36 Int_t fSignalStartBinLoGain; //! 48 MArrayF fAmpWeightsHiGain; //! Amplitude weights High-Gain (from weights file) 49 MArrayF fTimeWeightsHiGain; //! Time weights High-Gain (from weights file) 50 MArrayF fAmpWeightsLoGain; //! Amplitude weights Low-Gain (from weights file) 51 MArrayF fTimeWeightsLoGain; //! Time weights Low-Gain (from weights file) 37 52 38 Int_t fWindowSizeHiGain; 39 Int_t fWindowSizeLoGain; 40 41 Int_t fBinningResolutionHiGain; 42 Int_t fBinningResolutionHalfHiGain; 43 Int_t fBinningResolutionLoGain; 44 Int_t fBinningResolutionHalfLoGain; 53 TString fNameWeightsFile; // Name of the weights file 54 Bool_t fWeightsSet; // Flag if weights have alreayd been set 45 55 46 MArrayF fAmpWeightsHiGain; //!47 MArrayF fTimeWeightsHiGain; //!48 MArrayF fAmpWeightsLoGain; //!49 MArrayF fTimeWeightsLoGain; //!50 51 56 Bool_t ReInit(MParList *pList); 52 57 Int_t PreProcess(MParList *pList); 53 58 54 59 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 55 56 60 57 61 public: … … 63 67 TH1F *shapelo=NULL, TH2F *autocorrlo=NULL ); 64 68 65 Bool_t ReadWeightsFile(TString filename="cosmic_weights.dat"); 69 Bool_t ReadWeightsFile(TString filename); 70 71 void SetNameWeightsFile( TString s = fgNameWeightsFile ) { fNameWeightsFile = s; } 66 72 void SetWindowSize(Int_t windowh=fgWindowSizeHiGain, 67 73 Int_t windowl=fgWindowSizeLoGain); … … 80 86 } 81 87 88 TString GetNameWeightsFile() const { return fNameWeightsFile; } 89 82 90 void Print(Option_t *o) const; 83 91
Note:
See TracChangeset
for help on using the changeset viewer.