Useful macros for the shifter
authorcoppedis <coppedis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Mar 2010 13:22:59 +0000 (13:22 +0000)
committercoppedis <coppedis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Mar 2010 13:22:59 +0000 (13:22 +0000)
ZDC/CheckLaser.C [deleted file]
ZDC/CheckPedestal.C [deleted file]

diff --git a/ZDC/CheckLaser.C b/ZDC/CheckLaser.C
deleted file mode 100644 (file)
index 0ae5861..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-#if !defined(__CINT__) || defined(__MAKECINT__)
-
-#include <TROOT.h>
-#include <TStyle.h>
-#include <Riostream.h>
-#include "TClassTable.h"
-#include <TStopwatch.h>
-#include <TDatime.h>
-#include <TClassTable.h>
-#include <TH1.h>
-#include <TH2.h>
-#include <TF1.h>
-#include <TProfile.h>
-#include <TFunction.h>
-#include <TCanvas.h>
-#include <TFile.h>
-
-#endif
-
-void CheckLaser(const char * histoFName = "ZDCLaserHisto.root", Int_t optPlot = 1)
-{
-
-  TFile * file = new TFile(histoFName, "READ");
-  file->cd();
-  TH1F::AddDirectory(0);
-  //
-  // --- Histos for reference PMTs (high gain chains)
-  TH1F *hPMRefChg = new TH1F("hPMRefChg","hPMRefChg", 100,0.,1000.);
-  TH1F *hPMRefAhg = new TH1F("hPMRefAhg","hPMRefAhg", 100,0.,1000.);
-  TH1F *hPMRefClg = new TH1F("hPMRefClg","hPMRefClg", 100,0.,4000.);
-  TH1F *hPMRefAlg = new TH1F("hPMRefAlg","hPMRefAlg", 100,0.,4000.);
-  //
-  hPMRefChg = (TH1F*) file->Get("hPMRefChg");
-  hPMRefAhg = (TH1F*) file->Get("hPMRefAhg");
-  hPMRefClg = (TH1F*) file->Get("hPMRefClg");
-  hPMRefAlg = (TH1F*) file->Get("hPMRefAlg");
-  // --- Histos for detector PMTs 
-  TH1F *hZNChg[5], *hZPChg[5], *hZNAhg[5], *hZPAhg[5], *hZEMhg[2];
-  TH1F *hZNClg[5], *hZPClg[5], *hZNAlg[5], *hZPAlg[5], *hZEMlg[2];
-  char hnamZNChg[20], hnamZPChg[20], hnamZNAhg[20], hnamZPAhg[20];
-  char hnamZNClg[20], hnamZPClg[20], hnamZNAlg[20], hnamZPAlg[20];
-  char hnamZEMhg[20], hnamZEMlg[20];
-  for(Int_t j=0; j<5; j++){
-    sprintf(hnamZNChg,"ZNChg-tow%d",j);
-    sprintf(hnamZPChg,"ZPChg-tow%d",j);
-    sprintf(hnamZNAhg,"ZNAhg-tow%d",j);
-    sprintf(hnamZPAhg,"ZPAhg-tow%d",j);
-    //
-    hZNChg[j] = new TH1F(hnamZNChg, hnamZNChg, 100, 0., 1000.);
-    hZPChg[j] = new TH1F(hnamZPChg, hnamZPChg, 100, 0., 1000.);
-    hZNAhg[j] = new TH1F(hnamZNAhg, hnamZNAhg, 100, 0., 1000.);
-    hZPAhg[j] = new TH1F(hnamZPAhg, hnamZPAhg, 100, 0., 1000.);
-    //
-    sprintf(hnamZNClg,"ZNClg-tow%d",j);
-    sprintf(hnamZPClg,"ZPClg-tow%d",j);
-    sprintf(hnamZNAlg,"ZNAlg-tow%d",j);
-    sprintf(hnamZPAlg,"ZPAlg-tow%d",j);
-    //
-    hZNClg[j] = new TH1F(hnamZNClg, hnamZNClg, 100, 0., 4000.);
-    hZPClg[j] = new TH1F(hnamZPClg, hnamZPClg, 100, 0., 4000.);
-    hZNAlg[j] = new TH1F(hnamZNAlg, hnamZNAlg, 100, 0., 4000.);
-    hZPAlg[j] = new TH1F(hnamZPAlg, hnamZPAlg, 100, 0., 4000.);
-    //
-    if(j<2){
-      sprintf(hnamZEMhg,"ZEM%dhg",j);
-      sprintf(hnamZEMlg,"ZEM%dlg",j);
-      //
-      hZEMhg[j] = new TH1F(hnamZEMhg, hnamZEMhg, 100, 0., 1000.);      
-      hZEMlg[j] = new TH1F(hnamZEMlg, hnamZEMlg, 100, 0., 4000.);      
-    }
-    //
-    hZNChg[j] = (TH1F*) file->Get(hnamZNChg);
-    hZPChg[j] = (TH1F*) file->Get(hnamZPChg);
-    hZNAhg[j] = (TH1F*) file->Get(hnamZNAhg);
-    hZPAhg[j] = (TH1F*) file->Get(hnamZPAhg);
-    //
-    hZNClg[j] = (TH1F*) file->Get(hnamZNClg);
-    hZPClg[j] = (TH1F*) file->Get(hnamZPClg);
-    hZNAlg[j] = (TH1F*) file->Get(hnamZNAlg);
-    hZPAlg[j] = (TH1F*) file->Get(hnamZPAlg);
-    
-    
-  }
-
- if(optPlot==1){
-  // Plot the retrieved histos
-  //***********************************************************
-  // #### ROOT initialization
-  gROOT->Reset();
-  gStyle->SetCanvasColor(10);
-  gStyle->SetFrameFillColor(10);
-  gStyle->SetOptTitle(0);
-  gStyle->SetOptStat(1111);
-  gStyle->SetOptFit(111);
-  gStyle->SetTitleTextColor(9);
-  gStyle->SetStatTextColor(4);
-  gStyle->SetLineColor(1);
-  gStyle->SetPalette(1);
-  //***********************************************************
-  TCanvas *c1 = new TCanvas("c1","ZNC",0,0,1000,400);
-  c1->Divide(5,2);
-  for(Int_t y=0; y<5; y++){
-    c1->cd(y+1);
-    hZNChg[y]->Draw();
-    c1->cd(y+6);
-    hZNClg[y]->Draw();
-  }
-  c1->Print("ZNCLaser.ps");
-  //
-  TCanvas *c2 = new TCanvas("c2","ZPC",300,0,1000,400);
-  c2->Divide(5,2);
-  for(Int_t y=0; y<5; y++){
-    c2->cd(y+1);
-    hZPChg[y]->Draw();
-    c2->cd(y+6);
-    hZPClg[y]->Draw();
-  }
-  c2->Print("ZPCLaser.ps");
-  //
-  TCanvas *c3 = new TCanvas("c3","ZEM",400,0,400,400);
-  c3->Divide(2,2);
-  for(Int_t y=0; y<2; y++){
-    c3->cd(y+1);
-    hZEMhg[y]->Draw();
-    c3->cd(y+3);
-    hZEMlg[y]->Draw();
-  }
-  c3->Print("ZEMLaser.ps");
-  //
-  TCanvas *c4 = new TCanvas("c4","ZNA",0,400,1000,400);
-  c4->Divide(5,2);
-  for(Int_t y=0; y<5; y++){
-    c4->cd(y+1);
-    hZNAhg[y]->Draw();
-    c4->cd(y+6);
-    hZNAlg[y]->Draw();
-  }
-  c4->Print("ZNALaser.ps");
-  //
-  TCanvas *c5 = new TCanvas("c5","ZPA",300,400,1000,400);
-  c5->Divide(5,2);
-  for(Int_t y=0; y<5; y++){
-    c5->cd(y+1);
-    hZPAhg[y]->Draw();
-    c5->cd(y+6);
-    hZPAlg[y]->Draw();
-  }
-  c5->Print("ZPALaser.ps");
-  //
-  TCanvas *c6 = new TCanvas("c6","Ref",400,0,400,400);
-  c6->Divide(2,2);
-  c6->cd(1);
-  hPMRefChg->Draw();
-  c6->cd(2);
-  hPMRefAhg->Draw();
-  c6->cd(3);
-  hPMRefClg->Draw();
-  c6->cd(4);
-  hPMRefAlg->Draw();
- //
-  c6->Print("RefLaser.ps");
- }
-}
diff --git a/ZDC/CheckPedestal.C b/ZDC/CheckPedestal.C
deleted file mode 100644 (file)
index 133c3f1..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-#if !defined(__CINT__) || defined(__MAKECINT__)
-
-#include <TROOT.h>
-#include <TStyle.h>
-#include <Riostream.h>
-#include "TClassTable.h"
-#include <TStopwatch.h>
-#include <TDatime.h>
-#include <TClassTable.h>
-#include <TH1.h>
-#include <TH2.h>
-#include <TF1.h>
-#include <TProfile.h>
-#include <TFunction.h>
-#include <TCanvas.h>
-#include <TFile.h>
-
-#endif
-
-void CheckPedestal(const char * histoFName = "ZDCPedHisto.root", Int_t optPlot = 1)
-{
-
-  int const kNChannels = 24;
-  //
-  TFile * file = new TFile(histoFName, "READ");
-  file->cd();
-  TH1F::AddDirectory(0);
-  //
-  TH1F *hPedhg[kNChannels], *hPedOutOfTimehg[kNChannels];
-  TH2F *hPedCorrhg[kNChannels];
-  TH1F *hPedlg[kNChannels], *hPedOutOfTimelg[kNChannels];
-  TH2F *hPedCorrlg[kNChannels];
-  //
-  char namhist1hg[50], namhist2hg[50], namhist3hg[50];
-  char namhist1lg[50], namhist2lg[50], namhist3lg[50];
-  for(Int_t j=0; j<kNChannels; j++){
-     if(j<=4){ // ZNC
-       sprintf(namhist1hg,"PedZNChg_%d",j);
-       sprintf(namhist2hg,"PedZNChgOutOfTime_%d",j);
-       sprintf(namhist3hg,"PedCorrZNChg_%d",j);
-       //
-       sprintf(namhist1lg,"PedZNClg_%d",j);
-       sprintf(namhist2lg,"PedZNClgOutOfTime_%d",j);
-       sprintf(namhist3lg,"PedCorrZNClg_%d",j);
-     }
-     else if(j>=5 && j<=9){ // ZPC
-       sprintf(namhist1hg,"PedZPChg_%d",j-5);
-       sprintf(namhist2hg,"PedZPChgOutOfTime_%d",j-5);
-       sprintf(namhist3hg,"PedCorrZPChg_%d",j-5);
-       //
-       sprintf(namhist1lg,"PedZPClg_%d",j-5);
-       sprintf(namhist2lg,"PedZPClgOutOfTime_%d",j-5);
-       sprintf(namhist3lg,"PedCorrZPClg_%d",j-5);       
-     }
-     else if(j==10 || j==11){ // ZEM
-       sprintf(namhist1hg,"PedZEMhg_%d",j-9);
-       sprintf(namhist2hg,"PedZEMhgOutOfTime_%d",j-9);
-       sprintf(namhist3hg,"PedCorrZEMhg_%d",j-9);
-       //
-       sprintf(namhist1lg,"PedZEMlg_%d",j-9);
-       sprintf(namhist2lg,"PedZEMlgOutOfTime_%d",j-9);
-       sprintf(namhist3lg,"PedCorrZEMlg_%d",j-9);
-     }
-     else if(j>=12 && j<=16){ // ZNA
-       sprintf(namhist1hg,"PedZNAhg_%d",j-12);
-       sprintf(namhist2hg,"PedZNAhgOutOfTime_%d",j-12);
-       sprintf(namhist3hg,"PedCorrZNAhg_%d",j-12);
-       //
-       sprintf(namhist1lg,"PedZNAlg_%d",j-12);
-       sprintf(namhist2lg,"PedZNAlgOutOfTime_%d",j-12);
-       sprintf(namhist3lg,"PedCorrZNAlg_%d",j-12);
-     }
-     else if(j>=17 && j<=21){ // ZPA
-       sprintf(namhist1hg,"PedZPAhg_%d",j-17);
-       sprintf(namhist2hg,"PedZPAhgOutOfTime_%d",j-17);
-       sprintf(namhist3hg,"PedCorrZPAhg_%d",j-17);
-       //
-       sprintf(namhist1lg,"PedZPAlg_%d",j-17);
-       sprintf(namhist2lg,"PedZPAlgOutOfTime_%d",j-17);
-       sprintf(namhist3lg,"PedCorrZPAlg_%d",j-17);
-     }
-     else if(j==22 || j==23){ //Reference PMs
-       sprintf(namhist1hg,"PedRefhg_%d",j-22);
-       sprintf(namhist2hg,"PedRefhgOutOfTime_%d",j-22);
-       sprintf(namhist3hg,"PedCorrRefhg_%d",j-22);
-       //
-       sprintf(namhist1lg,"PedReflg_%d",j-22);
-       sprintf(namhist2lg,"PedReflgOutOfTime_%d",j-22);
-       sprintf(namhist3lg,"PedCorrReflg_%d",j-22);
-     }
-     // --- High gain chain histos
-     hPedhg[j] = (TH1F*) file->Get(namhist1hg);
-     hPedOutOfTimehg[j] = (TH1F*) file->Get(namhist2hg);
-     hPedCorrhg[j] =  (TH2F*) file->Get(namhist3hg);
-     // --- Low gain chain histos
-     hPedlg[j] = (TH1F*) file->Get(namhist1lg);
-     hPedOutOfTimelg[j] =(TH1F*) file->Get(namhist2lg);
-     hPedCorrlg[j] = (TH2F*) file->Get(namhist3lg);
-  }
-
- if(optPlot==1){
-  // Plot the retrieved histos
-  //***********************************************************
-  // #### ROOT initialization
-  gROOT->Reset();
-  gStyle->SetCanvasColor(10);
-  gStyle->SetFrameFillColor(10);
-  gStyle->SetOptTitle(0);
-  gStyle->SetOptStat(1111);
-  gStyle->SetOptFit(111);
-  gStyle->SetTitleTextColor(9);
-  gStyle->SetStatTextColor(4);
-  gStyle->SetLineColor(1);
-  gStyle->SetPalette(1);
-  //***********************************************************
-  TCanvas *c6 = new TCanvas("c6","Side C correlations",0,200,1000,800);
-  c6->Divide(5,4);
-  for(Int_t t=0; t<10; t++){
-    c6->cd(t+1);
-    hPedCorrhg[t]->Draw();
-    c6->cd(t+11);
-    hPedCorrlg[t]->Draw();
-  }
-  c6->Print("CorrSideC.ps");
-  //
-  TCanvas *c7 = new TCanvas("c7","Side A correlations",300,200,1000,800);
-  c7->Divide(5,4);
-  for(Int_t t=0; t<10; t++){
-    c7->cd(t+1);
-    hPedCorrhg[t+12]->Draw();
-    c7->cd(t+11);
-    hPedCorrlg[t+12]->Draw();
-  }
-  c7->Print("CorrSideA.ps");
-  //
-  TCanvas *c8 = new TCanvas("c8","ZEM correlations",400,200,400,400);
-  c8->Divide(2,2);
-  for(Int_t t=0; t<2; t++){
-    c8->cd(t+1);
-    hPedCorrhg[t+10]->Draw();
-    c8->cd(t+3);
-    hPedCorrlg[t+10]->Draw();
-  }
-  c8->Print("CorrZEM.ps");
-  //***********************************************************
-  TCanvas *c1 = new TCanvas("c1","ZNC pedestals",0,0,1000,400);
-  c1->Divide(5,2);
-  for(Int_t y=0; y<5; y++){
-    c1->cd(y+1);
-    hPedhg[y]->Draw();
-    c1->cd(y+6);
-    hPedlg[y]->Draw();
-  }
-  c1->Print("ZNCPed.ps");
-  //
-  TCanvas *c2 = new TCanvas("c2","ZPC pedestals",300,0,1000,400);
-  c2->Divide(5,2);
-  for(Int_t y=0; y<5; y++){
-    c2->cd(y+1);
-    hPedhg[y+5]->Draw();
-    c2->cd(y+6);
-    hPedlg[y+5]->Draw();
-  }
-  c2->Print("ZPCPed.ps");
-  //
-  TCanvas *c3 = new TCanvas("c3","ZEM pedestals",400,0,400,400);
-  c3->Divide(2,2);
-  for(Int_t y=0; y<2; y++){
-    c3->cd(y+1);
-    hPedhg[y+10]->Draw();
-    c3->cd(y+3);
-    hPedlg[y+10]->Draw();
-  }
-  c3->Print("ZEMPed.ps");
-  //
-  TCanvas *c4 = new TCanvas("c4","ZNA pedestals",0,400,1000,400);
-  c4->Divide(5,2);
-  for(Int_t y=0; y<5; y++){
-    c4->cd(y+1);
-    hPedhg[y+12]->Draw();
-    c4->cd(y+6);
-    hPedlg[y+12]->Draw();
-  }
-  c4->Print("ZNAPed.ps");
-  //
-  TCanvas *c5 = new TCanvas("c5","ZPA pedestals",300,400,1000,400);
-  c5->Divide(5,2);
-  for(Int_t y=0; y<5; y++){
-    c5->cd(y+1);
-    hPedhg[y+17]->Draw();
-    c5->cd(y+6);
-    hPedlg[y+17]->Draw();
-  }
-  c5->Print("ZPAPed.ps");
- }
-}