StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
runMuDstAVEff.C
1 
2 // forward declarations
3 class StChain;
4 class StMuDstMaker;
5 class StMuFgtOccTxtMkr;
6 class StFgtGenPlotter;
7 class StFgtGenAVEMaker;
8 class StFgtGeneralBase;
11 class StFgtDbMaker;
12 
13 // global variables
14 StChain *analysisChain = 0;
15 StMuDstMaker *muDstMaker = 0;
16 StFgtGenPlotter *fgtGenPlotter = 0;
17 StFgtGenAVEMaker *fgtAVEffMkr = 0;
18 StFgtGeneralBase * fgtGenBase =0;
19 StFgtStraightTrackMaker* fgtStraightTrackMaker2;
20 StFgtStraightPlotter* fgtStraightPlotter2;
21 StFgtStraightTrackMaker* fgtStraightTrackMaker3;
22 StFgtStraightPlotter* fgtStraightPlotter3;
23 StFgtStraightTrackMaker* fgtStraightTrackMaker4;
24 StFgtStraightPlotter* fgtStraightPlotter4;
25 StFgtDbMaker *fgtDbMkr=0;
26 
27 void runMuDstAVEff( const Char_t *filename, const Char_t* baseFilename=".",
28  Int_t neventsIn = 400 ){
29  cout <<" looking at file: " << filename << endl;
30  // load the shared libraries
31  std::cout << "***** Loading libraries *****" << endl;
32  LoadLibs();
33 
34  std::cout << "***** Done loading libraries *****" << endl;
35  std::cout << "***** Instanciating all the classes *****" << endl;
36 
37  //
38  // Create the analysis chain
39  //
40  analysisChain = new StChain("fgtTrackingChain");
41  cout << "Loading St_db_Maker" << endl;
42  gSystem->Load("libStDb_Tables.so");
43  gSystem->Load("StDbLib.so");
44  gSystem->Load("St_db_Maker");
45  gSystem->Load("StDbBroker");
46 
47  TString dir0 = "MySQL:StarDb";
48  TString dir1 = "$STAR/StarDb";
49  //db maker should not be needed...
50  St_db_Maker *dbMkr = new St_db_Maker( "dbMkr", dir0, dir1 );
51  dbMkr->SetDateTime(20120622,152618);
52 
53  //for 13063034
54  // dbMkr->SetDateTime(20120303,130411); ///D
55  // dbMkr->SetDateTime(20120128,204320); // run ???
56 
57  cout << "Constructing StFgtDbMaker" << endl;
58  fgtDbMkr = new StFgtDbMaker( "fgtDb" );
59  //fgtDbMkr->SetFlavor("ideal",""); // mapping is wrong, but at least the code runs...
60  fgtDbMkrName = fgtDbMkr->GetName();
61  //
62  // MuDst maker for reading input
63  //
64  Int_t nfiles = 10000;
65  muDstMaker = new StMuDstMaker( 0, 0, "", filename, "MuDst", nfiles );
66  muDstMaker->SetStatus("*",0);
67  muDstMaker->SetStatus("Event",1);
68  muDstMaker->SetStatus("MuEvent",1);
69  muDstMaker->SetStatus("PrimaryVertices",1);
70  muDstMaker->SetStatus("FgtStrip",1);
71  muDstMaker->SetStatus("FgtCluster",1);
72  muDstMaker->SetStatus("FgtStripAssociation",1);
73  muDstMaker->SetStatus("FgtAdc",1);
74 
75  //
76  // now the QA maker
77  //
78  // occTxtMkr = new StMuFgtOccTxtMkr( "fgtOccTxtMkr" );
79 
80  //
81  // the track maker
82  //
83  // fgtTrkMkr = new StFgtHHTracking( "fgtTrkMkr" );
84  cout <<"construction genplotter " <<endl;
85  //fgtGenPlotter = new StFgtGenPlotter( "fgtGenPlotter" );
86  // fgtAVEffMkr = new StFgtGenAVEMaker( "avEffMkr" );
87  fgtGenBase=new StFgtGeneralBase("fgtGenBase");
88  // fgtGenBase->setVertexNumber(1); //<--- this selects second best vertex
89  fgtGenBase->useEHTTrig(true);
90  fgtStraightTrackMaker2 =new StFgtStraightTrackMaker("fgtStraightTracker2");
91  fgtStraightTrackMaker3 =new StFgtStraightTrackMaker("fgtStraightTracker3");
92  fgtStraightTrackMaker4 =new StFgtStraightTrackMaker("fgtStraightTracker4");
93  fgtStraightTrackMaker2->SetEffDisk(20);
94  fgtStraightTrackMaker3->SetEffDisk(20);
95  fgtStraightTrackMaker4->SetEffDisk(20);
96  fgtStraightTrackMaker2->setMinNumFitPoints(2);
97  fgtStraightTrackMaker3->setMinNumFitPoints(3);
98  fgtStraightTrackMaker4->setMinNumFitPoints(4);
99  fgtStraightTrackMaker2->setMaxClusters(30);
100  fgtStraightTrackMaker3->setMaxClusters(30);
101  fgtStraightTrackMaker4->setMaxClusters(30);
102  fgtStraightPlotter2=new StFgtStraightPlotter("fgtStraightPlotterNew2","fgtStraightTracker2");
103  fgtStraightPlotter3=new StFgtStraightPlotter("fgtStraightPlotter3","fgtStraightTracker3");
104  fgtStraightPlotter4=new StFgtStraightPlotter("fgtStraightPlotter4","fgtStraightTracker4");
105  fgtStraightPlotter2->SetFileBase(".","2PointTrack");
106  fgtStraightPlotter3->SetFileBase(".","3PointTrack");
107  fgtStraightPlotter4->SetFileBase(".","4PointTrack");
108 
109  // fgtAVEffMkr->SetFileBase(baseFilename);
110 
111  // debugging info
112  std::cout << "***** Done instanciating all the classes *****" << endl;
113  analysisChain->ls(3);
114 
115  //
116  // Initialize all makers
117  //
118  std::cout << "***** Initializing all makers in the analysis chain *****" << std::endl;
119  analysisChain->Init();
120  std::cout << "***** Initialization done *****" << std::endl;
121  //
122  // Finally ready to loop over the events
123  //
124 
125  // If nEvents is negative, reset to the maximum possible value
126  // for an Int_t
127  if( neventsIn < 0 )
128  neventsIn = 1<<31-1;
129 
130  Int_t ierr = kStOK; // err flag
131  Int_t nevents = 0; // cumulative number of events in
132  for( ; nevents < neventsIn && !ierr; ++nevents ){
133  if(nevents%100)
134  cout <<"event: "<< nevents <<endl;
135  analysisChain->Clear();
136  // cout <<"making ... " << endl;
137  // make
138  ierr = analysisChain->Make();
139  };
140 
141  //---------------------------------------------------------------
142  //
143  // Calls the ::Finish() method on all makers
144  //
145  analysisChain->Finish();
146 
147  //
148  // Delete the chain
149  //
150  analysisChain->Delete();
151 
152  return;
153 };
154 
155 
156 
157 // load the shared libraries
158 void LoadLibs() {
159  // commong shared libraries
160  gROOT->Macro("loadMuDst.C");
161  //gROOT->Macro("LoadLogger.C");
162 
163  // and a few others
164 // gSystem->Load("StDbLib");
165 // gSystem->Load("StDbBroker");
166 // gSystem->Load("St_db_Maker");
167 // gSystem->Load("StStarLogger");
168  gSystem->Load("StFgtDbMaker");
169 // gSystem->Load("StFgtPedPlotter");
170 // gSystem->Load("StFgtPedMaker");
171 // gSystem->Load("StFgtQaMakers");
172  gSystem->Load("StFgtUtil");
173  gSystem->Load("StFgtClusterTools");
174  // gSystem->Load("StMuFgtQa");
175  // gSystem->Load("StFgtTracking");
176 };
177 
178 /*
179 $Id: runMuDstAVEff.C,v 1.14 2013/05/10 18:20:09 avossen Exp $
180 $Log: runMuDstAVEff.C,v $
181 Revision 1.14 2013/05/10 18:20:09 avossen
182 implemented cuts on dca in straight tracker
183 
184 Revision 1.13 2013/05/01 16:49:33 avossen
185 updated code and macros so that several trackers and plotters can run at the same time with different settings such as min points. Added option to use other primary vertices
186 
187 Revision 1.12 2013/03/02 03:11:24 avossen
188 *** empty log message ***
189 
190 Revision 1.11 2013/01/29 21:58:25 avossen
191 new/old efficiency computation now consistent
192 
193 Revision 1.10 2013/01/23 22:52:17 avossen
194 fixed uninitialized bufffer for filename
195 
196 Revision 1.9 2013/01/23 20:36:41 avossen
197 less printouts, no crash
198 
199 Revision 1.8 2013/01/20 02:06:37 avossen
200 changed defines in attributes
201 
202 Revision 1.7 2013/01/18 15:47:15 avossen
203 update for new mdsts
204 
205 Revision 1.6 2012/12/22 04:13:33 avossen
206 *** empty log message ***
207 
208 Revision 1.5 2012/12/22 02:19:15 avossen
209 some bugfixes
210 
211 Revision 1.4 2012/10/24 14:28:57 avossen
212 adapted macro to new mDst structure
213 
214 Revision 1.3 2012/05/30 13:38:35 avossen
215 *** empty log message ***
216 
217 Revision 1.2 2012/05/25 00:36:11 avossen
218 made fit for stevent reading
219 
220 Revision 1.1 2012/04/16 19:50:04 avossen
221 added cluster tools macro
222 
223  *
224  */
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
virtual const char * GetName() const
special overload
Definition: StMaker.cxx:237
Definition: Stypes.h:40
void SetStatus(const char *arrType, int status)