StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
doEmcEmbedEvent.C
1 
5 class StChain;
6 StChain *chain=0;
7 void doEmcEmbedEvent(int nevents = 10,char* file="*.event.root",Bool_t print = kTRUE)
8 {
9  gROOT->Macro("LoadLogger.C");
10  gROOT->Macro("loadMuDst.C");
11  gSystem->Load("StarMagField");
12  gSystem->Load("StMagF");
13  gSystem->Load("StTpcDb");
14  gSystem->Load("StDetectorDbMaker");
15  gSystem->Load("StDbUtilities");
16  gSystem->Load("StEEmcUtil");
17  gSystem->Load("StMcEvent");
18  gSystem->Load("StMcEventMaker");
19  gSystem->Load("StDaqLib");
20  gSystem->Load("StAssociationMaker");
21  gSystem->Load("StMcAnalysisMaker");
22  gSystem->Load("StDbBroker");
23  gSystem->Load("St_db_Maker");
24  gSystem->Load("libgeometry_Tables");
25  gSystem->Load("StEmcRawMaker");
26  gSystem->Load("StEmcADCtoEMaker");
27  gSystem->Load("StPreEclMaker");
28  gSystem->Load("StEpcMaker");
29  gSystem->Load("StEmcSimulatorMaker");
30  gSystem->Load("StEmcMixerMaker");
31 
32  // create chain
33  chain = new StChain("bfc");
34  if(print) chain->SetDebug(1);
35 
36  StIOMaker* io = new StIOMaker("IO");
37  io->SetFile(file);
38  io->SetIOMode("r");
39  io->SetBranch("*",0,"0"); //deactivate all branches
40  io->SetBranch("eventBranch",0,"r");
41  io->SetBranch("geantBranch",0,"r");
42 
43  St_db_Maker *db1 = new St_db_Maker("db","MySQL:StarDb","$STAR/StarDb","$PWD/StarDb");
44  db1->SetFlavor("sim", "bprsCalib");
45 
47  // this line is important to propagate all the hits into StEvent
48  // so, even the pedestals are propagated. In this case
49  // the second AdcToEMaker will be responsible for making the
50  // cuts (after the simulated hits are embedded)
51  adc->saveAllStEvent(kTRUE);
52  if(!print) adc->setPrint(kFALSE);
53 
54  StEmcPreMixerMaker *preMixer = new StEmcPreMixerMaker("preEmbed");
55 
56  StMcEventMaker *mcEvent = new StMcEventMaker();
57 
59 
60  StEmcMixerMaker *emb = new StEmcMixerMaker();
61  // include the next line if you want to embedd all simuated hits
62  // even the ones that do not have a hit in the real data
63  //emb->setEmbedAll(kTRUE);
64  if(!print) emb->setPrint(kFALSE);
65 
66  StEmcADCtoEMaker *adc1 = new StEmcADCtoEMaker("EReadEmbed");
67  adc1->setEmbeddingMode(kTRUE);
68  if(!print) adc1->setPrint(kFALSE);
69 
70  StPreEclMaker *pre = new StPreEclMaker();
71  if(!print) pre->setPrint(kFALSE);
72 
73  StEpcMaker *epc = new StEpcMaker();
74  if(!print) epc->setPrint(kFALSE);
75 
76  StAssociationMaker *association = new StAssociationMaker(); // TPC association maker
77  StEmcAssociationMaker *emcAssociation = new StEmcAssociationMaker(); // EMC association maker
78  emcAssociation->setPrint(print);
79 
81  //
82  // put your analysis maker here
83  //
85 
86  chain->Init();
87  int iev = 0;
88  int istat = 0;
89 
90  // do the event loop
91  while ( istat!=2 && istat!=3 && istat!=4 && iev<=nevents ) {
92  chain->Clear();
93  istat = chain->Make();
94  emcAssociation->printMaps();
95  if(iev%20==0) cout << "Finished processing event number "<<iev <<endl;
96  iev++;
97  }
98  chain->Finish();
99 
100 }
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
Definition: StIOInterFace.h:35
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
void setPrint(Bool_t a)
Set print log.
void setPrint(Bool_t a)
Obsolete function; users can control messages with logger config file.
Definition: StPreEclMaker.h:36
void setPrint(Bool_t a)
Obsolete function; users can control messages with logger config file.
virtual Int_t Finish()
Definition: StChain.cxx:85
Filling of all StMcEvent classes from g2t tables Transform all the data in the g2t tables into the co...
virtual Int_t Make()
Definition: StChain.cxx:110
void setPrint(Bool_t a)
Obsolete function; users can control messages with logger config file.
Definition: StEpcMaker.h:89
void saveAllStEvent(Bool_t a)
Set to kTRUE if all hits are to be saved on StEvent.