Public Member Functions | Public Attributes | List of all members
Acclaim::SummarySelector Class Reference

Template TSelector to be inherited from, designed for use with SummarySet. More...

#include <SummarySelector.h>

Public Member Functions

 SummarySelector (const char *sumBranchName="sum")
 Set this to true to generate and fill fDemoHist. More...
 
virtual ~SummarySelector ()
 
void addCut (const TCut *analysisCut)
 
virtual void Begin (TTree *tree)
 
virtual void SlaveBegin (TTree *tree)
 
virtual void Init (TTree *tree)
 
virtual Bool_t Notify ()
 
virtual Bool_t Process (Long64_t entry)
 Reads the AnitaEventSummary TTree entry and sets the fSum pointer. Cycles through the fCuts, applying each TCut in turn. More...
 
virtual void SlaveTerminate ()
 
virtual void Terminate ()
 
virtual Int_t Version () const
 From ROOT.
 
virtual Int_t GetEntry (Long64_t entry, Int_t getall=0)
 From ROOT, Gets the local tree entry.
 
virtual void SetOption (const char *option)
 From ROOT, set the option.
 
virtual void SetObject (TObject *obj)
 Set the current object, not sure what this does.
 
virtual void SetInputList (TList *input)
 Set the input list, not sure what this does.
 
virtual TList * GetOutputList () const
 Used to combine the objects.
 

Public Attributes

TTree * fChain
 
Int_t fDirectionFormulaIndex
 The analyzed TTree or TChain.
 
TList * fCuts
 Which TTree formula determines the peak direction?
 
TList * fCutFormulas
 A list of TCut objects, for event selection (none means selecting all)
 
Int_t fMaxNdata
 A list of TTreeFormula objects, derived from the TCut objects.
 
std::vector< std::vector< Int_t > > fCutReturns
 Maximum size of the cut.
 
std::vector< Int_t > fCumulativeCutReturns
 Stores the results as the cuts are processed in sequence.
 
TTreeFormula * fDemoForm
 Stores the AND of cut results per iteration processed in sequence. More...
 
TH1D * fDemoHist
 TTree formula produced if making the demonstration histogram.
 
bool fDoDemoHist
 A histogram of peak[1][0].value.
 

Detailed Description

Template TSelector to be inherited from, designed for use with SummarySet.

The following methods must be defined in the cxx file: Begin(): Called every time a loop on the tree starts, a convenient place to create your histograms.

SlaveBegin(): Called after Begin(), when on PROOF called only on the slave servers.

Process(): Called for each event, in this function you decide what to read and fill your histograms.

SlaveTerminate: Called at the end of the loop on the tree, when on PROOF called only on the slave servers.

Terminate(): Called at the end of the loop on the tree, a convenient place to draw/fit your histograms.

With the Acclaim::SummarySet, create a SummarySelector (or dereived) object. Acclaim::SummarySet::Process(&SummarySelector). Make sure to set SummarySet::SetUseProof(true) to get the full multithreaded PROOF goodness.

Definition at line 48 of file SummarySelector.h.

Inheritance diagram for Acclaim::SummarySelector:
Inheritance graph
[legend]
Collaboration diagram for Acclaim::SummarySelector:
Collaboration graph
[legend]

Constructor & Destructor Documentation

Acclaim::SummarySelector::SummarySelector ( const char *  sumBranchName = "sum")

Set this to true to generate and fill fDemoHist.

Default constructor

Parameters
treeDefault parameter which is not used, for backward compatibility reasons
sumBranchNamethe name of the branch of AnitaEventSummaries, default is "sum"

Definition at line 20 of file SummarySelector.cxx.

Acclaim::SummarySelector::~SummarySelector ( )
virtual

Destructor

Definition at line 38 of file SummarySelector.cxx.

Member Function Documentation

void Acclaim::SummarySelector::addCut ( const TCut *  analysisCut)

Add an analysis cut to fCuts, takes care of const casting

Parameters
analysisCut

Definition at line 50 of file SummarySelector.cxx.

void Acclaim::SummarySelector::Begin ( TTree *  tree)
virtual

The Begin() function is called at the start of the query. When running with PROOF Begin() is only called on the client. The tree argument is deprecated (on PROOF 0 is passed).

Reimplemented in Acclaim::CutTreeSelector, and Acclaim::SumTreeReductionSelector.

Definition at line 148 of file SummarySelector.cxx.

void Acclaim::SummarySelector::Init ( TTree *  tree)
virtual

The Init() function is called when the selector needs to initialize a new tree or chain. Typically here the reader is initialized. It is normally not necessary to make changes to the generated code, but the routine can be extended by the user if needed. Init() will be called many times when running on PROOF (once per file to be processed).

Parameters
treethe tree to initialize

Reimplemented in Acclaim::CutTreeSelector.

Definition at line 68 of file SummarySelector.cxx.

Bool_t Acclaim::SummarySelector::Process ( Long64_t  entry)
virtual

Reads the AnitaEventSummary TTree entry and sets the fSum pointer. Cycles through the fCuts, applying each TCut in turn.

The Process() function is called for each entry in the tree (or possibly keyed object in the case of PROOF) to be processed. The entry argument specifies which entry in the currently loaded tree is to be processed. When processing keyed objects with PROOF, the object is already loaded and is available via the fObject pointer.

This function should contain the "body" of the analysis. It can contain simple or elaborate selection criteria, run algorithms on the data of the event and typically fill histograms.

The processing can be stopped by calling Abort().

Use fStatus to set the return value of TTree::Process().

Parameters
entryin the currently loaded tree
Returns
true if the entry passes all the fCuts values

Reimplemented in Acclaim::CutTreeSelector, and Acclaim::SumTreeReductionSelector.

Definition at line 204 of file SummarySelector.cxx.

void Acclaim::SummarySelector::SlaveBegin ( TTree *  tree)
virtual

The SlaveBegin() function is called after the Begin() function. When running with PROOF SlaveBegin() is called on each slave server. The tree argument is deprecated (on PROOF 0 is passed).

Reimplemented in Acclaim::CutTreeSelector, and Acclaim::SumTreeReductionSelector.

Definition at line 167 of file SummarySelector.cxx.

void Acclaim::SummarySelector::SlaveTerminate ( )
virtual

The SlaveTerminate() function is called after all entries or objects have been processed. When running with PROOF SlaveTerminate() is called on each slave server.

Reimplemented in Acclaim::CutTreeSelector, and Acclaim::SumTreeReductionSelector.

Definition at line 284 of file SummarySelector.cxx.

void Acclaim::SummarySelector::Terminate ( )
virtual

The Terminate() function is the last function to be called during a query. It always runs on the client, it can be used to present the results graphically or save the results to file.

Reimplemented in Acclaim::CutTreeSelector, and Acclaim::SumTreeReductionSelector.

Definition at line 300 of file SummarySelector.cxx.

Member Data Documentation

TTreeFormula* Acclaim::SummarySelector::fDemoForm

Stores the AND of cut results per iteration processed in sequence.

For demonstration

Definition at line 66 of file SummarySelector.h.


The documentation for this class was generated from the following files: