3 void doPhoton(
unsigned long nEvents,
char *infile,
char *jobid,
char *flag,
char *coll,Int_t nFiles=0,
char *timestampfile)
8 Bool_t USERANDOMIZER=kFALSE;
10 gSystem->Load(
"StarRoot");
11 gSystem->Load(
"St_base");
14 gSystem->Load(
"liblog4cxx.so");
15 gSystem->Load(
"StStarLogger.so");
16 StLoggerManager::StarLoggerInit();
19 gSystem->Load(
"StChain");
20 gSystem->Load(
"St_Tables");
21 gSystem->Load(
"StarMagField");
22 gSystem->Load(
"StMagF");
23 gSystem->Load(
"StUtilities");
24 gSystem->Load(
"StTreeMaker");
25 gSystem->Load(
"StIOMaker");
26 gSystem->Load(
"StarClassLibrary");
27 gSystem->Load(
"StTpcDb");
28 gSystem->Load(
"StDetectorDbMaker");
29 gSystem->Load(
"StDbUtilities");
30 gSystem->Load(
"StEvent");
31 gSystem->Load(
"StEventUtilities");
32 gSystem->Load(
"StMcEvent");
33 gSystem->Load(
"StMcEventMaker");
34 gSystem->Load(
"StAssociationMaker");
35 gSystem->Load(
"StStrangeMuDstMaker");
36 gSystem->Load(
"StEmcUtil");
37 gSystem->Load(
"StEEmcUtil");
38 gSystem->Load(
"StMuDSTMaker");
40 gSystem->Load(
"StBichsel");
42 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
43 loadSharedLibraries();
46 gSystem->Load(
"StDaqLib");
47 gSystem->Load(
"StDbLib");
48 gSystem->Load(
"StDbBroker");
49 gSystem->Load(
"St_db_Maker");
52 gSystem->Load(
"StEmcRawMaker");
53 gSystem->Load(
"StEmcADCtoEMaker");
54 gSystem->Load(
"StPreEclMaker");
55 gSystem->Load(
"StEpcMaker");
57 gSystem->Load(
"StEmcSimulatorMaker");
58 gSystem->Load(
"StEmcMixerMaker");
60 gSystem->Load(
"StEmcTriggerMaker");
63 gSystem->Load(
"StTimeRandomizerMaker");
65 gSystem->Load(
"/star/u/russcher/MyEvent/MyEvent");
66 gSystem->Load(
"StPhotonMaker");
68 cout<<
"Finished loading libraries"<<endl;
75 StTimeRandomizerMaker* rndMaker=0;
80 TString output(jobid);
85 output.Append(
".root");
87 TString input(infile);
88 if(strcmp(flag,
"mc")==0||strcmp(flag,
"realembed")==0||strcmp(flag,
"embed")==0){
89 if(input.EndsWith(
"list")){
90 cout<<endl<<
"running on event.root, prepend @ on "<<input.Data()<<endl;
100 if(strcmp(flag,
"real")==0){
101 cout <<
"Processing REAL data" << endl;
104 cout<<
"running on MuDst without number of files specified!!!"<<endl;
108 dbMk =
new St_db_Maker(
"db",
"MySQL:StarDb",
"$STAR/StarDb");
115 if(strcmp(flag,
"realembed")==0){
116 cout <<
"Processing REALEMBED data" << endl;
118 ioMaker =
new StIOMaker(
"IO",
"r",input.Data());
120 ioMaker->SetBranch(
"*",0,
"0");
121 ioMaker->SetBranch(
"eventBranch", 0,
"r");
123 dbMk =
new St_db_Maker(
"db",
"MySQL:StarDb",
"$STAR/StarDb");
127 if(strcmp(flag,
"mc")==0)
129 ioMaker =
new StIOMaker(
"IO",
"r",input.Data());
131 ioMaker->SetBranch(
"*",0,
"0");
132 ioMaker->SetBranch(
"eventBranch", 0,
"r");
133 ioMaker->SetBranch(
"geantBranch",0,
"r");
137 rndMaker=
new StTimeRandomizerMaker();
138 rndMaker->setRunTimesFilename(timestampfile);
139 rndMaker->setNormalizeEventsTotal(3000);
140 rndMaker->setDatasetNameStEvent(
"IO_Root/.data/bfcTree/eventBranch/StEvent");
141 rndMaker->setSeed(0);
142 rndMaker->setBaseEventId(0);
145 dbMk =
new St_db_Maker(
"db",
"MySQL:StarDb",
"$STAR/StarDb");
146 if(strcmp(coll,
"dAu")==0 && !USERANDOMIZER){
147 dbMk->SetDateTime(20030313,000000);
149 if(strcmp(coll,
"pp05")==0 && !USERANDOMIZER){
152 dbMk->SetDateTime(date,time);
155 mcEventMaker->doPrintEventInfo=debug;
157 mcEventMaker->doPrintCpuInfo=debug;
159 cout <<
"Processing MC data" << endl;
168 if(strcmp(coll,
"dAu")==0){
171 if(strcmp(coll,
"pp05")==0){
179 if(strcmp(flag,
"embed")==0){
180 ioMaker =
new StIOMaker(
"IO",
"r",input.Data());
181 ioMaker->SetDebug(debug);
183 ioMaker->SetBranch(
"*",0,
"0");
184 ioMaker->SetBranch(
"eventBranch", 0,
"r");
185 ioMaker->SetBranch(
"geantBranch",0,
"r");
187 cout <<
"Processing EMBED data" << endl;
189 dbMk=
new St_db_Maker(
"db",
"MySQL:StarDb",
"$STAR/StarDb");
190 cout<<
"database done"<<endl;
195 cout<<
"first adcmaker done"<<endl;
198 cout<<
"added premixer"<<endl;
201 mcEventMaker->doPrintEventInfo=debug;
203 mcEventMaker->doPrintCpuInfo=debug;
204 cout<<
"added mcEventmaker"<<endl;
207 cout<<
"adjust for new simulator!"<<endl;
213 cout<<
"mixer done"<<endl;
219 if(strcmp(flag,
"mc")!=0){
232 emcTrigger->setDbMaker(dbMk);
235 photonMaker->setDbMaker(dbMk);
236 if(strcmp(flag,
"mc")!=0) photonMaker->setAdcMaker(adc);
241 cout<<endl<<
"Using old clustering, setting parameters now!"<<endl;
248 cout<<endl<<
"******** Starting to loop over chain->Make()!!!! *********"<<endl<<endl;
250 for(
unsigned long iev=0;iev<nEvents; iev++){
251 if(iev%100==0) cout<<
"processing event: "<<iev<<endl;
253 Int_t iret = chain->
Make(iev);
256 photonMaker->saveHistograms();
258 if(iret==2) cout<<
"### Last Event Processed. Status = "<<iret<<endl;
259 if(iret==3) cout<<
"### Error Event Processed. Status = "<<iret<<endl;
260 if(iret==4) cout<<
"### Fatal Event Processed. Status = "<<iret<<endl;
void setEmbeddingMode(Bool_t a)
Set embedding mode (default is kFALSE)
void setPrint(Bool_t)
Obsolete function; users can control messages with logger config file.
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
void setCalibOffset(StDetectorId det, float offset)
scale simulator calibration coefficients by 1.0 + offset. Default is zero
virtual void Clear(Option_t *option="")
User defined functions.
void setPrint(Bool_t a)
Obsolete function; users can control messages with logger config file.
void setPrint(Bool_t a)
Obsolete function; users can control messages with logger config file.
void SetClusterConditions(char *, Int_t, Float_t, Float_t, Float_t, Bool_t=kFALSE)
this is for background compatibility with the old finder
Filling of all StMcEvent classes from g2t tables Transform all the data in the g2t tables into the co...
Bool_t doPrintMemoryInfo
lots of screen output
void setEmbedAll(Bool_t a)
Set kTRUE to embedd all hits even if the first emcCollection has no hits.
void setPrint(Bool_t a)
Obsolete function; users can control messages with logger config file.
void saveAllStEvent(Bool_t a)
Set to kTRUE if all hits are to be saved on StEvent.
void setCalibSpread(StDetectorId det, float spread)
smear simulator calibration coefficients using Gaussian with this RMS.