]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOF.cxx
Separate trees for ITSsa and global tracks
[u/mrichter/AliRoot.git] / TOF / AliTOF.cxx
index 5e63e0a72948efc44fdee23b35d1320e74c7389c..14bffafbf27ef9ae709759aadc7984d8c088ee65 100644 (file)
@@ -42,7 +42,6 @@
 #include <TFile.h>
 #include <TFolder.h>
 #include <TROOT.h>
-#include <TTask.h>
 #include <TTree.h>
 #include <TVirtualMC.h>
 #include <TStopwatch.h>
 
 class AliTOFcluster;
 
-extern TFile *gFile;
-extern TROOT *gROOT;
-extern TVirtualMC *gMC;
+// extern TROOT *gROOT;
+// extern TVirtualMC *TVirtualMC::GetMC();
 
-extern AliRun *gAlice;
+// extern AliRun *gAlice;
 
 ClassImp(AliTOF)
 
 //_____________________________________________________________________________
 AliTOF::AliTOF():
   fFGeom(0x0),
-  fDTask(0x0),
-  fReTask(0x0),
   fSDigits(0x0),
   fNSDigits(0),
   fReconParticles(0x0),
@@ -109,8 +105,6 @@ AliTOF::AliTOF(const char *name, const char *title, Option_t *option)
        : 
   AliDetector(name,title),
   fFGeom(0x0),
-  fDTask(0x0),
-  fReTask(0x0),
   fSDigits(0x0),
   fNSDigits(0),
   fReconParticles(0x0),
@@ -198,7 +192,6 @@ void AliTOF::GetTOFSectors(Int_t *sectors) const
 void AliTOF::CreateTOFFolders()
 {
   // create the ALICE TFolder
-  // create the ALICE TTasks
   // create the ALICE main TFolder
   // to be done by AliRun
 
@@ -211,29 +204,6 @@ void AliTOF::CreateTOFFolders()
   aliceF->SetOwner() ;
   // geometry folder
   TFolder * geomF = aliceF->AddFolder("Geometry", "Geometry objects") ;
-  TFolder * aliceT  = alice->AddFolder("tasks", "Alice tasks Folder") ;   
-  //  make it the owner of the objects that it contains
-  aliceT->SetOwner() ;
-
-  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 TOF Digitizer and adds it to alice main (S)Digitizer task
-  sprintf(tempo, "%sDigitizers container",GetName() ) ;
-  fDTask = new TTask(GetName(), tempo);
-  aliceDi->Add(fDTask) ;
-
-  // creates the TOF 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 TOF geometry  folder
   geomF->AddFolder("TOF", "Geometry for TOF") ;
@@ -244,7 +214,6 @@ AliTOF::~AliTOF()
 {
   // dtor:
   // it remove also the alice folder 
-  // and task that TOF creates instead of AliRun
   /* PH Temporarily commented because of problems
   TFolder * alice = (TFolder*)gROOT->GetListOfBrowsables()->FindObject("FPAlice") ;
   delete alice;
@@ -418,40 +387,6 @@ void AliTOF::CreateGeometry()
 
 }
 
-//_____________________________________________________________________________
-void AliTOF::DrawModule() const
-{
-  //
-  // Draw a shaded view of the common part of the TOF geometry
-  //
-
-  AliInfo(" Drawing of AliTOF"); 
-  // Set everything unseen
-  gMC->Gsatt("*", "seen", -1);
-  // 
-  // Set ALIC mother transparent
-  gMC->Gsatt("ALIC","SEEN",0);
-  //
-  // Set the volumes visible
-  gMC->Gsatt("FTOA","SEEN",1);
-  gMC->Gsatt("FTOB","SEEN",1);
-  gMC->Gsatt("FTOC","SEEN",1);
-  gMC->Gsatt("FLTA","SEEN",1);
-  gMC->Gsatt("FLTB","SEEN",1);
-  gMC->Gsatt("FLTC","SEEN",1);
-  gMC->Gsatt("FSTR","SEEN",1);
-  //
-  gMC->Gdopt("hide", "on");
-  gMC->Gdopt("shad", "on");
-  gMC->Gsatt("*", "fill", 7);
-  gMC->SetClipBox(".");
-  gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
-  gMC->DefaultRange();
-  gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
-  gMC->Gdhead(1111, "Time Of Flight");
-  gMC->Gdman(18, 4, "MAN");
-  gMC->Gdopt("hide","off");
-}
 
 //___________________________________________
 void AliTOF::ResetHits ()
@@ -484,7 +419,7 @@ void AliTOF::Init()
   // Initialise TOF detector after it has been built
   //
   // Set id of TOF sensitive volume
-  if (IsVersion() !=0) fIdSens=gMC->VolId("FPAD");
+  if (IsVersion() !=0) fIdSens=TVirtualMC::GetMC()->VolId("FPAD");
 
   /*
   // Save the geometry
@@ -518,8 +453,9 @@ void AliTOF::MakeBranch(Option_t* option)
   AliDetector::MakeBranch(option);
 
   Int_t buffersize = 4000;
-  Char_t branchname[10];
-  sprintf(branchname,"%s",GetName());
+  const Int_t kSize=10;
+  Char_t branchname[kSize];
+  snprintf(branchname,kSize,"%s",GetName());
   
   const char *oD = strstr(option,"D");
   const char *oS = strstr(option,"S");
@@ -557,7 +493,7 @@ void AliTOF::Makehits(Bool_t hits)
 //              disabled for TOFv0
 // 
    if (hits &&  (IsVersion()!=0))
-      fIdSens = gMC->VolId("FPAD");
+      fIdSens = TVirtualMC::GetMC()->VolId("FPAD");
    else
       AliInfo("Option for writing the TOF-hits branch on TreeH: disabled");
 }
@@ -584,8 +520,8 @@ void AliTOF::Hits2SDigits()
   //ToAliDebug(1, sd.Print(""));
   //AliInfo("ToAliDebug");
 
-  //sd.Exec("all") ;
-  sd.Exec("partial") ;
+  //sd.Digitize("all") ;
+  sd.Digitize("partial") ;
 
   AliDebug(2,"I am sorting from AliTOF class");
 
@@ -607,15 +543,15 @@ void AliTOF::Hits2SDigits(Int_t evNumber1, Int_t evNumber2)
   AliTOFSDigitizer sd((rl->GetFileName()).Data(),evNumber1,evNumber2) ;
   ToAliDebug(1, sd.Print(""));
 
-  sd.Exec("") ;
+  sd.Digitize("") ;
 
 }
 
 //___________________________________________________________________________
-AliDigitizer* AliTOF::CreateDigitizer(AliRunDigitizer* manager) const
+AliDigitizer* AliTOF::CreateDigitizer(AliDigitizationInput* digInput) const
 {
   AliDebug(2,"I am creating the TOF digitizer");
-  return new AliTOFDigitizer(manager);
+  return new AliTOFDigitizer(digInput);
 }
 
 //___________________________________________________________________________