AliRoot Core  v5-06-30 (35d6c57)
AliMUONMCDataInterface Class Reference

#include <AliMUONMCDataInterface.h>

Inheritance diagram for AliMUONMCDataInterface:

## Public Member Functions

AliMUONMCDataInterface (const char *filename="galice.root")

virtual ~AliMUONMCDataInterface ()

void Open (const char *filename)

Bool_t IsValid () const
Returns true if the data interface was able to open the root file correctly. More...

Int_t NumberOfEvents () const

Int_t CurrentEvent () const

Int_t NumberOfTracks (Int_t event)

Int_t NumberOfTrackRefs (Int_t event)

AliMUONVHitStoreHitStore (Int_t event, Int_t track)

AliMUONVDigitStoreSDigitStore (Int_t event)

AliMUONVDigitStoreDigitStore (Int_t event)

AliStack * Stack (Int_t event)

TClonesArray * TrackRefs (Int_t event, Int_t track)

AliMUONVTriggerStoreTriggerStore (Int_t event)

void DumpDigits (Int_t event, Bool_t sorted=kTRUE)

void DumpSDigits (Int_t event, Bool_t sorted=kTRUE)

void DumpHits (Int_t event)

void DumpKine (Int_t event)

void DumpTrackRefs (Int_t event)

void DumpTrigger (Int_t event)

Bool_t GetEvent (Int_t event=0)

Int_t NumberOfParticles ()

TParticle * Particle (Int_t index)

Int_t NumberOfTracks ()

Int_t NumberOfHits (Int_t track)

AliMUONHitHit (Int_t track, Int_t index)

Int_t NumberOfSDigits (Int_t detElemId)

AliMUONVDigitSDigit (Int_t detElemId, Int_t index)

Int_t NumberOfSDigits (Int_t chamber, Int_t cathode)

AliMUONVDigitSDigit (Int_t chamber, Int_t cathode, Int_t index)

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 NumberOfLocalTriggers ()

AliMUONLocalTriggerLocalTrigger (Int_t index)

Int_t NumberOfRegionalTriggers ()

AliMUONRegionalTriggerRegionalTrigger (Int_t index)

AliMUONGlobalTriggerGlobalTrigger ()

Int_t NumberOfTrackRefs ()

TClonesArray * TrackRefs (Int_t track)

## Private Types

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

## Private Member Functions

AliMUONMCDataInterface (const AliMUONMCDataInterface &)
Not implemented. More...

AliMUONMCDataInterfaceoperator= (const AliMUONMCDataInterface &)
Not implemented. More...

void DumpSorted (const AliMUONVStore &store) const

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)

## Private Attributes

! Tree accessor More...

AliMUONVHitStorefHitStore
! current hit store (owner) More...

AliMUONVDigitStorefSDigitStore
! current sdigit store (owner) More...

AliMUONVDigitStorefDigitStore
! current digit store (owner) More...

AliMUONVTriggerStorefTriggerStore
! current trigger store (owner) More...

TClonesArray * fTrackRefs
! current trackrefs (owner) More...

Int_t fCurrentEvent
! Current event we've read in 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, detector element or track number. 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

Easy to use MC data accessor

Definition at line 39 of file AliMUONMCDataInterface.h.

## Member Enumeration Documentation

 private

The various identifiers for the type of iterator constructed.

Enumerator
kNoIterator

No iterator was constructed.

kHitIterator

An iterator to iterate over the hits.

kSDigitIteratorByDetectorElement

A summable digit iterator to iterate over the detector elements.

kSDigitIteratorByChamberAndCathode

A summable digit iterator to iterate over chambers and cathodes.

kDigitIteratorByDetectorElement

An iterator for simulated digits to iterate over the detector elements.

kDigitIteratorByChamberAndCathode

An iterator for simulated digits to iterate over chambers and cathodes.

kLocalTriggerIterator

An iterator for iterating over the simulated local triggers.

kRegionalTriggerIterator

An iterator for iterating over the simulated regional triggers.

Definition at line 106 of file AliMUONMCDataInterface.h.

## Constructor & Destructor Documentation

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

ctor

Definition at line 69 of file AliMUONMCDataInterface.cxx.

 AliMUONMCDataInterface::~AliMUONMCDataInterface ( )
virtual

dtor

Definition at line 103 of file AliMUONMCDataInterface.cxx.

 AliMUONMCDataInterface::AliMUONMCDataInterface ( const AliMUONMCDataInterface & )
private

Not implemented.

## Member Function Documentation

 Int_t AliMUONMCDataInterface::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 1104 of file AliMUONMCDataInterface.cxx.

 Int_t AliMUONMCDataInterface::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 any of the methods in this interface that have 'Int_t event' in the parameter list. GetEvent(Int_t event) for example.

Definition at line 56 of file AliMUONMCDataInterface.h.

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

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

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

Definition at line 800 of file AliMUONMCDataInterface.cxx.

Referenced by SimDigitsOk().

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

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

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

Definition at line 824 of file AliMUONMCDataInterface.cxx.

 AliMUONVDigitStore * AliMUONMCDataInterface::DigitStore ( Int_t event )

Return a pointer to the digitStore for a given event (or 0 if 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 215 of file AliMUONMCDataInterface.cxx.

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

Dump the digits for a given event, sorted if requested.

Definition at line 390 of file AliMUONMCDataInterface.cxx.

 void AliMUONMCDataInterface::DumpHits ( Int_t event )

Dump all the hits for one event

Definition at line 410 of file AliMUONMCDataInterface.cxx.

 void AliMUONMCDataInterface::DumpKine ( Int_t event )

Dump all generated particles for one event

Definition at line 429 of file AliMUONMCDataInterface.cxx.

 void AliMUONMCDataInterface::DumpSDigits ( Int_t event, Bool_t sorted = kTRUE )

Dump the SDigits for a given event, sorted if requested

Definition at line 451 of file AliMUONMCDataInterface.cxx.

 void AliMUONMCDataInterface::DumpSorted ( const AliMUONVStore & store ) const
private

Dump the given store in sorted order

Definition at line 471 of file AliMUONMCDataInterface.cxx.

Referenced by DumpDigits(), and DumpSDigits().

 void AliMUONMCDataInterface::DumpTrackRefs ( Int_t event )

Dump track references for one event

Definition at line 492 of file AliMUONMCDataInterface.cxx.

 void AliMUONMCDataInterface::DumpTrigger ( Int_t event )

Dump trigger for a given event (trigger is read from TreeD)

Definition at line 509 of file AliMUONMCDataInterface.cxx.

 TObject * AliMUONMCDataInterface::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
 iter The iterator to fetch an object from. index The index number of the object to fetch in the range [0 .. N-1] where N = CountObjects(iter)

Definition at line 1119 of file AliMUONMCDataInterface.cxx.

Referenced by Digit(), Hit(), LocalTrigger(), RegionalTrigger(), and SDigit().

 Bool_t AliMUONMCDataInterface::GetEvent ( Int_t event = 0 )

Loads all simulated data for the given event.

Definition at line 674 of file AliMUONMCDataInterface.cxx.

Referenced by SimDigitsOk(), SimHitsOk(), SimSDigitsOk(), and SimTriggersOk().

 TIterator * AliMUONMCDataInterface::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
 type The type of iterator to create. x This is the detector element ID if type equals kDigitIteratorByDetectorElement or kSDigitIteratorByDetectorElement. If type equals kDigitIteratorByChamberAndCathode or kSDigitIteratorByChamberAndCathode then this is the chamber number. For type == kHitIterator the parameter x is the track number. In all other cases this parameter is ignored. y If type equals kDigitIteratorByChamberAndCathode or kSDigitIteratorByChamberAndCathode then this parameter is the cathode number. In all other cases this parameter is ignored.

Definition at line 940 of file AliMUONMCDataInterface.cxx.

 AliMUONGlobalTrigger * AliMUONMCDataInterface::GlobalTrigger ( )

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

Definition at line 878 of file AliMUONMCDataInterface.cxx.

Referenced by SimTriggersOk().

 AliMUONHit * AliMUONMCDataInterface::Hit ( Int_t track, Int_t index )

Returns a pointer to the index'th hit object.

Parameters
 track The track number in the range [0 .. N-1] where N = NumberOfTracks() index The index number of the hit in the range [0 ... M-1] where M = NumberOfHits(track)

Definition at line 729 of file AliMUONMCDataInterface.cxx.

Referenced by SimHitsOk().

 AliMUONVHitStore * AliMUONMCDataInterface::HitStore ( Int_t event, Int_t track )

Return the hitStore for a given track of one event Return 0x0 if event and/or track 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 111 of file AliMUONMCDataInterface.cxx.

Referenced by DumpHits(), GetEvent(), GetIterator(), MUONTriggerEfficiency(), MUONTriggerEfficiencyPt(), and SimHitsOk().

 Bool_t AliMUONMCDataInterface::IsValid ( ) const
inline

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

Definition at line 48 of file AliMUONMCDataInterface.h.

 Bool_t AliMUONMCDataInterface::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 523 of file AliMUONMCDataInterface.cxx.

 AliMUONLocalTrigger * AliMUONMCDataInterface::LocalTrigger ( Int_t index )

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

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

Definition at line 847 of file AliMUONMCDataInterface.cxx.

Referenced by SimTriggersOk().

 Int_t AliMUONMCDataInterface::NumberOfDigits ( Int_t detElemId )

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

Parameters
 detElemId The detector element ID number to search on.

Definition at line 790 of file AliMUONMCDataInterface.cxx.

Referenced by SimDigitsOk().

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

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

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

Definition at line 812 of file AliMUONMCDataInterface.cxx.

 Int_t AliMUONMCDataInterface::NumberOfEvents ( ) const

Number of events in the file we're connected to

Definition at line 543 of file AliMUONMCDataInterface.cxx.

 Int_t AliMUONMCDataInterface::NumberOfHits ( Int_t track )

Returns the number of hits for a given primary track/particle.

Parameters
 track The track number in the range [0 .. N-1] where N = NumberOfTracks()

Definition at line 717 of file AliMUONMCDataInterface.cxx.

Referenced by SimHitsOk().

 Int_t AliMUONMCDataInterface::NumberOfLocalTriggers ( )

Returns the number of simulated local trigger objects.

Definition at line 838 of file AliMUONMCDataInterface.cxx.

Referenced by SimTriggersOk().

 Int_t AliMUONMCDataInterface::NumberOfParticles ( )

Returns the total number of particles in the kinematics tree.

Definition at line 687 of file AliMUONMCDataInterface.cxx.

 Int_t AliMUONMCDataInterface::NumberOfRegionalTriggers ( )

Returns the number of simulated regional trigger objects.

Definition at line 858 of file AliMUONMCDataInterface.cxx.

Referenced by SimTriggersOk().

 Int_t AliMUONMCDataInterface::NumberOfSDigits ( Int_t detElemId )

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

Parameters
 detElemId The detector element ID number to search on.

Definition at line 742 of file AliMUONMCDataInterface.cxx.

Referenced by SimSDigitsOk().

 Int_t AliMUONMCDataInterface::NumberOfSDigits ( Int_t chamber, Int_t cathode )

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

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

Definition at line 764 of file AliMUONMCDataInterface.cxx.

 Int_t AliMUONMCDataInterface::NumberOfTrackRefs ( Int_t event )

Number of track references in the event

Definition at line 584 of file AliMUONMCDataInterface.cxx.

 Int_t AliMUONMCDataInterface::NumberOfTrackRefs ( )

Number of track references in the currently selected event.

Definition at line 888 of file AliMUONMCDataInterface.cxx.

Referenced by DumpTrackRefs().

 Int_t AliMUONMCDataInterface::NumberOfTracks ( Int_t event )

Number of tracks in the event

Definition at line 552 of file AliMUONMCDataInterface.cxx.

Referenced by MUONTriggerEfficiency(), MUONTriggerEfficiencyPt(), and SimHitsOk().

 Int_t AliMUONMCDataInterface::NumberOfTracks ( )

Returns the number of primary tracks (from primary particles) in the current event.

Definition at line 709 of file AliMUONMCDataInterface.cxx.

Referenced by DumpHits().

 void AliMUONMCDataInterface::Open ( const char * filename )

Connect to a given galice.root file

Definition at line 616 of file AliMUONMCDataInterface.cxx.

 AliMUONMCDataInterface& AliMUONMCDataInterface::operator= ( const AliMUONMCDataInterface & )
private

Not implemented.

 TParticle * AliMUONMCDataInterface::Particle ( Int_t index )

Returns the index'th particle in the kinematics tree.

Parameters
 index The index number of the particle in the range [0 ... N-1] where N = NumberOfParticles()

Definition at line 697 of file AliMUONMCDataInterface.cxx.

 AliMUONRegionalTrigger * AliMUONMCDataInterface::RegionalTrigger ( Int_t index )

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

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

Definition at line 867 of file AliMUONMCDataInterface.cxx.

Referenced by SimTriggersOk().

 void AliMUONMCDataInterface::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 1091 of file AliMUONMCDataInterface.cxx.

Referenced by GetIterator(), and ResetStores().

 void AliMUONMCDataInterface::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 906 of file AliMUONMCDataInterface.cxx.

 AliMUONVDigit * AliMUONMCDataInterface::SDigit ( Int_t detElemId, Int_t index )

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

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

Definition at line 752 of file AliMUONMCDataInterface.cxx.

Referenced by SimSDigitsOk().

 AliMUONVDigit * AliMUONMCDataInterface::SDigit ( Int_t chamber, Int_t cathode, Int_t index )

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

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

Definition at line 776 of file AliMUONMCDataInterface.cxx.

 AliMUONVDigitStore * AliMUONMCDataInterface::SDigitStore ( Int_t event )

Return the SDigit store for a given event. Return 0 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 166 of file AliMUONMCDataInterface.cxx.

Referenced by DumpSDigits(), GetEvent(), GetIterator(), and SimSDigitsOk().

 AliStack * AliMUONMCDataInterface::Stack ( Int_t event )

Get the Stack (list of generated particles) for one event 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 263 of file AliMUONMCDataInterface.cxx.

Referenced by DumpKine(), NumberOfParticles(), and Particle().

 TClonesArray * AliMUONMCDataInterface::TrackRefs ( Int_t event, Int_t track )

Get the track references for a given (generated) track of one event 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 289 of file AliMUONMCDataInterface.cxx.

Referenced by DumpTrackRefs(), GetEvent(), and TrackRefs().

 TClonesArray * AliMUONMCDataInterface::TrackRefs ( Int_t track )

Returns the track references for a given track in the current event.

Parameters
 track The track to returns track references for. In the range [0 .. N-1] where N = NumberOfTrackRefs()

Definition at line 896 of file AliMUONMCDataInterface.cxx.

 AliMUONVTriggerStore * AliMUONMCDataInterface::TriggerStore ( Int_t event )

Return the triggerStore 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 341 of file AliMUONMCDataInterface.cxx.

## Member Data Documentation

 Int_t AliMUONMCDataInterface::fCurrentEvent
private

! Current event we've read in

Definition at line 141 of file AliMUONMCDataInterface.h.

 Int_t AliMUONMCDataInterface::fCurrentIndex
private

! A current index number maintained for certain iteration operations.

Definition at line 145 of file AliMUONMCDataInterface.h.

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

 IteratorType AliMUONMCDataInterface::fCurrentIteratorType
private

! The type of iterator that is currently set.

Definition at line 144 of file AliMUONMCDataInterface.h.

Referenced by GetIterator(), and ResetIterator().

 Int_t AliMUONMCDataInterface::fDataX
private

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

Definition at line 146 of file AliMUONMCDataInterface.h.

Referenced by GetIterator(), HitStore(), ResetIterator(), and TrackRefs().

 Int_t AliMUONMCDataInterface::fDataY
private

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

Definition at line 147 of file AliMUONMCDataInterface.h.

Referenced by GetIterator(), and ResetIterator().

 AliMUONVDigitStore* AliMUONMCDataInterface::fDigitStore
private

! current digit store (owner)

Definition at line 138 of file AliMUONMCDataInterface.h.

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

 Int_t AliMUONMCDataInterface::fgInstanceCounter
staticprivate

! To build unique folder name for each instance

Definition at line 150 of file AliMUONMCDataInterface.h.

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

 AliMUONVHitStore* AliMUONMCDataInterface::fHitStore
private

! current hit store (owner)

Definition at line 136 of file AliMUONMCDataInterface.h.

Referenced by DumpHits(), HitStore(), and ResetStores().

 Bool_t AliMUONMCDataInterface::fIsValid
private

! whether we were initialized properly or not

Definition at line 142 of file AliMUONMCDataInterface.h.

Referenced by IsValid(), and Open().

 TIterator* AliMUONMCDataInterface::fIterator
private

! Iterator for various iteration operations.

Definition at line 148 of file AliMUONMCDataInterface.h.

Referenced by GetIterator(), and ResetIterator().

private

! Tree accessor

Definition at line 135 of file AliMUONMCDataInterface.h.

 AliMUONVDigitStore* AliMUONMCDataInterface::fSDigitStore
private

! current sdigit store (owner)

Definition at line 137 of file AliMUONMCDataInterface.h.

Referenced by DumpSDigits(), ResetStores(), and SDigitStore().

 TClonesArray* AliMUONMCDataInterface::fTrackRefs
private

! current trackrefs (owner)

Definition at line 140 of file AliMUONMCDataInterface.h.

Referenced by DumpTrackRefs(), ResetStores(), and TrackRefs().

 AliMUONVTriggerStore* AliMUONMCDataInterface::fTriggerStore
private

! current trigger store (owner)

Definition at line 139 of file AliMUONMCDataInterface.h.

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

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