StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
runGammaTreeMaker.C
1 void runGammaTreeMaker
2 (
3  char *inputFile = "root://rcas6132.rcf.bnl.gov:1095//home/starreco/reco/ppProductionLong/FullField/P06ie/2006/131/7131043/st_physics_7131043_raw_1020001.MuDst.root",
4  char *outputFile = "test.root"
5 )
6 {
7 
8  // Display file paths
9  cout << "****************************************" << endl;
10  cout << "Reading MuDst File : " << inputFile << endl;
11  cout << "Writing Output File : " << outputFile << endl;
12 
13  // Load libraries
14  cout << "Loading common libraries..." << endl;
15 
16  gROOT->Macro("loadMuDst.C");
17  gROOT->Macro("LoadLogger.C");
18 
19  gSystem->Load("libMinuit");
20  gSystem->Load("StDetectorDbMaker");
21  gSystem->Load("StDbUtilities");
22  gSystem->Load("StDbBroker");
23  gSystem->Load("St_db_Maker");
24  gSystem->Load("StSpinDbMaker");
25 
26  gSystem->Load("libgeometry_Tables"); // BEMC Only
27  gSystem->Load("StDaqLib"); // BEMC Only
28  gSystem->Load("StEmcRawMaker"); // BEMC Only
29  gSystem->Load("StEmcADCtoEMaker"); // BEMC Only
30 
31  gSystem->Load("StEEmcDbMaker"); // EEMC Only
32  gSystem->Load("StEEmcUtil"); // EEMC Only
33  gSystem->Load("StEEmcA2EMaker"); // EEMC Only
34  gSystem->Load("StEEmcClusterMaker"); // EEMC Only
35 
36  gSystem->Load("StMCAsymMaker");
37  gSystem->Load("StJetSkimEvent");
38  gSystem->Load("StGammaMaker");
39 
41  // Start up the chain //
43 
44  StChain *chain = new StChain("chain");
45 
46  StMuDstMaker *muDstMaker = new StMuDstMaker(0, 0, "", inputFile, "", 1e6, "MuDst");
47  muDstMaker->SetStatus("*", 0);
48  muDstMaker->SetStatus("MuEvent", 1);
49  muDstMaker->SetStatus("Event", 1);
50  muDstMaker->SetStatus("PrimaryVertices", 1);
51  muDstMaker->SetStatus("PrimaryTracks", 1);
52  muDstMaker->SetStatus("GlobalTracks", 1);
53  muDstMaker->SetStatus("EmcTow", 1); // BEMC Only
54  muDstMaker->SetStatus("EmcPrs", 1); // BEMC only
55  muDstMaker->SetStatus("EmcSmde", 1); // BEMC Only
56  muDstMaker->SetStatus("EmcSmdp", 1); // BEMC Only
57  muDstMaker->SetStatus("EEmcPrs", 1); // EEMC Only
58  muDstMaker->SetStatus("EEmcSmdu", 1); // EEMC Only
59  muDstMaker->SetStatus("EEmcSmdv", 1); // EEMC Only
60 
61  St_db_Maker *StarDatabase = new St_db_Maker("StarDb", "MySQL:StarDb", "$STAR/StarDb");
62 
63  /*
65  // Filter Undesired Triggers //
67 
68  // Choose your favorite triggers to keep here
69 
70  StTriggerFilterMaker* triggerFilter = new StTriggerFilterMaker();
71  triggerFilter->addTrigger(117001); // minbias
72  triggerFilter->addTrigger(137611); // bemcl2gamma
73  triggerFilter->addTrigger(137641); // eemcl2gamma
74  */
75 
77  // Barrel //
79 
80  // Only necessary if using the BEMC
81 
82  StEmcADCtoEMaker *bemcAdc2E = new StEmcADCtoEMaker(); // this will just convert what's in MuDst to ADC, use for data only!
83  bemcAdc2E->setPrint(false);
84 
86  // Endcap //
88 
90 
91  // Initialize EEMC database
92  StEEmcDbMaker *EEmcDatabase = new StEEmcDbMaker("eemcDb");
93 
94  // ADC to energy
95  StEEmcA2EMaker *EEanalysis = new StEEmcA2EMaker("mEEanalysis");
96  EEanalysis->database("eemcDb"); // sets db connection
97  EEanalysis->source("MuDst", 1); // sets mudst as input
98  EEanalysis->threshold(3.0, 0); // tower threshold (ped+N sigma)
99  EEanalysis->threshold(3.0, 1); // pre1 threshold
100  EEanalysis->threshold(3.0, 2); // pre2 threshold
101  EEanalysis->threshold(3.0, 3); // post threshold
102  EEanalysis->threshold(3.0, 4); // smdu threshold
103  EEanalysis->threshold(3.0, 5); // smdv threshold
104 
106  // GammaMaker //
108 
109  // Possible values for the second argument,
110  // kBemc (Use only the BEMC)
111  // kEemc (Use only the EEMC)
112  // kBoth (Use both detectors)
113 
114  StGammaMaker *gammaMaker = new StGammaMaker("gammaMaker", StGammaMaker::kBoth, StGammaMaker::kData);
115  gammaMaker->setOutputFile(outputFile);
116  gammaMaker->storeEmptyEvents();
117 
118  gammaMaker->setClusterEtThreshold(5.1);
119  gammaMaker->setConeRadius(0.4);
120  gammaMaker->setBsmdRange(0.05237);
121  gammaMaker->setEsmdRange(20.0);
122 
123  gammaMaker->setSeedEnergyThreshold(3.6);
124  gammaMaker->setClusterEnergyThreshold(5.1);
125 
126  gammaMaker->setTrackEtRawThreshold(0.0);
127  gammaMaker->setTowerEtRawThreshold(0.0);
128 
129  gammaMaker->setEemcTowerClusterThreshold(0.1);
130 
132  // Start up the chain //
134 
135  chain->Init();
136  chain->ls(3);
137 
138  int ntotal = 50;
139  //int ntotal = 1e6;
140 
141  Int_t stat = 0;
142  Int_t total = 0;
143  for(int iev = 0; iev < ntotal; ++iev)
144  {
145 
146  cout << "********** Processing Event: " << iev << " **********" << endl;
147 
148  chain->Clear();
149  stat = chain->Make();
150 
151  if(stat && stat != kStSKIP)
152  {
153  cout << "Bad return code!" << endl;
154  break;
155  }
156 
157  ++total;
158 
159  }
160 
161  chain->Finish();
162 
163  cout << "****************************************** " << endl;
164  cout << total << " Total Events" << endl;
165  cout << "****************************************** " << endl;
166 
167 }
168 
EEmc ADC –&gt; energy maker.
Definition: Stypes.h:48
void setPrint(Bool_t)
Obsolete function; users can control messages with logger config file.
void source(const Char_t *, Int_t=0)
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
virtual Int_t Finish()
Definition: StChain.cxx:85
void threshold(Float_t cut, Int_t layer)
virtual void ls(Option_t *option="") const
Definition: TDataSet.cxx:495
virtual Int_t Make()
Definition: StChain.cxx:110
void SetStatus(const char *arrType, int status)
void database(const Char_t *)
Set the name of the EEMC database, init obtains pointer.