]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOF.cxx
macro to convert Raw to Digits
[u/mrichter/AliRoot.git] / TOF / AliTOF.cxx
index 1612c6de088c90414cfb1a48d25693e9410b00ef..234515cb517d8e5e3a68cb520e7ec0f27f6c20da 100644 (file)
 */
 //End_Html
 
-#include "TFile.h"
-#include "TFolder.h"
-#include "TROOT.h"
-#include "TTask.h"
-#include "TTree.h"
-#include "TVirtualMC.h"
+#include <TClonesArray.h>
+#include <TFile.h>
+#include <TFolder.h>
+#include <TROOT.h>
+#include <TTask.h>
+#include <TTree.h>
+#include <TVirtualMC.h>
 
 #include "AliConst.h"
 #include "AliLoader.h"
@@ -74,27 +75,38 @@ extern AliRun *gAlice;
 ClassImp(AliTOF)
  
 //_____________________________________________________________________________
-AliTOF::AliTOF()
+AliTOF::AliTOF():
+  fFGeom(0x0),
+  fDTask(0x0),
+  fReTask(0x0),
+  fSDigits(0x0),
+  fNSDigits(0),
+  fReconParticles(0x0),
+  fIdSens(-1),
+  fTZero(kFALSE),
+  fTOFGeometry(0x0)
 {
   //
   // Default constructor
   //
-  fFGeom  = 0x0;
-  fDTask  = 0x0;
-  fReTask = 0x0;
+  fDigits = 0;
   fIshunt   = 0;
-  fSDigits  = 0 ;
-  fNSDigits = 0;
-  fDigits   = 0 ;
-  fReconParticles = 0x0;
-  fName="TOF";
-  fTZero  = kFALSE;
-  fTOFGeometry = 0;
+  fName = "TOF";
 }
  
 //_____________________________________________________________________________
 AliTOF::AliTOF(const char *name, const char *title, Option_t *option)
-       : AliDetector(name,title)
+       : 
+  AliDetector(name,title),
+  fFGeom(0x0),
+  fDTask(0x0),
+  fReTask(0x0),
+  fSDigits(0x0),
+  fNSDigits(0),
+  fReconParticles(0x0),
+  fIdSens(-1),
+  fTZero(kFALSE),
+  fTOFGeometry(0x0)
 {
   //
   // AliTOF standard constructor
@@ -104,16 +116,13 @@ AliTOF::AliTOF(const char *name, const char *title, Option_t *option)
 
   // Initialization of hits, sdigits and digits array
   // added option for time zero analysis
-  fFGeom  = 0x0; //skowron
-  fDTask  = 0x0;
-  fReTask = 0x0;
-  fReconParticles= 0x0;
+  //skowron
   fTOFGeometry = new AliTOFGeometry();
 
   if (strstr(option,"tzero")){
     fHits   = new TClonesArray("AliTOFhitT0",  1000);
     fTZero = kTRUE;
-    AliWarning("tzero option requires AliTOFv4T0/AliTOFv5T0 as TOF version (check Your Config.C)");
+    //    AliWarning("tzero option requires AliTOFv4T0/AliTOFv5T0 as TOF version (check Your Config.C)");
   }else{
     fHits   = new TClonesArray("AliTOFhit",  1000);
     fTZero = kFALSE;
@@ -131,21 +140,15 @@ AliTOF::AliTOF(const char *name, const char *title, Option_t *option)
   fIshunt  = 0;
   fSDigits = new TClonesArray("AliTOFSDigit", 1000);
   fDigits  = new TClonesArray("AliTOFdigit",  1000);
-  fNSDigits = 0;
-
-  fFGeom = 0x0;
-  fDTask = 0x0;
-  fReTask = 0x0;
-  fReconParticles = 0x0;
 
   //
   // Digitization parameters
   //
   // (Transfer Functions to be inserted here)
   //
-  SetMarkerColor(7);
-  SetMarkerStyle(2);
-  SetMarkerSize(0.4);
+  //PH  SetMarkerColor(7);
+  //PH  SetMarkerStyle(2);
+  //PH  SetMarkerSize(0.4);
 
 // Strip Parameters
   //fGapA    =   4.; //cm  Gap beetween tilted strip in A-type plate
@@ -157,9 +160,36 @@ AliTOF::AliTOF(const char *name, const char *title, Option_t *option)
 
 }
 
+//____________________________________________________________________________
+void AliTOF::SetTOFSectors(Int_t *sectors)
+{
+  // Setter for partial/full TOF configuration
+
+  for(Int_t isec=0;isec<18;isec++){
+    fTOFSectors[isec]=sectors[isec];
+  }
+}
+//____________________________________________________________________________
+void AliTOF::GetTOFSectors(Int_t *sectors) const
+{
+  // Getter for partial/full TOF configuration
+
+  for(Int_t isec=0;isec<18;isec++){
+    sectors[isec]=fTOFSectors[isec];
+  }
+}
 //_____________________________________________________________________________
 AliTOF::AliTOF(const AliTOF &source)
-  :AliDetector()
+  :AliDetector(),
+  fFGeom(0x0),
+  fDTask(0x0),
+  fReTask(0x0),
+  fSDigits(0x0),
+  fNSDigits(0),
+  fReconParticles(0x0),
+  fIdSens(-1),
+  fTZero(kFALSE),
+  fTOFGeometry(0x0)
 {
   // copy constructor
 
@@ -580,10 +610,9 @@ void AliTOF::Hits2SDigits(Int_t evNumber1, Int_t evNumber2)
 //
 
   if ((evNumber2-evNumber1)==1) 
-      AliDebug(1, Form("I am making sdigits for the %dth event", evNumber1))
-  else if ((evNumber2-evNumber1)>1)
-      AliDebug(1, Form("I am making sdigits for the events from the " 
-                      "%dth to the %dth", evNumber1, evNumber2-1));
+    AliDebug(1, Form("I am making sdigits for the %dth event", evNumber1));
+  if ((evNumber2-evNumber1)>1)
+    AliDebug(1, Form("I am making sdigits for the events from the %dth to the %dth", evNumber1, evNumber2-1));
  
   AliRunLoader * rl = fLoader->GetRunLoader();
   AliTOFSDigitizer sd((rl->GetFileName()).Data(),evNumber1,evNumber2) ;
@@ -677,8 +706,9 @@ void AliTOF::Digits2Raw()
   AliTOFDDLRawData rawWriter(geometry);
   //AliTOFDDLRawData rawWriter;
   rawWriter.SetVerbose(0);
+  //rawWriter.SetAcquisitionMode(kFALSE);
   
-  AliInfo("Formatting raw data for TOF");
+  AliDebug(1,"Formatting raw data for TOF");
   digits->GetEvent(0);
   rawWriter.RawDataTOF(digits->GetBranch("TOF"));