You are not allowed to use this action.

Clear message
Locked History Actions

ANAROOT/Manual/analoop

Abstract of AnaLoop

AnaLoop(Exact class name is TArtAnaLoop) is a abstract class to control flow of analysis. Developer can make a class inherit TArtAnaLoop and required to implement 4 functions, Construct(), Calculate(), Destruct(), and ClassName(). Maybe it's easier to understand to look source code like TAlDALIExample.cc and .hh.

Construct()

This function is for construct like TArtCalibNEBULA, namely "new TArtCalibNEBULA". Constructing like TH1 is better to do in global book function (override it), but this is not essential and construct TH1 in Construct() is ok. You can find example of this in TArtAnaLoopUser.C.

Calculate()

This function will be called every event loop, so write only one step.

Destruct()

Just delete object which you create in Construct(). This part is important when you book twice or more at one root session.

ClassName()

This function only exists to show name of current AnaLoop class in status().

2 usage of AnaLoop

built-in to library

Create TArtAnaLoop derived class in $TARTSYS/source/AnaLoop/include and src. This suit to user whom you want to provide as black box.

create macro in your analysis directory and load dynamically

You can load same code as built-in one in ROOT session.

root[i] .L macros/TArtAnaLoopUser.C+

With "+" at end of line, ROOT will compile macro so you can use native C++ grammar (.x is execute command, so it's not proper). This suit to user who wants to edit frequently or familiar to ROOT and use TH1.

Special TArtAnaLoop derived class "TAlEncExample"

In TAlEncExample, register class inherits TAlEncSub and analysis each EncSub derived class in order of registration.

If you are using AnaFile, you have to use this class.

# hoge.ana
<analys> 0,15,12,

Command in ROOT session is simple,

root[i] book(new TAlEncExample, "hoge.ana");
root[i] push("ridf/sm_com/sdaq02/run0140.ridf");
root[i] start();

Registering manually (for ROOT user), do as follows.

root[i] TAlEncExample* alencexample = new TAlEncExample;
root[i] alencexample->Register(new TAlEncSAMURAIExample);
root[i] alencexample->Register(new TAlEncDALIExample);
root[i] alencexample->Register(new TAlEncNEBULAExample);
root[i] book(alencexample);
root[i] push("ridf/sm_com/sdaq02/run0140.ridf");
root[i] start();

built-in your own TAlEncSub class

Create class inherits TAlEncSub and register by your self. Pleas look TAlEncUser.C and TAlEncUser.hh for example. Then by following commands,

root[i] .L macros/analoop/TAlEncUser.C+
root[i] book(new TAlEncExample, "ana/hoge.ana")
root[i] push("ridf/run0140.ridf")
root[i] start()

analysis will start. In above example, registering is done inside statical class construction (but this is tricky), so you don't need to do manually.

anapaw: val[1][0] = auraw -> anaroot: Add(1, 0, auraw)

Use Add function instead of directly input to val. In ANAROOT, you don't need to Add anything if there is nodata. If you want to fill kind of over-flow of TDC, it doesn't matter but performance will decrease.

EAnalyser and EWNum

EAnalyser and EWNum is a number (define by enum) to identify physical meaning of values in AnaFile.

src/source/AnaLoop/include/EAnalyser.hh
src/source/AnaLoop/include/EWNum.hh

It's able to be seen on ROOT by using lv() command,

root[i] lv();

This command is written in perl, but not perfectly understand C++ grammer so how to write EAnalyse.hh and EWNum.hh is limited.