Changeset 3522
- Timestamp:
- 03/16/04 12:37:24 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3521 r3522 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2004/03/16: Wolfgang Wittek 22 23 * manalysis/MSigmabar.[h,cc] 24 - calculate sigmabar as mean of individual pedestalRMS 25 instead of sqrt of mean pedestalRMS^2 26 20 27 21 28 2004/03/16: Oscar Blanch -
trunk/MagicSoft/Mars/manalysis/MSigmabar.cc
r2798 r3522 100 100 Int_t innerPixels[6]; 101 101 Int_t outerPixels[6]; 102 Float_t innerS quaredSum[6];103 Float_t outerS quaredSum[6];102 Float_t innerSum[6]; 103 Float_t outerSum[6]; 104 104 105 105 memset(innerPixels, 0, sizeof(innerPixels)); 106 106 memset(outerPixels, 0, sizeof(outerPixels)); 107 memset(innerS quaredSum, 0, sizeof(innerSquaredSum));108 memset(outerS quaredSum, 0, sizeof(outerSquaredSum));109 110 // 111 // sum up sigma ^2 for each sector, separately for inner and outer region;112 // all pixels are renormalized to the area of pixel 0107 memset(innerSum, 0, sizeof(innerSum)); 108 memset(outerSum, 0, sizeof(outerSum)); 109 110 // 111 // sum up sigma/sqrt(area) for each sector, 112 // separately for inner and outer region; 113 113 // 114 114 // consider all pixels with Cherenkov photon information … … 149 149 const MGeomPix &gpix = geom[idx]; 150 150 151 Int_t sector = (Int_t)(atan2(gpix.GetY(),gpix.GetX())*6 / (TMath::Pi()*2)); 151 Int_t sector = (Int_t)(atan2(gpix.GetY(),gpix.GetX())*6 152 / (TMath::Pi()*2)); 152 153 if (sector<0) 153 154 sector+=6; … … 163 164 { 164 165 innerPixels[sector]++; 165 innerS quaredSum[sector]+= sigma*sigma * ratio;166 innerSum[sector]+= sigma * sqrt(ratio); 166 167 } 167 168 else 168 169 { 169 170 outerPixels[sector]++; 170 outerS quaredSum[sector]+= sigma*sigma * ratio;171 outerSum[sector]+= sigma * sqrt(ratio); 171 172 } 172 173 } … … 174 175 fInnerPixels = 0; 175 176 fOuterPixels = 0; 176 fSigmabarInner = 0;177 fSigmabarOuter = 0;177 Double_t fSumInner = 0; 178 Double_t fSumOuter = 0; 178 179 for (UInt_t i=0; i<6; i++) 179 180 { 180 fS igmabarInner += innerSquaredSum[i];181 fSumInner += innerSum[i]; 181 182 fInnerPixels += innerPixels[i]; 182 fS igmabarOuter += outerSquaredSum[i];183 fSumOuter += outerSum[i]; 183 184 fOuterPixels += outerPixels[i]; 184 185 } 185 186 186 // 187 // this is the sqrt of the average sigma^2; 188 // 189 fSigmabar=fInnerPixels+fOuterPixels<=0?0:sqrt((fSigmabarInner+fSigmabarOuter)/(fInnerPixels+fOuterPixels)); 190 191 if (fInnerPixels > 0) fSigmabarInner /= fInnerPixels; 192 if (fOuterPixels > 0) fSigmabarOuter /= fOuterPixels; 193 194 // 195 // this is the sqrt of the average sigma^2 196 // for the inner and outer pixels respectively 197 // 198 fSigmabarInner = sqrt( fSigmabarInner ); 199 fSigmabarOuter = sqrt( fSigmabarOuter ); 187 if (fInnerPixels > 0) fSigmabarInner = fSumInner / fInnerPixels; 188 if (fOuterPixels > 0) fSigmabarOuter = fSumOuter / fOuterPixels; 189 190 // 191 // this is the average sigma/sqrt(area) (over all pixels) 192 // 193 fSigmabar = (fInnerPixels+fOuterPixels)<=0 ? 0: 194 (fSumInner+fSumOuter)/(fInnerPixels+fOuterPixels); 200 195 201 196 for (UInt_t i=0; i<6; i++) … … 203 198 const Double_t ip = innerPixels[i]; 204 199 const Double_t op = outerPixels[i]; 205 const Double_t iss = innerS quaredSum[i];206 const Double_t oss = outerS quaredSum[i];200 const Double_t iss = innerSum[i]; 201 const Double_t oss = outerSum[i]; 207 202 208 203 const Double_t sum = ip + op; 209 210 fSigmabarSector[i] = sum<=0 ? 0 : sqrt((iss+oss)/sum); 211 fSigmabarInnerSector[i] = ip <=0 ? 0 : sqrt(iss/ip); 212 fSigmabarOuterSector[i] = op <=0 ? 0 : sqrt(oss/op); 204 fSigmabarInnerSector[i] = ip <=0 ? 0 : iss/ip; 205 fSigmabarOuterSector[i] = op <=0 ? 0 : oss/op; 206 fSigmabarSector[i] = sum<=0 ? 0 : (iss+oss)/sum; 213 207 } 208 209 //TString opt = ""; 210 //Print(opt); 214 211 215 212 return fSigmabar;
Note:
See TracChangeset
for help on using the changeset viewer.