52 #include <Riostream.h> 53 #include <TClonesArray.h> 55 #include <TParticle.h> 56 #include <TIterator.h> 79 fCurrentIteratorType(kNoIterator),
91 AliFatal(
"CDB default storage not defined.");
98 AliFatal(
"Could not access mapping from OCDB !");
146 AliDebug(1,
"Creating hitStore from treeH");
150 if ( treeH->GetEvent(track) == 0 )
152 AliError(Form(
"Could not read track %d",track));
274 if ( not
IsValid() )
return 0x0;
300 if ( not
IsValid() )
return 0x0;
321 if ( treeTR->GetEvent(track) > 0 )
323 TBranch* branch = treeTR->GetBranch(
"TrackReferences");
325 branch->GetEvent(track);
416 for ( Int_t i = 0; i < ntracks; ++i )
418 cout <<
">> Track " << i << endl;
436 Int_t nparticles = (Int_t) stack->
GetNtrack();
438 for (Int_t iparticle=0; iparticle<nparticles; ++iparticle)
440 stack->
Particle(iparticle)->Print(
"");
478 list.SetOwner(kFALSE);
480 while ( (
object = next() ) )
497 for ( Int_t i = 0; i < ntrackrefs; ++i )
570 rv =
static_cast<Int_t
>(treeH->GetEntries());
602 rv =
static_cast<Int_t
>(treeTR->GetEntries());
641 if (runLoader == 0x0)
643 AliError(Form(
"Cannot open file %s",filename));
663 AliError(
"Cannot get AliMUONLoader");
669 AliError(Form(
"Could not access %s filename. Object is unuseable",filename));
678 if (
HitStore(event, 0) == 0x0)
return kFALSE;
682 if (
TrackRefs(event, 0) == 0x0)
return kFALSE;
692 if ( stack == 0x0 )
return -1;
704 if ( stack == 0x0 )
return 0x0;
705 return static_cast<TParticle*
>( stack->
Particle(index) );
883 if (store == 0x0)
return 0x0;
962 AliError(
"No event was selected. Try first using GetEvent().");
974 if (store == 0x0)
return 0x0;
985 if (store == 0x0)
return 0x0;
1000 "Must have give a chamber value in the range [0..%d], but got a value of: %d",
1006 if (cathode < 0 or 1 < cathode)
1008 AliError(Form(
"Must have give a cathode value in the range [0..1], but got a value of: %d", cathode));
1013 if (store == 0x0)
return 0x0;
1027 if (store == 0x0)
return 0x0;
1042 "Must have give a chamber value in the range [0..%d], but got a value of: %d",
1048 if (cathode < 0 or 1 < cathode)
1050 AliError(Form(
"Must have give a cathode value in the range [0..1], but got a value of: %d", cathode));
1055 if (store == 0x0)
return 0x0;
1068 if (store == 0x0)
return 0x0;
1078 if (store == 0x0)
return 0x0;
1109 if (iter == 0x0)
return -1;
1112 while ( iter->Next() != 0x0 ) count++;
1134 AliError(Form(
"Index is out of bounds. Got a value of %d.", index));
1138 if (iter == 0x0)
return 0x0;
1145 TObject*
object = 0x0;
1148 object = iter->Next();
1151 AliError(Form(
"Index is out of bounds. Got a value of %d.", index));
AliMUONVDigitStore * SDigitStore(Int_t event)
TClonesArray * fTrackRefs
! current trackrefs (owner)
virtual TIterator * CreateIterator() const =0
Return an iterator to loop over the whole store.
virtual TIterator * CreateRegionalIterator() const =0
Create iterator on regional trigger.
static Int_t NofChambers()
Return number of chambers.
AliLoader * fLoader
! Tree accessor
TFile * Open(const char *filename, Long64_t &nevents)
void DumpHits(Int_t event)
virtual TIterator * CreateLocalIterator() const =0
Create iterator on local trigger.
Int_t NumberOfHits(Int_t track)
Interface for a digit container.
No iterator was constructed.
Virtual store to hold digit.
virtual void Print(Option_t *wildcard="") const
Print all objects whose name matches wildcard.
TIterator * GetIterator(IteratorType type, Int_t x=0, Int_t y=0)
AliMUONVDigit * Digit(Int_t detElemId, Int_t index)
AliMUONVDigitStore * fDigitStore
! current digit store (owner)
void DumpTrigger(Int_t event)
Int_t NumberOfTrackRefs()
void Open(const char *filename)
An iterator for iterating over the simulated regional triggers.
static MpPair_t GetDetElemIdRange(Int_t chamberId)
AliLoader * GetDetectorLoader(const char *detname)
An iterator for simulated digits to iterate over the detector elements.
Int_t fDataY
! Extra data parameter about the iterator, can be the cathode number.
static Int_t fgInstanceCounter
! To build unique folder name for each instance
TParticle * Particle(Int_t index)
AliMUONVTriggerStore * TriggerStore(Int_t event)
AliMUONRegionalTrigger * RegionalTrigger(Int_t index)
void DumpSorted(const AliMUONVStore &store) const
An iterator for simulated digits to iterate over chambers and cathodes.
AliMUONGlobalTrigger * GlobalTrigger()
virtual ~AliMUONMCDataInterface()
Base class of a trigger information store.
TClonesArray * TrackRefs(Int_t event, Int_t track)
virtual TIterator * CreateIterator() const =0
Create an iterator to loop over all our digits.
static AliRunLoader * Open(const char *filename="galice.root", const char *eventfoldername=AliConfig::GetDefaultEventFolderName(), Option_t *option="READ")
AliMUONVDigitStore * fSDigitStore
! current sdigit store (owner)
AliMUONVDigitStore * DigitStore(Int_t event)
AliMUONVHitStore * fHitStore
! current hit store (owner)
Reconstructed regional Trigger object.
Int_t CountObjects(TIterator *iter)
Int_t LoadSDigits(Option_t *opt="")
virtual Int_t GetNtrack() const
AliMUONHit * Hit(Int_t track, Int_t index)
Reconstructed Local Trigger object.
Int_t NumberOfSDigits(Int_t detElemId)
void UnloadDigits() const
virtual AliMUONVDigitStore * Create() const =0
Create an (empty) object of the same concrete class as *this.
virtual AliMUONVStore * Create() const =0
Create an empty copy of this.
IteratorType
The various identifiers for the type of iterator constructed.
Int_t fDataX
! Extra data parameter about the iterator, can be the chamber number, detector element or track numbe...
AliHeader * GetHeader() const
AliRunLoader * GetRunLoader()
Int_t NumberOfRegionalTriggers()
void DumpDigits(Int_t event, Bool_t sorted=kTRUE)
virtual AliMUONGlobalTrigger * Global() const =0
Return global trigger.
An iterator for iterating over the simulated local triggers.
AliMUONVTriggerStore * fTriggerStore
! current trigger store (owner)
Int_t GetNumberOfEvents()
void DumpKine(Int_t event)
An iterator to iterate over the hits.
#define AliFatal(message)
Int_t LoadHits(Option_t *opt="")
IteratorType fCurrentIteratorType
! The type of iterator that is currently set.
TIterator * fIterator
! Iterator for various iteration operations.
Int_t GetEvent(Int_t evno)
Int_t NumberOfParticles()
Bool_t IsValid() const
Returns true if the data interface was able to open the root file correctly.
TParticle * Particle(Int_t id, Bool_t useInEmbedding=kFALSE)
#define AliDebug(logLevel, message)
void DumpSDigits(Int_t event, Bool_t sorted=kTRUE)
Bool_t fIsValid
! whether we were initialized properly or not
Easy to use data access to MC information.
void DumpTrackRefs(Int_t event)
Int_t PairFirst(MpPair_t pair)
Decode the first integer from encoded pair.
Int_t LoadTrackRefs(Option_t *option="READ")
virtual TIterator * CreateIterator() const =0
Return an iterator to loop over hits.
Bool_t GetEvent(Int_t event=0)
void UnloadSDigits() const
virtual void Print(Option_t *wildcard="") const
Print all objects whose name matches wildcard.
Int_t NumberOfDigits(Int_t detElemId)
AliMUONVHitStore * HitStore(Int_t event, Int_t track)
TObject * FetchObject(TIterator *iter, Int_t index)
AliMUONVDigit * SDigit(Int_t detElemId, Int_t index)
AliStack * Stack(Int_t event)
virtual void Clear(Option_t *opt="")=0
Clear ourselves (i.e. Reset)
#define AliError(message)
Int_t PairSecond(MpPair_t pair)
Decode the second integer from encoded pair.
Bool_t LoadEvent(Int_t event)
Int_t LoadDigits(Option_t *opt="")
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
Int_t NumberOfLocalTriggers()
static AliRunLoader * GetRunLoader(const char *eventfoldername)
Base class for MUON data stores.
Int_t fCurrentIndex
! A current index number maintained for certain iteration operations.
Int_t fCurrentEvent
! Current event we've read in
virtual Bool_t Connect(TTree &tree, Bool_t alone=kTRUE) const
Connect us to a TTree (only valid if CanConnect()==kTRUE)
A summable digit iterator to iterate over chambers and cathodes.
static Bool_t LoadMpSegmentation(Bool_t warn=false)
A summable digit iterator to iterate over the detector elements.
AliMUONLocalTrigger * LocalTrigger(Int_t index)
Int_t LoadKinematics(Option_t *option="READ")
Int_t NumberOfEvents() const