26 TH1F *hMassLU = 0, *hMassUL = 0;
27 TH1F *hMassLD = 0, *hMassUR = 0;
28 TH1F *hMassRU = 0, *hMassDL = 0;
29 TH1F *hMassRD = 0, *hMassDR = 0;
31 TH1F *hMassTU = 0, *hMassUT = 0;
32 TH1F *hMassTD = 0, *hMassUB = 0;
33 TH1F *hMassBU = 0, *hMassDT = 0;
34 TH1F *hMassBD = 0, *hMassDB = 0;
36 TH2F *hMassTimeUU = 0;
37 TH2F *hMassTimeUD = 0;
38 TH2F *hMassTimeDU = 0;
39 TH2F *hMassTimeDD = 0;
47 Double_t pt_bins[] = { 0., 4.5, 5.5, 6.5, 7.5, 9.5, 11.5, 21.5 };
54 Int_t fill_number = 0;
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];
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];
81 void normalizemass(Int_t nevents=-1,
82 const Char_t *mydir=
"/star/institutions/iucf/hew/7863/",
const Char_t *ofile=
"ttree.root")
95 sortFills( nevents, mydir, 1,ofile );
99 void sortFills( Int_t nevents,
102 const Char_t *ofile )
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;
114 gStyle->SetHistMinimumZero();
115 gStyle->SetPalette(1);
123 outfile=
new TFile(ofile,
"recreate");
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.);
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);
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);
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);
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);
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);
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.);
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);
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
182 hBXstar =
new TH1F(
"hBXstar",
"Beam x-ing number @ STAR IP",120,0.,120.);
184 for ( Int_t i=0;i<120;i++ )
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);
193 hDsmvtx =
new TH1F(
"hDsmvtx",
"DSM vertex",512,0.,512.);
194 hTimebin =
new TH1F(
"hTimebin",
"BBC time bin",17,-1.,16.);
210 for ( UInt_t jj=0;jj<nfills;jj++ )
216 TString bdir=adir( adir.Last(
'/')-4, adir.Last(
'/')-1 );
217 current_fill = bdir.Atoi();
219 getFillPattern(current_fill);
221 fill_number = current_fill;
235 TSystemDirectory *dir =
new TSystemDirectory(
"fills",fillPath);
236 TIter next( dir->GetListOfFiles() );
238 while ( file = (TObject*)next() )
240 TString name=file->GetName();
241 if ( name.Contains(
".") ) {
244 std::cout <<
"-------- Processing run="<<name<<
" ---------------------"<<std::endl;
284 void readFill(
const Char_t *name )
296 void readRun(
const Char_t *name )
300 Int_t runid = atoi(name);
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;
313 std::cout <<
"*** run is not contained in the rel. luminosity file, abort *** " << std::endl;
317 std::cout << Form(
"+++ run %i has relative luminosities",runid) << std::endl;
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.);
328 chainFiles(fillPath+name,&reader);
329 nevents = reader.getNumberOfEvents();
336 if ( event>=nevents )
break;
339 realEvent = reader.event();
341 Int_t bxStar=realEvent->bxStar;
342 hBXstar->Fill(bxStar);
345 if ( bxStar < 0 || bxStar > 119 ) {
347 std::cout << Form(
"************* Warning bxStar = %i fill = %i run = %i ****************",
348 bxStar,fill_number,run_number)
356 if ( !current_fill_pattern[bxStar] )
continue;
358 Int_t dsmvtx = realEvent->mBbcTrigger.onlineTimeDifference();
359 hDsmvtx->Fill(dsmvtx);
361 Int_t timebin = onlineBin(dsmvtx);
362 hTimebin->Fill(onlineBin(dsmvtx));
365 if ( timebin <= 0 )
continue;
366 if ( timebin > 14 )
continue;
368 for ( Int_t i=0;i<
nPairs;i++ )
371 Float_t mass = reader.event()->mMass[i];
372 Float_t pt = reader.event()->mPT[i];
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];
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;
391 Bool_t left = sector < 5;
392 Bool_t right = sector > 5;
393 Bool_t top = sector < 2 || sector > 8;
394 Bool_t bottom = sector > 2 && sector < 8;
396 Int_t spin4 = realEvent->mSpin4;
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
421 Float_t Nuu = current_bbc_lumin[timebin][0];
422 Float_t Ndu = current_bbc_lumin[timebin][1];
423 Float_t Nud = current_bbc_lumin[timebin][2];
424 Float_t Ndd = current_bbc_lumin[timebin][3];
427 hMassUU->Fill(mass, 1.0);
428 hMassTimeUU->Fill(mass, (
float)timebin, 1.0 );
429 hMassPtUU->Fill(mass, pt, 1.0 );
432 hMassUD->Fill(mass, Nuu/Nud);
433 hMassTimeUD->Fill(mass, (
float)timebin, Nuu/Nud );
434 hMassPtUD->Fill(mass, pt, Nuu/Nud );
437 hMassDU->Fill(mass, Nuu/Ndu);
438 hMassTimeDU->Fill(mass, (
float)timebin, Nuu/Ndu );
439 hMassPtDU->Fill(mass,pt,Nuu/Ndu);
442 hMassDD->Fill(mass, Nuu/Ndd);
443 hMassTimeDD->Fill(mass, (
float)timebin, Nuu/Ndd );
444 hMassPtDD->Fill(mass,pt,Nuu/Ndd);
447 Bool_t blue_plus = (spin4 == 5 || spin4 == 6);
448 Bool_t blue_minus = !blue_plus;
450 Bool_t yell_plus = (spin4 == 5 || spin4 == 9 );
451 Bool_t yell_minus = !yell_plus;
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) );
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) );
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) );
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) );
476 hMassFill->Fill(mass);
477 if ( mass > 0.1 && mass < 0.18 ) {
481 hPhiFill->Fill(phibin);
498 Int_t onlineBin( Int_t tdiff )
501 static Int_t mybins[]=
503 { 1, 50, 110, 130, 140, 180, 215, 240, 260, 300, 340, 360, 400, 440, 480, 500, 512};
505 for ( UInt_t ii=0;ii<
sizeof(mybins)/
sizeof(Int_t)-1;ii++ )
507 if ( tdiff >=mybins[ii] && tdiff < mybins[ii+1] )
return ii;
524 std::cout <<
"chaining files " << path << std::endl;
526 TSystemDirectory *dir =
new TSystemDirectory(
"dir",path);
528 TIter next( dir->GetListOfFiles() );
530 while ( file = (TObject*)next() )
532 TString name=file->GetName();
534 if ( name.Contains(
"root") ) {
535 reader->chainFile(name);
560 void getFillPattern( Int_t fill )
562 for ( Int_t i=0;i<NMAX_FILLS;i++ )
564 Int_t myfill = fill_numbers[i];
565 if ( fill == myfill )
567 for ( Int_t j=0;j<120;j++ ) current_fill_pattern[j]=fill_pattern[i][j];
570 else if ( fill < 0 )
break;
572 for ( Int_t j=0;j<120;j++ ) current_fill_pattern[j]=-1;
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;
589 void initFillPattern()
591 ifstream fills( fill_pattern_file );
593 while ( !fills.eof() )
595 fills >> fill_numbers[count];
596 for ( Int_t i=0;i<120;i++ ) fills >> fill_pattern[count][i];
598 if ( count >= NMAX_FILLS )
break;
599 fill_numbers[count]=-1;
605 void getBbcLumin( Int_t run )
608 for ( Int_t i=0;i<NMAX_RUNS;i++ )
610 if ( run == run_numbers[i] )
613 for ( Int_t j=0;j<16;j++ )
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];
624 for ( Int_t j=0;j<16;j++ )
for ( Int_t k=0;k<4;k++ ) current_bbc_lumin[j][k]=-1;
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++ )
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;
637 std::cout <<
"-------------------------------------------------------------------------------" << std::endl;
638 std::cout <<
"-------------------------------------------------------------------------------" << std::endl;
645 ifstream bbc( bbc_lumin_file );
651 if ( myfill < 0 )
break;
665 if ( mybin > 1 ) assert(myrun==run_numbers[count]);
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++;
682 gROOT -> LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
683 loadSharedLibraries();
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");
692 gSystem->Load(
"StEEmcA2EMaker");
693 gSystem->Load(
"StEEmcIUPi0");
694 gSystem->Load(
"StSpinDbMaker");
virtual void Clear(Option_t *option="")
User defined functions.
Int_t nPairs
From EEMC point-maker.
virtual void ls(Option_t *option="") const