Move tail cancellation parameters to recparam
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Mar 2006 14:15:10 +0000 (14:15 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Mar 2006 14:15:10 +0000 (14:15 +0000)
TRD/AliTRDRecParam.cxx
TRD/AliTRDRecParam.h
TRD/AliTRDSimParam.cxx
TRD/AliTRDSimParam.h
TRD/AliTRDclusterizerV1.cxx
TRD/AliTRDclusterizerV1.h
TRD/AliTRDdigitizer.cxx
TRD/AliTRDtracker.cxx

index 07f4bf4c0bda8ba69e69ec4cd894e0f6a851adc4..70102f169b0854d2c533d7712e35d8f434f0ed49 100644 (file)
@@ -79,6 +79,9 @@ AliTRDRecParam::AliTRDRecParam()
   fLUTOn              = kFALSE;  
   fLUTbin = 0;
   
+  fTCOn               = kFALSE;
+  fTCnexp             = 0;
+  
   Init();
 }
 
@@ -139,6 +142,9 @@ void AliTRDRecParam::Copy(TObject &p) const
   target->fClusMaxThresh      = fClusMaxThresh;
   target->fClusSigThresh      = fClusSigThresh;
   
+  target->fTCOn               = fTCOn;
+  target->fTCnexp             = fTCnexp;
+
 }
 
 //_____________________________________________________________________________
@@ -157,6 +163,13 @@ void AliTRDRecParam::Init()
 
   // Create the LUT
   FillLUT();
+
+  // The tail cancelation
+  fTCOn           = kTRUE;
+  
+  // The number of exponentials
+  fTCnexp         = 1;
+
 }
 
 //_____________________________________________________________________________
index c6b7bc681ca1dd5d778a684363004b979d6be068..c2d3a745a0ebc15eb8326fe71f32c048a1b22f3e 100644 (file)
@@ -29,12 +29,18 @@ class AliTRDRecParam : public TObject
     virtual void     SetClusMaxThresh(Int_t thresh)                 { fClusMaxThresh  = thresh;   };
     virtual void     SetClusSigThresh(Int_t thresh)                 { fClusSigThresh  = thresh;   };
     
+            void SetTailCancelation(Int_t tcOn = 1)                 { fTCOn           = tcOn;     };
+            void SetNexponential(Int_t nexp)                        { fTCnexp         = nexp;     };
+  
     Bool_t   LUTOn()                                          const { return fLUTOn;         };
     virtual Int_t    GetClusMaxThresh()                       const { return fClusMaxThresh; };
     virtual Int_t    GetClusSigThresh()                       const { return fClusSigThresh; };
     
     virtual Double_t  LUTposition(Int_t iplane, Double_t ampL, Double_t ampC, Double_t ampR) const;
   
+            Bool_t   TCOn()                                   const { return fTCOn;          };
+            Int_t    GetTCnexp()                              const { return fTCnexp;            };
+  
   protected:
     static AliTRDRecParam* fgInstance;     // Instance of this class (singleton implementation)
     static Bool_t fgTerminated;               // Defines if this class has already been terminated and therefore does not return instances in GetInstance anymore
@@ -49,6 +55,8 @@ class AliTRDRecParam : public TObject
     Int_t                fLUTbin;                             //  Number of bins of the LUT
     Float_t             *fLUT;                                //! The lookup table
   
+    Int_t                fTCOn;                               //  Switch for the tail cancelation
+    Int_t                fTCnexp;                             //  Number of exponentials, digital filter
     virtual void         FillLUT();
   
   private:
index 1748ac0331d0210d2e65423d3a9f68ca25a01bd4..a745f04a58ffe13aca5ec49ca40c0a6a676291c1 100644 (file)
@@ -100,10 +100,6 @@ AliTRDSimParam::AliTRDSimParam()
   fCTOn               = kFALSE;
   fCTsmp              = 0;
   
-  fTCOn               = kFALSE;
-  
-  fTCnexp             = 0;
-  
   fAnodeWireOffset    = 0.0;
   fPadCoupling        = 0.0;
   fTimeCoupling       = 0.0;
@@ -143,12 +139,6 @@ void AliTRDSimParam::Init()
   // The cross talk
   fCTOn           = kTRUE;
 
-  // The tail cancelation
-  fTCOn           = kTRUE;
-  
-  // The number of exponentials
-  fTCnexp         = 1;
-
   // The pad coupling factor
   //fPadCoupling    = 0.3;
   // Use 0.46 instead which reproduces better the test beam
@@ -256,9 +246,6 @@ void AliTRDSimParam::Copy(TObject &p) const
     target->fCTsmp[iBin]  = fCTsmp[iBin];
   }
   
-  target->fTCOn               = fTCOn;
-  target->fTCnexp             = fTCnexp;
-
   target->fAnodeWireOffset    = fAnodeWireOffset;
   target->fPadCoupling        = fPadCoupling;
   target->fTimeCoupling       = fTimeCoupling;
index 102828c067dfd1e8755c88c1795ccccb75e1b483..b695c740c0c3fc55ace7bdb2dfe050787f298c7b 100644 (file)
@@ -44,9 +44,6 @@ public:
   
   void SetCrossTalk(Int_t ctOn = 1)                   { fCTOn           = ctOn; ReInit(); };
   
-  void SetTailCancelation(Int_t tcOn = 1)             { fTCOn           = tcOn;     };
-  void SetNexponential(Int_t nexp)                    { fTCnexp         = nexp;     };
-  
   void SetPadCoupling(Float_t v)                      { fPadCoupling    = v;        };
   void SetTimeCoupling(Float_t v)                     { fTimeCoupling   = v;        };
   void SetAnodeWireOffset(Float_t offset = 0.25)      { fAnodeWireOffset = offset;};
@@ -76,9 +73,6 @@ public:
   Bool_t   CTOn()                                   const { return fCTOn;          };
   Double_t CrossTalk(Double_t time) const; 
   
-  Bool_t   TCOn()                                   const { return fTCOn;          };
-  Int_t    GetTCnexp()                              const { return fTCnexp;            };
-  
   Float_t  GetPadCoupling()                         const { return fPadCoupling;       };
   Float_t  GetTimeCoupling()                        const { return fTimeCoupling;      };
   Float_t  GetAnodeWireOffset()                     const { return fAnodeWireOffset;   };
@@ -115,9 +109,6 @@ protected:
   Int_t                fCTOn;                               //  Switch for cross talk
   Float_t             *fCTsmp;                              //! Integrated cross talk
   
-  Int_t                fTCOn;                               //  Switch for the tail cancelation
-  Int_t                fTCnexp;                             //  Number of exponential of the digital filter
-  
   Float_t              fAnodeWireOffset;                    //  Distance of first anode wire from pad edge
   Float_t              fPadCoupling;                        //  Pad coupling factor
   Float_t              fTimeCoupling;                       //  Time coupling factor (image charge of moving ions)
index 1a6029e2170d72f8436cabed3905714128877613..87885edb96af5bf24adf5f4117de2119add7d4c8 100644 (file)
@@ -211,6 +211,8 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
     return kFALSE;
   }
     
+  Float_t ADCthreshold = simParam->GetADCthreshold();
+
   if (fVerbose > 0) {
     //printf("<AliTRDclusterizerV1::MakeCluster> ");
     //printf("OmegaTau = %f \n",omegaTau);
@@ -261,7 +263,6 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
     printf("Number of Time Bins = %d.\n",nTimeTotal);
   }
 
-
   // Start clustering in every chamber
   for (Int_t icham = chamBeg; icham < chamEnd; icham++) {
     for (Int_t iplan = planBeg; iplan < planEnd; iplan++) {
@@ -292,7 +293,9 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
         digitsIn->Expand();
         digitsOut->Expand();
 
-       Transform(digitsIn, digitsOut, idet, nRowMax, nColMax, nTimeTotal);
+       if (recParam->TCOn()) {            // tail cancellation
+         Transform(digitsIn, digitsOut, idet, nRowMax, nColMax, nTimeTotal, ADCthreshold);
+       }
 
         track0 = fDigitsManager->GetDictionary(idet,0);
         track0->Expand();
@@ -437,7 +440,6 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
                   iUnfold = 1;
                 }
 
-
                 Double_t clusterCharge = clusterSignal[0]
                                        + clusterSignal[1]
                                        + clusterSignal[2];
@@ -541,6 +543,7 @@ Bool_t AliTRDclusterizerV1::MakeClusters()
 
 }
 
+//_____________________________________________________________________________
 Double_t AliTRDclusterizerV1::GetCOG(Double_t signal[5])
 {
   //
@@ -551,8 +554,6 @@ Double_t AliTRDclusterizerV1::GetCOG(Double_t signal[5])
   return res;            
 }
 
-
-
 //_____________________________________________________________________________
 Double_t AliTRDclusterizerV1::Unfold(Double_t eps, Int_t plane, Double_t* padSignal)
 {
@@ -617,7 +618,8 @@ Double_t AliTRDclusterizerV1::Unfold(Double_t eps, Int_t plane, Double_t* padSig
 void AliTRDclusterizerV1::Transform(AliTRDdataArrayI* digitsIn,
                                    AliTRDdataArrayI* digitsOut,
                                    Int_t idet, Int_t nRowMax,
-                                   Int_t nColMax, Int_t nTimeTotal)
+                                   Int_t nColMax, Int_t nTimeTotal,
+                                   Float_t ADCthreshold)
 {
 
   //
@@ -626,11 +628,11 @@ void AliTRDclusterizerV1::Transform(AliTRDdataArrayI* digitsIn,
   //
 
 
-  AliTRDSimParam* simParam = AliTRDSimParam::Instance();
-  if (!simParam)
+  AliTRDRecParam* recParam = AliTRDRecParam::Instance();
+  if (!recParam)
   {
     printf("<AliTRDclusterizerV1::Transform> ");
-    printf("ERROR getting instance of AliTRDSimParam");
+    printf("ERROR getting instance of AliTRDRecParam");
     return;
   }
   AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
@@ -641,7 +643,7 @@ void AliTRDclusterizerV1::Transform(AliTRDdataArrayI* digitsIn,
   if (fVerbose > 0) {
     printf("<AliTRDclusterizerV1::Transform> ");
     printf("Tail cancellation (nExp = %d) for detector %d.\n",
-          simParam->GetTCnexp(),idet);
+          recParam->GetTCnexp(),idet);
   }
 
   for (Int_t iRow  = 0; iRow  <  nRowMax;   iRow++ ) {
@@ -661,14 +663,14 @@ void AliTRDclusterizerV1::Transform(AliTRDdataArrayI* digitsIn,
       }
 
       // Apply the tail cancelation via the digital filter
-      if (simParam->TCOn())
+      if (recParam->TCOn())
       {
-       DeConvExp(inADC,outADC,nTimeTotal,simParam->GetTCnexp());
+       DeConvExp(inADC,outADC,nTimeTotal,recParam->GetTCnexp());
       }
 
       for (Int_t iTime = 0; iTime < nTimeTotal; iTime++) {   
        // Store the amplitude of the digit if above threshold
-       if (outADC[iTime] > simParam->GetADCthreshold()) {
+       if (outADC[iTime] > ADCthreshold) {
          if (fVerbose > 1)
          {
            printf("  iRow = %d, iCol = %d, iTime = %d, adc = %f\n"
index f45cc6cbef43e4d2f5e18d095824d1e8e5d3160d..4e04ba090a4a87d2898cacdb8729b55ea56ed597 100644 (file)
@@ -38,7 +38,7 @@ class AliTRDclusterizerV1 : public AliTRDclusterizer {
  private:
   void DeConvExp(Double_t *source, Double_t *target, Int_t nTimeTotal, Int_t nexp);
   void Transform(AliTRDdataArrayI* digitsIn, AliTRDdataArrayI* digitsOut,
-                Int_t idet, Int_t nRowMax, Int_t nColMax, Int_t nTimeTotal);
+                Int_t idet, Int_t nRowMax, Int_t nColMax, Int_t nTimeTotal, Float_t ADCthreshold);
   virtual Double_t Unfold(Double_t eps, Int_t plane, Double_t *padSignal);
   Double_t GetCOG(Double_t signal[5]);      // get COG position
 
index 087c53690f526019a338da0e3ed0fa6059fae34d..9268e8f52c633fa804b6691df02dab2353b230ff 100644 (file)
@@ -996,7 +996,10 @@ Bool_t AliTRDdigitizer::MakeDigits()
 
           // The time bin (always positive), with t0 correction
           Double_t timeBinIdeal = drifttime * samplingRate + t0;
-         if (TMath::Abs(timeBinIdeal)>nTimeTotal*2) timeBinIdeal = nTimeTotal*2; //???MI????
+         // Protection according to MI
+          if (TMath::Abs(timeBinIdeal) > 2*nTimeTotal) {
+            timeBinIdeal = 2 * nTimeTotal;
+         }
           Int_t    timeBinTruncated = (Int_t) timeBinIdeal;
           // The distance of the position to the middle of the timebin
           Double_t timeOffset = ((Float_t) timeBinTruncated + 0.5 - timeBinIdeal) / samplingRate;
index ec6223fdc6fea0d81386745a56dd9a5bd4a82498..a3b444f3aaa62d054aae7083c2a7ceeed5989045 100644 (file)
@@ -708,7 +708,6 @@ Int_t AliTRDtracker::FollowProlongation(AliTRDtrack& t, Int_t rf)
   Int_t lastplane = GetLastPlane(&t);
   Double_t radLength = 0.0;
   Double_t rho = 0.0;
-  Double_t x;
   Int_t expectedNumberOfClusters = 0;
   //
   //
@@ -2374,9 +2373,9 @@ AliTRDtracker::AliTRDtrackingSector::AliTRDtrackingSector(AliTRDgeometry* geo, I
 
   // add layers for each of the planes
   Double_t dxAmp = (Double_t) fGeom->CamHght();   // Amplification region
-  Double_t dxDrift = (Double_t) fGeom->CdrHght(); // Drift region  
+  //Double_t dxDrift = (Double_t) fGeom->CdrHght(); // Drift region  
 
-  Int_t tb, tbIndex;
+  Int_t    tbIndex;
   const Int_t  kNchambers = AliTRDgeometry::Ncham();
   Double_t  ymax = 0;
   Double_t ymaxsensitive=0;
@@ -2414,8 +2413,8 @@ AliTRDtracker::AliTRDtrackingSector::AliTRDtrackingSector(AliTRDgeometry* geo, I
     rho = 0.00295 * 0.85; radLength = 11.0;  
 
     Double_t x0 = (Double_t) AliTRDgeometry::GetTime0(plane);
-    Double_t xbottom = x0 - dxDrift;
-    Double_t xtop = x0 + dxAmp;
+    //Double_t xbottom = x0 - dxDrift;
+    //Double_t xtop = x0 + dxAmp;
     //
     Int_t nTimeBins =  AliTRDcalibDB::Instance()->GetNumberOfTimeBins();    
     for (Int_t iTime = 0; iTime<nTimeBins; iTime++){