StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
runEvent.C
1 TString opt = "in fcsWFF fcsCluster fcsPoint";
2 
3 void runEvent(Int_t nevents=100, Int_t pedLedPhy=2, Int_t eventDisplay=100, Int_t debug=0,
4  const Char_t *file="st_physics_22066021_raw_0000002.event.root"){
5 
6  TString f(file);
7  int l1 = f.Length();
8  int l2 = f.Last('/');
9  TString dir(f); dir.Remove(l2+1,l1-l2);
10  TString fne(f); fne.Remove(0,l2+1);
11  TString crun(fne);
12  int l3= crun.First('_'); crun.Remove(0,l3+1);
13  int l4= crun.First('_'); crun.Remove(0,l4+1);
14  int l5 =crun.Length(); int l6= crun.First('_'); crun.Remove(l6,l5-l6);
15  int run=crun.Atoi();
16  int day=run/1000;
17  //printf("l1=%d l2=%d l3=%d l4=%d l5=%d l6=%d\n",l1,l2,l3,l4,l5,l6);
18  //printf("f =%s\n",f.Data());
19  //printf("dir=%s\n",dir.Data());
20  //printf("fne=%s\n",fne.Data());
21  //printf("run=%s\n",run.Data());
22  printf("Run=%d yearday=%d\n",run,day);
23  char edout[200];
24 
25  gROOT->LoadMacro("bfc.C"); // Load big "full" chain
26  bfc(-1,opt,file); // Setup but do not init
27 
28  St_db_Maker *dbMk= (St_db_Maker*) chain->GetMaker("db");
29  if(dbMk){
30  dbMk->SetAttr("blacklist", "tpc");
31  dbMk->SetAttr("blacklist", "svt");
32  dbMk->SetAttr("blacklist", "ssd");
33  dbMk->SetAttr("blacklist", "ist");
34  dbMk->SetAttr("blacklist", "pxl");
35  dbMk->SetAttr("blacklist", "pp2pp");
36  dbMk->SetAttr("blacklist", "ftpc");
37  dbMk->SetAttr("blacklist", "emc");
38  dbMk->SetAttr("blacklist", "eemc");
39  dbMk->SetAttr("blacklist", "mtd");
40  dbMk->SetAttr("blacklist", "pmd");
41  dbMk->SetAttr("blacklist", "tof");
42  dbMk->SetAttr("blacklist", "etof");
43  dbMk->SetAttr("blacklist", "rhicf");
44  }
45 
46  StFcsDbMaker *fcsDbMkr=(StFcsDbMaker *)chain->GetMaker("fcsDbMkr");
47  StFcsDb* fcsDb = (StFcsDb*) chain->GetDataSet("fcsDb");
48  fcsDb->setDbAccess(0);
49  fcsDb->setDebug(debug);
50  fcsDb->forceUniformGain(0.0053*2.0); //tail has 1/2 integral
51  fcsDb->forceUniformGainCorrection(1.0);
52 
53  StFcsWaveformFitMaker *wff=(StFcsWaveformFitMaker *)chain->GetMaker("StFcsWaveformFitMaker");
54  StFcsClusterMaker *clu=(StFcsClusterMaker *)chain->GetMaker("StFcsClusterMaker");
55  StFcsPointMaker *poi=(StFcsPointMaker *)chain->GetMaker("StFcsPointMaker");
56  wff->setDebug(1);
57  wff->setEnergySelect(10);
58  char wffout[100];
59  char wffout2[100];
60  if(pedLedPhy==1){
61  if(run<1106734){
62  wff->setCenterTimeBins(207,190,240);
63  }else{
64  wff->setCenterTimeBins(207+8,190+8,240+8);
65  }
66  wff->setPedTimeBins(0,150);
67  skip=5;
68  }else{
69  wff->setCenterTimeBins(50,30,100);
70  }
71  sprintf(wffout,"%d/%d.wff",day,run);
72  wff->setFileName(wffout,10,0);
73  sprintf(wffout2,"%d/%d.wfftime.png",day,run);
74  wff->setMeasureTime(wffout2);
75 
76  gSystem->Load("StFcsEventDisplay");
77  StFcsEventDisplay* fcsed;
78  if(pedLedPhy>0 && eventDisplay>0){
79  gSystem->Load("StEpdUtil");
80  fcsed = new StFcsEventDisplay();
81  fcsed->setMaxEvents(eventDisplay);
82  sprintf(edout,"%d/%d.eventDisplay.png",day,run);
83  fcsed->setFileName(edout);
84  fcsed->setFilter(1);
85  }
86 
87  gSystem->Load("StFcsQaMaker");
88  StFcsQaMaker *qaMkr=new StFcsQaMaker("FcsQa");
89  qaMkr->setRun(run);
90  if(pedLedPhy==0){
91  qaMkr->setMaxTimeBins(1024);
92  qaMkr->setMaxAdc(512);
93  }else if(pedLedPhy==1){
94  qaMkr->setMaxTimeBins(256);
95  qaMkr->setSumTimeBins(210,225);
96  qaMkr->setMaxAdc(2048);
97  qaMkr->setMaxAdcSum(20000);
98  }else if(pedLedPhy==2){
99  qaMkr->setMaxTimeBins(160);
100  qaMkr->setSumTimeBins(35,60);
101  qaMkr->setMaxAdc(1024);
102  qaMkr->setMaxAdcSum(2000);
103  }
104 
105  // Intializet the chain
106  chain->Init();
107 
108  // Process events
109  chain->EventLoop(nevents);
110 }
void setPedTimeBins(int min, int max)
Set the timebin region where the pedestal occurs, for non-pedestal subtracted data.
void setFileName(char *file, int maxpage=25, int skip=5)
Set event drawing options.
void forceUniformGain(float ecal, float hcal=0.0053, float pres=0.01)
fixed default gaincorr
Definition: StFcsDb.h:234
void setDbAccess(int v=1)
debug level
Definition: StFcsDb.cxx:250
void forceUniformGainCorrection(float ecal, float hcal=1.0, float pres=0.5)
Definition: StFcsDb.h:240