Last minute changes (C.Blume)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 May 2001 16:45:47 +0000 (16:45 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 May 2001 16:45:47 +0000 (16:45 +0000)
TRD/AliTRD.cxx
TRD/AliTRDcluster.h
TRD/AliTRDclusterizerV1.cxx
TRD/AliTRDclusterizerV1.h
TRD/AliTRDdigitizer.cxx
TRD/AliTRDdigitizer.h
TRD/AliTRDgeometry.cxx
TRD/AliTRDgeometry.h
TRD/AliTRDsim.cxx
TRD/AliTRDv1.cxx

index a12f71f..efa195a 100644 (file)
 
 /*
 $Log$
+Revision 1.28  2001/05/16 14:57:27  alibrary
+New files for folders and Stack
+
+Revision 1.27  2001/05/08 07:05:02  hristov
+Loop variable declared once (HP, Sun)
+
 Revision 1.26  2001/05/07 08:03:22  cblume
 Generate also hits in the amplification region
 
@@ -27,7 +33,6 @@ Major upgrade of AliRoot code
 Revision 1.23  2000/11/01 14:53:20  cblume
 Merge with TRD-develop
 
-
 Revision 1.17.2.6  2000/10/15 23:29:08  cblume
 Introduced more detailed geometry for the display
 
@@ -293,9 +298,23 @@ void AliTRD::AddCluster(Float_t *pos, Int_t *digits, Int_t det, Float_t amp
   c->SetSigmaY2(0.05 * 0.05);
   c->SetSigmaZ2(rowSize * rowSize / 12.);
 
-  if (iType == 1) {
-    c->SetUnfolding();
-  }
+  switch (iType) {
+  case 0:
+    c->Set2pad();
+    break;
+  case 1:
+    c->Set3pad();
+    break;
+  case 2:
+    c->Set4pad();
+    break;
+  case 3:
+    c->Set5pad();
+    break;
+  case 4:
+    c->SetLarge();
+    break;
+  };
 
   fRecPoints->Add(c);
 
@@ -316,7 +335,7 @@ void AliTRD::Hits2Digits()
   digitizer->SetExB();
   digitizer->SetEvent(gAlice->GetEvNumber());
   // Initialization
-  //digitizer->InitDetector();
+  digitizer->InitDetector();
     
   // Create the digits
   digitizer->MakeDigits();
@@ -352,7 +371,7 @@ void AliTRD::Hits2SDigits()
   digitizer->SetEvent(gAlice->GetEvNumber());
 
   // Initialization
-  //digitizer->InitDetector();
+  digitizer->InitDetector();
     
   // Create the digits
   digitizer->MakeDigits();
@@ -414,15 +433,15 @@ void AliTRD::BuildGeometry()
 
   Float_t rmin, rmax;
   Float_t zmax1, zmax2;
+
+  Int_t   iPlan;
  
   const Int_t kColorTRD = 46;
   
   // Find the top node alice
   top = gAlice->GetGeometry()->GetNode("alice");
   
-  switch (fDisplayType) {
-
-  case 0:
+  if      (fDisplayType == 0) {
 
     pgon = new TPGON("S_TRD","TRD","void",0,360,AliTRDgeometry::Nsect(),4);
     rmin = AliTRDgeometry::Rmin();
@@ -436,9 +455,8 @@ void AliTRD::BuildGeometry()
     node->SetLineColor(kColorTRD);
     fNodes->Add(node);
 
-    break;
-
-  case 1:
+  }
+  else if (fDisplayType == 1) {
 
     Char_t name[7];
 
@@ -454,7 +472,7 @@ void AliTRD::BuildGeometry()
     zmax2 = AliTRDgeometry::Zmax2() + slope * thickness;
     zmax1 = zmax2 + slope * AliTRDgeometry::DrThick();
 
-    for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
+    for (iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
 
       sprintf(name,"S_TR1%d",iPlan);
       pgon  = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsect(),4);
@@ -481,7 +499,7 @@ void AliTRD::BuildGeometry()
     zmax2 = AliTRDgeometry::Zmax2() + slope * thickness;
     zmax1 = zmax2 + slope * AliTRDgeometry::AmThick();
 
-    for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
+    for (iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
 
       sprintf(name,"S_TR2%d",iPlan);
       pgon  = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsect(),4);
@@ -502,9 +520,7 @@ void AliTRD::BuildGeometry()
 
     }
 
-    break;
-
-  };
+  }
 
 }
  
@@ -587,9 +603,15 @@ void AliTRD::CreateMaterials()
   Float_t wis[2] = {  4., 10. };
   Float_t dis    = 0.00267;
 
+  // For plexiglas (C5H8O2)
+  Float_t apg[3] = { 12.011 ,  1.0    , 15.9994 };
+  Float_t zpg[3] = {  6.0   ,  1.0    ,  8.0    };
+  Float_t wpg[3] = {  5.0   ,  8.0    ,  2.0    };
+  Float_t dpg    = 1.18; 
+
   // For Xe/CO2-gas-mixture 
-  // Xe-content of the Xe/CO2-mixture (90% / 10%) 
-  Float_t fxc    = .90;
+  // Xe-content of the Xe/CO2-mixture (85% / 15%) 
+  Float_t fxc    = .85;
   // Xe-content of the Xe/Isobutane-mixture (97% / 3%) 
   Float_t fxi    = .97;
   Float_t dxe    = .005858;
@@ -610,19 +632,20 @@ void AliTRD::CreateMaterials()
   //     Define Materials 
   //////////////////////////////////////////////////////////////////////////
 
-  AliMaterial( 1, "Al $",  26.98, 13.0, 2.7     ,     8.9 ,    37.2);
-  AliMaterial( 2, "Air$",  14.61,  7.3, 0.001205, 30420.0 , 67500.0);
-  AliMaterial( 4, "Xe $", 131.29, 54.0, dxe     ,  1447.59,     0.0);
-  AliMaterial( 5, "Cu $",  63.54, 29.0, 8.96    ,     1.43,    14.8);
-  AliMaterial( 6, "C  $",  12.01,  6.0, 2.265   ,    18.8 ,    74.4);
-  AliMaterial(12, "G10$",  20.00, 10.0, 1.7     ,    19.4 ,   999.0);
+  AliMaterial( 1, "Al ",  26.98, 13.0, 2.7     ,     8.9 ,    37.2);
+  AliMaterial( 2, "Air",  14.61,  7.3, 0.001205, 30420.0 , 67500.0);
+  AliMaterial( 4, "Xe ", 131.29, 54.0, dxe     ,  1447.59,     0.0);
+  AliMaterial( 5, "Cu ",  63.54, 29.0, 8.96    ,     1.43,    14.8);
+  AliMaterial( 6, "C  ",  12.01,  6.0, 2.265   ,    18.8 ,    74.4);
+  AliMaterial(12, "G10",  20.00, 10.0, 1.7     ,    19.4 ,   999.0);
 
   // Mixtures 
-  AliMixture(3, "Polyethilene$",   ape, zpe, dpe, -2, wpe);
-  AliMixture(7, "Mylar$",          amy, zmy, dmy, -3, wmy);
-  AliMixture(8, "CO2$",            aco, zco, dco, -2, wco);
-  AliMixture(9, "Isobutane$",      ais, zis, dis, -2, wis);
-  AliMixture(13,"Water$",          awa, zwa, dwa, -2, wwa);
+  AliMixture(3, "Polyethilene",   ape, zpe, dpe, -2, wpe);
+  AliMixture(7, "Mylar",          amy, zmy, dmy, -3, wmy);
+  AliMixture(8, "CO2",            aco, zco, dco, -2, wco);
+  AliMixture(9, "Isobutane",      ais, zis, dis, -2, wis);
+  AliMixture(13,"Water",          awa, zwa, dwa, -2, wwa);
+  AliMixture(14,"Plexiglas",      apg, zpg, dpg, -3, wpg);
 
   // Gas mixtures
   Char_t namate[21];
@@ -635,7 +658,7 @@ void AliTRD::CreateMaterials()
   wgm[0] = fxc;
   wgm[1] = 1. - fxc;
   dgm1   = wgm[0] * dxe + wgm[1] * dco;
-  AliMixture(10, "Gas mixture 1$", agm, zgm, dgm1,  2, wgm);
+  AliMixture(10, "Gas mixture 1", agm, zgm, dgm1,  2, wgm);
   // Xe/Isobutane-mixture
   // Get properties of Xe 
   gMC->Gfmate((*fIdmate)[4], namate, agm[0], zgm[0], d, radl, absl, buf, nbuf);
@@ -645,60 +668,63 @@ void AliTRD::CreateMaterials()
   wgm[0] = fxi;
   wgm[1] = 1. - fxi;
   dgm2   = wgm[0] * dxe + wgm[1] * dis;
-  AliMixture(11, "Gas mixture 2$", agm, zgm, dgm2,  2, wgm);
+  AliMixture(11, "Gas mixture 2", agm, zgm, dgm2,  2, wgm);
  
   //////////////////////////////////////////////////////////////////////////
   //     Tracking Media Parameters 
   //////////////////////////////////////////////////////////////////////////
 
   // Al Frame 
-  AliMedium(1, "Al Frame$",   1, 0, isxfld, sxmgmx
+  AliMedium(1, "Al Frame",   1, 0, isxfld, sxmgmx
                 , tmaxfd, stemax, deemax, epsil, stmin);
   // Air 
-  AliMedium(2, "Air$",        2, 0, isxfld, sxmgmx
+  AliMedium(2, "Air",        2, 0, isxfld, sxmgmx
                 , tmaxfd, stemax, deemax, epsil, stmin);
   // Polyethilene 
-  AliMedium(3, "Radiator$",   3, 0, isxfld, sxmgmx
+  AliMedium(3, "Radiator",   3, 0, isxfld, sxmgmx
                 , tmaxfd, stemax, deemax, epsil, stmin);
   // Xe 
-  AliMedium(4, "Xe$",         4, 1, isxfld, sxmgmx
+  AliMedium(4, "Xe",         4, 1, isxfld, sxmgmx
                 , tmaxfd, stemax, deemax, epsil, stmin);
   // Cu pads 
-  AliMedium(5, "Padplane$",   5, 1, isxfld, sxmgmx
+  AliMedium(5, "Padplane",   5, 1, isxfld, sxmgmx
                 , tmaxfd, stemax, deemax, epsil, stmin);
   // Fee + cables 
-  AliMedium(6, "Readout$",    1, 0, isxfld, sxmgmx
+  AliMedium(6, "Readout",    1, 0, isxfld, sxmgmx
                 , tmaxfd, stemax, deemax, epsil, stmin);
   // C frame 
-  AliMedium(7, "C Frame$",    6, 0, isxfld, sxmgmx
+  AliMedium(7, "C Frame",    6, 0, isxfld, sxmgmx
                 , tmaxfd, stemax, deemax, epsil, stmin);
   // Mylar foils 
-  AliMedium(8, "Mylar$",      7, 0, isxfld, sxmgmx
+  AliMedium(8, "Mylar",      7, 0, isxfld, sxmgmx
                 , tmaxfd, stemax, deemax, epsil, stmin);
   if (fGasMix == 1) {
     // Gas-mixture (Xe/CO2) 
-    AliMedium(9, "Gas-mix$",   10, 1, isxfld, sxmgmx
+    AliMedium(9, "Gas-mix",   10, 1, isxfld, sxmgmx
                   , tmaxfd, stemax, deemax, epsil, stmin);
   }
   else {
     // Gas-mixture (Xe/Isobutane) 
-    AliMedium(9, "Gas-mix$",   11, 1, isxfld, sxmgmx
+    AliMedium(9, "Gas-mix",   11, 1, isxfld, sxmgmx
                   , tmaxfd, stemax, deemax, epsil, stmin);
   }
   // Nomex-honeycomb (use carbon for the time being) 
-  AliMedium(10, "Nomex$",      6, 0, isxfld, sxmgmx
+  AliMedium(10, "Nomex",      6, 0, isxfld, sxmgmx
                 , tmaxfd, stemax, deemax, epsil, stmin);
   // Kapton foils (use Mylar for the time being) 
-  AliMedium(11, "Kapton$",     7, 0, isxfld, sxmgmx
+  AliMedium(11, "Kapton",     7, 0, isxfld, sxmgmx
                 , tmaxfd, stemax, deemax, epsil, stmin);
   // Gas-filling of the radiator 
-  AliMedium(12, "CO2$",        8, 0, isxfld, sxmgmx
+  AliMedium(12, "CO2",        8, 0, isxfld, sxmgmx
                 , tmaxfd, stemax, deemax, epsil, stmin);
   // G10-plates
-  AliMedium(13, "G10-plates$",12, 0, isxfld, sxmgmx
+  AliMedium(13, "G10-plates",12, 0, isxfld, sxmgmx
                 , tmaxfd, stemax, deemax, epsil, stmin);
   // Cooling water
-  AliMedium(14, "Water$",     13, 0, isxfld, sxmgmx
+  AliMedium(14, "Water",     13, 0, isxfld, sxmgmx
+                , tmaxfd, stemax, deemax, epsil, stmin);
+  // Rohacell (plexiglas) for the radiator
+  AliMedium(15, "Rohacell",  14, 0, isxfld, sxmgmx
                 , tmaxfd, stemax, deemax, epsil, stmin);
 
   // Save the density values for the TRD absorbtion
@@ -809,7 +835,7 @@ void AliTRD::Init()
   }
   
   if (fGasMix == 1)
-    printf("%s: Gas Mixture: 90%% Xe + 10%% CO2\n",ClassName());
+    printf("%s: Gas Mixture: 85%% Xe + 15%% CO2\n",ClassName());
   else
     printf("%s: Gas Mixture: 97%% Xe + 3%% Isobutane\n",ClassName());
 
index 032f073..afe3def 100644 (file)
@@ -35,7 +35,11 @@ class AliTRDcluster : public TObject {
           void    Use()                           { fQ = -fQ; }
           Int_t   GetTrackIndex(Int_t i) const    { return fTracks[i]; }
 
-          Bool_t  FromUnfolding() const           { return TestBit(kUnfold); }
+          Bool_t  From2pad() const                { return TestBit(k2pad);  }
+          Bool_t  From3pad() const                { return TestBit(k3pad);  }
+          Bool_t  From4pad() const                { return TestBit(k4pad);  }
+          Bool_t  From5pad() const                { return TestBit(k5pad);  }
+          Bool_t  FromLarge() const               { return TestBit(kLarge); }
 
           void    SetDetector(Int_t d)            { fDetector  = d; }
           void    SetLocalTimeBin(Int_t t)        { fTimeBin   = t; }
@@ -46,12 +50,20 @@ class AliTRDcluster : public TObject {
           void    SetSigmaY2(Float_t s)           { fSigmaY2   = s; }
           void    SetSigmaZ2(Float_t s)           { fSigmaZ2   = s; }
 
-          void    SetUnfolding()                  { SetBit(kUnfold); }
+          void    Set2pad()                       { SetBit(k2pad);  }
+          void    Set3pad()                       { SetBit(k3pad);  }
+          void    Set4pad()                       { SetBit(k4pad);  }
+          void    Set5pad()                       { SetBit(k5pad);  }
+          void    SetLarge()                      { SetBit(kLarge); }
 
  protected:
 
   enum {
-    kUnfold = 0x00000001    // Cluster results from unfolding procedure
+    k2pad  = 0x00000001,   // 2 pad cluster
+    k3pad  = 0x00000002,   // 3 pad cluster
+    k4pad  = 0x00000004,   // 4 pad cluster
+    k5pad  = 0x00000008,   // 5 pad cluster
+    kLarge = 0x00000016    // Large cluster
   };
 
   Int_t    fDetector;       // TRD detector number
index 7a7a279..4a0e43c 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.10  2001/05/07 08:06:44  cblume
+Speedup of the code. Create only AliTRDcluster
+
 Revision 1.9  2000/11/01 14:53:20  cblume
 Merge with TRD-develop
 
@@ -91,6 +94,8 @@ AliTRDclusterizerV1::AliTRDclusterizerV1():AliTRDclusterizer()
   fClusMaxThresh = 0;
   fClusSigThresh = 0;
 
+  fUseLUT        = kFALSE;
+
 }
 
 //_____________________________________________________________________________
@@ -150,9 +155,13 @@ void AliTRDclusterizerV1::Copy(TObject &c)
   // Copy function
   //
 
+  ((AliTRDclusterizerV1 &) c).fUseLUT        = fUseLUT;
   ((AliTRDclusterizerV1 &) c).fClusMaxThresh = fClusMaxThresh;
   ((AliTRDclusterizerV1 &) c).fClusSigThresh = fClusSigThresh;
   ((AliTRDclusterizerV1 &) c).fDigitsManager = NULL;
+  for (Int_t ilut = 0; ilut < kNlut; ilut++) {
+    ((AliTRDclusterizerV1 &) c).fLUT[ilut] = fLUT[ilut];
+  }
 
   AliTRDclusterizer::Copy(c);
 
@@ -169,6 +178,32 @@ void AliTRDclusterizerV1::Init()
   fClusMaxThresh = 3;
   fClusSigThresh = 1;
 
+  // Use the lookup table for the position determination
+  fUseLUT        = kTRUE;
+
+  // The lookup table from Bogdan
+  Float_t lut[128] = {  
+    0.0068,  0.0198,  0.0318,  0.0432,  0.0538,  0.0642,  0.0742,  0.0838,
+    0.0932,  0.1023,  0.1107,  0.1187,  0.1268,  0.1347,  0.1423,  0.1493,  
+    0.1562,  0.1632,  0.1698,  0.1762,  0.1828,  0.1887,  0.1947,  0.2002,  
+    0.2062,  0.2118,  0.2173,  0.2222,  0.2278,  0.2327,  0.2377,  0.2428,  
+    0.2473,  0.2522,  0.2567,  0.2612,  0.2657,  0.2697,  0.2743,  0.2783,  
+    0.2822,  0.2862,  0.2903,  0.2943,  0.2982,  0.3018,  0.3058,  0.3092,  
+    0.3128,  0.3167,  0.3203,  0.3237,  0.3268,  0.3302,  0.3338,  0.3368,  
+    0.3402,  0.3433,  0.3462,  0.3492,  0.3528,  0.3557,  0.3587,  0.3613,  
+    0.3643,  0.3672,  0.3702,  0.3728,  0.3758,  0.3783,  0.3812,  0.3837,  
+    0.3862,  0.3887,  0.3918,  0.3943,  0.3968,  0.3993,  0.4017,  0.4042,  
+    0.4067,  0.4087,  0.4112,  0.4137,  0.4157,  0.4182,  0.4207,  0.4227,  
+    0.4252,  0.4272,  0.4293,  0.4317,  0.4338,  0.4358,  0.4383,  0.4403,  
+    0.4423,  0.4442,  0.4462,  0.4482,  0.4502,  0.4523,  0.4543,  0.4563,  
+    0.4582,  0.4602,  0.4622,  0.4638,  0.4658,  0.4678,  0.4697,  0.4712,  
+    0.4733,  0.4753,  0.4767,  0.4787,  0.4803,  0.4823,  0.4837,  0.4857,  
+    0.4873,  0.4888,  0.4908,  0.4922,  0.4942,  0.4958,  0.4972,  0.4988  
+  }; 
+  for (Int_t ilut = 0; ilut < kNlut; ilut++) {
+    fLUT[ilut] = lut[ilut];
+  }
+
 }
 
 //_____________________________________________________________________________
@@ -227,6 +262,16 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
   const Int_t   kNsig    = 5;
   const Int_t   kNtrack  = 3 * kNclus;
 
+  // For the LUT
+  const Float_t kLUTmin  = 0.106113;
+  const Float_t kLUTmax  = 0.995415;
+
+  Int_t   iType          = 0;
+  Int_t   iUnfold        = 0;
+
+  Float_t ratioLeft      = 1.0;
+  Float_t ratioRight     = 1.0;
+
   Float_t padSignal[kNsig];   
   Float_t clusterSignal[kNclus];
   Float_t clusterPads[kNclus];   
@@ -268,8 +313,12 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
 
         Int_t idet = geo->GetDetector(iplan,icham,isect);
 
-        Int_t nClusters       = 0;
-        Int_t nClustersUnfold = 0;
+        Int_t nClusters      = 0;
+        Int_t nClusters2pad  = 0;
+        Int_t nClusters3pad  = 0;
+        Int_t nClusters4pad  = 0;
+        Int_t nClusters5pad  = 0;
+        Int_t nClustersLarge = 0;
 
         printf("AliTRDclusterizerV1::MakeCluster -- ");
         printf("Analyzing chamber %d, plane %d, sector %d.\n"
@@ -300,10 +349,11 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
               Int_t signalR = digits->GetDataUnchecked(row,col-2,time);
  
              // Look for the maximum
-              if ((signalM >= maxThresh) &&
-                  (signalL >= sigThresh) &&
-                  (signalR >= sigThresh)) {
-                if ((signalL < signalM) && (signalR < signalM)) {
+              if (signalM >= maxThresh) {
+                if (((signalL >= sigThresh) &&
+                     (signalL <  signalM))  ||
+                    ((signalR >= sigThresh) &&
+                     (signalR <  signalM))) {
                   // Maximum found, mark the position by a negative signal
                   digits->SetDataUnchecked(row,col-1,time,-signalM);
                }
@@ -315,8 +365,8 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
 
         // Now check the maxima and calculate the cluster position
         for ( row = 0;  row <  nRowMax  ;  row++) {
-          for ( col = 1;  col <  nColMax-1;  col++) {
-            for (time = 0; time < nTimeTotal; time++) {
+          for (time = 0; time < nTimeTotal; time++) {
+            for ( col = 1;  col <  nColMax-1;  col++) {
 
               // Maximum found ?             
               if (digits->GetDataUnchecked(row,col,time) < 0) {
@@ -333,35 +383,141 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
                  clusterTracks[3*iPad+2] = track2->GetDataUnchecked(row,iPadCol,time) - 1;
                 }
 
-                // Neighbouring maximum on right side?
-                Int_t iType = 0; 
+               // Count the number of pads in the cluster
+                Int_t nPadCount = 0;
+                Int_t ii        = 0;
+                while (TMath::Abs(digits->GetDataUnchecked(row,col-ii  ,time))
+                                                                  >= sigThresh) {
+                  nPadCount++;
+                  ii++;
+                  if (col-ii   <        0) break;
+               }
+                ii = 0;
+                while (TMath::Abs(digits->GetDataUnchecked(row,col+ii+1,time))
+                                                                  >= sigThresh) {
+                  nPadCount++;
+                  ii++;
+                  if (col+ii+1 >= nColMax) break;
+               }
+
+                nClusters++;
+                switch (nPadCount) {
+                case 2:
+                  iType = 0;
+                  nClusters2pad++;
+                  break;
+                case 3:
+                  iType = 1;
+                  nClusters3pad++;
+                  break;
+                case 4:
+                  iType = 2;
+                  nClusters4pad++;
+                  break;
+                case 5:
+                  iType = 3;
+                  nClusters5pad++;
+                  break;
+                default:
+                  iType = 4;
+                  nClustersLarge++;
+                  break;
+               };
+
+               // Don't analyze large clusters
+                //if (iType == 4) continue;
+
+                // Look for 5 pad cluster with minimum in the middle
+                Bool_t fivePadCluster = kFALSE;
                 if (col < nColMax-3) {
                   if (digits->GetDataUnchecked(row,col+2,time) < 0) {
-                    for (iPad = 0; iPad < kNsig; iPad++) {
-                      padSignal[iPad] = TMath::Abs(digits->GetDataUnchecked(row
-                                                                           ,col-1+iPad
-                                                                           ,time));
-                    }
-                    // Unfold the two maxima and set the signal on 
-                    // the overlapping pad to the ratio
-                    clusterSignal[2] *= Unfold(kEpsilon,padSignal);
-                    iType = 1;
+                    fivePadCluster = kTRUE;
+                 }
+                  if ((fivePadCluster) && (col < nColMax-5)) {
+                    if (digits->GetDataUnchecked(row,col+4,time) >= sigThresh) {
+                      fivePadCluster = kFALSE;
+                   }
+                 }
+                  if ((fivePadCluster) && (col >         1)) {
+                    if (digits->GetDataUnchecked(row,col-2,time) >= sigThresh) {
+                      fivePadCluster = kFALSE;
+                   }
+                 }
+               }
+
+               // 5 pad cluster
+                // Modify the signal of the overlapping pad for the left part 
+               // of the cluster which remains from a previous unfolding
+                if (iUnfold) {
+                  clusterSignal[0] *= ratioLeft;
+                  iType   = 3;
+                  iUnfold = 0;
+               }
+
+               // Unfold the 5 pad cluster
+                if (fivePadCluster) {
+                  for (iPad = 0; iPad < kNsig; iPad++) {
+                    padSignal[iPad] = TMath::Abs(digits->GetDataUnchecked(row
+                                                                         ,col-1+iPad
+                                                                         ,time));
                   }
+                  // Unfold the two maxima and set the signal on 
+                  // the overlapping pad to the ratio
+                  ratioRight        = Unfold(kEpsilon,padSignal);
+                  ratioLeft         = 1.0 - ratioRight; 
+                  clusterSignal[2] *= ratioRight;
+                  iType   = 3;
+                  iUnfold = 1;
                 }
 
                 Float_t clusterCharge = clusterSignal[0]
                                       + clusterSignal[1]
                                       + clusterSignal[2];
                 
-               // Calculate the position of the cluster by using the
-               // center of gravity method
+               // The position of the cluster
                 clusterPads[0] = row + 0.5;
-                clusterPads[1] = col + 0.5 
-                               + (clusterSignal[2] - clusterSignal[0]) 
-                              / clusterCharge;
                // Take the shift of the additional time bins into account
                 clusterPads[2] = time - nTimeBefore + 0.5;
 
+                if (fUseLUT) {
+
+                 // Calculate the position of the cluster by using the
+                 // lookup table method
+                  Float_t ratioLUT;
+                  Float_t signLUT;
+                  Float_t lut = 0.0;
+                  if (clusterSignal[0] > clusterSignal[2]) {
+                    ratioLUT = clusterSignal[0] / clusterSignal[1];
+                    signLUT  = -1.0;
+                 }
+                  else {
+                    ratioLUT = clusterSignal[2] / clusterSignal[1];
+                    signLUT  =  1.0;
+                 }
+                  if      (ratioLUT < kLUTmin) {
+                    lut = 0.0;
+                 }
+                  else if (ratioLUT > kLUTmax) {
+                    lut = 0.5;
+                 }
+                  else {
+                    Int_t indexLUT = TMath::Nint ((kNlut-1) * (ratioLUT - kLUTmin)  
+                                                           / (kLUTmax  - kLUTmin)); 
+                    lut = fLUT[indexLUT];
+                 }
+                  clusterPads[1] = col + 0.5 + signLUT * lut;
+
+               }
+               else {
+
+                 // Calculate the position of the cluster by using the
+                 // center of gravity method
+                  clusterPads[1] = col + 0.5 
+                                 + (clusterSignal[2] - clusterSignal[0]) 
+                                / clusterCharge;
+
+               }
+
                 if (fVerbose) {
                   printf("-----------------------------------------------------------\n");
                   printf("Create cluster no. %d\n",nClusters);
@@ -381,11 +537,9 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
                   printf("        pad2 %d, %d, %d\n",clusterTracks[6]
                                                    ,clusterTracks[7]
                                                     ,clusterTracks[8]);
+                  printf("Type = %d, Number of pads = %d\n",iType,nPadCount);
                 }
 
-                nClusters++;
-                if (iType == 1) nClustersUnfold++;
-
                 // Add the cluster to the output array 
                 fTRD->AddCluster(clusterPads
                                 ,clusterDigit
@@ -410,8 +564,13 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
        fTRD->ResetRecPoints();
 
         printf("AliTRDclusterizerV1::MakeCluster -- ");
-        printf("Found %d (%d unfolded) clusters.\n"
-              ,nClusters,nClustersUnfold);
+        printf("Found %d clusters in total.\n"
+              ,nClusters);
+        printf("                                    2pad:  %d\n",nClusters2pad);
+        printf("                                    3pad:  %d\n",nClusters3pad);
+        printf("                                    4pad:  %d\n",nClusters4pad);
+        printf("                                    5pad:  %d\n",nClusters5pad);
+        printf("                                    Large: %d\n",nClustersLarge);
 
       }    
     }      
@@ -468,7 +627,8 @@ Float_t AliTRDclusterizerV1::Unfold(Float_t eps, Float_t* padSignal)
     newRightSignal[2] = ampRight * PadResponse( 1 - maxRight);
 
     // Calculate new overlapping ratio
-    ratio = newLeftSignal[2] / (newLeftSignal[2] + newRightSignal[0]);
+    ratio = TMath::Min(1.0,newLeftSignal[2] / 
+                          (newLeftSignal[2] + newRightSignal[0]));
 
   }
 
index 4bc1787..e58ece8 100644 (file)
@@ -27,19 +27,27 @@ class AliTRDclusterizerV1 : public AliTRDclusterizer {
   virtual void    Init();
   virtual Bool_t  MakeClusters();
   virtual Bool_t  ReadDigits();
+          void    UseLUT()                                { fUseLUT        = kTRUE;  };
+          void    UseCOG()                                { fUseLUT        = kFALSE; };
 
-  virtual void    SetClusMaxThresh(Int_t thresh)          { fClusMaxThresh = thresh; };
-  virtual void    SetClusSigThresh(Int_t thresh)          { fClusSigThresh = thresh; };
+          void    SetClusMaxThresh(Int_t thresh)          { fClusMaxThresh = thresh; };
+          void    SetClusSigThresh(Int_t thresh)          { fClusSigThresh = thresh; };
 
-  virtual Int_t GetClusMaxThresh() const                  { return fClusMaxThresh; };
-  virtual Int_t GetClusSigThresh() const                  { return fClusSigThresh; };
+          Int_t   GetClusMaxThresh() const                { return fClusMaxThresh; };
+          Int_t   GetClusSigThresh() const                { return fClusSigThresh; };
 
  protected:
+  enum { 
+    kNlut = 128                        //  Dimension of the lookup table
+  };                    
 
   AliTRDdigitsManager *fDigitsManager; //! TRD digits manager
 
-  Int_t              fClusMaxThresh; // Threshold value for cluster maximum
-  Int_t              fClusSigThresh; // Threshold value for cluster signal
+  Int_t                fClusMaxThresh; //  Threshold value for cluster maximum
+  Int_t                fClusSigThresh; //  Threshold value for cluster signal
+  Bool_t               fUseLUT;        //  Switch for the lookup table method
+  Float_t              fLUT[kNlut];    //  The lookup table
 
  private:
 
index 8a195b2..33ebe50 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.23  2001/05/07 08:04:48  cblume
+New TRF and PRF. Speedup of the code. Digits from amplification region included
+
 Revision 1.22  2001/03/30 14:40:14  cblume
 Update of the digitization parameter
 
@@ -136,6 +139,7 @@ Add new TRD classes
 #include <TF1.h>
 
 #include "AliRun.h"
+#include "AliMagF.h"
 
 #include "AliTRD.h"
 #include "AliTRDhit.h"
@@ -159,7 +163,6 @@ AliTRDdigitizer::AliTRDdigitizer():TNamed()
   fDigits         = NULL;
   fTRD            = NULL;
   fGeo            = NULL;
-  fPRF            = NULL;
   fPRFsmp         = NULL;
   fTRFsmp         = NULL;
 
@@ -185,6 +188,7 @@ AliTRDdigitizer::AliTRDdigitizer():TNamed()
   fPadCoupling    = 0.0;
   fTimeCoupling   = 0.0;
   fTimeBinWidth   = 0.0;
+  fField          = 0.0;
 
   fPRFbin         = 0;
   fPRFlo          = 0.0;
@@ -214,7 +218,6 @@ AliTRDdigitizer::AliTRDdigitizer(const Text_t *name, const Text_t *title)
   fDigits        = NULL;
   fTRD           = NULL;
   fGeo           = NULL;
-  fPRF           = NULL;
   fPRFsmp        = NULL;
   fTRFsmp        = NULL;
 
@@ -255,8 +258,6 @@ AliTRDdigitizer::~AliTRDdigitizer()
     delete fDigits;
   }
 
-  if (fPRF) delete fPRF;
-
 }
 
 //_____________________________________________________________________________
@@ -307,6 +308,7 @@ void AliTRDdigitizer::Copy(TObject &d)
   ((AliTRDdigitizer &) d).fPadCoupling    = fPadCoupling;
   ((AliTRDdigitizer &) d).fTimeCoupling   = fTimeCoupling;
   ((AliTRDdigitizer &) d).fTimeBinWidth   = fTimeBinWidth;
+  ((AliTRDdigitizer &) d).fField          = fField;
   ((AliTRDdigitizer &) d).fPRFOn          = fPRFOn;
   ((AliTRDdigitizer &) d).fTRFOn          = fTRFOn;
 
@@ -314,8 +316,6 @@ void AliTRDdigitizer::Copy(TObject &d)
   ((AliTRDdigitizer &) d).fVerbose        = fVerbose;
   ((AliTRDdigitizer &) d).fSDigits        = fSDigits;
 
-  fPRF->Copy(*((AliTRDdigitizer &) d).fPRF);
-
   ((AliTRDdigitizer &) d).fPRFbin         = fPRFbin;
   ((AliTRDdigitizer &) d).fPRFlo          = fPRFlo;
   ((AliTRDdigitizer &) d).fPRFhi          = fPRFhi;
@@ -426,9 +426,8 @@ void AliTRDdigitizer::Init()
   //
 
   // The default parameter for the digitization
-  // Updated to new TRF 200 ns   
-  fGasGain        = 1600.;
-  fChipGain       = 8.0;
+  fGasGain        = 2800.;
+  fChipGain       = 6.1;
   fNoise          = 1000.;
   fADCoutRange    = 1023.;          // 10-bit ADC
   fADCinRange     = 1000.;          // 1V input range
@@ -438,42 +437,28 @@ void AliTRDdigitizer::Init()
   fSinRange       = 1000000.;
   fSoutRange      = 1000000.;
 
-  // Transverse and longitudinal diffusion coefficients (Xe/Isobutane)
+  // The drift velocity (cm / mus)
+  fDriftVelocity  = 1.5;
+
+  // The magnetic field strength in Tesla
+  fField          = 0.2 * gAlice->Field()->Factor();
+
+  // Diffusion on
   fDiffusionOn    = 1;
-  fDiffusionT     = 0.060;
-  fDiffusionL     = 0.017;
+
+  // E x B effects
+  fExBOn          = 0;
 
   // Propability for electron attachment
   fElAttachOn     = 0;
   fElAttachProp   = 0.0;
 
-  // E x B effects
-  fExBOn          = 0;
-  // omega * tau.= arctan(Lorentz-angle)
-  fOmegaTau       = 0.19438031;
-
   // The pad response function
   fPRFOn          =  1;
-  fPRFlo          = -3.0;
-  fPRFhi          =  3.0;
-  fPRFbin         = 120;
-  fPRFwid         = (fPRFhi - fPRFlo) / ((Float_t) fPRFbin);
-  fPRFpad         = ((Int_t) (1.0 / fPRFwid));
-  // New PRF from Bogdan  25/04/01
-  fPRF            = new TF1("PRF"
-                           ,"[0]*([1]+exp(-pow(sqrt(x*x),[3])/(2.0*[2])))"
-                           ,fPRFlo,fPRFhi);
-  fPRF->SetParameter(0, 0.8303); 
-  fPRF->SetParameter(1,-0.00392); 
-  fPRF->SetParameter(2, 0.472 * 0.472); 
-  fPRF->SetParameter(3, 2.19); 
 
   // The time response function
   fTRFOn          =  1;
 
-  // The drift velocity (cm / mus)
-  fDriftVelocity  = 2.0;
-
   // The pad coupling factor (same number as for the TPC)
   fPadCoupling    = 0.5;
 
@@ -500,13 +485,20 @@ void AliTRDdigitizer::ReInit()
 
   // The range and the binwidth for the sampled TRF 
   fTRFbin = 100;
-  // Start 0.8 mus before the signal
-  fTRFlo  = -0.8 * fDriftVelocity;
+  // Start 0.2 mus before the signal
+  fTRFlo  = -0.2 * fDriftVelocity;
   // End the maximum driftlength after the signal 
   fTRFhi  = AliTRDgeometry::DrThick() 
           + fGeo->GetTimeAfter() * fGeo->GetTimeBinSize();
   fTRFwid = (fTRFhi - fTRFlo) / ((Float_t) fTRFbin);
 
+  // Transverse and longitudinal diffusion coefficients (Xe/CO2)
+  fDiffusionT     = GetDiffusionT(fDriftVelocity,fField);
+  fDiffusionL     = GetDiffusionL(fDriftVelocity,fField);
+
+  // omega * tau.= tan(Lorentz-angle)
+  fOmegaTau       = GetOmegaTau(fDriftVelocity,fField);
+
   // The Lorentz factor
   if (fExBOn) {
     fLorentzFactor = 1.0 / (1.0 + fOmegaTau*fOmegaTau);
@@ -531,32 +523,112 @@ void AliTRDdigitizer::SampleTRF()
   Int_t   ipos2;
   Float_t diff;
 
-  const Float_t kShift = 0.0;
-  const Float_t kScale = 0.5;
-  //const Float_t kScale = 1.0;
-
-  const Int_t kNpasa = 36;
-  Float_t time[kNpasa]   = { -2.80,     -2.40,     -2.00,     -1.60
-                           , -1.20,     -0.80,     -0.60,     -0.40
-                           , -0.30,     -0.20,     -0.10,      0.00
-                           ,  0.10,      0.20,      0.30,      0.40
-                           ,  0.60,      0.80,      1.20,      1.60
-                           ,  2.00,      2.40,      2.80,      3.20
-                           ,  3.60,      4.00,      4.40,      4.80
-                           ,  5.20,      5.60,      7.20,      9.20
-                           , 11.20,     13.20,     15.20,     17.20     };
-  Float_t signal[kNpasa] = {  0.000000,  0.000000,  0.000000,  0.000000
-                           ,  0.000000,  0.000000,  0.015385,  0.086154
-                           ,  0.236923,  0.452308,  0.726154,  1.003077
-                           ,  0.953846,  0.652307,  0.332308,  0.181539
-                           ,  0.120000,  0.083077,  0.049231,  0.024615
-                           ,  0.015385,  0.009231,  0.003077,  0.000000
-                           , -0.003077, -0.006154, -0.009231, -0.012308
-                           , -0.015385, -0.018462, -0.018462, -0.018462
-                          , -0.015385, -0.012308, -0.009231, -0.006154 };
-  for (Int_t ipasa = 0; ipasa < kNpasa; ipasa++) {
-    time[ipasa] = kScale * time[ipasa] + kShift; 
-  }
+  const Int_t kNpasa = 200;
+  Float_t time[kNpasa]   = {  -0.280000, -0.270000, -0.260000, -0.250000
+                            , -0.240000, -0.230000, -0.220000, -0.210000
+                            , -0.200000, -0.190000, -0.180000, -0.170000
+                            , -0.160000, -0.150000, -0.140000, -0.130000
+                            , -0.120000, -0.110000, -0.100000, -0.090000
+                            , -0.080000, -0.070000, -0.060000, -0.050000
+                            , -0.040000, -0.030000, -0.020000, -0.010000
+                            , -0.000000,  0.010000,  0.020000,  0.030000
+                            ,  0.040000,  0.050000,  0.060000,  0.070000
+                            ,  0.080000,  0.090000,  0.100000,  0.110000
+                            ,  0.120000,  0.130000,  0.140000,  0.150000
+                            ,  0.160000,  0.170000,  0.180000,  0.190000
+                            ,  0.200000,  0.210000,  0.220000,  0.230000
+                            ,  0.240000,  0.250000,  0.260000,  0.270000
+                            ,  0.280000,  0.290000,  0.300000,  0.310000
+                            ,  0.320000,  0.330000,  0.340000,  0.350000
+                            ,  0.360000,  0.370000,  0.380000,  0.390000
+                            ,  0.400000,  0.410000,  0.420000,  0.430000
+                            ,  0.440000,  0.450000,  0.460000,  0.470000
+                            ,  0.480000,  0.490000,  0.500000,  0.510000
+                            ,  0.520000,  0.530000,  0.540000,  0.550000
+                            ,  0.560000,  0.570000,  0.580000,  0.590000
+                            ,  0.600000,  0.610000,  0.620000,  0.630000
+                            ,  0.640000,  0.650000,  0.660000,  0.670000
+                            ,  0.680000,  0.690000,  0.700000,  0.710000
+                            ,  0.720000,  0.730000,  0.740000,  0.750000
+                            ,  0.760000,  0.770000,  0.780000,  0.790000
+                            ,  0.800000,  0.810000,  0.820000,  0.830000
+                            ,  0.840000,  0.850000,  0.860000,  0.870000
+                            ,  0.880000,  0.890000,  0.900000,  0.910000
+                            ,  0.920000,  0.930000,  0.940000,  0.950000
+                            ,  0.960000,  0.970000,  0.980000,  0.990000
+                            ,  1.000000,  1.010000,  1.020000,  1.030000
+                            ,  1.040000,  1.050000,  1.060000,  1.070000
+                            ,  1.080000,  1.090000,  1.100000,  1.110000
+                            ,  1.120000,  1.130000,  1.140000,  1.150000
+                            ,  1.160000,  1.170000,  1.180000,  1.190000
+                            ,  1.200000,  1.210000,  1.220000,  1.230000
+                            ,  1.240000,  1.250000,  1.260000,  1.270000
+                            ,  1.280000,  1.290000,  1.300000,  1.310000
+                            ,  1.320000,  1.330000,  1.340000,  1.350000
+                            ,  1.360000,  1.370000,  1.380000,  1.390000
+                            ,  1.400000,  1.410000,  1.420000,  1.430000
+                            ,  1.440000,  1.450000,  1.460000,  1.470000
+                            ,  1.480000,  1.490000,  1.500000,  1.510000
+                            ,  1.520000,  1.530000,  1.540000,  1.550000
+                            ,  1.560000,  1.570000,  1.580000,  1.590000
+                            ,  1.600000,  1.610000,  1.620000,  1.630000
+                            ,  1.640000,  1.650000,  1.660000,  1.670000
+                           ,  1.680000,  1.690000,  1.700000,  1.710000 };
+
+  Float_t signal[kNpasa] = {   0.000000,  0.000000,  0.000000,  0.000000 
+                            ,  0.000000,  0.000000,  0.000000,  0.000000
+                            ,  0.000000,  0.000000,  0.000000,  0.000000
+                            ,  0.000000,  0.000000,  0.000000,  0.000098
+                            ,  0.003071,  0.020056,  0.066053,  0.148346
+                            ,  0.263120,  0.398496,  0.540226,  0.674436
+                            ,  0.790977,  0.883083,  0.947744,  0.985714
+                            ,  0.999248,  0.992105,  0.967669,  0.930827
+                            ,  0.884586,  0.833083,  0.778571,  0.723684
+                            ,  0.669173,  0.617293,  0.567669,  0.521805
+                            ,  0.479699,  0.440977,  0.405639,  0.373985
+                            ,  0.345526,  0.320038,  0.297256,  0.276917
+                            ,  0.258797,  0.242632,  0.228195,  0.215301
+                            ,  0.203759,  0.193383,  0.184023,  0.175564
+                            ,  0.167895,  0.160940,  0.154549,  0.148722
+                            ,  0.143308,  0.138346,  0.133722,  0.129398
+                            ,  0.125376,  0.121617,  0.118045,  0.114699
+                            ,  0.111541,  0.108571,  0.105714,  0.103008
+                            ,  0.100414,  0.097970,  0.095602,  0.093346
+                            ,  0.091165,  0.089060,  0.087068,  0.085150
+                            ,  0.083308,  0.081541,  0.079812,  0.078158
+                            ,  0.076541,  0.075000,  0.073496,  0.072068
+                            ,  0.070677,  0.069286,  0.068008,  0.066729
+                            ,  0.065489,  0.064286,  0.063120,  0.061992
+                            ,  0.060902,  0.059850,  0.058797,  0.057820
+                            ,  0.056842,  0.055902,  0.054962,  0.054060
+                            ,  0.053158,  0.052293,  0.051466,  0.050639
+                            ,  0.049850,  0.049060,  0.048308,  0.047556
+                            ,  0.046842,  0.046128,  0.045451,  0.044774
+                            ,  0.044098,  0.043459,  0.042820,  0.042218
+                            ,  0.041617,  0.041015,  0.040451,  0.039887
+                            ,  0.039323,  0.038797,  0.038271,  0.037744
+                            ,  0.037237,  0.036744,  0.036259,  0.035786
+                            ,  0.035323,  0.034872,  0.034429,  0.033996
+                            ,  0.033575,  0.033162,  0.032756,  0.032361
+                            ,  0.031974,  0.031594,  0.031222,  0.030857
+                            ,  0.030496,  0.030143,  0.029793,  0.029451
+                            ,  0.029109,  0.028774,  0.028444,  0.028113
+                            ,  0.027793,  0.027477,  0.027165,  0.026861
+                            ,  0.026564,  0.026271,  0.025981,  0.025699
+                            ,  0.025421,  0.025147,  0.024880,  0.024613
+                            ,  0.024353,  0.024094,  0.023842,  0.023590
+                            ,  0.023346,  0.023102,  0.022865,  0.022628
+                            ,  0.022398,  0.022173,  0.021951,  0.021733
+                            ,  0.021519,  0.021308,  0.021098,  0.020891
+                            ,  0.020688,  0.020485,  0.020286,  0.020090
+                            ,  0.019895,  0.019707,  0.019519,  0.019335
+                            ,  0.019150,  0.018974,  0.018797,  0.018624
+                            ,  0.018451,  0.018282,  0.018113,  0.017947
+                           ,  0.017782,  0.017617,  0.017455,  0.017297 };
+
+  //for (Int_t ipasa = 0; ipasa < kNpasa; ipasa++) {
+  //  time[ipasa] += 0.13; 
+  //}
 
   if (fTRFsmp) delete fTRFsmp;
   fTRFsmp = new Float_t[fTRFbin];
@@ -593,11 +665,31 @@ void AliTRDdigitizer::SamplePRF()
   // Samples the pad response function
   //
 
+  const Int_t kPRFbin = 61;
+  Float_t prf[kPRFbin] = { 0.002340, 0.003380, 0.004900, 0.007080, 0.010220
+                         , 0.014740, 0.021160, 0.030230, 0.042800, 0.059830
+                         , 0.082030, 0.109700, 0.142550, 0.179840, 0.220610
+                         , 0.263980, 0.309180, 0.355610, 0.402790, 0.450350
+                         , 0.497930, 0.545190, 0.591740, 0.637100, 0.680610
+                         , 0.721430, 0.758400, 0.790090, 0.814720, 0.830480
+                         , 0.835930, 0.830480, 0.814710, 0.790070, 0.758390
+                         , 0.721410, 0.680590, 0.637080, 0.591730, 0.545180
+                         , 0.497920, 0.450340, 0.402790, 0.355610, 0.309190
+                         , 0.263990, 0.220630, 0.179850, 0.142570, 0.109720
+                         , 0.082040, 0.059830, 0.042820, 0.030230, 0.021170
+                         , 0.014740, 0.010230, 0.007080, 0.004900, 0.003380
+                        , 0.002340 };
+
+  fPRFlo  = -1.5;
+  fPRFhi  =  1.5;
+  fPRFbin = kPRFbin;
+  fPRFwid = (fPRFhi - fPRFlo) / ((Float_t) fPRFbin);
+  fPRFpad = ((Int_t) (1.0 / fPRFwid));
+
   if (fPRFsmp) delete fPRFsmp;
   fPRFsmp = new Float_t[fPRFbin];
   for (Int_t iBin = 0; iBin < fPRFbin; iBin++) {
-    Float_t bin = (((Float_t ) iBin) + 0.5) * fPRFwid + fPRFlo;
-    fPRFsmp[iBin] = TMath::Max(fPRF->Eval(bin),0.0);
+    fPRFsmp[iBin] = prf[iBin];
   }
 
 }
@@ -1013,7 +1105,7 @@ Bool_t AliTRDdigitizer::MakeDigits()
 
             // Add the signals
            // Note: The time bin number is shifted by nTimeBefore to avoid negative
-           // time bins. This has to be subtracted lateron.
+           // time bins. This has to be subtracted later.
             Int_t iCurrentTimeBin = iTimeBin + nTimeBefore;
             signalOld[iPad]  = signals->GetDataUnchecked(rowE,colPos,iCurrentTimeBin);
             signalOld[iPad] += padSignal[iPad] * timeResponse;
@@ -1242,14 +1334,86 @@ Bool_t AliTRDdigitizer::WriteDigits()
 }
 
 //_____________________________________________________________________________
-void AliTRDdigitizer::SetPRF(TF1 *prf)
+Float_t AliTRDdigitizer::GetDiffusionL(Float_t vd, Float_t b)
 {
   //
-  // Defines a new pad response function
+  // Returns the longitudinal diffusion coefficient for a given drift 
+  // velocity <vd> and a B-field <b> for Xe/CO2 (15%).
+  // The values are according to a GARFIELD simulation.
   //
 
-  if (fPRF) delete fPRF;
-  fPRF = prf;     
+  const Int_t kNb = 5;
+  Float_t p0[kNb] = {  0.007440,  0.007493,  0.007513,  0.007672,  0.007831 };
+  Float_t p1[kNb] = {  0.019252,  0.018912,  0.018636,  0.018012,  0.017343 };
+  Float_t p2[kNb] = { -0.005042, -0.004926, -0.004867, -0.004650, -0.004424 };
+  Float_t p3[kNb] = {  0.000195,  0.000189,  0.000195,  0.000182,  0.000169 };
+
+  Int_t ib = ((Int_t) (10 * (b - 0.15)));
+  ib       = TMath::Max(  0,ib);
+  ib       = TMath::Min(kNb,ib);
+
+  Float_t diff = p0[ib] 
+               + p1[ib] * vd
+               + p2[ib] * vd*vd
+               + p3[ib] * vd*vd*vd;
+
+  return diff;
+
+}
+
+//_____________________________________________________________________________
+Float_t AliTRDdigitizer::GetDiffusionT(Float_t vd, Float_t b)
+{
+  //
+  // Returns the transverse diffusion coefficient for a given drift 
+  // velocity <vd> and a B-field <b> for Xe/CO2 (15%).
+  // The values are according to a GARFIELD simulation.
+  //
+
+  const Int_t kNb = 5;
+  Float_t p0[kNb] = {  0.009550,  0.009599,  0.009674,  0.009757,  0.009850 };
+  Float_t p1[kNb] = {  0.006667,  0.006539,  0.006359,  0.006153,  0.005925 };
+  Float_t p2[kNb] = { -0.000853, -0.000798, -0.000721, -0.000635, -0.000541 };
+  Float_t p3[kNb] = {  0.000131,  0.000122,  0.000111,  0.000098,  0.000085 };
+
+  Int_t ib = ((Int_t) (10 * (b - 0.15)));
+  ib       = TMath::Max(  0,ib);
+  ib       = TMath::Min(kNb,ib);
+
+  Float_t diff = p0[ib] 
+               + p1[ib] * vd
+               + p2[ib] * vd*vd
+               + p3[ib] * vd*vd*vd;
+
+  return diff;
+
+}
+
+//_____________________________________________________________________________
+Float_t AliTRDdigitizer::GetOmegaTau(Float_t vd, Float_t b)
+{
+  //
+  // Returns omega*tau (tan(Lorentz-angle)) for a given drift velocity <vd> 
+  // and a B-field <b> for Xe/CO2 (15%).
+  // The values are according to a GARFIELD simulation.
+  //
+
+  const Int_t kNb = 5;
+  Float_t p0[kNb] = {  0.004810,  0.007412,  0.010252,  0.013409,  0.016888 };
+  Float_t p1[kNb] = {  0.054875,  0.081534,  0.107333,  0.131983,  0.155455 };
+  Float_t p2[kNb] = { -0.008682, -0.012896, -0.016987, -0.020880, -0.024623 };
+  Float_t p3[kNb] = {  0.000155,  0.000238,  0.000330,  0.000428,  0.000541 };
+
+  Int_t ib = ((Int_t) (10 * (b - 0.15)));
+  ib       = TMath::Max(  0,ib);
+  ib       = TMath::Min(kNb,ib);
+
+  Float_t alphaL = p0[ib] 
+                 + p1[ib] * vd
+                 + p2[ib] * vd*vd
+                 + p3[ib] * vd*vd*vd;
+
+  return TMath::Tan(alphaL);
 
 }
 
index 18a8651..dd825eb 100644 (file)
@@ -44,15 +44,10 @@ class AliTRDdigitizer : public TNamed {
   virtual void         SetADCinRange(Float_t range)     { fADCinRange     = range;    };
   virtual void         SetADCthreshold(Int_t thresh)    { fADCthreshold   = thresh;   };
   virtual void         SetDiffusion(Int_t diffOn = 1)   { fDiffusionOn    = diffOn;   };
-  virtual void         SetDiffusionT(Float_t diff)      { fDiffusionT     = diff;     };
-  virtual void         SetDiffusionL(Float_t diff)      { fDiffusionL     = diff;     };
   virtual void         SetElAttach(Int_t elOn = 1)      { fElAttachOn     = elOn;     };
   virtual void         SetElAttachProp(Float_t prop)    { fElAttachProp   = prop;     };
   virtual void         SetExB(Int_t exbOn = 1)          { fExBOn          = exbOn;    };
-  virtual void         SetOmegaTau(Float_t ot)          { fOmegaTau       = ot;      
-                                                          ReInit();                   };
   virtual void         SetPadResponse(Int_t prfOn = 1)  { fPRFOn          = prfOn;    };
-  virtual void         SetPRF(TF1 *prf);
   virtual void         SetTimeResponse(Int_t trfOn = 1) { fTRFOn          = trfOn;   
                                                           ReInit();                   };
   virtual void         SetDriftVelocity(Float_t v)      { fDriftVelocity  = v;       
@@ -66,23 +61,25 @@ class AliTRDdigitizer : public TNamed {
 
   AliTRDdigitsManager *Digits() const                   { return fDigits;             };
 
-  virtual Float_t      GetGasGain() const               { return fGasGain;            };
-  virtual Float_t      GetNoise() const                 { return fNoise;              };
-  virtual Float_t      GetChipGain() const              { return fChipGain;           };
-  virtual Float_t      GetADCoutRange() const           { return fADCoutRange;        };
-  virtual Float_t      GetADCinRange() const            { return fADCinRange;         };
-  virtual Int_t        GetADCthreshold() const          { return fADCthreshold;       };
-  virtual Float_t      GetDiffusionT() const            { return fDiffusionT;         };
-  virtual Float_t      GetDiffusionL() const            { return fDiffusionL;         };
-  virtual Float_t      GetElAttachProp() const          { return fElAttachProp;       };
-  virtual Float_t      GetOmegaTau() const              { return fOmegaTau;           };
-  virtual TF1         *GetPadResponse() const           { return fPRF;                };
-  virtual Float_t      GetDriftVelocity() const         { return fDriftVelocity;      };
-  virtual Float_t      GetPadCoupling() const           { return fPadCoupling;        };
-  virtual Float_t      GetTimeCoupling() const          { return fTimeCoupling;       };
-  virtual Bool_t       GetCompress() const              { return fCompress;           };
-  virtual Bool_t       GetSDigits() const               { return fSDigits;            };
-  virtual Float_t      GetTimeBinWidth() const          { return fTimeBinWidth;       };
+          Float_t      GetGasGain() const               { return fGasGain;            };
+          Float_t      GetNoise() const                 { return fNoise;              };
+          Float_t      GetChipGain() const              { return fChipGain;           };
+          Float_t      GetADCoutRange() const           { return fADCoutRange;        };
+          Float_t      GetADCinRange() const            { return fADCinRange;         };
+          Int_t        GetADCthreshold() const          { return fADCthreshold;       };
+          Float_t      GetDiffusionT() const            { return fDiffusionT;         };
+          Float_t      GetDiffusionL() const            { return fDiffusionL;         };
+          Float_t      GetElAttachProp() const          { return fElAttachProp;       };
+          Float_t      GetOmegaTau() const              { return fOmegaTau;           };
+          Float_t      GetDriftVelocity() const         { return fDriftVelocity;      };
+          Float_t      GetPadCoupling() const           { return fPadCoupling;        };
+          Float_t      GetTimeCoupling() const          { return fTimeCoupling;       };
+          Bool_t       GetCompress() const              { return fCompress;           };
+          Bool_t       GetSDigits() const               { return fSDigits;            };
+          Float_t      GetTimeBinWidth() const          { return fTimeBinWidth;       };
+  virtual Float_t      GetDiffusionL(Float_t vd, Float_t b);
+  virtual Float_t      GetDiffusionT(Float_t vd, Float_t b);
+  virtual Float_t      GetOmegaTau(Float_t vd, Float_t b);
 
  protected:
 
@@ -93,6 +90,7 @@ class AliTRDdigitizer : public TNamed {
   
   Int_t                fEvent;           //! Event number
 
+  Float_t              fField;           // Magnetic field
   Float_t              fGasGain;         // Gas gain
   Float_t              fNoise;           // Electronics noise
   Float_t              fChipGain;        // Electronics gain
@@ -110,7 +108,6 @@ class AliTRDdigitizer : public TNamed {
   Float_t              fOmegaTau;        // Tangens of the Lorentz angle 
   Float_t              fLorentzFactor;   // Factor due to Lorentz force
   Int_t                fPRFOn;           // Switch for the pad response
-  TF1                 *fPRF;             // Pad response function
   Float_t             *fPRFsmp;          //!Sampled pad response
   Int_t                fPRFbin;          // Number of bins for the PRF
   Float_t              fPRFlo;           // Lower boundary of the PRF
index 0c3da12..0728921 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.11  2001/05/11 07:56:12  hristov
+Consistent declarations needed on Alpha
+
 Revision 1.10  2001/05/07 08:08:05  cblume
 Update of TRD code
 
@@ -131,9 +134,7 @@ ClassImp(AliTRDgeometry)
   //
   // Thickness of the the material layers
   //
-  const Float_t AliTRDgeometry::fgkSeThick = 0.02;  
-  const Float_t AliTRDgeometry::fgkRaThick = 4.78;  
-  const Float_t AliTRDgeometry::fgkPeThick = 0.20;    
+  const Float_t AliTRDgeometry::fgkRaThick = 0.3646;  
   const Float_t AliTRDgeometry::fgkMyThick = 0.005;
   const Float_t AliTRDgeometry::fgkXeThick = 3.5;
   const Float_t AliTRDgeometry::fgkDrThick = 3.0;
@@ -143,14 +144,13 @@ ClassImp(AliTRDgeometry)
   const Float_t AliTRDgeometry::fgkSuThick = 0.06; 
   const Float_t AliTRDgeometry::fgkFeThick = 0.0044; 
   const Float_t AliTRDgeometry::fgkCoThick = 0.02;
-  const Float_t AliTRDgeometry::fgkWaThick = 0.01;
+//const Float_t AliTRDgeometry::fgkWaThick = 0.01;
+  const Float_t AliTRDgeometry::fgkWaThick = 0.02;
 
   //
   // Position of the material layers
   //
-  const Float_t AliTRDgeometry::fgkSeZpos  = -4.14; 
   const Float_t AliTRDgeometry::fgkRaZpos  = -1.74;
-  const Float_t AliTRDgeometry::fgkPeZpos  =  0.0000;
   const Float_t AliTRDgeometry::fgkMyZpos  =  0.6550;
   const Float_t AliTRDgeometry::fgkDrZpos  =  2.1600;
   const Float_t AliTRDgeometry::fgkAmZpos  =  3.9100;
@@ -158,7 +158,8 @@ ClassImp(AliTRDgeometry)
   const Float_t AliTRDgeometry::fgkSuZpos  =  0.0000;
   const Float_t AliTRDgeometry::fgkFeZpos  =  1.3053;
   const Float_t AliTRDgeometry::fgkCoZpos  =  1.3175;
-  const Float_t AliTRDgeometry::fgkWaZpos  =  1.3325; 
+//const Float_t AliTRDgeometry::fgkWaZpos  =  1.3325; 
+  const Float_t AliTRDgeometry::fgkWaZpos  =  1.3375; 
 
 //_____________________________________________________________________________
 AliTRDgeometry::AliTRDgeometry():AliGeometry()
@@ -300,18 +301,16 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
   //                           inner(/middle/outer) chambers
   //
   // The material layers in one chamber:
-  //    UL01       (G10)   --- The gas seal of the radiator
-  //    UL02       (CO2)   --- The gas in the radiator
-  //    UL03       (PE)    --- The foil stack
-  //    UL04       (Mylar) --- Entrance window to the driftvolume and HV-cathode
-  //    UL05       (Xe)    --- The driftvolume
-  //    UL06       (Xe)    --- The amplification region
+  //    UL03       (Rohacell) --- The radiator
+  //    UL04       (Mylar)    --- Entrance window to the driftvolume and HV-cathode
+  //    UL05       (Xe)       --- The driftvolume
+  //    UL06       (Xe)       --- The amplification region
   //    
-  //    UL07       (Cu)    --- The pad plane
-  //    UL08       (G10)   --- The Nomex honeycomb support structure
-  //    UL09       (Cu)    --- FEE and signal lines
-  //    UL10       (PE)    --- The cooling devices
-  //    UL11       (Water) --- The cooling water
+  //    UL07       (Cu)       --- The pad plane
+  //    UL08       (G10)      --- The Nomex honeycomb support structure
+  //    UL09       (Cu)       --- FEE and signal lines
+  //    UL10       (Al)       --- The cooling devices
+  //    UL11       (Water)    --- The cooling water
 
   const Int_t kNparCha = 3;
 
@@ -355,22 +354,16 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
   // The material layers inside the chambers
   parCha[0] = -1.;
   parCha[1] = -1.;
-  // G10 layer (radiator seal)
-  parCha[2] = fgkSeThick/2;
-  gMC->Gsvolu("UL01","BOX ",idtmed[1313-1],parCha,kNparCha);
-  // CO2 layer (radiator)
+  // Rohacell layer (radiator)
   parCha[2] = fgkRaThick/2;
-  gMC->Gsvolu("UL02","BOX ",idtmed[1312-1],parCha,kNparCha);
-  // PE layer (radiator)
-  parCha[2] = fgkPeThick/2;
-  gMC->Gsvolu("UL03","BOX ",idtmed[1303-1],parCha,kNparCha);
+  gMC->Gsvolu("UL03","BOX ",idtmed[1315-1],parCha,kNparCha);
   // Mylar layer (entrance window + HV cathode) 
   parCha[2] = fgkMyThick/2;
   gMC->Gsvolu("UL04","BOX ",idtmed[1308-1],parCha,kNparCha);
-  // Xe/Isobutane layer (drift volume, sensitive
+  // Xe/Isobutane layer (drift volume) 
   parCha[2] = fgkDrThick/2.;
   gMC->Gsvolu("UL05","BOX ",idtmed[1309-1],parCha,kNparCha);
-  // Xe/Isobutane layer (amplification volume, not sensitive)
+  // Xe/Isobutane layer (amplification volume)
   parCha[2] = fgkAmThick/2.;
   gMC->Gsvolu("UL06","BOX ",idtmed[1309-1],parCha,kNparCha);
   
@@ -383,9 +376,9 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
   // Cu layer (FEE + signal lines)
   parCha[2] = fgkFeThick/2;
   gMC->Gsvolu("UL09","BOX ",idtmed[1305-1],parCha,kNparCha);
-  // PE layer (cooling devices)
+  // Al layer (cooling devices)
   parCha[2] = fgkCoThick/2;
-  gMC->Gsvolu("UL10","BOX ",idtmed[1303-1],parCha,kNparCha);
+  gMC->Gsvolu("UL10","BOX ",idtmed[1301-1],parCha,kNparCha);
   // Water layer (cooling)
   parCha[2] = fgkWaThick/2;
   gMC->Gsvolu("UL11","BOX ",idtmed[1314-1],parCha,kNparCha);
@@ -394,19 +387,11 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
   xpos = 0;
   ypos = 0;
 
-  // G10 layer (radiator seal)
-  zpos = fgkSeZpos;
-  gMC->Gspos("UL01",1,"UCII",xpos,ypos,zpos,0,"ONLY");
-  gMC->Gspos("UL01",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
-  gMC->Gspos("UL01",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
-  // CO2 layer (radiator)
+  // Rohacell layer (radiator)
   zpos = fgkRaZpos;
-  gMC->Gspos("UL02",1,"UCII",xpos,ypos,zpos,0,"ONLY");
-  gMC->Gspos("UL02",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
-  gMC->Gspos("UL02",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
-  // PE layer (radiator)
-  zpos = 0;
-  gMC->Gspos("UL03",1,"UL02",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL03",1,"UCII",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL03",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
+  gMC->Gspos("UL03",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
   // Mylar layer (entrance window + HV cathode)   
   zpos = fgkMyZpos;
   gMC->Gspos("UL04",1,"UCII",xpos,ypos,zpos,0,"ONLY");
@@ -422,7 +407,6 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
   gMC->Gspos("UL06",1,"UCII",xpos,ypos,zpos,0,"ONLY");
   gMC->Gspos("UL06",2,"UCIM",xpos,ypos,zpos,0,"ONLY");
   gMC->Gspos("UL06",3,"UCIO",xpos,ypos,zpos,0,"ONLY");
-
   // Cu layer (pad plane)
   zpos = fgkCuZpos;
   gMC->Gspos("UL07",1,"UAII",xpos,ypos,zpos,0,"ONLY");
@@ -438,7 +422,7 @@ void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
   gMC->Gspos("UL09",1,"UAII",xpos,ypos,zpos,0,"ONLY");
   gMC->Gspos("UL09",2,"UAIM",xpos,ypos,zpos,0,"ONLY");
   gMC->Gspos("UL09",3,"UAIO",xpos,ypos,zpos,0,"ONLY");
-  // PE layer (cooling devices)
+  // Al layer (cooling devices)
   zpos = fgkCoZpos;
   gMC->Gspos("UL10",1,"UAII",xpos,ypos,zpos,0,"ONLY");
   gMC->Gspos("UL10",2,"UAIM",xpos,ypos,zpos,0,"ONLY");
index 9fb9f95..2366c0f 100644 (file)
@@ -3,11 +3,7 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-/* $Id: AliTRDgeometry.h,v 1.8 2001/02/14 18:22:26 cbl
- public:
-
-  enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
-ume Exp $ */
+/* $Id$ */
 
 #include "AliGeometry.h"
 
@@ -43,11 +39,9 @@ class AliTRDgeometry : public AliGeometry {
   static  Float_t  Cheight() { return fgkCheight; };
   static  Float_t  Cspace()  { return fgkCspace;  };
   static  Float_t  Ccframe() { return fgkCcframe; };
-  static  Float_t  SeThick() { return fgkSeThick; };
   static  Float_t  MyThick() { return fgkMyThick; };
   static  Float_t  DrThick() { return fgkDrThick; };
   static  Float_t  AmThick() { return fgkAmThick; };
-  static  Float_t  RaThick() { return fgkRaThick; };
   static  Float_t  DrZpos()  { return fgkDrZpos;  };
 
   virtual void     SetPHOShole() = 0;
@@ -122,9 +116,7 @@ class AliTRDgeometry : public AliGeometry {
   static const Float_t fgkCathick;                          // Thickness of the aluminum frame
   static const Float_t fgkCcthick;                          // Thickness of the carbon frame
 
-  static const Float_t fgkSeThick;                          // Thickness of the radiator seal
   static const Float_t fgkRaThick;                          // Thickness of the radiator
-  static const Float_t fgkPeThick;                          // Thickness of the PE-layer in the radiator
   static const Float_t fgkMyThick;                          // Thickness of the mylar-layer
   static const Float_t fgkXeThick;                          // Thickness of the gas volume
   static const Float_t fgkDrThick;                          // Thickness of the drift region
@@ -135,9 +127,7 @@ class AliTRDgeometry : public AliGeometry {
   static const Float_t fgkCoThick;                          // Thickness of the PE of the cooling device
   static const Float_t fgkWaThick;                          // Thickness of the cooling water
 
-  static const Float_t fgkSeZpos;                           // Position of the radiator seal
   static const Float_t fgkRaZpos;                           // Position of the radiator
-  static const Float_t fgkPeZpos;                           // Position of the PE-layer in the radiator
   static const Float_t fgkMyZpos;                           // Position of the mylar-layer
   static const Float_t fgkDrZpos;                           // Position of the drift region
   static const Float_t fgkAmZpos;                           // Position of the amplification region
index 82b68e2..5e4e537 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.8  2001/01/26 19:56:57  hristov
+Major upgrade of AliRoot code
+
 Revision 1.7  2000/12/20 13:00:45  cblume
 Modifications for the HP-compiler
 
@@ -184,20 +187,19 @@ void AliTRDsim::Init()
 {
   //
   // Initialization 
-  // The default radiator are 100 prolypropilene foils of 20 mu thickness
-  // with gaps of 500 mu filled with CO2.
-  //      
+  // The default radiator are 100 prolypropilene foils of 13 mu thickness
+  // with gaps of 60 mu filled with CO2.
   // 
 
   fNFoils     = 100;
 
-  fFoilThick  = 0.0020;
+  fFoilThick  = 0.0013;
   fFoilDens   = 0.92;   
   fFoilZ      = 5.28571;
   fFoilA      = 10.4286;
   fFoilOmega  = Omega(fFoilDens,fFoilZ,fFoilA);
 
-  fGapThick   = 0.0500;
+  fGapThick   = 0.0060;
   fGapDens    = 0.001977;  
   fGapZ       = 7.45455;
   fGapA       = 14.9091;
index b3381f0..d11652b 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.29  2001/05/16 14:57:28  alibrary
+New files for folders and Stack
+
 Revision 1.28  2001/05/07 08:03:22  cblume
 Generate also hits in the amplification region
 
@@ -328,7 +331,7 @@ void AliTRDv1::CreateTRhit(Int_t det)
         // Gas-mixture (Xe/CO2)
         Double_t muXe = fTR->GetMuXe(energyMeV);
         Double_t muCO = fTR->GetMuCO(energyMeV);
-        sigma = (0.90 * muXe + 0.10 * muCO) * fGasDensity;
+        sigma = (0.85 * muXe + 0.15 * muCO) * fGasDensity;
       }
       else {
         // Gas-mixture (Xe/Isobutane)