Changeset 8918
- Timestamp:
- 06/03/08 12:34:58 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mextralgo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mextralgo/MExtralgoDigitalFilter.cc
r8500 r8918 19 19 ! Author(s): Thomas Bretz, 08/2006 <mailto:tbretz@astro.uni-wuerzburg.de> 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 621 ! Copyright: MAGIC Software Development, 2000-2008 22 22 ! 23 23 ! … … 31 31 #include "MExtralgoDigitalFilter.h" 32 32 33 #include <TMath.h> 33 34 #include <TRandom.h> 34 35 … … 139 140 } 140 141 141 #include <iostream> 142 Int_t MExtralgoDigitalFilter::AlignExtractionWindow(Int_t &maxp, Int_t &frac, const Double_t ampsum) 143 { 144 // Align extraction window to signal position 145 146 const Double_t timesum = Eval(fWeightsTime, maxp, frac); 147 148 // Because fWeightsPerBin/2 doesn't correspond to the center 149 // of a bin the time-values extracted are slightly positive. 150 // They are roughly between -0.45 and 0.55 151 const Double_t binoffset = TMath::Even(fWeightsPerBin) ? 0.5 : 0; 152 153 // This is the time offset from the extraction position 154 Double_t tmoffset = (frac+binoffset)/fWeightsPerBin + timesum/ampsum; 155 156 // Convert the residual fraction of one slice into an 157 // offset position in the extraction weights 158 const Int_t integ = TMath::FloorNint(tmoffset+0.5); 159 160 /* 161 if (integ>0) 162 tmoffset=0.49-0.05; 163 if (integ<0) 164 tmoffset=-0.49-0.05; 165 integ=0; 166 */ 167 168 // move the extractor by an offset number of slices 169 // determined by the extracted time 170 maxp -= integ; 171 172 frac = TMath::FloorNint((tmoffset-integ)*fWeightsPerBin); 173 174 // Align maxp into available range (TO BE CHECKED) 175 AlignIntoLimits(maxp, frac); 176 177 return integ; 178 } 179 142 180 void MExtralgoDigitalFilter::Extract(Int_t maxpos) 143 181 { -
trunk/MagicSoft/Mars/mextralgo/MExtralgoDigitalFilter.h
r8500 r8918 11 11 class TH2F; 12 12 class TArrayF; 13 14 //#include <TMatrix.h>15 13 16 14 class MExtralgoDigitalFilter … … 97 95 } 98 96 99 inline Int_t AlignExtractionWindow(Int_t &maxp, Int_t &frac, const Double_t ampsum) 100 { 101 // Align extraction window to signal position 102 103 const Double_t timesum = Eval(fWeightsTime, maxp, frac); 104 105 // Because fWeightsPerBin/2 doesn't correspond to the center 106 // of a bin the time-values extracted are slightly positive. 107 // They are roughly between -0.45 and 0.55 108 const Double_t binoffset = TMath::Even(fWeightsPerBin) ? 0.5 : 0; 109 110 // This is the time offset from the extraction position 111 Double_t tmoffset = (frac+binoffset)/fWeightsPerBin + timesum/ampsum; 112 113 // Convert the residual fraction of one slice into an 114 // offset position in the extraction weights 115 const Int_t integ = TMath::FloorNint(tmoffset+0.5); 116 117 /* 118 if (integ>0) 119 tmoffset=0.49-0.05; 120 if (integ<0) 121 tmoffset=-0.49-0.05; 122 integ=0; 123 */ 124 125 // move the extractor by an offset number of slices 126 // determined by the extracted time 127 maxp -= integ; 128 129 frac = TMath::FloorNint((tmoffset-integ)*fWeightsPerBin); 130 131 // Align maxp into available range (TO BE CHECKED) 132 AlignIntoLimits(maxp, frac); 133 134 return integ; 135 } 136 137 inline void AlignExtractionWindow(Int_t &maxp, Int_t &frac) 97 inline Int_t AlignExtractionWindow(Int_t &maxp, Int_t &frac, const Double_t ampsum); 98 inline void AlignExtractionWindow(Int_t &maxp, Int_t &frac) 138 99 { 139 100 const Double_t amp = Eval(fWeightsAmp, maxp, frac);
Note:
See TracChangeset
for help on using the changeset viewer.