Ntuple Class Reference

Combine tuples (Tuple). More...

#include <Ntuple.h>

Collaboration diagram for Ntuple:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool AddPair (const int aStreamNumber0, const int aStreamNumber1, const int aEventIndex0, const int aEventIndex1)
 Adds a pair of events to a given 2-Tuple.
vector< int > GetEvents (const int aTupleIndex, const int aStreamIndex)
 Returns a vector of events.
int GetNevents (const int aTupleIndex)
 Returns the number events stored in the Tuple indexed by 'aTupleIndex'.
int GetNtuples (void)
 Returns the number of Tuple objects for this NTuple object.
int GetTupleType (const int aTupleIndex)
 Returns the type of Tuple indexed by 'aTupleIndex'.
bool IsStreamInside (const int aStreamNumber, const int aTupleIndex)
 Tests whether a stream is part of a Tuple composing the Ntuple.
bool MakeNtuple (const int aNmax, const bool aUniq=false)
 Combines 2-Tuple objects to fill N-Tuple objects up to aNmax.
void PrintEvents (void)
 Prints current event list, tuple by tuple.
bool ResetEvents (void)
 Resets all Tuple objects.
Constructors and destructors



 Ntuple (const int aNstreams)
 Constructor of the Ntuple class.
virtual ~Ntuple (void)
 Destructor of the Ntuple class.

Detailed Description

Combine tuples (Tuple).

This class was designed to combine N-Tuples of events.

Author:
Florent Robinet

Constructor & Destructor Documentation

Ntuple::Ntuple ( const int  aNstreams  ) 

Constructor of the Ntuple class.

A Ntuple object is defined by N streams (up to 10). 2^N Tuple objects are created corresponding to every combinations of streams. Tuple objects are indexed following the GWOLLUM convention for networks where streams are used as detectors.

Parameters:
aNstreams number of input streams
Ntuple::~Ntuple ( void   )  [virtual]

Destructor of the Ntuple class.


Member Function Documentation

bool Ntuple::AddPair ( const int  aStreamNumber0,
const int  aStreamNumber1,
const int  aEventIndex0,
const int  aEventIndex1 
)

Adds a pair of events to a given 2-Tuple.

A pair of events, defined by the indexes 'aEventIndex0' and 'aEventIndex1', is added to the 2-Tuple defined by the stream indexes 'aStreamIndex0' and 'aStreamIndex1'. Stream index 'aStreamIndex0' should be smaller than 'aStreamIndex1'.

IMPORTANT: For a given Tuple, events should be added by increasing event indexes: first condition: aEventIndex0(this pair) >= aEventIndex0(previous pair), second condition: aEventIndex1(this pair) >= aEventIndex1(previous pair)

Parameters:
aStreamNumber0 first stream index
aStreamNumber1 second stream index
aEventIndex0 event index for first stream index
aEventIndex1 event index for second stream index
vector< int > Ntuple::GetEvents ( const int  aTupleIndex,
const int  aStreamIndex 
)

Returns a vector of events.

This applies to Tuple with index 'aTupleIndex' and stream with index 'aStreamIndex'. Returns an empty vector if 'aTupleIndex' or 'aStreamIndex' does not exist.

Parameters:
aTupleIndex Tuple index
aStreamIndex Stream index
int Ntuple::GetNevents ( const int  aTupleIndex  )  [inline]

Returns the number events stored in the Tuple indexed by 'aTupleIndex'.

Returns -1 if aTupleIndex does not exist.

Parameters:
aTupleIndex Tuple index
int Ntuple::GetNtuples ( void   )  [inline]

Returns the number of Tuple objects for this NTuple object.

int Ntuple::GetTupleType ( const int  aTupleIndex  )  [inline]

Returns the type of Tuple indexed by 'aTupleIndex'.

Returns -1 if aTupleIndex does not exist.

Parameters:
aTupleIndex Tuple index
bool Ntuple::IsStreamInside ( const int  aStreamNumber,
const int  aTupleIndex 
)

Tests whether a stream is part of a Tuple composing the Ntuple.

Returns true if the answer is yes.

Parameters:
aStreamIndex stream index to test
aTupleIndex Tuple index to search for
bool Ntuple::MakeNtuple ( const int  aNmax,
const bool  aUniq = false 
)

Combines 2-Tuple objects to fill N-Tuple objects up to aNmax.

2-Tuple objects are combined to fill N-Tuple objects from N=3 up to N=aNmax. It uses events stored in 2-Tuple objects up to now. Higher-types Tuple objects are first reset before being filled. N-Tuple objects are filled recursively: the N-Tuple object is filled with events which are contained by all the (N-1)-Tuple objects composing the N-Tuple object. For example, the 3-tuple defined by the stream indexes 0-2-3 is filled by an event contained in all the 2-tuples 0-2, 0-3 and 2-3.

If aUniq is set to true, every time a N-Tuple event is found, all the events in the (N-1)-Tuple objects are removed.

Parameters:
aNmax 
aUniq 
void Ntuple::PrintEvents ( void   ) 

Prints current event list, tuple by tuple.

bool Ntuple::ResetEvents ( void   )  [inline]

Resets all Tuple objects.

Every events saved so far are deleted.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Friends Defines

Generated on 29 Sep 2016 by  doxygen 1.6.1