/*
$Log$
+Revision 1.14 2001/03/12 17:46:22 hristov
+Changes needed on Sun with CC 5.0
+
+Revision 1.13 2001/01/26 20:02:43 hristov
+Major upgrade of AliRoot code
+
+Revision 1.12 2000/12/04 08:48:18 alibrary
+Fixing problems in the HEAD
+
+Revision 1.11 2000/11/17 10:15:24 morsch
+Call to AliDetector::ResetHits() added to method AliPMD::ResetHits()
+
+Revision 1.10 2000/11/06 09:07:13 morsch
+Set fRecPoints to zero in default constructor.
+
+Revision 1.9 2000/10/30 09:03:59 morsch
+Prototype for PMD reconstructed hits (AliPMDRecPoint) added.
+
+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 <TFile.h>
#include "AliPMD.h"
#include "AliRun.h"
#include "AliMC.h"
#include "AliConst.h"
-
+#include "AliPMDRecPoint.h"
+
ClassImp(AliPMD)
//_____________________________________________________________________________
// Default constructor
//
fIshunt = 0;
+
+ // Always make the TClonesArray, otherwise the automatic streamer gets angry
+ fRecPoints = new TClonesArray("AliPMDRecPoint",10000);
+
}
//_____________________________________________________________________________
// 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, const char *file)
+{
+ // Create Tree branches for the PMD
+
+ const char *cR = strstr(option,"R");
+
+ AliDetector::MakeBranch(option,file);
+
+ if (cR) {
+ printf("Make Branch - TreeR address %p\n",gAlice->TreeR());
+
+ const Int_t kBufferSize = 4000;
+ char branchname[30];
+
+ sprintf(branchname,"%sRecPoints",GetName());
+ if (fRecPoints && gAlice->TreeR()) {
+ MakeBranchInTree(gAlice->TreeR(),
+ branchname, &fRecPoints, kBufferSize, file);
+ }
+ }
+}
+
+
+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
+ //
+ AliDetector::ResetHits();
+ fNRecPoints = 0;
+ if (fRecPoints) fRecPoints->Clear();
+}
+
///////////////////////////////////////////////////////////////////////////////
// //
// Photon Multiplicity Detector Version 1 //
// //
///////////////////////////////////////////////////////////////////////////////
+
+
ClassImp(AliPMDhit)
//_____________________________________________________________________________