//*-- Author: Laurent Aphecetche & Yves Schutz (SUBATECH)
//////////////////////////////////////////////////////////////////////////////
+
// --- ROOT system ---
+class TFile;
+#include "TROOT.h"
+#include "TTree.h"
+#include "TFolder.h"
// --- Standard library ---
+#include <strstream.h>
// --- AliRoot header files ---
#include "AliPHOS.h"
#include "AliMC.h"
#include "AliRun.h"
+#include "AliMagF.h"
+#include "AliPHOSGeometry.h"
+#include "AliPHOSQAChecker.h"
ClassImp(AliPHOS)
+//____________________________________________________________________________
+AliPHOS:: AliPHOS() : AliDetector()
+{
+ // Create folder and task hierarchy
+ fName="PHOS";
+ CreatePHOSFolders();
+}
//____________________________________________________________________________
-AliPHOS::~AliPHOS()
+AliPHOS::AliPHOS(const char* name, const char* title): AliDetector(name, title)
{
- delete fHits ;
- delete fDigits ;
+ // Create folder and task hierarchy
+ CreatePHOSFolders();
+}
+
+//____________________________________________________________________________
+void AliPHOS::CreatePHOSFolders()
+{
+ // create the ALICE TFolder
+ // create the ALICE TTasks
+ // add the Alice QA TTAsks
+ // create the ALICE main TFolder
+ // add the Alice QA Alarms
+ // this should be done of course by AliRun
+
+ TFolder * alice = new TFolder();
+ alice->SetNameTitle("YSAlice", "Alice Folder") ;
+ gROOT->GetListOfBrowsables()->Add(alice) ;
+
+ TFolder * aliceF = alice->AddFolder("folders", "Alice memory Folder") ;
+ // make it the owner of the objects that it contains
+ aliceF->SetOwner() ;
+ // geometry folder
+ TFolder * geomF = aliceF->AddFolder("Geometry", "Geometry objects") ;
+ // alarms folder
+ TFolder * alarmsF = aliceF->AddFolder("QAAlarms", "Alarms raised by QA check") ;
+ // make it the owner of the objects that it contains
+ alarmsF->SetOwner() ;
+ TFolder * aliceT = alice->AddFolder("tasks", "Alice tasks Folder") ;
+ // make it the owner of the objects that it contains
+ aliceT->SetOwner() ;
+
+ TTask * aliceQA = new TTask("QA", "Alice QA tasks") ;
+ aliceT->Add(aliceQA);
+
+ TTask * aliceDi = new TTask("(S)Digitizer", "Alice SDigitizer & Digitizer") ;
+ aliceT->Add(aliceDi);
+
+ TTask * aliceRe = new TTask("Reconstructioner", "Alice Reconstructioner") ;
+ aliceT->Add(aliceRe);
+
+ char * tempo = new char[80] ;
+
+ // creates the PHOSQA (QAChecker knows how to add itself in the tasks list)
+ sprintf(tempo, "%sCheckers container",GetName() ) ;
+ fQATask = new AliPHOSQAChecker(GetName(), tempo);
+
+ // creates the PHOS(S)Digitizer and adds it to alice main (S)Digitizer task
+ sprintf(tempo, "%sDigitizers container",GetName() ) ;
+ fSDTask = new TTask(GetName(), tempo);
+ aliceDi->Add(fSDTask) ;
+
+ // creates the PHOS reconstructioner and adds it to alice main Reconstructioner task
+ sprintf(tempo, "%sReconstructioner container",GetName() ) ;
+ fReTask = new TTask(GetName(), tempo);
+ aliceRe->Add(fReTask) ;
+
+ delete tempo ;
+
+ // creates the PHOS geometry folder
+ geomF->AddFolder("PHOS", "Geometry for PHOS") ;
+ // creates the PHOSQA alarm folder
+ alarmsF->AddFolder("PHOS", "QA alarms from PHOS") ;
+}
+//____________________________________________________________________________
+AliPHOS::~AliPHOS()
+{
+ // remove the alice folder and alice QA task that PHOS creates instead of AliRun
+
+ // remove and delete the PHOS QA tasks
+ TFolder * alice = (TFolder*)gROOT->GetListOfBrowsables()->FindObject("YSAlice") ;
+ TTask * aliceQA = (TTask*)alice->FindObject("tasks/QA") ;
+ fQATask->GetListOfTasks()->Delete() ;
+ aliceQA->GetListOfTasks()->Remove(fQATask) ;
+ delete fQATask ;
+
+ // remove and delete aliceQA (should be done by AliRun)
}
//____________________________________________________________________________
AliMixture(16, "ArCO2$", aGM, zGM, dGM, 2, wGM) ;
+ // --- Stainless steel (let it be pure iron) ---
+ AliMaterial(17, "Steel$", 55.845, 26, 7.87, 1.76, 0., 0, 0) ;
// --- Air ---
AliMaterial(99, "Air$", 14.61, 7.3, 0.001205, 30420., 67500., 0, 0) ;
AliMedium(16, "ArCo2 $", 16, 1,
isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.01, 0, 0) ;
+ // Stainless steel -> idtmed[716]
+ AliMedium(17, "Steel $", 17, 0,
+ isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.0001, 0, 0) ;
+
// Air -> idtmed[798]
AliMedium(99, "Air $", 99, 0,
isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
gMC->Gstpar(idtmed[715], "DRAY",0.) ;
gMC->Gstpar(idtmed[715], "STRA",2.) ;
+}
+//____________________________________________________________________________
+AliPHOSGeometry * AliPHOS::GetGeometry() const
+{
+ // gets the pointer to the AliPHOSGeometry unique instance from the folder
-
+ AliPHOSGeometry * rv ;
+
+ TFolder * alice = (TFolder*)gROOT->GetListOfBrowsables()->FindObject("YSAlice") ;
+ TString path("folders/Geometry/PHOS/") ;
+ path += GetTitle() ;
+ rv = (AliPHOSGeometry*)alice->FindObject(path) ;
+ if ( !rv )
+ rv = fGeom ;
+ return rv ;
+}
+
+//____________________________________________________________________________
+void AliPHOS::SetTreeAddress()
+{
+
+ // TBranch *branch;
+ // AliDetector::SetTreeAddress();
+
+ TBranch *branch;
+ char branchname[20];
+ sprintf(branchname,"%s",GetName());
+
+ // Branch address for hit tree
+ TTree *treeH = gAlice->TreeH();
+ if (treeH && fHits) {
+ branch = treeH->GetBranch(branchname);
+ if (branch) branch->SetAddress(&fHits);
+ }
}
+
+