StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
runFgtLHHTracking_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 StMuFgtOccTxtMkr;
13 class StFgtLHHTracking;
14 
15 // global variables
16 StChain *analysisChain = 0;
17 StMuDstMaker *muDstMaker = 0;
18 StMuFgtOccTxtMkr *occTxtMkr = 0;
19 StFgtLHHTracking *fgtTrkMkr = 0;
20 
21 void runFgtLHHTracking_MuDst( const Char_t *filename,
22  Int_t neventsIn = 10 ){
23 
24  // load the shared libraries
25  std::cout << "***** Loading libraries *****" << endl;
26  LoadLibs();
27 
28  std::cout << "***** Done loading libraries *****" << endl;
29  std::cout << "***** Instanciating all the classes *****" << endl;
30 
31  //
32  // Create the analysis chain
33  //
34  analysisChain = new StChain("fgtTrackingChain");
35 
36  //
37  // MuDst maker for reading input
38  //
39  Int_t nfiles = 10000;
40  muDstMaker = new StMuDstMaker( 0, 0, "", filename, "MuDst", nfiles );
41  muDstMaker->SetStatus("*",0);
42  muDstMaker->SetStatus("Event",1);
43  muDstMaker->SetStatus("MuEvent",1);
44  muDstMaker->SetStatus("PrimaryVertices",1);
45  muDstMaker->SetStatus("FgtStrip",1);
46  muDstMaker->SetStatus("FgtCluster",1);
47 
48  //
49  // now the QA maker
50  //
51  // occTxtMkr = new StMuFgtOccTxtMkr( "fgtOccTxtMkr" );
52 
53  //
54  // the track maker
55  //
56  fgtTrkMkr = new StFgtLHHTracking( "fgtTrkMkr" );
57 
58 
59  // debugging info
60  std::cout << "***** Done instanciating all the classes *****" << endl;
61  analysisChain->ls(3);
62 
63  //
64  // Initialize all makers
65  //
66  std::cout << "***** Initializing all makers in the analysis chain *****" << std::endl;
67 
68  analysisChain->Init();
69 
70  std::cout << "***** Initialization done *****" << std::endl;
71 
72  //
73  // Finally ready to loop over the events
74  //
75 
76  // If nEvents is negative, reset to the maximum possible value
77  // for an Int_t
78  if( neventsIn < 0 )
79  neventsIn = 1<<31-1;
80 
81  Int_t ierr = kStOK; // err flag
82  Int_t nevents = 0; // cumulative number of events in
83  for( ; nevents < neventsIn && !ierr; ++nevents ){
84  // clear
85  analysisChain->Clear();
86 
87  // make
88  ierr = analysisChain->Make();
89  };
90 
91  //---------------------------------------------------------------
92 
93 
94  //
95  // Calls the ::Finish() method on all makers
96  //
97  analysisChain->Finish();
98 
99  //
100  // Delete the chain
101  //
102  analysisChain->Delete();
103 
104  return;
105 };
106 
107 
108 
109 // load the shared libraries
110 void LoadLibs() {
111  // commong shared libraries
112  gROOT->Macro("loadMuDst.C");
113  //gROOT->Macro("LoadLogger.C");
114 
115  // and a few others
116 // gSystem->Load("StDbLib");
117 // gSystem->Load("StDbBroker");
118 // gSystem->Load("St_db_Maker");
119 // gSystem->Load("StStarLogger");
120 
121  gSystem->Load("StFgtUtil");
122  gSystem->Load("StMuFgtQa");
123  gSystem->Load("StFgtTracking");
124 };
125 
126 /*
127  * $Id: runFgtLHHTracking_MuDst.C,v 1.1 2012/04/09 16:14:23 sgliske Exp $
128  * $Log: runFgtLHHTracking_MuDst.C,v $
129  * Revision 1.1 2012/04/09 16:14:23 sgliske
130  * creation
131  *
132  *
133  */
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 void ls(Option_t *option="") const
Definition: TDataSet.cxx:495
virtual Int_t Make()
Definition: StChain.cxx:110
Definition: Stypes.h:40
void SetStatus(const char *arrType, int status)