StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
savePulseShapes.C
1 
2 void savePulseShapes(Char_t* pulseFile="pulses.root")
3 {
4 
5 
6 TFile f(pulseFile);
7  Char_t buffer[100];
8  Char_t quadName[10];
9  // TCanvas c;
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  sprintf(buffer,"pulseShapes_disc%d_quad%s",iD,quadName);
25  TCanvas c(buffer,buffer,2000,2000);
26  c.Divide(2,2);
27  c.cd(1);
28  sprintf(buffer,"validChargesR_D%d_Q%d",iD,iQ);
29  cout <<"loading " << buffer <<endl;
30  TH1D* hVC=(TH1D*)f.Get(buffer);
31  sprintf(buffer,"validChargesR_D%d_Q%s",iD,quadName);
32  hVC->SetName(buffer);
33  hVC->Draw();
34  // sprintf(buffer,"validChargesR_D%d_Q%s.png",iD,quadName);
35  // c.SaveAs(buffer);
36  c.cd(2);
37  sprintf(buffer,"validChargesP_D%d_Q%d",iD,iQ);
38  cout <<"loading " << buffer <<endl;
39  TH1D* hVC=(TH1D*)f.Get(buffer);
40  sprintf(buffer,"validChargesP_D%d_Q%s",iD,quadName);
41  hVC->SetName(buffer);
42  hVC->Draw();
43  sprintf(buffer,"validChargesP_D%d_Q%s.png",iD,quadName);
44  // c.SaveAs(buffer);
45 
46  c.cd(3);
47  sprintf(buffer,"validPulsesR_D%d_Q%d",iD,iQ);
48  cout <<"loading " << buffer <<endl;
49  TH1D* hVP=(TH1D*)f.Get(buffer);
50  sprintf(buffer,"validPulsesR_D%d_Q%s",iD,quadName);
51  hVP->SetName(buffer);
52  hVP->Draw();
53  sprintf(buffer,"validPulsesR_D%d_Q%s.png",iD,quadName);
54  // c.SaveAs(buffer);
55  c.cd(4);
56  sprintf(buffer,"validPulsesP_D%d_Q%d",iD,iQ);
57  cout <<"loading " << buffer <<endl;
58  TH1D* hVP=(TH1D*)f.Get(buffer);
59  sprintf(buffer,"validPulsesP_D%d_Q%s",iD,quadName);
60  hVP->SetName(buffer);
61  hVP->Draw();
62  sprintf(buffer,"validChargeAndPulses_D%d_Q%s.png",iD,quadName);
63  c.SaveAs(buffer);
64  }
65  }
66 
67 }