Changeset 3400 for trunk/MagicSoft/Mars/mhist/MHCamera.cc
- Timestamp:
- 03/04/04 15:46:17 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r3324 r3400 164 164 // sector idx matches the sector of the pixel with index idx. 165 165 // 166 Bool_t MHCamera::MatchSector(Int_t idx, Int_t sector) const 167 { 168 return sector<0 ? kTRUE : (*fGeomCam)[idx].GetSector()==(UInt_t)sector; 166 Bool_t MHCamera::MatchSector(Int_t idx, const TArrayI §or, const TArrayI &aidx) const 167 { 168 const MGeomPix &pix = (*fGeomCam)[idx]; 169 return FindVal(sector, pix.GetSector()) && FindVal(aidx, pix.GetAidx()); 169 170 } 170 171 … … 270 271 // entries with match the given sector are taken into account. 271 272 // 272 Stat_t MHCamera::GetMeanSector (Int_t sector, Bool_t all) const273 Stat_t MHCamera::GetMeanSectors(const TArrayI §or, const TArrayI &aidx, Bool_t all) const 273 274 { 274 275 if (fNcells<=1) … … 280 281 for (int i=0; i<fNcells-2; i++) 281 282 { 282 if ((all || IsUsed(i)) && MatchSector(i, sector ))283 if ((all || IsUsed(i)) && MatchSector(i, sector, aidx)) 283 284 { 284 285 mean += fArray[i+1]; … … 296 297 // entries with match the given sector are taken into account. 297 298 // 298 Stat_t MHCamera::GetRmsSector (Int_t sector, Bool_t all) const299 Stat_t MHCamera::GetRmsSectors(const TArrayI §or, const TArrayI &aidx, Bool_t all) const 299 300 { 300 301 if (fNcells<=1) … … 307 308 for (int i=0; i<fNcells-2; i++) 308 309 { 309 if ((all || IsUsed(i)) && MatchSector(i, sector ))310 if ((all || IsUsed(i)) && MatchSector(i, sector, aidx)) 310 311 { 311 312 sum += fArray[i+1]; … … 327 328 // only pixels with matching sector number are taken into account. 328 329 // 329 Double_t MHCamera::GetMinimumSector (Int_t sector, Bool_t all) const330 Double_t MHCamera::GetMinimumSectors(const TArrayI §or, const TArrayI &aidx, Bool_t all) const 330 331 { 331 332 if (fMinimum != -1111) … … 338 339 339 340 for (Int_t idx=0; idx<fNcells-2; idx++) 340 if (MatchSector(idx, sector ) && (all || IsUsed(idx)) && fArray[idx+1]<minimum)341 if (MatchSector(idx, sector, aidx) && (all || IsUsed(idx)) && fArray[idx+1]<minimum) 341 342 minimum = fArray[idx+1]; 342 343 … … 350 351 // only pixels with matching sector number are taken into account. 351 352 // 352 Double_t MHCamera::GetMaximumSector (Int_t sector, Bool_t all) const353 Double_t MHCamera::GetMaximumSectors(const TArrayI §or, const TArrayI &aidx, Bool_t all) const 353 354 { 354 355 if (fMaximum!=-1111) … … 360 361 Double_t maximum=-FLT_MAX; 361 362 for (Int_t idx=0; idx<fNcells-2; idx++) 362 if (MatchSector(idx, sector ) && (all || IsUsed(idx)) && fArray[idx+1]>maximum)363 if (MatchSector(idx, sector, aidx) && (all || IsUsed(idx)) && fArray[idx+1]>maximum) 363 364 maximum = fArray[idx+1]; 364 365 … … 496 497 // into account. 497 498 // 498 TH1D *MHCamera::ProjectionS( Int_t sector, const char *name) const499 TH1D *MHCamera::ProjectionS(const TArrayI §or, const TArrayI &aidx, const char *name) const 499 500 { 500 501 Int_t nbins = 50; … … 505 506 { 506 507 pname.Prepend(GetName()); 507 if (sector>=0) 508 pname += sector; 508 if (sector.GetSize()>0) 509 { 510 pname += ";"; 511 for (int i=0; i<sector.GetSize(); i++) 512 pname += sector[i]; 513 } 514 if (aidx.GetSize()>0) 515 { 516 pname += ";"; 517 for (int i=0; i<aidx.GetSize(); i++) 518 pname += aidx[i]; 519 } 509 520 } 510 521 … … 520 531 if (!h1) 521 532 { 522 Double_t min = GetMinimumSector (sector);523 Double_t max = GetMaximumSector (sector);533 Double_t min = GetMinimumSectors(sector, aidx); 534 Double_t max = GetMaximumSectors(sector, aidx); 524 535 525 536 Int_t newbins=0; … … 536 547 // Fill the projected histogram 537 548 for (Int_t idx=0; idx<fNcells-2; idx++) 538 if (IsUsed(idx) && MatchSector(idx, sector ))549 if (IsUsed(idx) && MatchSector(idx, sector, aidx)) 539 550 h1->Fill(GetBinContent(idx+1)); 540 551
Note:
See TracChangeset
for help on using the changeset viewer.