StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
runEvent.C
1 void runEvent(Int_t nevents=10, Int_t pedLedPhy=2, Int_t eventDisplay=0, Int_t debug=0,
2  const Char_t *file="/gpfs01/star/subsysg/FPS/fcs2019/event/liangxl/gain0015_20192002/st_physics_20192002_raw_1500002.event.root"){
3 
4  cout<<" Input Filename = "<<file<<endl;
5  TString opt = "in fcsCluster";
6 
7  TString f(file);
8  int l1 = f.Length();
9  int l2 = f.Last('/');
10  TString dir(f); dir.Remove(l2+1,l1-l2);
11  TString fne(f); fne.Remove(0,l2+1);
12  TString crun(fne);
13  int l3= crun.First('_'); crun.Remove(0,l3+1);
14  int l4= crun.First('_'); crun.Remove(0,l4+1);
15  TString srun(crun);
16  int l5 =crun.Length();
17  int l6= crun.First('_'); crun.Remove(l6,l5-l6);
18  srun.Remove(0,l6+1);
19  int l7=srun.First('_'); srun.Remove(0,l7+1);
20  int l8 = srun.First(".");
21  int l9 = srun.Length();
22  srun.Remove(l8,l9-l8);
23 
24  int run=crun.Atoi();
25  int subrun=srun.Atoi();
26  int day=run/1000;
27  printf("Run=%d SubRun=%d yearday=%d\n",run,subrun,day);
28 
29  gROOT->LoadMacro("bfc.C"); // Load big "full" chain
30  bfc(-1,opt,file); // Setup but do not init
31  gROOT->Macro("load.C");
32 
33  St_db_Maker *dbMk= (St_db_Maker*) chain->GetMaker("db");
34  if(dbMk){
35  dbMk->SetAttr("blacklist", "tpc");
36  dbMk->SetAttr("blacklist", "svt");
37  dbMk->SetAttr("blacklist", "ssd");
38  dbMk->SetAttr("blacklist", "ist");
39  dbMk->SetAttr("blacklist", "pxl");
40  dbMk->SetAttr("blacklist", "pp2pp");
41  dbMk->SetAttr("blacklist", "ftpc");
42  dbMk->SetAttr("blacklist", "emc");
43  dbMk->SetAttr("blacklist", "eemc");
44  dbMk->SetAttr("blacklist", "mtd");
45  dbMk->SetAttr("blacklist", "pmd");
46  dbMk->SetAttr("blacklist", "tof");
47  dbMk->SetAttr("blacklist", "etof");
48  dbMk->SetAttr("blacklist", "rhicf");
49  }
50 
51  StFcsDbMaker *fcsDbMkr=(StFcsDbMaker *)chain->GetMaker("fcsDb");
52  fcsDbMkr->setRun(run);
53  fcsDbMkr->setDebug(debug);
54  fcsDbMkr->setRun19(1);
55  fcsDbMkr->readGainFromText();
56  fcsDbMkr->readGainCorrFromText();
57 
58  Int_t filter=1;
59  if(filter){
60  gSystem->Load("StTriggerFilterMaker");
61  StTriggerFilterMaker* filterMaker = new StTriggerFilterMaker;
62  filterMaker->printTriggerId();
63  filterMaker->addTrigger(19);
64  filterMaker->addTrigger(20);
65  filterMaker->addTrigger(21);
66  filterMaker->addTrigger(22);
67  filterMaker->addTrigger(23);
68  filterMaker->addTrigger(24);
69  filterMaker->addTrigger(25);
70  filterMaker->addTrigger(26);
71  filterMaker->addTrigger(27);
72  filterMaker->addTrigger(28);
73  filterMaker->addTrigger(29);
74  filterMaker->addTrigger(30);
75  filterMaker->addTrigger(31);
76  filterMaker->addTrigger(700001);
77  filterMaker->addTrigger(700013);
78  }
79 
80 
81 
82  //StFcsRawHitMaker *hitmk=(StFcsRawHitMaker *)chain->GetMaker("fcsHit");
83  //hitmk->setDebug(debug);
84 
85  StFcsClusterMaker *clu=(StFcsClusterMaker *)chain->GetMaker("StFcsClusterMaker");
86  /*
87  gSystem->Load("StFcsEventDisplay");
88  StFcsEventDisplay* fcsed;
89  if(pedLedPhy>0 && eventDisplay>0){
90  fcsed = new StFcsEventDisplay();
91  fcsed->setMaxEvents(eventDisplay);
92  sprintf(edout,"%d/%d.eventDisplay.png",day,run);
93  fcsed->setFileName(edout);
94  fcsed->setFilter(1);
95  fcsed->setRun19(1);
96  }
97 
98  gSystem->Load("StFcsQaMaker");
99  StFcsQaMaker *qaMkr=new StFcsQaMaker("FcsQa");
100  qaMkr->setRun(run);
101  */
102  gSystem->Load("StFcsMIPMaker");
103  StFcsMIPMaker *MIPMkr=new StFcsMIPMaker("FcsMIP");
104  MIPMkr->setRun(run);
105  MIPMkr->setSubRun(subrun);
106 
107  if(pedLedPhy==0){
108  //hitmk->setReadMode(0);
109  qaMkr->setMaxTimeBins(1024);
110  qaMkr->setMaxAdc(512);
111  }else if(pedLedPhy==1){
112  //hitmk->setReadMode(1);
113  qaMkr->setMaxTimeBins(256);
114  qaMkr->setSumTimeBins(210,225);
115  qaMkr->setMaxAdc(2048);
116  qaMkr->setMaxAdcSum(20000);
117  clu->setEnergySelect(1);
118  clu->setSumTimeBins(210,225);
119  }else if(pedLedPhy==2){
120  //hitmk->setReadMode(1);
121  //qaMkr->setMaxTimeBins(160);
122  //qaMkr->setSumTimeBins(35,60);
123  //qaMkr->setMaxAdc(1024);
124  //qaMkr->setMaxAdcSum(2000);
125  clu->setEnergySelect(1);
126  clu->setSumTimeBins(48,60);
127  }
128 
129  // Intializet the chain
130  chain->Init();
131 
132  // Process events
133  chain->EventLoop(nevents);
134 }