![]() |
AliRoot Core
3dc7879 (3dc7879)
|
Easy to use data access to MC information. More...
#include <AliMUONMCDataInterface.h>
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) |
AliMUONVHitStore * | HitStore (Int_t event, Int_t track) |
AliMUONVDigitStore * | SDigitStore (Int_t event) |
AliMUONVDigitStore * | DigitStore (Int_t event) |
AliStack * | Stack (Int_t event) |
TClonesArray * | TrackRefs (Int_t event, Int_t track) |
AliMUONVTriggerStore * | TriggerStore (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) |
AliMUONHit * | Hit (Int_t track, Int_t index) |
Int_t | NumberOfSDigits (Int_t detElemId) |
AliMUONVDigit * | SDigit (Int_t detElemId, Int_t index) |
Int_t | NumberOfSDigits (Int_t chamber, Int_t cathode) |
AliMUONVDigit * | SDigit (Int_t chamber, Int_t cathode, Int_t index) |
Int_t | NumberOfDigits (Int_t detElemId) |
AliMUONVDigit * | Digit (Int_t detElemId, Int_t index) |
Int_t | NumberOfDigits (Int_t chamber, Int_t cathode) |
AliMUONVDigit * | Digit (Int_t chamber, Int_t cathode, Int_t index) |
Int_t | NumberOfLocalTriggers () |
AliMUONLocalTrigger * | LocalTrigger (Int_t index) |
Int_t | NumberOfRegionalTriggers () |
AliMUONRegionalTrigger * | RegionalTrigger (Int_t index) |
AliMUONGlobalTrigger * | GlobalTrigger () |
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... | |
AliMUONMCDataInterface & | operator= (const AliMUONMCDataInterface &) |
Not implemented. More... | |
void | DumpSorted (const AliMUONVStore &store) const |
Bool_t | LoadEvent (Int_t event) |
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 | |
AliLoader * | fLoader |
! Tree accessor More... | |
AliMUONVHitStore * | fHitStore |
! current hit store (owner) More... | |
AliMUONVDigitStore * | fSDigitStore |
! current sdigit store (owner) More... | |
AliMUONVDigitStore * | fDigitStore |
! current digit store (owner) More... | |
AliMUONVTriggerStore * | fTriggerStore |
! 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... | |
Easy to use data access to MC information.
Easy to use MC data accessor
Definition at line 39 of file AliMUONMCDataInterface.h.
|
private |
The various identifiers for the type of iterator constructed.
Definition at line 106 of file AliMUONMCDataInterface.h.
AliMUONMCDataInterface::AliMUONMCDataInterface | ( | const char * | filename = "galice.root" | ) |
ctor
Definition at line 69 of file AliMUONMCDataInterface.cxx.
|
virtual |
dtor
Definition at line 103 of file AliMUONMCDataInterface.cxx.
|
private |
Not implemented.
|
private |
Counts the number of objects in the iterator and resets it.
Definition at line 1104 of file AliMUONMCDataInterface.cxx.
Referenced by NumberOfDigits(), NumberOfHits(), NumberOfLocalTriggers(), NumberOfRegionalTriggers(), and NumberOfSDigits().
|
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.
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 CurrentEvent(), and 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.
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
Definition at line 215 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent(), AliMUONTriggerGUIbdmap::DrawDigits(), AliMUONTriggerGUIdimap::DrawMaps(), DumpDigits(), GetEvent(), GetIterator(), and SimDigitsOk().
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.
Referenced by CurrentEvent().
void AliMUONMCDataInterface::DumpHits | ( | Int_t | event | ) |
Dump all the hits for one event
Definition at line 410 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent().
void AliMUONMCDataInterface::DumpKine | ( | Int_t | event | ) |
Dump all generated particles for one event
Definition at line 429 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent().
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.
Referenced by CurrentEvent().
|
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.
Referenced by CurrentEvent().
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.
Referenced by CurrentEvent().
|
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.
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 CurrentEvent(), SimDigitsOk(), SimHitsOk(), SimSDigitsOk(), and SimTriggersOk().
|
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.
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.
Referenced by Digit(), Hit(), LocalTrigger(), NumberOfDigits(), NumberOfHits(), NumberOfLocalTriggers(), NumberOfRegionalTriggers(), NumberOfSDigits(), RegionalTrigger(), and SDigit().
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 CurrentEvent(), and SimTriggersOk().
AliMUONHit * AliMUONMCDataInterface::Hit | ( | Int_t | track, |
Int_t | index | ||
) |
Returns a pointer to the index'th hit object.
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 CurrentEvent(), and 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
Definition at line 111 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent(), DumpHits(), GetEvent(), GetIterator(), MUONTriggerEfficiency(), MUONTriggerEfficiencyPt(), and SimHitsOk().
|
inline |
Returns true if the data interface was able to open the root file correctly.
Definition at line 48 of file AliMUONMCDataInterface.h.
Referenced by DigitStore(), HitStore(), LoadEvent(), MUONTriggerEfficiency(), MUONTriggerEfficiencyPt(), NumberOfEvents(), NumberOfTrackRefs(), NumberOfTracks(), Open(), SDigitStore(), Stack(), TrackRefs(), and TriggerStore().
|
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.
Referenced by DigitStore(), HitStore(), NumberOfTrackRefs(), NumberOfTracks(), SDigitStore(), Stack(), TrackRefs(), and TriggerStore().
AliMUONLocalTrigger * AliMUONMCDataInterface::LocalTrigger | ( | Int_t | index | ) |
Returns a pointer to the index'th simulated local trigger object.
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 CurrentEvent(), and SimTriggersOk().
Int_t AliMUONMCDataInterface::NumberOfDigits | ( | Int_t | detElemId | ) |
Returns the number of simulated digits to be found on a given detector element.
detElemId | The detector element ID number to search on. |
Definition at line 790 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent(), and 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.
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.
Referenced by AliMUONCheck::CheckKine(), IsValid(), MUONTriggerEfficiency(), MUONTriggerEfficiencyPt(), SimDigitsOk(), SimHitsOk(), SimSDigitsOk(), and SimTriggersOk().
Int_t AliMUONMCDataInterface::NumberOfHits | ( | Int_t | track | ) |
Returns the number of hits for a given primary track/particle.
track | The track number in the range [0 .. N-1] where N = NumberOfTracks() |
Definition at line 717 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent(), and SimHitsOk().
Int_t AliMUONMCDataInterface::NumberOfLocalTriggers | ( | ) |
Returns the number of simulated local trigger objects.
Definition at line 838 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent(), and SimTriggersOk().
Int_t AliMUONMCDataInterface::NumberOfParticles | ( | ) |
Returns the total number of particles in the kinematics tree.
Definition at line 687 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent().
Int_t AliMUONMCDataInterface::NumberOfRegionalTriggers | ( | ) |
Returns the number of simulated regional trigger objects.
Definition at line 858 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent(), and SimTriggersOk().
Int_t AliMUONMCDataInterface::NumberOfSDigits | ( | Int_t | detElemId | ) |
Returns the number of summable digits to be found on a given detector element.
detElemId | The detector element ID number to search on. |
Definition at line 742 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent(), and 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.
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 CurrentEvent(), and 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 CurrentEvent(), and DumpHits().
void AliMUONMCDataInterface::Open | ( | const char * | filename | ) |
Connect to a given galice.root file
Definition at line 616 of file AliMUONMCDataInterface.cxx.
|
private |
Not implemented.
TParticle * AliMUONMCDataInterface::Particle | ( | Int_t | index | ) |
Returns the index'th particle in the kinematics tree.
index | The index number of the particle in the range [0 ... N-1] where N = NumberOfParticles() |
Definition at line 697 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent().
AliMUONRegionalTrigger * AliMUONMCDataInterface::RegionalTrigger | ( | Int_t | index | ) |
Returns a pointer to the index'th simulated regional trigger object.
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 CurrentEvent(), and SimTriggersOk().
|
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().
|
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.
Referenced by DigitStore(), HitStore(), NumberOfTrackRefs(), NumberOfTracks(), Open(), SDigitStore(), Stack(), TrackRefs(), and TriggerStore().
AliMUONVDigit * AliMUONMCDataInterface::SDigit | ( | Int_t | detElemId, |
Int_t | index | ||
) |
Returns the a pointer to the index'th summable digit on the specified detector element.
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 CurrentEvent(), and 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.
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
Definition at line 166 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent(), 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
Definition at line 263 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent(), 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
Definition at line 289 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent(), DumpTrackRefs(), GetEvent(), and TrackRefs().
TClonesArray * AliMUONMCDataInterface::TrackRefs | ( | Int_t | track | ) |
Returns the track references for a given track in the current event.
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.
Definition at line 341 of file AliMUONMCDataInterface.cxx.
Referenced by CurrentEvent(), DumpTrigger(), GetEvent(), GetIterator(), GlobalTrigger(), AliMUONTriggerGUIbdmap::LocalTriggerInfo(), and SimTriggersOk().
|
private |
! Current event we've read in
Definition at line 141 of file AliMUONMCDataInterface.h.
Referenced by CurrentEvent(), DigitStore(), GetIterator(), GlobalTrigger(), HitStore(), LoadEvent(), NumberOfParticles(), NumberOfTrackRefs(), NumberOfTracks(), Open(), Particle(), SDigitStore(), Stack(), TrackRefs(), and TriggerStore().
|
private |
! A current index number maintained for certain iteration operations.
Definition at line 145 of file AliMUONMCDataInterface.h.
Referenced by CountObjects(), FetchObject(), and ResetIterator().
|
private |
! The type of iterator that is currently set.
Definition at line 144 of file AliMUONMCDataInterface.h.
Referenced by GetIterator(), and ResetIterator().
|
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().
|
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().
|
private |
! current digit store (owner)
Definition at line 138 of file AliMUONMCDataInterface.h.
Referenced by DigitStore(), DumpDigits(), and ResetStores().
|
staticprivate |
! To build unique folder name for each instance
Definition at line 150 of file AliMUONMCDataInterface.h.
Referenced by Open(), and ~AliMUONMCDataInterface().
|
private |
! current hit store (owner)
Definition at line 136 of file AliMUONMCDataInterface.h.
Referenced by DumpHits(), HitStore(), and ResetStores().
|
private |
! whether we were initialized properly or not
Definition at line 142 of file AliMUONMCDataInterface.h.
|
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.
Referenced by DigitStore(), HitStore(), LoadEvent(), NumberOfEvents(), NumberOfTrackRefs(), NumberOfTracks(), Open(), SDigitStore(), Stack(), TrackRefs(), and TriggerStore().
|
private |
! current sdigit store (owner)
Definition at line 137 of file AliMUONMCDataInterface.h.
Referenced by DumpSDigits(), ResetStores(), and SDigitStore().
|
private |
! current trackrefs (owner)
Definition at line 140 of file AliMUONMCDataInterface.h.
Referenced by DumpTrackRefs(), ResetStores(), and TrackRefs().
|
private |
! current trigger store (owner)
Definition at line 139 of file AliMUONMCDataInterface.h.
Referenced by DumpTrigger(), ResetStores(), and TriggerStore().