#include <TBRIK.h>
#include <TClonesArray.h>
-#include <TFile.h>
#include <TGeometry.h>
#include <TNode.h>
#include <TTree.h>
#include <TVirtualMC.h>
-#include "AliConst.h"
+#include "AliLog.h"
#include "AliLoader.h"
#include "AliPMDLoader.h"
#include "AliPMD.h"
-#include "AliPMDRecPoint.h"
#include "AliRun.h"
#include "AliMC.h"
#include "AliPMDDigitizer.h"
#include "AliPMDhit.h"
+#include "AliPMDDDLRawData.h"
ClassImp(AliPMD)
//
fIshunt = 0;
- fRecPoints = 0;
-
}
//_____________________________________________________________________________
fHits = new TClonesArray("AliPMDhit", 405);
gAlice->GetMCApp()->AddHitList(fHits);
- fRecPoints = new TClonesArray("AliPMDRecPoint",10000);
- fNRecPoints = 0;
-
fIshunt = 0;
if (fLoader)
{
- cout<<"Success"<<endl;
+ AliInfo("Success");
}
else
{
- cout<<"Failure"<<endl;
+ AliError("Failure");
}
return fLoader;
AliPMD::~AliPMD()
{
//
- // Default constructor
+ // Destructor
//
- delete fRecPoints;
- fNRecPoints=0;
}
//_____________________________________________________________________________
//
}
-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
- const char *cR = strstr(option,"R");
const char *cH = strstr(option,"H");
if (cH && fLoader->TreeH() && (fHits == 0x0))
fHits = new TClonesArray("AliPMDhit", 405);
AliDetector::MakeBranch(option);
-
- if (cR && fLoader->TreeR()) {
- printf("Make Branch - TreeR address %p\n",fLoader->TreeR());
-
- const Int_t kBufferSize = 4000;
- char branchname[30];
-
- sprintf(branchname,"%sRecPoints",GetName());
- if (fRecPoints == 0x0) {
- fRecPoints = new TClonesArray("AliPMDRecPoint",10000);
- }
- MakeBranchInTree(fLoader->TreeR(), branchname, &fRecPoints, kBufferSize,0);
- }
}
void AliPMD::SetTreeAddress()
{
- // Set branch address for the TreeR
- char branchname[30];
-
+ // Set branch address
+
if (fLoader->TreeH() && fHits==0x0)
fHits = new TClonesArray("AliPMDhit", 405);
AliDetector::SetTreeAddress();
-
- TBranch *branch;
- TTree *treeR = fLoader->TreeR();
-
- sprintf(branchname,"%s",GetName());
- if (treeR) {
- branch = treeR->GetBranch(branchname);
- if (branch)
- {
- if (fRecPoints == 0x0) {
- fRecPoints = new TClonesArray("AliPMDRecPoint",10000);
- }
- branch->SetAddress(&fRecPoints);
- }
- }
}
-void AliPMD::ResetHits()
-{
- //
- // Reset number of hits and the hits array
- //
- AliDetector::ResetHits();
- fNRecPoints = 0;
- if (fRecPoints) fRecPoints->Clear();
-}
//____________________________________________________________________________
void AliPMD::Hits2SDigits()
{
return new AliPMDDigitizer(manager);
}
// ---------------------------------------------------------------------------
+void AliPMD::Digits2Raw()
+{
+// convert digits of the current event to raw data
+
+ fLoader->LoadDigits();
+ TTree* digits = fLoader->TreeD();
+ if (!digits) {
+ AliError("No digits tree");
+ return;
+ }
+
+ AliPMDDDLRawData rawWriter;
+ rawWriter.WritePMDRawData(digits);
+
+ fLoader->UnloadDigits();
+}
+