Various style issues dealt with, like inclussion of header files, etc.
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Nov 2004 14:48:27 +0000 (14:48 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Nov 2004 14:48:27 +0000 (14:48 +0000)
Honeycomb material changed to Aluminum - which is what want.
New split of reconstruction classes.   We have one `manager' class:
`AliFMDReconstructor' that contains a list of algorithms derived
from AliFMDMultAlgorithm.  Currently implemented are `AliFMDMultNaiive'
and `AliFMDMultPoisson'.
New data structure `AliFMDMult' encodes common multiplicity information.
`AliFMDMultRegion' hold multiplicity information gather from sevaral strips,
like when using the Poisson method.  This class should be extended to
give information on the average eta, phi value.
`AliFMDMultStrip' hold information on multiplicity from a single strip,
as is the case when using the naiive approach to reconstruction.
Some old and obsolete files are removed.
AliFMDMap is moved into libFMDbase as per request of Thomas Kuhr.
New subdirectory `scripts' will hold various scripts for testing, and so
on.

47 files changed:
FMD/AliFMD.cxx
FMD/AliFMD.h
FMD/AliFMD1.h
FMD/AliFMD2.cxx
FMD/AliFMD2.h
FMD/AliFMD3.h
FMD/AliFMDBoolMap.cxx [new file with mode: 0644]
FMD/AliFMDBoolMap.h [new file with mode: 0644]
FMD/AliFMDDigit.cxx
FMD/AliFMDDigit.h
FMD/AliFMDDigitizer.cxx
FMD/AliFMDHit.h
FMD/AliFMDMult.cxx [moved from FMD/AliFMDPoissonAlgorithm.cxx with 53% similarity]
FMD/AliFMDMult.h [new file with mode: 0644]
FMD/AliFMDMultAlgorithm.cxx [moved from FMD/AliFMDReconstructionAlgorithm.cxx with 69% similarity]
FMD/AliFMDMultAlgorithm.h [moved from FMD/AliFMDReconstructionAlgorithm.h with 57% similarity]
FMD/AliFMDMultNaiive.cxx [new file with mode: 0644]
FMD/AliFMDMultNaiive.h [new file with mode: 0644]
FMD/AliFMDMultPoisson.cxx [new file with mode: 0644]
FMD/AliFMDMultPoisson.h [new file with mode: 0644]
FMD/AliFMDMultRegion.cxx [moved from FMD/AliFMDParticles.cxx with 56% similarity]
FMD/AliFMDMultRegion.h [new file with mode: 0644]
FMD/AliFMDMultStrip.cxx [new file with mode: 0644]
FMD/AliFMDMultStrip.h [new file with mode: 0644]
FMD/AliFMDNaiiveAlgorithm.cxx [deleted file]
FMD/AliFMDParticles.h [deleted file]
FMD/AliFMDPoissonAlgorithm.h [deleted file]
FMD/AliFMDPolygon.h
FMD/AliFMDRawReader.cxx
FMD/AliFMDRawStream.cxx
FMD/AliFMDRawWriter.cxx
FMD/AliFMDReconstructor.cxx
FMD/AliFMDReconstructor.h
FMD/AliFMDRing.cxx
FMD/AliFMDSubDetector.cxx
FMD/AliFMDv1.cxx
FMD/Digitize.C [deleted file]
FMD/Document.C [deleted file]
FMD/FMDbaseLinkDef.h
FMD/FMDrecLinkDef.h
FMD/FMDsimLinkDef.h
FMD/ReadRaw.C [deleted file]
FMD/Reconstruct.C
FMD/libFMDbase.pkg
FMD/libFMDrec.pkg
FMD/libFMDsim.pkg
FMD/scripts/.cvsignore [new file with mode: 0644]

index 489cdad..288edb7 100644 (file)
 // Many modifications by Christian Holm Christensen <cholm@nbi.dk>
 //
 
-#include "TClonesArray.h"      // ROOT_TClonesArray
-#include "TGeometry.h"         // ROOT_TGeomtry
-#include "TNode.h"             // ROOT_TNode
-#include "TTUBE.h"             // ROOT_TTUBE
-#include "TTree.h"             // ROOT_TTree
-#include "TVirtualMC.h"                // ROOT_TVirtualMC
-#include "TBrowser.h"          // ROOT_TBrowser
-#include "TMath.h"             // ROOT_TMath
-
-#include "AliRunDigitizer.h"   // ALIRUNDIGITIZER_H
-#include "AliLoader.h"         // ALILOADER_H
-#include "AliRun.h"            // ALIRUN_H
-#include "AliMC.h"             // ALIMC_H
-#include "AliLog.h"            // ALILOG_H
-#include "AliMagF.h"           // ALIMAGF_H
+// These files are not in the same directory, so there's no reason to
+// ask the preprocessor to search in the current directory for these
+// files by including them with `#include "..."' 
+#include <TClonesArray.h>      // ROOT_TClonesArray
+#include <TGeometry.h>         // ROOT_TGeomtry
+#include <TNode.h>             // ROOT_TNode
+#include <TTUBE.h>             // ROOT_TTUBE
+#include <TTree.h>             // ROOT_TTree
+#include <TVirtualMC.h>                // ROOT_TVirtualMC
+#include <TBrowser.h>          // ROOT_TBrowser
+#include <TMath.h>             // ROOT_TMath
+
+#include <AliRunDigitizer.h>   // ALIRUNDIGITIZER_H
+#include <AliLoader.h>         // ALILOADER_H
+#include <AliRun.h>            // ALIRUN_H
+#include <AliMC.h>             // ALIMC_H
+#include <AliLog.h>            // ALILOG_H
+#include <AliMagF.h>           // ALIMAGF_H
 #include "AliFMD.h"            // ALIFMD_H
 #include "AliFMDDigit.h"       // ALIFMDDIGIG_H
 #include "AliFMDHit.h"         // ALIFMDHIT_H
@@ -132,14 +135,19 @@ AliFMD::AliFMD()
     fFMD3(0), 
     fSDigits(0), 
     fNsdigits(0),
-    fSiDensity(0),
     fPrintboardRotationId(0),
     fIdentityRotationId(0),
     fShortLegId(0),
     fLongLegId(0),
     fLegLength(0),
     fLegRadius(0),
-    fModuleSpacing(0)
+    fModuleSpacing(0), 
+    fSiDensity(0),
+    fSiThickness(0),
+    fSiDeDxMip(1.664),
+    fVA1MipRange(0),
+    fAltroChannelSize(0),
+    fSampleRate(0)
 {
   //
   // Default constructor for class AliFMD
@@ -151,6 +159,33 @@ AliFMD::AliFMD()
 }
 
 //____________________________________________________________________
+AliFMD::AliFMD(const AliFMD& other)
+  : AliDetector(other),
+    fInner(other.fInner), 
+    fOuter(other.fOuter),
+    fFMD1(other.fFMD1),
+    fFMD2(other.fFMD2), 
+    fFMD3(other.fFMD3), 
+    fSDigits(other.fSDigits), 
+    fNsdigits(other.fNsdigits),
+    fPrintboardRotationId(other.fPrintboardRotationId),
+    fIdentityRotationId(other.fIdentityRotationId),
+    fShortLegId(other.fShortLegId),
+    fLongLegId(other.fLongLegId),
+    fLegLength(other.fLegLength),
+    fLegRadius(other.fLegRadius),
+    fModuleSpacing(other.fModuleSpacing), 
+    fSiDensity(other.fSiDensity),
+    fSiThickness(other.fSiThickness),
+    fSiDeDxMip(other.fSiDeDxMip),
+    fVA1MipRange(other.fVA1MipRange),
+    fAltroChannelSize(other.fAltroChannelSize),
+    fSampleRate(other.fSampleRate)
+{
+  // Copy constructor 
+}
+
+//____________________________________________________________________
 AliFMD::AliFMD(const char *name, const char *title, bool detailed)
   : AliDetector (name, title),
     fInner(0), 
@@ -160,14 +195,19 @@ AliFMD::AliFMD(const char *name, const char *title, bool detailed)
     fFMD3(0),
     fSDigits(0),
     fNsdigits(0),
-    fSiDensity(0),
     fPrintboardRotationId(0),
     fIdentityRotationId(0),
     fShortLegId(0),
     fLongLegId(0),
     fLegLength(0),
     fLegRadius(0),
-    fModuleSpacing(0)
+    fModuleSpacing(0), 
+    fSiDensity(0),
+    fSiThickness(0),
+    fSiDeDxMip(1.664),
+    fVA1MipRange(0),
+    fAltroChannelSize(0),
+    fSampleRate(0)
 {
   //
   // Standard constructor for Forward Multiplicity Detector
@@ -209,13 +249,18 @@ AliFMD::AliFMD(const char *name, const char *title, bool detailed)
   SetLegRadius();
   SetLegOffset();
   SetModuleSpacing();
+  SetSiThickness();
+  SetSiDensity();
+  SetVA1MipRange();
+  SetAltroChannelSize();
+  SetSampleRate();
   
   fInner->SetLowR(4.3);
   fInner->SetHighR(17.2);
   fInner->SetWaferRadius(13.4/2);
   fInner->SetTheta(36/2);
   fInner->SetNStrips(512);
-  fInner->SetSiThickness(.03);
+  fInner->SetSiThickness(fSiThickness);
   fInner->SetPrintboardThickness(.11);
   fInner->SetBondingWidth(.5);
 
@@ -223,8 +268,8 @@ AliFMD::AliFMD(const char *name, const char *title, bool detailed)
   fOuter->SetHighR(28.0);
   fOuter->SetWaferRadius(13.4/2);
   fOuter->SetTheta(18/2);
-  fOuter->SetNStrips( 256);
-  fOuter->SetSiThickness(.03);
+  fOuter->SetNStrips(256);
+  fOuter->SetSiThickness(fSiThickness);
   fOuter->SetPrintboardThickness(.1);
   fOuter->SetBondingWidth(.5);
   
@@ -262,6 +307,35 @@ AliFMD::~AliFMD ()
   }
 }
 
+//____________________________________________________________________
+AliFMD&
+AliFMD::operator=(const AliFMD& other)
+{
+  AliDetector::operator=(other);
+  fInner               = other.fInner; 
+  fOuter               = other.fOuter;
+  fFMD1                        = other.fFMD1;
+  fFMD2                        = other.fFMD2; 
+  fFMD3                        = other.fFMD3; 
+  fSDigits             = other.fSDigits; 
+  fNsdigits            = other.fNsdigits;
+  fSiDensity           = other.fSiDensity;
+  fPrintboardRotationId        = other.fPrintboardRotationId;
+  fIdentityRotationId  = other.fIdentityRotationId;
+  fShortLegId          = other.fShortLegId;
+  fLongLegId           = other.fLongLegId;
+  fLegLength           = other.fLegLength;
+  fLegRadius           = other.fLegRadius;
+  fModuleSpacing       = other.fModuleSpacing; 
+  fSiDensity           = other.fSiDensity;
+  fSiThickness         = other.fSiThickness;
+  fVA1MipRange         = other.fVA1MipRange;
+  fAltroChannelSize    = other.fAltroChannelSize;
+  fSampleRate          = other.fSampleRate;
+
+  return *this;
+}
+
 //====================================================================
 //
 // GEometry ANd Traking
@@ -326,9 +400,9 @@ AliFMD::CreateGeometry()
                        fPrintboardRotationId, 
                        fIdentityRotationId);
 
-  fFMD1->SetupGeometry((*fIdtmed)[kAirId], (*fIdtmed)[kKaptionId]);
-  fFMD2->SetupGeometry((*fIdtmed)[kAirId], (*fIdtmed)[kKaptionId]);
-  fFMD3->SetupGeometry((*fIdtmed)[kAirId], (*fIdtmed)[kKaptionId]);
+  fFMD1->SetupGeometry((*fIdtmed)[kAirId], (*fIdtmed)[kAlId]);
+  fFMD2->SetupGeometry((*fIdtmed)[kAirId], (*fIdtmed)[kAlId]);
+  fFMD3->SetupGeometry((*fIdtmed)[kAirId], (*fIdtmed)[kAlId]);
   
   fFMD1->Geometry("ALIC", fPrintboardRotationId, fIdentityRotationId);
   fFMD2->Geometry("ALIC", fPrintboardRotationId, fIdentityRotationId);
@@ -398,6 +472,18 @@ void AliFMD::CreateMaterials()
   AliMedium(kCarbonId, "FMD Carbon$",id,0,fieldType,maxField,maxBending,
            maxStepSize,maxEnergyLoss,precision,minStepSize);
 
+  // Aluminum
+  a                = 26.981539;
+  z                = 13.;
+  density          = 2.7;
+  radiationLength  = 8.9;
+  id               = kAlId;
+  AliMaterial(id, "FMD Aluminum$", a, z, density, radiationLength, 
+             absorbtionLength);
+  AliMedium(kAlId, "FMD Aluminum$", id, 0, fieldType, maxField, maxBending,
+           maxStepSize, maxEnergyLoss, precision, minStepSize);
+  
+  
   // Silicon chip 
   {
     Float_t as[] = { 12.0107,      14.0067,      15.9994,
@@ -417,8 +503,8 @@ void AliFMD::CreateMaterials()
              maxBending, maxStepSize, maxEnergyLoss, precision, minStepSize);
   }
   
-
-  // Kaption 
+#if 0
+  // Kaption
   {
     Float_t as[] = { 1.00794,  12.0107,  14.010,   15.9994};
     Float_t zs[] = { 1.,        6.,       7.,       8.};
@@ -428,12 +514,13 @@ void AliFMD::CreateMaterials()
     maxStepSize      = .001;
     precision        = .001;
     minStepSize      = .001;
-    id               = kKaptionId;
+    id               = KaptionId;
     AliMixture(id, "FMD Kaption$", as, zs, density, 4, ws);
-    AliMedium(kKaptionId, "FMD Kaption$",id,0,fieldType,maxField,maxBending,
+    AliMedium(kAlId, "FMD Kaption$",id,0,fieldType,maxField,maxBending,
              maxStepSize,maxEnergyLoss,precision,minStepSize);
   }
-  
+#endif
+
   // Air
   {
     Float_t as[] = { 12.0107, 14.0067,   15.9994,  39.948 };
@@ -943,8 +1030,11 @@ AliFMD::Hits2SDigits()
   // Create AliFMDSDigit's from AliFMDHit's.  This is done by creating
   // an AliFMDSDigitizer object, and executing it. 
   // 
-  AliDigitizer* sdig = new AliFMDSDigitizer("galice.root");
-  sdig->Exec("");
+  AliFMDSDigitizer* digitizer = new AliFMDSDigitizer("galice.root");
+  digitizer->SetSampleRate(fSampleRate);
+  digitizer->SetVA1MipRange(fVA1MipRange);
+  digitizer->SetAltroChannelSize(fAltroChannelSize);
+  digitizer->Exec("");
 }
 
   
@@ -953,7 +1043,11 @@ AliDigitizer*
 AliFMD::CreateDigitizer(AliRunDigitizer* manager) const
 {
   // Create a digitizer object 
-  return new AliFMDDigitizer(manager);
+  AliFMDDigitizer* digitizer = new AliFMDDigitizer(manager);
+  digitizer->SetSampleRate(fSampleRate);
+  digitizer->SetVA1MipRange(fVA1MipRange);
+  digitizer->SetAltroChannelSize(fAltroChannelSize);
+  return digitizer;
 }
 
 //====================================================================
@@ -969,219 +1063,8 @@ AliFMD::Digits2Raw()
   // This uses the class AliFMDRawWriter to do the job.   Please refer
   // to that class for more information. 
   AliFMDRawWriter writer(this);
+  writer.SetSampleRate(fSampleRate);
   writer.Exec();
-  
-#if 0
-  // Digits are read from the Digit branch, and processed to make
-  // three DDL files, one for each of the sub-detectors FMD1, FMD2,
-  // and FMD3. 
-  //
-  // The raw data files consists of a header, followed by ALTRO
-  // formatted blocks.  
-  // 
-  //          +-------------+
-  //          | Header      |
-  //          +-------------+
-  //          | ALTRO Block |
-  //          | ...         |
-  //          +-------------+
-  //          DDL file 
-  // 
-  // An ALTRO formatted block, in the FMD context, consists of a
-  // number of counts followed by a trailer. 
-  // 
-  //          +------------------+
-  //          | Count            |
-  //          | ...              |
-  //          | possible fillers |
-  //          +------------------+
-  //          | Trailer          |
-  //          +------------------+
-  //          ALTRO block 
-  // 
-  // The counts are listed backwards, that is, starting with the
-  // latest count, and ending in the first. 
-  // 
-  // Each count consist of 1 or more ADC samples of the VA1_ALICE
-  // pre-amp. signal.  Just how many samples are used depends on
-  // whether the ALTRO over samples the pre-amp.  Each sample is a
-  // 10-bit word, and the samples are grouped into 40-bit blocks 
-  //
-  //          +------------------------------------+
-  //          |  S(n)   | S(n-1) | S(n-2) | S(n-3) |
-  //          |  ...    | ...    | ...    | ...    |
-  //          |  S(2)   | S(1)   | AA     | AA     |
-  //          +------------------------------------+
-  //          Counts + possible filler 
-  //
-  // The trailer of the number of words of signales, the starting
-  // strip number, the sector number, and the ring ID; each 10-bit
-  // words,  packed into 40-bits. 
-  // 
-  //          +------------------------------------+
-  //          | # words | start  | sector | ring   |
-  //          +------------------------------------+
-  //          Trailer
-  // 
-  // Note, that this method assumes that the digits are ordered. 
-  //
-  AliFMD* fmd = static_cast<AliFMD*>(gAlice->GetDetector(GetName()));
-  fLoader->LoadDigits();
-  TTree* digitTree = fLoader->TreeD();
-  if (!digitTree) {
-    Error("Digits2Raw", "no digit tree");
-    return;
-  }
-  
-  TClonesArray* digits = new TClonesArray("AliFMDDigit", 1000);
-  fmd->SetTreeAddress();
-  TBranch* digitBranch = digitTree->GetBranch(GetName());
-  if (!digitBranch) {
-    Error("Digits2Raw", "no branch for %s", GetName());
-    return;
-  }
-  digitBranch->SetAddress(&digits);
-  
-  Int_t nEvents = Int_t(digitTree->GetEntries());
-  for (Int_t event = 0; event < nEvents; event++) {
-    fmd->ResetDigits();
-    digitTree->GetEvent(event);
-    
-    Int_t nDigits = digits->GetEntries();
-    if (nDigits < 1) continue;
-
-
-    UShort_t prevDetector = 0;
-    Char_t   prevRing     = '\0';
-    UShort_t prevSector   = 0;
-    // UShort_t prevStrip    = 0;
-
-    // The first seen strip number for a channel 
-    UShort_t startStrip   = 0;
-    
-    // Which channel number in the ALTRO channel we're at 
-    UShort_t offset       = 0;
-
-    // How many times the ALTRO Samples one VA1_ALICE channel 
-    Int_t sampleRate = 1;
-
-    // A buffer to hold 1 ALTRO channel - Normally, one ALTRO channel
-    // holds 128 VA1_ALICE channels, sampled at a rate of `sampleRate' 
-    TArrayI channel(128 * sampleRate);
-    
-    // The Altro buffer 
-    AliAltroBuffer* altro = 0;
-    
-    // Loop over the digits in the event.  Note, that we assume the
-    // the digits are in order in the branch.   If they were not, we'd
-    // have to cache all channels before we could write the data to
-    // the ALTRO buffer, or we'd have to set up a map of the digits. 
-    for (Int_t i = 0; i < nDigits; i++) {
-      // Get the digit
-      AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i));
-
-      UShort_t det    = digit->Detector();
-      Char_t   ring   = digit->Ring();
-      UShort_t sector = digit->Sector();
-      UShort_t strip  = digit->Strip();
-      if (det != prevDetector) {
-       AliDebug(10, Form("FMD: New DDL, was %d, now %d",
-                         kBaseDDL + prevDetector - 1,
-                         kBaseDDL + det - 1));
-       // If an altro exists, delete the object, flushing the data to
-       // disk, and closing the file. 
-       if (altro) { 
-         // When the first argument is false, we write the real
-         // header. 
-         AliDebug(10, Form("New altro: Write channel at %d Strip: %d "
-                           "Sector: %d  Ring: %d", 
-                           i, startStrip, prevSector, prevRing));
-         // TPC to FMD translations 
-         // 
-         //    TPC                FMD
-         //    ----------+-----------
-         //    pad       |      strip
-         //    row       |     sector
-         //    sector    |       ring
-         // 
-         altro->WriteChannel(Int_t(startStrip), 
-                             Int_t(prevSector), 
-                             Int_t((prevRing == 'I' ? 0 : 1)), 
-                             channel.fN, channel.fArray, 0);
-         altro->Flush();
-         altro->WriteDataHeader(kFALSE, kFALSE);
-         delete altro;
-         altro = 0;
-       }
-
-       prevDetector = det;
-       // Need to open a new DDL! 
-       Int_t ddlId = kBaseDDL + det - 1;
-       TString filename(Form("%s_%d.ddl", GetName(),  ddlId));
-
-       AliDebug(10, Form("New altro buffer with DDL file %s", 
-                         filename.Data()));
-       AliDebug(10, Form("New altro at %d", i));
-       // Create a new altro buffer - a `1' as the second argument
-       // means `write mode' 
-       altro = new AliAltroBuffer(filename.Data(), 1);
-       
-       // Write a dummy (first argument is true) header to the DDL
-       // file - later on, when we close the file, we write the real
-       // header
-       altro->WriteDataHeader(kTRUE, kFALSE);
-
-       // Figure out the sample rate 
-       if (digit->Count2() > 0) sampleRate = 2;
-       if (digit->Count3() > 0) sampleRate = 3;
-
-       channel.Set(128 * sampleRate);
-       offset     = 0;
-       prevRing   = ring;
-       prevSector = sector;
-       startStrip = strip;
-      }
-      else if (offset == 128                        
-              || digit->Ring() != prevRing 
-              || digit->Sector() != prevSector) {
-       // Force a new Altro channel
-       AliDebug(10, Form("Flushing channel to disk because %s",
-                         (offset == 128 ? "channel is full" :
-                          (ring != prevRing ? "new ring up" :
-                           "new sector up"))));
-       AliDebug(10, Form("New Channel: Write channel at %d Strip: %d "
-                         "Sector: %d  Ring: %d", 
-                         i, startStrip, prevSector, prevRing));
-       altro->WriteChannel(Int_t(startStrip), 
-                           Int_t(prevSector), 
-                           Int_t((prevRing == 'I' ? 0 : 1)), 
-                           channel.fN, channel.fArray, 0);
-       // Reset and update channel variables 
-       channel.Reset(0);
-       offset     = 0; 
-       startStrip = strip;
-       prevRing   = ring;
-       prevSector = sector;
-      }
-
-      // Store the counts of the ADC in the channel buffer 
-      channel[offset * sampleRate] = digit->Count1();
-      if (sampleRate > 1) 
-       channel[offset * sampleRate + 1] = digit->Count2();
-      if (sampleRate > 2) 
-       channel[offset * sampleRate + 2] = digit->Count3();
-      offset++;
-    }
-    // Finally, we need to close the final ALTRO buffer if it wasn't
-    // already 
-    if (altro) {
-      altro->Flush();
-      altro->WriteDataHeader(kFALSE, kFALSE);
-      delete altro;
-    }
-  }
-  fLoader->UnloadDigits();
-#endif
 }
 
 //==================================================================
index 8dfdbd4..fb6c643 100644 (file)
@@ -34,9 +34,9 @@ class AliFMD : public AliDetector
 public:
   AliFMD();
   AliFMD(const char *name, const char *title, bool detailed);
-  AliFMD(const AliFMD& FMD) : AliDetector(FMD)  {}  //copy ctor
+  AliFMD(const AliFMD& other);
   virtual ~AliFMD(); 
-  AliFMD&               operator=(const AliFMD&)  {return *this;}
+  AliFMD& operator=(const AliFMD& other);
 
   // GEometry ANd Tracking (GEANT :-)
   virtual void   CreateGeometry();
@@ -106,62 +106,76 @@ public:
   void     SetLegRadius(Double_t     radius=.5);
   void     SetLegOffset(Double_t     offset=.5);
   void     SetModuleSpacing(Double_t spacing=1);
+  void     SetSiDensity(Float_t r=2.33)         { fSiDensity = r; }
+  void     SetSiThickness(Float_t r=0.03)       { fSiThickness = r; }
+  void     SetVA1MipRange(UShort_t r=20)        { fVA1MipRange = r; }
+  void     SetAltroChannelSize(UShort_t s=1024) { fAltroChannelSize = s;}
+  void     SetSampleRate(UShort_t r=1)          { fSampleRate = (r>2 ? 2 : r);}
 
   // Get various parameters
-  Int_t    GetSiId() const                 { return (*fIdtmed)[kSiId]; }
-  Int_t    GetAirId() const                { return (*fIdtmed)[kAirId]; }
-  Int_t    GetPlasticId() const            { return (*fIdtmed)[kPlasticId]; }
-  Int_t    GetPcbId() const                { return (*fIdtmed)[kPcbId]; }
-  Int_t    GetKaptionId() const            { return (*fIdtmed)[kKaptionId]; }
-  Int_t    GetCarbonId() const             { return (*fIdtmed)[kCarbonId]; }
+  Int_t    GetSiId()                 const { return (*fIdtmed)[kSiId]; }
+  Int_t    GetAirId()                const { return (*fIdtmed)[kAirId]; }
+  Int_t    GetPlasticId()            const { return (*fIdtmed)[kPlasticId]; }
+  Int_t    GetPcbId()                const { return (*fIdtmed)[kPcbId]; }
+  Int_t    GetAlId()                 const { return (*fIdtmed)[kAlId]; }
+  Int_t    GetCarbonId()             const { return (*fIdtmed)[kCarbonId]; }
   Int_t    GetPrintboardRotationId() const { return fPrintboardRotationId; }
-  Int_t    GetShortLegId() const          { return fShortLegId; }
-  Int_t    GetLongLegId() const                   { return fLongLegId; }
-  Double_t GetLegLength() const                   { return fLegLength; }
-  Double_t GetLegRadius() const                   { return fLegRadius; }
-  Double_t GetModuleSpacing() const       { return fModuleSpacing; }  
-
+  Int_t    GetShortLegId()           const { return fShortLegId; }
+  Int_t    GetLongLegId()            const { return fLongLegId; }
+  Double_t GetLegLength()            const { return fLegLength; }
+  Double_t GetLegRadius()            const { return fLegRadius; }
+  Double_t GetModuleSpacing()        const { return fModuleSpacing; }  
+  Float_t  GetSiDensity()            const { return fSiDensity; }
+  Float_t  GetSiThickness()          const { return fSiThickness; }
+  UShort_t GetVA1MipRange()          const { return fVA1MipRange; }
+  UShort_t GetAltroChannelSize()     const { return fAltroChannelSize; }
+  UShort_t GetSampleRate()           const { return fSampleRate; }
+  Float_t  GetEdepMip()              const { 
+    return fSiDeDxMip * fSiDensity * fSiThickness;
+  }
+  
   // Utility
   void   Browse(TBrowser* b);
-  Float_t GetSiDensity() const { return fSiDensity; }
   enum { 
     kBaseDDL = 0x1000 // DDL offset for the FMD
   };
 protected:
+  TClonesArray*      HitsArray();
+  TClonesArray*      DigitsArray();
+  TClonesArray*      SDigitsArray();
+
   enum {
     kSiId,                 // ID of Si medium
     kAirId,                // ID of Air medium
     kPlasticId,            // ID of Plastic medium
     kPcbId,                // ID of PCB medium
     kSiChipId,             // ID of Si Chip medium
-    kKaptionId,            // ID of Kaption medium
+    kAlId,                 // ID of Al medium
     kCarbonId              // ID of Carbon medium
   };
-
-  void    SetSiDensity(Float_t r=2.33) { fSiDensity = r; }
-  TClonesArray*      HitsArray();
-  TClonesArray*      DigitsArray();
-  TClonesArray*      SDigitsArray();
-  
-  AliFMDRing*        fInner;        // Inner ring structure
-  AliFMDRing*        fOuter;        // Outer ring structure  
-  AliFMDSubDetector* fFMD1;         // FMD1 structure
-  AliFMDSubDetector* fFMD2;         // FMD2 structure  
-  AliFMDSubDetector* fFMD3;         // FMD3 structure
-
-  TClonesArray*      fSDigits;
-  Int_t              fNsdigits;
   
-  Float_t    fSiDensity;            // Density of Silicon
-  Int_t      fPrintboardRotationId; // ID of Rotation of print bard
-  Int_t      fIdentityRotationId;   // ID of identity matrix 
-  Int_t      fShortLegId;           // ID short leg volume
-  Int_t      fLongLegId;            // ID long leg volume  
-  Double_t   fLegLength;            // Leg length
-  Double_t   fLegRadius;            // Leg radius
-  Double_t   fModuleSpacing;        // Staggering offset 
+  AliFMDRing*        fInner;                // Inner ring structure
+  AliFMDRing*        fOuter;                // Outer ring structure  
+  AliFMDSubDetector* fFMD1;                 // FMD1 structure
+  AliFMDSubDetector* fFMD2;                 // FMD2 structure  
+  AliFMDSubDetector* fFMD3;                 // FMD3 structure
+  TClonesArray*      fSDigits;              // Summable digits
+  Int_t              fNsdigits;             // Number of digits  
+  Int_t              fPrintboardRotationId; // ID of Rotation of print bard
+  Int_t              fIdentityRotationId;   // ID of identity matrix 
+  Int_t              fShortLegId;           // ID short leg volume
+  Int_t              fLongLegId;            // ID long leg volume  
+  Double_t           fLegLength;            // Leg length
+  Double_t           fLegRadius;            // Leg radius
+  Double_t           fModuleSpacing;        // Staggering offset 
+  Float_t            fSiDensity;            // Density of Silicon
+  Float_t            fSiThickness;          // Thickness of silicon wafers
+  const Float_t      fSiDeDxMip;            // MIP dE/dx in Silicon
+  UShort_t           fVA1MipRange;          // # MIPs the pre-amp can do    
+  UShort_t           fAltroChannelSize;     // Largest # to store in 1 ADC ch.
+  UShort_t           fSampleRate;           // Times the ALTRO samples pre-amp.
   
-  ClassDef(AliFMD,8)     // Base class FMD entry point
+  ClassDef(AliFMD,9)     // Base class FMD entry point
 };
 
 #endif
index 7fd074a..51922dc 100644 (file)
@@ -17,9 +17,9 @@ public:
   virtual void   Geometry(const char* mother, Int_t pbRotId, 
                          Int_t idRotId, Double_t z=0);
 protected:
-  Int_t    fVolumeId;
-  Double_t fDz;
-  ClassDef(AliFMD1,1); // Geometry of FMD1 
+  Int_t    fVolumeId;   // Volume ID
+  Double_t fDz;         // Half-length in Z
+  ClassDef(AliFMD1,1);  // Geometry of FMD1 
 };
 
 #endif
index 0e72c47..272b448 100644 (file)
@@ -22,9 +22,9 @@
 // This implements the geometry for FMD2
 //
 #include "AliFMD2.h"           // ALIFMD2_H 
-#include "TVirtualMC.h"                // ROOT_TVirtualMC
-#include "AliLog.h"            // ALILOG_H
 #include "AliFMDRing.h"                // ALIFMDRING_H 
+#include <AliLog.h>            // ALILOG_H
+#include <TVirtualMC.h>                // ROOT_TVirtualMC
 
 //____________________________________________________________________
 ClassImp(AliFMD2);
index 5558902..d8162e2 100644 (file)
@@ -17,8 +17,8 @@ public:
   virtual void   Geometry(const char* mother, Int_t pbRotId, 
                          Int_t idRotId, Double_t z=0);
 protected:
-  Int_t    fVolumeId;
-  Double_t fDz;
+  Int_t    fVolumeId;  // Volume ID       
+  Double_t fDz;               // Half-length in Z
   ClassDef(AliFMD2,1); // Geometry of FMD2
 };
 
index f1cb3f2..4065d3b 100644 (file)
@@ -20,8 +20,8 @@ public:
                                Int_t colour, Double_t zMother);
 protected:
   void     CalculateDz();
-  Int_t    fVolumeId;
-  Double_t fDz;
+  Int_t    fVolumeId;  // Volume ID
+  Double_t fDz;        // Half-length in Z
   ClassDef(AliFMD3,1); // Geometry of FMD3 
 };
 
diff --git a/FMD/AliFMDBoolMap.cxx b/FMD/AliFMDBoolMap.cxx
new file mode 100644 (file)
index 0000000..17f5ba1
--- /dev/null
@@ -0,0 +1,124 @@
+/**************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN.          *
+ * All rights reserved.                                       *
+ *                                                            *
+ * Author: The ALICE Off-line Project.                        *
+ * Contributors are mentioned in the code where appropriate.  *
+ *                                                            *
+ * Permission to use, copy, modify and distribute this        *
+ * software and its documentation strictly for non-commercial *
+ * purposes is hereby granted without fee, provided that the  *
+ * above copyright notice appears in all copies and that both *
+ * the copyright notice and this permission notice appear in  *
+ * the supporting documentation. The authors make no claims   *
+ * about the suitability of this software for any purpose. It *
+ * is provided "as is" without express or implied warranty.   *
+ **************************************************************/
+/* $Id$ */
+//__________________________________________________________
+// 
+// Map of per strip Bool_t information
+// 
+// Created Mon Nov  8 12:51:51 2004 by Christian Holm Christensen
+// 
+#include "AliFMDBoolMap.h"     //ALIFMDBOOLMAP_H
+//__________________________________________________________
+ClassImp(AliFMDBoolMap);
+//__________________________________________________________
+AliFMDBoolMap::AliFMDBoolMap(const AliFMDBoolMap& other)
+  : AliFMDMap(other.fMaxDetectors,
+              other.fMaxRings,
+              other.fMaxSectors,
+              other.fMaxStrips),
+    fData(0)
+{
+  // Copy constructor
+  fData = new Bool_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
+  for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips; i++)
+    fData[i] = other.fData[i];
+}
+
+//__________________________________________________________
+AliFMDBoolMap::AliFMDBoolMap(size_t maxDet,
+                         size_t maxRing,
+                         size_t maxSec,
+                         size_t maxStr)
+  : AliFMDMap(maxDet, maxRing, maxSec, maxStr),
+    fData(0)
+{
+  // Constructor.
+  // Parameters:
+  //   maxDet  Maximum number of detectors
+  //   maxRing Maximum number of rings per detector
+  //   maxSec  Maximum number of sectors per ring
+  //   maxStr  Maximum number of strips per sector
+  fData = new Bool_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
+  Clear();
+}
+
+//__________________________________________________________
+AliFMDBoolMap&
+AliFMDBoolMap::operator=(const AliFMDBoolMap& other)
+{
+  // Assignment operator 
+  fMaxDetectors = other.fMaxDetectors;
+  fMaxRings     = other.fMaxRings;
+  fMaxSectors   = other.fMaxSectors;
+  fMaxStrips    = other.fMaxStrips;
+  if (fData) delete [] fData;
+  fData = new Bool_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
+  for (size_t i = 0; i < fMaxDetectors * fMaxRings 
+        * fMaxSectors * fMaxStrips; i++)
+    fData[i] = other.fData[i];
+  return *this;
+}
+
+//__________________________________________________________
+void
+AliFMDBoolMap::Clear(const Bool_t& val)
+{
+  // Reset map to val
+  for (size_t i = 0; i < fMaxDetectors * fMaxRings 
+        * fMaxSectors * fMaxStrips; i++)
+    fData[i] = val;
+}
+
+//__________________________________________________________
+Bool_t&
+AliFMDBoolMap::operator()(UShort_t det, 
+                         Char_t   ring, 
+                         UShort_t sec, 
+                         UShort_t str)
+{
+  // Get data
+  // Parameters:
+  //   det     Detector #
+  //   ring    Ring ID
+  //   sec     Sector #
+  //   str     Strip #
+  // Returns appropriate data
+  return fData[CalcIndex(det, ring, sec, str)];
+}
+
+//__________________________________________________________
+const Bool_t&
+AliFMDBoolMap::operator()(UShort_t det, 
+                         Char_t   ring, 
+                         UShort_t sec, 
+                         UShort_t str) const
+{
+  // Get data
+  // Parameters:
+  //   det     Detector #
+  //   ring    Ring ID
+  //   sec     Sector #
+  //   str     Strip #
+  // Returns appropriate data
+  return fData[CalcIndex(det, ring, sec, str)];
+}
+
+//__________________________________________________________
+// 
+// EOF
+// 
+
diff --git a/FMD/AliFMDBoolMap.h b/FMD/AliFMDBoolMap.h
new file mode 100644 (file)
index 0000000..f97fa64
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef ALIFMDBOOLMAP_H
+#define ALIFMDBOOLMAP_H
+/* Copyright (c) 2004, ALICE Experiment @ CERN.
+ * All rights reserved
+ * See AliFMDBoolMap.cxx for full copyright notice
+ * 
+ * Created Mon Nov  8 12:51:51 2004 by Christian Holm Christensen
+ */
+/* $Id$ */
+//__________________________________________________________
+// 
+// Map of Bool_t for each FMD strip
+// 
+#ifndef ALIFMDMAP_H
+# include <AliFMDMap.h>
+#endif
+
+class AliFMDBoolMap : public AliFMDMap
+{
+public:
+  AliFMDBoolMap(const AliFMDBoolMap& other);
+  AliFMDBoolMap(size_t maxDet  = kMaxDetectors,
+                 size_t maxRing = kMaxRings,
+                 size_t maxSec  = kMaxSectors,
+                 size_t maxStr  = kMaxStrips);
+  virtual ~AliFMDBoolMap() { delete [] fData; }
+  AliFMDBoolMap& operator=(const AliFMDBoolMap& other);
+  virtual void Clear(const Bool_t& v=Bool_t());
+  virtual Bool_t& operator()(UShort_t det,
+                                     Char_t   ring,
+                                     UShort_t sec,
+                                     UShort_t str);
+  virtual const Bool_t& operator()(UShort_t det,
+                                           Char_t   ring,
+                                           UShort_t sec,
+                                           UShort_t str) const;
+protected:
+  Bool_t* fData; // The Data
+  ClassDef(AliFMDBoolMap,1) // Map of Bool_t data per strip
+};
+
+#endif
+//__________________________________________________________
+// 
+// Local Variables:
+//   mode: C++
+// End:
+//
index e1127d6..1261250 100644 (file)
@@ -102,7 +102,7 @@ AliFMDBaseDigit::Print(Option_t* /* option*/) const
   cout << ClassName() << ": FMD" << fDetector << fRing << "[" 
        << setw(3) << fSector << ","
        << setw(3) << fStrip << "]" 
-       << endl;
+       << flush;
 }
 
 //====================================================================
index 167431e..42cde91 100644 (file)
@@ -1,11 +1,9 @@
 #ifndef ALIFMDDIGIT_H
 #define ALIFMDDIGIT_H
-
-//////////////////////////////////////////////////////////////////////
+//___________________________________________________________________
 //
 //  Digits classes for the FMD                
 //
-//////////////////////////////////////////////////////////////////////
 #ifndef ROOT_TObject
 # include <TObject.h>
 #endif
index 67fcbfb..b55bbb4 100644 (file)
 //                    -1 + B + exp(-B)
 //
 
-#include "TTree.h"             // ROOT_TTree
-#include "TRandom.h"           // ROOT_TRandom
-#include "AliLog.h"            // ALILOG_H
+#include <TTree.h>             // ROOT_TTree
+#include <TRandom.h>           // ROOT_TRandom
+#include <AliLog.h>            // ALILOG_H
 #include "AliFMDDigitizer.h"   // ALIFMDDIGITIZER_H
 #include "AliFMD.h"            // ALIFMD_H
 #include "AliFMDHit.h"         // ALIFMDHIT_H
 #include "AliFMDDigit.h"       // ALIFMDDIGIT_H
-#include "AliRunDigitizer.h"   // ALIRUNDIGITIZER_H
-#include "AliRun.h"            // ALIRUN_H
-#include "AliLoader.h"         // ALILOADER_H
-#include "AliRunLoader.h"      // ALIRUNLOADER_H
+#include <AliRunDigitizer.h>   // ALIRUNDIGITIZER_H
+#include <AliRun.h>            // ALIRUN_H
+#include <AliLoader.h>         // ALILOADER_H
+#include <AliRunLoader.h>      // ALIRUNLOADER_H
     
 //____________________________________________________________________
 ClassImp(AliFMDEdepMap);
@@ -375,8 +375,8 @@ AliFMDBaseDigitizer::DigitizeHits(AliFMD* fmd) const
          if (strip % 128 == 0) last = 0;
          
          Float_t edep = fEdep(detector, r->GetId(), sector, strip).fEdep;
-         ConvertToCount(edep, last, r->GetSiThickness(), fmd->GetSiDensity(), 
-                        counts);
+         ConvertToCount(edep, last, r->GetSiThickness(), 
+                        fmd->GetSiDensity(), counts);
          last = edep;
          AddDigit(fmd, detector, r->GetId(), sector, strip, 
                   edep, UShort_t(counts[0]), 
index 6abec54..9050690 100644 (file)
 // through a detector.
 //
 #ifndef ALIHIT_H
-# include "AliHit.h"
+# include <AliHit.h>
 #endif
-
 
+//___________________________________________________________________
 class AliFMDHit : public AliHit 
 {
 public:
similarity index 53%
rename from FMD/AliFMDPoissonAlgorithm.cxx
rename to FMD/AliFMDMult.cxx
index be89bea..4efb380 100644 (file)
@@ -1,5 +1,5 @@
 /**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
  * Author: The ALICE Off-line Project.                                    *
  * Contributors are mentioned in the code where appropriate.              *
 /* $Id$ */
 
 //____________________________________________________________________
-// 
-// Base class for FMD poisson algorithms. 
 //
-// Derived classes will implement various ways of reconstructing the
-// charge particle multiplicity in the FMD.  
-// 
-#include "AliFMDPoissonAlgorithm.h"    // ALIFMDPOISSONALGORITHM_H
-#include "AliFMDDigit.h"               // ALIFMDDIGIT_H
-
-//____________________________________________________________________
-ClassImp(AliFMDPoissonAlgorithm);
+//  Forward Multiplicity Detector have to be reconstructed number of
+//  particles in fixed pseudorapidity interval from fNumOfMinRing
+//  to fNumOfMaxRing and phi interval from fNumOfMinSector to
+//  fNumOfMaxSector
+//
+#include "AliFMDMult.h"                // ALIFMDMULT_H
+#include <TString.h>            // ROOT_TString 
+#include <Riostream.h>         // ROOT_Riostream
 
 //____________________________________________________________________
-AliFMDPoissonAlgorithm::AliFMDPoissonAlgorithm()
-  : AliFMDReconstructionAlgorithm("Poisson", "Poisson")
-{}
-
+ClassImp(AliFMDMult);
 
 //____________________________________________________________________
-void
-AliFMDPoissonAlgorithm::Reset() 
+AliFMDMult::AliFMDMult(Float_t  particles, UShort_t method)
+  : fParticles(particles),
+    fMethod(method)
 {
-  // Reset internal data 
-  fTotal = 0;
-  fEmpty.Reset(kFALSE);
+  // Constructor
+  switch (fMethod) {
+  case kPoission: 
+  case kIterative: 
+  case kNaiive:    
+    break;    
+  default:        
+    Warning("AliFMDMult", "unknown method: %d", method);
+    break;
+  }
 }
 
+
 //____________________________________________________________________
 void
-AliFMDPoissonAlgorithm::ProcessDigit(AliFMDDigit* digit, 
-                                    Float_t eta, Float_t phi, 
-                                    UShort_t count)
+AliFMDMult::Print(Option_t* option) const
 {
-  // Process one digit. 
-  // 
-  // Parameters: 
-  //    
-  //   digit           Digit to process 
-  //   ipZ             Z--coordinate of the primary interaction
-  //                    vertex of this event 
+  // Print information 
+  //
+  // Options:
   //
-  if (!digit) return;
-  fTotal++;
-  if (charge < threshold) fEmpty(digit->Detector() - 1, 
-                                digit->Ring(), 
-                                digit->Setctor(), 
-                                digit->Strip()) = kTRUE;
+  //    V      Be verbose
+  // 
+  TString opt(option);
+  if (!opt.Contains("v", TString::kIgnoreCase)) return;
+  cout << "  Method:        " << flush;
+  switch (fMethod) {
+  case kPoission:  cout << "Poission"  << endl; break;
+  case kIterative: cout << "Iterative" << endl; break;
+  case kNaiive:    cout << "Naive"     << endl; break; 
+  default:         cout << "Unknown"   << endl; break;
+  }
 }
 
-
+    
 //____________________________________________________________________
-// 
+//
 // EOF
 //
diff --git a/FMD/AliFMDMult.h b/FMD/AliFMDMult.h
new file mode 100644 (file)
index 0000000..9b71657
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef ALIFMDMULT_H
+#define ALIFMDMULT_H
+
+/* Reconstracted Particles Class: has number of reconstructed
+ * particles in sectors from NumOfMinSector to NumberOfMaxSector()
+ * rings from NumOfMinRing to NumOfMaxRing for each FMDvolume
+ */
+#ifndef ROOT_TObject
+# include <TObject.h>
+#endif
+
+class AliFMDMult: public TObject
+{
+public:
+  enum EMethod {
+    kPoission, 
+    kIterative, 
+    kNaiive
+  };
+  AliFMDMult(Float_t  particles=0, UShort_t method=kNaiive);
+  virtual ~AliFMDMult() {};
+
+  Float_t      Particles() const { return fParticles; }
+  UShort_t     Method()    const { return fMethod; }
+  virtual void Print(Option_t* opt="") const;
+protected:
+  Float_t  fParticles;       // Number of particles 
+  UShort_t fMethod;          // Method use to get fParticles
+
+  ClassDef(AliFMDMult,1)     // Base class for multiplicity data
+};
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+//   mode: C++
+// End:
+//
+// EOF
+//
similarity index 69%
rename from FMD/AliFMDReconstructionAlgorithm.cxx
rename to FMD/AliFMDMultAlgorithm.cxx
index 10d3ea1..7c8c778 100644 (file)
 // Derived classes will implement various ways of reconstructing the
 // charge particle multiplicity in the FMD.  
 // 
-#include "AliFMDReconstructionAlgorithm.h"     // ALIFMDRECONSTRUCTIONALGORITHM_H
-#include "AliFMDDigit.h"                       // ALIFMDDIGIT_H
+#include "AliFMDMultAlgorithm.h"       // ALIFMDMULTALGORITHM_H
+#include "AliFMDDigit.h"               // ALIFMDDIGIT_H
+#include <TClonesArray.h>               // ROOT_TClonesArray
 
 //____________________________________________________________________
-ClassImp(AliFMDReconstructionAlgorithm);
+ClassImp(AliFMDMultAlgorithm);
 
 //____________________________________________________________________
-AliFMDReconstructionAlgorithm::AliFMDReconstructionAlgorithm(const char* name, 
-                                                            const char* title)
-  : TNamed(name, title)
+AliFMDMultAlgorithm::AliFMDMultAlgorithm(const char* name, const char* title)
+  : TNamed(name, title), 
+    fTreeR(0), 
+    fMult(0), 
+    fFMD(0)
 {}
 
+//____________________________________________________________________
+AliFMDMultAlgorithm::~AliFMDMultAlgorithm()
+{
+  if (fMult) delete fMult;
+}
+
+
+//____________________________________________________________________
+void
+AliFMDMultAlgorithm::PreEvent(TTree* treeR, Float_t /* ipZ */) 
+{
+  if (fMult) fMult->Clear();
+  fNMult = 0;
+  fTreeR = treeR;
+}
+
 
 
 //____________________________________________________________________
similarity index 57%
rename from FMD/AliFMDReconstructionAlgorithm.h
rename to FMD/AliFMDMultAlgorithm.h
index fd2759e..8719e91 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef ALIFMDRECONSTRUCTIONALGORITHM_H
-#define ALIFMDRECONSTRUCTIONALGORITHM_H
+#ifndef ALIFMDMULTALGORITHM_H
+#define ALIFMDMULTALGORITHM_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
  * reserved. 
  *
 
 //____________________________________________________________________
 class AliFMDDigit;
+class TTree;
+class AliFMD;
+class TClonesArray;
 
 //____________________________________________________________________
-class AliFMDReconstructionAlgorithm : public TNamed
+class AliFMDMultAlgorithm : public TNamed
 {
 public:
-  AliFMDReconstructionAlgorithm(const char* name, const char* title);
-  virtual ~AliFMDReconstructionAlgorithm() {}
+  AliFMDMultAlgorithm(const char* name, const char* title);
+  virtual ~AliFMDMultAlgorithm();
   
-  virtual void PreEvent() {};
+  virtual void PreRun(AliFMD* fmd) { fFMD = fmd; }
+  virtual void PreEvent(TTree* treeR, Float_t ipZ);
   virtual void ProcessDigit(AliFMDDigit* digit, 
                            Float_t eta, 
                            Float_t phi, 
                            UShort_t counts) = 0;
-  virtual void PostEvent() {};
+  virtual void PostEvent() {}
+  virtual void PostRun() {}
 protected:
-  ClassDef(AliFMDReconstructionAlgorithm, 0) // Base class for algorithms
+  TTree*        fTreeR;     //! Reconstruction tree  
+  TClonesArray* fMult;      //! Reconstructed multiplicities
+  Int_t         fNMult;     //! Number of reconstructed multiplicities
+  AliFMD*       fFMD;       //! Detector information 
+  
+  ClassDef(AliFMDMultAlgorithm, 0) // Base class for algorithms
 };
 
 #endif
diff --git a/FMD/AliFMDMultNaiive.cxx b/FMD/AliFMDMultNaiive.cxx
new file mode 100644 (file)
index 0000000..2d9baa7
--- /dev/null
@@ -0,0 +1,166 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+//____________________________________________________________________
+// 
+// Base class for FMD naiive algorithms. 
+//
+// Derived classes will implement various ways of reconstructing the
+// charge particle multiplicity in the FMD.  
+// 
+#include "AliFMD.h"                    // ALIFMD_H
+#include "AliFMDMultNaiive.h"          // ALIFMDMULTNAIIVE_H
+#include "AliFMDMultStrip.h"           // ALIFMDMULTNAIIVE_H
+#include "AliFMDDigit.h"               // ALIFMDDIGIT_H
+#include <TClonesArray.h>               // ROOT_TClonesArray
+#include <TTree.h>                     // ROOT_TTree
+
+//____________________________________________________________________
+ClassImp(AliFMDMultNaiive);
+
+//____________________________________________________________________
+AliFMDMultNaiive::AliFMDMultNaiive()
+  : AliFMDMultAlgorithm("Naiive", "Naiive")
+{
+  // Default CTOR
+  fMult = new TClonesArray("AliFMDMultStrip", 1000);
+}
+
+//____________________________________________________________________
+void
+AliFMDMultNaiive::PreRun(AliFMD* fmd) 
+{
+  // Initialise before a run 
+  AliFMDMultAlgorithm::PreRun(fmd);
+  fEdepMip = fmd->GetEdepMip();
+  fGain = (fmd->GetVA1MipRange() / fmd->GetAltroChannelSize() 
+          * fEdepMip);
+}
+
+//____________________________________________________________________
+void
+AliFMDMultNaiive::PreEvent(TTree* treeR, Float_t ipZ) 
+{
+  // Reset internal data 
+  AliFMDMultAlgorithm::PreEvent(treeR, ipZ);  
+  fTreeR->Branch("FMDNaiive", &fMult);
+}
+
+//____________________________________________________________________
+void
+AliFMDMultNaiive::ProcessDigit(AliFMDDigit* digit, 
+                              Float_t eta, 
+                              Float_t phi, 
+                              UShort_t count)
+{
+  // Process one digit. 
+  // 
+  // Parameters: 
+  //    
+  //   digit           Digit to process 
+  //   eta              Pseudo-rapidity of digit
+  //   phi              Azimuthal angle of digit
+  //   count            ADC (corrected for the pedestal)
+  //
+  // This calculates the energy deposited and the number of MIPs that
+  // this energy deposition corresponds to 
+  // 
+  //   EnergyDeposited = cos(theta) * gain * count 
+  //   Multiplicity    = EnergyDeposited / EnergyDepositedPerMIP
+  // 
+  // where gain is a conversion factor from number of counts to an
+  // energy:
+  //          Pre_Amp_MIP_Range           1
+  //   gain = ----------------- * ---------------------
+  //          ADC_channel_size    EnergyDepositedPerMip
+  // 
+  // and theta is the particles incident angle on the strip, given by 
+  //
+  //   theta = 2 * atan(exp(-eta))
+  //
+  // The cos(theta) factor corrects for the fact that the particle may
+  // traverse the strip at an angle, and therefor have a longer flight
+  // length, leading to a larger energy deposition. 
+  // 
+  if (!digit) return;
+  Double_t edep  = Adc2Energy(digit, eta, count);
+  Double_t mult  = Energy2Multiplicity(digit, edep);
+
+  new ((*fMult)[fNMult]) AliFMDMultStrip(digit->Detector(), 
+                                        digit->Ring(), 
+                                        digit->Sector(),
+                                        digit->Strip(),
+                                        eta, phi, 
+                                        edep, mult, 
+                                        AliFMDMult::kNaiive);
+  fNMult++;
+}
+//____________________________________________________________________
+Float_t
+AliFMDMultNaiive::Adc2Energy(AliFMDDigit* /* digit */, 
+                            Float_t      eta, 
+                            UShort_t     count) 
+{
+  // Converts number of ADC counts to energy deposited. 
+  // Note, that this member function can be overloaded by derived
+  // classes to do strip-specific look-ups in databases or the like,
+  // to find the proper gain for a strip. 
+  // 
+  // In this simple version, we calculate the energy deposited as 
+  // 
+  //    EnergyDeposited = cos(theta) * gain * count
+  // 
+  // where 
+  // 
+  //           Pre_amp_MIP_Range
+  //    gain = ----------------- * Energy_deposited_per_MIP
+  //           ADC_channel_size    
+  // 
+  // is constant and the same for all strips. 
+  Double_t theta = 2 * TMath::Tan(TMath::Exp(-eta));
+  Double_t edep  = TMath::Cos(theta) * fGain * count;
+  return edep;
+}
+
+//____________________________________________________________________
+Float_t
+AliFMDMultNaiive::Energy2Multiplicity(AliFMDDigit* /* digit */, 
+                                     Float_t      edep)
+{
+  // Converts an energy signal to number of particles. 
+  // Note, that this member function can be overloaded by derived
+  // classes to do strip-specific look-ups in databases or the like,
+  // to find the proper gain for a strip. 
+  // 
+  // In this simple version, we calculate the multiplicity as 
+  // 
+  //   multiplicity = Energy_deposited / Energy_deposited_per_MIP
+  // 
+  // where 
+  //
+  //   Energy_deposited_per_MIP = 1.664 * SI_density * SI_thickness 
+  // 
+  // is constant and the same for all strips 
+  return edep / fEdepMip;
+}
+
+
+
+//____________________________________________________________________
+// 
+// EOF
+//
diff --git a/FMD/AliFMDMultNaiive.h b/FMD/AliFMDMultNaiive.h
new file mode 100644 (file)
index 0000000..a6970a5
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef ALIFMDMULTNAIIVE_H
+#define ALIFMDMULTNAIIVE_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
+ * reserved. 
+ *
+ * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
+ *
+ * See cxx source for full Copyright notice                               
+ */
+/* $Id$ */
+//____________________________________________________________________
+// 
+// Class to do multiplicity reconstruction using the Naiive method.
+// That is, we count the number of empty strips in a region, and
+// derive the charge particle multiplicity from that number. 
+// 
+
+#ifndef ALIFMDMULTALGORITHM_H
+# include "AliFMDMultAlgorithm.h"
+#endif
+
+//____________________________________________________________________
+class AliFMDMultNaiive : public AliFMDMultAlgorithm
+{
+public:
+  AliFMDMultNaiive();
+  virtual ~AliFMDMultNaiive() {}
+  
+  virtual void PreRun(AliFMD* fmd);
+  virtual void PreEvent(TTree* treeR, Float_t ipZ);
+  virtual void ProcessDigit(AliFMDDigit* digit, 
+                           Float_t eta, 
+                           Float_t phi, 
+                           UShort_t counts);
+  void    SetGain(Float_t g) { fGain = g; }
+  void    SetEdepMip(Float_t e) { fEdepMip = e; }
+  Float_t GetGain() const { return fGain; }
+  Float_t GetEdepMip() const { return fEdepMip; }
+protected:
+  Float_t Adc2Energy(AliFMDDigit* digit, Float_t eta, UShort_t count);
+  Float_t Energy2Multiplicity(AliFMDDigit* digit, Float_t edep);
+  Float_t fGain;           //  GeV per ADC count
+  Float_t fEdepMip;        //  Energy deposited per MIP
+  
+  ClassDef(AliFMDMultNaiive, 0) // Naiive algorithm
+};
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+//   mode: C++
+// End:
+//
+// EOF
+//
diff --git a/FMD/AliFMDMultPoisson.cxx b/FMD/AliFMDMultPoisson.cxx
new file mode 100644 (file)
index 0000000..37e08a8
--- /dev/null
@@ -0,0 +1,206 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+//____________________________________________________________________
+// 
+// Base class for FMD poisson algorithms. 
+//
+// Derived classes will implement various ways of reconstructing the
+// charge particle multiplicity in the FMD.  
+// 
+#include "AliFMD.h"                    // ALIFMD_H
+#include "AliFMDMultPoisson.h"         // ALIFMDMULTPOISSON_H
+#include "AliFMDMultRegion.h"          // ALIFMDMULTREGION_H
+#include "AliFMDDigit.h"               // ALIFMDDIGIT_H
+#include "AliLog.h"                    // ALILOG_H
+#include <TClonesArray.h>               // ROOT_TClonesArray
+#include <TTree.h>                     // ROOT_TTree
+
+//____________________________________________________________________
+ClassImp(AliFMDMultPoisson);
+
+//____________________________________________________________________
+AliFMDMultPoisson::AliFMDMultPoisson()
+  : AliFMDMultAlgorithm("Poisson", "Poisson"),
+    fDeltaEta(0), 
+    fDeltaPhi(0), 
+    fThreshold(0)
+{
+  SetDeltaEta();
+  SetDeltaPhi();
+  SetThreshold();
+  fMult = new TClonesArray("AliFMDMultRegion", 1000);
+}
+
+//____________________________________________________________________
+void
+AliFMDMultPoisson::PreEvent(TTree* tree, Float_t ipZ) 
+{
+  // Reset internal data
+  AliFMDMultAlgorithm::PreEvent(tree, ipZ);
+  fCurrentVertexZ = ipZ;
+  fEmpty.Clear(kFALSE);
+
+  // Make a branch in the reconstruction tree. 
+  const Int_t kBufferSize = 16000;
+  fTreeR->Branch("FMDPoisson", &fMult, kBufferSize);  
+  
+}
+
+//____________________________________________________________________
+void
+AliFMDMultPoisson::ProcessDigit(AliFMDDigit*  digit, 
+                               Float_t       /* eta */, 
+                               Float_t       /* phi */, 
+                               UShort_t      count)
+{
+  // Process one digit. 
+  // 
+  // Parameters: 
+  //    
+  //   digit           Digit to process 
+  //   ipZ             Z--coordinate of the primary interaction
+  //                    vertex of this event 
+  //
+  if (!digit) return;
+  if (count < fThreshold) fEmpty(digit->Detector() - 1, 
+                                digit->Ring(), 
+                                digit->Sector(), 
+                                digit->Strip()) = kTRUE;
+}
+
+//____________________________________________________________________
+void
+AliFMDMultPoisson::PostEvent() 
+{
+  // Fill the branch 
+  // Based on the information in the cache, do the reconstruction. 
+
+  // Loop over the detectors 
+  for (Int_t i = 1; i <= 3; i++) {
+    AliFMDSubDetector* sub = 0;
+    switch (i) {
+    case 1: sub = fFMD->GetFMD1(); break;
+    case 2: sub = fFMD->GetFMD2(); break;
+    case 3: sub = fFMD->GetFMD3(); break;
+    }
+    if (!sub) continue;
+       
+    // Loop over the rings in the detector
+    for (Int_t j = 0; j < 2; j++) {
+      Float_t     rZ = 0;
+      AliFMDRing* r  = 0;
+      switch (j) {
+      case 0: r  = sub->GetInner(); rZ = sub->GetInnerZ(); break;
+      case 1: r  = sub->GetOuter(); rZ = sub->GetOuterZ(); break;
+      }
+      if (!r) continue;
+      
+      // Calculate low/high theta and eta 
+      // FIXME: Is this right? 
+      Float_t realZ    = fCurrentVertexZ + rZ;
+      Float_t thetaOut = TMath::ATan2(r->GetHighR(), realZ);
+      Float_t thetaIn  = TMath::ATan2(r->GetLowR(), realZ);
+      Float_t etaOut   = - TMath::Log(TMath::Tan(thetaOut / 2));
+      Float_t etaIn    = - TMath::Log(TMath::Tan(thetaIn / 2));
+      if (TMath::Abs(etaOut) > TMath::Abs(etaIn)) {
+       Float_t tmp = etaIn;
+       etaIn       = etaOut;
+       etaOut      = tmp;
+      }
+
+      //-------------------------------------------------------------
+      //
+      // Here starts poisson method 
+      //
+      // Calculate eta step per strip, number of eta steps, number of
+      // phi steps, and check the sign of the eta increment 
+      Float_t stripEta = (Float_t(r->GetNStrips()) / (etaIn - etaOut));
+      Int_t   nEta     = Int_t(TMath::Abs(etaIn - etaOut) / fDeltaEta); 
+      Int_t   nPhi     = Int_t(360. / fDeltaPhi);
+      Float_t sign     = TMath::Sign(Float_t(1.), etaIn);
+
+      AliDebug(10, Form("FMD%d%c Eta range: %f, %f %d Phi steps",
+                       sub->GetId(), r->GetId(), etaOut, etaIn, nPhi));
+
+      // Loop over relevant phi values 
+      for (Int_t p = 0; p < nPhi; p++) {
+       Float_t  minPhi    = p * fDeltaPhi;
+       Float_t  maxPhi    = minPhi + fDeltaPhi;
+       UShort_t minSector = UShort_t(minPhi / 360) * r->GetNSectors();
+       UShort_t maxSector = UShort_t(maxPhi / 360) * r->GetNSectors();
+       
+       AliDebug(10, Form(" Now in phi range %f, %f (sectors %d,%d)",
+                         minPhi, maxPhi, minSector, maxSector));
+       // Loop over relevant eta values 
+       for (Int_t e = nEta; e >= 0; --e) {
+         Float_t  maxEta   = etaIn  - sign * e * fDeltaEta;
+         Float_t  minEta   = maxEta - sign * fDeltaEta;
+         if (sign > 0)  minEta = TMath::Max(minEta, etaOut);
+         else           minEta = TMath::Min(minEta, etaOut);
+         Float_t  theta1   = 2 * TMath::ATan(TMath::Exp(-minEta));
+         Float_t  theta2   = 2 * TMath::ATan(TMath::Exp(-maxEta));
+         Float_t  minR     = TMath::Abs(realZ * TMath::Tan(theta2));
+         Float_t  maxR     = TMath::Abs(realZ * TMath::Tan(theta1));
+         UShort_t minStrip = UShort_t((etaIn - maxEta) * stripEta + 0.5);
+         UShort_t maxStrip = UShort_t((etaIn - minEta) * stripEta + 0.5);
+
+         AliDebug(10, Form("  Now in eta range %f, %f (strips %d, %d)\n"
+                           "    [radii %f, %f, thetas %f, %f, sign %d]", 
+                           minEta, maxEta, minStrip, maxStrip, 
+                           minR, maxR, theta1, theta2, sign));
+
+         // Count number of empty strips
+         Int_t   emptyStrips = 0;
+         for (Int_t sector = minSector; sector < maxSector; sector++) 
+           for (Int_t strip = minStrip; strip < maxStrip; strip++) 
+             if (fEmpty(sub->GetId() - 1, r->GetId(), sector, strip)) 
+               emptyStrips++;
+         
+         // The total number of strips 
+         Float_t nTotal = (maxSector - minSector) * (maxStrip - minStrip);
+         
+         // Log ratio of empty to total number of strips 
+         AliDebug(10, Form("Lambda= %d / %d = %f", 
+                           emptyStrips, nTotal, 
+                           Float_t(emptyStrips) / nTotal));
+         
+         Double_t lambda = (emptyStrips > 0 ? 
+                            - TMath::Log(Double_t(emptyStrips) / nTotal) :
+                            1);
+
+         // The reconstructed number of particles is then given by 
+         Int_t reconstructed = Int_t(lambda * nTotal + 0.5);
+           
+         // Add a AliFMDMultRegion to the reconstruction tree. 
+         new((*fMult)[fNMult])   
+           AliFMDMultRegion(sub->GetId(), r->GetId(),
+                            minSector, maxSector, minStrip, maxStrip,
+                            minEta, maxEta, minPhi, maxPhi,
+                            reconstructed, AliFMDMultRegion::kPoission);
+         fNMult++;
+       } // phi 
+      } // eta
+    } // ring 
+  } // detector 
+}
+
+
+//____________________________________________________________________
+// 
+// EOF
+//
diff --git a/FMD/AliFMDMultPoisson.h b/FMD/AliFMDMultPoisson.h
new file mode 100644 (file)
index 0000000..6d39331
--- /dev/null
@@ -0,0 +1,60 @@
+#ifndef ALIFMDMULTPOISSON_H
+#define ALIFMDMULTPOISSON_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
+ * reserved. 
+ *
+ * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
+ *
+ * See cxx source for full Copyright notice                               
+ */
+/* $Id$ */
+//____________________________________________________________________
+// 
+// Class to do multiplicity reconstruction using the Poisson method.
+// That is, we count the number of empty strips in a region, and
+// derive the charge particle multiplicity from that number. 
+// 
+
+#ifndef ALIFMDMULTALGORITHM_H
+# include "AliFMDMultAlgorithm.h"
+#endif
+#ifndef ALIFMDBOOLMAP_H
+# include "AliFMDBoolMap.h"
+#endif
+
+//____________________________________________________________________
+class AliFMDMultPoisson : public AliFMDMultAlgorithm
+{
+public:
+  AliFMDMultPoisson();
+  virtual ~AliFMDMultPoisson() {}
+  
+  virtual void PreEvent(TTree* treeR, Float_t ipZ);
+  virtual void ProcessDigit(AliFMDDigit* digit, 
+                           Float_t eta, 
+                           Float_t phi, 
+                           UShort_t counts);
+  virtual void PostEvent();
+  
+  void         SetDeltaEta(Float_t deta=.1)  { fDeltaEta = deta;  }
+  void         SetDeltaPhi(Float_t dphi=360) { fDeltaPhi = dphi;  } 
+  void         SetThreshold(UShort_t t=6)    { fThreshold = t; }
+protected:
+  AliFMDBoolMap fEmpty;          //! Map of empty channels
+  Float_t       fCurrentVertexZ; //! Current IP's Z-coordinate
+  Float_t       fDeltaEta;       // Bin size in eta
+  Float_t       fDeltaPhi;       // Bin size in phi
+  UShort_t      fThreshold;      // Threshold for Poisson recon.
+  
+  ClassDef(AliFMDMultPoisson, 0) // Poisson algorithm
+};
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+//   mode: C++
+// End:
+//
+// EOF
+//
similarity index 56%
rename from FMD/AliFMDParticles.cxx
rename to FMD/AliFMDMultRegion.cxx
index 88e5e74..d7c98eb 100644 (file)
 //  to fNumOfMaxRing and phi interval from fNumOfMinSector to
 //  fNumOfMaxSector
 //
-#include "AliFMDParticles.h"   // ALIFMDPARTICLES_H
-#include "Riostream.h"         // ROOT_Riostream
+#include "AliFMDMultRegion.h"  // ALIFMDPARTICLES_H
+#include <TString.h>            // ROOT_TString
+#include <Riostream.h>         // ROOT_Riostream
 
 //____________________________________________________________________
-ClassImp(AliFMDParticles)
+ClassImp(AliFMDMultRegion);
+
 
 //____________________________________________________________________
-AliFMDParticles::AliFMDParticles()
+AliFMDMultRegion::AliFMDMultRegion()
   : fDetector(0),
     fRing('\0'),
     fMinSector(0),
@@ -39,19 +41,18 @@ AliFMDParticles::AliFMDParticles()
     fMinEta(0),
     fMaxEta(0),
     fMinPhi(0),
-    fMaxPhi(0),
-    fParticles(0),
-    fMethod(kNaive)
+    fMaxPhi(0)
 {}
 
 //____________________________________________________________________
-AliFMDParticles::AliFMDParticles(UShort_t detector,  Char_t ring, 
-                                UShort_t minSector, UShort_t maxSector, 
-                                UShort_t minStrip,  UShort_t maxStrip, 
-                                Float_t  minEta,    Float_t  maxEta, 
-                                Float_t  minPhi,    Float_t  maxPhi,
-                                Float_t  particles, UShort_t method)
-  : fDetector(detector),
+AliFMDMultRegion::AliFMDMultRegion(UShort_t detector,  Char_t ring, 
+                                  UShort_t minSector, UShort_t maxSector, 
+                                  UShort_t minStrip,  UShort_t maxStrip, 
+                                  Float_t  minEta,    Float_t  maxEta, 
+                                  Float_t  minPhi,    Float_t  maxPhi,
+                                  Float_t  particles, UShort_t method)
+  : AliFMDMult(particles, method),
+    fDetector(detector),
     fRing(ring),
     fMinSector(minSector),
     fMaxSector(maxSector),
@@ -60,39 +61,36 @@ AliFMDParticles::AliFMDParticles(UShort_t detector,  Char_t ring,
     fMinEta(minEta),
     fMaxEta(maxEta),
     fMinPhi(minPhi),
-    fMaxPhi(maxPhi),
-    fParticles(particles),
-    fMethod(method)
-{
-  switch (fMethod) {
-  case kPoission: 
-  case kIterative: 
-  case kNaive:    
-    break;    
-  default:        
-    Warning("AliFMDParticles", "unknown method: %d", method);
-    break;
-  }
-}
+    fMaxPhi(maxPhi)
+{}
 
 
 //____________________________________________________________________
 void
-AliFMDParticles::Print(Option_t* /* opt*/) const
+AliFMDMultRegion::Print(Option_t* option) const
 {
-  cout << "FMD Reconstructed particles: " << fParticles << "\n" 
-       << "  Detector:      FMD" << fDetector << fRing << "\n"
-       << "  Sector range:  [" << fMinSector << "," << fMaxSector << "\n"
-       << "  Strip range:   [" << fMinStrip << "," << fMaxStrip << "\n"
-       << "  Eta range:     [" << fMinEta << "," << fMaxEta << "\n"
-       << "  Phi range:     [" << fMinPhi << "," << fMaxPhi << "\n"
-       << "  Method:        " << flush;
-  switch (fMethod) {
-  case kPoission:  cout << "Poission"  << endl; break;
-  case kIterative: cout << "Iterative" << endl; break;
-  case kNaive:     cout << "Naive"     << endl; break; 
-  default:         cout << "Unknown"   << endl; break;
-  }
+  // Print information 
+  // 
+  // Options:
+  //    D:           Detector (default)
+  //    S:           Sector range 
+  //    T:           Strip range 
+  //    E:           Eta range (default)
+  //    P:           Phi range (default)
+  //
+  TString opt(option);
+  cout << "FMD Reconstructed particles: " << fParticles << endl;
+  if (opt.Contains("D", TString::kIgnoreCase))
+    cout << "  Detector:      FMD" << fDetector << fRing << endl;
+  if (opt.Contains("S", TString::kIgnoreCase))
+    cout << "  Sector range:  [" << fMinSector << "," << fMaxSector << endl;
+  if (opt.Contains("T", TString::kIgnoreCase))
+    cout << "  Strip range:   [" << fMinStrip << "," << fMaxStrip << endl;
+  if (opt.Contains("E", TString::kIgnoreCase))
+    cout << "  Eta range:     [" << fMinEta << "," << fMaxEta << endl;
+  if (opt.Contains("P", TString::kIgnoreCase))
+    cout << "  Phi range:     [" << fMinPhi << "," << fMaxPhi << endl;
+  AliFMDMult::Print(option);
 }
 
     
diff --git a/FMD/AliFMDMultRegion.h b/FMD/AliFMDMultRegion.h
new file mode 100644 (file)
index 0000000..67e394a
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef ALIFMDMULTREGION_H
+#define ALIFMDMULTREGION_H
+
+/* Reconstracted Particles Class: has number of reconstructed
+ * particles in sectors from NumOfMinSector to NumberOfMaxSector()
+ * rings from NumOfMinRing to NumOfMaxRing for each FMDvolume
+ */
+#ifndef ALIFMDMULT_H
+# include "AliFMDMult.h"
+#endif
+
+class AliFMDMultRegion: public AliFMDMult
+{
+public:
+  AliFMDMultRegion();
+  AliFMDMultRegion (UShort_t detector,  Char_t ring, 
+                   UShort_t minSector, UShort_t maxSector, 
+                   UShort_t minStrip,  UShort_t maxStrip, 
+                   Float_t  minEta,    Float_t  maxEta, 
+                   Float_t  minPhi,    Float_t  maxPhi,
+                   Float_t  particles, UShort_t method);
+  virtual ~AliFMDMultRegion(){};
+
+  UShort_t     Detector() const        { return fDetector; }
+  Char_t       Ring() const            { return fRing; }
+  UShort_t     MinSector() const       { return fMinSector; }
+  UShort_t     MaxSector() const       { return fMaxSector; }
+  UShort_t     MinStrip() const        { return fMinStrip; }
+  UShort_t     MaxStrip() const        { return fMaxStrip; }
+  Float_t      MinEta() const          { return fMinEta; }
+  Float_t      MaxEta() const          { return fMaxEta; }
+  Float_t      MinPhi() const          { return fMinPhi; }
+  Float_t      MaxPhi() const          { return fMaxPhi; }
+  virtual void Print(Option_t* opt="") const;
+protected:
+  UShort_t fDetector;        // Detector #
+  Char_t   fRing;            // Ring ID
+  UShort_t fMinSector;       // First sector of this region
+  UShort_t fMaxSector;       // Last sector of this region
+  UShort_t fMinStrip;        // First strip of this region
+  UShort_t fMaxStrip;        // Second strip of this region  
+  Float_t  fMinEta;          // Least eta covered
+  Float_t  fMaxEta;          // Largest eta covered
+  Float_t  fMinPhi;          // Least phi covered
+  Float_t  fMaxPhi;          // Largest phi covered
+
+  ClassDef(AliFMDMultRegion,1) // Rec. Multiplicity in a eta,phi region
+};
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+//   mode: C++
+// End:
+//
+// EOF
+//
diff --git a/FMD/AliFMDMultStrip.cxx b/FMD/AliFMDMultStrip.cxx
new file mode 100644 (file)
index 0000000..976f595
--- /dev/null
@@ -0,0 +1,88 @@
+/**************************************************************************
+ * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+//____________________________________________________________________
+//
+//  Forward Multiplicity Detector have to be reconstructed number of
+//  particles in fixed pseudorapidity interval from fNumOfMinRing
+//  to fNumOfMaxRing and phi interval from fNumOfMinSector to
+//  fNumOfMaxSector
+//
+#include "AliFMDMultStrip.h"   // ALIFMDMULTSTRIP_H
+#include <TString.h>            // ROOT_TString
+#include <Riostream.h>         // ROOT_Riostream
+
+//____________________________________________________________________
+ClassImp(AliFMDMultStrip);
+
+
+//____________________________________________________________________
+AliFMDMultStrip::AliFMDMultStrip()
+  : fDetector(0),
+    fRing('\0'),
+    fSector(0),
+    fStrip(0),
+    fEta(0),
+    fPhi(0),
+    fEdep(0)
+{}
+
+//____________________________________________________________________
+AliFMDMultStrip::AliFMDMultStrip(UShort_t detector,  Char_t   ring, 
+                                UShort_t sector,    UShort_t strip,
+                                Float_t  eta,       Float_t  phi,
+                                Float_t  edep,      Float_t  particles, 
+                                UShort_t method)
+  : AliFMDMult(particles, method),
+    fDetector(detector),
+    fRing(ring),
+    fSector(sector),
+    fStrip(strip),
+    fEta(eta),
+    fPhi(phi),
+    fEdep(edep)
+{}
+
+
+//____________________________________________________________________
+void
+AliFMDMultStrip::Print(Option_t* option) const
+{
+  // Print information 
+  // 
+  // Options:
+  //    D:           Detector (default)
+  //    E:           Eta range (default)
+  //    P:           Phi range (default)
+  //
+  TString opt(option);
+  cout << "FMD Reconstructed particles: " << fParticles << endl;
+  if (opt.Contains("D", TString::kIgnoreCase))
+    cout << "  Detector:      FMD" << fDetector << fRing 
+        << "[" << fSector << "," << fStrip << "]" << endl;
+  if (opt.Contains("E", TString::kIgnoreCase))
+    cout << "  Eta range:     " << fEta << endl;
+  if (opt.Contains("P", TString::kIgnoreCase))
+    cout << "  Phi range:     " << fPhi << endl;
+  AliFMDMult::Print(option);
+}
+
+    
+//____________________________________________________________________
+//
+// EOF
+//
diff --git a/FMD/AliFMDMultStrip.h b/FMD/AliFMDMultStrip.h
new file mode 100644 (file)
index 0000000..341fef3
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef ALIFMDMULTSTRIP_H
+#define ALIFMDMULTSTRIP_H
+
+/* Reconstracted Particles Class: has number of reconstructed
+ * particles in sectors from NumOfMinSector to NumberOfMaxSector()
+ * rings from NumOfMinRing to NumOfMaxRing for each FMDvolume
+ */
+#ifndef ALIFMDMULT_H
+# include "AliFMDMult.h"
+#endif
+
+class AliFMDMultStrip: public AliFMDMult
+{
+public:
+  AliFMDMultStrip();
+  AliFMDMultStrip (UShort_t detector,  Char_t   ring, 
+                  UShort_t sector,    UShort_t strip, 
+                  Float_t  eta,       Float_t  phi,
+                  Float_t  edep,      Float_t  particles, 
+                  UShort_t method);
+  virtual ~AliFMDMultStrip(){};
+
+  UShort_t     Detector() const        { return fDetector; }
+  Char_t       Ring() const            { return fRing; }
+  UShort_t     Sector() const          { return fSector; }
+  UShort_t     Strip() const           { return fStrip; }
+  Float_t      Eta() const             { return fEta; }
+  Float_t      Phi() const             { return fPhi; }
+  Float_t      Edep() const            { return fEdep; }
+  virtual void Print(Option_t* opt="") const;
+protected:
+  UShort_t fDetector;        // Detector #
+  Char_t   fRing;            // Ring ID
+  UShort_t fSector;          // Sector #
+  UShort_t fStrip;           // Strip # 
+  Float_t  fEta;             // Eta value 
+  Float_t  fPhi;             // Phi value
+  Float_t  fEdep;            // Energy deposited 
+
+  ClassDef(AliFMDMultStrip,1) // Rec. Multiplicity in a strip
+};
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+//   mode: C++
+// End:
+//
+// EOF
+//
diff --git a/FMD/AliFMDNaiiveAlgorithm.cxx b/FMD/AliFMDNaiiveAlgorithm.cxx
deleted file mode 100644 (file)
index c56b33e..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-//____________________________________________________________________
-// 
-// Base class for FMD naiive algorithms. 
-//
-// Derived classes will implement various ways of reconstructing the
-// charge particle multiplicity in the FMD.  
-// 
-#include "AliFMDNaiiveAlgorithm.h"     // ALIFMDNAIIVEALGORITHM_H
-#include "AliFMDDigit.h"               // ALIFMDDIGIT_H
-
-//____________________________________________________________________
-ClassImp(AliFMDNaiiveAlgorithm);
-
-//____________________________________________________________________
-AliFMDNaiiveAlgorithm::AliFMDNaiiveAlgorithm()
-  : AliFMDReconstructionAlgorithm("Naiive", "Naiive")
-{}
-
-
-//____________________________________________________________________
-void
-AliFMDNaiiveAlgorithm::Reset() 
-{
-  // Reset internal data 
-  fTotal = 0;
-  fEdep.Clear(0);
-  fMultiplicity.Clear(0);
-}
-
-//____________________________________________________________________
-void
-AliFMDNaiiveAlgorithm::ProcessDigit(AliFMDDigit* digit, 
-                                   Float_t eta, 
-                                   Float_t phi, 
-                                   UShort_t count)
-{
-  // Process one digit. 
-  // 
-  // Parameters: 
-  //    
-  //   digit           Digit to process 
-  //   eta              Pseudo-rapidity of digit
-  //   phi              Azimuthal angle of digit
-  //   count            ADC (corrected for the pedestal)
-  //
-  // This calculates the energy deposited and the number of MIPs that
-  // this energy deposition corresponds to 
-  // 
-  //   EnergyDeposited = cos(theta) * gain * count 
-  //   Multiplicity    = EnergyDeposited / EnergyDepositedPerMIP
-  // 
-  // where gain is a conversion factor from number of counts to an
-  // energy:
-  //          Pre_Amp_MIP_Range           1
-  //   gain = ----------------- * ---------------------
-  //          ADC_channel_size    EnergyDepositedPerMip
-  // 
-  // and theta is the particles incident angle on the strip, given by 
-  //
-  //   theta = 2 * atan  * exp(-eta)
-  //
-  // The cos(theta) factor corrects for the fact that the particle may
-  // traverse the strip at an angle, and therefor have a longer flight
-  // length, leading to a larger energy deposition. 
-  // 
-  if (!digit) return;
-  Double_t theta = 2 * TMath::Tan(TMath::Exp(- eta));
-  Double_t edep  = TMath::Cos(theta) * fGain * count;
-  Double_t mult  = edep / fEdepMip;
-  fEdep(digit->Detector() - 1, digit->Ring(), 
-       digit->Setctor(), digit->Strip()) = edep;
-  fMultiplicity(digit->Detector() - 1, digit->Ring(), 
-               digit->Setctor(), digit->Strip()) = mult;
-}
-
-
-//____________________________________________________________________
-// 
-// EOF
-//
diff --git a/FMD/AliFMDParticles.h b/FMD/AliFMDParticles.h
deleted file mode 100644 (file)
index a52517f..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef ALIFMDPARTICLES_H
-#define ALIFMDPARTICLES_H
-
-/* Reconstracted Particles Class: has number of reconstructed
- * particles in sectors from NumOfMinSector to NumberOfMaxSector()
- * rings from NumOfMinRing to NumOfMaxRing for each FMDvolume
- */
-#ifndef ROOT_TObject
-# include <TObject.h>
-#endif
-
-class AliFMDParticles: public TObject
-{
-public:
-  enum EMethod {
-    kPoission, 
-    kIterative, 
-    kNaive
-  };
-  
-  AliFMDParticles();
-  AliFMDParticles (UShort_t detector,  Char_t ring, 
-                  UShort_t minSector, UShort_t maxSector, 
-                  UShort_t minStrip,  UShort_t maxStrip, 
-                  Float_t  minEta,    Float_t  maxEta, 
-                  Float_t  minPhi,    Float_t  maxPhi,
-                  Float_t  particles, UShort_t method);
-  virtual ~AliFMDParticles(){};
-
-  UShort_t Detector() const        { return fDetector; }
-  Char_t   Ring() const            { return fRing; }
-  UShort_t MinSector() const       { return fMinSector; }
-  UShort_t MaxSector() const       { return fMaxSector; }
-  UShort_t MinStrip() const        { return fMinStrip; }
-  UShort_t MaxStrip() const        { return fMaxStrip; }
-  Float_t  MinEta() const          { return fMinEta; }
-  Float_t  MaxEta() const          { return fMaxEta; }
-  Float_t  MinPhi() const          { return fMinPhi; }
-  Float_t  MaxPhi() const          { return fMaxPhi; }
-  Float_t  Particles() const       { return fParticles; }
-  UShort_t Method() const          { return fMethod; }
-  
-  virtual void Print(Option_t* opt="") const;
-protected:
-  UShort_t fDetector;        // Detector #
-  Char_t   fRing;            // Ring ID
-  UShort_t fMinSector;       // First sector of this region
-  UShort_t fMaxSector;       // Last sector of this region
-  UShort_t fMinStrip;        // First strip of this region
-  UShort_t fMaxStrip;        // Second strip of this region  
-  Float_t  fMinEta;          // Least eta covered
-  Float_t  fMaxEta;          // Largest eta covered
-  Float_t  fMinPhi;          // Least phi covered
-  Float_t  fMaxPhi;          // Largest phi covered
-  Float_t  fParticles;       // Number of particles 
-  UShort_t fMethod;          // Method use to get fParticles
-
-  ClassDef(AliFMDParticles,2) // Reconstructed # or particles in a eta,phi region
-};
-#endif
-//____________________________________________________________________
-//
-// Local Variables:
-//   mode: C++
-// End:
-//
-// EOF
-//
diff --git a/FMD/AliFMDPoissonAlgorithm.h b/FMD/AliFMDPoissonAlgorithm.h
deleted file mode 100644 (file)
index 265f950..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef ALIFMDPOISSONALGORITHM_H
-#define ALIFMDPOISSONALGORITHM_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
- * reserved. 
- *
- * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
- *
- * See cxx source for full Copyright notice                               
- */
-/* $Id$ */
-//____________________________________________________________________
-// 
-// Class to do multiplicity reconstruction using the Poisson method.
-// That is, we count the number of empty strips in a region, and
-// derive the charge particle multiplicity from that number. 
-// 
-
-#ifndef ROOT_TTask
-# include <TTask.h>
-#endif
-
-//____________________________________________________________________
-class AliFMDDigit;
-
-//____________________________________________________________________
-class AliFMDPoissonAlgorithm : public TNamed
-{
-public:
-  AliFMDPoissonAlgorithm();
-  virtual ~AliFMDPoissonAlgorithm() {}
-  
-  virtual void Reset();
-  virtual void ProcessDigit(AliFMDDigit* digit, Float_t ipZ);
-  
-protected:
-  ClassDef(AliFMDPoissonAlgorithm, 0) // Poisson algorithm
-};
-
-#endif
-//____________________________________________________________________
-//
-// Local Variables:
-//   mode: C++
-// End:
-//
-// EOF
-//
index 022f1e8..ecd3eaf 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef ALIFMDPOLYGON_H
+#define ALIFMDPOLYGON_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
  * reserved. 
  *
@@ -5,8 +7,6 @@
  *
  * See cxx source for full Copyright notice                               
  */
-#ifndef ALIFMDPOLYGON_H
-#define ALIFMDPOLYGON_H
 #ifndef ROOT_TVector2
 # include <TVector2.h>
 #endif
index 36ea8b9..08b08a2 100644 (file)
 //
 // Class to read ADC values from a AliRawReader object. 
 //
-#include "AliLog.h"            // ALILOG_H
+#include <AliLog.h>            // ALILOG_H
 #include "AliFMD.h"            // ALIFMD_H
 #include "AliFMDDigit.h"       // ALIFMDDIGIT_H
 #include "AliFMDRawStream.h"   // ALIFMDRAWSTREAM_H 
 #include "AliRawReader.h"      // ALIRAWREADER_H 
 #include "AliFMDRawReader.h"   // ALIFMDRAWREADER_H 
-#include "TArrayI.h"           // ROOT_TArrayI
+#include <TArrayI.h>           // ROOT_TArrayI
 // #include <TClonesArray.h>   // ROOT_TClonesArray
 
 //____________________________________________________________________
@@ -37,7 +37,8 @@ AliFMDRawReader::AliFMDRawReader(AliFMD* fmd, AliRawReader* reader)
     fFMD(fmd),
     fReader(reader)
 {
-  SetSampleRate();
+  // Default CTOR
+  SetSampleRate(fmd->GetSampleRate());
 }
 
 
@@ -45,6 +46,7 @@ AliFMDRawReader::AliFMDRawReader(AliFMD* fmd, AliRawReader* reader)
 void
 AliFMDRawReader::Exec(Option_t*) 
 {
+  // Read raw data into the digits array
   if (!fReader->ReadHeader()) {
     Error("ReadAdcs", "Couldn't read header");
     return;
index 0a57d33..d698fbc 100644 (file)
@@ -21,7 +21,7 @@
 // 
 //
 #include "AliFMDRawStream.h"           // ALIFMDRAWSTREAM_H
-#include "AliRawReader.h"              // ALIRAWREADER_H
+#include <AliRawReader.h>              // ALIRAWREADER_H
 
 //____________________________________________________________________
 ClassImp(AliFMDRawStream);
index 3c6222c..97b7352 100644 (file)
 //
 // Class to write ADC values to a raw data file
 //
-#include "AliLog.h"            // ALILOG_H
+#include <AliLog.h>            // ALILOG_H
+#include <AliLoader.h>         // ALILOADER_H
+#include <AliAltroBuffer.h>     // ALIALTROBUFFER_H
 #include "AliFMD.h"            // ALIFMD_H
 #include "AliFMDDigit.h"       // ALIFMDDIGIT_H
 #include "AliFMDRawWriter.h"   // ALIFMDRAWREADER_H 
-#include "AliAltroBuffer.h"     // ALIALTROBUFFER_H
-#include "AliLoader.h"         // ALILOADER_H
-#include "TArrayI.h"           // ROOT_TArrayI
+#include <TArrayI.h>           // ROOT_TArrayI
 #include <TClonesArray.h>      // ROOT_TClonesArray
 
 //____________________________________________________________________
index b634193..49ea78a 100644 (file)
 //
 //____________________________________________________________________
 
-#include "AliFMD.h"                            // ALIFMD_H
-#include "AliFMDDigit.h"                       // ALIFMDDIGIT_H
-#include "AliFMDParticles.h"                   // ALIFMDPARTICLES_H
-#include "AliFMDReconstructor.h"               // ALIFMDRECONSTRUCTOR_H
-#include "AliAltroBuffer.h"                    // ALIALTROBUFFER_H
-#include "AliLog.h"                            // ALILOG_H
-#include "AliRun.h"                            // ALIRUN_H
-#include "AliRunLoader.h"                      // ALIRUNLOADER_H
-#include "AliLoader.h"                         // ALILOADER_H
-#include "AliHeader.h"                         // ALIHEADER_H
-#include "AliGenEventHeader.h"                 // ALIGENEVENTHEADER_H
-#include "AliFMDRawStream.h"                   // ALIFMDRAWSTREAM_H
-#include "AliFMDRawReader.h"                   // ALIFMDRAWREADER_H
-#include "AliRawReader.h"                      // ALIRAWREADER_H
-#include "AliFMDReconstructionAlgorithm.h"     // ALIFMDRECONSTRUCTIONALGORITHM_H
+#include <AliLog.h>                        // ALILOG_H
+#include <AliRun.h>                        // ALIRUN_H
+#include <AliRunLoader.h>                  // ALIRUNLOADER_H
+#include <AliLoader.h>                     // ALILOADER_H
+#include <AliHeader.h>                     // ALIHEADER_H
+#include <AliRawReader.h>                  // ALIRAWREADER_H
+#include <AliGenEventHeader.h>             // ALIGENEVENTHEADER_H
+#include "AliFMD.h"                        // ALIFMD_H
+#include "AliFMDDigit.h"                   // ALIFMDDIGIT_H
+#include "AliFMDReconstructor.h"           // ALIFMDRECONSTRUCTOR_H
+#include "AliFMDRawStream.h"               // ALIFMDRAWSTREAM_H
+#include "AliFMDRawReader.h"               // ALIFMDRAWREADER_H
+#include "AliFMDMultAlgorithm.h"          // ALIFMDMULTALGORITHM_H
+#include "AliFMDMultPoisson.h"            // ALIFMDMULTPOISSON_H
+#include "AliFMDMultNaiive.h"             // ALIFMDMULTNAIIVE_H
 
 //____________________________________________________________________
 ClassImp(AliFMDReconstructor);
@@ -65,46 +65,41 @@ ClassImp(AliFMDReconstructor);
 //____________________________________________________________________
 AliFMDReconstructor::AliFMDReconstructor() 
   : AliReconstructor(),
-    fDeltaEta(0), 
-    fDeltaPhi(0), 
-    fThreshold(0),
     fPedestal(0), 
     fPedestalWidth(0),
     fPedestalFactor(0)
 {
   // Make a new FMD reconstructor object - default CTOR.
-  SetDeltaEta();
-  SetDeltaPhi();
-  SetThreshold();
   SetPedestal();
 
-  fParticles = new TClonesArray("AliFMDParticles", 1000);
   fFMDLoader = 0;
   fRunLoader = 0;
   fFMD       = 0;
+  fAlgorithms.Add(new AliFMDMultNaiive);
+  fAlgorithms.Add(new AliFMDMultPoisson);
 }
   
 
 //____________________________________________________________________
 AliFMDReconstructor::AliFMDReconstructor(const AliFMDReconstructor& other) 
   : AliReconstructor(),
-    fDeltaEta(0), 
-    fDeltaPhi(0), 
-    fThreshold(0),
     fPedestal(0), 
     fPedestalWidth(0),
     fPedestalFactor(0)
 {
-  // Make a new FMD reconstructor object - default CTOR.
-  SetDeltaEta(other.fDeltaEta);
-  SetDeltaPhi(other.fDeltaPhi);
-  SetThreshold(other.fThreshold);
+  // Copy constructor 
   SetPedestal(other.fPedestal, other.fPedestalWidth, other.fPedestalFactor);
 
-  // fParticles = new TClonesArray("AliFMDParticles", 1000);
   fFMDLoader = other.fFMDLoader;
   fRunLoader = other.fRunLoader;
   fFMD       = other.fFMD;
+  
+  fAlgorithms.Delete();
+  TIter next(&(other.fAlgorithms));
+  AliFMDMultAlgorithm* algorithm = 0;
+  while ((algorithm = static_cast<AliFMDMultAlgorithm*>(next()))) 
+    fAlgorithms.Add(algorithm);
+  fAlgorithms.SetOwner(kFALSE);
 }
   
 
@@ -112,19 +107,29 @@ AliFMDReconstructor::AliFMDReconstructor(const AliFMDReconstructor& other)
 AliFMDReconstructor&
 AliFMDReconstructor::operator=(const AliFMDReconstructor& other) 
 {
-  // Make a new FMD reconstructor object - default CTOR.
-  SetDeltaEta(other.fDeltaEta);
-  SetDeltaPhi(other.fDeltaPhi);
-  SetThreshold(other.fThreshold);
-  SetPedestal(other.fPedestal, other.fPedestalWidth);
+  // Assignment operator
+  SetPedestal(other.fPedestal, other.fPedestalWidth, other.fPedestalFactor);
 
-  // fParticles = new TClonesArray("AliFMDParticles", 1000);
   fFMDLoader = other.fFMDLoader;
   fRunLoader = other.fRunLoader;
   fFMD       = other.fFMD;
 
+  fAlgorithms.Delete();
+  TIter next(&(other.fAlgorithms));
+  AliFMDMultAlgorithm* algorithm = 0;
+  while ((algorithm = static_cast<AliFMDMultAlgorithm*>(next()))) 
+    fAlgorithms.Add(algorithm);
+  fAlgorithms.SetOwner(kFALSE);
+
   return *this;
 }
+
+//____________________________________________________________________
+AliFMDReconstructor::~AliFMDReconstructor() 
+{
+  // Destructor 
+  fAlgorithms.Delete();
+}
   
 //____________________________________________________________________
 void 
@@ -151,7 +156,6 @@ AliFMDReconstructor::Reconstruct(AliRunLoader* runLoader,
   //
   // The reconstruction method is choosen based on the number of empty
   // strips. 
-  fParticles->Clear();
   if (!runLoader) {
     Error("Exec","Run Loader loader is NULL - Session not opened");
     return;
@@ -175,6 +179,11 @@ AliFMDReconstructor::Reconstruct(AliRunLoader* runLoader,
 
   if (!fRunLoader->TreeE())     fRunLoader->LoadHeader();
 
+  TIter next(&fAlgorithms);
+  AliFMDMultAlgorithm* algorithm = 0;
+  while ((algorithm = static_cast<AliFMDMultAlgorithm*>(next()))) 
+    algorithm->PreRun(fFMD);
+
   if (rawReader) {
     Int_t event = 0;
     while (rawReader->NextEvent()) {
@@ -188,6 +197,10 @@ AliFMDReconstructor::Reconstruct(AliRunLoader* runLoader,
       ProcessEvent(event, 0);
   }
 
+  next.Reset();
+  algorithm = 0;
+  while ((algorithm = static_cast<AliFMDMultAlgorithm*>(next()))) 
+    algorithm->PostRun();
 
   fFMDLoader->UnloadRecPoints();
   fFMDLoader = 0;
@@ -235,10 +248,6 @@ AliFMDReconstructor::ProcessEvent(Int_t event,
   // If the recontruction tree isn't loaded, load it
   if(fFMDLoader->TreeR()==0) fFMDLoader->MakeTree("R");
   
-  //Make branches to hold the reconstructed particles 
-  const Int_t kBufferSize = 16000;
-  fFMDLoader->TreeR()->Branch("FMD", &fParticles, kBufferSize);
-
   // Load or recreate the digits 
   if (fFMDLoader->LoadDigits((reader ? "UPDATE" : "READ"))) {
     if (!reader) {
@@ -283,15 +292,15 @@ AliFMDReconstructor::ProcessEvent(Int_t event,
   }
   
   TIter next(&fAlgorithms);
-  AliFMDReconstructionAlgorithm* algorithm = 0;
-  while ((algorithm = static_cast<AliFMDReconstructionAlgorithm*>(next()))) 
-    algorithm->PreEvent();
+  AliFMDMultAlgorithm* algorithm = 0;
+  while ((algorithm = static_cast<AliFMDMultAlgorithm*>(next()))) 
+    algorithm->PreEvent(fFMDLoader->TreeR(), fCurrentVertex);
 
   ProcessDigits(digits);
 
   next.Reset();
   algorithm = 0;
-  while ((algorithm = static_cast<AliFMDReconstructionAlgorithm*>(next()))) 
+  while ((algorithm = static_cast<AliFMDMultAlgorithm*>(next()))) 
     algorithm->PostEvent();
   
   if (reader) {
@@ -361,8 +370,9 @@ AliFMDReconstructor::ProcessDigits(TClonesArray* digits) const
     }
     
     Float_t  realZ    = fCurrentVertex + ringZ;
-    Float_t  stripR   = ((ring->GetHighR() - ring->GetLowR()) / ring->GetNStrips() 
-                        * (digit->Strip() + .5) + ring->GetLowR());
+    Float_t  stripR   = ((ring->GetHighR() - ring->GetLowR()) 
+                        / ring->GetNStrips() * (digit->Strip() + .5) 
+                        + ring->GetLowR());
     Float_t  theta    = TMath::ATan2(stripR, realZ);
     Float_t  phi      = (2 * TMath::Pi() / ring->GetNSectors() 
                         * (digit->Sector() + .5));
@@ -370,128 +380,12 @@ AliFMDReconstructor::ProcessDigits(TClonesArray* digits) const
     UShort_t counts   = SubtractPedestal(digit);
     
     TIter next(&fAlgorithms);
-    AliFMDReconstructionAlgorithm* algorithm = 0;
-    while ((algorithm = static_cast<AliFMDReconstructionAlgorithm*>(next()))) 
+    AliFMDMultAlgorithm* algorithm = 0;
+    while ((algorithm = static_cast<AliFMDMultAlgorithm*>(next()))) 
       algorithm->ProcessDigit(digit, eta, phi, counts);
   }
 }
-
       
-//____________________________________________________________________
-void
-AliFMDReconstructor::ReconstructFromCache() const
-{
-  // Based on the information in the cache, do the reconstruction. 
-  Int_t nRecon = 0;
-  // Loop over the detectors 
-  for (Int_t i = 1; i <= 3; i++) {
-    AliFMDSubDetector* sub = 0;
-    switch (i) {
-    case 1: sub = fFMD->GetFMD1(); break;
-    case 2: sub = fFMD->GetFMD2(); break;
-    case 3: sub = fFMD->GetFMD3(); break;
-    }
-    if (!sub) continue;
-       
-    // Loop over the rings in the detector
-    for (Int_t j = 0; j < 2; j++) {
-      Float_t     rZ = 0;
-      AliFMDRing* r  = 0;
-      switch (j) {
-      case 0: r  = sub->GetInner(); rZ = sub->GetInnerZ(); break;
-      case 1: r  = sub->GetOuter(); rZ = sub->GetOuterZ(); break;
-      }
-      if (!r) continue;
-      
-      // Calculate low/high theta and eta 
-      // FIXME: Is this right? 
-      Float_t realZ    = fCurrentVertex + rZ;
-      Float_t thetaOut = TMath::ATan2(r->GetHighR(), realZ);
-      Float_t thetaIn  = TMath::ATan2(r->GetLowR(), realZ);
-      Float_t etaOut   = - TMath::Log(TMath::Tan(thetaOut / 2));
-      Float_t etaIn    = - TMath::Log(TMath::Tan(thetaIn / 2));
-      if (TMath::Abs(etaOut) > TMath::Abs(etaIn)) {
-       Float_t tmp = etaIn;
-       etaIn       = etaOut;
-       etaOut      = tmp;
-      }
-
-      //-------------------------------------------------------------
-      //
-      // Here starts poisson method 
-      //
-      // Calculate eta step per strip, number of eta steps, number of
-      // phi steps, and check the sign of the eta increment 
-      Float_t stripEta = (Float_t(r->GetNStrips()) / (etaIn - etaOut));
-      Int_t   nEta     = Int_t(TMath::Abs(etaIn - etaOut) / fDeltaEta); 
-      Int_t   nPhi     = Int_t(360. / fDeltaPhi);
-      Float_t sign     = TMath::Sign(Float_t(1.), etaIn);
-
-      AliDebug(10, Form("FMD%d%c Eta range: %f, %f %d Phi steps",
-                       sub->GetId(), r->GetId(), etaOut, etaIn, nPhi));
-
-      // Loop over relevant phi values 
-      for (Int_t p = 0; p < nPhi; p++) {
-       Float_t  minPhi    = p * fDeltaPhi;
-       Float_t  maxPhi    = minPhi + fDeltaPhi;
-       UShort_t minSector = UShort_t(minPhi / 360) * r->GetNSectors();
-       UShort_t maxSector = UShort_t(maxPhi / 360) * r->GetNSectors();
-       
-       AliDebug(10, Form(" Now in phi range %f, %f (sectors %d,%d)",
-                         minPhi, maxPhi, minSector, maxSector));
-       // Loop over relevant eta values 
-       for (Int_t e = nEta; e >= 0; --e) {
-         Float_t  maxEta   = etaIn  - sign * e * fDeltaEta;
-         Float_t  minEta   = maxEta - sign * fDeltaEta;
-         if (sign > 0)  minEta = TMath::Max(minEta, etaOut);
-         else           minEta = TMath::Min(minEta, etaOut);
-         Float_t  theta1   = 2 * TMath::ATan(TMath::Exp(-minEta));
-         Float_t  theta2   = 2 * TMath::ATan(TMath::Exp(-maxEta));
-         Float_t  minR     = TMath::Abs(realZ * TMath::Tan(theta2));
-         Float_t  maxR     = TMath::Abs(realZ * TMath::Tan(theta1));
-         UShort_t minStrip = UShort_t((etaIn - maxEta) * stripEta + 0.5);
-         UShort_t maxStrip = UShort_t((etaIn - minEta) * stripEta + 0.5);
-
-         AliDebug(10, Form("  Now in eta range %f, %f (strips %d, %d)\n"
-                           "    [radii %f, %f, thetas %f, %f, sign %d]", 
-                           minEta, maxEta, minStrip, maxStrip, 
-                           minR, maxR, theta1, theta2, sign));
-
-         // Count number of empty strips
-         Int_t   emptyStrips = 0;
-         for (Int_t sector = minSector; sector < maxSector; sector++) 
-           for (Int_t strip = minStrip; strip < maxStrip; strip++) emptyStrips++;
-         // if (fAdcs(sub->GetId() - 1, r->GetId(), sector, strip) 
-         //     < fThreshold) emptyStrips++;
-         
-         // The total number of strips 
-         Float_t nTotal = (maxSector - minSector) * (maxStrip - minStrip);
-         
-         // Log ratio of empty to total number of strips 
-         AliDebug(10, Form("Lambda= %d / %d = %f", 
-                           emptyStrips, nTotal, 
-                           Float_t(emptyStrips) / nTotal));
-         
-         Double_t lambda = (emptyStrips > 0 ? 
-                            - TMath::Log(Double_t(emptyStrips) / nTotal) :
-                            1);
-
-         // The reconstructed number of particles is then given by 
-         Int_t reconstructed = Int_t(lambda * nTotal + 0.5);
-           
-         // Add a AliFMDParticles to the reconstruction tree. 
-         new((*fParticles)[nRecon])   
-           AliFMDParticles(sub->GetId(), r->GetId(),
-                           minSector, maxSector, minStrip, maxStrip,
-                           minEta, maxEta, minPhi, maxPhi,
-                           reconstructed, AliFMDParticles::kPoission);
-         nRecon++;
-       } // phi 
-      } // eta
-    } // ring 
-  } // detector 
-}
-
  
 //____________________________________________________________________
 void 
index a36e7cb..0555df2 100644 (file)
@@ -35,9 +35,6 @@
 #ifndef ROOT_TObjArray
 # include <TObjArray.h>
 #endif
-// #ifndef ALIFMDUSHORTMAP_H
-// # include <AliFMDUShortMap.h>
-// #endif
 
 //____________________________________________________________________
 class TClonesArray;
@@ -47,21 +44,15 @@ class AliRunLoader;
 class AliFMDDigit;
 class AliRawReader;
 
-// typedef AliFMDUShortMap AliFMDAdcMap;
-
-
 //____________________________________________________________________
 class AliFMDReconstructor: public AliReconstructor 
 {
 public:
   AliFMDReconstructor();
   AliFMDReconstructor(const AliFMDReconstructor& other);
-  virtual ~AliFMDReconstructor() {}
+  virtual ~AliFMDReconstructor();
   AliFMDReconstructor& operator=(const AliFMDReconstructor& other);
 
-  void         SetDeltaEta(Float_t deta=.1)  { fDeltaEta = deta;  }
-  void         SetDeltaPhi(Float_t dphi=360) { fDeltaPhi = dphi;  } 
-  void         SetThreshold(UShort_t t=6)    { fThreshold = t; }
   void         SetPedestal(Float_t mean=10, Float_t width=1, Float_t f=3);
      
   virtual void Reconstruct(AliRunLoader* runLoader) const;
@@ -74,31 +65,17 @@ protected:
                                AliRawReader* rawReader) const;
   virtual void     ProcessDigits(TClonesArray* digits) const;
   virtual UShort_t SubtractPedestal(AliFMDDigit* digit) const;
-  virtual void     ReconstructFromCache() const;
 
-  mutable AliRunLoader* fRunLoader;  // Run loader 
-  mutable AliLoader*    fFMDLoader;  // FMD specific loader 
-  mutable TClonesArray* fParticles;  // Array of particles 
-  mutable AliFMD*       fFMD;        // Pointer to FMD manager 
+  mutable AliRunLoader* fRunLoader;  //! Run loader 
+  mutable AliLoader*    fFMDLoader;  //! FMD specific loader 
+  mutable AliFMD*       fFMD;        //! Pointer to FMD manager 
   
   TObjArray            fAlgorithms;    // Array of algorithms
-  Float_t               fDeltaEta;      // Bin size in eta
-  Float_t               fDeltaPhi;      // Bin size in phi
-  UShort_t              fThreshold;     // Threshold for Poisson recon.
   Float_t               fPedestal;      // Pedestal to subtract
   Float_t               fPedestalWidth; // Width of pedestal
   Float_t               fPedestalFactor;// Number of pedestal widths 
-  mutable Int_t         fEmptyStrips;   // Number of empty strips
-  mutable Int_t         fTotalStrips;   // Total number of strips 
   mutable Float_t       fCurrentVertex; // Z-coordinate of primary vertex
   
-  enum { 
-    kMaxDetectors = 3,                  // Maximum number of sub-det.
-    kMaxRings     = 2,                  // Maximum number of rings
-    kMaxSectors   = 40,                 // Maximum number of sectors
-    kMaxStrips    = 512                 // Maximum number of strips
-  };
-  
   ClassDef(AliFMDReconstructor, 0)  // class for the FMD reconstruction
 }; 
 #endif
index 34107fd..e075353 100644 (file)
 // Latest changes by Christian Holm Christensen
 //
 
-#include <math.h>
-
+#include <AliLog.h>            // ALILOG_H
 #include "AliFMDRing.h"                // ALIFMDRING_H
-#include "AliLog.h"            // ALILOG_H
-#include "TMath.h"             // ROOT_TMath
-#include "TH2.h"               // ROOT_TH2
-#include "TVirtualMC.h"                // ROOT_TVirtualMC
-#include "TVector2.h"          // ROOT_TVector2
-#include "TBrowser.h"          // ROOT_TBrowser
-#include "TString.h"           // ROOT_TString
-#include "TArc.h"              // ROOT_TArc
-#include "TObjArray.h"         // ROOT_TObjArray
-#include "TXTRU.h"             // ROOT_TXTRU
-#include "TNode.h"             // ROOT_TNode
-#include "TRotMatrix.h"                // ROOT_TRotMatrix
-#include "TList.h"             // ROOT_TList
+#include <TMath.h>             // ROOT_TMath
+#include <TH2.h>               // ROOT_TH2
+#include <TVirtualMC.h>                // ROOT_TVirtualMC
+#include <TVector2.h>          // ROOT_TVector2
+#include <TBrowser.h>          // ROOT_TBrowser
+#include <TString.h>           // ROOT_TString
+#include <TArc.h>              // ROOT_TArc
+#include <TObjArray.h>         // ROOT_TObjArray
+#include <TXTRU.h>             // ROOT_TXTRU
+#include <TNode.h>             // ROOT_TNode
+#include <TRotMatrix.h>                // ROOT_TRotMatrix
+#include <TList.h>             // ROOT_TList
 
 const Char_t* AliFMDRing::fgkRingFormat         = "FRG%c";
 const Char_t* AliFMDRing::fgkVirtualFormat      = "FV%c%c";
@@ -221,7 +219,7 @@ AliFMDRing::SetupCoordinates()
   double xD        = fLowR + TMath::Sqrt(r2 - tanTheta2 * lr2);
   double xD2       = TMath::Power(xD,2);
   //double xD_2      = fLowR - TMath::Sqrt(r2 - tanTheta2 * lr2);
-  double yB        = sqrt(r2 - hr2 + 2 * fHighR * xD - xD2);
+  double yB        = TMath::Sqrt(r2 - hr2 + 2 * fHighR * xD - xD2);
   double xC        = ((xD + TMath::Sqrt(-tanTheta2 * xD2 + r2 
                                        + r2 * tanTheta2)) 
                       / (1 + tanTheta2));
index bc87f76..29fd044 100644 (file)
 
 #include "AliFMDSubDetector.h" // ALIFMDSUBDETECTOR_H
 #include "AliFMDRing.h"                // ALIFMDRING_H
-#include "AliLog.h"            // ALILOG_H
-#include "TVirtualMC.h"                // ROOT_TVirtualMC
-#include "TList.h"             // ROOT_TList
-#include "TString.h"           // ROOT_TString
+#include <AliLog.h>            // ALILOG_H
+#include <TVirtualMC.h>                // ROOT_TVirtualMC
+#include <TList.h>             // ROOT_TList
+#include <TString.h>           // ROOT_TString
 
 ClassImp(AliFMDSubDetector);
 
index f7149ac..17e7ca8 100644 (file)
 //
 // See also the class AliFMD for a more detailed explanation of the
 // various componets. 
-#include "TVirtualMC.h"                // ROOT_TVirtualMC
+#include <TVirtualMC.h>                // ROOT_TVirtualMC
+#include <AliRun.h>            // ALIRUN_H
+#include <AliMC.h>             // ALIMC_H
+#include <AliLog.h>            // ALILOG_H
 #include "AliFMDv1.h"          // ALIFMDV1_H
-#include "AliRun.h"            // ALIRUN_H
-#include "AliMC.h"             // ALIMC_H
-#include "AliLog.h"            // ALILOG_H
 
 //____________________________________________________________________
 ClassImp(AliFMDv1);
diff --git a/FMD/Digitize.C b/FMD/Digitize.C
deleted file mode 100644 (file)
index 3992548..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-// Script to do test the FMD digitization class. 
-void 
-Digitize() 
-{
-  // Dynamically link some shared libs
-  if (gClassTable->GetID("AliRun") < 0) {
-    gROOT->LoadMacro("loadlibs.C");
-    loadlibs();
-  }
-  if (gAlice) {
-    delete gAlice;
-    gAlice = 0;
-  }
-
-  AliRunDigitizer * manager = new AliRunDigitizer(1,1);
-  manager->SetInputStream(0,"galice.root");
-  AliFMDDigitizer *FMD = new AliFMDDigitizer(manager);
-  manager->Exec("");
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/FMD/Document.C b/FMD/Document.C
deleted file mode 100644 (file)
index 046471c..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-// Script to do test the FMD digitization class. 
-void
-Document()
-{
-  gEnv->SetValue("Root.Html.SourceDir", "$(ALICE)/FMD");
-  gEnv->SetValue("Root.Html.OutputDir", "$(ALICE)/FMD/html");
-
-  gSystem->MakeDirectory("$(ALICE)/FMD/html");
-  
-  THtml* html = new THtml;
-  html->MakeAll(kFALSE, "AliFMD*");
-  html->Convert("$(ALICE)/FMD/Digitize.C", "Digitize", 
-               "FMD/html/src");
-  html->Convert("$(ALICE)/FMD/Reconstruct.C", "Reconstruct", 
-               "FMD/html/src");
-  html->Convert("$(ALICE)/FMD/Simulate.C", "Simulate", 
-               "FMD/html/src");
-  html->Convert("$(ALICE)/FMD/DrawFMD.C", "DrawFMD", 
-               "FMD/html/src");
-  html->Convert("$(ALICE)/FMD/ViewFMD.C", "ViewFMD", 
-               "FMD/html/src");
-  html->MakeIndex("AliFMD*");
-
-  std::ofstream index("FMD/html/index.html");
-  html->WriteHtmlHeader(index, "ALICE FMD Code - Index page");
-  
-  index << "<h1>ALICE FMD Code</h1>\n"
-       << "<ul>\n"
-       << "<li><a href=\"USER_Index.html\">Classes</a></li>\n"
-        << "<li><a href=\"src/Digitize.C.html\">Digitize script</a></li>\n"
-        << "<li><a href=\"src/Reconstruct.C.html\">Reconstruct script</a></li>\n"
-        << "<li><a href=\"src/Simulate.C.html\">Simulate script</a></li>\n"
-        << "<li><a href=\"src/DrawFMD.C.html\">DrawFMD script</a></li>\n"
-        << "<li><a href=\"src/ViewFMD.C.html\">ViewFMD script</a></li>\n"
-       << "</ul>\n"
-       << std::endl;
-  html->WriteHtmlFooter(index, "", "", "", "");
-  index.close();
-}
-
-//
-// EOF
-//
index 182ffbe..6b5a582 100644 (file)
@@ -12,6 +12,7 @@
 #pragma link C++ class  AliFMDBaseDigit+;
 #pragma link C++ class  AliFMDDigit+;
 #pragma link C++ class  AliFMDSDigit+;
+#pragma link C++ class  AliFMDMap+;
 
 #else
 # error Not for compilation 
index 2f993e7..7de18d3 100644 (file)
 // #pragma link C++ class  AliFMDMap<UShort_t>;
 // #pragma link C++ typedef AliFMDAdcMap;
 #pragma link C++ class  AliFMDUShortMap+;
-// #pragma link C++ typedef  AliFMDAdcMap;
+#pragma link C++ class  AliFMDBoolMap+;
 #pragma link C++ class  AliFMDReconstructor+;
-#pragma link C++ class  AliFMDReconstructionAlgorithm+;
-#pragma link C++ class  AliFMDParticles+;
+#pragma link C++ class  AliFMDMultAlgorithm+;
+#pragma link C++ class  AliFMDMultNaiive+;
+#pragma link C++ class  AliFMDMultPoisson+;
+#pragma link C++ class  AliFMDMult+;
+#pragma link C++ class  AliFMDMultRegion+;
+#pragma link C++ class  AliFMDMultStrip+;
 #pragma link C++ class  AliFMDRawStream+;
 #pragma link C++ class  AliFMDRawReader+;
 
index df17f45..c7b64d4 100644 (file)
@@ -15,7 +15,6 @@
 // #pragma link C++ class  std::pair<Float_t,UShort_t>;
 // #pragma link C++ class  AliFMDMap<std::pair<Float_t,UShort_t> >;
 // #pragma link C++ typedef  AliFMDEdepMap;
-#pragma link C++ class  AliFMDMap+;
 #pragma link C++ class  AliFMDEdepMap+;
 #pragma link C++ class  AliFMDHit+;
 #pragma link C++ class  AliFMD+;
diff --git a/FMD/ReadRaw.C b/FMD/ReadRaw.C
deleted file mode 100644 (file)
index ad2838b..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#include <iomanip>
-
-void 
-ReadRaw(Int_t det=2,  bool verbose=false, Int_t event=0) 
-{
-  TString file(Form("raw%d/FMD_%d.ddl", event, AliFMD::kBaseDDL + det - 1));
-
-  std::cout << "Reading raw data file " << file << std::endl;
-  
-  TH1* h = new TH1F("rawData", "Raw Data", 90, 0, 90);
-  
-  
-  // This method creates a text file containing the same information
-  // stored in an Altro file. The information in the text file is
-  // organized pad by pad and and for each pad it consists in a
-  // sequence of bunches (Bunch length +2, Time bin of the last
-  // amplitude sample in the bunch, amplitude values) It is used
-  // mainly //for debugging
-
-  AliAltroBuffer buff(file.Data(),0);
-  Int_t numWords,padNum,rowNum,secNum=0;
-  Int_t value = 0;
-  Int_t zero  = 0;
-  // if (!buff.ReadDataHeader()) {
-  // std::cout<< file << " isn't a valid data file!" << std::endl;
-  // }
-  
-  while(buff.ReadTrailerBackward(numWords,padNum,rowNum,secNum)){
-    if (verbose) 
-      std::cout << "Ring: " << (secNum == 0 ? 'I' : 'O') 
-               << " Sector: " << std::setw(2) << rowNum 
-               << " Strip:  " << std::setw(3) << padNum 
-               << " Words:  " << std::setw(4) << numWords << std::endl;
-    if (numWords == 0) zero++;
-    if (numWords % 4){
-      if (verbose) 
-       std::cout << "Skipping trailer of " 
-                 << (4 - numWords % 4) << " words" << std::endl;
-      for(Int_t j = 0; j < (4 - numWords % 4); j++)
-       value=buff.GetNextBackWord(); 
-    }//end if
-    for(Int_t i = 0; i <numWords; i++) {
-      value=buff.GetNextBackWord();
-      if (verbose) {
-       std::cout << std::setw(5) <<  value << std::flush;
-       if (i % 16 == 15) std::cout << std::endl;
-      }
-      h->Fill(value);
-    }//end for
-    if (verbose)
-      std::cout << std::endl;
-    if (zero > 1) {
-      std::cout << "Error: Read zero channels - should not happen" 
-               << std::endl;
-      break;
-    }
-  }//end while
-  h->Draw();
-  return;
-}
index 8e5a5a2..41c4154 100644 (file)
@@ -23,7 +23,7 @@ Reconstruct()
   AliReconstruction rec;   
   rec.SetRunLocalReconstruction("FMD");
   rec.SetRunVertexFinder(kFALSE);
-  rec.SetRunTracking(kFALSE); 
+  // rec.SetRunTracking(kFALSE); 
   rec.SetFillESD(""); 
   rec.SetInput("./");
   rec.Run(); 
index 34c624d..b795aff 100644 (file)
@@ -2,7 +2,8 @@
 #
 # $Id$
 
-SRCS   =  AliFMDDigit.cxx
+SRCS   =  AliFMDDigit.cxx              \
+          AliFMDMap.cxx                
 HDRS   =  $(SRCS:.cxx=.h)
 DHDR   := FMDbaseLinkDef.h
 
index ad83dc6..a5da33c 100644 (file)
@@ -2,12 +2,17 @@
 #
 # $Id$
 
-SRCS           =  AliFMDReconstructor.cxx \
-                  AliFMDReconstructionAlgorithm.cxx \
-                  AliFMDRawStream.cxx  \
-                  AliFMDRawReader.cxx  \
-                  AliFMDParticles.cxx  \
-                  AliFMDUShortMap.cxx
+SRCS           =  AliFMDReconstructor.cxx      \
+                  AliFMDRawStream.cxx          \
+                  AliFMDRawReader.cxx          \
+                  AliFMDMultAlgorithm.cxx      \
+                  AliFMDMultNaiive.cxx         \
+                  AliFMDMultPoisson.cxx        \
+                  AliFMDMultRegion.cxx         \
+                  AliFMDMult.cxx               \
+                  AliFMDMultStrip.cxx          \
+                  AliFMDUShortMap.cxx          \
+                  AliFMDBoolMap.cxx
 HDRS           =  $(SRCS:.cxx=.h)
 DHDR           := FMDrecLinkDef.h
 EINCLUDE       := $(ALICE)/RAW
index 8867b23..6b1f15f 100644 (file)
@@ -13,7 +13,6 @@ SRCS          =  AliFMD.cxx                   \
                   AliFMDPolygon.cxx            \
                   AliFMDHit.cxx                \
                   AliFMDDigitizer.cxx          \
-                  AliFMDMap.cxx                \
                   AliFMDEdepMap.cxx            \
                   AliFMDRawWriter.cxx
 HDRS           =  $(SRCS:.cxx=.h) 
diff --git a/FMD/scripts/.cvsignore b/FMD/scripts/.cvsignore
new file mode 100644 (file)
index 0000000..6fdc321
--- /dev/null
@@ -0,0 +1,16 @@
+Compare.C
+Config.C.all
+Config.C.keep
+Digitize.C
+Document.C
+LsHits.C
+MakeMap.C
+RawTest.C
+ReadRaw.C
+ShowDigits.C
+ShowHits.C
+old
+runIt.C
+runflukageo.sh
+rungeant3geo.sh
+va1_train.C