Changeset 2052 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 05/02/03 08:56:31 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
r1965 r2052 351 351 } 352 352 353 /*354 // --------------------------------------------------------------------------355 //356 // Use this function to sum photons in events together.357 //358 Bool_t MCerPhotEvt::AddEvent(const MCerPhotEvt &evt)359 {360 if (evt.fNumPixels<=0)361 {362 *fLog << "Warning - Event to be added has no pixels." << endl;363 return kFALSE;364 }365 if (fNumPixels<=0)366 {367 *fLog << "Warning - Event to add pixels to has no pixels." << endl;368 return kFALSE;369 }370 371 for (UInt_t i=0; i<evt.fNumPixels; i++)372 {373 const UInt_t id = evt[i].GetPixId();374 375 MCerPhotPix *pix2 = GetPixById(id);376 if (!pix2)377 {378 *fLog << "Error - Pixel#" << dec << id << " does not exist in this event!" << endl;379 return kFALSE;380 }381 382 pix2->AddNumPhotons(evt[i].GetNumPhotons());383 }384 return kTRUE;385 }386 */387 388 353 void MCerPhotEvt::Scale(Double_t f) 389 354 { 390 355 fPixels->ForEach(MCerPhotPix, Scale)(f); 391 356 } 357 358 void MCerPhotEvt::RemoveUnusedPixels() 359 { 360 TIter Next(fPixels); 361 MCerPhotPix *pix = NULL; 362 363 while ((pix=(MCerPhotPix*)Next())) 364 if (!pix->IsPixelUsed()) 365 fPixels->Remove(pix); 366 367 fPixels->Compress(); 368 fNumPixels=fPixels->GetEntriesFast(); 369 } -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
r1965 r2052 49 49 50 50 void Scale(Double_t f); 51 void RemoveUnusedPixels(); 51 52 52 53 MCerPhotPix *GetPixById(int id) const; -
trunk/MagicSoft/Mars/manalysis/MSigmabar.cc
r1961 r2052 172 172 fSigmabarInner = 0; 173 173 fSigmabarOuter = 0; 174 for (UInt_t i=0; i<6; i++) { 174 for (UInt_t i=0; i<6; i++) 175 { 175 176 fSigmabarInner += innerSquaredSum[i]; 176 177 fInnerPixels += innerPixels[i]; … … 187 188 if (fOuterPixels > 0) fSigmabarOuter /= fOuterPixels; 188 189 189 // 190 // this is the sqrt of the average sigma^2 191 // for the inner and outer pixels respectively 192 // 193 fSigmabarInner = sqrt( fSigmabarInner ); 194 fSigmabarOuter = sqrt( fSigmabarOuter ); 195 196 for (UInt_t i=0; i<6; i++) { 197 fSigmabarSector[i] = innerPixels[i]+outerPixels[i]<=0?0:sqrt((innerSquaredSum[i]+outerSquaredSum[i])/(innerPixels[i]+outerPixels[i])); 198 199 const Double_t is = innerPixels[i]<=0?0:innerSquaredSum[i]/innerPixels[i]; 200 const Double_t os = outerPixels[i]<=0?0:outerSquaredSum[i]/outerPixels[i]; 201 202 fSigmabarInnerSector[i] = sqrt( is ); 203 fSigmabarOuterSector[i] = sqrt( os ); 204 } 205 190 // 191 // this is the sqrt of the average sigma^2 192 // for the inner and outer pixels respectively 193 // 194 fSigmabarInner = sqrt( fSigmabarInner ); 195 fSigmabarOuter = sqrt( fSigmabarOuter ); 196 197 for (UInt_t i=0; i<6; i++) 198 { 199 const Double_t ip = innerPixels[i]; 200 const Double_t op = outerPixels[i]; 201 const Double_t iss = innerSquaredSum[i]; 202 const Double_t oss = outerSquaredSum[i]; 203 204 const Double_t sum = ip + op; 205 206 fSigmabarSector[i] = sum<=0 ? 0 : sqrt((iss+oss)/sum); 207 fSigmabarInnerSector[i] = ip <=0 ? 0 : sqrt(iss/ip); 208 fSigmabarOuterSector[i] = op <=0 ? 0 : sqrt(oss/op); 209 } 210 206 211 return fSigmabar; 207 212 } … … 237 242 238 243 } 239 240 241 242 243 244
Note:
See TracChangeset
for help on using the changeset viewer.