Changeset 2946 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 01/28/04 16:55:40 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCerPhotAnal2.cc
r2386 r2946 31 31 // 32 32 // Input Containers: 33 // MRawEvtData, MPed estalCam33 // MRawEvtData, MPedPhotCam 34 34 // 35 35 // Output Containers: … … 48 48 #include "MRawEvtData.h" // MRawEvtData::GetNumPixels 49 49 #include "MCerPhotEvt.h" 50 #include "MPed estalPix.h"51 #include "MPed estalCam.h"50 #include "MPedPhotPix.h" 51 #include "MPedPhotCam.h" 52 52 #include "MRawEvtPixelIter.h" 53 53 … … 78 78 // - MRawRunHeader 79 79 // - MRawEvtData 80 // - MPed estalCam80 // - MPedPhotCam 81 81 // 82 82 // The following output containers are also searched and created if … … 116 116 } 117 117 118 fPedestals = (MPed estalCam*)pList->FindCreateObj("MPedestalCam");118 fPedestals = (MPedPhotCam*)pList->FindCreateObj("MPedPhotCam"); 119 119 if (runheader && !fPedestals) 120 120 return kFALSE; -
trunk/MagicSoft/Mars/manalysis/MCerPhotAnal2.h
r2265 r2946 16 16 17 17 class MRawEvtData; 18 class MPed estalCam;18 class MPedPhotCam; 19 19 class MCerPhotEvt; 20 20 class MRawRunHeader; … … 23 23 { 24 24 private: 25 MPed estalCam*fPedestals; // Pedestals of all pixels in the camera25 MPedPhotCam *fPedestals; // Pedestals of all pixels in the camera 26 26 MRawEvtData *fRawEvt; // raw event data (time slices) 27 27 MCerPhotEvt *fCerPhotEvt; // Cerenkov Photon Event used for calculation -
trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc
r2944 r2946 102 102 if (!fRawEvt) 103 103 { 104 *fLog << err << AddSerialNumber("MRawEvtData") << " not found... aborting." << endl;104 *fLog << err << AddSerialNumber("MRawEvtData") << " not found... aborting." << endl; 105 105 return kFALSE; 106 106 } … … 116 116 fPedestals = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam")); 117 117 if (!fPedestals) 118 118 { 119 119 *fLog << err << AddSerialNumber("MPedestalCam") << " not found... aborting" << endl; 120 120 return kFALSE; 121 122 } 121 } 123 122 124 123 fArrivalTime = (MArrivalTime*)pList->FindCreateObj(AddSerialNumber("MArrivalTime")); 124 if (!fArrivalTime) 125 return kFALSE; 125 126 126 127 return kTRUE; … … 135 136 Bool_t MExtractSignal::ReInit(MParList *pList ) 136 137 { 137 138 138 MGeomCam *cam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam")); 139 139 if (!cam) … … 143 143 } 144 144 145 return kTRUE; 146 } 147 145 return kTRUE; 146 } 148 147 149 148 // -------------------------------------------------------------------------- … … 154 153 Int_t MExtractSignal::Process() 155 154 { 156 157 155 MRawEvtPixelIter pixel(fRawEvt); 158 156 fSignals->Clear(); … … 165 163 UShort_t satLo = 0; 166 164 167 Byte_t *ptr = pixel.GetHiGainSamples(); 168 Byte_t *first = ptr + fHiGainFirst; 169 Byte_t *last = ptr + fHiGainFirst + fNumHiGainSamples; 170 171 UInt_t sumHi = 0; 172 UInt_t sumLo = 0; 165 UInt_t sumHi = 0; 166 UInt_t sumLo = 0; 167 168 Byte_t maxhi = 0; 169 Byte_t midhi = 0; 170 171 Byte_t *ptr = pixel.GetHiGainSamples() + fHiGainFirst; 172 Byte_t *last = ptr + fNumHiGainSamples; 173 174 while (ptr<last) 175 { 176 sumHi += *ptr; 177 178 if (*ptr > maxhi) 179 { 180 maxhi = *ptr; 181 midhi = ptr-pixel.GetHiGainSamples(); 182 } 183 184 if (*ptr >= fSaturationLimit) 185 satHi++; 186 187 ptr++; 188 } 189 190 ptr = pixel.GetLoGainSamples() + fLoGainFirst; 191 last = ptr + fNumLoGainSamples; 192 193 Byte_t maxlo = 0; 194 Byte_t midlo = 0; 195 196 while (ptr<last) 197 { 198 sumLo += *ptr; 199 200 if (*ptr > maxlo) 201 { 202 maxlo = *ptr; 203 midlo = ptr-pixel.GetLoGainSamples(); 204 } 205 206 if (*ptr >= fSaturationLimit) 207 satLo++; 208 209 ptr++; 210 } 211 212 if (satLo) 213 satlo++; 173 214 174 215 const Int_t pixid = pixel.GetPixelId(); 216 175 217 const MPedestalPix &ped = (*fPedestals)[pixid]; 176 218 MExtractedSignalPix &pix = (*fSignals)[pixid]; 177 219 178 const Float_t pedes = ped.GetPedestal(); 179 const Float_t pedrms = ped.GetPedestalRms(); 180 181 Byte_t maxhi = 0; 182 Byte_t midhi = 0; 183 184 for (ptr=first;ptr<last;ptr++) 185 { 186 187 if (*ptr > maxhi) 188 { 189 maxhi = *ptr; 190 midhi = ptr-first; 191 } 192 193 sumHi += *ptr; 194 195 if (*ptr >= fSaturationLimit) 196 satHi++; 197 198 } 199 200 ptr = pixel.GetLoGainSamples(); 201 first = ptr + fLoGainFirst; 202 last = ptr + fLoGainFirst + fNumLoGainSamples; 203 Byte_t maxlo = 0; 204 Byte_t midlo = 0; 205 206 for (ptr=first;ptr<last;ptr++) 207 { 208 209 if (*ptr > maxlo) 210 { 211 maxlo = *ptr; 212 midlo = ptr-first; 213 } 214 215 sumLo += *ptr; 216 217 if (*ptr >= fSaturationLimit) 218 satLo++; 219 } 220 221 if (satLo) 222 satlo++; 223 224 pix.SetExtractedSignal((Float_t)sumHi - pedes*(Float_t)fNumHiGainSamples, 225 pedrms*fSqrtHiGainSamples, 226 (Float_t)sumLo - pedes*(Float_t)fNumLoGainSamples, 227 pedrms*fSqrtLoGainSamples); 220 const Float_t pedes = ped.GetPedestal(); 221 const Float_t pedrms = ped.GetPedestalRms(); 222 223 pix.SetExtractedSignal(sumHi - pedes*fNumHiGainSamples, pedrms*fSqrtHiGainSamples, 224 sumLo - pedes*fNumLoGainSamples, pedrms*fSqrtLoGainSamples); 228 225 229 226 pix.SetGainSaturation(satHi, satHi, satLo); 230 227 231 if (satHi) 232 fArrivalTime->SetTime(pixid,(Float_t)(midlo+fLoGainFirst)); 233 else 234 fArrivalTime->SetTime(pixid,(Float_t)(midhi+fHiGainFirst)); 235 236 228 fArrivalTime->SetTime(pixid, satHi?midlo:midhi); 237 229 238 230 } /* while (pixel.Next()) */
Note:
See TracChangeset
for help on using the changeset viewer.