20 #include "StFtpcLaser.hh"
22 #include "StMessMgr.h"
26 StFtpcLaser::StFtpcLaser()
28 TStyle *plain =
new TStyle(
"Plain",
"Plain Style (no colors/fill areas)");
29 plain->SetTitleOffset(1.25);
30 plain->SetCanvasBorderMode(0);
31 plain->SetPadBorderMode(0);
32 plain->SetPadColor(0);
33 plain->SetCanvasColor(0);
34 plain->SetTitleColor(0);
35 plain->SetStatColor(0);
37 plain->SetOptStat(11);
54 void StFtpcLaser::Init(TString filename)
57 f=
new TFile(filename+
".root");
58 LOG_INFO<<
"StFtpcLaser::Init..."<<endm;
61 LOG_INFO<<
"Read file : "<<filename<<
".root"<<endm;
62 LOG_INFO<<
"--------------"<<endm;
66 void StFtpcLaser::GetTreeEntry(
int k)
68 btcluster->GetEntry(k);
77 void StFtpcLaser::GetClusterTreeEntry(
int k)
79 bcluster->GetEntry(k);
86 StFtpcLaser::~StFtpcLaser()
94 Float_t StFtpcLaser::zyltrafo(Float_t x,Float_t y, Float_t z)
97 if (x<0) erg=atan(y/x)+TMath::Pi();
98 if (x>0) erg=atan(y/x);
99 if (x==0 && y>0) erg=TMath::Pi()/2;
100 if (x==0 && y<0) erg=-TMath::Pi()/2;
106 bool StFtpcLaser::laser_sector(
int whichftpc,
int whichsec,
int sec)
118 if (sec==32 || sec==38 || sec==44 || sec==50 || sec==56)
124 if (sec==34 || sec==40 || sec==46 || sec==52 || sec==58)
130 if (sec==36 || sec==42 || sec==48 || sec==54 || sec==60)
137 LOG_ERROR<<
"ERROR : No valid Laser sector for Ftpc East!"<<endm;
142 else if (whichftpc==1)
151 if (sec==2 || sec==8 || sec==14 || sec==20 || sec==26)
157 if (sec==4 || sec==10 || sec==16 || sec==22 || sec==28)
163 if (sec==6 || sec==12 || sec==18 || sec==24 || sec==30)
170 LOG_ERROR<<
"ERROR : No valid Laser sector for Ftpc West!"<<endm;
175 else if (whichftpc==0)
180 LOG_ERROR<<
"ERROR : No FTPC chosen !"<<endm;
187 int StFtpcLaser::laser_straight(
float *rad,
int max)
190 if ((rad[0]-rad[max-1])>5)
193 else if (fabs(rad[0]-rad[max-1])>5)
202 void StFtpcLaser::readtree(TFile *f)
204 drtree=(TTree*) f->Get(
"rinfo");
205 bRun=drtree->GetBranch(
"Run");
206 bRun->SetAddress(&Run);
207 dtree=(TTree*) f->Get(
"cl");
208 bhit=dtree->GetBranch(
"hit");
209 bhit->SetAddress(&
hit);
210 bcluster=dtree->GetBranch(
"cluster");
211 bcluster->SetAddress(&cluster);
212 bevent=dtree->GetBranch(
"event");
213 bevent->SetAddress(&event);
215 dtrtree=(TTree*) f->Get(
"tr");
216 btrevent=dtrtree->GetBranch(
"event");
217 btrevent->SetAddress(&trevent);
218 btrack=dtrtree->GetBranch(
"track");
219 btrack->SetAddress(&
track);
220 btrvertex=dtrtree->GetBranch(
"vertex");
221 btrvertex->SetAddress(&mvertex);
223 dttree=(TTree*) f->Get(
"clot");
224 btcluster=dttree->GetBranch(
"cluster");
225 btcluster->SetAddress(&tcluster);
226 bthit=dttree->GetBranch(
"hit");
227 bthit->SetAddress(&thit);
228 btevent=dttree->GetBranch(
"event");
229 btevent->SetAddress(&tevent);