StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fgtCosmicTrackQA.C
1 /***************************************************************************
2  *
3  * $Id: fgtCosmicTrackQA.C,v 1.1 2012/01/31 09:26:17 sgliske Exp $
4  * Author: ckriley, Oct. 19 2011
5  *
6  ***************************************************************************
7  *
8  * Description: Script to make the basic, raw track QA plots for middle
9  * quadrant
10  *
11  ***************************************************************************
12  *
13  * $Log: fgtCosmicTrackQA.C,v $
14  * Revision 1.1 2012/01/31 09:26:17 sgliske
15  * StFgtQaMakers moved to StFgtPool
16  *
17  * Revision 1.12 2011/12/07 17:19:59 ckriley
18  * minor update
19  *
20  * Revision 1.11 2011/11/25 20:20:04 ckriley
21  * added statusmaker functionality
22  *
23  * Revision 1.10 2011/11/17 18:41:57 sgliske
24  * Bug fixes: check on palette ptrs and set A2CMaker to remove pedestals
25  *
26  * Revision 1.9 2011/11/09 21:03:20 ckriley
27  * working version with current containers
28  *
29  * Revision 1.8 2011/10/28 20:17:44 ckriley
30  * conforming with other maker methods of getting event
31  *
32  * Revision 1.7 2011/10/26 20:59:14 ckriley
33  * now correctly subtracts pedestals
34  *
35  * Revision 1.6 2011/10/25 20:43:32 ckriley
36  * added more plots
37  *
38  * Revision 1.5 2011/10/25 14:46:22 ckriley
39  * update for more plots
40  *
41  * Revision 1.4 2011/10/20 17:13:45 ckriley
42  * major update -> headers, tracks stored in StFgtEvent instead of StFgtDisc, changes to trackmaker and algorithms
43  *
44  * Revision 1.3 2011/10/20 16:58:41 ckriley
45  * test
46  *
47  **************************************************************************/
48 
49 // forward declarations
50 class StChain;
51 class StFgtCosmicMaker;
52 class StFgtEvent;
53 class StFgtDbMaker;
54 class StFgtPedPlotter;
55 class StFgtA2CMaker;
62 class StFgtClusterMaker;
63 class StFgtPointMaker;
64 class StFgtCosmicTrackQA;
66 
67 StChain *analysisChain = 0;
68 StFgtCosmicMaker *cosmicMkr = 0;
69 StFgtDbMaker *dbMkr = 0;
70 StFgtA2CMaker *adcCorrector = 0;
71 StFgtSimpleClusterAlgo *simpleClusterAlgo = 0;
72 StFgtMaxClusterAlgo *maxClusterAlgo = 0;
73 StFgtSimplePointAlgo *simplePointAlgo = 0;
74 StFgtSimpleCosmicTrackAlgo *simpleCosmicTrackAlgo =0;
75 StFgt2PointCosmicTrackAlgo *twoPointCosmicTrackAlgo =0;
76 StFgtClusterMaker *clusterMkr = 0;
77 StFgtPointMaker *pointMkr = 0;
78 StFgtCosmicTrackMaker *trackMkr = 0;
79 
80 StFgtPedPlotter *pedPlotter = 0;
81 StFgtCosmicTrackQA *cosmicQA1 = 0;
82 StFgtCosmicTrackQA *cosmicQA2 = 0;
83 StFgtCosmicTrackQA *cosmicQA3 = 0;
84 StFgtCosmicTrackPlots *cosmicHists = 0;
85 StFgtCosmicTrackPlots *cosmicHists = 0;
86 StFgtCosmicTrackPlots *cosmicHists = 0;
87 
88 TCanvas *can1 = 0;
89 TCanvas *can2 = 0;
90 TCanvas *can3 = 0;
91 TCanvas *can4 = 0;
92 TCanvas *can5 = 0;
93 TCanvas *can6 = 0;
94 TCanvas *can7 = 0;
95 TCanvas *can8 = 0;
96 TCanvas *can9 = 0;
97 TCanvas *can10 = 0;
98 TCanvas *can11 = 0;
99 TCanvas *can12 = 0;
100 
101 Int_t fgtCosmicTrackQA( const Char_t *filename = "testfile.sfs",
102  const Char_t *pedfilename = "testfile.Ped.txt",
103  const Char_t *statusfilename = "testfile.Status.txt",
104  Int_t disc1 = 0,
105  Int_t quad1 = 0,
106  Int_t disc2 = 0,
107  Int_t quad2 = 0,
108  Int_t disc3 = 0,
109  Int_t quad3 = 0,
110  const Char_t *runname = "testrun",
111  const Char_t *quadname1 = "010",
112  const Char_t *quadname2 = "011",
113  const Char_t *quadname3 = "013",
114  Int_t nevents = -1,
115  Int_t timeBin = 4,
116  Bool_t cutShortEvents = 1,
117  Bool_t skipCor = 1 ){
118  LoadLibs();
119  cout << "Loaded libraries" << endl;
120  Int_t ierr = 0;
121 
122  // hardcoded options
123  Int_t numDiscs = 3;
124  Float_t sansPedXmax = 500;
125  Float_t sansPedXmin = -200;
126  Int_t sansPedXbins = (sansPedXmax-sansPedXmin)/5;
127 
128  // so that don't have to rebin later
129  //Int_t binFactorXc = 8, binFactorXr = 2, binFactorXp = 4, binFactorY = 32;
130  Int_t numChannelsPerCorBin = 1;
131 
132  // canvas size
133  Int_t canWidth = 850, canHeight = 1100;
134 
135  Short_t timeBinMask = (1<<timeBin);
136 
137  cout << "Constructing the ped plotter" << endl;
138  pedPlotter = new StFgtPedPlotter;
139  pedPlotter->setReadFromFile( pedfilename );
140  pedPlotter->setTimeBinMask( 1<<timeBin );
141  pedPlotter->setPlotVsStrip( 'c' );
142  pedPlotter->setDisc( disc2 );
143  pedPlotter->setQuad( quad2 );
144  pedPlotter->setQuadName( quadname2 );
145  pedPlotter->setPlotStDev( 1 );
146 
147  cout << "making the ped. st. dev. plots" << endl;
148  ierr = pedPlotter->makePlots();
149  cout << "\tdone" << endl;
150 
151  if( ierr ){
152  cerr << "\tError making pedestal st. dev. plot" << endl;
153  return;
154  }
155 
156  const TGraph* gr = pedPlotter->getGraph( timeBin );
157  if( !gr ){
158  cerr << "\tError making pedestal st. dev. plot" << endl;
159  return;
160  }
161 
162  cout << "Constructing the chain" << endl;
163  analysisChain = new StChain("eemcAnalysisChain");
164 
165  cout << "Constructing the cosmic maker" << endl;
166  cosmicMkr = new StFgtCosmicMaker( "cosmicMaker", filename );
167 
168  cout << "Constructing the A2C maker" << endl;
169  adcCorrector = new StFgtA2CMaker( "adcCorrector" );
170  adcCorrector->setPedReaderFile( pedfilename );
171  adcCorrector->setStatusReaderFile( statusfilename );
172  adcCorrector->setTimeBinMask( timeBinMask );
173  adcCorrector->setAbsThres( -10000 ); // set below -4096 to skip cut
174  adcCorrector->setRelThres( 5 ); // set to zero to skip cut
175  adcCorrector->doRemoveOtherTimeBins( 1 );
176 
177  cout << "Constructing the cluster and point maker " << endl;
178  simpleClusterAlgo = new StFgtSimpleClusterAlgo();
179  maxClusterAlgo = new StFgtMaxClusterAlgo();
180  simplePointAlgo = new StFgtSimplePointAlgo();
181  simpleCosmicTrackAlgo = new StFgtSimpleCosmicTrackAlgo();
182  twoPointCosmicTrackAlgo = new StFgt2PointCosmicTrackAlgo();
183 
184  clusterMkr = new StFgtClusterMaker("clusterMkr" );
185  clusterMkr->setClusterAlgo(simpleClusterAlgo);
186 
187  pointMkr = new StFgtPointMaker( "pointMkr" );
188  pointMkr->setPointAlgo(simplePointAlgo);
189 
190  cout << "Constructing cosmic trackmaker" << endl;
191  trackMkr = new StFgtCosmicTrackMaker( "trackMkr" );
192  trackMkr->setCosmicTrackAlgo(simpleCosmicTrackAlgo);
193 
194  cout << "Constructing the QA makers" << endl;
195 
196  // StFgtA2CMaker needs to be made before these QA plots
197  cosmicQA1 = new StFgtCosmicTrackQA( "cosmicQA1", disc1, quad1, quadname1 );
198  cosmicQA1->setTimeBin( timeBin );
199  cosmicQA1->setFilenameBase( "" );
200  cosmicQA1->setXbins( sansPedXbins );
201  cosmicQA1->setXrange( sansPedXmin, sansPedXmax );
202  cosmicQA1->setBinFactors( 1, 1 );
203 
204  cosmicQA2 = new StFgtCosmicTrackQA( "cosmicQA2", disc2, quad2, quadname2 );
205  cosmicQA2->setTimeBin( timeBin );
206  cosmicQA2->setFilenameBase( "" );
207  cosmicQA2->setXbins( sansPedXbins );
208  cosmicQA2->setXrange( sansPedXmin, sansPedXmax );
209  cosmicQA2->setBinFactors( 1, 1 );
210 
211  cosmicQA3 = new StFgtCosmicTrackQA( "cosmicQA3", disc3, quad3, quadname3 );
212  cosmicQA3->setTimeBin( timeBin );
213  cosmicQA3->setFilenameBase( "" );
214  cosmicQA3->setXbins( sansPedXbins );
215  cosmicQA3->setXrange( sansPedXmin, sansPedXmax );
216  cosmicQA3->setBinFactors( 1, 1 );
217 
218  cosmicHistsTop = new StFgtCosmicTrackPlots( "fgtTrackQATop", "trackMkr", disc1, quad1, quadname1 );
219 
220  cosmicHists = new StFgtCosmicTrackPlots( "fgtTrackQA", "trackMkr", disc2, quad2, quadname2 );
221 
222  cosmicHistsBottom = new StFgtCosmicTrackPlots( "fgtTrackQABottom", "trackMkr", disc3, quad3, quadname3 );
223 
224  cout << "Initializing" << endl;
225  ierr = analysisChain->Init();
226  cout << "\t done initializing" << endl;
227 
228  if( ierr ){
229  cout << "Error initializing" << endl;
230  return;
231  };
232 
233  if( nevents < 0 )
234  nevents = 1<<30; // a big number
235 
236  cout << "Looping over events..." << endl;
237  for( int i=0; i<nevents && !ierr; ++i ){
238 
239  if( i%1000 == 1 )
240  cout << "\n\nevent number " << i << endl;
241 
242  //cout << "clear" << endl;
243  analysisChain->Clear();
244 
245  //cout << "make" << endl;
246  ierr = analysisChain->Make();
247 
248  };
249 
250  //
251  // Calls the ::Finish() method on all makers
252  //
253  cout << "finish" << endl;
254  analysisChain->Finish();
255 
256  cout << "Making plots..." << endl;
257 
258  // now do some plotting
259 
260 // cout << "Hist ptrs " << hAdcVsChan << ' ' << hAdcVsR << ' ' << hAdcVsPhi << ' ' << hAdcSansPedVsChan << ' '
261 // << hAdcSansPedVsR << ' ' << hAdcSansPedVsPhi << endl;
262 
263  gROOT->SetStyle("Plain");
264  gStyle->SetOptStat(0);
265  gStyle->SetEndErrorSize(0);
266  gStyle->SetTitleBorderSize(0);
267  gStyle->SetTitleTextColor(kRed);
268  gStyle->SetPalette(1);
269  gStyle->SetOptDate(0);
270 
271  // For the quadrant look -> set quadrantOutline=true
272  bool quadrantOutline = true;
273  TArc *innerArc=0;
274  TArc *outerArc=0;
275  TLine *left=0;
276  TLine *right=0;
277  TLine *center=0;
278  TLine *weird=0;
279  if(quadrantOutline) {
280  innerArc = new TArc(0,0,10.35+1.15,0.0,90.0);
281  outerArc = new TArc(0,0,39.40-1.15,0.0,90.0);
282  left = new TLine( 1.15, 10.35+1.15, 1.15, 39.40-1.15 );
283  right = new TLine( 10.35+1.15, 1.15, 39.40-1.15, 1.15 );
284  center = new TLine(
285  (10.35+1.15)*cos( 0.785398163 ),
286  (10.35+1.15)*sin( 0.785398163 ),
287  (39.40-1.15)*cos( 0.785398163 ),
288  (39.40-1.15)*sin( 0.785398163 )
289  );
290  weird = new TLine(
291  (39.40-1.15)*cos( 0.190240888 ),
292  (39.40-1.15)*sin( 0.190240888 ),
293  (39.40-1.15)*cos( 0.891863248 ),
294  (39.40-1.15)*sin( 0.891863248 )
295  );
296  innerArc->SetFillStyle(0);
297  outerArc->SetFillStyle(0);
298  innerArc->SetLineWidth(2);
299  outerArc->SetLineWidth(2);
300  left->SetLineWidth(2);
301  right->SetLineWidth(2);
302  center->SetLineWidth(2);
303  weird->SetLineWidth(2);
304  }
305 
306  //Float_t maxY = pedPlotter->getMaxY()*1.05;
307  //TH2F *histC = new TH2F ("histC", "", 1, 0, 1280, 1, 0, 200 );
308 
309  gROOT->SetStyle("Plain");
310  TCanvas *can1 = new TCanvas( "fgtQAcan1", "fgtQAcan1", canHeight, canHeight );
311 
312  can1->Divide(5,6);
313  gPad->SetGridx(0);
314  int can1pad = 1;
315  for(int i=0;i<10;i++) {
316  TH1F* hAPV1 = cosmicQA1->getHistAPV(i);
317  TH1F* hAPV2 = cosmicQA2->getHistAPV(i);
318  TH1F* hAPV3 = cosmicQA3->getHistAPV(i);
319  can1->cd(can1pad);
320  gStyle->SetOptStat(100110); // for plotting overflows
321  hAPV1->Draw();
322  can1->cd(can1pad+10);
323  gStyle->SetOptStat(100110);
324  hAPV2->Draw();
325  can1->cd(can1pad+20);
326  gStyle->SetOptStat(100110);
327  hAPV3->Draw();
328  can1pad++;
329  }
330  gPad->Update();
331 
332  TCanvas *can2 = new TCanvas( "fgtQAcan2", "fgtQAcan2", 1300, canWidth );
333  TH1F* clusterDist1R = cosmicQA1->getHist1Dcluster(0);
334  TH1F* clusterDist2R = cosmicQA2->getHist1Dcluster(0);
335  TH1F* clusterDist3R = cosmicQA3->getHist1Dcluster(0);
336  TH1F* clusterDist1P = cosmicQA1->getHist1Dcluster(1);
337  TH1F* clusterDist2P = cosmicQA2->getHist1Dcluster(1);
338  TH1F* clusterDist3P = cosmicQA3->getHist1Dcluster(1);
339 
340  gPad->SetGridx(0);
341  can2->Divide(3,2);
342 
343  can2->cd(1);
344  gStyle->SetOptStat(100110); // for plotting overflows
345  clusterDist1R->Draw();
346 
347  can2->cd(2);
348  gStyle->SetOptStat(100110);
349  clusterDist2R->Draw();
350 
351  can2->cd(3);
352  gStyle->SetOptStat(100110);
353  clusterDist3R->Draw();
354 
355  can2->cd(4);
356  gStyle->SetOptStat(100110);
357  clusterDist1P->Draw();
358 
359  can2->cd(5);
360  gStyle->SetOptStat(100110);
361  clusterDist2P->Draw();
362 
363  can2->cd(6);
364  gStyle->SetOptStat(100110);
365  clusterDist3P->Draw();
366  gPad->Update();
367 
368 /*
369  // look for hot strips
370  TH1F* testHist1R = cosmicQA1->getTestHist(0);
371  TH1F* testHist2R = cosmicQA2->getTestHist(0);
372  TH1F* testHist3R = cosmicQA3->getTestHist(0);
373  TH1F* testHist1P = cosmicQA1->getTestHist(1);
374  TH1F* testHist2P = cosmicQA2->getTestHist(1);
375  TH1F* testHist3P = cosmicQA3->getTestHist(1);
376 
377  gPad->SetGridx(0);
378  can2->Divide(3,2);
379 
380  can2->cd(1);
381  gStyle->SetOptStat(100000); // for plotting overflows
382  testHist1R->Draw();
383 
384  can2->cd(2);
385  gStyle->SetOptStat(100000);
386  testHist2R->Draw();
387 
388  can2->cd(3);
389  gStyle->SetOptStat(100000);
390  testHist3R->Draw();
391 
392  can2->cd(4);
393  gStyle->SetOptStat(100000);
394  testHist1P->Draw();
395 
396  can2->cd(5);
397  gStyle->SetOptStat(100000);
398  testHist2P->Draw();
399 
400  can2->cd(6);
401  gStyle->SetOptStat(100000);
402  testHist3P->Draw();
403  gPad->Update();
404 */
405 
406 
407  TCanvas *can3 = new TCanvas( "fgtQAcan3", "fgtQAcan3", 1300, canWidth );
408  TH1F* clusterDist1 = cosmicQA1->getHist1Dclusters();
409  TH1F* clusterDist2 = cosmicQA2->getHist1Dclusters();
410  TH1F* clusterDist3 = cosmicQA3->getHist1Dclusters();
411 
412  gPad->SetGridx(0);
413  can3->Divide(3,1);
414 
415  can3->cd(1);
416  gStyle->SetOptStat(100110);
417  clusterDist1->Draw();
418 
419  can3->cd(2);
420  gStyle->SetOptStat(100110);
421  clusterDist2->Draw();
422 
423  can3->cd(3);
424  gStyle->SetOptStat(100110);
425  clusterDist3->Draw();
426  gPad->Update();
427 
428  TCanvas *can4 = new TCanvas( "fgtQAcan4", "fgtQAcan4", canWidth, 1500 );
429  TH2F* pointDist1 = cosmicQA1->getHist2Dpoint();
430  TH2F* pointDist2 = cosmicQA2->getHist2Dpoint();
431  TH2F* pointDist3 = cosmicQA3->getHist2Dpoint();
432 
433  gStyle->SetOptStat(0);
434  gPad->SetGridx(0);
435  gPad->SetGridy(0);
436  can4->Divide(1,3);
437 
438  can4->cd(1);
439  pointDist1->Draw("colz");
440  if(quadrantOutline) {
441  outerArc->Draw("only");
442  innerArc->Draw("only");
443  left->Draw();
444  right->Draw();
445  center->Draw();
446  weird->Draw();
447  }
448  gPad->Update();
449  TPaletteAxis *palette = (TPaletteAxis*)pointDist1->GetListOfFunctions()->FindObject("palette");
450  if( palette )
451  palette->SetLabelSize(0.035);
452 
453  can4->cd(2);
454  pointDist2->Draw("colz");
455  if(quadrantOutline) {
456  outerArc->Draw("only");
457  innerArc->Draw("only");
458  left->Draw();
459  right->Draw();
460  center->Draw();
461  weird->Draw();
462  }
463  gPad->Update();
464  TPaletteAxis *palette = (TPaletteAxis*)pointDist2->GetListOfFunctions()->FindObject("palette");
465  if( palette )
466  palette->SetLabelSize(0.035);
467 
468  can4->cd(3);
469  pointDist3->Draw("colz");
470  if(quadrantOutline) {
471  outerArc->Draw("only");
472  innerArc->Draw("only");
473  left->Draw();
474  right->Draw();
475  center->Draw();
476  weird->Draw();
477  }
478  gPad->Update();
479  TPaletteAxis *palette = (TPaletteAxis*)pointDist3->GetListOfFunctions()->FindObject("palette");
480  if( palette )
481  palette->SetLabelSize(0.035);
482 
483 
484  TCanvas *can5 = new TCanvas( "fgtTrackQAcan5", "fgtTrackQAcan5", canWidth, canHeight );
485  TH2F* trackDist = cosmicHists->getHistTracks();
486 
487  gPad->SetGridx(0);
488  gPad->SetGridy(0);
489 
490  trackDist->Draw("colz");
491  if(quadrantOutline) {
492  outerArc->Draw("only");
493  innerArc->Draw("only");
494  left->Draw();
495  right->Draw();
496  center->Draw();
497  weird->Draw();
498  }
499  gPad->Update();
500  TPaletteAxis *palette = (TPaletteAxis*)trackDist->GetListOfFunctions()->FindObject("palette");
501  if( palette ){
502  palette->SetLabelSize(0.035);
503  palette->SetX1NDC(0.87);
504  palette->SetX2NDC(0.92);
505  };
506 
507  TCanvas *can6 = new TCanvas( "fgtTrackQAcan6", "fgtTrackQAcan6", canWidth, canHeight );
508  TProfile2D* chi2Dist = cosmicHists->getProfileChi2();
509 
510  gPad->SetGridx(0);
511  gPad->SetGridy(0);
512 
513  chi2Dist->Draw("colz");
514  if(quadrantOutline) {
515  outerArc->Draw("only");
516  innerArc->Draw("only");
517  left->Draw();
518  right->Draw();
519  center->Draw();
520  weird->Draw();
521  }
522  gPad->Update();
523  TPaletteAxis *palette = (TPaletteAxis*)chi2Dist->GetListOfFunctions()->FindObject("palette");
524  if( palette ){
525  palette->SetLabelSize(0.035);
526  palette->SetX1NDC(0.87);
527  palette->SetX2NDC(0.92);
528  };
529 
530  TCanvas *can7 = new TCanvas( "fgtTrackQAcan7", "fgtTrackQAcan7", canWidth, canHeight );
531  TProfile2D* efficiencyDist = cosmicHists->getProfileEfficiency();
532 
533  gPad->SetGridx(0);
534  gPad->SetGridy(0);
535 
536  efficiencyDist->Draw("colz");
537  if(quadrantOutline) {
538  outerArc->Draw("only");
539  innerArc->Draw("only");
540  left->Draw();
541  right->Draw();
542  center->Draw();
543  weird->Draw();
544  }
545  gPad->Update();
546  TPaletteAxis *palette = (TPaletteAxis*)efficiencyDist->GetListOfFunctions()->FindObject("palette");
547  if( palette ){
548  palette->SetLabelSize(0.035);
549  palette->SetX1NDC(0.87);
550  palette->SetX2NDC(0.92);
551  }
552 
553  TCanvas *can8 = new TCanvas( "fgtQAcan8", "fgtQAcan8", 1300, canWidth );
554  TH1F* clusterDistTrack1R = cosmicHistsTop->getHist1Dcluster(0);
555  TH1F* clusterDistTrack1P = cosmicHistsTop->getHist1Dcluster(1);
556  TH1F* clusterDistTrack2R = cosmicHists->getHist1Dcluster(0);
557  TH1F* clusterDistTrack2P = cosmicHists->getHist1Dcluster(1);
558  TH1F* clusterDistTrack3R = cosmicHistsBottom->getHist1Dcluster(0);
559  TH1F* clusterDistTrack3P = cosmicHistsBottom->getHist1Dcluster(1);
560 
561  gPad->SetGridx(0);
562  can8->Divide(3,2);
563 
564  can8->cd(1);
565  gStyle->SetOptStat(100110);
566  clusterDistTrack1R->Draw();
567 
568  can8->cd(2);
569  gStyle->SetOptStat(100110);
570  clusterDistTrack2R->Draw();
571 
572  can8->cd(3);
573  gStyle->SetOptStat(100110);
574  clusterDistTrack3R->Draw();
575 
576  can8->cd(4);
577  gStyle->SetOptStat(100110);
578  clusterDistTrack1P->Draw();
579 
580  can8->cd(5);
581  gStyle->SetOptStat(100110);
582  clusterDistTrack2P->Draw();
583 
584  can8->cd(6);
585  gStyle->SetOptStat(100110);
586  clusterDistTrack3P->Draw();
587  gPad->Update();
588 
589 
590  TCanvas *can9 = new TCanvas( "fgtQAcan9", "fgtQAcan9", 1300, canWidth );
591  TH1F* clusterDistTrack1 = cosmicHistsTop->getHist1Dclusters();
592  TH1F* clusterDistTrack2 = cosmicHists->getHist1Dclusters();
593  TH1F* clusterDistTrack3 = cosmicHistsBottom->getHist1Dclusters();
594 
595  gPad->SetGridx(0);
596  can9->Divide(3,1);
597 
598  can9->cd(1);
599  gStyle->SetOptStat(100110);
600  clusterDistTrack1->Draw();
601 
602  can9->cd(2);
603  gStyle->SetOptStat(100110);
604  clusterDistTrack2->Draw();
605 
606  can9->cd(3);
607  gStyle->SetOptStat(100110);
608  clusterDistTrack3->Draw();
609  gPad->Update();
610 
611 
612  TCanvas *can10 = new TCanvas( "fgtTrackQAcan10", "fgtTrackQAcan10", canWidth, canHeight );
613  TH2F* realTrackPointDist = cosmicHists->getHist2Dcluster();
614 
615  gPad->SetGridx(0);
616  gPad->SetGridy(0);
617  gStyle->SetOptStat(0);
618 
619  realTrackPointDist->Draw("colz");
620  if(quadrantOutline) {
621  outerArc->Draw("only");
622  innerArc->Draw("only");
623  left->Draw();
624  right->Draw();
625  center->Draw();
626  weird->Draw();
627  }
628 
629 
630  TCanvas *can11 = new TCanvas( "fgtTrackQAcan11", "fgtTrackQAcan11", canWidth, canHeight );
631  TH2F* realtrackDist = cosmicHists->getHistRealTracks();
632 
633  gPad->SetGridx(0);
634  gPad->SetGridy(0);
635 
636  realtrackDist->Draw("colz");
637  if(quadrantOutline) {
638  outerArc->Draw("only");
639  innerArc->Draw("only");
640  left->Draw();
641  right->Draw();
642  center->Draw();
643  weird->Draw();
644  }
645  gPad->Update();
646  TPaletteAxis *palette = (TPaletteAxis*)realtrackDist->GetListOfFunctions()->FindObject("palette");
647  if( palette ){
648  palette->SetLabelSize(0.035);
649  palette->SetX1NDC(0.87);
650  palette->SetX2NDC(0.92);
651  };
652 
653 
654  TCanvas *can12 = new TCanvas( "fgtTrackQAcan12", "fgtTrackQAcan12", canWidth, canHeight );
655  //TProfile* dXvX = cosmicHists->getProfileX();
656  //dXvX->Draw();
657  TCanvas *can13 = new TCanvas( "fgtTrackQAcan13", "fgtTrackQAcan13", canWidth, canHeight );
658  //TProfile* dYvY = cosmicHists->getProfileY();
659  //dYvY->Draw();
660 
661 
662  can12->Divide(4,4);
663  can13->Divide(4,4);
664  int canpad=1;
665  for(int i=3;i>=0;i--) {
666  for(int j=0;j<4;j++) {
667  can12->cd(canpad);
668  TH1F* hdX = cosmicHists->getHistX(i,j);
669  hdX->Draw();
670  can13->cd(canpad);
671  TH1F* hdY = cosmicHists->getHistY(i,j);
672  hdY->Draw();
673  canpad++;
674  }
675  }
676 
677  cout << "ready to save plots" << endl;
678 
679  std::string fileOut1 = "fgtCosmicTrackQA.page-1.";
680  std::string fileOut2 = "fgtCosmicTrackQA.page-2.";
681  std::string fileOut3 = "fgtCosmicTrackQA.page-3.";
682  std::string fileOut4 = "fgtCosmicTrackQA.page-4.";
683  std::string fileOut5 = "fgtCosmicTrackQA.page-5.";
684  std::string fileOut6 = "fgtCosmicTrackQA.page-6.";
685  std::string fileOut7 = "fgtCosmicTrackQA.page-7.";
686  std::string fileOut8 = "fgtCosmicTrackQA.page-8.";
687  std::string fileOut9 = "fgtCosmicTrackQA.page-9.";
688  std::string fileOut10 = "fgtCosmicTrackQA.page-10.";
689  std::string fileOut11 = "fgtCosmicTrackQA.page-11.";
690  std::string fileOut12 = "fgtCosmicTrackQA.page-12.";
691  std::string fileOut13 = "fgtCosmicTrackQA.page-13.";
692 
693  std::string tail = runname;
694  tail += ".fgt";
695  tail += quadname2;
696  tail += ".pdf";
697 
698  //cout << "\trunname is " << runname << endl;
699  cout << "\tsaving to '" << tail << "'" << endl;
700  can1->Print( (fileOut1+tail).data() );
701  can2->Print( (fileOut2+tail).data() );
702  can3->Print( (fileOut3+tail).data() );
703  can4->Print( (fileOut4+tail).data() );
704  can5->Print( (fileOut5+tail).data() );
705  can6->Print( (fileOut6+tail).data() );
706  can7->Print( (fileOut7+tail).data() );
707  can8->Print( (fileOut8+tail).data() );
708  can9->Print( (fileOut9+tail).data() );
709  can10->Print((fileOut10+tail).data());
710  can11->Print((fileOut11+tail).data());
711  can12->Print((fileOut12+tail).data());
712  can13->Print((fileOut13+tail).data());
713 
714  cout << "all done" << endl;
715  return;
716 };
717 
718 
719 // load the shared libraries
720 void LoadLibs() {
721  // common shared libraries
722 
723  gSystem->Load("libPhysics");
724  gSystem->Load("St_base");
725  gSystem->Load("StChain");
726  gSystem->Load("StUtilities");
727  gSystem->Load("StFgtUtil");
728  gSystem->Load("StFgtRawMaker");
729  gSystem->Load("StEvent");
730  cout << "loaded StEvent library" << endl;
731 
732  gSystem->Load("RTS");
733  gSystem->Load("StFgtDbMaker");
734  gSystem->Load("StFgtPedMaker");
735  gSystem->Load("StFgtStatusMaker");
736  gSystem->Load("StFgtCosmicTrackMaker");
737  gSystem->Load("StFgtQaMakers");
738  gSystem->Load("StFgtPedPlotter");
739  gSystem->Load("StFgtClusterMaker");
740  gSystem->Load("StFgtPointMaker");
741  gSystem->Load("StFgtA2CMaker");
742 };
void setRelThres(Float_t thres)
set to below -kFgtMaxAdc (-4096) to skip cut
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
virtual Int_t Finish()
Definition: StChain.cxx:85
Int_t setClusterAlgo(StFgtIClusterAlgo *)
clear function is empty at the moment
virtual Int_t Make()
Definition: StChain.cxx:110