- Timestamp:
- 02/03/04 14:42:26 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3009 r3010 8 8 * mfileio/MReadTree.cc: 9 9 - fixed handling of -1 entries in AddFile: root 3.10/02 crashed 10 11 * manalysis/MExtractSignal.[h,cc]: 12 - moved code to extract the signal from Process to 13 new member function FindSignal, I left the arrival time 14 extraction as commented-out code in the code just as a 15 demonstration to do this very fast. 10 16 11 17 -
trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc
r2994 r3010 122 122 } 123 123 124 void MExtractSignal::FindSignal(Byte_t *ptr, Int_t size, Int_t &sum, Byte_t &sat/*, Byte_t* &max*/) const 125 { 126 Byte_t *end = ptr + size; 127 128 sum = 0; 129 sat = 0; 130 //max = ptr; 131 while (ptr<end) 132 { 133 sum += *ptr; 134 135 //if (*ptr>*max) 136 // max = ptr; 137 138 if (*ptr++ >= fSaturationLimit) 139 sat++; 140 } 141 } 142 124 143 // -------------------------------------------------------------------------- 125 144 // … … 132 151 fSignals->Clear(); 133 152 134 UInt_t sat lo=0;153 UInt_t sat=0; 135 154 136 155 while (pixel.Next()) 137 156 { 138 UShort_t satHi = 0; 139 UShort_t satLo = 0; 140 141 UInt_t sumHi = 0; 142 UInt_t sumLo = 0; 143 144 Byte_t maxhi = 0; 145 Byte_t midhi = 0; 146 147 Byte_t *ptr = pixel.GetHiGainSamples() + fHiGainFirst; 148 Byte_t *last = ptr + fNumHiGainSamples; 149 150 while (ptr<last) 151 { 152 sumHi += *ptr; 153 154 if (*ptr > maxhi) 155 { 156 maxhi = *ptr; 157 midhi = ptr-pixel.GetHiGainSamples(); 158 } 159 160 if (*ptr >= fSaturationLimit) 161 satHi++; 162 163 ptr++; 164 } 165 166 ptr = pixel.GetLoGainSamples() + fLoGainFirst; 167 last = ptr + fNumLoGainSamples; 168 169 Byte_t maxlo = 0; 170 Byte_t midlo = 0; 171 172 while (ptr<last) 173 { 174 sumLo += *ptr; 175 176 if (*ptr > maxlo) 177 { 178 maxlo = *ptr; 179 midlo = ptr-pixel.GetLoGainSamples(); 180 } 181 182 if (*ptr >= fSaturationLimit) 183 satLo++; 184 185 ptr++; 186 } 187 188 if (satLo) 189 satlo++; 157 Int_t sumhi, sumlo; 158 Byte_t sathi, satlo; 159 //Byte_t *maxhi, *maxlo; 160 161 FindSignal(pixel.GetHiGainSamples()+fHiGainFirst, fNumHiGainSamples, sumhi, sathi);//, maxhi); 162 FindSignal(pixel.GetLoGainSamples()+fLoGainFirst, fNumLoGainSamples, sumlo, satlo);//, maxlo); 163 164 if (satlo) 165 sat++; 190 166 191 167 const Int_t pixid = pixel.GetPixelId(); … … 197 173 const Float_t pedrms = ped.GetPedestalRms(); 198 174 199 pix.SetExtractedSignal(sumHi - pedes*fNumHiGainSamples, pedrms*fSqrtHiGainSamples, 200 sumLo - pedes*fNumLoGainSamples, pedrms*fSqrtLoGainSamples); 201 202 pix.SetGainSaturation(satHi, satHi, satLo); 203 204 } /* while (pixel.Next()) */ 205 206 if (satlo) 207 *fLog << warn << "WARNING - Lo Gain saturated in " << satlo << " pixels." << endl; 208 175 pix.SetExtractedSignal(sumhi - pedes*fNumHiGainSamples, pedrms*fSqrtHiGainSamples, 176 sumlo - pedes*fNumLoGainSamples, pedrms*fSqrtLoGainSamples); 177 178 pix.SetGainSaturation(sathi, sathi, satlo); 179 180 /* 181 const Byte_t midhi = maxhi-pixel.GetHiGainSamples(); 182 const Byte_t midlo = maxlo-pixel.GetLoGainSamples(); 183 184 fArrivalTime->SetTime(pixid, sathi?midlo:midhi); 185 */ 186 187 } /* while (pixel.Next()) */ 188 189 if (sat) 190 *fLog << warn << "WARNING - Lo Gain saturated in " << sat << " pixels." << endl; 209 191 210 192 fSignals->SetReadyToSave(); -
trunk/MagicSoft/Mars/manalysis/MExtractSignal.h
r2958 r3010 20 20 class MPedestalCam; 21 21 class MExtractedSignalCam; 22 class MArrivalTime;23 22 24 23 class MExtractSignal : public MTask … … 35 34 MRawRunHeader *fRunHeader; // RunHeader information 36 35 37 MArrivalTime *fArrivalTime; // Arrival Time of FADC sample38 39 36 Byte_t fHiGainFirst; 40 37 Byte_t fLoGainFirst; … … 47 44 48 45 Byte_t fSaturationLimit; 46 47 void FindSignal(Byte_t *ptr, Int_t size, Int_t &sum, Byte_t &sat/*, Byte_t* &mid*/) const; 49 48 50 49 Int_t PreProcess(MParList *pList);
Note:
See TracChangeset
for help on using the changeset viewer.