- Timestamp:
- 11/28/01 10:15:33 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
r1081 r1092 45 45 #include "MLogManip.h" 46 46 47 #include "MRawRunHeader.h" 47 48 #include "MRawEvtData.h" // MRawEvtData::GetNumPixels 48 49 #include "MCerPhotEvt.h" … … 66 67 AddToBranchList("fHiGainFadcSamples"); 67 68 AddToBranchList("fLoGainFadcSamples"); 69 68 70 } 69 71 … … 71 73 // 72 74 // The PreProcess searches for the following input containers: 75 // - MRawRunHeader 73 76 // - MRawEvtData 74 77 // - MPedestalCam … … 80 83 Bool_t MCerPhotCalc::PreProcess(MParList *pList) 81 84 { 85 MRawRunHeader *RunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 86 if (!RunHeader) 87 { 88 *fLog << dbginf << "MRawRunHeader not found... aborting." << endl; 89 return kFALSE; 90 } 91 fNumLoGainFadcSlices= RunHeader->GetNumSamplesLoGain(); 92 fNumHiGainFadcSlices= RunHeader->GetNumSamplesHiGain(); 93 82 94 fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData"); 83 95 if (!fRawEvt) … … 103 115 // -------------------------------------------------------------------------- 104 116 // 105 // Calculate the integral of the FADC time sl aices and store them as a new117 // Calculate the integral of the FADC time slices and store them as a new 106 118 // pixel in the MCerPhotEvt container. 107 119 // … … 111 123 112 124 MRawEvtPixelIter pixel(fRawEvt); 125 113 126 while (pixel.Next()) 114 127 { 128 115 129 const UInt_t pixid = pixel.GetPixelId(); 116 130 117 131 const MPedestalPix &ped = (*fPedestals)[pixid]; 118 132 119 const Float_t nphot = (Float_t)pixel.GetSumHiGainSamples() - ped.GetMean();133 Float_t nphot = (Float_t)pixel.GetSumHiGainSamples(); 120 134 121 fCerPhotEvt->AddPixel(pixid, nphot, ped.GetMeanRms()); 135 if(nphot>0) nphot -= fNumHiGainFadcSlices*ped.GetMean(); 136 137 fCerPhotEvt->AddPixel(pixid, nphot, sqrt(fNumHiGainFadcSlices)*ped.GetMeanRms()); 122 138 123 139 // FIXME! Handling of Lo Gains is missing! … … 128 144 return kTRUE; 129 145 } 130
Note:
See TracChangeset
for help on using the changeset viewer.