StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
normalizemass.C
1 //This macro normalizes the spin-dependent pi0 yield according to relative luminosity after we have generated EEMC pi0 trees according to pi0 finder software. We read these pi0 trees, initialize the luminosity for each fill and each run accordingly, and save the information we want into an output root file for further usage.
2 //Make sure you understand the spin states in this macro according to the definition of STAR database because we have two beams here: Yellow and Blue. They are defined in different sequences by the luminosity file, but here we make them consistent with the STAR database.
3 //Author: Weihong He.
4 
5 
6 class StChain;
8 class StEEmcIUMixEvent;
9 
10 StEEmcIUMixEvent *realEvent = 0;
11 
12 Long64_t nevents = 0;
13 
14 TString fillPath;
15 TFile *outfile = 0;
16 
17 TH1F *hMassFill = 0;
18 TH1F *hZggFill = 0;
19 TH1F *hPhiFill = 0;
20 
21 TH1F *hMassUU = 0; /* inv. mass in (B=+Y=+) spin state */
22 TH1F *hMassUD = 0; /* inv. mass in (B=+Y=-) spin state */
23 TH1F *hMassDU = 0; /* inv. mass in (B=-Y=+) spin state */
24 TH1F *hMassDD = 0; /* inv. mass in (B=-Y=-) spin state */
25 
26 TH1F *hMassLU = 0, *hMassUL = 0;
27 TH1F *hMassLD = 0, *hMassUR = 0;
28 TH1F *hMassRU = 0, *hMassDL = 0;
29 TH1F *hMassRD = 0, *hMassDR = 0;
30 
31 TH1F *hMassTU = 0, *hMassUT = 0;
32 TH1F *hMassTD = 0, *hMassUB = 0;
33 TH1F *hMassBU = 0, *hMassDT = 0;
34 TH1F *hMassBD = 0, *hMassDB = 0;
35 
36 TH2F *hMassTimeUU = 0;
37 TH2F *hMassTimeUD = 0;
38 TH2F *hMassTimeDU = 0;
39 TH2F *hMassTimeDD = 0;
40 
41 TH2F *hMassPtUU = 0;
42 TH2F *hMassPtUD = 0;
43 TH2F *hMassPtDU = 0;
44 TH2F *hMassPtDD = 0;
45 
46 //uble_t pt_bins[] = { 0., 4.5, 6.5, 8.5, 12.5, 16.5, 20.5 };
47 Double_t pt_bins[] = { 0., 4.5, 5.5, 6.5, 7.5, 9.5, 11.5, 21.5 };
48 
49 TH1F *hDsmvtx = 0;
50 TH1F *hTimebin = 0;
51 
52 TH1F *hBXstar = 0;
53 
54 Int_t fill_number = 0;
55 Int_t run_number = 0;
56 
57 
58 const Int_t NMAX_FILLS = 200;
59 const Char_t *fill_pattern_file = "fillPatternBxRun6_070412.txt";
60 Int_t fill_numbers[NMAX_FILLS];
61 Int_t fill_pattern[NMAX_FILLS][120];
62 Int_t current_fill_pattern[120];
63 Int_t current_fill;
64 
65 const Int_t NMAX_RUNS = 22000;
66 const Char_t *bbc_lumin_file = "relLumi06_070614.txt";
67 Int_t run_numbers[NMAX_RUNS];
68 Int_t bbc_lumin[NMAX_RUNS][16][4];
69 Int_t current_bbc_lumin[16][4];
70 Int_t current_run;
71 Int_t bbc_valid = 0;
72 
73 
74 
75 
76 // bad idea #define CORRECT_PT
77 
78 
79 // ----------------------------------------------------------------------------
80 // ----------------------------------------------------------------------------
81 void normalizemass(Int_t nevents=-1,
82  const Char_t *mydir="/star/institutions/iucf/hew/7863/", const Char_t *ofile="ttree.root")
83 {
84 
85 
86 
87  //Char_t *mydirs[] =
88  //{
89  //#if 1
90  // "/star/institutions/iucf/hew/Histout/7918/",
91  //#endif
92 
93  //};
94 
95  sortFills( nevents, mydir, 1,ofile );
96 
97 }
98 
99 void sortFills( Int_t nevents,
100  Char_t *mydir,
101  Int_t nfills,
102  const Char_t *ofile )
103 {
104 
105 #if 0
106  // current_fill = 7863;
107  TString adir=mydir;
108  TString bdir=adir( adir.Last('/')-4, adir.Last('/')-1 );
109  current_fill = bdir.Atoi();
110  std::cout << Form("---- current fill = %i ", current_fill) << std::endl;
111 #endif
112 
113 
114  gStyle->SetHistMinimumZero();
115  gStyle->SetPalette(1);
116  // gROOT->LoadMacro("macros/fitter.C");
117  //gROOT->LoadMacro("fitter2.C");
118 
119  initFillPattern();
120  initBbcLumin();
121 
122 
123  outfile=new TFile(ofile,"recreate");
124  outfile->cd();
125  hMassFill = new TH1F(Form("hMass%s","Fill"),Form("Inv. mass run=%s","Fill"),120,0.,1.2);
126  hZggFill = new TH1F(Form("hZgg%s","Fill"), Form("z_{#gamma #gamma} run=%s","Fill"),50,0.,1.);
127  hPhiFill = new TH1F(Form("hPhi%s","Fill"), Form("#phi-bin run=%s","Fill"),60,0.,60.);
128 
129  hMassUU = new TH1F("hMassUU","Inv. mass spin=(B=+Y=+);M_{#gamma #gamma} [GeV]",120,0.,1.2);
130  hMassUD = new TH1F("hMassUD","Inv. mass spin=(B=+Y=-);M_{#gamma #gamma} [GeV]",120,0.,1.2);
131  hMassDU = new TH1F("hMassDU","Inv. mass spin=(B=-Y=+);M_{#gamma #gamma} [GeV]",120,0.,1.2);
132  hMassDD = new TH1F("hMassDD","Inv. mass spin=(B=-Y=-);M_{#gamma #gamma} [GeV]",120,0.,1.2);
133 
134  hMassUL = new TH1F("hMassUL","Inv. mass L spin=B+;M_{#gamma #gamma} [GeV]",120,0.,1.2);
135  hMassUR = new TH1F("hMassUR","Inv. mass R spin=B+;M_{#gamma #gamma} [GeV]",120,0.,1.2);
136  hMassDL = new TH1F("hMassDL","Inv. mass L spin=B-;M_{#gamma #gamma} [GeV]",120,0.,1.2);
137  hMassDR = new TH1F("hMassDR","Inv. mass R spin=B-;M_{#gamma #gamma} [GeV]",120,0.,1.2);
138 
139  hMassLU = new TH1F("hMassLU","Inv. mass L spin=Y+;M_{#gamma #gamma} [GeV]",120,0.,1.2);
140  hMassRU = new TH1F("hMassRU","Inv. mass R spin=Y+;M_{#gamma #gamma} [GeV]",120,0.,1.2);
141  hMassLD = new TH1F("hMassLD","Inv. mass L spin=Y-;M_{#gamma #gamma} [GeV]",120,0.,1.2);
142  hMassRD = new TH1F("hMassRD","Inv. mass R spin=Y-;M_{#gamma #gamma} [GeV]",120,0.,1.2);
143 
144  //
145 
146  hMassUT = new TH1F("hMassUT","Inv. mass T spin=B+;M_{#gamma #gamma} [GeV]",120,0.,1.2);
147  hMassUB = new TH1F("hMassUB","Inv. mass B spin=B+;M_{#gamma #gamma} [GeV]",120,0.,1.2);
148  hMassDT = new TH1F("hMassDT","Inv. mass T spin=B-;M_{#gamma #gamma} [GeV]",120,0.,1.2);
149  hMassDB = new TH1F("hMassDB","Inv. mass B spin=B-;M_{#gamma #gamma} [GeV]",120,0.,1.2);
150 
151  hMassTU = new TH1F("hMassTU","Inv. mass T spin=Y+;M_{#gamma #gamma} [GeV]",120,0.,1.2);
152  hMassBU = new TH1F("hMassBU","Inv. mass B spin=Y+;M_{#gamma #gamma} [GeV]",120,0.,1.2);
153  hMassTD = new TH1F("hMassTD","Inv. mass T spin=Y-;M_{#gamma #gamma} [GeV]",120,0.,1.2);
154  hMassBD = new TH1F("hMassBD","Inv. mass B spin=Y-;M_{#gamma #gamma} [GeV]",120,0.,1.2);
155 
156  //
157 
158  hMassTimeUU = new TH2F("hMassTimeUU","Inv. mass spin=(B=+Y=+);M_{#gamma #gamma} [GeV]",120,0.,1.2,16,0.,16.);
159  hMassTimeUD = new TH2F("hMassTimeUD","Inv. mass spin=(B=+Y=-);M_{#gamma #gamma} [GeV]",120,0.,1.2,16,0.,16.);
160  hMassTimeDU = new TH2F("hMassTimeDU","Inv. mass spin=(B=-Y=+);M_{#gamma #gamma} [GeV]",120,0.,1.2,16,0.,16.);
161  hMassTimeDD = new TH2F("hMassTimeDD","Inv. mass spin=(B=-Y==);M_{#gamma #gamma} [GeV]",120,0.,1.2,16,0.,16.);
162 
163  //
164 
165  hMassPtUU = new TH2F("hMassPtUU","Inv. mass spin=(B=+Y=+);M_{#gamma #gamma} [GeV];pT Gev/c",120,0.,1.2,50,0.0,25.0);
166  hMassPtUD = new TH2F("hMassPtUD","Inv. mass spin=(B=+Y=-);M_{#gamma #gamma} [GeV];pT Gev/c",120,0.,1.2,50,0.0,25.0);
167  hMassPtDU = new TH2F("hMassPtDU","Inv. mass spin=(B=-Y=+);M_{#gamma #gamma} [GeV];pT Gev/c",120,0.,1.2,50,0.0,25.0);
168  hMassPtDD = new TH2F("hMassPtDD","Inv. mass spin=(B=-Y=-);M_{#gamma #gamma} [GeV];pT Gev/c",120,0.,1.2,50,0.0,25.0);
169 
170 
171  TH1 *hh[] = { hMassUU, hMassUD, hMassDU, hMassDD,
172  hMassUL, hMassUR, hMassDL, hMassDR,
173  hMassLU, hMassRU, hMassLD, hMassRD,
174  hMassUT, hMassUB, hMassDT, hMassDB,
175  hMassTU, hMassBU, hMassTD, hMassBD,
176  hMassTimeUU, hMassTimeUD, hMassTimeDU, hMassTimeDD,
177  hMassPtUU, hMassPtUD, hMassPtDU, hMassPtDD
178  };
179  //for ( Int_t ii=0;ii<sizeof(hh)/sizeof(TH1*);ii++ ) hh[ii]->Sumw2();
180 
181 
182  hBXstar = new TH1F("hBXstar","Beam x-ing number @ STAR IP",120,0.,120.);
183 #if 0
184  for ( Int_t i=0;i<120;i++ )
185  {
186  if ( !current_fill_pattern[i] ) continue;
187  TMarker *mark=new TMarker(0.5+(float)i,0.,20);
188  mark->SetMarkerColor(4);
189  hBXstar->GetListOfFunctions()->Add(mark);
190  }
191 #endif
192 
193  hDsmvtx = new TH1F("hDsmvtx","DSM vertex",512,0.,512.);
194  hTimebin = new TH1F("hTimebin","BBC time bin",17,-1.,16.);
195 
196  LoadLibs();
197 
198 
199  /*
200  ********************************************************************
201  ********************************************************************
202  **
203  ** Loop over all fills
204  **
205  ********************************************************************
206  ********************************************************************
207  */
208 
209 
210  for ( UInt_t jj=0;jj<nfills;jj++ )
211  {
212  //const Char_t *mydir = mydirs[jj];
213 
214 
215  TString adir=mydir;
216  TString bdir=adir( adir.Last('/')-4, adir.Last('/')-1 );
217  current_fill = bdir.Atoi();
218 
219  getFillPattern(current_fill);
220  fillPath=mydir;
221  fill_number = current_fill;
222 
223 
224  /*
225  **************************************************
226  **************************************************
227  **
228  ** Loop over all runs in the fill
229  **
230  **************************************************
231  **************************************************
232  */
233 
234  Int_t nruns = 0;
235  TSystemDirectory *dir = new TSystemDirectory("fills",fillPath);
236  TIter next( dir->GetListOfFiles() );
237  TObject *file = 0;
238  while ( file = (TObject*)next() )
239  {
240  TString name=file->GetName();
241  if ( name.Contains(".") ) {
242  continue;
243  }
244  std::cout << "-------- Processing run="<<name<<" ---------------------"<<std::endl;
245  readRun( name );
246  nruns++;
247  }// loop over runs
248 
249  }// for loop over fills
250 
251 
252  /*
253  ********************************************************************
254  ********************************************************************
255  **
256  ** Loop over all fills
257  **
258  ********************************************************************
259  ********************************************************************
260  */
261 
262 
263  outfile->Write();
264 
265 
266 
267 
268 
269 }//end of sortfill
270 
271 
274 
275 
276 
277 
278 
279 
280 
281 
282 // ----------------------------------------------------------------------------
283 // ----------------------------------------------------------------------------
284 void readFill( const Char_t *name )
285 {
286 
287 
288 
289 }
290 
291 
292 
293 
294 // ----------------------------------------------------------------------------
295 // ----------------------------------------------------------------------------
296 void readRun( const Char_t *name )
297 {
298 
299  TString run=name;
300  Int_t runid = atoi(name);
301  run_number = runid;
302 
303  std::cout << std::endl << std::endl;
304  std::cout << "================================= new run =================================" << std::endl;
305  std::cout << std::endl;
306  std::cout << "Fill number: " << current_fill << std::endl;
307  std::cout << "Run number: " << runid << std::endl;
308 
309  getBbcLumin(runid);
310 
311  if ( !bbc_valid )
312  {
313  std::cout << "*** run is not contained in the rel. luminosity file, abort *** " << std::endl;
314  return;
315  }
316 
317  std::cout << Form("+++ run %i has relative luminosities",runid) << std::endl;
318 
319 #if 0
320  outfile->cd();
321  TH1F *hMass = new TH1F(Form("hMass%s",name),Form("Inv. mass run=%s",name),120,0.,1.2);
322  TH1F *hZgg = new TH1F(Form("hZgg%s",name), Form("z_{#gamma #gamma} run=%s",name),50,0.,1.);
323  TH1F *hPhi = new TH1F(Form("hPhi%s",name), Form("#phi-bin run=%s",name),60,0.,60.);
324 #endif
325 
326  StChain chain("chain");
327  StEEmcIUPi0Reader reader("mRealTree");
328  chainFiles(fillPath+name,&reader);
329  nevents = reader.getNumberOfEvents();
330  chain.ls(3);
331  chain.Init();
332  Int_t stat = 0;
333  Int_t event = 0;
334  while ( !stat )
335  {
336  if ( event>=nevents ) break;
337  chain.Clear();
338  stat = chain.Make();
339  realEvent = reader.event();
340  Int_t nPairs = reader.event() -> nPairs;
341  Int_t bxStar=realEvent->bxStar;
342  hBXstar->Fill(bxStar);
343 
344 
345  if ( bxStar < 0 || bxStar > 119 ) {
346 
347  std::cout << Form("************* Warning bxStar = %i fill = %i run = %i ****************",
348  bxStar,fill_number,run_number)
349  << std::endl;
350  continue;
351 
352  }
353 
354 
355  // reject event if not valid bunch crossing
356  if ( !current_fill_pattern[bxStar] ) continue;
357 
358  Int_t dsmvtx = realEvent->mBbcTrigger.onlineTimeDifference();
359  hDsmvtx->Fill(dsmvtx);
360 
361  Int_t timebin = onlineBin(dsmvtx);
362  hTimebin->Fill(onlineBin(dsmvtx));
363 
364  // -------------------------------------------------------------------------------- select these --
365  if ( timebin <= 0 ) continue;
366  if ( timebin > 14 ) continue;
367 
368  for ( Int_t i=0;i<nPairs;i++ )
369  {
370 
371  Float_t mass = reader.event()->mMass[i];
372  Float_t pt = reader.event()->mPT[i];
373  //#ifdef CORRECT_PT
374  //if ( mass > 0. )
375  //pt = ( 0.135 / mass ) * pt;
376  //#endif
377 
378 
379  Float_t zgg = reader.event()->mZgg[i];
380  Float_t diff = realEvent->mEsmdu[i] - realEvent->mEsmdv[i];
381  Float_t sum = realEvent->mEsmdu[i] + realEvent->mEsmdv[i];
382  Float_t zuv = TMath::Abs(diff)/sum;
383  Float_t eta = reader.event()->mEEmcEta[i];
384  //if ( eta > 1.5 ) continue;
385 
386  Int_t phibin = reader.event()->mTower1[i] / 12;
387  Int_t sector = phibin / 5;
388  Int_t subsec = phibin % 5;
389  Int_t etabin = reader.event()->mTower1[i] % 12;
390 
391  Bool_t left = sector < 5;
392  Bool_t right = sector > 5;
393  Bool_t top = sector < 2 || sector > 8; // 9 10 11 0 1
394  Bool_t bottom = sector > 2 && sector < 8; // 3 4 5 6 7
395 
396  Int_t spin4 = realEvent->mSpin4;
397 
398 #if 0
399  std::cout << "[" << event << "/" << nevents << "]"
400  << " npair=" << realEvent->nPairs
401  << " mass=" << realEvent->mMass[i]
402  << " pt=" << pt << " org=" << realEvent->mPT[i]
403  << " bx=" << realEvent->bxStar
404  << " zgg=" << realEvent->mZgg[i]
405  << " spin4=" << realEvent->mSpin4
406  << " dsmvtx=" << realEvent->mBbcTrigger.onlineTimeDifference()
407  << " sum smd=" << sum
408  << " diff smd=" << diff
409  << std::endl;
410 #endif
411 
412  //if ( pt < 4.5 ) continue;
413 
414  //Int_t ntracks = reader.event()->mNumberOfTracks[i];
415  //Int_t npoints = reader.event()->mNumberOfPoints[i];
416 
417  //$$$if ( ntracks ) continue;
418 
419 
420  //cout<<"timebin="<<timebin<<endl;
421  Float_t Nuu = current_bbc_lumin[timebin][0];
422  Float_t Ndu = current_bbc_lumin[timebin][1]; // Note that "du" and "ud" in the rel. lum files refers to YB
423  Float_t Nud = current_bbc_lumin[timebin][2];
424  Float_t Ndd = current_bbc_lumin[timebin][3];
425  //cout<<"uu="<<Nuu<<" du="<<Ndu<<" ud="<<Nud<<" dd="<<Ndd<<endl;
426  if ( spin4==5 ) {
427  hMassUU->Fill(mass, 1.0);
428  hMassTimeUU->Fill(mass, (float)timebin, 1.0 );
429  hMassPtUU->Fill(mass, pt, 1.0 );
430  }
431  if ( spin4==9 ) {
432  hMassUD->Fill(mass, Nuu/Nud);
433  hMassTimeUD->Fill(mass, (float)timebin, Nuu/Nud );
434  hMassPtUD->Fill(mass, pt, Nuu/Nud );
435  }
436  if ( spin4==6 ) {
437  hMassDU->Fill(mass, Nuu/Ndu);
438  hMassTimeDU->Fill(mass, (float)timebin, Nuu/Ndu );
439  hMassPtDU->Fill(mass,pt,Nuu/Ndu);
440  }
441  if ( spin4==10 ) {
442  hMassDD->Fill(mass, Nuu/Ndd);
443  hMassTimeDD->Fill(mass, (float)timebin, Nuu/Ndd );
444  hMassPtDD->Fill(mass,pt,Nuu/Ndd);
445  }
446 
447  Bool_t blue_plus = (spin4 == 5 || spin4 == 6);
448  Bool_t blue_minus = !blue_plus;
449 
450  Bool_t yell_plus = (spin4 == 5 || spin4 == 9 );
451  Bool_t yell_minus = !yell_plus;
452 
453 
454  if ( left && blue_plus ) hMassUL->Fill(mass, 1.0);
455  if ( left && blue_minus ) hMassDL->Fill(mass, (Nuu+Ndu)/(Nud+Ndd) );
456  if ( right && blue_plus ) hMassUR->Fill(mass, 1.0);
457  if ( right && blue_minus ) hMassDR->Fill(mass, (Nuu+Ndu)/(Nud+Ndd) );
458 
459  if ( left && yell_plus ) hMassLU->Fill(mass, 1.0);
460  if ( left && yell_minus ) hMassLD->Fill(mass, (Nuu+Nud)/(Ndu+Ndd) );
461  if ( right && yell_plus ) hMassRU->Fill(mass, 1.0);
462  if ( right && yell_minus ) hMassRD->Fill(mass, (Nuu+Nud)/(Ndu+Ndd) );
463 
464  if ( top && blue_plus ) hMassUT->Fill(mass, 1.0);
465  if ( top && blue_minus ) hMassDT->Fill(mass, (Nuu+Ndu)/(Nud+Ndd) );
466  if ( bottom && blue_plus ) hMassUB->Fill(mass, 1.0);
467  if ( bottom && blue_minus ) hMassDB->Fill(mass, (Nuu+Ndu)/(Nud+Ndd) );
468 
469  if ( top && yell_plus ) hMassTU->Fill(mass, 1.0);
470  if ( top && yell_minus ) hMassTD->Fill(mass, (Nuu+Nud)/(Ndu+Ndd) );
471  if ( bottom && yell_plus ) hMassBU->Fill(mass, 1.0);
472  if ( bottom && yell_minus ) hMassBD->Fill(mass, (Nuu+Nud)/(Ndu+Ndd) );
473 
474 
475  // hMass->Fill(mass);
476  hMassFill->Fill(mass);
477  if ( mass > 0.1 && mass < 0.18 ) {
478  // hZgg->Fill(zgg);
479  hZggFill->Fill(zgg);
480  // hPhi->Fill(phibin);
481  hPhiFill->Fill(phibin);
482  }
483 
484  }
485  event++;
486  }
487 
488  //----------------------------------------------------------- fit mass spectrum --
489  //$$$ fitter(hMass);
490 
491 
492 }//end of readRun
493 
494 
495 
496 
497 
498 Int_t onlineBin( Int_t tdiff )
499 {
500 
501  static Int_t mybins[]=
502  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
503  { 1, 50, 110, 130, 140, 180, 215, 240, 260, 300, 340, 360, 400, 440, 480, 500, 512};//2006???
504 
505  for ( UInt_t ii=0;ii<sizeof(mybins)/sizeof(Int_t)-1;ii++ )
506  {
507  if ( tdiff >=mybins[ii] && tdiff < mybins[ii+1] ) return ii;
508  }
509  return -1;
510 
511 }
512 
513 
514 
515 
516 
517 
518 
519 // ----------------------------------------------------------------------------
520 // ----------------------------------------------------------------------------
521 void chainFiles(const Char_t *path, StEEmcIUPi0Reader *reader)
522 {
523 
524  std::cout << "chaining files " << path << std::endl;
525 
526  TSystemDirectory *dir = new TSystemDirectory("dir",path);
527 
528  TIter next( dir->GetListOfFiles() );
529  TObject *file = 0;
530  while ( file = (TObject*)next() )
531  {
532  TString name=file->GetName();
533 
534  if ( name.Contains("root") ) {
535  reader->chainFile(name);
536 
537  }
538 
539  }
540 
541  delete dir;
542 
543 }
544 
545 
546 
547 
548 
549 
550 
551 
552 
553 
554 
555 
556 
557 
558 // ----------------------------------------------------------------------------
559 // ----------------------------------------------------------------------------
560 void getFillPattern( Int_t fill )
561 {
562  for ( Int_t i=0;i<NMAX_FILLS;i++ )
563  {
564  Int_t myfill = fill_numbers[i];
565  if ( fill == myfill )
566  {
567  for ( Int_t j=0;j<120;j++ ) current_fill_pattern[j]=fill_pattern[i][j];
568  goto FINISH;
569  }
570  else if ( fill < 0 ) break;
571  }
572  for ( Int_t j=0;j<120;j++ ) current_fill_pattern[j]=-1;
573 
574  FINISH:
575  std::cout << "-------------------------------------------------------------------------------" << std::endl;
576  std::cout << "-------------------------------------------------------------------------------" << std::endl;
577  std::cout << "Current fill pattern:"<< std::endl;
578  std::cout << current_fill << " ";
579  for ( Int_t j=0;j<60;j++ ) std::cout << current_fill_pattern[j] << " ";
580  std::cout << std::endl << " ";
581  for ( Int_t j=60;j<120;j++ ) std::cout << current_fill_pattern[j] << " ";
582  std::cout << std::endl;
583  std::cout << "-------------------------------------------------------------------------------" << std::endl;
584  std::cout << "-------------------------------------------------------------------------------" << std::endl;
585 
586  return;
587 }
588 
589 void initFillPattern()
590 {
591  ifstream fills( fill_pattern_file );
592  Int_t count=0;
593  while ( !fills.eof() )
594  {
595  fills >> fill_numbers[count];
596  for ( Int_t i=0;i<120;i++ ) fills >> fill_pattern[count][i];
597  count++;
598  if ( count >= NMAX_FILLS ) break;
599  fill_numbers[count]=-1;
600  }
601 }
602 // ----------------------------------------------------------------------------
603 // ----------------------------------------------------------------------------
604 
605 void getBbcLumin( Int_t run )
606 {
607 
608  for ( Int_t i=0;i<NMAX_RUNS;i++ )
609  {
610  if ( run == run_numbers[i] )
611  {
612  bbc_valid = run;
613  for ( Int_t j=0;j<16;j++ )
614  {
615  current_bbc_lumin[j][0] = bbc_lumin[i][j][0];
616  current_bbc_lumin[j][1] = bbc_lumin[i][j][1];
617  current_bbc_lumin[j][2] = bbc_lumin[i][j][2];
618  current_bbc_lumin[j][3] = bbc_lumin[i][j][3];
619  }
620  goto FINISH;
621  }
622  }
623 
624  for ( Int_t j=0;j<16;j++ ) for ( Int_t k=0;k<4;k++ ) current_bbc_lumin[j][k]=-1;
625  bbc_valid = 0;
626 
627  FINISH:
628  std::cout << "-------------------------------------------------------------------------------" << std::endl;
629  std::cout << "-------------------------------------------------------------------------------" << std::endl;
630  std::cout << "Relative luminosities for run " << bbc_valid << std::endl;
631  for ( Int_t j=0;j<16;j++ )
632  {
633  std::cout << j << " ";
634  for ( Int_t k=0;k<4;k++ ) std::cout << current_bbc_lumin[j][k] << " ";
635  std::cout << std::endl;
636  }
637  std::cout << "-------------------------------------------------------------------------------" << std::endl;
638  std::cout << "-------------------------------------------------------------------------------" << std::endl;
639 }
640 
641 void initBbcLumin()
642 {
643 
644  Int_t count = 0;
645  ifstream bbc( bbc_lumin_file );
646  while ( !bbc.eof() )
647  {
648 
649  Int_t myfill;
650  bbc >> myfill;
651  if ( myfill < 0 ) break;
652  Int_t myrun;
653  bbc >> myrun;
654  Int_t myboard;
655  bbc >> myboard;
656  Int_t mybin;
657  bbc >> mybin;
658  Int_t uu,du,ud,dd;
659  bbc >> uu;
660  bbc >> du;
661  bbc >> ud;
662  bbc >> dd;
663 
664 
665  if ( mybin > 1 ) assert(myrun==run_numbers[count]); // error detected in file
666  run_numbers[count] = myrun;
667  bbc_lumin[count][mybin][0] = uu;
668  bbc_lumin[count][mybin][1] = du;
669  bbc_lumin[count][mybin][2] = ud;
670  bbc_lumin[count][mybin][3] = dd;
671  if ( mybin == 15 ) count++; // increment to next run on last timebin
672 
673  }
674 
675 }
676 
677 // ----------------------------------------------------------------------------
678 // ----------------------------------------------------------------------------
679 void LoadLibs()
680 {
681  //-- Load muDst shared libraries --
682  gROOT -> LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
683  loadSharedLibraries();
684 
685  gSystem->Load("StDbLib");
686  gSystem->Load("StDbBroker");
687  gSystem->Load("St_db_Maker");
688  gSystem->Load("StEEmcUtil");
689  gSystem->Load("StEEmcDbMaker");
690  gSystem->Load("StEEmcSimulatorMaker");
691 
692  gSystem->Load("StEEmcA2EMaker");
693  gSystem->Load("StEEmcIUPi0");
694  gSystem->Load("StSpinDbMaker");
695 
696 }
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
Int_t nPairs
From EEMC point-maker.
virtual void ls(Option_t *option="") const
Definition: TDataSet.cxx:495
virtual Int_t Make()
Definition: StChain.cxx:110