]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Update of digitization. Moved digit branch definition to AliTRD
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Mar 2001 09:30:44 +0000 (09:30 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Mar 2001 09:30:44 +0000 (09:30 +0000)
TRD/AliTRD.cxx
TRD/AliTRD.h
TRD/AliTRDconfig.C
TRD/AliTRDcreateDigits.C
TRD/AliTRDdigitizer.cxx
TRD/AliTRDdigitizer.h
TRD/AliTRDdigitsManager.cxx
TRD/AliTRDgeometry.cxx
TRD/AliTRDsegmentArray.cxx
TRD/AliTRDtest.C

index ec84e956c036453d2fc17f4fd9ba55846da8e109..923efcf5008600c1e7662bd55587d01917ecd590 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.24  2001/01/26 19:56:49  hristov
+Major upgrade of AliRoot code
+
 Revision 1.23  2000/11/01 14:53:20  cblume
 Merge with TRD-develop
 
@@ -126,6 +129,8 @@ Introduction of the Copyright and cvs Log
 #include "AliTRDgeometryFull.h"
 #include "AliTRDrecPoint.h"
 #include "AliTRDdigitsManager.h"
+#include "AliTRDdataArrayI.h"
+#include "AliTRDsegmentArray.h"
 
 ClassImp(AliTRD)
  
@@ -136,21 +141,26 @@ AliTRD::AliTRD()
   // Default constructor
   //
 
-  fIshunt      = 0;
-  fGasMix      = 0;
-  fHits        = 0;
-  fDigits      = 0;
+  fIshunt        = 0;
+  fGasMix        = 0;
+  fHits          = 0;
+  fDigits        = 0;
 
-  fRecPoints   = 0;
-  fNRecPoints  = 0;
+  fRecPoints     = 0;
+  fNRecPoints    = 0;
 
-  fGeometry    = 0;
+  fGeometry      = 0;
 
-  fGasDensity  = 0;
-  fFoilDensity = 0;
+  fGasDensity    = 0;
+  fFoilDensity   = 0;
 
-  fDrawTR      = 0;
-  fDisplayType = 0; 
+  fDrawTR        = 0;
+  fDisplayType   = 0; 
+
+  fDigitsArray   = 0; 
+  for (Int_t iDict = 0; iDict < AliTRDdigitsManager::NDict(); iDict++) {
+    fDictionaryArray[iDict] = 0; 
+  }
 
 }
  
@@ -192,17 +202,22 @@ AliTRD::AliTRD(const char *name, const char *title)
   fDigits      = 0;
 
   // Allocate the rec point array
-  fRecPoints   = new TObjArray(400);
-  fNRecPoints  = 0;
+  fRecPoints     = new TObjArray(400);
+  fNRecPoints    = 0;
    
-  fIshunt      = 0;
-  fGasMix      = 0;
+  fIshunt        = 0;
+  fGasMix        = 1;
 
-  fGasDensity  = 0;
-  fFoilDensity = 0;
+  fGasDensity    = 0;
+  fFoilDensity   = 0;
 
-  fDrawTR      = 0;
-  fDisplayType = 0;
+  fDrawTR        = 0;
+  fDisplayType   = 0;
+
+  fDigitsArray   = 0; 
+  for (Int_t iDict = 0; iDict < AliTRDdigitsManager::NDict(); iDict++) {
+    fDictionaryArray[iDict] = 0; 
+  }
 
   SetMarkerColor(kWhite);   
 
@@ -231,6 +246,10 @@ AliTRD::~AliTRD()
   delete fGeometry;
   delete fHits;
   delete fRecPoints;
+  if (fDigitsArray) delete fDigitsArray;
+  for (Int_t iDict = 0; iDict < AliTRDdigitsManager::NDict(); iDict++) {
+    if (fDictionaryArray[iDict]) delete fDictionaryArray[iDict];
+  }
 
 }
 
@@ -257,38 +276,81 @@ void AliTRD::AddRecPoint(Float_t *pos, Int_t *digits, Int_t det, Float_t amp
   fRecPoints->Add(recPoint);
 
 }
-//___________________________________________
-void AliTRD::SDigits2Digits()
+
+//_____________________________________________________________________________
+void AliTRD::Hits2Digits()
 {
   //
   // Create digits
   //
-  AliTRDdigitizer *Digitizer = new AliTRDdigitizer("digitizer","TRD digitizer class");
+
+  AliTRDdigitizer *digitizer = new AliTRDdigitizer("TRDdigitizer"
+                                                  ,"TRD digitizer class");
 
   // Set the parameter
-  Digitizer->SetDiffusion();
-  Digitizer->SetVerbose(1);
+  digitizer->SetDiffusion();
+  digitizer->SetExB();
+
+  // Initialization
+  //digitizer->InitDetector();
+    
+  // Create the digits
+  digitizer->MakeDigits();
   
-  //Digitizer->SetExB();
-  //Digitizer->SetElAttach();
-  //Digitizer->SetAttachProb();
+  // Write the digits into the input file
+  if (digitizer->Digits()->MakeBranch(fDigitsFile)) {
+
+    digitizer->WriteDigits();
+
+    // Save the digitizer class in the AliROOT 
+    digitizer->Write();
+
+  }
+
+}
+
+//_____________________________________________________________________________
+void AliTRD::Hits2SDigits()
+{
+  //
+  // Create summable digits
+  //
+
+  AliTRDdigitizer *digitizer = new AliTRDdigitizer("TRDdigitizer"
+                                                  ,"TRD digitizer class");
+
+  // For the summable digits
+  digitizer->SetSDigits(kTRUE);
 
-  Digitizer->InitDetector();
+  // Set the parameter
+  digitizer->SetDiffusion();
+  digitizer->SetExB();
+
+  // Initialization
+  //digitizer->InitDetector();
     
   // Create the digits
-  Digitizer->MakeDigits();
-  cout<<"After MakeDigits"<<endl;
+  digitizer->MakeDigits();
   
   // Write the digits into the input file
-  if (Digitizer->Digits()->MakeBranch(fDigitsFile))
-  {
-    Digitizer->WriteDigits();
-    cout<<"After write digits"<<endl;
+  if (digitizer->Digits()->MakeBranch(fDigitsFile)) {
+
+    digitizer->WriteDigits();
 
     // Save the digitizer class in the AliROOT 
-    Digitizer->Write();
-    cout<<"After write digitizer"<<endl;
+    digitizer->Write();
+
   }
+
+}
+
+//_____________________________________________________________________________
+void AliTRD::SDigits2Digits()
+{
+  //
+  // Create final digits from summable digits
+  //
+
 }
 
 //_____________________________________________________________________________
@@ -844,6 +906,22 @@ void AliTRD::MakeBranch(Option_t* option, char *file)
 
   AliDetector::MakeBranch(option,file);
 
+  Int_t buffersize = 64000;
+
+  fDigitsArray = new AliTRDdataArrayI();
+  gAlice->MakeBranchInTree(gAlice->TreeD() 
+                          ,"TRDdigits", fDigitsArray->IsA()->GetName()
+                          ,&fDigitsArray,buffersize,1,file);
+
+  for (Int_t iDict = 0; iDict < AliTRDdigitsManager::NDict(); iDict++) {
+    Char_t branchname[15];
+    sprintf(branchname,"TRDdictionary%d",iDict);
+    fDictionaryArray[iDict] = new AliTRDdataArrayI();
+    gAlice->MakeBranchInTree(gAlice->TreeD() 
+                            ,branchname,fDictionaryArray[iDict]->IsA()->GetName()
+                            ,&fDictionaryArray[iDict],buffersize,1,file) ;
+  }
+
   //Char_t *r = strstr(option,"R");
   //sprintf(branchname,"%srecPoints",GetName());
   //if (fRecPoints && gAlice->TreeR() && r) {
@@ -853,6 +931,29 @@ void AliTRD::MakeBranch(Option_t* option, char *file)
 
 }
 
+//_____________________________________________________________________________
+void AliTRD::ResetDigits()
+{
+  //
+  // Resets the digits
+  //
+
+  if (gAlice->TreeD()) {
+    TBranch *branch;
+    branch = gAlice->TreeD()->GetBranch("TRDdigits");
+    if (branch) {
+      branch->Reset();
+      for (Int_t iDict = 0; iDict < AliTRDdigitsManager::NDict(); iDict++) {
+        Char_t branchname[15];
+        sprintf(branchname,"TRDdictionary%d",iDict);
+        branch = gAlice->TreeD()->GetBranch(branchname);
+        branch->Reset();
+      }
+    }
+  }
+
+}
+
 //_____________________________________________________________________________
 void AliTRD::ResetRecPoints()
 {
@@ -904,7 +1005,7 @@ void AliTRD::SetGasMix(Int_t imix)
   if ((imix < 0) || (imix > 1)) {
     printf("Wrong input value: %d\n",imix);
     printf("Use standard setting\n");
-    fGasMix = 0;
+    fGasMix = 1;
     return;
   }
 
index 696a5be5b1571765e51591673d2215aec7374ade..99b74a0a83c16dc90b67735193446206dcb11903 100644 (file)
@@ -19,6 +19,7 @@ class AliDigit;
 class AliTRDhit;
 class AliTRDsim;
 class AliTRDgeometry;
+class AliTRDdataArrayI;
 
 //_____________________________________________________________________________
 class AliTRD : public AliDetector {
@@ -47,6 +48,7 @@ class AliTRD : public AliDetector {
   virtual void       Init();
   virtual Int_t      IsVersion() const = 0;
   virtual void       MakeBranch(Option_t* option, char *file=0);     
+  virtual void       ResetDigits();     
   virtual void       ResetRecPoints();
   virtual void       StepManager() = 0; 
   virtual void       SetTreeAddress();
@@ -70,6 +72,8 @@ class AliTRD : public AliDetector {
   virtual Int_t      GetSensSector() const      = 0;
   virtual Int_t      GetSensSectorRange() const = 0; 
 
+  virtual void       Hits2Digits();
+  virtual void       Hits2SDigits();
   virtual void       SDigits2Digits();
 
   virtual AliTRDsim *CreateTR()     = 0;
@@ -77,20 +81,23 @@ class AliTRD : public AliDetector {
 
  protected:
 
-  Int_t              fGasMix;            //  Gas mixture. 0: Xe/Isobutane 1: Xe/CO2
+  Int_t                fGasMix;             //  Gas mixture. 0: Xe/Isobutane 1: Xe/CO2
 
-  AliTRDgeometry    *fGeometry;          //  The TRD geometry
+  AliTRDgeometry      *fGeometry;           //  The TRD geometry
 
-  TObjArray         *fRecPoints;         //  Array of reconstructed points
-  Int_t              fNRecPoints;        //! Number of reconstructed points
+  TObjArray           *fRecPoints;          //  Array of reconstructed points
+  Int_t                fNRecPoints;         //! Number of reconstructed points
 
-  Float_t            fGasDensity;        //  The density of the drift gas
-  Float_t            fFoilDensity;       //  The density of the entrance window foil
+  Float_t              fGasDensity;         //  The density of the drift gas
+  Float_t              fFoilDensity;        //  The density of the entrance window foil
 
-  Int_t              fDrawTR;            //  Switches marking the TR photons in the display
-  Int_t              fDisplayType;       //  Display type (0: normal, 1: detailed) 
+  Int_t                fDrawTR;             //  Switches marking the TR photons in the display
+  Int_t                fDisplayType;        //  Display type (0: normal, 1: detailed) 
 
-  ClassDef(AliTRD,1)                     //  Transition Radiation Detector base class
+  AliTRDdataArrayI    *fDigitsArray;        //! Digits array
+  AliTRDdataArrayI    *fDictionaryArray[3]; //! Dictionary array 
+
+  ClassDef(AliTRD,2)                        //  Transition Radiation Detector base class
 
 };
 
index e5c2b8507edc04a1b81620e15eed96a3428951f7..a480f9abbeb5dd8b174f84973ef248a9f801bf1f 100644 (file)
@@ -120,7 +120,8 @@ void Config()
     // understandable to the CAD system EUCLID. The default (=0) means that you 
     // dont want to use this facility.
     //
-    AliITS *ITS  = new AliITSv5("ITS","normal ITS");
+    //AliITS *ITS  = new AliITSv5("ITS","normal ITS");
+    AliITS *ITS  = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
     ITS->SetEUCLID(0);
   }
 
@@ -141,20 +142,25 @@ void Config()
     //
     //-----------------------------------------------------------------------------
 
-    gROOT->LoadMacro("SetTPCParam.C");
-    AliTPCParam *param = SetTPCParam();
-    AliTPC *TPC  = new AliTPCv1("TPC","Default"); //v1 is default
-    TPC->SetParam(param); // pass the parameter object to the TPC
-
+    //gROOT->LoadMacro("SetTPCParam.C");
+    //AliTPCParam *param = SetTPCParam();
+    //AliTPC *TPC  = new AliTPCv2("TPC","Default"); //v1 is default
+    //TPC->SetParam(param); // pass the parameter object to the TPC
+    //
     // set gas mixture
-    TPC->SetGasMixt(2,20,10,-1,0.9,0.1,0.);
-    TPC->SetSecAL(4);
-    TPC->SetSecAU(4);
-    TPC->SetSecLows(1,  2,  3, 19, 20, 21);
-    TPC->SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1);
-    TPC->SetSens(1);
-
-    if (TPC->IsVersion()==1) param->Write(param->GetTitle());
+    //TPC->SetGasMixt(2,20,10,-1,0.9,0.1,0.);
+    //TPC->SetSecAL(4);
+    //TPC->SetSecAU(4);
+    //TPC->SetSecLows(1,  2,  3, 19, 20, 21);
+    //TPC->SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1);
+    //TPC->SetSens(1);
+    //
+    //if (TPC->IsVersion()==1) param->Write(param->GetTitle());
+
+    AliTPC *TPC  = new AliTPCv2("TPC","Default");
+    // All sectors included 
+    TPC->SetSecAL(-1);
+    TPC->SetSecAU(-1);
 
   }
 
index 45b6d3d7aeb45a86a79bc3aa00772db18f10c5c9..39cc66944d418021e2fbdb859739af71d4d3fb9f 100644 (file)
@@ -16,32 +16,25 @@ Int_t AliTRDcreateDigits()
   // Create the TRD digitzer 
   AliTRDdigitizer *Digitizer = new AliTRDdigitizer("digitizer","Digitizer class");
 
-  // Initialize the TRD and the geometry
-  if (!(Digitizer->InitDetector())) {
-    cout << "<AliTRDcreateDigits> No TRD geometry found" << endl;
-    rc = 2;
-    return rc;
-  }
-
   // Set the parameter
   Digitizer->SetDiffusion();
   Digitizer->SetVerbose(1);
 
   // Create the digits
   if (!(Digitizer->MakeDigits())) {
-    rc = 3;
+    rc = 2;
     return rc;
   }
 
   // Write the digits into the input file
   if (!(Digitizer->WriteDigits())) {
-    rc = 4;
+    rc = 3;
     return rc;
   }
 
   // Save the digitizer class in the AliROOT file
   if (!(Digitizer->Write())) {
-    rc = 5;
+    rc = 4;
     return rc;
   }
 
index c0c022359a98d7d5df4d23b80c1f32395512185d..3fd273cbed421cc3659ade47166b1eebf708cb18 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.20  2001/02/25 20:19:00  hristov
+Minor correction: loop variable declared only once for HP, Sun
+
 Revision 1.19  2001/02/14 18:22:26  cblume
 Change in the geometry of the padplane
 
@@ -146,45 +149,51 @@ AliTRDdigitizer::AliTRDdigitizer():TNamed()
   // AliTRDdigitizer default constructor
   //
 
-  fInputFile     = NULL;
-  fDigits        = NULL;
-  fTRD           = NULL;
-  fGeo           = NULL;
-  fPRF           = NULL;
-  fPRFsmp        = NULL;
-  fTRF           = NULL;
-  fTRFint        = NULL;
-
-  fEvent         = 0;
-  fGasGain       = 0.0;
-  fNoise         = 0.0;
-  fChipGain      = 0.0;
-  fADCoutRange   = 0.0;
-  fADCinRange    = 0.0;
-  fADCthreshold  = 0;
-  fDiffusionOn   = 0;
-  fDiffusionT    = 0.0;
-  fDiffusionL    = 0.0;
-  fElAttachOn    = 0;
-  fElAttachProp  = 0.0;
-  fExBOn         = 0;
-  fOmegaTau      = 0.0;
-  fPRFOn         = 0;
-  fTRFOn         = 0;
-  fDriftVelocity = 0.0;
-
-  fPRFbin        = 0;
-  fPRFlo         = 0.0;
-  fPRFhi         = 0.0;
-  fPRFwid        = 0.0;
-  fPRFpad        = 0;
-  fTRFbin        = 0;
-  fTRFlo         = 0.0;
-  fTRFhi         = 0.0;
-  fTRFwid        = 0.0;
-
-  fCompress      = kTRUE;
-  fVerbose       = 1;
+  fInputFile      = NULL;
+  fDigits         = NULL;
+  fTRD            = NULL;
+  fGeo            = NULL;
+  fPRF            = NULL;
+  fPRFsmp         = NULL;
+  fTRF            = NULL;
+  fTRFint         = NULL;
+
+  fEvent          = 0;
+  fGasGain        = 0.0;
+  fNoise          = 0.0;
+  fChipGain       = 0.0;
+  fSinRange       = 0.0;
+  fSoutRange      = 0.0;
+  fADCoutRange    = 0.0;
+  fADCinRange     = 0.0;
+  fADCthreshold   = 0;
+  fDiffusionOn    = 0;
+  fDiffusionT     = 0.0;
+  fDiffusionL     = 0.0;
+  fElAttachOn     = 0;
+  fElAttachProp   = 0.0;
+  fExBOn          = 0;
+  fOmegaTau       = 0.0;
+  fPRFOn          = 0;
+  fTRFOn          = 0;
+  fDriftVelocity  = 0.0;
+  fPadCoupling    = 0.0;
+  fTimeCoupling   = 0.0;
+  fTimeBinWidth   = 0.0;
+
+  fPRFbin         = 0;
+  fPRFlo          = 0.0;
+  fPRFhi          = 0.0;
+  fPRFwid         = 0.0;
+  fPRFpad         = 0;
+  fTRFbin         = 0;
+  fTRFlo          = 0.0;
+  fTRFhi          = 0.0;
+  fTRFwid         = 0.0;
+
+  fCompress       = kTRUE;
+  fVerbose        = 1;
+  fSDigits        = kFALSE;
 
 }
 
@@ -209,6 +218,7 @@ AliTRDdigitizer::AliTRDdigitizer(const Text_t *name, const Text_t *title)
 
   fCompress      = kTRUE;
   fVerbose       = 1;
+  fSDigits       = kFALSE;
 
   Init();
 
@@ -267,56 +277,63 @@ void AliTRDdigitizer::Copy(TObject &d)
 
   Int_t iBin;
 
-  ((AliTRDdigitizer &) d).fInputFile     = NULL;
-  ((AliTRDdigitizer &) d).fDigits        = NULL;
-  ((AliTRDdigitizer &) d).fTRD           = NULL;
-  ((AliTRDdigitizer &) d).fGeo           = NULL;
-
-  ((AliTRDdigitizer &) d).fEvent         = 0;
-
-  ((AliTRDdigitizer &) d).fGasGain       = fGasGain;
-  ((AliTRDdigitizer &) d).fNoise         = fNoise;
-  ((AliTRDdigitizer &) d).fChipGain      = fChipGain;
-  ((AliTRDdigitizer &) d).fADCoutRange   = fADCoutRange;
-  ((AliTRDdigitizer &) d).fADCinRange    = fADCinRange;
-  ((AliTRDdigitizer &) d).fADCthreshold  = fADCthreshold;
-  ((AliTRDdigitizer &) d).fDiffusionOn   = fDiffusionOn; 
-  ((AliTRDdigitizer &) d).fDiffusionT    = fDiffusionT;
-  ((AliTRDdigitizer &) d).fDiffusionL    = fDiffusionL;
-  ((AliTRDdigitizer &) d).fElAttachOn    = fElAttachOn;
-  ((AliTRDdigitizer &) d).fElAttachProp  = fElAttachProp;
-  ((AliTRDdigitizer &) d).fExBOn         = fExBOn;
-  ((AliTRDdigitizer &) d).fOmegaTau      = fOmegaTau;
-  ((AliTRDdigitizer &) d).fLorentzFactor = fLorentzFactor;
-  ((AliTRDdigitizer &) d).fPRFOn         = fPRFOn;
-  ((AliTRDdigitizer &) d).fTRFOn         = fTRFOn;
-
-  ((AliTRDdigitizer &) d).fCompress      = fCompress;
-  ((AliTRDdigitizer &) d).fVerbose       = fVerbose;
+  ((AliTRDdigitizer &) d).fInputFile      = NULL;
+  ((AliTRDdigitizer &) d).fDigits         = NULL;
+  ((AliTRDdigitizer &) d).fTRD            = NULL;
+  ((AliTRDdigitizer &) d).fGeo            = NULL;
+
+  ((AliTRDdigitizer &) d).fEvent          = 0;
+
+  ((AliTRDdigitizer &) d).fGasGain        = fGasGain;
+  ((AliTRDdigitizer &) d).fNoise          = fNoise;
+  ((AliTRDdigitizer &) d).fChipGain       = fChipGain;
+  ((AliTRDdigitizer &) d).fSoutRange      = fSoutRange;
+  ((AliTRDdigitizer &) d).fSinRange       = fSinRange;
+  ((AliTRDdigitizer &) d).fADCoutRange    = fADCoutRange;
+  ((AliTRDdigitizer &) d).fADCinRange     = fADCinRange;
+  ((AliTRDdigitizer &) d).fADCthreshold   = fADCthreshold;
+  ((AliTRDdigitizer &) d).fDiffusionOn    = fDiffusionOn; 
+  ((AliTRDdigitizer &) d).fDiffusionT     = fDiffusionT;
+  ((AliTRDdigitizer &) d).fDiffusionL     = fDiffusionL;
+  ((AliTRDdigitizer &) d).fElAttachOn     = fElAttachOn;
+  ((AliTRDdigitizer &) d).fElAttachProp   = fElAttachProp;
+  ((AliTRDdigitizer &) d).fExBOn          = fExBOn;
+  ((AliTRDdigitizer &) d).fOmegaTau       = fOmegaTau;
+  ((AliTRDdigitizer &) d).fLorentzFactor  = fLorentzFactor;
+  ((AliTRDdigitizer &) d).fDriftVelocity  = fDriftVelocity;
+  ((AliTRDdigitizer &) d).fPadCoupling    = fPadCoupling;
+  ((AliTRDdigitizer &) d).fTimeCoupling   = fTimeCoupling;
+  ((AliTRDdigitizer &) d).fTimeBinWidth   = fTimeBinWidth;
+  ((AliTRDdigitizer &) d).fPRFOn          = fPRFOn;
+  ((AliTRDdigitizer &) d).fTRFOn          = fTRFOn;
+
+  ((AliTRDdigitizer &) d).fCompress       = fCompress;
+  ((AliTRDdigitizer &) d).fVerbose        = fVerbose;
+  ((AliTRDdigitizer &) d).fSDigits        = fSDigits;
 
   fPRF->Copy(*((AliTRDdigitizer &) d).fPRF);
   fTRF->Copy(*((AliTRDdigitizer &) d).fTRF);
 
-  ((AliTRDdigitizer &) d).fPRFbin        = fPRFbin;
-  ((AliTRDdigitizer &) d).fPRFlo         = fPRFlo;
-  ((AliTRDdigitizer &) d).fPRFhi         = fPRFhi;
-  ((AliTRDdigitizer &) d).fPRFwid        = fPRFwid;
-  ((AliTRDdigitizer &) d).fPRFpad        = fPRFpad;
+  ((AliTRDdigitizer &) d).fPRFbin         = fPRFbin;
+  ((AliTRDdigitizer &) d).fPRFlo          = fPRFlo;
+  ((AliTRDdigitizer &) d).fPRFhi          = fPRFhi;
+  ((AliTRDdigitizer &) d).fPRFwid         = fPRFwid;
+  ((AliTRDdigitizer &) d).fPRFpad         = fPRFpad;
   if (((AliTRDdigitizer &) d).fPRFsmp) delete ((AliTRDdigitizer &) d).fPRFsmp;
   ((AliTRDdigitizer &) d).fPRFsmp = new Float_t[fPRFbin];
   for (iBin = 0; iBin < fPRFbin; iBin++) {
     ((AliTRDdigitizer &) d).fPRFsmp[iBin] = fPRFsmp[iBin];
   }                                                                             
-  ((AliTRDdigitizer &) d).fTRFbin        = fTRFbin;
-  ((AliTRDdigitizer &) d).fTRFlo         = fTRFlo;
-  ((AliTRDdigitizer &) d).fTRFhi         = fTRFhi;
-  ((AliTRDdigitizer &) d).fTRFwid        = fTRFwid;
+  ((AliTRDdigitizer &) d).fTRFbin         = fTRFbin;
+  ((AliTRDdigitizer &) d).fTRFlo          = fTRFlo;
+  ((AliTRDdigitizer &) d).fTRFhi          = fTRFhi;
+  ((AliTRDdigitizer &) d).fTRFwid         = fTRFwid;
   if (((AliTRDdigitizer &) d).fTRFint) delete ((AliTRDdigitizer &) d).fTRFint;
   ((AliTRDdigitizer &) d).fTRFint = new Float_t[fTRFbin];
   for (iBin = 0; iBin < fTRFbin; iBin++) {
     ((AliTRDdigitizer &) d).fTRFint[iBin] = fTRFint[iBin];
-  }                                                                             
-
+  }                                      
+                                       
 }
 
 //_____________________________________________________________________________
@@ -406,74 +423,110 @@ void AliTRDdigitizer::Init()
   // Initializes the digitization procedure with standard values
   //
 
+  // Get the detector geometry
+  InitDetector();
+
   // The default parameter for the digitization
-  fGasGain       = 8.0E3;
-  fNoise         = 3000.;
-  fChipGain      = 10.;
-  fADCoutRange   = 255.;
-  fADCinRange    = 2000.;
-  fADCthreshold  = 1;
+  fGasGain        = 2.0E3;
+  fChipGain       = 20.;
+  fNoise          = 1000.;
+  fADCoutRange    = 1023.;          // 10-bit ADC
+  fADCinRange     = 2000.;          // 2V input range
+  fADCthreshold   = 1;
+
+  // For the summable digits
+  fSinRange       = 1000000.;
+  fSoutRange      = 1000000.;
 
   // Transverse and longitudinal diffusion coefficients (Xe/Isobutane)
-  fDiffusionOn   = 1;
-  fDiffusionT    = 0.060;
-  fDiffusionL    = 0.017;
+  fDiffusionOn    = 1;
+  fDiffusionT     = 0.060;
+  fDiffusionL     = 0.017;
 
   // Propability for electron attachment
-  fElAttachOn    = 0;
-  fElAttachProp  = 0.0;
+  fElAttachOn     = 0;
+  fElAttachProp   = 0.0;
 
   // E x B effects
-  fExBOn         = 0;
-  // omega * tau. (tau ~ 12 * 10^-12, B = 0.2T)
-  fOmegaTau      = 17.6 * 12.0 * 0.2 * 0.01;
+  fExBOn          = 0;
+  // omega * tau.= arctan(Lorentz-angle)
+  fOmegaTau       = 0.19438031;
 
   // The pad response function
-  fPRFOn         =  1;
-  fPRFlo         = -3.0;
-  fPRFhi         =  3.0;
-  fPRFbin        = 1200;
-  fPRFwid        = (fPRFhi - fPRFlo) / ((Float_t) fPRFbin);
-  fPRFpad        = ((Int_t) (1.0 / fPRFwid));
-  fPRF           = new TF1("PRF","[0]*([1]+exp(-x*x/(2.0*[2])))",fPRFlo,fPRFhi);
+  fPRFOn          =  1;
+  fPRFlo          = -3.0;
+  fPRFhi          =  3.0;
+  fPRFbin         = 120;
+  fPRFwid         = (fPRFhi - fPRFlo) / ((Float_t) fPRFbin);
+  fPRFpad         = ((Int_t) (1.0 / fPRFwid));
+  fPRF            = new TF1("PRF","[0]*([1]+exp(-x*x/(2.0*[2])))",fPRFlo,fPRFhi);
   fPRF->SetParameter(0, 0.8872);
   fPRF->SetParameter(1,-0.00573);
   fPRF->SetParameter(2, 0.454 * 0.454);
 
   // The drift velocity (cm / mus)
-  fDriftVelocity = 1.0;
-
-  // The time response function
-  fTRFOn         = 1;
-  Float_t loTRF  = -200.0;
-  Float_t hiTRF  = 1000.0;
-  fTRF           = new TF1("TRF",TRFlandau,loTRF,hiTRF,3);
-  fTRF->SetParameter(0,  1.0 / 24.24249);
+  fDriftVelocity  = 2.0;
+
+  // The pad coupling factor (same number as for the TPC)
+  fPadCoupling    = 0.5;
+
+  // The time coupling factor (same number as for the TPC)
+  fTimeCoupling   = 0.4;
+
+  ReInit();
+
+}
+
+//_____________________________________________________________________________
+void AliTRDdigitizer::ReInit()
+{
+  //
+  // Re-initializes the digitization procedure after a change in the parameter
+  //
+
+  // Calculate the time bin width in ns
+  fTimeBinWidth   = fGeo->GetTimeBinSize() / fDriftVelocity * 1000.0;
+
+  // The time response function (in ns)
+  // The FWHM of the TRF is automatically set equal to the time bin width
+  fTRFOn          =  1;
+  Float_t loTRF   = -2.0 * fTimeBinWidth;
+  Float_t hiTRF   = 10.0 * fTimeBinWidth;
+  fTRF            = new TF1("TRF",TRFlandau,loTRF,hiTRF,3);
+  //fTRF->SetParameter(0,  1.0 / 24.24249);
+  fTRF->SetParameter(0,  5.56);
   fTRF->SetParameter(1,  0.0);
-  fTRF->SetParameter(2, 25.0);
-  fTRFbin        = 1200;
-  fTRFlo         = loTRF * fDriftVelocity / 1000.0;
-  fTRFhi         = hiTRF * fDriftVelocity / 1000.0;
-  fTRFwid        = (fTRFhi - fTRFlo) / ((Float_t) fTRFbin);
+  fTRF->SetParameter(2,  0.25 * fTimeBinWidth);
+  fTRFbin         = 120;
+  fTRFlo          = loTRF * fDriftVelocity / 1000.0;
+  fTRFhi          = hiTRF * fDriftVelocity / 1000.0;
+  fTRFwid         = (fTRFhi - fTRFlo) / ((Float_t) fTRFbin);
+
+  // The Lorentz factor
+  if (fExBOn) {
+    fLorentzFactor = 1.0 / (1.0 + fOmegaTau*fOmegaTau);
+  }
+  else {
+    fLorentzFactor = 1.0;
+  }
 
 }
 
 //_____________________________________________________________________________
-void AliTRDdigitizer::IntegrateTRF()
+void AliTRDdigitizer::SampleTRF()
 {
   //
-  // Integrates the time response function over the time bin size
+  // Samples the time response function
   //
 
   if (fTRFint) delete fTRFint;
   fTRFint = new Float_t[fTRFbin];
-  Float_t hiTRF   = fTRFhi                 / fDriftVelocity * 1000.0;
-  Float_t loTRF   = fTRFlo                 / fDriftVelocity * 1000.0;
-  Float_t timeBin = fGeo->GetTimeBinSize() / fDriftVelocity * 1000.0;
+  Float_t loTRF    = fTRFlo / fDriftVelocity * 1000.0;
+  Float_t hiTRF    = fTRFhi / fDriftVelocity * 1000.0;
   Float_t binWidth = (hiTRF - loTRF) / ((Float_t) fTRFbin);
   for (Int_t iBin = 0; iBin < fTRFbin; iBin++) {
-    Float_t bin = iBin * binWidth + loTRF - 0.5 * timeBin;
-    fTRFint[iBin] = fTRF->Integral(bin,bin + timeBin);
+    Float_t bin = (((Float_t) iBin) + 0.5) * binWidth + loTRF;
+    fTRFint[iBin] = fTRF->Eval(bin);
   }
 
 }
@@ -548,25 +601,37 @@ Bool_t AliTRDdigitizer::InitDetector()
   // Get the pointer to the detector class and check for version 1
   fTRD = (AliTRD*) gAlice->GetDetector("TRD");
   if (fTRD->IsVersion() != 1) {
-    printf("AliTRDdigitizer::Open -- ");
+    printf("AliTRDdigitizer::InitDetector -- ");
     printf("TRD must be version 1 (slow simulator).\n");
     exit(1);
   }
 
   // Get the geometry
   fGeo = fTRD->GetGeometry();
-  printf("AliTRDdigitizer::Open -- ");
+  printf("AliTRDdigitizer::InitDetector -- ");
   printf("Geometry version %d\n",fGeo->IsVersion());
 
   return kTRUE;
 
 }
 
+//_____________________________________________________________________________
+Bool_t AliTRDdigitizer::SumSDigits()
+{
+  //
+  // Sums up the summable digits and creates final digits
+  // Not yet implemented
+  //
+
+  return kFALSE;
+
+}
+
 //_____________________________________________________________________________
 Bool_t AliTRDdigitizer::MakeDigits()
 {
   //
-  // Loops through the TRD-hits and creates the digits.
+  // Creates summable digits.
   //
 
   ///////////////////////////////////////////////////////////////
@@ -614,19 +679,11 @@ Bool_t AliTRDdigitizer::MakeDigits()
   printf("Start creating digits.\n");
   if (fVerbose > 0) this->Dump();
 
-  // The Lorentz factor
-  if (fExBOn) {
-    fLorentzFactor = 1.0 / (1.0 + fOmegaTau*fOmegaTau);
-  }
-  else {
-    fLorentzFactor = 1.0;
-  }
-
   // Create the sampled PRF
   SamplePRF();
 
-  // Create the integrated TRF
-  IntegrateTRF();
+  // Create the sampled TRF
+  SampleTRF();
 
   // Get the pointer to the hit tree
   TTree *HitTree = gAlice->TreeH();
@@ -806,13 +863,12 @@ Bool_t AliTRDdigitizer::MakeDigits()
         // The electron position 
         // The pad row (z-direction)
         Int_t  rowE = (Int_t) ((xyz[2] -  row0) /  rowPadSize);
+        if (( rowE < 0) || ( rowE >=  nRowMax)) continue;
         // The pad column (rphi-direction)
         Int_t  colE = (Int_t) ((xyz[1] -  col0) /  colPadSize);
+        if (( colE < 0) || ( colE >=  nColMax)) continue;
         // The time bucket
         Int_t timeE = (Int_t) ((time0 - xyz[0]) / timeBinSize);
-
-        if (( rowE < 0) || ( rowE >=  nRowMax)) continue;
-        if (( colE < 0) || ( colE >=  nColMax)) continue;
         if ((timeE < 0) || (timeE >= nTimeMax)) continue;
 
         // Apply the gas gain including fluctuations
@@ -822,12 +878,6 @@ Bool_t AliTRDdigitizer::MakeDigits()
        } while (ggRndm <= 0);
         Int_t signal = (Int_t) (-fGasGain * TMath::Log(ggRndm));
 
-        if (fVerbose > 2) {
-          printf("  electron no. %d, signal = %d\n",iEl,signal);
-          printf("  rowE = %d, colE = %d, timeE = %d\n"
-               ,rowE,colE,timeE);
-       }
-
         // Apply the pad response 
         Float_t padSignal[kNpad];
         if (fPRFOn) {
@@ -852,8 +902,8 @@ Bool_t AliTRDdigitizer::MakeDigits()
           timeTRDend = 11;
        }
         for (Int_t iTimeBin = TMath::Max(timeE - timeTRDbeg,       0)
-                iTimeBin < TMath::Min(timeE + timeTRDend,nTimeMax) 
-                iTimeBin++) {
+                 ;iTimeBin < TMath::Min(timeE + timeTRDend,nTimeMax) 
+                 ;iTimeBin++) {
 
          // Apply the time response
           Float_t timeResponse = 1.0;
@@ -872,12 +922,6 @@ Bool_t AliTRDdigitizer::MakeDigits()
             signalOld[iPad] += padSignal[iPad] * timeResponse;
             signals->SetData(rowE,colPos,iTimeBin,signalOld[iPad]);
          }
-          if (fVerbose > 3) {
-            printf("    iTimeBin = %d, timeResponse = %f\n"
-                  ,iTimeBin,timeResponse);
-            printf("    pad-signal = %f, %f, %f\n"
-                  ,signalOld[0],signalOld[1],signalOld[2]);
-         }
 
           // Store the track index in the dictionary
           // Note: We store index+1 in order to allow the array to be compressed
@@ -904,18 +948,15 @@ Bool_t AliTRDdigitizer::MakeDigits()
                 //if (oldTrack ==      -1) break;
                 if (oldTrack ==       0) {
                   dictionary[iDict]->SetData(rowE,colPos,iTimeBin,track+1);
-                  if (fVerbose > 3) {
-                    printf("    track index = %d\n",track); 
-                  }
                   break;
                 }
               }
             }
           }
-          if ((fVerbose > 1) && (iDict == kNDict)) {
-            printf("AliTRDdigitizer::MakeDigits -- ");
-            printf("More than three tracks for one digit!\n");
-          }
+          //if ((fVerbose > 1) && (iDict == kNDict)) {
+          //  printf("AliTRDdigitizer::MakeDigits -- ");
+          //  printf("More than three tracks for one digit!\n");
+          //}
 
        }
 
@@ -928,6 +969,9 @@ Bool_t AliTRDdigitizer::MakeDigits()
   printf("AliTRDdigitizer::MakeDigits -- ");
   printf("Finished analyzing %d hits\n",countHits);
 
+  // The total conversion factor
+  Float_t convert = kEl2fC * fPadCoupling * fTimeCoupling * fChipGain;
+
   // Loop through all chambers to finalize the digits
   for (Int_t iDet = 0; iDet < AliTRDgeometry::Ndet(); iDet++) {
 
@@ -938,7 +982,6 @@ Bool_t AliTRDdigitizer::MakeDigits()
     Int_t nColMax  = fGeo->GetColMax(plane);
     Int_t nTimeMax = fGeo->GetTimeMax();
 
-    //if (!(CheckDetector(plane,chamber,sector))) continue;
     if (fVerbose > 0) {
       printf("AliTRDdigitizer::MakeDigits -- ");
       printf("Digitization for chamber %d\n",iDet);
@@ -969,42 +1012,65 @@ Bool_t AliTRDdigitizer::MakeDigits()
 
     Int_t nDigits = 0;
 
-    // Create the digits for this chamber
-    for (iRow  = 0; iRow  <  nRowMax; iRow++ ) {
-      for (iCol  = 0; iCol  <  nColMax; iCol++ ) {
-        for (iTime = 0; iTime < nTimeMax; iTime++) {         
-
-          Float_t signalAmp = signals->GetData(iRow,iCol,iTime);
-
-          // Add the noise
-          signalAmp  = TMath::Max((Double_t) gRandom->Gaus(signalAmp,fNoise),0.0);
-         // Convert to fC
-          signalAmp *= kEl2fC;
-          // Convert to mV
-          signalAmp *= fChipGain;
-         // Convert to ADC counts. Set the overflow-bit fADCoutRange if the 
-         // signal is larger than fADCinRange
-          Int_t adc  = 0;
-          if (signalAmp >= fADCinRange) {
-            adc = ((Int_t) fADCoutRange);
-         }
-          else {
-            adc = ((Int_t) (signalAmp * (fADCoutRange / fADCinRange)));
-         }
+    // Don't create noise in detectors that are switched off
+    if (CheckDetector(plane,chamber,sector)) {
+
+      // Create the digits for this chamber
+      for (iRow  = 0; iRow  <  nRowMax; iRow++ ) {
+        for (iCol  = 0; iCol  <  nColMax; iCol++ ) {
+          for (iTime = 0; iTime < nTimeMax; iTime++) {         
+
+           // Create summable digits
+            if (fSDigits) {
+
+              Float_t signalAmp = signals->GetData(iRow,iCol,iTime);
+              Int_t adc  = 0;
+              if (signalAmp >= fSinRange) {
+                adc = ((Int_t) fSoutRange);
+             }
+              else {
+                adc = ((Int_t) (signalAmp * (fSoutRange / fSinRange)));
+             }
+              nDigits++;
+              digits->SetData(iRow,iCol,iTime,adc);
 
-          // Store the amplitude of the digit if above threshold
-          if (adc > fADCthreshold) {
-            if (fVerbose > 2) {
-              printf("  iRow = %d, iCol = %d, iTime = %d\n"
-                    ,iRow,iCol,iTime);
-              printf("  signal = %f, adc = %d\n",signalAmp,adc);
            }
-            nDigits++;
-            digits->SetData(iRow,iCol,iTime,adc);
-         }
+           // Create normal digits
+            else {
+
+              Float_t signalAmp = signals->GetData(iRow,iCol,iTime);
+
+              // Add the noise
+              signalAmp  = TMath::Max((Double_t) gRandom->Gaus(signalAmp,fNoise),0.0);
+              // Convert to mV
+              signalAmp *= convert;
+             // Convert to ADC counts. Set the overflow-bit fADCoutRange if the 
+             // signal is larger than fADCinRange
+              Int_t adc  = 0;
+              if (signalAmp >= fADCinRange) {
+                adc = ((Int_t) fADCoutRange);
+             }
+              else {
+                adc = ((Int_t) (signalAmp * (fADCoutRange / fADCinRange)));
+             }
+
+              // Store the amplitude of the digit if above threshold
+              if (adc > fADCthreshold) {
+                if (fVerbose > 2) {
+                  printf("  iRow = %d, iCol = %d, iTime = %d\n"
+                        ,iRow,iCol,iTime);
+                  printf("  signal = %f, adc = %d\n",signalAmp,adc);
+               }
+                nDigits++;
+                digits->SetData(iRow,iCol,iTime,adc);
+             }
 
-       }
+           }
+
+         }
+        }
       }
+
     }
 
     // Compress the arrays
@@ -1078,7 +1144,12 @@ Bool_t AliTRDdigitizer::WriteDigits()
 
   // Create the branches
   if (!(gAlice->TreeD()->GetBranch("TRDdigits"))) { 
-    if (!fDigits->MakeBranch()) return kFALSE;
+    return kFALSE;
+    //if (!fDigits->MakeBranch()) {
+    //  printf("AliTRDdigitizer::WriteDigits -- ");
+    //  printf("MakeBranch failed.\n");
+    //  return kFALSE;
+    //}
   }
 
   // Store the digits and the dictionary in the tree
index aef4863f554706a28b1d8343e7c31dd888c6d2b4..a8f9534ab5dccfcc80e955cc612d896673e78863 100644 (file)
@@ -35,29 +35,37 @@ class AliTRDdigitizer : public TNamed {
   virtual void         Init();
   virtual Bool_t       Open(const Char_t *name, Int_t nEvent = 0);
   virtual Bool_t       MakeDigits();
+  virtual void         ReInit();
+  virtual Bool_t       SumSDigits();
   virtual Bool_t       WriteDigits();
   virtual Bool_t       InitDetector();
 
-  virtual void         SetGasGain(Float_t gasgain)      { fGasGain       = gasgain;  };
-  virtual void         SetNoise(Float_t noise)          { fNoise         = noise;    };
-  virtual void         SetChipGain(Float_t chipgain)    { fChipGain      = chipgain; };
-  virtual void         SetADCoutRange(Float_t range)    { fADCoutRange   = range;    };
-  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;       };
-  virtual void         SetPadResponse(Int_t prfOn = 1)  { fPRFOn         = prfOn;    };
+  virtual void         SetGasGain(Float_t gasgain)      { fGasGain        = gasgain;  };
+  virtual void         SetNoise(Float_t noise)          { fNoise          = noise;    };
+  virtual void         SetChipGain(Float_t chipgain)    { fChipGain       = chipgain; };
+  virtual void         SetADCoutRange(Float_t range)    { fADCoutRange    = range;    };
+  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;    };
+  virtual void         SetTimeResponse(Int_t trfOn = 1) { fTRFOn          = trfOn;   
+                                                          ReInit();                   };
   virtual void         SetTRF(TF1 *trf);
-  virtual void         SetDriftVelocity(Float_t v)      { fDriftVelocity = v;        };
-  virtual void         SetCompress(Int_t c = 1)         { fCompress      = c;        };
-  virtual void         SetVerbose(Int_t v = 1)          { fVerbose       = v;        };
+  virtual void         SetDriftVelocity(Float_t v)      { fDriftVelocity  = v;       
+                                                          ReInit();                   };
+  virtual void         SetPadCoupling(Float_t v)        { fPadCoupling    = v;        };
+  virtual void         SetTimeCoupling(Float_t v)       { fTimeCoupling   = v;        };
+  virtual void         SetCompress(Int_t c = 1)         { fCompress       = c;        };
+  virtual void         SetVerbose(Int_t v = 1)          { fVerbose        = v;        };
+  virtual void         SetSDigits(Int_t v = 1)          { fSDigits        = v;        };
 
   AliTRDdigitsManager *Digits() const                   { return fDigits;            };
 
@@ -74,7 +82,11 @@ class AliTRDdigitizer : public TNamed {
   virtual TF1         *GetPadResponse() const           { return fPRF;               };
   virtual TF1         *GetTimeResponse() const          { return fTRF;               };
   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;      };
 
  protected:
 
@@ -90,6 +102,8 @@ class AliTRDdigitizer : public TNamed {
   Float_t              fChipGain;        // Electronics gain
   Float_t              fADCoutRange;     // ADC output range (number of channels)
   Float_t              fADCinRange;      // ADC input range (input charge)
+  Float_t              fSinRange;        // Input range for summable digits 
+  Float_t              fSoutRange;       // Output range for summable digits 
   Int_t                fADCthreshold;    // ADC threshold in ADC channel
   Int_t                fDiffusionOn;     // Switch for the diffusion
   Float_t              fDiffusionT;      // Diffusion in transverse direction
@@ -115,8 +129,12 @@ class AliTRDdigitizer : public TNamed {
   Float_t              fTRFhi;           // Higher boundary of the TRF
   Float_t              fTRFwid;          // Bin width of the integrated TRF
   Float_t              fDriftVelocity;   // Drift velocity (cm / mus)
+  Float_t              fTimeBinWidth;    // Time bin width in ns
+  Float_t              fPadCoupling;     // Pad coupling factor
+  Float_t              fTimeCoupling;    // Time coupling factor (image charge of moving ions)
   Bool_t               fCompress;        // Switch to keep only compressed data in memory
   Int_t                fVerbose;         // Sets the verbose level
+  Bool_t               fSDigits;         // Switch for the summable digits
 
  private:
 
@@ -126,9 +144,9 @@ class AliTRDdigitizer : public TNamed {
   virtual Float_t      TimeResponse(Float_t time);  
   virtual Bool_t       CheckDetector(Int_t plane, Int_t chamber, Int_t sector);
   virtual void         SamplePRF();
-  virtual void         IntegrateTRF();
+  virtual void         SampleTRF();
 
-  ClassDef(AliTRDdigitizer,2)            // Produces TRD-Digits
+  ClassDef(AliTRDdigitizer,3)            // Produces TRD-Digits
 
 };
 
index f5c28debaa2444352f24275ac679c610d53bdf6d..6080f5f48c5037b98884b64d7e359b48c43d1445 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.10  2001/01/26 19:56:57  hristov
+Major upgrade of AliRoot code
+
 Revision 1.9  2000/11/02 09:25:53  cblume
 Change also the dictionary to AliTRDdataArray
 
@@ -59,6 +62,7 @@ Add new class AliTRDdigitsManager
 //  AliTRDdataArray objects.                                                 //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
+
 #include <iostream.h>
  
 #include <TROOT.h>
@@ -198,10 +202,10 @@ Bool_t AliTRDdigitsManager::MakeBranch(char *file)
                                      &kDictionary,buffersize, 1,file) ;
           printf("AliTRDdigitsManager::MakeBranch -- ");
           printf("Making branch %s\n",branchname);
-           }
+       }
         else {
           status = kFALSE;
-           }
+       }
       }
       else {
         status = kFALSE;
@@ -254,6 +258,8 @@ Bool_t AliTRDdigitsManager::WriteDigits()
 
   // Create the branches
   if (!(gAlice->TreeD()->GetBranch("TRDdigits"))) { 
+    printf("AliTRDdigitsManager::WriteDigits -- ");
+    printf("Call MakeBranch\n");
     if (!MakeBranch()) return kFALSE;
   }
 
index ef9cb529485a3eafc9c1c3c8dbe90a7142f7be39..8d82f26a7232a2e559ff327a9ad33f806a5cb2df 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+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
 
@@ -212,8 +215,8 @@ void AliTRDgeometry::Init()
   // The pad column (rphi-direction)  
   SetNColPad(96);
 
-  // The time bucket
-  SetNTimeBin(30);
+  // The time bucket. Default is 100 ns timbin size
+  SetNTimeBin(15);
 
   // The rotation matrix elements
   Float_t phi = 0;
index d2fb55ff670257221d1948bdb36226f8c5b413e6..ab01aee63d6950fdaa7e279a20e19d890ec8d595 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.6  2000/11/01 14:53:21  cblume
+Merge with TRD-develop
+
 Revision 1.1.4.3  2000/10/06 16:49:46  cblume
 Made Getters const
 
@@ -54,6 +57,7 @@ Add new TRD classes
 #include "AliTRD.h"
 #include "AliTRDgeometry.h"
 #include "AliTRDsegmentArray.h"
+#include "AliTRDdataArray.h"
 
 ClassImp(AliTRDsegmentArray)
 
index 1d2b969c150f6c9c2efe724ea7ae5cdfae74830d..0167e79a02c211f36d3049f0ebaaea2d110834ac 100644 (file)
@@ -10,8 +10,13 @@ Int_t AliTRDtest()
   gAlice->Init("$(ALICE_ROOT)/TRD/AliTRDconfig.C");
 
   // Run one event and create the hits
+  gAlice->SetDebug(2);
   gAlice->Run(1);
 
+  if (gAlice) delete gAlice;
+  TFile *file = (TFile *) gROOT->GetListOfFiles()->FindObject("TRD_test.root");
+  gAlice = (AliRun *) file->Get("gAlice");
+
   // Analyze the TRD hits
   gROOT->LoadMacro("$(ALICE_ROOT)/TRD/AliTRDanalyzeHits.C");
   if (rc = AliTRDanalyzeHits()) return rc;
@@ -20,6 +25,10 @@ Int_t AliTRDtest()
   gROOT->LoadMacro("$(ALICE_ROOT)/TRD/AliTRDcreateDigits.C");
   if (rc = AliTRDcreateDigits()) return rc;
 
+  if (gAlice) delete gAlice;
+  TFile *file = (TFile *) gROOT->GetListOfFiles()->FindObject("TRD_test.root");
+  gAlice = (AliRun *) file->Get("gAlice");
+
   // Analyze the digits
   gROOT->LoadMacro("$(ALICE_ROOT)/TRD/AliTRDanalyzeDigits.C");
   if (rc = AliTRDanalyzeDigits()) return rc;