13 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
14 loadSharedLibraries();
16 gSystem->Load(
"StDbBroker.so");
17 gSystem->Load(
"St_db_Maker");
18 gSystem->Load(
"StDetectorDbMaker");
19 gSystem->Load(
"StTpcDb");
20 gSystem->Load(
"StDbUtilities");
21 gSystem->Load(
"StdEdxY2Maker");
22 gSystem->Load(
"StPicoEvent");
23 gSystem->Load(
"StPicoDstMaker");
24 gSystem->Load(
"StPass0CalibMaker");
28 const Int_t nevents=10,
29 const Char_t *path=
"/star/data13/reco/dev/2001/10/",
30 const Char_t *file=
"st_physics_2304060_raw_0303.event.root",
31 const Char_t* outDir=
"./"){
43 if (pstr.Length() > 0 && !(pstr.EndsWith(
"/"))) pstr.Append(
"/");
45 if (fstr.EndsWith(
"event.root")) {
48 IOMaker->SetBranch(
"*",0,
"0");
49 IOMaker->SetBranch(
"runcoBranch",0,
"r");
50 IOMaker->SetBranch(
"eventBranch",0,
"r");
51 new St_db_Maker(
"db",
"MySQL:StarDb",
"$STAR/StarDb",
"StarDb");
53 }
else if (fstr.EndsWith(
"MuDst.root")) {
54 dstMaker =
new StMuDstMaker(0,0,pstr.Data(),file,
"MuDst.root");
56 dstMaker->SetStatus(
"MuEvent",1);
57 dstMaker->SetStatus(
"PrimaryVertices",1);
58 dstMaker->SetStatus(
"PrimaryTracks",1);
59 dstMaker->SetStatus(
"GlobalTracks",1);
60 dstMaker->SetStatus(
"BTofHeader",1);
61 new St_db_Maker(
"db",
"MySQL:StarDb",
"$STAR/StarDb",
"StarDb");
63 }
else if (fstr.EndsWith(
"picoDst.root")) {
67 dstMaker->SetStatus(
"Track",1);
68 dbMaker =
new St_db_Maker(
"db",
"MySQL:StarDb",
"$STAR/StarDb",
"StarDb");
70 }
else if (fstr.EndsWith(
"daq")) {
71 cout <<
"Please process with a BFC chain. Stopping." << endl;
74 cout <<
"Unknown file type. Stopping." << endl;
77 vtxSeedMk->SetDefDir(outDir);
80 int status = chain.Init();
81 if (status) { chain.Fatal(status,
"on init");
return; }
85 if (fstr.BeginsWith(
"st_")) {
86 fstr.ReplaceAll(
"adc_",
"");
87 fstr.
Remove(0,fstr.Index(
'_',fstr.First(
'_')+1)+1);
88 int run = fstr.Atoi();
90 cout <<
"Guessing run number from filename to be: " << run << endl;
93 int port = (((run/1000) - 1273)/1000) + 3400;
94 TMySQLServer serv(Form(
"mysql://dbbak.starp.bnl.gov:%d/RunLog",port),
"",
"");
95 TSQLResult* result = serv.Query(Form(
"SELECT FLOOR(1e-6*(FROM_UNIXTIME(firstEventTime)+0)),FLOOR(FROM_UNIXTIME(firstEventTime)+0)%1000000 FROM daqSummary WHERE runNumber=%d",run));
97 TSQLRow* row = result->Next();
99 int date = atoi(row->GetField(0));
100 int time = atoi(row->GetField(1));
101 dbMaker->SetDateTime(date,time);
106 cout <<
"Unable to guess run number...skipping InitRun()" << endl;
112 for( Int_t i=0; i<nevents; i++ ) {
114 status = chain.
Make();
Class that converts MuDst into PicoDst.
virtual void Remove(TDataSet *set)
Remiove the "set" from this TDataSet.
virtual void Clear(Option_t *option="")
User defined functions.
void SetStatus(char const *branchNameRegex, int enable)
Enables or disables branches matching a simple regex pattern in reading mode.
void SetStatus(const char *arrType, int status)
BeamLine Constraint calibration base class.