/*
$Log$
+Revision 1.8 2000/10/20 06:24:40 fca
+Put the PMD at the right position in the event display
+
Revision 1.7 2000/10/02 21:28:12 fca
Removal of useless dependecies via forward declarations
#include <TBRIK.h>
#include <TNode.h>
+#include <TTree.h>
#include <TGeometry.h>
+#include <TClonesArray.h>
#include "AliPMD.h"
#include "AliRun.h"
#include "AliMC.h"
#include "AliConst.h"
-
+#include "AliPMDRecPoint.h"
+
ClassImp(AliPMD)
//_____________________________________________________________________________
// Allocate the array of hits
fHits = new TClonesArray("AliPMDhit", 405);
gAlice->AddHitList(fHits);
+
+ fRecPoints = new TClonesArray("AliPMDRecPoint",10000);
+ fNRecPoints = 0;
+
fIshunt = 1;
fPar[0] = 1;
fPadSize[3] = 1.5;
}
+AliPMD::~AliPMD()
+{
+ //
+ // Default constructor
+ //
+ delete fRecPoints;
+ fNRecPoints=0;
+}
+
//_____________________________________________________________________________
void AliPMD::AddHit(Int_t track, Int_t *vol, Float_t *hits)
{
//
}
+void AliPMD::AddRecPoint(const AliPMDRecPoint &p)
+{
+ //
+ // Add a PMD reconstructed hit to the list
+ //
+ TClonesArray &lrecpoints = *fRecPoints;
+ new(lrecpoints[fNRecPoints++]) AliPMDRecPoint(p);
+}
+
+void AliPMD::MakeBranch(Option_t* option)
+{
+ // Create Tree branches for the PMD
+ printf("Make Branch - TreeR address %p\n",gAlice->TreeR());
+
+ const Int_t kBufferSize = 4000;
+ char branchname[30];
+
+ AliDetector::MakeBranch(option);
+
+ sprintf(branchname,"%sRecPoints",GetName());
+ if (fRecPoints && gAlice->TreeR()) {
+ gAlice->TreeR()->Branch(branchname, &fRecPoints, kBufferSize);
+ printf("Making Branch %s for reconstructed hits\n",branchname);
+ }
+}
+
+
+void AliPMD::SetTreeAddress()
+{
+ // Set branch address for the TreeR
+ char branchname[30];
+ AliDetector::SetTreeAddress();
+
+ TBranch *branch;
+ TTree *treeR = gAlice->TreeR();
+
+ sprintf(branchname,"%s",GetName());
+ if (treeR && fRecPoints) {
+ branch = treeR->GetBranch(branchname);
+ if (branch) branch->SetAddress(&fRecPoints);
+ }
+}
+
+void AliPMD::ResetHits()
+{
+ //
+ // Reset number of hits and the hits array
+ //
+ fNRecPoints = 0;
+ if (fRecPoints) fRecPoints->Clear();
+}
+
///////////////////////////////////////////////////////////////////////////////
// //
// Photon Multiplicity Detector Version 1 //
// //
///////////////////////////////////////////////////////////////////////////////
+
+
ClassImp(AliPMDhit)
//_____________________________________________________________________________