Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:11:53

0001 //#include "z1.C"
0002 
0003 // 2006.06.05 dkcira - plot all histograms from 1 Tk Module
0004 plot1tkmod(TString dirpath="TIB/layer_1/backward_strings/internal_strings/string_1", TString mod="369164550")
0005 {
0006   gStyle->SetOptStat(1110);
0007   gStyle->SetCanvasColor(0);
0008   gStyle->SetStatBorderSize(1);
0009   gStyle->SetHistFillColor(0);
0010   gStyle->SetHistLineColor(1);
0011   gStyle->SetMarkerStyle(23);
0012   gStyle->SetMarkerSize(2.5);
0013   gStyle->SetMarkerColor(1);
0014   gStyle->SetTitleSize(1.0);
0015 //  zc->SetGrid();
0016 
0017 //TString dirpath="TIB/layer_1/backward_strings/internal_strings/string_1", TString mod="369164550"
0018 //TString dirpath="TIB/layer_1/backward_strings/internal_strings/string_17",TString mod="369168654"
0019 
0020 
0021   // read in file with histograms
0022   TString histo_file = "test_digi_cluster.root";
0023   TFile dqmf(histo_file); // dqmf.ls();
0024   TString fullpath="DQMData/SiStrip/MechanicalView/"+dirpath+"/module_"+mod+"/";
0025 //  dqmf.cd(fullpath);
0026    cout<<"fullpath="<<fullpath<<endl;
0027 
0028   TString S_DigisPerDetector = fullpath+"DigisPerDetector__det__"+mod;
0029   TString S_ADCsCoolestStrip = fullpath+"ADCsCoolestStrip__det__"+mod;
0030   TString S_ADCsHottestStrip = fullpath+"ADCsHottestStrip__det__"+mod;
0031   TString S_NrOfClusterizedStrips = fullpath+"NrOfClusterizedStrips__det__"+mod;
0032   TString S_ClusterCharge = fullpath+"ClusterCharge__det__"+mod;
0033   TString S_ClusterPosition = fullpath+"ClusterPosition__det__"+mod;
0034   TString S_ClusterWidth = fullpath+"ClusterWidth__det__"+mod;
0035   TString S_ClustersPerDetector = fullpath+"ClustersPerDetector__det__"+mod;
0036   TString S_ModuleLocalOccupancy = fullpath+"ModuleLocalOccupancy__det__"+mod;
0037 
0038   TH1F * DigisPerDetector = (TH1F*)dqmf.Get(S_DigisPerDetector);
0039   TH1F * ADCsCoolestStrip = (TH1F*)dqmf.Get(S_ADCsCoolestStrip);
0040   TH1F * ADCsHottestStrip = (TH1F*)dqmf.Get(S_ADCsHottestStrip);
0041   TH1F * NrOfClusterizedStrips = (TH1F*)dqmf.Get(S_NrOfClusterizedStrips);
0042   TH1F * ClusterCharge = (TH1F*)dqmf.Get(S_ClusterCharge);
0043   TH1F * ClusterPosition = (TH1F*)dqmf.Get(S_ClusterPosition);
0044   TH1F * ClusterWidth = (TH1F*)dqmf.Get(S_ClusterWidth);
0045   TH1F * ClustersPerDetector = (TH1F*)dqmf.Get(S_ClustersPerDetector);
0046   TH1F * ModuleLocalOccupancy = (TH1F*)dqmf.Get(S_ModuleLocalOccupancy);
0047 
0048   z1(DigisPerDetector, dirpath);
0049   z1(ADCsCoolestStrip, dirpath);
0050   TString lokt = "ADCs__det__"+mod; ADCsHottestStrip->SetTitle(lokt);
0051   cout<<lokt<<endl;
0052   z1(ADCsHottestStrip, dirpath);
0053   z1(ClustersPerDetector, dirpath);
0054   z1(ClusterCharge, dirpath);
0055   z1(ClusterPosition, dirpath);
0056   z1(ClusterWidth, dirpath);
0057   z1(ClustersPerDetector, dirpath);
0058   z1(ModuleLocalOccupancy, dirpath);
0059 }
0060 
0061 void z1(TH1F *ah1, TString dirpath){
0062 //2006.06.05 - plot 1 of modules histograms and print plot to file
0063 TCanvas *myCanvas = new TCanvas("zc","zC",500,0,700,700);
0064 //  mode = "ourmen" o = number of entries in overflow box, u = number of entries in underflow box r = rms of distribution m = mean of distribution e = total number of entries n = histogram name
0065   //
0066   ah1->SetXTitle(ah1->GetTitle()); ah1->SetTitle(dirpath);
0067   TString thetitle = ah1->GetXaxis()->GetTitle();
0068   TString filenamewheretoprint = thetitle+".gif";
0069   cout<<"filenamewheretoprint="<<filenamewheretoprint<<endl;
0070   ah1->Draw();
0071   char *s = new char[1];
0072 //  cout<<"hit return to continue"<<endl; gets(s);  // "return" is enough, root waits until you hit a key
0073   zc->Print(filenamewheretoprint);
0074 //  zc->Close();
0075 }
0076