//
//////////////////////////////////////////////////////////////////////////////
-// --- Standard library ---
-#include <strstream.h>
-
// --- ROOT system ---
class TFile;
-#include "TBranch.h"
-#include "TClonesArray.h"
-#include "TTree.h"
+#include <TFolder.h>
+#include <TROOT.h>
+#include <TTree.h>
+#include <TVirtualMC.h>
-// --- AliRoot header files ---
+// --- Standard library ---
+#include <Rstrstream.h>
+// --- AliRoot header files ---
+#include "AliMagF.h"
#include "AliEMCAL.h"
#include "AliEMCALGeometry.h"
-#include "AliMC.h"
+#include "AliEMCALLoader.h"
+//#include "AliEMCALQAChecker.h"
#include "AliRun.h"
-#include "AliMagF.h"
ClassImp(AliEMCAL)
-
//____________________________________________________________________________
AliEMCAL::AliEMCAL():AliDetector()
{
- // ctor
- //We do not create objects, because these pointers will be overwritten during reading from file.
- fGeom = 0;
+ // Default ctor
+ fName="EMCAL";
+ //fQATask = 0;
+ fTreeQA = 0;
+ fGeom = 0 ;
}
+
//____________________________________________________________________________
-AliEMCAL::AliEMCAL(const char* name, const char* title): AliDetector(name,title) {
-// ctor : title is used to identify the layout
- fGeom = 0;
-// gets an instance of the geometry parameters class
+AliEMCAL::AliEMCAL(const char* name, const char* title): AliDetector(name,title)
+{
+ // ctor : title is used to identify the layout
+
+ //fQATask = 0;
+ fTreeQA = 0;
+ fGeom = 0;
}
+
//____________________________________________________________________________
-AliEMCAL::~AliEMCAL(){
- // dtor
- delete fHits;
+AliEMCAL::~AliEMCAL()
+{
+
}
//____________________________________________________________________________
-void AliEMCAL::CreateMaterials(){
+void AliEMCAL::CreateMaterials()
+{
// Definitions of materials to build EMCAL and associated tracking media.
// media number in idtmed are 1599 to 1698.
AliMaterial(3, "Al$", 26.98, 13., 2.7, 8.9, 999., 0, 0) ;
// --- Absorption length is ignored ^
+ // --- Copper ---
+ AliMaterial(4, "Cu$", 63.546, 29, 8.96, 1.43, 14.8, 0, 0) ;
+ // --- Absorption length is ignored ^
// DEFINITION OF THE TRACKING MEDIA
AliMedium(0, "Air $", 0, 0,
isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
- // The Lead -> idtmed[1600]
+ // The Lead -> idtmed[1600]
AliMedium(1, "Lead $", 1, 0,
isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
AliMedium(2, "CPV scint. $", 2, 1,
isxfld, sxmgmx, 10.0, 0.001, 0.1, 0.001, 0.001, 0, 0) ;
- // Various Aluminium parts made of Al -> idtmed[1602]
+ // Various Aluminium parts made of Al -> idtmed[1602]
AliMedium(3, "Al parts $", 3, 0,
isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
+ // Copper for HCal (post shower) -> idtmed[1603]
+ AliMedium(4, "Copper $", 4, 0,
+ isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
// --- Generate explicitly delta rays in Lead ---
gMC->Gstpar(idtmed[1600], "LOSS",3.) ;
gMC->Gstpar(idtmed[1600], "DRAY",1.) ;
-
-// --- and in aluminium parts ---
+ gMC->Gstpar(idtmed[1600], "DCUTE",0.00001) ;
+ gMC->Gstpar(idtmed[1600], "DCUTM",0.00001) ;
+
+// --- in aluminium parts ---
gMC->Gstpar(idtmed[1602], "LOSS",3.) ;
gMC->Gstpar(idtmed[1602], "DRAY",1.) ;
+ gMC->Gstpar(idtmed[1602], "DCUTE",0.00001) ;
+ gMC->Gstpar(idtmed[1602], "DCUTM",0.00001) ;
+
+// --- in copper parts ---
+ gMC->Gstpar(idtmed[1603], "LOSS",3.) ;
+ gMC->Gstpar(idtmed[1603], "DRAY",1.) ;
+ gMC->Gstpar(idtmed[1603], "DCUTE",0.00001) ;
+ gMC->Gstpar(idtmed[1603], "DCUTM",0.00001) ;
+
// --- and finally thresholds for photons and electrons in the scintillator ---
}
+
+//____________________________________________________________________________
+AliEMCALGeometry * AliEMCAL::GetGeometry() const
+{
+ // gets the pointer to the AliEMCALGeometry unique instance
+
+ if (fGeom)
+ return fGeom ;
+ else
+ return AliEMCALGeometry::GetInstance(GetTitle(),"") ;
+}
+
//____________________________________________________________________________
void AliEMCAL::SetTreeAddress()
{
sprintf(branchname,"%s",GetName());
// Branch address for hit tree
- TTree *treeH = gAlice->TreeH();
- if (treeH && fHits) {
+ TTree *treeH = TreeH();
+ if (treeH) {
branch = treeH->GetBranch(branchname);
- if (branch) branch->SetAddress(&fHits);
+ if (branch)
+ {
+ if (fHits == 0x0) fHits= new TClonesArray("AliEMCALHit",1000);
+ //Info("SetTreeAddress","<%s> Setting Hits Address",GetName());
+ branch->SetAddress(&fHits);
+ }
+ else
+ {
+ Warning("SetTreeAddress","<%s> Failed",GetName());
+ }
}
-
+}
+//____________________________________________________________________________
+void AliEMCAL::WriteQA()
+{
+
+ // Make TreeQA in the output file.
+
+ if(fTreeQA == 0)
+ fTreeQA = new TTree("TreeQA", "QA Alarms") ;
+ // Create Alarms branches
+ Int_t bufferSize = 32000 ;
+ Int_t splitlevel = 0 ;
+
+ TFolder* topfold = GetLoader()->GetTopFolder(); //get top aliroot folder; skowron
+ TString emcalqafn(AliConfig::Instance()->GetQAFolderName()+"/"); //get name of QAaut folder relative to top event; skowron
+ emcalqafn+=GetName(); //hard wired string!!! add the detector name to the pathname; skowron
+ TFolder * alarmsF = (TFolder*)topfold->FindObjectAny(emcalqafn); //get the folder
+
+ if (alarmsF == 0x0)
+ {
+ Error("WriteQA","Can not find folder with qa alarms");
+ return;
+ }
+ TString branchName(alarmsF->GetName());
+ TBranch * alarmsBranch = fTreeQA->Branch(branchName,"TFolder", &alarmsF, bufferSize, splitlevel);
+ TString branchTitle = branchName + " QA alarms" ;
+ alarmsBranch->SetTitle(branchTitle);
+ alarmsBranch->Fill() ;
+
+ //fTreeQA
}
-
+//____________________________________________________________________________
+AliLoader* AliEMCAL::MakeLoader(const char* topfoldername)
+{
+//different behaviour than standard (singleton getter)
+// --> to be discussed and made eventually coherent
+ fLoader = new AliEMCALLoader(GetName(),topfoldername);
+ return fLoader;
+}