StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
support.C
1 /************************************************************************
2  * $Id: support.C,v 1.2 2004/06/26 16:28:42 porter Exp $
3  *
4  * Author: Jeff Porter
5  *
6  * Many of the macros have common features which when they change
7  * they typically change for all. So I put them here in one place
8  * and call from the main macro
9  *
10  *************************************************************************/
11 
12 //----------------------------------------------------------------
13 char** getDirNames(const char* type, int nset){
14 
15  char** retVal=new char*[nset];
16 
17  for(int i=0;i<nset;i++){
18  TString ndir(type);
19  ndir+="/0";
20  ndir+=(i+1);
21  retVal[i]=new char[strlen(ndir.Data())+1];
22  strcpy(retVal[i],ndir.Data());
23  };
24 
25  return retVal;
26 }
27 
28 
29 //------------------- helper macro for numTracks cut -----
30 char** getNumTracksStrings(int min, int max){
31 
32  TString nchMin;
33  nchMin+=min;
34  TString nchMax;
35  nchMax+=max;
36  char** retVal=new char*[2];
37  retVal[0]=new char[strlen(nchMin.Data())+1];
38  strcpy(retVal[0],nchMin.Data());
39  retVal[1]=new char[strlen(nchMax.Data())+1];
40  strcpy(retVal[1],nchMax.Data());
41 
42  return retVal;
43 }
44 
45 //-------------------------------------------------------------------
46 
47 void doTheWork(StEStructAnalysisMaker* estructMaker, int maxNumEvents){
48 
49  int istat=0,i=1;
50  estructMaker->Init();
51  estructMaker->startTimer();
52 
53  int counter=0;
54  while(istat!=2){
55 
56  istat=estructMaker->Make();
57  i++; counter++;
58  if(counter==200){
59  cout<<"doing event ="<<i<<endl;
60  counter=0;
61  }
62  if( maxNumEvents!=0 && i>=maxNumEvents )istat=2;
63  }
64  estructMaker->stopTimer();
65 
66 
67 }
68 
69 
70 /**********************************************************************
71  *
72  * $Log: support.C,v $
73  * Revision 1.2 2004/06/26 16:28:42 porter
74  * fixed typo in getDirNames.C
75  *
76  * Revision 1.1 2004/06/25 03:14:56 porter
77  * modified basic macro to take only 1 cutfile and moved some common
78  * features into a new macro=support.C..... this cleaned up the
79  * doEStruct macro somewhat
80  *
81  *
82  **********************************************************************/