The HarpoAnalyse class is the base class to process data event by event. It has three main functions:
Init()
This is run at the beginning of the analysis. You typically initialize histograms and counters there.process()
This is where the actual data processing is done. HarpoEvent* fEvt
contains the aggregated data from all the detectors included (Feminos X, Y, PMm2, ...) for a single event (already synchronized). More details in HarpoEvent.Save()
This is run at the end of the analysis. You can do some final processing there. You will also explicitly save your output histograms in a file defined with the -b
option (see below).A template analysis class HarpoAnalyseTemplate
exists. The makeNewAnalysis.sh
script allows to generate a copy of the template with all the required files and modifications to Makefile
, harpoanalysis.cxx
and hrecomonitor.cxx
. For consistency, please use a name starting with "Analyse" for analysis (does not modify the data).
$ cd $HARPO_SCRIPT_DIR $ ./makeNewAnalysis.sh AnalyseName $ cd ../analysis $ ls HarpoAnalyseName* HarpoAnalyseName.cxx HarpoAnalyseName.h HarpoAnalyseNameLinkDef.h
The script modifies Makefile
, harpoanalysis.cxx
and hrecomonitor.cxx
. If you want to remove your analysis, look for its name in those files to remove the corresponding lines.
You can also create a selction process. It is the same type of object HarpoAnalyse, but it modifies the flag fEvAnaStatus
in the event header.
fEvAnaStatus = hAnaAbort = -5
Abort program without saving the output or < -5 (not implemented)fEvAnaStatus = hAnaStop = -4
, Stop Event Loop (not implemented)fEvAnaStatus = hAnaNextFile = -3
, Close current input file continue with next file (not implemented)fEvAnaStatus = hAnaNextEvent = -2
stop event analysis, without writingfEvAnaStatus = hAnaEventWrt = -1
stop event analysis, but write eventfEvAnaStatus = hAnaOK = 0
OK , continue analysis The makeNewSelector.sh
script allows to generate a copy of the template with all the required files and modifications to Makefile
, harpoanalysis.cxx
and hrecomonitor.cxx
. For consistency, please use a name starting with "Selector" for analysis (does not modify the data).$ ./makeNewSelector.sh SelectorName $ ls HarpoSelectorName* HarpoSelectorName.cxx HarpoSelectorName.h HarpoSelectorNameLinkDef.h
The script modifies Makefile
, harpoanalysis.cxx
and hrecomonitor.cxx
. If you want to remove your selector, look for its name in those files to remove the corresponding lines.
The harpoanalysis
program can run your analysis (if you created it with makeNewAnalysis.sh
). You can apply the analysis through the command line option -a
:
harpoanalysis -a HarpoSelectorName -a HarpoAnalyseName -b hist.root run.root
This will apply the analysis HarpoAnalyseName
, to the events in run.root
that pass the selection in HarpoSelectorName
. The output histograms are saved in hist.root
. You can apply multiple selectors, and multiple analyses. They will be run sequentially in the order given in the command line.
You can also do that in a configuration file:
# File myConfig.cfg config: { analyses="HarpoSelectorName HarpoAnalyseName"; }; @include "HarpoReconstruction.cfg"
The analyses in the list will be applied sequentially for each event.
You can then apply the list of analyses to data:
$HARPO_DATA_DIR
)./runRawData harpoanalysis RUNNO -c myConfig.cfg
harpoanalysis -c myConfig.cfg --root run.root
The HarpoAnalyse
class contains a function DisplayAnalysis(TRootEmbeddedCanvas* ecTab, TGListBox* infobox)
, which allows to display histogram on the "Analysis" tab of the recomonitor, and text output on the text box of the recomonitor. You can look at details in the template class. The analysis can be selected in the "Analysis" menu on the left of the monitor.
Similarly, a selector can be selected in the "Selector" menu on the left of the monitor. This allows to browse events which pass the selector cuts, using the "Find Next Event" button.
A configuration window can be created for an analysis or a selector in the function ConfigFrame(TGMainFrame* fMain, Int_t id)
. Look at the template for more details.