Ignore:
Timestamp:
03/19/04 16:56:19 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r3528 r3551  
    594594TProfile *MHCamera::RadialProfileS(const TArrayI &sector, const TArrayI &aidx, const char *name, const Int_t nbins) const
    595595{
    596 
    597     // Create the projection histogram
    598     TString pname(name);
    599     if (name=="_rad")
    600     {
    601         pname.Prepend(GetName());
    602         if (sector.GetSize()>0)
     596 
     597  // Create the projection histogram
     598  TString pname(name);
     599  if (name=="_rad")
     600    {
     601      pname.Prepend(GetName());
     602      if (sector.GetSize()>0)
    603603        {
    604             pname += ";";
    605             for (int i=0; i<sector.GetSize(); i++)
    606                 pname += sector[i];
     604          pname += ";";
     605          for (int i=0; i<sector.GetSize(); i++)
     606            pname += sector[i];
    607607        }
    608         if (aidx.GetSize()>0)
     608      if (aidx.GetSize()>0)
    609609        {
    610             pname += ";";
    611             for (int i=0; i<aidx.GetSize(); i++)
    612                 pname += aidx[i];
     610          pname += ";";
     611          for (int i=0; i<aidx.GetSize(); i++)
     612            pname += aidx[i];
    613613        }
    614614    }
    615 
    616     TProfile *h1=0;
    617 
    618     //check if histogram with identical name exist
    619     TObject *h1obj = gROOT->FindObject(pname);
    620     if (h1obj && h1obj->InheritsFrom("TProfile")) {
    621         h1 = (TProfile*)h1obj;
    622         h1->Reset();
    623     }
    624 
    625     if (!h1)
    626     {
    627 
     615 
     616  TProfile *h1=0;
     617 
     618  //check if histogram with identical name exist
     619  TObject *h1obj = gROOT->FindObject(pname);
     620  if (h1obj && h1obj->InheritsFrom("TProfile")) {
     621    h1 = (TProfile*)h1obj;
     622    h1->Reset();
     623  }
     624 
     625  if (!h1)
     626    {
     627     
    628628      Double_t min = 0.;
    629629      Double_t max = fGeomCam->GetMaxRadius();
     
    638638      h1->SetYTitle(GetYaxis()->GetTitle());
    639639    }
    640    
    641     // Fill the projected histogram
    642     for (Int_t idx=0; idx<fNcells-2; idx++)
    643       if (IsUsed(idx) && MatchSector(idx, sector, aidx))
    644         h1->Fill(TMath::Hypot((*fGeomCam)[idx].GetX(),(*fGeomCam)[idx].GetY()),
    645                  GetBinContent(idx+1));
    646     return h1;
     640 
     641  // Fill the projected histogram
     642  for (Int_t idx=0; idx<fNcells-2; idx++)
     643    if (IsUsed(idx) && MatchSector(idx, sector, aidx))
     644      h1->Fill(TMath::Hypot((*fGeomCam)[idx].GetX(),(*fGeomCam)[idx].GetY()),
     645               GetBinContent(idx+1));
     646  return h1;
    647647}
    648648
Note: See TracChangeset for help on using the changeset viewer.