Changeset 3368
- Timestamp:
- 03/01/04 13:14:28 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/msignal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MArrivalTimeCalc.cc
r3320 r3368 55 55 #include "MRawEvtPixelIter.h" 56 56 57 #include "MPedestalCam.h" 58 #include "MPedestalPix.h" 59 57 60 ClassImp(MArrivalTimeCalc); 58 61 … … 76 79 // The PreProcess searches for the following input containers: 77 80 // - MRawEvtData 78 // - M ArrivalTime81 // - MPedestalCam 79 82 // 80 83 // The following output containers are also searched and created if 81 84 // they were not found: 82 // - MArrivalTime 85 // - MArrivalTimeCam 83 86 // 84 87 … … 93 96 return kFALSE; 94 97 } 98 99 fPedestals = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam")); 100 if (!fPedestals) 101 { 102 *fLog << err << AddSerialNumber("MPedestalCam") << " not found... aborting" << endl; 103 return kFALSE; 104 } 105 95 106 96 107 fArrTime = (MArrivalTimeCam*)pList->FindCreateObj(AddSerialNumber("MArrivalTimeCam")); … … 142 153 143 154 const Short_t nslices = fRawEvt->GetNumLoGainSamples(); 144 time = Calc(pixel.GetLoGainSamples(),nslices );155 time = Calc(pixel.GetLoGainSamples(),nslices,idx); 145 156 } 146 157 … … 153 164 154 165 const Short_t nslices = fRawEvt->GetNumHiGainSamples(); 155 time = Calc(pixel.GetHiGainSamples(),nslices );166 time = Calc(pixel.GetHiGainSamples(),nslices,idx); 156 167 } 157 168 … … 174 185 // Case 1: MCubicSpline (3rd order spline) 175 186 // 176 Float_t MArrivalTimeCalc::Calc(const Byte_t *fadcSamples, const Short_t nslices )187 Float_t MArrivalTimeCalc::Calc(const Byte_t *fadcSamples, const Short_t nslices, const UInt_t idx) 177 188 { 178 189 … … 185 196 // Now find the maximum 186 197 // 187 return (Float_t)spline->EvalAbMax(); 188 } 189 198 Double_t abMaximum = spline->EvalAbMax(); 199 Double_t maximum = spline->EvalMax(); 200 const MPedestalPix &ped = (*fPedestals)[idx]; 201 const Float_t halfMax = (maximum - ped.GetPedestal())/2; 202 return (halfMax > 0.0) ? (Float_t ) spline->FindVal(halfMax,abMaximum,'l'): 0.0; 203 204 } 205 -
trunk/MagicSoft/Mars/msignal/MArrivalTimeCalc.h
r3320 r3368 9 9 class MRawRunHeader; 10 10 class MArrivalTimeCam; 11 class MPedestalCam; 11 12 class MArrivalTimeCalc : public MTask 12 13 { … … 14 15 MRawEvtData *fRawEvt; // raw event data (time slices) 15 16 MRawRunHeader *fRunHeader; // RunHeader information 17 MPedestalCam *fPedestals; // pedestal information 16 18 17 19 MArrivalTimeCam *fArrTime; // Container with the photons arrival times … … 22 24 Int_t PostProcess() {return kTRUE;} 23 25 24 Float_t Calc(const Byte_t *fadcSamples, const Short_t nslices );26 Float_t Calc(const Byte_t *fadcSamples, const Short_t nslices, const UInt_t idx); 25 27 26 28 public:
Note:
See TracChangeset
for help on using the changeset viewer.