]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - START/AliSTART.cxx
Small corrections on slat segmentation and MUONdisplay
[u/mrichter/AliRoot.git] / START / AliSTART.cxx
index e6146b35fce076be62148d6710254032413d10a6..ca20910629ed71caa5f36d9741467bc07295200b 100755 (executable)
 #include <TVirtualMC.h>
 #include <AliESD.h>
 
+#include "AliLog.h"
+#include "AliMC.h"
 #include "AliLoader.h"
 #include "AliRun.h"
+
 #include "AliSTART.h"
 #include "AliSTARTLoader.h"
 #include "AliSTARTdigit.h"
 #include "AliSTARThit.h"
-#include "AliSTARThitPhoton.h"
-#include "AliSTARTvertex.h"
-#include "AliMC.h"
 #include "AliSTARTDigitizer.h"
+#include "AliSTARTRawData.h"
 
 ClassImp(AliSTART)
 
-static  AliSTARTdigit *digits; 
+  //static  AliSTARTdigit *digits; 
 
 //_____________________________________________________________________________
 AliSTART::AliSTART()
@@ -73,7 +74,6 @@ AliSTART::AliSTART()
   fIshunt   = 1;
   fHits     = 0;
   fDigits   = 0;
-  fPhotons  = 0;
 }
  
 //_____________________________________________________________________________
@@ -89,13 +89,8 @@ AliSTART::AliSTART(const char *name, const char *title)
   // Initialise Hit array
   fHits       = new TClonesArray("AliSTARThit",  405);
   gAlice->GetMCApp()->AddHitList(fHits);
-
-  fPhotons  = new TClonesArray("AliSTARThitPhoton", 10000);
-  gAlice->GetMCApp()->AddHitList (fPhotons);
-  if (GetDebug()>2) cout<<" Debug "<<endl;
   fIshunt     =  1;
   fIdSens   =  0;
-  fNPhotons =  0;
   SetMarkerColor(kRed);
 }
 
@@ -105,10 +100,6 @@ AliSTART::~AliSTART() {
     fHits->Delete();
     delete fHits;
   }
-  if (fPhotons) {
-    fPhotons->Delete();
-    delete fPhotons;
-  }
 }
  
 //_____________________________________________________________________________
@@ -121,14 +112,6 @@ void AliSTART::AddHit(Int_t track, Int_t *vol, Float_t *hits)
   new(lhits[fNhits++]) AliSTARThit(fIshunt,track,vol,hits);
 }
 
-//_____________________________________________________________________________
-void AliSTART::AddHitPhoton(Int_t track, Int_t *vol, Float_t *hits)
-{
-  //  Add a START hit of photons
-  
-  TClonesArray &lhits = *fPhotons;
-  new(lhits[fNPhotons++]) AliSTARThitPhoton(fIshunt,track,vol,hits);
-}
 
 //_____________________________________________________________________________
 
@@ -203,28 +186,17 @@ void AliSTART::MakeBranch(Option_t* option)
   // Specific START branches
   //
   // Create Tree branches for the START.
-  Int_t buffersize = 4000;
   char branchname[20];
   sprintf(branchname,"%s",GetName());
 
-
-  const char *cD = strstr(option,"D");
   const char *cH = strstr(option,"H");
   
   if (cH && fLoader->TreeH())
   {
-     if (fPhotons == 0x0) fPhotons  = new TClonesArray("AliSTARThitPhoton", 10000);
-     sprintf (branchname, "%shitPhoton", GetName());
-     MakeBranchInTree (fLoader->TreeH(), branchname, &fPhotons, 50000, 0);
      if (fHits == 0x0) fHits  = new TClonesArray("AliSTARThit",  405);
   } 
   
   AliDetector::MakeBranch(option);
-
-  if (cD) {
-    digits = new AliSTARTdigit();
-    MakeBranchInTree(fLoader->TreeD(), branchname, "AliSTARTdigit", digits, buffersize, 1, 0);
-  } 
 }    
 
 //_____________________________________________________________________________
@@ -232,24 +204,17 @@ void AliSTART::ResetHits()
 {
   AliDetector::ResetHits();
   
-  fNPhotons = 0;
-  if (fPhotons)  fPhotons->Clear();
 }
 
 //_____________________________________________________________________________
 void AliSTART::SetTreeAddress()
 {
-  TBranch  *branch;
+
   TTree    *treeH;
-  
   treeH = TreeH();
   
   if (treeH)
     {
-      if (fPhotons == 0x0) fPhotons  = new TClonesArray("AliSTARThitPhoton", 10000);
-      branch = treeH->GetBranch("STARThitPhoton");
-      if (branch)  branch->SetAddress(&fPhotons);
       if (fHits == 0x0) fHits  = new TClonesArray("AliSTARThit",  405);
     }
     
@@ -260,7 +225,8 @@ void AliSTART::SetTreeAddress()
 //______________________________________________________________________
 AliLoader* AliSTART::MakeLoader(const char* topfoldername)
 { 
-  Info("MakeLoader", "Creating AliSTARTLoader. Top folder is %s.", topfoldername);
+
+  AliDebug(2,Form(" Creating AliSTARTLoader "));
   fLoader = new AliSTARTLoader(GetName(), topfoldername);
   return fLoader;
 }
@@ -270,11 +236,22 @@ AliDigitizer* AliSTART::CreateDigitizer(AliRunDigitizer* manager) const
 {
   return new AliSTARTDigitizer(manager);
 }
-
-//_____________________________________________________________________________
-void AliSTART::FillESD(AliESD* pESD)  const
+//____________________________________________________________________________
+void AliSTART::Digits2Raw()
 {
-  AliSTARTvertex reco;
-  reco.Reconstruct(fLoader->GetRunLoader(), pESD);
-}
+//
+// Starting from the START digits, writes the Raw Data objects
+//
+  AliSTARTLoader* pStartLoader = (AliSTARTLoader*)fLoader;
+  pStartLoader ->LoadDigits();
+  AliSTARTdigit* fDigits=pStartLoader->Digits();
+  AliSTARTRawData rawWriter;
+  rawWriter.SetVerbose(0);
+
+  AliDebug(2,Form(" Formatting raw data for START "));
+  
+  rawWriter.RawDataSTART (fDigits);
 
+   pStartLoader->UnloadDigits();
+
+}