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