Changeset 1443
- Timestamp:
- 07/25/02 17:14:55 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1442 r1443 1 1 -*-*- END -*-*- 2 3 2002/07/25: Abelardo Moralejo 4 5 * manalysis/MCerPhotCalc2.[h,cc]: 6 - Changed fWeight into a TArrayF to make the class usable for 7 any number of FADC slices. 8 - added procedure SetDefaultWeights for initialization. 9 10 * macros/MagicHillas.C: 11 - changed accordingly 2 12 3 13 2002/07/25: Wolfgang Wittek, Thomas Bretz -
trunk/MagicSoft/Mars/macros/MagicHillas.C
r1424 r1443 106 106 // MCerPhotCalc2 ncalc; 107 107 // Example: use only 2nd to 6th FADC slices for photon calculation: 108 // Float_t w[15] = {0., 1., 1., 1., 1., 1., 0.,0.,0.,0.,0.,0.,0.,0.,0.}; 108 // const Float_t x[15]={0., 1., 1., 1., 1., 1., 0.,0.,0.,0.,0.,0.,0.,0.,0.}; 109 // TArrayF w(15,x); 109 110 // ncalc.SetWeights(w); 110 111 -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc2.cc
r1425 r1443 73 73 AddToBranchList("MRawEvtData.fHiGainFadcSamples"); 74 74 AddToBranchList("MRawEvtData.fLoGainFadcSamples"); 75 76 SetDefaultWeights(); 75 77 } 76 78 … … 115 117 // Calculate quadratic sum of weights: 116 118 fSumQuadWeights = 0.; 117 for (Int_t i = 0; i < 15; i++)119 for (Int_t i = 0; i < fWeight.GetSize(); i++) 118 120 fSumQuadWeights += fWeight[i]*fWeight[i]; 119 121 … … 138 140 } 139 141 140 if (fRunHeader->GetNumSamplesHiGain() != 15)141 { 142 *fLog << dbginf << "Number of FADC slices (" << fRunHeader->GetNumSamplesHiGain() <<") is different from expected (15)... aborting." << endl;142 if (fRunHeader->GetNumSamplesHiGain() != fWeight.GetSize()) 143 { 144 *fLog << dbginf << "Number of FADC slices (" << fRunHeader->GetNumSamplesHiGain() <<") is different from assumed one (" << fWeight.GetSize() << ")... aborting." << endl; 143 145 return kFALSE; 144 146 } … … 171 173 MRawEvtPixelIter pixel(fRawEvt); 172 174 173 Float_t BinSignal[15];175 TArrayF BinSignal(fWeight.GetSize()); 174 176 175 177 while (pixel.Next()) … … 194 196 Float_t nphot = 0.; 195 197 196 for(Int_t i = 0; i< 15; i++)198 for(Int_t i = 0; i<fWeight.GetSize(); i++) 197 199 { 198 200 BinSignal[i] = (Float_t) ptr[i] - mean; … … 212 214 } 213 215 214 // Default weights: 215 Float_t MCerPhotCalc2::fWeight[] = {0, 0.0809835, 0.289593, 0.366926, 0.211665, 0.0508328, 0., 0., 0., 0., 0., 0., 0., 0., 0.}; 216 // 217 // Set default values for the number of slices and weights: 218 // 219 220 void MCerPhotCalc2::SetDefaultWeights() 221 { 222 const Float_t dummy[15] = {0, 0.0809835, 0.289593, 0.366926, 0.211665, 0.0508328, 0., 0., 0., 0., 0., 0., 0., 0., 0.}; 223 224 fWeight.Set(15,dummy); 225 return; 226 } 227 228 229 230 -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc2.h
r1425 r1443 15 15 #endif 16 16 17 #include <TArrayF.h> 18 17 19 class MRawEvtData; 18 20 class MPedestalCam; 19 21 class MCerPhotEvt; 20 22 class MRawRunHeader; 23 class TArrayF; 21 24 22 25 class MCerPhotCalc2 : public MTask … … 29 32 Bool_t fEnableFix; // fix for a bug in files from older camera versions (<=40) 30 33 31 static Float_t fWeight[15]; // Weights for adding up the ADC slices34 TArrayF fWeight; // Weights for adding up the ADC slices 32 35 Float_t fSumQuadWeights; 36 37 void SetDefaultWeights(); 33 38 34 39 public: … … 39 44 Bool_t ReInit(MParList *pList); 40 45 41 void SetWeights( Float_t *w) {memcpy(fWeight,w,15*sizeof(Float_t));}46 void SetWeights(TArrayF w) {fWeight.Set(w.GetSize(),w.GetArray());} 42 47 43 48 ClassDef(MCerPhotCalc2, 0) // Task to calculate cerenkov photons from raw data
Note:
See TracChangeset
for help on using the changeset viewer.