StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
saveSignalChar.C
1 
2 void saveSignalChar(Char_t* signalFile="signalShapes.root")
3 {
4  gStyle->SetPalette(1);
5  TFile f(signalFile);
6  Char_t buffer[100];
7  Char_t quadName[10];
8  Char_t layerName[10];
9 
10  for(int iD=1;iD<7;iD++)
11  {
12  for(int iQ=0;iQ<4;iQ++)
13  {
14  if(iD>1 && iQ >1)
15  continue;
16  if(iQ==0)
17  sprintf(quadName,"A");
18  if(iQ==1)
19  sprintf(quadName,"B");
20  if(iQ==2)
21  sprintf(quadName,"C");
22  if(iQ==3)
23  sprintf(quadName,"D");
24  for(int iL=0;iL<2;iL++)
25  {
26  if(iL==0)
27  sprintf(layerName,"P");
28  else
29  sprintf(layerName,"R");
30  sprintf(buffer,"Canvas_Disc_%id_Quad%s_Layer%s",iD,quadName,layerName);
31  TCanvas c(buffer,buffer,10,10,3000,2000);
32  c.Divide(3,3);
33  c.cd(1);
34  sprintf(buffer,"numFSigCloseCluster%s_disc%d_quad%d",layerName,iD,iQ);
35  cout <<"loading " << buffer <<endl;
36  // TCanvas c2;
37  TH1D* h=(TH1D*)f.Get(buffer);
38  sprintf(buffer,"numFSigCloseCluster%s_disc%d_quad%s",layerName,iD,quadName);
39  if(h!=0)
40  {
41  h->SetTitle(buffer);
42  h->SetName(buffer);
43  h->SetFillColor(kYellow-9);
44  h->Draw();
45  }
46  sprintf(buffer,"numFSigCloseCluster%s_disc%d_quad%s.png",layerName,iD,quadName);
47  // c2.SaveAs(buffer);
48  c.cd(2);
49  sprintf(buffer,"maxTbCloseCluster%s_disc%d_quad%d",layerName,iD,iQ);
50  cout <<"loading " << buffer <<endl;
51  TH1D* h=(TH1D*)f.Get(buffer);
52  sprintf(buffer,"maxTbCloseCluster%s_disc%d_quad%s",layerName,iD,quadName);
53  if(h!=0)
54  {
55  h->SetName(buffer);
56  h->SetTitle(buffer);
57  h->SetFillColor(kYellow-9);
58  h->Draw();
59  }
60  c.cd(3);
61  sprintf(buffer,"maxAdcCloseCluster%s_disc%d_quad%d",layerName,iD,iQ);
62  cout <<"loading " << buffer <<endl;
63  TH1D* h=(TH1D*)f.Get(buffer);
64  sprintf(buffer,"maxAdcCloseCluster%s_disc%d_quad%s",layerName,iD,quadName);
65  if(h!=0)
66  {
67  h->SetName(buffer);
68  h->SetTitle(buffer);
69  h->SetFillColor(kYellow-9);
70  h->Draw();
71  }
72 
73  c.cd(4);
74  sprintf(buffer,"maxAdcTrackCluster%s_disc%d_quad%d",layerName,iD,iQ);
75  cout <<"loading " << buffer <<endl;
76  TH1D* h=(TH1D*)f.Get(buffer);
77  sprintf(buffer,"maxAdcTrackCluster%s_disc%d_quad%s",layerName,iD,quadName);
78  if(h!=0)
79  {
80  h->SetName(buffer);
81  h->SetTitle(buffer);
82  h->SetFillColor(kYellow-9);
83  h->Draw();
84  }
85  c.cd(5);
86  sprintf(buffer,"numFirstHighCloseCluster%s_disc%d_quad%d",layerName,iD,iQ);
87  cout <<"loading " << buffer <<endl;
88  TH1D* h=(TH1D*)f.Get(buffer);
89  sprintf(buffer,"maxFirstHighCloseCluster%s_disc%d_quad%s",layerName,iD,quadName);
90  if(h!=0)
91  {
92  h->SetName(buffer);
93  h->SetTitle(buffer);
94  h->SetFillColor(kYellow-9);
95  h->Draw();
96  }
97  c.cd(6);
98  sprintf(buffer,"r_phi_ChargeCorrelationInDisk_%d_quad_%d",iD,iQ);
99  cout <<"loading " << buffer <<endl;
100  TH2D* h2=(TH2D*)f.Get(buffer);
101  sprintf(buffer,"r_phi_ChargeCorrelationInDisk_%d_quad_%s",iD,quadName);
102  if(h2!=0)
103  {
104  h2->SetName(buffer);
105  h2->SetTitle(buffer);
106  h2->GetXaxis()->SetRangeUser(0,15000);
107  h2->GetYaxis()->SetRangeUser(0,15000);
108  h2->Draw("colz");
109  }
110  sprintf(buffer,"EnergyForDisk%d_Quad%s_layerR.png",iD,quadName,layerName);
111  TH1D* projR=h2->ProjectionX(buffer);
112  sprintf(buffer,"EnergyForDisk%d_Quad%s_layerP.png",iD,quadName,layerName);
113  TH1D* projP=h2->ProjectionY(buffer);
114  c.cd(7);
115  projR->SetFillColor(kYellow-9);
116  projR->Draw();
117  c.cd(8);
118  projP->SetFillColor(kYellow-9);
119  projP->Draw();
120  c.cd(9);
121  sprintf(buffer,"clusterSize%sInDisk_%d_quad_%d",layerName,iD,iQ);
122  TH1D* hClusSize=(TH1D*)f.Get(buffer);
123  if(hClusSize!=0)
124  {
125  hClusSize->SetFillColor(kYellow-9);
126  hClusSize->GetXaxis()->SetTitle("number of strips");
127  hClusSize->GetXaxis()->SetRangeUser(0,10);
128  hClusSize->Draw();
129  }
130  sprintf(buffer,"signalInfoForDisk%d_Quad%s_layer%s.png",iD,quadName,layerName);
131  c.SaveAs(buffer);
132 
133  }
134  }
135  }
136 
137 }