// //
///////////////////////////////////////////////////////////////////////////////
+#include "AliCRT.h"
+
#include <TTree.h>
+#include <TVirtualMC.h>
#include "AliRun.h"
#include "AliMagF.h"
+//#include "AliMC.h"
-#include "AliCRT.h"
+//#include "AliCRThit.h"
+#include "AliCRTModule.h"
ClassImp(AliCRT)
//_____________________________________________________________________________
AliCRT::AliCRT()
- : AliDetector()
+ : AliDetector(),
+ fModule(0)
{
//
// Default constructor
//_____________________________________________________________________________
AliCRT::AliCRT(const char *name, const char *title)
- : AliDetector(name, title)
+ : AliDetector(name, title),
+ fModule(0)
{
//
// Standard constructor
//
+ //fHits = new TClonesArray("AliCRThit", 400);
+ //gAlice->GetMCApp()->AddHitList(fHits);
}
//_____________________________________________________________________________
AliCRT::AliCRT(const AliCRT& crt)
- : AliDetector(crt)
+ : AliDetector(crt),
+ fModule(crt.fModule)
{
//
// Copy constructor
//
// Default destructor
//
+ if ( fModule ) { delete fModule; fModule = 0; }
}
//_____________________________________________________________________________
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);
+}