StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
plDAQ2Ped.C
1 TObjArray *HList;
2 TH2F* h2D=0;
3 
4 class St_db_Maker;
5 St_db_Maker *stDb = 0;
6 
7 //=================================================
8 plDAQ2Ped(char *core0 = "" ) {
9 
10  char *path="";
11  TString fullInpName=path; fullInpName+=core0;
12  fullInpName+=".hist.root";
13  fd=new TFile(fullInpName);
14  if(! fd->IsOpen()) {
15  printf("ERROR: input histo file not found, quit\n",fullInpName.Data());
16  return;
17  }
18 
19  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
20  loadSharedLibraries();
21 
22  // libraries below are needed for DB interface
23  assert( !gSystem->Load("StDbBroker"));
24  assert( !gSystem->Load("St_db_Maker"));
25  assert( !gSystem->Load("StEEmcDbMaker"));
26 
27  assert( !gSystem->Load("StEEmcUtil"));
28  assert( !gSystem->Load("StEEmcDAQ2Ped"));
29 
30  StChain* chain = new StChain("StChain");
31 
32  stDb = new St_db_Maker("StarDb", "MySQL:StarDb");
33 
34  // for slope fits need a timestamp for pedestals (set by hand for now)
35  stDb->SetDateTime(20090424,0);//time stamp for run 10114001
36 
37  StEEmcDbMaker *myDb=new StEEmcDbMaker("eemcDb");
38 
39  HList=new TObjArray;
40  StEEmcDAQ2Ped* daq2ped=new StEEmcDAQ2Ped("daq2ped",fd);
41  daq2ped->SetHList(HList);
42 
43  daq2ped->ChooseSet(0); //sets marker type for slope histos
44  daq2ped->MappingFile("crMap.csv"); //file to store Mapmt mapping (sometimes useful)
45  chain->Init();
46  chain->Make();
47  chain->Finish();
48 
49  TString out;
50  out+="Rnnn";
51  out+="ped.hist.root";
52  TFile f( out,"recreate");
53  assert(f.IsOpen());
54  printf("%d histos are written to '%s' ...\n",HList->GetEntries(),out.Data());
55  HList->Write();
56  f.Close();
57 
58 }
59 
60 
61