Ignore:
Timestamp:
03/08/03 14:00:30 (22 years ago)
Author:
wittek
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r1772 r1809  
    504504}
    505505
     506// --------------------------------------------------------------------------
     507//
    506508void MHMatrix::Reassign()
    507509{
     
    691693//
    692694// Define the reference matrix
    693 //   refcolumn  number of the column containing the variable, for which a
    694 //              target distribution may be given;
     695//   refcolumn  number of the column (starting at 1)containing the variable,
     696//              for which a target distribution may be given;
    695697//              if refcolumn is negative the target distribution will be set
    696698//              equal to the real distribution; the events in the reference
     
    748750   //---------------------------------------------------------
    749751   //
    750    // if refcol < 0 : select reference events randomly
    751    //                 i.e. set the normaliztion factotrs equal to 1.0
     752   // if refcolumn < 0 : select reference events randomly
     753   //                    i.e. set the normaliztion factotrs equal to 1.0
     754   // refcol is the column number starting at 0; it is >= 0
    752755
    753756   if (refcolumn<0)
    754757   {
    755      frefcol = -refcolumn;
     758     frefcol = -refcolumn - 1;
    756759   }
    757760   else
    758761   {
    759      frefcol = refcolumn;
     762     frefcol =  refcolumn - 1;
    760763   }
    761764   
     
    790793     //      << ",  " << fM(j-1,frefcol) << endl;
    791794   }
    792 
    793    // if refcolumn<0 set target distribution equal to the real distribution
    794    // in order to obtain normalization factors = 1.0
    795    //if (refcolumn<0)
    796    //{
    797    //  for (Int_t j=1; j<=fnbins; j++)
    798    //  {
    799    //    float cont = fHth-> GetBinContent(j);
    800    //    fHthsh->SetBinContent(j, cont);
    801    //  }
    802    //}
    803795
    804796   //---------------------------------------------------------
     
    816808
    817809     // if refcolumn < 0 set the correction factors equal to 1
    818      if ( refcolumn>=0.0 )
     810     if ( refcolumn>=0 )
    819811       b = fHthsh->GetBinContent(j);
    820812     else
     
    948940   {
    949941     *fLog <<ir <<" ";
    950      for (Int_t ic=0;ic<13;ic++) cout<<Mnew(ir,ic)<<" ";
     942     for (Int_t ic=0; ic<Mnew.GetNcols(); ic++) cout<<Mnew(ir,ic)<<" ";
    951943     *fLog <<endl;
    952944   }
     
    957949   {
    958950     float a = fHthaft->GetBinContent(j);
    959      if (a>0) *fLog << j << "  "<< a << "   ";
     951     *fLog << j << "  "<< a << "   ";
    960952   }
    961953   *fLog <<endl;
     
    967959
    968960   th1->cd(1);
    969    ((TH1F*)fHthsh)->Draw();      // target
     961   ((TH1F*)fHthsh)->DrawCopy();      // target
    970962
    971963   th1->cd(2);
    972    ((TH1F*)fHth)->Draw();        // real histogram before
     964   ((TH1F*)fHth)->DrawCopy();        // real histogram before
    973965
    974966   th1->cd(3);
    975    ((TH1F*)fHthd) -> Draw();     // correction factors
     967   ((TH1F*)fHthd)->DrawCopy();       // correction factors
    976968
    977969   th1->cd(4);
    978    ((TH1F*)fHthaft) -> Draw();   // histogram after
    979 
    980    //---------------------------------------------------------
    981    // --- write onto output file
    982    //
    983    //TFile *outfile = new TFile(fileNameout, "RECREATE", "");
    984    //Mnew.Write(fileNameout);
    985    //outfile->Close();
     970   ((TH1F*)fHthaft)->DrawCopy();     // histogram after
     971
     972   //---------------------------------------------------------
    986973
    987974   return kTRUE;
Note: See TracChangeset for help on using the changeset viewer.