void xstatus(TH1 *h){

  cout<<"mada"<<endl;

//  Int_t nx = h->GetNbinsX();
//  Double_t dx = h->GetBinWidth(nx);
//
//  cout<<"1D"<<endl;
//
//  cout<<"Name     : "<<h->GetName()<<endl;
//  cout<<"Title    : "<<h->GetTitle()<<endl;
//  cout<<"Entries  : "<<h->GetEntries()<<endl;
//  cout<<"Integral : "<<h->Integral()
//      <<"  ("<<h->Integral()/h->GetEntries()<<" %)"<<endl;
//  cout<<"Mean     : "<<h->GetMean()<<endl;
//  cout<<"RMS      : "<<h->GetRMS()<<endl;
//  cout<<"Xaxis    : "<<nx
//      <<" bins  xmin="<<h->GetBinLowEdge(1)
//      <<"  xmax="<<h->GetBinLowEdge(nx)+dx
//      <<"  dx="<<dx
//      <<endl;
}

void xstatus(TH1 *h,Double_t x1,Double_t x2){

  Int_t ix1 = h->GetXaxis()->FindBin(x1);
  Int_t ix2 = h->GetXaxis()->FindBin(x2);

  Int_t nx = h->GetNbinsX();
  Double_t dx = h->GetBinWidth(nx);
  Int_t Entries = h->GetEntries();
  Double_t integ = h->Integral(ix1,ix2);

  Double_t ymin = h->GetMinimum();
  Double_t ymax = h->GetMaximum();

  TLine *lx1=new TLine(x1,ymin,x1,ymax);
  TLine *lx2=new TLine(x2,ymin,x2,ymax);
  lx1->Draw();
  lx2->Draw();

  cout<<
    "----------------------------------------------------------------------"
      <<endl;
  cout<<"Name     : "<<h->GetName()<<"     "
      <<"Title    : "<<h->GetTitle()<<endl;
  cout<<"Entries  : "<<h->GetEntries()<<endl;
  cout<<"Counts from "<<x1<<" to "<<x2<<endl;
  cout<<" = "<<integ<<"  ("<<integ/Entries*100<<" %)"<<endl;
}

void xstatus(TH2 *h){

  cout<<"mada"<<endl;
//
//  Int_t nx = h->GetNbinsX();
//  Int_t ny = h->GetNbinsY();
//  Double_t dx = h->GetBinWidth(nx);
//  Double_t dy = h->GetYaxis()->GetBinWidth(ny);
//
//  cout<<"2D"<<endl;
//
//  cout<<"Name     : "<<h->GetName()<<endl;
//  cout<<"Title    : "<<h->GetTitle()<<endl;
//  cout<<"Entries  : "<<h->GetEntries()<<endl;
//  cout<<"Integral : "<<h->Integral()
//      <<"  ("<<h->Integral()/h->GetEntries()<<" %)"<<endl;
//  cout<<"Xaxis    : "<<nx
//      <<" bins,  xmin="<<h->GetBinLowEdge(1)
//      <<"  xmax="<<h->GetBinLowEdge(nx)+dx
//      <<"  dx="<<dx
//      <<endl;
//
//  cout<<"Yaxis    : "<<ny
//      <<" bins,  ymin="<<h->GetYaxis()->GetBinLowEdge(1)
//      <<"  ymax="<<h->GetYaxis()->GetBinLowEdge(ny) + dy
//      <<"  dy="<<dy
//      <<endl;
}
