Changeset 5701 for trunk/MagicSoft/Mars/msignal
- Timestamp:
- 01/05/05 14:29:59 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/msignal
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MArrivalTimePix.cc
r3899 r5701 53 53 // 54 54 MArrivalTimePix::MArrivalTimePix(const char* name, const char* title) 55 : fArrivalTimeHiGain(gkSignalInitializer),56 fArrivalTimeHiGainError(gkSignalInitializer),57 fArrivalTimeLoGain(gkSignalInitializer),58 fArrivalTimeLoGainError(gkSignalInitializer),59 fNumHiGainSaturated(0),60 fNumLoGainSaturated(0)61 55 { 62 56 fName = name ? name : "MArrivalTimePix"; 63 57 fTitle = title ? title : "Container of the Extracted Signals"; 58 59 Clear(); 64 60 } 65 61 … … 71 67 { 72 68 fArrivalTimeHiGain = gkSignalInitializer; 73 fArrivalTimeHiGainError = gkSignalInitializer;69 fArrivalTimeHiGainError = -1; 74 70 fArrivalTimeLoGain = gkSignalInitializer; 75 fArrivalTimeLoGainError = gkSignalInitializer;71 fArrivalTimeLoGainError = -1; 76 72 77 73 fNumHiGainSaturated = 0; … … 96 92 Bool_t MArrivalTimePix::IsValid() const 97 93 { 98 return fArrivalTimeHiGain >= 0. || fArrivalTimeHiGainError >= 0.;94 return (!IsLoGainUsed() && fArrivalTimeHiGainError >= 0) || (IsLoGainUsed() && fArrivalTimeLoGainError >= 0); 99 95 } 100 96 -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc
r5601 r5701 171 171 // Find signal in hi- and lo-gain 172 172 // 173 Float_t sumhi =0., deltasumhi =0 .;174 Float_t timehi=0., deltatimehi=0 .;173 Float_t sumhi =0., deltasumhi =0; // Set hi-gain of MExtractedSignalPix valid 174 Float_t timehi=0., deltatimehi=0; // Set hi-gain of MArrivalTimePix valid 175 175 Byte_t sathi=0; 176 176 177 const Int_t pixid = pixel.GetPixelId();178 const MPedestalPix &ped = (*fPedestals)[pixid ];177 const Int_t pixidx = pixel.GetPixelId(); 178 const MPedestalPix &ped = (*fPedestals)[pixidx]; 179 179 const Bool_t higainabflag = pixel.HasABFlag(); 180 180 … … 183 183 timehi, deltatimehi, 184 184 sathi, ped, higainabflag); 185 186 // Make sure that in cases the time couldn't be correctly determined 187 // more meaningfull default values are assigned 188 if (timehi<0) 189 timehi = -1; 190 if (timehi>pixel.GetNumHiGainSamples()) 191 timehi = pixel.GetNumHiGainSamples(); 185 192 186 Float_t sumlo =0., deltasumlo = 0.;187 Float_t timelo=0., deltatimelo= 0.;193 Float_t sumlo =0., deltasumlo =-1.; // invalidate logain of MExtractedSignalPix 194 Float_t timelo=0., deltatimelo=-1; // invalidate logain of MArrivalTimePix 188 195 Byte_t satlo=0; 189 196 … … 192 199 // 193 200 if (pixel.HasLoGain()) 194 { 201 { 202 deltasumlo = 0; // make logain of MExtractedSignalPix valid 203 deltatimelo = 0; // make logain of MArrivalTimePix valid 204 195 205 fLoGainFirstSave = fLoGainFirst; 196 206 const Byte_t logainstart = (Byte_t)(timehi+fLoGainStartShift); 197 207 if (!sathi) 198 fLoGainFirst = logainstart > fLoGainFirstSave ? logainstart : fLoGainFirstSave;199 200 if ( fLoGainFirst < fLoGainLast)201 208 fLoGainFirst = logainstart > fLoGainFirstSave ? logainstart : fLoGainFirstSave; 209 210 if (fLoGainFirst < fLoGainLast) 211 { 202 212 const Bool_t logainabflag = (higainabflag + pixel.GetNumHiGainSamples()) & 0x1; 203 FindTimeAndChargeLoGain(pixel.GetLoGainSamples()+fLoGainFirst, 204 sumlo, deltasumlo, 205 timelo, deltatimelo, 213 FindTimeAndChargeLoGain(pixel.GetLoGainSamples()+fLoGainFirst, 214 sumlo, deltasumlo, 215 timelo, deltatimelo, 206 216 satlo, ped, logainabflag); 207 } 208 fLoGainFirst = fLoGainFirstSave; 209 } 210 211 MExtractedSignalPix &pix = (*fSignals)[pixid]; 212 MArrivalTimePix &tix = (*fArrTime)[pixid]; 217 } 218 fLoGainFirst = fLoGainFirstSave; 219 220 // Make sure that in cases the time couldn't be correctly determined 221 // more meaningfull default values are assigned 222 if (timelo<0) 223 timelo = -1; 224 if (timelo>pixel.GetNumLoGainSamples()) 225 timelo = pixel.GetNumLoGainSamples(); 226 } 227 228 MExtractedSignalPix &pix = (*fSignals)[pixidx]; 229 MArrivalTimePix &tix = (*fArrTime)[pixidx]; 213 230 214 231 pix.SetExtractedSignal(sumhi, deltasumhi,sumlo, deltasumlo); 215 232 pix.SetGainSaturation(sathi, sathi, satlo); 216 233 217 234 tix.SetArrivalTime(timehi, deltatimehi, timelo-fOffsetLoGain, deltatimelo); 218 235 tix.SetGainSaturation(sathi, sathi, satlo); -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
r5570 r5701 517 517 { 518 518 const Int_t idx = fBinningResolutionLoGain*sample + fBinningResolutionHalfLoGain + t_iter; 519 const Int_t ids = max_p + sample; ;519 const Int_t ids = max_p + sample; 520 520 const Float_t pex = ids < 0 ? 0. : ( ids >= range ? 0. : fLoGainSignal[ids]); 521 521 sum += fAmpWeightsLoGain [idx]*pex; -
trunk/MagicSoft/Mars/msignal/MExtractedSignalPix.cc
r3306 r5701 53 53 // 54 54 MExtractedSignalPix::MExtractedSignalPix(const char* name, const char* title) 55 : fExtractedSignalHiGain(gkSignalInitializer),56 fExtractedSignalHiGainError(gkSignalInitializer),57 fExtractedSignalLoGain(gkSignalInitializer),58 fExtractedSignalLoGainError(gkSignalInitializer),59 fLoGainUsed(kFALSE),60 fNumHiGainSaturated(0),61 fNumLoGainSaturated(0)62 55 { 63 56 fName = name ? name : "MExtractedSignalPix"; 64 57 fTitle = title ? title : "Container of the Extracted Signals"; 58 59 Clear(); 65 60 } 66 61 … … 72 67 { 73 68 fExtractedSignalHiGain = gkSignalInitializer; 74 fExtractedSignalHiGainError = gkSignalInitializer;69 fExtractedSignalHiGainError = -1; 75 70 fExtractedSignalLoGain = gkSignalInitializer; 76 fExtractedSignalLoGainError = gkSignalInitializer;71 fExtractedSignalLoGainError = -1; 77 72 78 73 fLoGainUsed = kFALSE; … … 99 94 Bool_t MExtractedSignalPix::IsValid() const 100 95 { 101 return fExtractedSignalHiGain >= 0. || fExtractedSignalHiGainError >= 0.;96 return (!IsLoGainUsed() && fExtractedSignalHiGainError >= 0) || (IsLoGainUsed() && fExtractedSignalLoGainError >= 0); 102 97 } 103 98
Note:
See TracChangeset
for help on using the changeset viewer.