Copy constructor fot TH1F

From: Chris Jillings (chris@owl.phy.queensu.ca)
Date: Tue May 19 1998 - 14:31:14 MEST


Hi,
    I have the following macro which I run off the command line of 2.00/05
on Linux. If the last four lines are commented out it works as I would
expect. When the last four lines are added, the interprter complains about
not being able to handle the copy constructor...

Error: Can't call TH1F::TH1F() in current scope
FILE:/usr/home/chris/analysis/qdc/clicks/./chargespec.C LINE:68
*** Interpreter error recovered ***

    Thanks,

Chris

sumchargespec(TFile* fin) {
  char hname[100];
  sprintf(hname,"qdcintime");
  TH1F* hintime = (TH1F*)fin->Get(hname);
  sprintf(hname,"qdcearly");
  TH1F* hearly = (TH1F*)fin->Get(hname);
  TCanvas *c1 = new TCanvas("c1","c1",1);
  c1->SetFillColor(kWhite);
  TPad* p1 = new TPad("p1","p1",0.02,0.52,0.98,0.98,kWhite);
  TPad* p2 = new TPad("p2","p2",0.02,0.02,0.98,0.48,kWhite);
  p1->Draw();
  p2->Draw();
  

  Float_t xlow = 40;
  Float_t xhigh = 90;
  Int_t low = hintime->GetXaxis()->FindBin(xlow);
  Int_t high = hintime->GetXaxis()->FindBin(xhigh);
  Float_t intimeArea = hintime->Integral(low,high);
  Int_t low = hearly->GetXaxis()->FindBin(xlow);
  Int_t high = hearly->GetXaxis()->FindBin(xhigh);
  Float_t earlyArea = hearly->Integral(low,high);

  printf("Early area = %f\n",earlyArea);
  printf("In time area = %f\n",intimeArea);

  
  if( intimeArea!=0.0 )
    hintime->Scale(earlyArea/intimeArea);

  p1->cd();  
  hearly->Draw();
  hintime->Draw("same");
  
  TH1F* hdiff = new TH1F(hearly);  // TH1F hdiff(hearly); also fails
  hdiff->Add(hintime,-1.0);
  p2->cd();
  hdiff->Draw();


}



=================================================================
=                                                               =
= Chris Jillings                                                =
= Department of Physics   phone/voice mail: (613) 545-6000x4805 =   
= Queen's University      fax: (613) 545-6813                   =
= Kingston, Ontario       email: chris@sno.phy.queensu.ca       =             
= Canada, K7L 3N6         web: http://sno.phy.queensu.ca        =
=                                                               =
=================================================================



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:33 MET