StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFgtSlowSimu_histo.cxx
1 // *-- Author : J.Balewski
2 //
3 // $Id: StFgtSlowSimu_histo.cxx,v 1.1 2011/04/07 19:31:22 balewski Exp $
4 
5 #include <TVector3.h>
6 #include <TH2.h>
7 #include <TF1.h>
8 #include <TFile.h>
9 #include <TLine.h>
10 #include <TPolyLine.h>
11 #include <TCrown.h>
12 #include <TRandom3.h>
13 
14 #include "StFgtSlowSimuMaker.h"
15 #include "StFgtGeom.h"
16 
17 //_______________________________________________
18 //________________________________________________
19 void
20 StFgtSlowSimuMaker::InitHisto1(){
21  /* working arrays for slow simulator
22  digXY is reset for every quart (24 times per event)
23  digRad, digPhi are reset for every disk ( 6 times per event)
24  */
25 
26  int digNx=2000, digNy=digNx;
27  float maxR=40.;
28  digXY=new TH2F("digXY"," 2D digitization response of FGT quart; local X(cm); local Y (cm)",digNx,0.,maxR,digNy,0.,maxR); HList->Add(digXY);
29 
30  digRad=new TH1F("digRad","rad-strips response of FGT disk; radial-strip ID",geom->radStripGBLId_number(),0.,geom->radStripGBLId_number()); HList->Add(digRad);
31  digPhi=new TH1F("digPhi","phi-strips response of FGT disk; phi-strip ID",geom->phiStripGBLId_number(),0.,geom->phiStripGBLId_number()); HList->Add(digPhi);
32 
33 // The next 3 histograms are not reset for debugging purpose WMZ
34  digXYAll=new TH2F("digXYAll"," 2D digitization response of all FGT quart; local X(cm); local Y (cm)",digNx,0.,maxR,digNy,0.,maxR); HList->Add(digXYAll);
35 
36  digRadAll=new TH1F("digRadAll","rad-strips response of all FGT disks; radial-strip ID",geom->radStripGBLId_number(),0.,geom->radStripGBLId_number()); HList->Add(digRadAll);
37  digPhiAll=new TH1F("digPhiAll","phi-strips response of all FGT disks; phi-strip ID",geom->phiStripGBLId_number(),0.,geom->phiStripGBLId_number()); HList->Add(digPhiAll);
38 
39 
40 }
41 //________________________________________________
42 //________________________________________________
43 void
44 StFgtSlowSimuMaker::InitHisto2(){
45 
46  // QA-histos
47  hA[0]=new TH1F("ss_inDE","g2t DE of hit; Elos (keV)",600,0.,5.);
48  hA[1]=new TH1F("ss_inDS","g2t path length of hit; DS (cm)",60,0.,9.);
49  hA[2]=new TH1F("ss_inZ","g2t Z of hit (entrance); Z(cm)",1000,50.,250.);
50 
51 // # of disk increased to 9 from 6.
52  hA[3]=new TH1F("ss_hitStat","Where hits are lost, 1-10 general; x=10+5*disk+quad",75, 0.5,75.5);
53  hA[4]=new TH2F("ss_inXY","Entrance X-Y , accepted hits, all disks",90,-45.,45.,90,-45.,45.);
54 
55  float maxRb=45.;
56  hA[5]=new TH1F("ss_cTof","g2t TOF of hit (before cut); TOF(ns)",1000,0.,200.);
57  hA[6]=new TH1F("ss_inR","g2t Rxy of hit, w=1.; Rxy (cm)",10*(int)maxRb,0.,maxRb);
58  hA[7]=new TH1F("ss_cPmag","g2t P.Mag of hit (before cut); log10(momentum/MeV)",160,-2,6.);
59 
60 
61 
62  // 8,9,10-free
63 
64  int i;
65  for(i=0;i<kFgtMxDisk;i++) { // uses histos ID=[11,18]
66  char tt1[100], tt2[500];
67  sprintf(tt1,"ss_gXY%d",i);
68  sprintf(tt2," hits accepted in Disk=%d; LAB X (cm) ; LAB Y (cm) ",i);
69  hA[11+i]=new TH2F(tt1,tt2,25,-maxRb,maxRb,25,-maxRb,maxRb);
70  }
71  hA[20]=new TH1F("fr_pairEne", "Energy of pair per collision; Energy Loss per collision [eV]", 100, 0, 100);
72  hA[21]=new TH1F("fr_nPrimPair", "No. of prim pairs per track; # of pairs", 35, -0.5, 34.5);
73  hA[22]= new TH1F("fr_totEne", "Total energy deposit per track; Energy Loss [keV]", 250, 0, 5.);
74 
75  hA[23]= new TH1F("fr_nTotPair", "Total No. of pairs per track; # of pairs", 250, -0.5, 249.5);
76  hA[24]= new TH1F("fr_pathL", "Total path length in gas per track; path (mm)",50, 0., 10.);
77  hA[25]= new TH1F("fr_avrPath", "Average path length , w=nAnyEle; path (mm)",50, 0., 10.);
78  hA[26]= new TH1F("fr_avrTPath", "Average transverse path length , w=nAnyEle; path (mm)",250, 0., 10.);
79  hA[27]=new TH1F("fr_Zdrf","Zdrift of prim ele ; Z(mm)",100,0.,5.);
80  hA[28]=new TH2F("fr_Rdiff","Transverse diffusion; relative X(um); relative Y(um)",50,-250,250,50,-250,250);
81 
82 
83  //..............add gadgets to histos
84  TList *Lx; TCrown *cr; //TLine *ln;
85 
86  //....inXY....
87  Lx=hA[4]->GetListOfFunctions(); assert(Lx);
88  int iq=0;
89  for(iq=0;iq<kFgtMxQuad;iq++) {
90  float phi1=geom->phiQuadXaxis(iq)/3.1416*180.;
91  cr=new TCrown(0.,0.,geom->Rin(),geom->Rout(),phi1,phi1+90);
92  cr->SetLineColor(kRed); Lx->Add(cr);
93  }
94  cr=new TCrown(0.,0.,geom->Rmid(),geom->Rmid(),0,360);
95  cr->SetLineColor(kMagenta); Lx->Add(cr); cr->SetLineStyle(2);
96 
97 
98 
99 
100  for(i=0;i<mxH;i++)
101  if(hA[i]) HList->Add(hA[i]);
102 
103 
104 }
105 
106 
107 //_______________________________________________
108 //________________________________________________
109 void
110 StFgtSlowSimuMaker::CloseHisto(){
111 
112  //..............add gadgets to histos
113  TList *Lx; TCrown *cr; //TLine *ln;
114 
115  //....digXY....
116  Lx=digXY->GetListOfFunctions(); assert(Lx);
117 
118  int iqq=0;
119  for(iqq=0;iqq<2;iqq++) {
120  float phi1=0;
121  if(iqq<1)
122  cr=new TCrown(0.,0.,geom->Rmid(),geom->Rout(),phi1,phi1+90);
123  else
124  cr=new TCrown(0.,0.,geom->Rin(),geom->Rmid(),phi1,phi1+90);
125  cr->SetLineColor(kGreen);
126  Lx->Add(cr);
127  }
128 // WMZ
129  cr=new TCrown(0.,0.,geom->Rmid(),geom->Rmid(),0,90);
130  Lx->Add(cr);
131 
132  TList *Lx1;
133  Lx1=digXYAll->GetListOfFunctions(); assert(Lx1);
134 
135  for(iqq=0;iqq<2;iqq++) {
136  float phi1=0;
137  if(iqq<1)
138  cr=new TCrown(0.,0.,geom->Rmid(),geom->Rout(),phi1,phi1+90);
139  else
140  cr=new TCrown(0.,0.,geom->Rin(),geom->Rmid(),phi1,phi1+90);
141  cr->SetLineColor(kGreen);
142  Lx1->Add(cr);
143  }
144 // WMZ
145  cr=new TCrown(0.,0.,geom->Rmid(),geom->Rmid(),0,90);
146  Lx1->Add(cr);
147 }
148 
149 
150 
153 
154 // $Log: StFgtSlowSimu_histo.cxx,v $
155 // Revision 1.1 2011/04/07 19:31:22 balewski
156 // start
157 //
158 
159 
160 
161 
162