]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDclusterizerV0.cxx
Merging the VirtualMC branch to the main development branch (HEAD)
[u/mrichter/AliRoot.git] / TRD / AliTRDclusterizerV0.cxx
index 48091dee55d84d8d36154064a908578656009ef5..d26376dd8da203ff5da82246e9b93078eaab4965 100644 (file)
 
 /*
 $Log$
+Revision 1.10.6.1  2002/07/24 10:09:30  alibrary
+Updating VirtualMC
+
+Revision 1.11  2002/06/12 09:54:35  cblume
+Update of tracking code provided by Sergei
+
+Revision 1.10  2001/12/05 15:04:34  hristov
+Changes related to the corrections of AliRecPoint
+
+Revision 1.9  2001/05/28 17:07:58  hristov
+Last minute changes; ExB correction in AliTRDclusterizerV1; taking into account of material in G10 TEC frames and material between TEC planes (C.Blume,S.Sedykh)
+
+Revision 1.8  2001/05/07 08:06:44  cblume
+Speedup of the code. Create only AliTRDcluster
+
+Revision 1.7  2001/02/14 18:22:26  cblume
+Change in the geometry of the padplane
+
+Revision 1.6  2000/11/01 14:53:20  cblume
+Merge with TRD-develop
+
+Revision 1.1.4.6  2000/10/16 01:16:53  cblume
+Changed timebin 0 to be the one closest to the readout
+
+Revision 1.1.4.5  2000/10/15 23:40:01  cblume
+Remove AliTRDconst
+
+Revision 1.1.4.4  2000/10/06 16:49:46  cblume
+Made Getters const
+
+Revision 1.1.4.3  2000/10/04 16:34:58  cblume
+Replace include files by forward declarations
+
+Revision 1.1.4.2  2000/09/22 14:49:49  cblume
+Adapted to tracking code
+
+Revision 1.5  2000/10/02 21:28:19  fca
+Removal of useless dependecies via forward declarations
+
+Revision 1.4  2000/06/08 18:32:58  cblume
+Make code compliant to coding conventions
+
+Revision 1.3  2000/06/07 16:27:01  cblume
+Try to remove compiler warnings on Sun and HP
+
+Revision 1.2  2000/05/08 16:17:27  cblume
+Merge TRD-develop
+
+Revision 1.1.4.1  2000/05/08 15:08:41  cblume
+Replace AliTRDcluster by AliTRDrecPoint
+
 Revision 1.4  2000/06/08 18:32:58  cblume
 Make code compliant to coding conventions
 
@@ -48,11 +99,15 @@ Add new TRD classes
 
 #include <TRandom.h>
 #include <TTree.h>
+#include "AliRun.h"
 
+#include "AliTRD.h"
 #include "AliTRDclusterizerV0.h"
-#include "AliTRDconst.h"
+#include "AliTRDhit.h"
 #include "AliTRDgeometry.h"
 #include "AliTRDrecPoint.h"
+#include "AliTRDparameter.h"
 
 ClassImp(AliTRDclusterizerV0)
 
@@ -101,22 +156,29 @@ void AliTRDclusterizerV0::Init()
 }
 
 //_____________________________________________________________________________
-Bool_t AliTRDclusterizerV0::MakeCluster()
+Bool_t AliTRDclusterizerV0::MakeClusters()
 {
   //
   // Generates the cluster
   //
 
-  // Get the pointer to the detector class and check for version 1
-  AliTRD *trd = (AliTRD*) gAlice->GetDetector("TRD");
-  if (trd->IsVersion() != 0) {
+  if (fTRD->IsVersion() != 0) {
     printf("AliTRDclusterizerV0::MakeCluster -- ");
     printf("TRD must be version 0 (fast simulator).\n");
     return kFALSE; 
   }
 
   // Get the geometry
-  AliTRDgeometry *geo = trd->GetGeometry();
+  AliTRDgeometry *geo = fTRD->GetGeometry();
+
+  // Create a default parameter class if none is defined
+  if (!fPar) {
+    fPar = new AliTRDparameter("TRDparameter","Standard TRD parameter");
+    if (fVerbose > 0) {
+      printf("<AliTRDclusterizerV0::MakeCluster> ");
+      printf("Create the default parameter object.\n");
+    }
+  }
   
   printf("AliTRDclusterizerV0::MakeCluster -- ");
   printf("Start creating cluster.\n");
@@ -137,18 +199,18 @@ Bool_t AliTRDclusterizerV0::MakeCluster()
   Int_t nTrack = (Int_t) hitTree->GetEntries();
 
   // Loop through all the chambers
-  for (Int_t icham = 0; icham < kNcham; icham++) {
-    for (Int_t iplan = 0; iplan < kNplan; iplan++) {
-      for (Int_t isect = 0; isect < kNsect; isect++) {
+  for (Int_t icham = 0; icham < AliTRDgeometry::Ncham(); icham++) {
+    for (Int_t iplan = 0; iplan < AliTRDgeometry::Nplan(); iplan++) {
+      for (Int_t isect = 0; isect < AliTRDgeometry::Nsect(); isect++) {
 
-        Int_t   nColMax     = geo->GetColMax(iplan);
-        Float_t row0        = geo->GetRow0(iplan,icham,isect);
-        Float_t col0        = geo->GetCol0(iplan);
-        Float_t time0       = geo->GetTime0(iplan);
+        Int_t   nColMax     = fPar->GetColMax(iplan);
+        Float_t row0        = fPar->GetRow0(iplan,icham,isect);
+        Float_t col0        = fPar->GetCol0(iplan);
+        Float_t time0       = fPar->GetTime0(iplan);
 
-        Float_t rowPadSize  = geo->GetRowPadSize();
-        Float_t colPadSize  = geo->GetColPadSize();
-        Float_t timeBinSize = geo->GetTimeBinSize();
+        Float_t rowPadSize  = fPar->GetRowPadSize(iplan,icham,isect);
+        Float_t colPadSize  = fPar->GetColPadSize(iplan);
+        Float_t timeBinSize = fPar->GetTimeBinSize();
 
         // Loop through all entries in the tree
         for (Int_t iTrack = 0; iTrack < nTrack; iTrack++) {
@@ -157,12 +219,12 @@ Bool_t AliTRDclusterizerV0::MakeCluster()
           nBytes += hitTree->GetEvent(iTrack);
 
           // Get the number of hits in the TRD created by this particle
-          Int_t nHit = trd->Hits()->GetEntriesFast();
+          Int_t nHit = fTRD->Hits()->GetEntriesFast();
 
           // Loop through the TRD hits  
           for (Int_t iHit = 0; iHit < nHit; iHit++) {
 
-            if (!(hit = (AliTRDhit *) trd->Hits()->UncheckedAt(iHit))) 
+            if (!(hit = (AliTRDhit *) fTRD->Hits()->UncheckedAt(iHit))) 
               continue;
 
             Float_t pos[3];
@@ -185,7 +247,7 @@ Bool_t AliTRDclusterizerV0::MakeCluster()
             geo->Rotate(detector,pos,rot);
 
             // Add this recPoint to the temporary array for this chamber
-            AliTRDrecPoint *recPoint = new AliTRDrecPoint();
+            AliTRDrecPoint *recPoint = new AliTRDrecPoint("");
             recPoint->SetLocalRow(rot[2]);
             recPoint->SetLocalCol(rot[1]);
             recPoint->SetLocalTime(rot[0]);
@@ -274,12 +336,17 @@ Bool_t AliTRDclusterizerV0::MakeCluster()
          // Transform into local coordinates
           smear[0] = (Int_t) ((smear[0] -  row0) /  rowPadSize);
           smear[1] = (Int_t) ((smear[1] -  col0) /  colPadSize);
-          smear[2] = (Int_t) ((smear[2] - time0) / timeBinSize);
+          smear[2] = (Int_t) ((time0 - smear[2]) / timeBinSize);
 
           // Add the smeared cluster to the output array 
-          Int_t detector  = recPoint1->GetDetector();
-          Int_t digits[3] = {0};
-          trd->AddRecPoint(smear,digits,detector,0.0);
+          Int_t   detector  = recPoint1->GetDetector();
+         Int_t   tr[9]     = { -1   };
+          Float_t pos[3];
+          Float_t sigma[2]  = {  0.0 };
+          pos[0] = smear[1];
+          pos[1] = smear[0];
+          pos[2] = (time0 - smear[2]) / timeBinSize;
+          fTRD->AddCluster(pos,detector,0.0,tr,sigma,0);
 
        }
 
@@ -291,7 +358,7 @@ Bool_t AliTRDclusterizerV0::MakeCluster()
   }
 
   printf("AliTRDclusterizerV0::MakeCluster -- ");
-  printf("Found %d points.\n",trd->RecPoints()->GetEntries());
+  printf("Found %d points.\n",fTRD->RecPoints()->GetEntries());
   printf("AliTRDclusterizerV0::MakeCluster -- ");
   printf("Fill the cluster tree.\n");
   clusterTree->Fill();