]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCAL.cxx
When calling the getter, the name of the file that holds gAlice is specified.
[u/mrichter/AliRoot.git] / EMCAL / AliEMCAL.cxx
index 953f398ae278fe4ffb39e8f2f07e8e9e09d1c1bc..0261c78e05776a0c71523b0b0caf4db660d2024a 100644 (file)
@@ -35,9 +35,14 @@ class TFile;
 
 // --- AliRoot header files ---
 #include "AliMagF.h"
+#include "AliESDCaloTrack.h" 
+#include "AliESD.h"
 #include "AliEMCAL.h"
-#include "AliEMCALGeometry.h"
-#include "AliEMCALLoader.h"
+#include "AliEMCALGetter.h"
+#include "AliRun.h"
+#include "AliEMCALSDigitizer.h"
+#include "AliEMCALDigitizer.h"
+#include "AliEMCALReconstructioner.h"
 
 ClassImp(AliEMCAL)
 //____________________________________________________________________________
@@ -45,8 +50,6 @@ AliEMCAL::AliEMCAL():AliDetector()
 {
   // Default ctor 
   fName="EMCAL";
-  //fQATask = 0;
-  fTreeQA = 0;
   fGeom = 0 ; 
 }
 
@@ -54,9 +57,6 @@ AliEMCAL::AliEMCAL():AliDetector()
 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;
 }
 
@@ -66,6 +66,18 @@ AliEMCAL::~AliEMCAL()
 
 }
 
+//____________________________________________________________________________
+void AliEMCAL::Copy(AliEMCAL & emcal)
+{
+  TObject::Copy(emcal) ; 
+}
+
+//____________________________________________________________________________
+AliDigitizer* AliEMCAL::CreateDigitizer(AliRunDigitizer* manager) const
+{
+  return new AliEMCALDigitizer(manager);
+}
+
 //____________________________________________________________________________
 void AliEMCAL::CreateMaterials()
 {
@@ -92,11 +104,6 @@ void AliEMCAL::CreateMaterials()
   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
 
   // for EMCAL: idtmed[1599->1698] equivalent to fIdtmed[0->100]
@@ -115,7 +122,6 @@ void AliEMCAL::CreateMaterials()
   AliMedium(1, "Lead      $", 1, 0,
             isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
 
  // The scintillator of the CPV made of Polystyrene scintillator                   -> idtmed[1601]
   AliMedium(2, "CPV scint.   $", 2, 1,
             isxfld, sxmgmx, 10.0, 0.001, 0.1, 0.001, 0.001, 0, 0) ;
@@ -124,11 +130,6 @@ void AliEMCAL::CreateMaterials()
   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) ;
-
-
 
 // --- Set decent energy thresholds for gamma and electron tracking
 
@@ -149,31 +150,54 @@ void AliEMCAL::CreateMaterials()
   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 ---
   gMC->Gstpar(idtmed[1601],"CUTGAM",0.00008) ;
   gMC->Gstpar(idtmed[1601],"CUTELE",0.001) ;
   gMC->Gstpar(idtmed[1601],"BCUTE",0.0001) ;
 
+}
+
+//____________________________________________________________________________
+void AliEMCAL::FillESD(AliESD* esd) const 
+{
+  // Fill the ESD with all RecParticles
+  AliEMCALGetter *gime = AliEMCALGetter::Instance( (fLoader->GetRunLoader()->GetFileName()).Data() );
+  gime->Event(gime->EventNumber(), "P") ; 
+  TClonesArray *recParticles = gime->RecParticles();
+  Int_t nOfRecParticles = recParticles->GetEntries();
+  for (Int_t recpart=0; recpart<nOfRecParticles; recpart++) {
+    AliESDCaloTrack *ct = new AliESDCaloTrack((AliEMCALRecParticle*)recParticles->At(recpart));
+    esd->AddCaloTrack(ct);
+  }
+}       
+
+
+//____________________________________________________________________________
+void AliEMCAL::Hits2SDigits()  
+{ 
+// create summable digits
+
+  AliEMCALSDigitizer* emcalDigitizer = 
+    new AliEMCALSDigitizer(fLoader->GetRunLoader()->GetFileName().Data()) ;
+  emcalDigitizer->SetEventRange(0, -1) ; // do all the events
+  emcalDigitizer->ExecuteTask() ;
+}
 
+//____________________________________________________________________________
+void AliEMCAL::Reconstruct() const 
+{ 
+  AliEMCALReconstructioner * rec = new AliEMCALReconstructioner((fLoader->GetRunLoader()->GetFileName()).Data()) ; 
+  rec->SetEventRange(0, -1) ; // do all the events  
+  rec->ExecuteTask() ; 
 }
 
 //____________________________________________________________________________
-AliEMCALGeometry * AliEMCAL::GetGeometry() const 
-{  
-  // gets the pointer to the AliEMCALGeometry unique instance 
-
-  if (fGeom) 
-    return fGeom ; 
-  else 
-    return AliEMCALGeometry::GetInstance(GetTitle(),"") ;  
+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;
 }
 
 //____________________________________________________________________________
@@ -192,7 +216,6 @@ void AliEMCAL::SetTreeAddress()
       { 
        if (fHits == 0x0) 
          fHits= new TClonesArray("AliEMCALHit",1000);
-       //Info("SetTreeAddress","<%s> Setting Hits Address",GetName());
        branch->SetAddress(&fHits);
       }
     else
@@ -201,42 +224,8 @@ void AliEMCAL::SetTreeAddress()
       }
   }
 }
-//____________________________________________________________________________
-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;
-}
+
+
+
+