AliRoot Core  d69033e (d69033e)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONDataInterface Class Reference

An easy to use interface to MUON data. More...

#include <AliMUONDataInterface.h>

Inheritance diagram for AliMUONDataInterface:

Public Member Functions

 AliMUONDataInterface (const char *filename="galice.root")
 
virtual ~AliMUONDataInterface ()
 
Bool_t IsValid () const
 Returns true if the data interface was able to open the root file correctly. More...
 
void Open (const char *filename)
 
Int_t NumberOfEvents () const
 
Int_t CurrentEvent () const
 
AliMUONVDigitStoreDigitStore (Int_t event)
 
AliMUONVClusterStoreClusterStore (Int_t event)
 
AliMUONVTriggerStoreTriggerStore (Int_t event, const char *treeLetter="R")
 
void DumpClusters (Int_t event, Bool_t sorted=kTRUE)
 Dump the clusters for a given event, sorted if so required. More...
 
void DumpRecPoints (Int_t event, Bool_t sorted=kTRUE)
 
void DumpDigits (Int_t event, Bool_t sorted=kTRUE)
 
void DumpTrigger (Int_t event, const char *treeLetter="R")
 
Bool_t GetEvent (Int_t event=0)
 
Int_t NumberOfDigits (Int_t detElemId)
 
AliMUONVDigitDigit (Int_t detElemId, Int_t index)
 
Int_t NumberOfDigits (Int_t chamber, Int_t cathode)
 
AliMUONVDigitDigit (Int_t chamber, Int_t cathode, Int_t index)
 
Int_t NumberOfRawClusters (Int_t chamber)
 
AliMUONVClusterRawCluster (Int_t chamber, Int_t index)
 
Int_t NumberOfLocalTriggers ()
 
AliMUONLocalTriggerLocalTrigger (Int_t index)
 
Int_t NumberOfRegionalTriggers ()
 
AliMUONRegionalTriggerRegionalTrigger (Int_t index)
 
AliMUONGlobalTriggerGlobalTrigger ()
 

Private Types

enum  IteratorType {
  kNoIterator, kDigitIteratorByDetectorElement, kDigitIteratorByChamberAndCathode, kRawClusterIterator,
  kLocalTriggerIterator, kRegionalTriggerIterator
}
 The various identifiers for the type of iterator constructed. More...
 

Private Member Functions

void DumpSorted (const AliMUONVStore &store) const
 
Bool_t LoadEvent (Int_t event)
 
void NtupleTrigger (const char *treeLetter)
 
void ResetStores ()
 
TIterator * GetIterator (IteratorType type, Int_t x=0, Int_t y=0)
 
void ResetIterator ()
 
Int_t CountObjects (TIterator *iter)
 
TObject * FetchObject (TIterator *iter, Int_t index)
 
 AliMUONDataInterface (const AliMUONDataInterface &rhs)
 Not implemented. More...
 
AliMUONDataInterfaceoperator= (const AliMUONDataInterface &rhs)
 Not implemented. More...
 

Private Attributes

AliLoader * fLoader
 ! Tree accessor More...
 
AliMUONVDigitStorefDigitStore
 ! current digit store (owner) More...
 
AliMUONVTriggerStorefTriggerStore
 ! current trigger store (owner) More...
 
AliMUONVClusterStorefClusterStore
 ! current cluster store (owner) More...
 
Int_t fCurrentEvent
 ! Current event we've read in More...
 
TString fTreeLetter
 ! The tree letter used in the last call to TriggerStore(). More...
 
Bool_t fIsValid
 ! whether we were initialized properly or not More...
 
IteratorType fCurrentIteratorType
 ! The type of iterator that is currently set. More...
 
Int_t fCurrentIndex
 ! A current index number maintained for certain iteration operations. More...
 
Int_t fDataX
 ! Extra data parameter about the iterator, can be the chamber number or detector element. More...
 
Int_t fDataY
 ! Extra data parameter about the iterator, can be the cathode number. More...
 
TIterator * fIterator
 ! Iterator for various iteration operations. More...
 

Static Private Attributes

static Int_t fgInstanceCounter
 ! To build unique folder name for each instance More...
 

Detailed Description

An easy to use interface to MUON data.

An easy to use interface to the MUON data data stored in TreeS, TreeD and TreeR.

For MC related information (i.e. TreeH, TreeK, TreeTR), see AliMUONMCDataInterface.

This interface in not necessarily the fastest way to fetch the data but it is the easiest.

Author
Laurent Aphecetche, Subatech & Artur Szostak artur.nosp@m.sz@i.nosp@m.afric.nosp@m.a.co.nosp@m.m (University of Cape Town)

Definition at line 35 of file AliMUONDataInterface.h.

Member Enumeration Documentation

The various identifiers for the type of iterator constructed.

Enumerator
kNoIterator 

No iterator was constructed.

kDigitIteratorByDetectorElement 

A digit iterator for iterating over detector elements.

kDigitIteratorByChamberAndCathode 

A digit iterator for iterating over chambers and cathodes.

kRawClusterIterator 

A raw cluster iterator.

kLocalTriggerIterator 

An iterator for iterating over reconstructed local triggers.

kRegionalTriggerIterator 

An iterator for iterating over reconstructed regional triggers.

Definition at line 86 of file AliMUONDataInterface.h.

Constructor & Destructor Documentation

AliMUONDataInterface::AliMUONDataInterface ( const char *  filename = "galice.root")

ctor

Parameters
filenameshould be the full path to a valid galice.root file

Definition at line 75 of file AliMUONDataInterface.cxx.

AliMUONDataInterface::~AliMUONDataInterface ( )
virtual

dtor

Definition at line 109 of file AliMUONDataInterface.cxx.

AliMUONDataInterface::AliMUONDataInterface ( const AliMUONDataInterface rhs)
private

Not implemented.

Member Function Documentation

AliMUONVClusterStore * AliMUONDataInterface::ClusterStore ( Int_t  event)

Return clusterStore for a given event. Return 0x0 if event not found. Returned pointer should not be deleted

Note
If a previous store has been retrieved by one of the methods of this class, but for a different event number, then those stores will be deleted and no longer valid. If you require access to the data for the earlier retrieved store, but for different events, then you should deep copy / clone the object.

Definition at line 167 of file AliMUONDataInterface.cxx.

Referenced by DumpRecPoints(), GetEvent(), GetIterator(), and RawClustersOk().

Int_t AliMUONDataInterface::CountObjects ( TIterator *  iter)
private

Counts the number of objects in the iterator and resets it.

Returns
The number of objects in 'iter'.

Definition at line 868 of file AliMUONDataInterface.cxx.

Referenced by NumberOfDigits(), NumberOfLocalTriggers(), NumberOfRawClusters(), and NumberOfRegionalTriggers().

Int_t AliMUONDataInterface::CurrentEvent ( ) const
inline

Returns the index number of the current event loaded. This is the event number as was used in the last calls to DigitStore(Int_t), ClusterStore(Int_t), TriggerStore(Int_t) or GetEvent(Int_t).

Definition at line 52 of file AliMUONDataInterface.h.

AliMUONVDigit * AliMUONDataInterface::Digit ( Int_t  detElemId,
Int_t  index 
)

Returns the a pointer to the index'th digit on the specified detector element.

Parameters
detElemIdThe detector element ID number to search on.
indexThe index number of the digit to fetch in the range [0 .. N-1], where N = NumberOfDigits(detElemId)

Definition at line 613 of file AliMUONDataInterface.cxx.

Referenced by RecDigitsOk().

AliMUONVDigit * AliMUONDataInterface::Digit ( Int_t  chamber,
Int_t  cathode,
Int_t  index 
)

Returns the a pointer to the index'th digit on the specified chamber and cathode.

Parameters
chamberThe chamber number in the range [0 .. 13].
cathodeThe cathode in the range [0 .. 1], where 0 is the bending and 1 is the non-bending plane.
indexThe index number of the digit to fetch in the range [0 .. N-1], where N = NumberOfDigits(chamber, cathode)

Definition at line 637 of file AliMUONDataInterface.cxx.

AliMUONVDigitStore * AliMUONDataInterface::DigitStore ( Int_t  event)

Return digitStore for a given event. Return 0x0 if event not found. Returned pointer should not be deleted

Note
If a previous store has been retrieved by one of the methods of this class, but for a different event number, then those stores will be deleted and no longer valid. If you require access to the data for the earlier retrieved store, but for different events, then you should deep copy / clone the object.

Definition at line 118 of file AliMUONDataInterface.cxx.

Referenced by AliMUONCheck::CheckOccupancy(), DumpDigits(), GetEvent(), GetIterator(), and RecDigitsOk().

void AliMUONDataInterface::DumpClusters ( Int_t  event,
Bool_t  sorted = kTRUE 
)
inline

Dump the clusters for a given event, sorted if so required.

Definition at line 59 of file AliMUONDataInterface.h.

void AliMUONDataInterface::DumpDigits ( Int_t  event,
Bool_t  sorted = kTRUE 
)

Dump the digits for a given event, sorted if so required

Definition at line 301 of file AliMUONDataInterface.cxx.

void AliMUONDataInterface::DumpRecPoints ( Int_t  event,
Bool_t  sorted = kTRUE 
)

Dump the recpoints for a given event, sorted if so required

Definition at line 320 of file AliMUONDataInterface.cxx.

Referenced by DumpClusters().

void AliMUONDataInterface::DumpSorted ( const AliMUONVStore store) const
private

Dump the given store, in sorted order

Definition at line 339 of file AliMUONDataInterface.cxx.

Referenced by DumpDigits(), and DumpRecPoints().

void AliMUONDataInterface::DumpTrigger ( Int_t  event,
const char *  treeLetter = "R" 
)

Dump trigger for a given event from a given tree (if event>=0) or loop over all events and build a trigger ntuple if event<0 treeLetter can be R or D to tell from which tree to read the information

Definition at line 360 of file AliMUONDataInterface.cxx.

TObject * AliMUONDataInterface::FetchObject ( TIterator *  iter,
Int_t  index 
)
private

Fetches the index'th object from the iterator counting the first object returned by iterator after it is reset as index == 0. The next object has index == 1 and so on where the last object returned by the iterator has index == N-1 where N = CountObjects(iter) This method will only reset the iterator if index is smaller than fCurrentIndex, which is used to track the iteration progress and is updated when a new object if returned by this method.

Parameters
iterThe iterator to fetch an object from.
indexThe index number of the object to fetch in the range [0 .. N-1] where N = CountObjects(iter)

Definition at line 883 of file AliMUONDataInterface.cxx.

Referenced by Digit(), LocalTrigger(), RawCluster(), and RegionalTrigger().

Bool_t AliMUONDataInterface::GetEvent ( Int_t  event = 0)

Loads all reconstructed data for the given event.

Definition at line 592 of file AliMUONDataInterface.cxx.

Referenced by RawClustersOk(), RecDigitsOk(), and TriggersOk().

TIterator * AliMUONDataInterface::GetIterator ( IteratorType  type,
Int_t  x = 0,
Int_t  y = 0 
)
private

Creates an appropriate iterator object and returns it. If the iterator has already been created then that one is returned otherwise a new object is created. Depending on the value of 'type' the semantics of parameters x and y can change.

Parameters
typeThe type of iterator to create.
xThis is the detector element ID if type == kDigitIteratorByDetectorElement If type equals kDigitIteratorByChamberAndCathode or kRawClusterIterator then this is the chamber number. In all other cases this parameter is ignored.
yIf type == kDigitIteratorByChamberAndCathode then this parameter is the cathode number. In all other cases this parameter is ignored.

Definition at line 747 of file AliMUONDataInterface.cxx.

Referenced by Digit(), LocalTrigger(), NumberOfDigits(), NumberOfLocalTriggers(), NumberOfRawClusters(), NumberOfRegionalTriggers(), RawCluster(), and RegionalTrigger().

AliMUONGlobalTrigger * AliMUONDataInterface::GlobalTrigger ( )

Returns a pointer to the reconstructed global trigger object for the event.

Definition at line 713 of file AliMUONDataInterface.cxx.

Referenced by TriggersOk().

Bool_t AliMUONDataInterface::IsValid ( ) const
inline

Returns true if the data interface was able to open the root file correctly.

Definition at line 43 of file AliMUONDataInterface.h.

Referenced by ClusterStore(), DigitStore(), LoadEvent(), MUONTriggerEfficiency(), MUONTriggerEfficiencyPt(), NumberOfEvents(), Open(), and TriggerStore().

Bool_t AliMUONDataInterface::LoadEvent ( Int_t  event)
private

Load event if different from the current one. Returns kFALSE on error and kTRUE if the event was loaded.

Definition at line 507 of file AliMUONDataInterface.cxx.

Referenced by ClusterStore(), DigitStore(), and TriggerStore().

AliMUONLocalTrigger * AliMUONDataInterface::LocalTrigger ( Int_t  index)

Returns a pointer to the index'th local trigger object.

Parameters
indexThe index number of the local trigger object to fetch in the range [0 .. N-1], where N = NumberOfLocalTriggers()

Definition at line 682 of file AliMUONDataInterface.cxx.

Referenced by TriggersOk().

void AliMUONDataInterface::NtupleTrigger ( const char *  treeLetter)
private

Loop over events to build trigger ntuples

Definition at line 383 of file AliMUONDataInterface.cxx.

Referenced by DumpTrigger().

Int_t AliMUONDataInterface::NumberOfDigits ( Int_t  detElemId)

Returns the number of digits to be found on a given detector element.

Parameters
detElemIdThe detector element ID number to search on.

Definition at line 603 of file AliMUONDataInterface.cxx.

Referenced by RecDigitsOk().

Int_t AliMUONDataInterface::NumberOfDigits ( Int_t  chamber,
Int_t  cathode 
)

Returns the number of digits to be found on a specific chamber and cathode.

Parameters
chamberThe chamber number in the range [0 .. 13].
cathodeThe cathode in the range [0 .. 1], where 0 is the bending and 1 is the non-bending plane.

Definition at line 625 of file AliMUONDataInterface.cxx.

Int_t AliMUONDataInterface::NumberOfEvents ( ) const

Number of events in the current galice.root file we're attached to

Definition at line 526 of file AliMUONDataInterface.cxx.

Referenced by MUONReCalcGlobalTrigger(), NtupleTrigger(), RawClustersOk(), RecDigitsOk(), and TriggersOk().

Int_t AliMUONDataInterface::NumberOfLocalTriggers ( )

Returns the number of reconstructed local trigger objects.

Definition at line 673 of file AliMUONDataInterface.cxx.

Referenced by TriggersOk().

Int_t AliMUONDataInterface::NumberOfRawClusters ( Int_t  chamber)

Returns the number of reconstructed raw clusters on the specified chamber.

Parameters
chamberThe chamber number in the range [0 .. 13].

Definition at line 651 of file AliMUONDataInterface.cxx.

Referenced by RawClustersOk().

Int_t AliMUONDataInterface::NumberOfRegionalTriggers ( )

Returns the number of regional trigger objects reconstructed.

Definition at line 693 of file AliMUONDataInterface.cxx.

Referenced by TriggersOk().

void AliMUONDataInterface::Open ( const char *  filename)

Connect to a given galice.root file

Definition at line 535 of file AliMUONDataInterface.cxx.

AliMUONDataInterface& AliMUONDataInterface::operator= ( const AliMUONDataInterface rhs)
private

Not implemented.

AliMUONVCluster * AliMUONDataInterface::RawCluster ( Int_t  chamber,
Int_t  index 
)

Returns a pointer to the index'th raw cluster on the specified chamber.

Parameters
chamberThe chamber number in the range [0 .. 13].
indexThe index number of the raw cluster to fetch in the range [0 .. N-1], where N = NumberOfRawClusters(chamber)

Definition at line 661 of file AliMUONDataInterface.cxx.

Referenced by RawClustersOk().

AliMUONRegionalTrigger * AliMUONDataInterface::RegionalTrigger ( Int_t  index)

Returns a pointer to the index'th regional trigger object.

Parameters
indexThe index number of the regional trigger object to fetch in the range [0 .. N-1], where N = NumberOfRegionalTriggers()

Definition at line 702 of file AliMUONDataInterface.cxx.

Referenced by TriggersOk().

void AliMUONDataInterface::ResetIterator ( )
private

The temporary iterator object is deleted if it exists and the pointer reset to 0x0. The iterator type and temporary data indicating the state of the iterator are also reset.

Definition at line 855 of file AliMUONDataInterface.cxx.

Referenced by GetIterator(), and ResetStores().

void AliMUONDataInterface::ResetStores ( )
private

Deletes all the store objects that have been created and resets the pointers to 0x0. The temporary iterator object is automatically reset. See ResetIterator for more details.

Definition at line 723 of file AliMUONDataInterface.cxx.

Referenced by ClusterStore(), DigitStore(), Open(), TriggerStore(), and ~AliMUONDataInterface().

AliMUONVTriggerStore * AliMUONDataInterface::TriggerStore ( Int_t  event,
const char *  treeLetter = "R" 
)

Return the triggerStore for a given event. Return 0x0 if event not found. Returned pointer should not be deleted treeLetter can be R or D to tell from which tree to read the information

Note
If a previous store has been retrieved by one of the methods of this class, but for a different event number, then those stores will be deleted and no longer valid. If you require access to the data for the earlier retrieved store, but for different events, then you should deep copy / clone the object.

Definition at line 216 of file AliMUONDataInterface.cxx.

Referenced by DumpTrigger(), GetEvent(), GetIterator(), GlobalTrigger(), MUONReCalcGlobalTrigger(), MUONTriggerEfficiency(), MUONTriggerEfficiencyPt(), NtupleTrigger(), and TriggersOk().

Member Data Documentation

AliMUONVClusterStore* AliMUONDataInterface::fClusterStore
private

! current cluster store (owner)

Definition at line 119 of file AliMUONDataInterface.h.

Referenced by ClusterStore(), DumpRecPoints(), and ResetStores().

Int_t AliMUONDataInterface::fCurrentEvent
private

! Current event we've read in

Definition at line 120 of file AliMUONDataInterface.h.

Referenced by ClusterStore(), CurrentEvent(), DigitStore(), GetIterator(), GlobalTrigger(), LoadEvent(), Open(), and TriggerStore().

Int_t AliMUONDataInterface::fCurrentIndex
private

! A current index number maintained for certain iteration operations.

Definition at line 125 of file AliMUONDataInterface.h.

Referenced by CountObjects(), FetchObject(), and ResetIterator().

IteratorType AliMUONDataInterface::fCurrentIteratorType
private

! The type of iterator that is currently set.

Definition at line 124 of file AliMUONDataInterface.h.

Referenced by GetIterator(), and ResetIterator().

Int_t AliMUONDataInterface::fDataX
private

! Extra data parameter about the iterator, can be the chamber number or detector element.

Definition at line 126 of file AliMUONDataInterface.h.

Referenced by GetIterator(), and ResetIterator().

Int_t AliMUONDataInterface::fDataY
private

! Extra data parameter about the iterator, can be the cathode number.

Definition at line 127 of file AliMUONDataInterface.h.

Referenced by GetIterator(), and ResetIterator().

AliMUONVDigitStore* AliMUONDataInterface::fDigitStore
private

! current digit store (owner)

Definition at line 117 of file AliMUONDataInterface.h.

Referenced by DigitStore(), DumpDigits(), and ResetStores().

Int_t AliMUONDataInterface::fgInstanceCounter
staticprivate

! To build unique folder name for each instance

Definition at line 130 of file AliMUONDataInterface.h.

Referenced by Open(), and ~AliMUONDataInterface().

Bool_t AliMUONDataInterface::fIsValid
private

! whether we were initialized properly or not

Definition at line 122 of file AliMUONDataInterface.h.

Referenced by IsValid(), and Open().

TIterator* AliMUONDataInterface::fIterator
private

! Iterator for various iteration operations.

Definition at line 128 of file AliMUONDataInterface.h.

Referenced by GetIterator(), and ResetIterator().

AliLoader* AliMUONDataInterface::fLoader
private

! Tree accessor

Definition at line 116 of file AliMUONDataInterface.h.

Referenced by ClusterStore(), DigitStore(), LoadEvent(), NtupleTrigger(), NumberOfEvents(), Open(), and TriggerStore().

TString AliMUONDataInterface::fTreeLetter
private

! The tree letter used in the last call to TriggerStore().

Definition at line 121 of file AliMUONDataInterface.h.

Referenced by TriggerStore().

AliMUONVTriggerStore* AliMUONDataInterface::fTriggerStore
private

! current trigger store (owner)

Definition at line 118 of file AliMUONDataInterface.h.

Referenced by DumpTrigger(), ResetStores(), and TriggerStore().


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