]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMD.cxx
Corrected digit's branch name
[u/mrichter/AliRoot.git] / FMD / AliFMD.cxx
index 66d9db215be0366a6d679664b2a4d1b2a2474875..5dc39846f7d6565d3948e38f06b5801ce3ec084b 100644 (file)
@@ -20,8 +20,8 @@
 //  Forward Multiplicity Detector based on Silicon plates                    //
 //  This class contains the base procedures for the Forward Multiplicity     //
 //  detector                                                                 //
-//  Detector consists of 6 Si volumes covered pseudorapidity interval         //
-//  from 1.6 to 6.0.                                                         //
+//  Detector consists of 5 Si volumes covered pseudorapidity interval         //
+//  from 1.7 to 5.1.                                                         //
 //                                                                           //
 //Begin_Html
 /*
 #include <TClonesArray.h>
 #include <TFile.h>
 #include <TGeometry.h>
-#include <TLorentzVector.h>
-#include <TMath.h>
 #include <TNode.h>
 #include <TTUBE.h>
 #include <TTree.h>
 #include <TVirtualMC.h>
 
 #include "AliDetector.h"
-#include "AliFMDReconstParticles.h"
-#include "AliFMDReconstruction.h"
 #include "AliFMDdigit.h"
 #include "AliFMDhit.h"
 #include "AliFMDv1.h"
 #include "AliLoader.h"
-#include "AliMagF.h"
 #include "AliRun.h"
+#include "AliMC.h"
+#include "AliFMDDigitizer.h"
 
 ClassImp (AliFMD)
   //_____________________________________________________________________________
@@ -74,7 +71,6 @@ AliFMD::AliFMD ():AliDetector ()
   fIshunt = 0;
   fHits     = 0;
   fDigits   = 0;
-  fReconParticles=0; 
 }
 
 //_____________________________________________________________________________
@@ -90,8 +86,7 @@ AliDetector (name, title)
   fHits = new TClonesArray ("AliFMDhit", 1000);
   // Digits for each Si disk
   fDigits = new TClonesArray ("AliFMDdigit", 1000);
-  fReconParticles=new TClonesArray("AliFMDReconstParticles",1000); 
-  gAlice->AddHitList (fHits);
+  gAlice->GetMCApp()->AddHitList (fHits);
 
   fIshunt = 0;
   //  fMerger = 0;
@@ -101,6 +96,7 @@ AliDetector (name, title)
 //-----------------------------------------------------------------------------
 AliFMD::~AliFMD ()
 {
+  //destructor for base class AliFMD
   if (fHits)
     {
       fHits->Delete ();
@@ -113,12 +109,6 @@ AliFMD::~AliFMD ()
       delete fDigits;
       fDigits = 0;
     }
-   if (fReconParticles)
-    {
-      fReconParticles->Delete ();
-      delete fReconParticles;
-      fReconParticles = 0;
-    }
 
 }
 
@@ -188,7 +178,7 @@ void AliFMD::BuildGeometry ()
 }
 
 //_____________________________________________________________________________
-Int_t AliFMD::DistanceToPrimitive (Int_t /*px*/, Int_t /*py*/)
+const Int_t AliFMD::DistanceToPrimitive (Int_t /*px*/, Int_t /*py*/)
 {
   //
   // Calculate the distance from the mouse to the FMD on the screen
@@ -249,7 +239,6 @@ void AliFMD::MakeBranch (Option_t * option)
   
   const char *cH = strstr(option,"H");
   const char *cD = strstr(option,"D");
-  const char *cR = strstr(option,"R");
   
   if (cH && (fHits == 0x0)) fHits = new TClonesArray ("AliFMDhit", 1000);
 
@@ -260,19 +249,12 @@ void AliFMD::MakeBranch (Option_t * option)
     MakeBranchInTree(fLoader->TreeD(), branchname,&fDigits, kBufferSize, 0);
   }
 
-  if (cR){
-    if (fReconParticles == 0x0) 
-      fReconParticles=new TClonesArray("AliFMDReconstParticles",1000); 
-    MakeBranchInTree(fLoader->TreeR(), branchname,&fReconParticles, kBufferSize, 0);
-  }
-  
 }
 
 //_____________________________________________________________________________
 void AliFMD::SetTreeAddress ()
 {
   // Set branch address for the Hits and Digits Tree.
-  char branchname[30];
 
   if (fLoader->TreeH() && (fHits == 0x0)) 
     fHits = new TClonesArray ("AliFMDhit", 1000);  
@@ -285,45 +267,14 @@ void AliFMD::SetTreeAddress ()
   if (treeD)
     {
       if (fDigits == 0x0) fDigits = new TClonesArray ("AliFMDdigit", 1000);
-      branch = treeD->GetBranch (branchname);
+      branch = treeD->GetBranch ("FMD");
       if (branch)
        branch->SetAddress (&fDigits);
     }
-  
-  if (fLoader->TreeR() && fReconParticles) 
-    {
-      if (fReconParticles == 0x0) 
-        fReconParticles=new TClonesArray("AliFMDReconstParticles",1000); 
-      branch = fLoader->TreeR()->GetBranch("FMD"); 
-      if (branch) branch->SetAddress(&fReconParticles) ;
-    }   
-}
-
-
-
-void
-AliFMD::Eta2Radius (Float_t eta, Float_t zDisk, Float_t * radius)
-{
-  Float_t expEta = TMath::Exp (-eta);
-  Float_t theta = TMath::ATan (expEta);
-  theta = 2. * theta;
-  Float_t rad = zDisk * (TMath::Tan (theta));
-  *radius = rad;
-
-  if (fDebug)
-    printf ("%s: eta %f radius %f\n", ClassName (), eta, rad);
 }
 
-//---------------------------------------------------------------------
 
 
-void AliFMD::Digits2Reco()
-{
-  AliFMDReconstruction * reconstruction =  new AliFMDReconstruction(fLoader->GetRunLoader());
-  cout<<" AliFMD::Digits2Reco >> "<<reconstruction<<endl;
-  reconstruction->Exec();
-  delete  reconstruction;
-}
 //-----------------------------------------------------------------------
 
 void AliFMD::MakeBranchInTreeD(TTree *treeD, const char *file)
@@ -340,3 +291,8 @@ void AliFMD::MakeBranchInTreeD(TTree *treeD, const char *file)
      }
 }
 
+//____________________________________________________________________________
+AliDigitizer* AliFMD::CreateDigitizer(AliRunDigitizer* manager) const
+{
+  return new AliFMDDigitizer(manager);
+}