]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOS.cxx
Do coupling factors before noise is applied
[u/mrichter/AliRoot.git] / PHOS / AliPHOS.cxx
index fd5aea7b7575c33367d80d5a63cefb89123518b2..2b1230cb2f755081f9fe5aef9d92a19b31c0b266 100644 (file)
@@ -32,10 +32,9 @@ class TFile;
 #include "TFolder.h" 
 
 // --- Standard library ---
-
 #include <strstream.h>
-// --- AliRoot header files ---
 
+// --- AliRoot header files ---
 #include "AliPHOS.h"
 #include "AliMC.h"
 #include "AliRun.h"
@@ -47,140 +46,25 @@ ClassImp(AliPHOS)
 //____________________________________________________________________________
 AliPHOS:: AliPHOS() : AliDetector()
 {
-  // Create folder and task hierarchy
+  // Default ctor
   fName="PHOS";
-  CreatePHOSWhiteBoard();
-
+  fQATask = 0;
+  fTreeQA = 0;
 }
 
 //____________________________________________________________________________
 AliPHOS::AliPHOS(const char* name, const char* title): AliDetector(name, title) 
 {
-  // Create folder and task hierarchy
-  CreatePHOSWhiteBoard(); 
-}
-
-//____________________________________________________________________________
-void AliPHOS::CreatePHOSWhiteBoard()
-{
-  // 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
-  //==================== BEG TO BE DONE BY AliRUN ===========================
-  TFolder *alice = gROOT->GetRootFolder()->AddFolder("YSAlice","Alice Folder") ;  
-  gROOT->GetListOfBrowsables()->Add(alice, "YSAlice") ;
-
-  TFolder * aliceF  = alice->AddFolder("WhiteBoard", "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") ; 
-  // Hits folder
-  TFolder * hitsF = aliceF->AddFolder("Hits", "Hits") ; 
-  // SDigits folder
-  TFolder * sdigitsF = aliceF->AddFolder("SDigits", "Summable Digits") ; 
-  // Digits folder
-  TFolder * digitsF = aliceF->AddFolder("Digits", "Digits") ; 
-  // RecPoints folder
-  TFolder * rpointsF = aliceF->AddFolder("RecPoints", "RecPoints") ; 
-  // TrackSegments folder
-  TFolder * tsF = aliceF->AddFolder("TrackSegments", "TrackSegments") ; 
-  // RecParticles folder
-  TFolder * rparticlesF = aliceF->AddFolder("RecParticles", "RecParticles") ; 
-  //  make it the owner of the objects that it contains
-  alarmsF->SetOwner() ;
-  hitsF->SetOwner() ;
-  sdigitsF->SetOwner() ;
-  digitsF->SetOwner() ;
-  rpointsF->SetOwner() ;
-  tsF->SetOwner() ;
-  rparticlesF->SetOwner() ;
-
-  // Tasks folder
-  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 * aliceSD = new TTask("SDigitizer", "Alice SDigitizer") ;
-  aliceT->Add(aliceSD); 
-
-  TTask * aliceDi = new TTask("Digitizer", "Alice Digitizer") ;
-  aliceT->Add(aliceDi); 
-
-  TTask * aliceRe = new TTask("Reconstructioner", "Alice Reconstructioner") ;
-  aliceT->Add(aliceRe); 
-
-  //==================== END TO BE DONE BY AliRUN ===========================
-
-  // =================== Creating PHOS related folders
-  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 SDigitizer and adds it to alice main SDigitizer task 
-  sprintf(tempo, "%sSDigitizers container",GetName() ) ; 
-  TTask * sdT = new TTask(GetName(), tempo);   
-  aliceSD->Add(sdT) ; 
-
-  // creates the PHOS Digitizer and adds it to alice main Digitizer task 
-  sprintf(tempo, "%sDigitizers container",GetName() ) ; 
-  TTask * dT = new TTask(GetName(), tempo);   
-  aliceDi->Add(dT) ; 
-
-  // creates the PHOS reconstructioner and adds it to alice main Reconstructioner task 
-  sprintf(tempo, "%s Reconstructioner container",GetName() ) ; 
-  TTask * reT = new TTask(GetName(), tempo); 
-  aliceRe->Add(reT) ; 
-
-  // creates the PHOS clusterizer, tracksegment maker and PID and adds it to the PHOS Reconstructioner task
-
-  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") ; 
-  // creates the PHOS Hits folder
-  hitsF->AddFolder("PHOS", "Hits for PHOS") ; 
-  // creates the PHOS Summable Digits folder
-  sdigitsF->AddFolder("PHOS", "Summable Digits for PHOS") ; 
-  // creates the PHOS Digits folder
-  digitsF->AddFolder("PHOS", "Digits for PHOS") ; 
-  // creates the PHOS RecPoints folder
-  TFolder * prpF = rpointsF->AddFolder("PHOS", "RecPoints for PHOS") ;
-  // creates the PHOS EMC RecPoints folder
-  prpF->AddFolder("emc", "EMC RecPoints for PHOS") ;
-  // creates the PHOS CPV RecPoints folder
-  prpF->AddFolder("cpv", "CPV RecPoints for PHOS") ;
+  //   ctor : title is used to identify the layout
   
-  // creates the PHOS TrackSegments folder
-  tsF->AddFolder("PHOS", "Track Segments for PHOS") ; 
-  // creates the PHOS RecParticles folder
-  rparticlesF->AddFolder("PHOS", "RecParticles for PHOS") ;
+  fQATask = 0;
+  fTreeQA = 0;
 }
+
 //____________________________________________________________________________
 AliPHOS::~AliPHOS() 
 {  
-  // remove the alice folder and alice QA task that PHOS creates instead of AliRun
-  
-  // remove and delete the PHOS QA tasks
-  TTask * aliceQA = (TTask*)gROOT->FindObjectAny("YSAlice/tasks/QA") ; 
-  fQATask->GetListOfTasks()->Delete() ;
-  aliceQA->GetListOfTasks()->Remove(fQATask) ; 
-  delete fQATask ;  
   
-  // remove and delete aliceQA (should be done by AliRun) 
 }
 
 //____________________________________________________________________________
@@ -243,7 +127,7 @@ void AliPHOS::CreateMaterials()
   Float_t aTI[2] = {12.011, 1.00794} ;
   Float_t zTI[2] = {6.0, 1.0} ;
   Float_t wTI[2] = {1.0, 1.0} ;
-  Float_t dTI = 0.1 ;
+  Float_t dTI = 0.04 ;
 
   AliMixture(7, "Thermo Insul.$", aTI, zTI, dTI, -2, wTI) ;
 
@@ -325,6 +209,28 @@ void AliPHOS::CreateMaterials()
 
   // --- Stainless steel (let it be pure iron) ---
   AliMaterial(17, "Steel$", 55.845, 26, 7.87, 1.76, 0., 0, 0) ;
+
+
+  // --- Fiberglass ---
+  Float_t aFG[4] = {16.0, 28.09, 12.011, 1.00794} ;
+  Float_t zFG[4] = {8.0, 14.0, 6.0, 1.0} ;
+  Float_t wFG[4] = {292.0, 68.0, 462.0, 736.0} ;
+  Float_t dFG    = 1.9 ;
+
+  AliMixture(18, "Fibergla$", aFG, zFG, dFG, -4, wFG) ;
+
+  // --- Cables in Air box  ---
+  // SERVICES
+
+  Float_t aCA[4] = { 1.,12.,55.8,63.5 };
+  Float_t zCA[4] = { 1.,6.,26.,29. }; 
+  Float_t wCA[4] = { .014,.086,.42,.48 };
+  Float_t dCA    = 0.8 ;  //this density is raw estimation, if you know better - correct
+
+  AliMixture(19, "Cables  $", aCA, zCA, dCA, -4, wCA) ;
+
+
+
  
   // --- Air ---
   AliMaterial(99, "Air$", 14.61, 7.3, 0.001205, 30420., 67500., 0, 0) ;
@@ -405,6 +311,14 @@ void AliPHOS::CreateMaterials()
   AliMedium(17, "Steel     $", 17, 0,
             isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.0001, 0, 0) ;
 
+  // Fibergalss                                                                     -> idtmed[717]
+  AliMedium(18, "Fiberglass$", 18, 0,
+            isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
+
+  // Cables in air                                                                  -> idtmed[718]
+  AliMedium(19, "Cables    $", 19, 0,
+            isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
+
   // Air                                                                            -> idtmed[798] 
   AliMedium(99, "Air          $", 99, 0,
             isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
@@ -443,27 +357,20 @@ void AliPHOS::CreateMaterials()
   gMC->Gstpar(idtmed[715], "STRA",2.) ;
 
 }
+
 //____________________________________________________________________________
 AliPHOSGeometry * AliPHOS::GetGeometry() const 
 {  
-  // gets the pointer to the AliPHOSGeometry unique instance from the folder
-  
-  AliPHOSGeometry * rv = 0 ; 
+  // gets the pointer to the AliPHOSGeometry unique instance 
   
-  TString path("YSAlice/WhiteBoard/Geometry/PHOS/") ; 
-  path += GetTitle() ; 
-  rv = (AliPHOSGeometry*)gROOT->FindObjectAny(path) ; 
-  return rv ; 
+  return AliPHOSGeometry::GetInstance(GetTitle(),"") ;  
+
 }
 
 //____________________________________________________________________________
 void AliPHOS::SetTreeAddress()
 { 
 
-
-  // TBranch *branch;
-  //  AliDetector::SetTreeAddress();
-
   TBranch *branch;
   char branchname[20];
   sprintf(branchname,"%s",GetName());
@@ -487,13 +394,13 @@ void AliPHOS::WriteQA()
   // Create Alarms branches
   Int_t bufferSize = 32000 ;    
   Int_t splitlevel = 0 ; 
-  TFolder * alarmsF = (TFolder*)gROOT->FindObjectAny("YSAlice/WhiteBoard/QAAlarms/PHOS") ; 
+  TFolder * alarmsF = (TFolder*)gROOT->FindObjectAny("Folders/Run/Conditions/QA/PHOS") ; 
   TString branchName(alarmsF->GetName());  
   TBranch * alarmsBranch = fTreeQA->Branch(branchName,"TFolder", &alarmsF, bufferSize, splitlevel);
   TString branchTitle = branchName + " QA alarms" ; 
   alarmsBranch->SetTitle(branchTitle);
   alarmsBranch->Fill() ; 
 
-  // fTreeQA->Fill() ; 
+  //fTreeQA->Fill() ; 
 }