1 TString MikesMinimalOpts =
" P2017a PicoVtxDefault -hitfilt ";
4 TString DanielSuggestedOpts =
"ry2017a in AgML tpcDB btof Tree picoWrite UseXgeom BAna ppOpt VFPPVnoCTB beamline3D l3onl fpd trgd analysis PicoVtxDefault -hitfilt epdDb epdHit";
9 void DrawWheel(StSPtrVecEpdHit hits, TString outputFileName);
11 void AnalyzePedAsPhysRun(
char* inputDirectory,
char* inputFileName)
14 TString _infile = inputDirectory;
16 _infile += inputFileName;
18 TString outfile = inputFileName;
19 outfile.ReplaceAll(
".daq",
"_Levels.txt");
22 gROOT->Macro(
"Load.C");
23 gSystem->Load(
"StEpdUtil");
25 gROOT->LoadMacro(
"bfc.C");
29 bfc(0,DanielSuggestedOpts,_infile);
33 for (
int i=0; i<N; i++ ) {
41 cout <<
"Cant find muDst :-(\n";
44 cout <<
"\n\n\n\n\n --------- here in the macro -----------\n\n\n i= " << i <<
"\n\n";
45 cout <<
"Looking at EPD hits in StEvent....\n\n";
46 if (event->epdCollection() == 0){ cout <<
"No StEpdCollection!\n";}
49 hits = epdCollection->epdHits();
51 cout <<
"StEpdCollection size is " << hits.size() << endl;
53 cout <<
"\n\n\n\n\n\n ----------------------------------\n\n\n";
55 DrawWheel(hits, outfile);
65 void DrawWheel(StSPtrVecEpdHit hits, TString outputFileName){
68 int lowLimitB[4] = {-1,10,150,3001};
69 int hiLimitB[4] = {9,149,3000,5000};
70 int lowLimitC[4] = {-1,10,150,3001};
71 int hiLimitC[4] = {9,149,3000,5000};
74 int levelColor[4] = {4,3,2,6};
77 int tileLevel[12][31][2];
78 int tileAdc[12][31][2];
80 for (
int ew=0; ew<2; ew++){
81 for (
int pp=1; pp<13; pp++){
82 for (
int tt=1; tt<32; tt++){
83 tileLevel[pp-1][tt-1][ew] = 0;
84 tileAdc[pp-1][tt-1][ew] = 0;
89 for (
unsigned int tile=0; tile<hits.size(); tile++){
92 int tt = theHit->
tile();
93 int ew = theHit->
side();
94 int ewIndex = (ew<0)?0:1;
95 int adc = theHit->
adc();
96 int Level,lowCutoff,hiCutoff;
97 for (Level=0; Level<4; Level++){
98 if (tt<10){lowCutoff=lowLimitC[Level]; hiCutoff=hiLimitC[Level];}
99 else {lowCutoff=lowLimitB[Level]; hiCutoff=hiLimitB[Level];}
100 if ((adc>=lowCutoff)&&(adc<=hiCutoff))
break;
102 if (Level>3) cout <<
"ERROR!!\n\n";
103 tileLevel[pp-1][tt-1][ewIndex] = Level;
104 tileAdc[pp-1][tt-1][ewIndex] = adc;
108 ofs.open(outputFileName.Data());
110 for (
int ew=0; ew<2; ew++){
111 int ewSigned = (ew==0)?-1:1;
112 for (
int pp=1; pp<13; pp++){
113 for (
int tt=1; tt<32; tt++){
114 ofs << ewSigned <<
"\t" << pp <<
"\t" << tt <<
"\t" << tileLevel[pp-1][tt-1][ew] <<
"\t" << tileAdc[pp-1][tt-1][ew] << endl;
124 TCanvas* WheelCan =
new TCanvas(
"EpdWheels",
"EpdWheels",1200,600);
126 WheelCan->Divide(2,1);
128 TPad* eastPad = WheelCan->cd(1);
129 eastPad->Range(-100,-100,100,100);
130 TPaveLabel* eastLab =
new TPaveLabel(60,90,90,99,
"East");
132 double labelRadius=96;
133 for (
int pp=1; pp<13; pp++){
134 double phi=geo->TileCenter(pp,1,-1).Phi();
135 TText* ppLabel =
new TText(labelRadius*cos(phi),labelRadius*sin(phi),Form(
"PP%d",pp));
136 ppLabel->SetTextAlign(22);
137 ppLabel->SetTextColor(kBlue);
138 ppLabel->SetTextSize(.02);
142 TPad* westPad = WheelCan->cd(2);
143 westPad->Range(-100,-100,100,100);
144 TPaveLabel* westLab =
new TPaveLabel(60,90,90,99,
"West");
146 for (
int pp=1; pp<13; pp++){
147 double phi=geo->TileCenter(pp,1,1).Phi();
148 TText* ppLabel =
new TText(labelRadius*cos(phi),labelRadius*sin(phi),Form(
"PP%d",pp));
149 ppLabel->SetTextAlign(22);
150 ppLabel->SetTextColor(kBlue);
151 ppLabel->SetTextSize(.02);
161 for (
int ew=0; ew<2; ew++){
162 for (
int pp=1; pp<13; pp++){
163 for (
int tt=1; tt<32; tt++){
166 geo->GetCorners(
id,&nCorners,xcorn,ycorn);
167 xcorn[nCorners]=xcorn[0]; ycorn[nCorners]=ycorn[0];
168 TPolyLine* pline =
new TPolyLine(nCorners+1,xcorn,ycorn);
169 pline->SetLineWidth(1);
170 pline->SetLineColor(1);
171 pline->SetFillColor(levelColor[tileLevel[pp-1][tt-1][ew]]);
172 thePad = (ew>0)?westPad:eastPad;
176 TText* ttlabel =
new TText(geo->TileCenter(
id).X(),geo->TileCenter(
id).Y(),Form(
"%d",tt));
177 ttlabel->SetTextAlign(22);
178 ttlabel->SetTextSize(0.015);
184 TString imageName = outputFileName +
".png";
185 WheelCan->SaveAs(imageName.Data());
virtual void Clear(Option_t *option="")
User defined functions.
short side() const
+1 if tile is on West side; -1 if on East side
int position() const
position of supersector on a wheel [1,12]
int adc() const
ADC value [0,4095].
Stores information for tiles in STAR Event Plane Detector.
int tile() const
tile on the supersector [1,31]