Changeset 2178 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 06/16/03 13:45:01 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
r2173 r2178 32 32 // the array fWeight (default: all slices added up with weight 1). 33 33 // 34 // The weights are rescaled, such that sum(weigths)=num slices 35 // 34 36 // Input Containers: 35 37 // MRawRunHeader, MRawEvtData, MPedestalCam … … 112 114 113 115 // Calculate quadratic sum of weights: 114 fSumQuadWeights = 0.; 115 for (Int_t i = 0; i < fWeight.GetSize(); i++) 116 fSumWeights = 0; 117 fSumQuadWeights = 0; 118 for (Int_t i=0; i<fWeight.GetSize(); i++) 119 { 120 fSumWeights += fWeight[i]; 116 121 fSumQuadWeights += fWeight[i]*fWeight[i]; 122 } 117 123 118 124 fSumQuadWeights = sqrt(fSumQuadWeights); … … 169 175 170 176 MRawEvtPixelIter pixel(fRawEvt); 171 172 TArrayF binsignal(fWeight.GetSize());173 177 174 178 while (pixel.Next()) … … 194 198 // Calculate pixel signal unless it has all FADC slices empty: 195 199 // 196 const Byte_t *ptr = pixel.GetHiGainSamples(); 197 198 Float_t nphot = 0; 199 Float_t nphoterr = 0; 200 201 if (pixel.GetSumHiGainSamples()>0) 202 { 203 for (Int_t i=0; i<fWeight.GetSize(); i++) 204 { 205 binsignal[i] = ptr[i] - mean; 206 nphot += binsignal[i] * fWeight[i]; 207 } 208 nphoterr = ped.GetSigma() * fSumQuadWeights; 209 } 200 Byte_t *ptr = pixel.GetHiGainSamples(); 201 202 Float_t nphot = 0; 203 for(Int_t i=0; i<fWeight.GetSize(); i++) 204 nphot += ptr[i]*fWeight[i]; 205 206 nphot -= mean*fSumWeights; 207 208 const Float_t nphoterr = ped.GetSigma()* fSumQuadWeights; 210 209 211 210 fCerPhotEvt->AddPixel(pixid, nphot, nphoterr); -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.h
r1715 r2178 33 33 34 34 TArrayF fWeight; // Weights for adding up the ADC slices 35 Float_t fSumWeights; 35 36 Float_t fSumQuadWeights; 36 37 -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
r2173 r2178 384 384 fNumPixels=fPixels->GetEntriesFast(); 385 385 } 386 387 Bool_t MCerPhotEvt::GetPixelContent(Float_t &val, Int_t idx, Float_t ratio, Int_t type) const 388 { 389 MCerPhotPix *pix = GetPixById(idx); 390 if (!pix || !pix->IsPixelUsed()) 391 return kFALSE; 392 393 switch (type) 394 { 395 case 1: 396 val = pix->GetErrorPhot()*TMath::Sqrt(ratio); 397 return kTRUE; 398 case 2: 399 if (pix->GetErrorPhot()<=0) 400 return kFALSE; 401 val = pix->GetNumPhotons()*TMath::Sqrt(ratio)/pix->GetErrorPhot(); 402 return kTRUE; 403 default: 404 val = pix->GetNumPhotons()*ratio; 405 return kTRUE; 406 } 407 return kTRUE; 408 } -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
r2147 r2178 4 4 #ifndef ROOT_TClonesArray 5 5 #include <TClonesArray.h> 6 #endif 7 #ifndef MARS_MCamEvent 8 #include "MCamEvent.h" 6 9 #endif 7 10 #ifndef MARS_MCerPhotPix … … 12 15 class MCerPhotPix; 13 16 14 class MCerPhotEvt : public M ParContainer17 class MCerPhotEvt : public MCamEvent 15 18 { 16 19 private: … … 61 64 void Clear(Option_t *opt=NULL) { Reset(); } 62 65 66 Bool_t GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const; 67 void DrawPixelContent(Int_t num) const 68 { 69 } 70 63 71 ClassDef(MCerPhotEvt, 1) // class for an event containing cerenkov photons 64 72 }; -
trunk/MagicSoft/Mars/manalysis/MCurrents.h
r2173 r2178 2 2 #define MARS_MCurrents 3 3 4 #ifndef MARS_M ParContainer5 #include "M ParContainer.h"4 #ifndef MARS_MCamEvent 5 #include "MCamEvent.h" 6 6 #endif 7 7 … … 10 10 #endif 11 11 12 class MCurrents : public MParContainer 12 #include <iostream.h> 13 class MCurrents : public MCamEvent 13 14 { 14 15 private: … … 37 38 void Print(Option_t *opt=NULL) const; 38 39 40 Bool_t GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const 41 { 42 val = (*this)[idx]; 43 return val>0; 44 } 45 void DrawPixelContent(Int_t num) const 46 { 47 } 48 39 49 ClassDef(MCurrents, 1) // Storage Container for the Currents (PRELIMINARY) 40 50 }; -
trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc
r2173 r2178 16 16 ! 17 17 ! 18 ! Author(s): Oscar Blanch 11/2001 <mailto:blanch@ifae.es>18 ! Author(s): Oscar Blanch, 11/2001 <mailto:blanch@ifae.es> 19 19 ! 20 20 ! Copyright: MAGIC Software Development, 2000-2001 -
trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
r2173 r2178 181 181 return maxval; 182 182 } 183 184 Bool_t MPedestalCam::GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const 185 { 186 val = (*this)[idx].GetMean()*ratio; 187 return kTRUE; 188 } -
trunk/MagicSoft/Mars/manalysis/MPedestalCam.h
r1540 r2178 2 2 #define MARS_MPedestalCam 3 3 4 #ifndef MARS_M ParContainer5 #include "M ParContainer.h"4 #ifndef MARS_MCamEvent 5 #include "MCamEvent.h" 6 6 #endif 7 7 … … 11 11 class MPedestalPix; 12 12 13 class MPedestalCam : public M ParContainer13 class MPedestalCam : public MCamEvent 14 14 { 15 15 private: … … 35 35 void Print(Option_t *o="") const; 36 36 37 Bool_t GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const; 38 void DrawPixelContent(Int_t num) const 39 { 40 } 41 37 42 ClassDef(MPedestalCam, 1) // Storage Container for all pedestal information of the camera 38 43 };
Note:
See TracChangeset
for help on using the changeset viewer.