14 #ifndef StEStructAnalysisMaker_HH
15 #define StEStructAnalysisMaker_HH
22 #include "StEStructEventReader.h"
23 #include "StEStructAnalysis.h"
24 #include "StEStructCuts.h"
26 #include "StEStructQAHists.h"
28 #include "StMuDSTMaker/COMMON/StMuTimer.h"
40 void Clear(Option_t *option=
"");
51 bool quickSort(
int *arr,
int elements);
52 bool quickSort(
double *arr,
int elements);
53 void SetSorting(
bool sort);
54 int GetSortedIndex(
int i);
55 int getAnalysisIndex();
56 void writeQAHists(
const char* fileName);
58 void writeDiagnostics(
int opt=0);
59 void toggleMemoryInfo();
60 int getNumberOfEventsLooped();
61 int getNumberOfEventsProcessed();
67 void logAllStats(ostream& os);
68 void logCutStats(
StEStructCuts* cuts, ostream& os,
int index);
70 void logAnalysisTime(ostream& os);
71 void logInputEvents(ostream& os);
72 void logOutputEvents(ostream& os);
73 void logOutputRate(ostream& os);
74 void logAnalysisStats(ostream& os);
76 void SetReactionPlaneAnalysis(
char* weightFile);
83 virtual const char *GetCVS()
const
84 {
static const char cvs[]=
"$Id: StEStructAnalysisMaker.h,v 1.10 2015/08/29 03:23:47 perev Exp $ built " __DATE__
" " __TIME__ ;
return cvs;}
90 Bool_t doPrintMemoryInfo;
92 UInt_t mEventLoopCounter;
93 UInt_t mEventProcessedCounter;
94 int* mEventProcessedPerType;
96 Bool_t doReactionPlaneAnalysis;
117 inline StMuTimer* StEStructAnalysisMaker::getTimer(){
return mtimer; };
121 SetEventReader(reader);
122 SetAnalysis(analysis);
130 manalysis[numAnalysis]=analysis; numAnalysis++;
133 inline void StEStructAnalysisMaker::SetAnalyses(
StEStructAnalysis ** analyses,
int n){
134 for(
int i=0;i<n;i++) {
135 manalysis[i]=analyses[i];
136 manalysis[i]->setEventReader(mreader);
143 if(mQAHists)
delete mQAHists;
147 inline void StEStructAnalysisMaker::SetSorting(
bool sort){
151 inline void StEStructAnalysisMaker::toggleMemoryInfo(){
152 if(doPrintMemoryInfo){
153 doPrintMemoryInfo=
false;
156 doPrintMemoryInfo=
true;
160 inline int StEStructAnalysisMaker::getNumberOfEventsLooped(){
return mEventLoopCounter; }
161 inline int StEStructAnalysisMaker::getNumberOfEventsProcessed(){
return mEventProcessedCounter; }
163 inline void StEStructAnalysisMaker::logCutStats(
StEStructCuts* cuts, ostream& os,
int index){
164 cuts->printCuts(os,index);
169 inline void StEStructAnalysisMaker::logAllStats(ostream& os){
174 logAnalysisStats(os);
177 inline void StEStructAnalysisMaker::logAnalysisTime(ostream& os){
179 os<<
"<processStat \"analysisTime\">"<<mtimer->elapsedTime();
180 os<<
"</processStat>"<<endl;
183 inline void StEStructAnalysisMaker::logInputEvents(ostream& os){
184 os<<
"<processStat \"inputEvents\">"<<mEventLoopCounter;
185 os<<
"</processStat>"<<endl;
188 inline void StEStructAnalysisMaker::logOutputEvents(ostream& os){
189 os<<
"<processStat \"outputEvents\">"<<mEventProcessedCounter;
190 os<<
"</processStat>"<<endl;
193 inline void StEStructAnalysisMaker::logOutputRate(ostream& os){
194 if(!mtimer || mtimer->elapsedTime()<0.01)
return;
196 os<<
"<processStat \"outputRate\">"<<mEventProcessedCounter/mtimer->elapsedTime();
197 os<<
"</processStat>"<<endl;
200 inline void StEStructAnalysisMaker::logAnalysisStats(ostream& os){
201 for(
int i=0;i<numAnalysis;i++) manalysis[i]->logStats(os);
void Clear(Option_t *option="")
User defined functions.