Changeset 1545 for trunk/MagicSoft/Mars
- Timestamp:
- 10/16/02 20:34:41 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1543 r1545 1 1 -*-*- END -*-*- 2 3 2002/10/16: Abelardo Moralejo 4 5 * manalysis/MCerPhotCalc2.[h,cc], MCerPhotCalc.[h,cc] 6 - Class MCerPhotCalc2 renamed MCerPhotCalc (they were redundant). 7 - Now the default pixel treatment is the same as originally: add 8 all FADC slices 9 2 10 2002/10/16: Thomas Bretz 3 11 -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
r1537 r1545 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>19 ! 20 ! Copyright: MAGIC Software Development, 200 0-200118 ! Author(s): Abelardo Moralejo 7/2002 (moralejo@pd.infn.it) 19 ! 20 ! Copyright: MAGIC Software Development, 2002 21 21 ! 22 22 ! … … 25 25 ////////////////////////////////////////////////////////////////////////////// 26 26 // // 27 // MCerPhotCalc 27 // MCerPhotCalc // 28 28 // // 29 29 // This is a task which calculates the number of photons from the FADC // 30 // time slices. At the moment it integrates simply the FADC values. // 30 // time slices. It weights the each slice according to the numbers in // 31 // the array fWeight (default: all slices added up with weight 1). 31 32 // // 32 33 // Input Containers: // 33 // MRaw EvtData, MPedesdtalCam//34 // MRawRunHeader, MRawEvtData, MPedestalCam // 34 35 // // 35 36 // Output Containers: // … … 63 64 { 64 65 fName = name ? name : "MCerPhotCalc"; 65 fTitle = title ? title : "Task to calculate Cerenkov photonsfrom raw data";66 fTitle = title ? title : "Task to calculate pixel signal from raw data"; 66 67 67 68 AddToBranchList("MRawEvtData.fHiGainPixId"); … … 70 71 AddToBranchList("MRawEvtData.fLoGainFadcSamples"); 71 72 73 SetDefaultWeights(); 72 74 } 73 75 … … 99 101 } 100 102 101 fPedestals = (MPedestalCam*)pList->Find Object("MPedestalCam");103 fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam"); 102 104 if (!fPedestals) 103 105 { … … 109 111 if (!fCerPhotEvt) 110 112 return kFALSE; 113 114 // Calculate quadratic sum of weights: 115 fSumQuadWeights = 0.; 116 for (Int_t i = 0; i < fWeight.GetSize(); i++) 117 fSumQuadWeights += fWeight[i]*fWeight[i]; 118 119 fSumQuadWeights = sqrt(fSumQuadWeights); 111 120 112 121 return kTRUE; … … 128 137 } 129 138 139 if (fRunHeader->GetNumSamplesHiGain() != fWeight.GetSize()) 140 { 141 *fLog << dbginf << "Number of FADC slices (" << fRunHeader->GetNumSamplesHiGain() <<") is different from assumed one (" << fWeight.GetSize() << ")... aborting." << endl; 142 return kFALSE; 143 } 144 130 145 if (runheader->GetRunType() != kRTMonteCarlo) 131 146 return kTRUE; … … 156 171 MRawEvtPixelIter pixel(fRawEvt); 157 172 173 TArrayF BinSignal(fWeight.GetSize()); 174 158 175 while (pixel.Next()) 159 {176 { 160 177 const UInt_t pixid = pixel.GetPixelId(); 161 162 178 const MPedestalPix &ped = (*fPedestals)[pixid]; 163 179 … … 171 187 } 172 188 173 Float_t nphot = (Float_t)pixel.GetSumHiGainSamples(); 174 175 // 176 // We check that the pixel is not empty, if it is empty 177 // we won't substract the pedestal. Empty means that it has 178 // 0 signal in all the slices. 179 // 189 // Mean pedestal: 180 190 const Double_t mean = fEnableFix ? ped.GetMean()-0.5 : ped.GetMean(); 181 if (nphot!=0) 182 nphot -= fRunHeader->GetNumSamplesHiGain()*mean; 183 184 fCerPhotEvt->AddPixel(pixid, nphot, sqrt(fRunHeader->GetNumSamplesHiGain())*ped.GetSigma()); 191 192 Byte_t *ptr = pixel.GetHiGainSamples(); 193 194 Float_t nphot = 0.; 195 196 for(Int_t i = 0; i<fWeight.GetSize(); i++) 197 { 198 BinSignal[i] = (Float_t) ptr[i] - mean; 199 nphot += BinSignal[i] * fWeight[i]; 200 } 201 202 Float_t nphoterr = ped.GetSigma()* fSumQuadWeights; 203 204 fCerPhotEvt->AddPixel(pixid, nphot, nphoterr); 185 205 186 206 // FIXME! Handling of Lo Gains is missing! 187 }207 } 188 208 189 209 fCerPhotEvt->SetReadyToSave(); … … 191 211 return kTRUE; 192 212 } 213 214 // 215 // Set default values for the number of slices and weights: 216 // 217 218 void MCerPhotCalc::SetDefaultWeights() 219 { 220 const Float_t dummy[15] = {1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,}; 221 222 fWeight.Set(15,dummy); 223 return; 224 } 225 226 227 228
Note:
See TracChangeset
for help on using the changeset viewer.