/[PAMELA software]/calo/flight/CaloProfile/src/CaloProfile.cpp
ViewVC logotype

Diff of /calo/flight/CaloProfile/src/CaloProfile.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by mocchiut, Mon Aug 17 15:00:36 2009 UTC revision 1.13 by mocchiut, Wed Aug 19 07:25:34 2009 UTC
# Line 281  CaloLat::CaloLat(PamLevel2 *l2p){   Line 281  CaloLat::CaloLat(PamLevel2 *l2p){  
281    PKT = 0;    PKT = 0;
282    atime = 0;    atime = 0;
283    //    //
284      suf = "";
285    debug = false;    debug = false;
286    //    //
287  };  };
# Line 297  Calo2D::Calo2D(PamLevel2 *l2p){   Line 298  Calo2D::Calo2D(PamLevel2 *l2p){  
298    PKT = 0;    PKT = 0;
299    atime = 0;    atime = 0;
300    //    //
301      suf = "";
302    debug = false;    debug = false;
303    //    //
304  };  };
# Line 375  void CaloLat::Draw(Int_t view,Int_t plan Line 377  void CaloLat::Draw(Int_t view,Int_t plan
377    //    //
378    for (Int_t v=minv; v<maxv;v++){    for (Int_t v=minv; v<maxv;v++){
379       for (Int_t p=minp; p<maxp;p++){       for (Int_t p=minp; p<maxp;p++){
380          TString hid = Form("clatv%ip%i",v,p);           TString hid = Form("clatv%ip%i%s",v,p,suf.Data());      
381          TCanvas *tc  = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid));          TCanvas *tc  = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid));
382          if ( tc ){          if ( tc ){
383  //       tc->Clear();  //       tc->Clear();
# Line 383  void CaloLat::Draw(Int_t view,Int_t plan Line 385  void CaloLat::Draw(Int_t view,Int_t plan
385           tc = new TCanvas(hid,hid);           tc = new TCanvas(hid,hid);
386          };          };
387          //          //
388          TString thid = Form("hlatv%ip%i",v,p);            TString thid = Form("hlatv%ip%i%s",v,p,suf.Data());    
389          TH1F *th  = dynamic_cast<TH1F*>(gDirectory->FindObject(thid));          TH1F *th  = dynamic_cast<TH1F*>(gDirectory->FindObject(thid));
390          if ( th ) th->Delete();          if ( th ) th->Delete();
391  //       th->Clear();  //       th->Clear();
# Line 426  void Calo2D::Draw(Int_t plane){ Line 428  void Calo2D::Draw(Int_t plane){
428    gStyle->SetNdivisions(510,"XY");    gStyle->SetNdivisions(510,"XY");
429    //    //
430    for (Int_t p=minp; p<maxp;p++){    for (Int_t p=minp; p<maxp;p++){
431      TString hid = Form("c2dp%i",p);          TString hid = Form("c2dp%i%s",p,suf.Data());        
432      TCanvas *tc  = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid));      TCanvas *tc  = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid));
433      if ( tc ){      if ( tc ){
434        //         tc->Clear();        //         tc->Clear();
# Line 434  void Calo2D::Draw(Int_t plane){ Line 436  void Calo2D::Draw(Int_t plane){
436        tc = new TCanvas(hid,hid);        tc = new TCanvas(hid,hid);
437      };      };
438      //      //
439      TString thid = Form("h2dp%i",p);          TString thid = Form("h2dp%i%s",p,suf.Data());      
440      TH2F *th  = dynamic_cast<TH2F*>(gDirectory->FindObject(thid));      TH2F *th  = dynamic_cast<TH2F*>(gDirectory->FindObject(thid));
441      if ( th ) th->Delete();      if ( th ) th->Delete();
442      //   th->Clear();      //   th->Clear();
# Line 671  CaloLong::CaloLong(PamLevel2 *l2p){   Line 673  CaloLong::CaloLong(PamLevel2 *l2p){  
673    umax = 100.;    umax = 100.;
674    slmax = "";    slmax = "";
675    sumax = "";    sumax = "";
676      suf = "";
677    xyaverage = true;    xyaverage = true;
678    //    //
679  };  };
# Line 1066  void CaloLong::Fit(Bool_t draw){ Line 1069  void CaloLong::Fit(Bool_t draw){
1069      gStyle->SetNdivisions(510,"XY");      gStyle->SetNdivisions(510,"XY");
1070    };    };
1071    //    //
1072    TString hid = Form("clongfit");          TString hid = Form("clongfit%s",suf.Data());  
1073    TCanvas *tc  = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid));    TCanvas *tc  = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid));
1074    //  if ( tc ) tc->Delete();    //  if ( tc ) tc->Delete();
1075    //  if ( tc ) tc->Close();    //  if ( tc ) tc->Close();
# Line 1076  void CaloLong::Fit(Bool_t draw){ Line 1079  void CaloLong::Fit(Bool_t draw){
1079      if ( tc ) tc->cd();      if ( tc ) tc->cd();
1080    };    };
1081    //    //
1082    TString thid = Form("hlongfit");          TString thid = Form("hlongfit%s",suf.Data());
1083    TH2F *th  = dynamic_cast<TH2F*>(gDirectory->FindObject(thid));    TH2F *th  = dynamic_cast<TH2F*>(gDirectory->FindObject(thid));
1084    if ( th ) th->Delete();    if ( th ) th->Delete();
1085    //    //
1086    TString ghid = Form("glongfit");          TString ghid = Form("glongfit%s",suf.Data());
1087    TGraphErrors *gh  = dynamic_cast<TGraphErrors*>(gDirectory->FindObject(ghid));    TGraphErrors *gh  = dynamic_cast<TGraphErrors*>(gDirectory->FindObject(ghid));
1088    if ( gh ) gh->Delete();    if ( gh ) gh->Delete();
1089    //    //
# Line 1220  void CaloLong::Fit(Bool_t draw){ Line 1223  void CaloLong::Fit(Bool_t draw){
1223    //  th = new TH2F(thid,thid,int(NC*1.5),-0.2,xmax);    //  th = new TH2F(thid,thid,int(NC*1.5),-0.2,xmax);
1224    th = new TH2F(thid,thid,1000,-0.2,xmax,1000,0.,emax*1.2);    th = new TH2F(thid,thid,1000,-0.2,xmax,1000,0.,emax*1.2);
1225    gh = new TGraphErrors(numpo,xxx,yyy,exx,eyy);    gh = new TGraphErrors(numpo,xxx,yyy,exx,eyy);
1226    TF1 *lfit  = dynamic_cast<TF1*>(gDirectory->FindObject("lfit"));    TString fnam=Form("lfit%s",suf.Data());
1227      TF1 *lfit  = dynamic_cast<TF1*>(gDirectory->FindObject(fnam));
1228    if ( lfit ) lfit->Delete();    if ( lfit ) lfit->Delete();
1229    lfit = new TF1("lfit",ccurve,0.,xmax,3);    lfit = new TF1(fnam,ccurve,0.,xmax,3);
1230    if ( debug ) printf("qtot %f qtotparz %f \n",clp->qtot,qtotparz);    if ( debug ) printf("qtot %f qtotparz %f \n",clp->qtot,qtotparz);
1231    E0 = qtotparz;    E0 = qtotparz;
1232    //  E0 = clp->qtot;    //  E0 = clp->qtot;
# Line 1369  void CaloLong::Draw(Int_t view){ Line 1373  void CaloLong::Draw(Int_t view){
1373    //    //
1374    if ( maxv != -1 ){    if ( maxv != -1 ){
1375      for (Int_t v=minv; v<maxv;v++){      for (Int_t v=minv; v<maxv;v++){
1376        TString hid = Form("clongv%i",v);        TString hid = Form("clongv%i%s",v,suf.Data());    
1377        TCanvas *tc  = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid));        TCanvas *tc  = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid));
1378        if ( tc ){        if ( tc ){
1379          //       tc->Clear();          //       tc->Clear();
# Line 1377  void CaloLong::Draw(Int_t view){ Line 1381  void CaloLong::Draw(Int_t view){
1381          tc = new TCanvas(hid,hid);          tc = new TCanvas(hid,hid);
1382        };        };
1383        //        //
1384        TString thid = Form("hlongv%i",v);                TString thid = Form("hlongv%i%s",v,suf.Data());  
1385        TH1F *th  = dynamic_cast<TH1F*>(gDirectory->FindObject(thid));        TH1F *th  = dynamic_cast<TH1F*>(gDirectory->FindObject(thid));
1386        if ( th ) th->Delete();        if ( th ) th->Delete();
1387        //         th->Clear();        //         th->Clear();
# Line 1396  void CaloLong::Draw(Int_t view){ Line 1400  void CaloLong::Draw(Int_t view){
1400      };      };
1401    } else {    } else {
1402      //      //
1403      TString hid = Form("clongvyvx");          TString hid = Form("clongvyvx%s",suf.Data());      
1404      TCanvas *tc  = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid));      TCanvas *tc  = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid));
1405      if ( tc ){      if ( tc ){
1406      } else {      } else {
1407        tc = new TCanvas(hid,hid);        tc = new TCanvas(hid,hid);
1408      };      };
1409      //      //
1410      TString thid = Form("hlongvyvx");        TString thid = Form("hlongvyvx%s",suf.Data());      
1411      TH1F *th  = dynamic_cast<TH1F*>(gDirectory->FindObject(thid));      TH1F *th  = dynamic_cast<TH1F*>(gDirectory->FindObject(thid));
1412      if ( th ) th->Delete();      if ( th ) th->Delete();
1413      th = new TH1F(thid,thid,44,-0.5,43.5);      th = new TH1F(thid,thid,44,-0.5,43.5);

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.23