StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
runFgtLHTracking_MuDst.C
1 /*
2  * Author: S. Gliske (sgliske@anl.gov), March 2012
3  *
4  * Macro to run the simple text based occupancy QA maker and FGT
5  * Helix-Hough tracking with input files in MuDSt format.
6  *
7  */
8 
9 // forward declarations
10 class StChain;
11 class StMuDstMaker;
12 class St_db_Maker;
13 class StEEmcDbMaker;
14 class StEEmcRawMapMaker;
15 class StFgtLHTracking;
16 class StEEmcFgtLHTrackQa;
17 
18 // global variables
19 StChain *analysisChain = 0;
20 StMuDstMaker *muDstMaker = 0;
21 St_db_Maker *starDatabase = 0;
22 StEEmcDbMaker *eemcDbMaker = 0;
23 StEEmcRawMapMaker *rawMapMkr = 0;
24 StFgtLHTracking *fgtTrkMkr = 0;
25 StEEmcFgtLHTrackQa *fgtTrkQa = 0;
26 
27 void runFgtLHTracking_MuDst( const Char_t *filenameIn,
28  const Char_t *filenameOut,
29  Int_t neventsIn = 10 ){
30 
31  // load the shared libraries
32  std::cout << "***** Loading libraries *****" << endl;
33  LoadLibs();
34 
35  std::cout << "***** Done loading libraries *****" << endl;
36  std::cout << "***** Instanciating all the classes *****" << endl;
37 
38  //
39  // Create the analysis chain
40  //
41  analysisChain = new StChain("fgtTrackingChain");
42 
43  //
44  // MuDst maker for reading input
45  //
46  Int_t nfiles = 10000;
47  muDstMaker = new StMuDstMaker( 0, 0, "", filenameIn, "MuDst", nfiles );
48  muDstMaker->SetStatus("*",0);
49  muDstMaker->SetStatus("Event",1);
50  muDstMaker->SetStatus("MuEvent",1);
51  muDstMaker->SetStatus("PrimaryVertices",1);
52  muDstMaker->SetStatus("FgtStrip",1);
53  muDstMaker->SetStatus("FgtCluster",1);
54  muDstMaker->SetStatus("EmcAll",1);
55 
56  //
57  // Connect to the STAR databse
58  //
59  starDatabase = new St_db_Maker("StarDb", "MySQL:StarDb");
60 
61  //
62  // EEMC raw map maker
63  //
64  eemcDbMaker = new StEEmcDbMaker( "EEmcDbMkr" );
65  rawMapMkr = new StEEmcRawMapMaker( "EEmcRawMapMaker" );
66  rawMapMkr->setInput("MuDst",1); // sets mudst as input
67 
68  //
69  // the track maker
70  //
71  fgtTrkMkr = new StFgtLHTracking( "fgtTrkMkr" );
72  fgtTrkMkr->setFitThres( 1 ); // cm
73  fgtTrkMkr->setIncludeThres( 1 ); // cm
74  fgtTrkMkr->setNumPoints( 3 ); // cm
75  fgtTrkMkr->setNumAgreeThres( 1 ); // cm
76  fgtTrkMkr->setUseVertex(1);
77 
78  //
79  // QA Makers
80  //
81  fgtTrkQa = new StEEmcFgtLHTrackQa( "EEmcFgtLHTrackQa", "EEmcRawMapMaker", "fgtTrkMkr" );
82  fgtTrkQa->setFileOutName( filenameOut );
83 
84  // debugging info
85  std::cout << "***** Done instanciating all the classes *****" << endl;
86  //analysisChain->ls(3);
87 
88  //
89  // Initialize all makers
90  //
91  std::cout << "***** Initializing all makers in the analysis chain *****" << std::endl;
92 
93  analysisChain->Init();
94 
95  std::cout << "***** Initialization done *****" << std::endl;
96 
97  //
98  // Finally ready to loop over the events
99  //
100 
101  // If nEvents is negative, reset to the maximum possible value
102  // for an Int_t
103  if( neventsIn < 0 )
104  neventsIn = 1<<31-1;
105 
106  Int_t ierr = kStOK; // err flag
107  Int_t nevents = 0; // cumulative number of events in
108  for( ; nevents < neventsIn && !ierr; ++nevents ){
109  // clear
110  analysisChain->Clear();
111 
112  // make
113  ierr = analysisChain->Make();
114  };
115 
116  //---------------------------------------------------------------
117 
118  //
119  // Calls the ::Finish() method on all makers
120  //
121  analysisChain->Finish();
122 
123  //
124  // Delete the chain
125  //
126  analysisChain->Delete();
127 
128  return;
129 };
130 
131 
132 
133 // load the shared libraries
134 void LoadLibs() {
135  // commong shared libraries
136  gROOT->Macro("loadMuDst.C");
137 
138  // and a few others
139  gSystem->Load("StDbLib");
140  gSystem->Load("StDbBroker");
141  gSystem->Load("St_db_Maker");
142 
143  gSystem->Load("StFgtUtil");
144  gSystem->Load("StMuFgtQa");
145  gSystem->Load("StFgtTracking");
146  gSystem->Load("StEEmcDbMaker");
147  gSystem->Load("StEEmcUtil");
148  gSystem->Load("StEEmcFgt");
149 
150 };
151 
152 /*
153  * $Id: runFgtLHTracking_MuDst.C,v 1.3 2012/04/13 15:08:58 sgliske Exp $
154  * $Log: runFgtLHTracking_MuDst.C,v $
155  * Revision 1.3 2012/04/13 15:08:58 sgliske
156  * updates
157  *
158  * Revision 1.2 2012/04/11 22:13:30 sgliske
159  * update
160  *
161  * Revision 1.1 2012/04/09 16:14:23 sgliske
162  * creation
163  *
164  *
165  */
virtual void Delete(Option_t *opt="")
Definition: TDataSet.cxx:320
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
virtual Int_t Finish()
Definition: StChain.cxx:85
virtual Int_t Make()
Definition: StChain.cxx:110
Definition: Stypes.h:40
void SetStatus(const char *arrType, int status)