#include "AliMagF.h"
#include "AliRun.h"
#include "AliTRD.h"
-#include "AliTRDcluster.h"
-#include "AliTRDclusterizer.h"
#include "AliTRDdigit.h"
#include "AliTRDdigitizer.h"
#include "AliTRDdigitsManager.h"
#include "AliTRDgeometryHole.h"
#include "AliTRDhit.h"
#include "AliTRDpoints.h"
-#include "AliTRDrecPoint.h"
#include "AliTRDtrackHits.h"
+#include "AliTRDrawData.h"
#include "AliTrackReference.h"
#include "AliMC.h"
-#include "AliTRDclusterizerV1.h"
-#include "AliTRDparameter.h"
-#include "AliTRDtracker.h"
ClassImp(AliTRD)
fHits = 0;
fDigits = 0;
- fRecPoints = 0;
- fNRecPoints = 0;
-
fGeometry = 0;
fGasDensity = 0;
exit(1);
}
- // Define the TRD geometry according to the FRAME geometry
- if (frame->IsVersion() == 0) {
- // Geometry with hole
- fGeometry = new AliTRDgeometryHole();
- }
- else if (frame->IsVersion() == 1) {
- // Geometry without hole
+ // Define the TRD geometry
+ if ((frame->IsVersion() == 0) ||
+ (frame->IsVersion() == 1)) {
fGeometry = new AliTRDgeometryFull();
}
else {
exit(1);
}
+ // Save the geometry
+ TDirectory* saveDir = gDirectory;
+ gAlice->GetRunLoader()->CdGAFile();
+ fGeometry->Write("TRDgeometry");
+ saveDir->cd();
+
// Allocate the hit array
fHits = new TClonesArray("AliTRDhit" ,405);
gAlice->GetMCApp()->AddHitList(fHits);
// Allocate the digits array
fDigits = 0;
- // Allocate the rec point array
- fRecPoints = new TObjArray(400);
- fNRecPoints = 0;
-
fIshunt = 0;
fGasMix = 1;
delete fHits;
fHits = 0;
}
- if (fRecPoints) {
- delete fRecPoints;
- fRecPoints = 0;
- }
+// if (fRecPoints) {
+// delete fRecPoints;
+// fRecPoints = 0;
+// }
if (fTrackHits) {
delete fTrackHits;
fTrackHits = 0;
}
-//_____________________________________________________________________________
-void AliTRD::AddCluster(Float_t *pos, Int_t det, Float_t amp
- , Int_t *tracks, Float_t *sig, Int_t iType)
-{
- //
- // Add a cluster for the TRD
- //
-
- AliTRDcluster *c = new AliTRDcluster();
-
- c->SetDetector(det);
- c->AddTrackIndex(tracks);
- c->SetQ(amp);
- c->SetY(pos[0]);
- c->SetZ(pos[1]);
- c->SetSigmaY2(sig[0]);
- c->SetSigmaZ2(sig[1]);
- c->SetLocalTimeBin(((Int_t) pos[2]));
-
- switch (iType) {
- case 0:
- c->Set2pad();
- break;
- case 1:
- c->Set3pad();
- break;
- case 2:
- c->Set4pad();
- break;
- case 3:
- c->Set5pad();
- break;
- case 4:
- c->SetLarge();
- break;
- };
-
- fRecPoints->Add(c);
-
-}
-
//_____________________________________________________________________________
void AliTRD::Hits2Digits()
{
}
+//_____________________________________________________________________________
+void AliTRD::Digits2Raw()
+{
+ //
+ // convert digits of the current event to raw data
+ //
+
+ fLoader->LoadDigits();
+ TTree* digits = fLoader->TreeD();
+ if (!digits) {
+ Error("Digits2Raw", "no digits tree");
+ return;
+ }
+
+ AliTRDrawData rawWriter;
+// rawWriter.SetDebug(2);
+ if (!rawWriter.Digits2Raw(digits)) {
+ Error("AliTRD::Digits2Raw","The raw writer could not load the digits tree");
+ }
+
+ fLoader->UnloadDigits();
+
+}
+
//_____________________________________________________________________________
void AliTRD::AddHit(Int_t track, Int_t det, Float_t *hits, Int_t q
, Bool_t inDrift)
((AliTRD &) trd).fGasMix = fGasMix;
((AliTRD &) trd).fGeometry = fGeometry;
- ((AliTRD &) trd).fRecPoints = fRecPoints;
- ((AliTRD &) trd).fNRecPoints = fNRecPoints;
((AliTRD &) trd).fGasDensity = fGasDensity;
((AliTRD &) trd).fFoilDensity = fFoilDensity;
((AliTRD &) trd).fDrawTR = fDrawTR;
printf("\n");
}
- if (fGeometry->IsVersion() == 0) {
- printf("%s: Geometry for spaceframe with holes initialized\n",ClassName());
- }
- else if (fGeometry->IsVersion() == 1) {
- printf("%s: Geometry for spaceframe without holes initialized\n",ClassName());
+ if (fGeometry->IsVersion() == 1) {
+ printf("%s: Full geometry version initialized\n",ClassName());
if (fGeometry->GetPHOShole())
printf("%s: Leave space in front of PHOS free\n",ClassName());
if (fGeometry->GetRICHhole())
printf("%s: Leave space in front of RICH free\n",ClassName());
}
+ else {
+ printf("%s: Not a valid geometry\n",ClassName());
+ }
if (fGasMix == 1) {
printf("%s: Gas Mixture: 85%% Xe + 15%% CO2\n",ClassName());
}
-//_____________________________________________________________________________
-void AliTRD::ResetRecPoints()
-{
- //
- // Reset number of reconstructed points and the point array
- //
-
- if (fRecPoints) {
- fNRecPoints = 0;
- Int_t nentr = fRecPoints->GetEntriesFast();
- for (Int_t i = 0; i < nentr; i++) delete fRecPoints->RemoveAt(i);
- }
-
-}
-
//_____________________________________________________________________________
void AliTRD::SetTreeAddress()
{
// Set the branch addresses for the trees.
//
- Char_t branchname[15];
-
if ( fLoader->TreeH() && (fHits == 0x0)) fHits = new TClonesArray("AliTRDhit",405);
AliDetector::SetTreeAddress();
- TBranch *branch;
- TTree *treeR = fLoader->TreeR();
-
- if (treeR) {
- sprintf(branchname,"%scluster",GetName());
- if (fRecPoints == 0x0) fRecPoints = new TObjArray(400);
- if (fRecPoints) {
- branch = treeR->GetBranch(branchname);
- if (branch) {
- branch->SetAddress(&fRecPoints);
- }
- }
- }
-
if (fHitType > 0) {
SetTreeAddress2();
}
}
-//_____________________________________________________________________________
-void AliTRD::Reconstruct() const
-{
-// reconstruct clusters
-
- AliTRDclusterizerV1 clusterer("clusterer", "TRD clusterizer");
- AliRunLoader* runLoader = GetLoader()->GetRunLoader();
- runLoader->CdGAFile();
- AliTRDparameter* trdParam = (AliTRDparameter*) gFile->Get("TRDparameter");
- if (!trdParam) {
- Error("Reconstruct", "no TRD parameters found");
- return;
- }
- trdParam->ReInit();
- clusterer.SetParameter(trdParam);
- Int_t nEvents = runLoader->GetNumberOfEvents();
-
- for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
- clusterer.Open(runLoader->GetFileName(), iEvent);
- clusterer.ReadDigits();
- clusterer.MakeClusters();
- clusterer.WriteClusters(-1);
- }
-}
-
-//_____________________________________________________________________________
-AliTracker* AliTRD::CreateTracker() const
-{
-// create a TRD tracker
-
- GetLoader()->GetRunLoader()->CdGAFile();
- return new AliTRDtracker(gFile);
-}
-
-