#include "AliCRT.h"
#include <TTree.h>
+#include <TVirtualMC.h>
#include "AliRun.h"
#include "AliMagF.h"
+//#include "AliMC.h"
+//#include "AliCRThit.h"
#include "AliCRTModule.h"
ClassImp(AliCRT)
//
// Standard constructor
//
+ //fHits = new TClonesArray("AliCRThit", 400);
+ //gAlice->GetMCApp()->AddHitList(fHits);
}
//_____________________________________________________________________________
TBranch *branch;
char branchname[20];
sprintf(branchname,"%s",GetName());
-
// Branch address for hit tree
TTree *treeH = fLoader->TreeH();
- if (treeH && fHits) {
+ if (treeH ) {
branch = treeH->GetBranch(branchname);
if (branch) branch->SetAddress(&fHits);
}
}
+
+//_____________________________________________________________________________
+void AliCRT::MakeBranch(Option_t* opt)
+{
+ //
+ // Initializes the branches of the CRT inside the trees written
+ // for each event.
+ //
+ const char* oH = strstr(opt, "H");
+ if ( fLoader->TreeH() && oH && (fHits == 0x0) ) {
+ fHits = new TClonesArray("AliCRThit", 1000);
+ fNhits = 0;
+ }
+ AliDetector::MakeBranch(opt);
+}
AliCRT& operator=(const AliCRT& crt);
virtual void CreateMaterials();
- virtual Int_t IsVersion() const { return 0; }
+ virtual Int_t IsVersion() const { return -1; }
virtual TString Version() { return TString(""); }
virtual void SetTreeAddress();
virtual void SetModule(AliCRTModule* module) {fModule = module;}
virtual const AliCRTModule* GetModule() const {return fModule; }
+ virtual void MakeBranch(Option_t* opt = "");
protected:
AliCRTModule* fModule;