fHistograms(0),
fNodes(0),
fEnable(1),
- fTrackReferences(0),
fMaxIterTrackRef(0),
fCurrentIterTrackRef(0),
fRunLoader(0)
fHistograms(new TList()),
fNodes(new TList()),
fEnable(1),
- fTrackReferences(new TClonesArray("AliTrackReference", 100)),
fMaxIterTrackRef(0),
fCurrentIterTrackRef(0),
fRunLoader(0)
delete fHistograms;
fHistograms = 0;
}
- // Delete track references
- if (fTrackReferences) {
- fTrackReferences->Delete();
- delete fTrackReferences;
- fTrackReferences = 0;
- }
// Delete TArray objects
delete fIdtmed;
delete fIdmate;
return (gAlice->GetMCApp()->AddTrackReference(label, id));
}
- //_______________________________________________________________________
-AliTrackReference* AliModule::FirstTrackReference(Int_t track)
-{
- //
- // Initialise the hit iterator
- // Return the address of the first hit for track
- // If track>=0 the track is read from disk
- // while if track0 the first hit of the current
- // track is returned
- //
- if(track>=0)
- {
- if (fRunLoader == 0x0)
- AliFatal("AliRunLoader not initialized. Can not proceed");
- fRunLoader->GetAliRun()->GetMCApp()->ResetTrackReferences();
- fRunLoader->TreeTR()->GetEvent(track);
- }
- //
- fMaxIterTrackRef = fTrackReferences->GetEntriesFast();
- fCurrentIterTrackRef = 0;
- if(fMaxIterTrackRef) return dynamic_cast<AliTrackReference*>(fTrackReferences->UncheckedAt(0));
- else return 0;
-}
-
- //_______________________________________________________________________
-AliTrackReference* AliModule::NextTrackReference()
-{
- //
- // Return the next hit for the current track
- //
- if(fMaxIterTrackRef) {
- if(++fCurrentIterTrackRef < fMaxIterTrackRef)
- return dynamic_cast<AliTrackReference*>(fTrackReferences->UncheckedAt(fCurrentIterTrackRef));
- else
- return 0;
- } else {
- AliWarning("Iterator called without calling FistTrackReference before");
- return 0;
- }
-}
-
-
-
-
//_____________________________________________________________________________
TTree* AliModule::TreeTR()
{
#include <Riostream.h>
#include <TNamed.h>
+#include <TClonesArray.h>
#include "AliLog.h"
#include "AliTriggerDetector.h"
-class TClonesArray;
class TBrowser;
class TArrayI;
class TFile;
virtual ~AliModule();
// Inline functions
- virtual int GetNdigits() const {return 0;}
- virtual int GetNhits() const {return 0;}
+ virtual Int_t GetNdigits() const {return 0;}
+ virtual Int_t GetNhits() const {return 0;}
virtual TArrayI *GetIdtmed() const {return fIdtmed;}
virtual TList *Histograms() const {return fHistograms;}
virtual TList *Nodes() const {return fNodes;}
virtual void ReadEuclid(const char *filnam, char *topvol);
virtual void ReadEuclidMedia(const char *filnam);
// Track reference related
- TClonesArray *TrackReferences() const {return fTrackReferences;}
virtual AliTrackReference * AddTrackReference(Int_t label, Int_t id = -999);
- virtual AliTrackReference * FirstTrackReference(Int_t track);
- virtual AliTrackReference * NextTrackReference();
TTree* TreeTR(); //shorcut method for accessing treeTR from folder
-
void SetRunLoader(AliRunLoader* runLoader)
{fRunLoader = runLoader;}
TList *fHistograms; //List of histograms
TList *fNodes; //List of geometry nodes
Bool_t fEnable; //StepManager enabling flag
- TClonesArray *fTrackReferences; //!list of track references - for one primary track only -MI
Int_t fMaxIterTrackRef; //!for track refernce iterator routines
Int_t fCurrentIterTrackRef; //!for track refernce iterator routines
// else
// AliDebug(1,"fHitType&2 Failed (can not find branch)");
// }
- //set address to TREETR
-
- TTree *treeTR = TreeTR();
- if (treeTR && fTrackReferences) {
- branch = treeTR->GetBranch(GetName());
- if (branch) branch->SetAddress(&fTrackReferences);
- }
-
}
void AliTPC::FinishPrimary()