HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
harpoanalysis.cxx
Go to the documentation of this file.
1 //
2 // Analysis program holding all the available analyses
3 // activate/deactivate in the config file
4 //
5 
6 #include <stdlib.h>
7 #include <stdio.h>
8 #include <iostream>
9 
10 #include "HarpoConfig.h"
11 #include "HarpoReader.h"
12 #include "HarpoReaderRoot.h"
13 #include "HarpoRunHeader.h"
14 #include "HarpoAnalyseVertex.h"
16 #include "HarpoAnalyseRates.h"
17 #include "HarpoAnalyseXtalk.h"
18 #include "HarpoAnalyseVdrift.h"
19 #include "HarpoAnalyseMatching.h"
20 #include "HarpoEventSelector.h"
21 #include "HarpoSelectCosmics.h"
22 #include "HarpoExcludeBadEvents.h"
23 #include "HarpoAnalyseTrackPairs.h"
25 #include "HarpoVertexing.h"
27 #include "HarpoSelectorPileUp.h"
28 #include "HarpoClusteringBlocs.h"
29 #include "HarpoAnalyseBertrand.h"
30 #include "HarpoAnalyseVertex3D.h"
32 #include "HarpoMatchingVertex.h"
33 #include "HarpoSelectorVertex.h"
34 #include "HarpoAnalyseEtrack.h"
35 #include "HarpoAnalysePattern.h"
36 #include "HarpoAnalyseTemplate.h"
37 #include "HarpoAnalyseGainStudy.h"
38 #include "HarpoAnalysePrf.h"
40 #include "HarpoAnalyseBasic.h"
41 #include "HarpoAnalyseRunNoZS.h"
42 #include "HarpoAnalyseResolution.h"
43 #include "HarpoAnalyseWriter.h"
45 #include "HarpoClustering.h"
46 #include "HarpoHoughTracking.h"
47 #include "HarpoTrackingPh.h"
48 #include "HarpoKalmanTracking.h"
49 #include "HarpoKalmanFitting.h"
50 #include "HarpoKalmanNew.h"
51 #include "HarpoMatching.h"
53 #include "HarpoAnalyseMonitorNew.h"
54 
55 int main(int argc, char **argv)
56 {
57  Long_t processed = -1; // Processed events counter , negative on error
58 
59  HarpoRunHeader *hdr;
60  //HarpoEvent *hevent;
62 
63  HarpoConfig *cfg = new HarpoConfig(argc,argv,0x17);
64  cfg->Init();
65 
66  cfg->print();
67 
68  HarpoReader *rdr = new HarpoReader( cfg );
69  // HarpoReaderRoot *rdr = new HarpoReaderRoot( cfg );
70  // rdr->SetRootFile(new TString("test.root"));
71  // hNoCMPTime, // Read without timeshump comparision
72  // hFirstTime, // return only plane which smaller time stamp
73  // hSyncTime // skip plane event with smaller timeshatp, return only
74 
75  // if ( rdr->Init() ) {
76  // if ( rdr->Init(hNoCMPTime) ) {
77  //if ( rdr->Init(hFirstTime) ) {
78  if ( rdr->Init(hSyncTime) ) {
79  hdr = rdr->GetRunHeader();
80  hdr->print();
81  }
82  else
83  {
84  printf ("Int ERROR exiting ...\n");
85  return 1;
86  }
87 
88  printf ("Initialized\n");
89 
90 
91  // TString* analyses = new TString();
92  TString* analyses = gHConfig->GetAnalyses();
93  // cfg->Lookup("Analyses",analyses);
94  if(analyses == NULL) return 0;
95  std::cout << analyses->Data() << std::endl;
96  TObjArray* list = analyses->Tokenize(" ");
97  std::cout << list->GetEntries() << std::endl;
98  HarpoAnalyse* hana[30];
99  Int_t i = 0;
100  for(Int_t k = 0; k<list->GetEntries(); k++){
101  TString str = ((TObjString*)(list->At(k)))->String();
102  if(str=="HarpoAnalyseVertex"){
103  hana[i] = new HarpoAnalyseVertex();
104  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
105  i++;
106  continue;
107  }
108  if(str=="HarpoAnalysePedestalShift"){
109  hana[i] = new HarpoAnalysePedestalShift();
110  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
111  i++;
112  continue;
113  }
114  if(str=="HarpoAnalyseRates"){
115  hana[i] = new HarpoAnalyseRates();
116  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
117  i++;
118  continue;
119  }
120  if(str=="HarpoAnalyseXtalk"){
121  hana[i] = new HarpoAnalyseXtalk();
122  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
123  i++;
124  continue;
125  }
126  if(str=="HarpoAnalyseVdrift"){
127  hana[i] = new HarpoAnalyseVdrift();
128  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
129  i++;
130  continue;
131  }
132  if(str=="HarpoAnalyseMatching"){
133  hana[i] = new HarpoAnalyseMatching();
134  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
135  i++;
136  continue;
137  }
138  if(str=="HarpoEventSelector"){
139  hana[i] = new HarpoEventSelector();
140  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
141  i++;
142  continue;
143  }
144  if(str=="HarpoSelectCosmics"){
145  hana[i] = new HarpoSelectCosmics();
146  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
147  i++;
148  continue;
149  }
150  if(str=="HarpoExcludeBadEvents"){
151  hana[i] = new HarpoExcludeBadEvents();
152  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
153  i++;
154  continue;
155  }
156  if(str=="HarpoAnalyseTrackPairs"){
157  hana[i] = new HarpoAnalyseTrackPairs();
158  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
159  i++;
160  continue;
161  }
162  if(str=="HarpoSelectorStraightTracks"){
163  hana[i] = new HarpoSelectorStraightTracks();
164  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
165  i++;
166  continue;
167  }
168  if(str=="HarpoVertexing"){
169  hana[i] = new HarpoVertexing();
170  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
171  i++;
172  continue;
173  }
174  if(str=="HarpoAnalyseMultiplicityAget"){
175  hana[i] = new HarpoAnalyseMultiplicityAget();
176  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
177  i++;
178  continue;
179  }
180  if(str=="HarpoSelectorPileUp"){
181  hana[i] = new HarpoSelectorPileUp();
182  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
183  i++;
184  continue;
185  }
186  if(str=="HarpoClusteringBlocs"){
187  hana[i] = new HarpoClusteringBlocs();
188  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
189  i++;
190  continue;
191  }
192  if(str=="HarpoAnalyseBertrand"){
193  hana[i] = new HarpoAnalyseBertrand();
194  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
195  i++;
196  continue;
197  }
198  if(str=="HarpoAnalyseVertex3D"){
199  hana[i] = new HarpoAnalyseVertex3D();
200  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
201  i++;
202  continue;
203  }
204  if(str=="HarpoAnalyseVertex3Dsim"){
205  hana[i] = new HarpoAnalyseVertex3Dsim();
206  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
207  i++;
208  continue;
209  }
210  if(str=="HarpoMatchingVertex"){
211  hana[i] = new HarpoMatchingVertex();
212  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
213  i++;
214  continue;
215  }
216  if(str=="HarpoSelectorVertex"){
217  hana[i] = new HarpoSelectorVertex();
218  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
219  i++;
220  continue;
221  }
222  if(str=="HarpoAnalyseEtrack"){
223  hana[i] = new HarpoAnalyseEtrack();
224  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
225  i++;
226  continue;
227  }
228  if(str=="HarpoAnalysePattern"){
229  hana[i] = new HarpoAnalysePattern();
230  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
231  i++;
232  continue;
233  }
234  if(str=="HarpoAnalyseTemplate"){
235  hana[i] = new HarpoAnalyseTemplate();
236  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
237  i++;
238  continue;
239  }
240  if(str=="HarpoAnalyseResolution"){
241  hana[i] = new HarpoAnalyseResolution();
242  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
243  i++;
244  continue;
245  }
246  if(str=="HarpoAnalyseNoiseSuppression"){
247  hana[i] = new HarpoAnalyseNoiseSuppression();
248  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
249  i++;
250  continue;
251  }
252  if(str=="HarpoClustering"){
253  hana[i] = new HarpoClustering();
254  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
255  i++;
256  continue;
257  }
258  if(str=="HarpoHoughTracking"){
259  hana[i] = new HarpoHoughTracking();
260  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
261  i++;
262  continue;
263  }
264  if(str=="HarpoTrackingPh"){
265  hana[i] = new HarpoTrackingPh();
266  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
267  i++;
268  continue;
269  }
270  if(str=="HarpoKalmanTracking"){
271  hana[i] = new HarpoKalmanTracking();
272  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
273  i++;
274  continue;
275  }
276  if(str=="HarpoKalmanNew"){
277  hana[i] = new HarpoKalmanNew();
278  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
279  i++;
280  continue;
281  }
282  if(str=="HarpoKalmanFitting"){
283  hana[i] = new HarpoKalmanFitting();
284  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
285  i++;
286  continue;
287  }
288  if(str=="HarpoMatching"){
289  hana[i] = new HarpoMatching();
290  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
291  i++;
292  continue;
293  }
294  if(str=="HarpoAnalyseGainStudy"){
295  hana[i] = new HarpoAnalyseGainStudy();
296  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
297  i++;
298  continue;
299  }
300  if(str=="HarpoAnalysePrf"){
301  hana[i] = new HarpoAnalysePrf();
302  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
303  i++;
304  continue;
305  }
306  if(str=="HarpoAnalyseBaselineFluct"){
307  hana[i] = new HarpoAnalyseBaselineFluct();
308  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
309  i++;
310  continue;
311  }
312  if(str=="HarpoAnalyseBasic"){
313  hana[i] = new HarpoAnalyseBasic();
314  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
315  i++;
316  continue;
317  }
318  if(str=="HarpoAnalyseRunNoZS"){
319  hana[i] = new HarpoAnalyseRunNoZS();
320  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
321  i++;
322  continue;
323  }
324  if(str=="HarpoAnalyseWriter"){
325  hana[i] = new HarpoAnalyseWriter();
326  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
327  i++;
328  continue;
329  }
330  if(str=="HarpoAnalyseTriggerTime"){
331  hana[i] = new HarpoAnalyseTriggerTime();
332  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
333  i++;
334  continue;
335  }
336  if(str=="HarpoAnalyseMonitorNew"){
337  hana[i] = new HarpoAnalyseMonitorNew();
338  std::cout << "Adding " << str.Data() << " " << i << " " << hana[i] << std::endl;
339  i++;
340  continue;
341  }
342 
343  std::cout << "Unknown analysis " << str.Data() << std::endl;
344  }
345 
346  if(i == 0){
347  std::cout << "No valid analysis" << std::endl;
348  return 0;
349  } else
350  std::cout << "** N of analysis = " << i << std::endl;
351  // return 0;
352 
353  for(Int_t k =0; k<i; k++){
354  hana[k]->Init();
355  rdr->AddAnalyseFunction(hana[k]);
356  }
357 
358  HarpoRunConfig * rcfg = hdr->GetRunConfig();
359  if (rcfg != NULL ) rcfg->print();
360 
361  processed = rdr->LoopAll();
362 
363  for(Int_t k = i-1; k>=0; k--){
364  hana[k]->Save();
365  }
367 
368  delete rdr;
369  delete cfg;
370  for(Int_t k = i-1; k>=0; k--)
371  delete hana[k];
372  printf("\n Done processed Events %li\n",processed);
373  return 0;
374 }
375 
376 
377 
Dummy analysis to run as test and example. Give basic histograms of the data.
virtual void Init()
Definition: HarpoAnalyse.h:56
Dummy analysis to run as test and example. Give basic histograms of the data.
static HarpoHistManager * GetPointer()
void AddAnalyseFunction(HarpoAnalyse *func)
Definition: HarpoReader.h:56
Dummy analysis to run as test and example. Give basic histograms of the data.
Dummy analysis to run as test and example. Give basic histograms of the data.
A virtual class which define intrafece between HARPO Reader and Event Analysis code.
Definition: HarpoAnalyse.h:47
Dummy analysis to run as test and example. Give basic histograms of the data.
Get Run Configuration info by run number. The class query MySQL databe use GetRunConfig Method Only t...
Analysis and suppression of baseline fluctuations.
HarpoMatchingVertex.
Bool_t Init(hReadMode mode=hSyncTime)
Definition: HarpoReader.h:73
Dummy analysis to run as test and example. Give basic histograms of the data.
Dummy analysis to run as test and example. Give basic histograms of the data.
Dummy analysis to run as test and example. Give basic histograms of the data.
A class hold HARPO run iformation.
Dummy analysis to run as test and example. Give basic histograms of the data.
Dummy analysis to run as test and example. Give basic histograms of the data.
Dummy analysis to run as test and example. Give basic histograms of the data.
A class which instantiate the real top level reader.
Definition: HarpoReader.h:33
Dummy analysis to run as test and example. Give basic histograms of the data.
Dummy analysis to run as test and example. Give basic histograms of the data.
Track finder with Kalman filter.
Long_t LoopAll()
Read errors.
Definition: HarpoReader.h:79
A virtual class which define intrafece between HARPO Reader and Event Analysis code.
Dummy analysis to run as test and example. Give basic histograms of the data.
void print()
Print values of all founded fields.
Dummy analysis to run as test and example. Give basic histograms of the data.
Dummy analysis to run as test and example. Give basic histograms of the data.
void Init()
Definition: HarpoConfig.h:63
Dummy analysis to run as test and example. Give basic histograms of the data.
Dummy analysis to run as test and example. Give basic histograms of the data.
Monitoring RAW data for online GUI.
Dummy analysis to run as test and example. Give basic histograms of the data.
HarpoRunConfig * GetRunConfig()
Dummy analysis to run as test and example. Give basic histograms of the data.
Analysis of charge distributions from event with single track Requires tracking information.
Dummy analysis to run as test and example. Give basic histograms of the data.
Dummy analysis to run as test and example. Give basic histograms of the data.
virtual void Save(char *=NULL)
Definition: HarpoAnalyse.h:59
Analysis of space and time response of the readout.
A class which write harpo events to ROOT Tree.
A virtual class which define intrafece between HARPO Reader and Event Analysis code.
Harpo Event Simulation.
Definition: HarpoConfig.h:32
int main(int argc, char **argv)
void print() const
Read config file in libconfig format.
Dummy analysis to run as test and example. Give basic histograms of the data.
Basic HARPO Event Analysis code. "Offline monitoring".
TString * GetAnalyses()
Get List of HarpoAnalyses.
Definition: HarpoConfig.h:102
Suppresses baseline fluctuations in non-zerosuppressed data.
HarpoConfig * gHConfig
A virtual class which define intrafece between HARPO Reader and Event Analysis code.
static hReaderType gHReaderType
Reader Type.
Definition: HarpoConfig.h:179
HarpoRunHeader * GetRunHeader()
Definition: HarpoReader.h:70
Clustering algorithm, runs on RAW data (HarpoMap), produces HarpoRecoClusters objects.
A class which keeps track of the entire configuration of the analysis.
Definition: HarpoConfig.h:50
Dummy analysis to run as test and example. Give basic histograms of the data.