Ignore:
Timestamp:
01/17/05 16:39:19 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc

    r5843 r5876  
    691691  TH1D *h = convcam.ProjectionS(TArrayI(),TArrayI(1,&aidx),"_py",750);
    692692  h->SetDirectory(NULL);
    693   h->Fit("gaus","Q");
    694   TF1 *fit = h->GetFunction("gaus");
    695  
     693
     694  TF1 *fit = NULL;
     695
     696  if (geom.InheritsFrom("MGeomCamMagic"))
     697    {
     698
     699      fit = new TF1("fit","gaus",0.4,5.);
     700     
     701      // Fix the ranges, as found by Nadia
     702      if(aidx == 0)
     703        {h->Fit("fit","REQ", "",0.4,1.5);}
     704      else
     705        {h->Fit("fit","REQ", "",1.,5.);}
     706    }
     707  else
     708    {
     709      h->Fit("gaus","Q");
     710      fit = h->GetFunction("gaus");
     711    }
     712
    696713  Float_t ci2   = fit->GetChisquare();
    697714  Float_t sigma = fit->GetParameter(2);
     
    699716  if (ci2 > 500. || sigma > sg)
    700717    {
    701       h->Fit("gaus","QM");
    702       fit = h->GetFunction("gaus");
     718      if (geom.InheritsFrom("MGeomCamMagic"))
     719        {
     720          // Fix the ranges, as found by Nadia
     721          if(aidx == 0)
     722            {h->Fit("fit","REQ", "",0.4,1.5);}
     723          else
     724            {h->Fit("fit","REQ", "",1.,5.);}
     725        }
     726      else
     727        {
     728          h->Fit("gaus","MREQ");
     729          fit = h->GetFunction("gaus");
     730        }
    703731     
    704732      ci2   = fit->GetChisquare();
     
    720748        << "  Chisquare: " << Form("%4.3f",fit->GetChisquare()) << "  NDF  : " << ndf << endl;         
    721749 
     750  delete fit;
    722751  delete h;
    723752  gROOT->GetListOfFunctions()->Remove(fit);
Note: See TracChangeset for help on using the changeset viewer.