// hits[9] [Float_t ] Time when the track hit
//
//
- AddHit(track,
- UShort_t(vol[0]), // Detector #
- Char_t(vol[1]), // Ring ID
- UShort_t(vol[2]), // Sector #
- UShort_t(vol[3]), // Strip #
- hits[0], // X
- hits[1], // Y
- hits[2], // Z
- hits[3], // Px
- hits[4], // Py
- hits[5], // Pz
- hits[6], // Energy loss
- Int_t(hits[7]), // PDG
- hits[8]); // Time
+ AddHitByFields(track,
+ UShort_t(vol[0]), // Detector #
+ Char_t(vol[1]), // Ring ID
+ UShort_t(vol[2]), // Sector #
+ UShort_t(vol[3]), // Strip #
+ hits[0], // X
+ hits[1], // Y
+ hits[2], // Z
+ hits[3], // Px
+ hits[4], // Py
+ hits[5], // Pz
+ hits[6], // Energy loss
+ Int_t(hits[7]), // PDG
+ hits[8]); // Time
}
//____________________________________________________________________
void
-AliFMD::AddHit(Int_t track,
- UShort_t detector,
- Char_t ring,
- UShort_t sector,
- UShort_t strip,
- Float_t x,
- Float_t y,
- Float_t z,
- Float_t px,
- Float_t py,
- Float_t pz,
- Float_t edep,
- Int_t pdg,
- Float_t t)
+AliFMD::AddHitByFields(Int_t track,
+ UShort_t detector,
+ Char_t ring,
+ UShort_t sector,
+ UShort_t strip,
+ Float_t x,
+ Float_t y,
+ Float_t z,
+ Float_t px,
+ Float_t py,
+ Float_t pz,
+ Float_t edep,
+ Int_t pdg,
+ Float_t t)
{
//
// Add a hit to the list
//____________________________________________________________________
void
-AliFMD::AddDigit(Int_t* digits)
+AliFMD::AddDigit(Int_t* digits, Int_t*)
{
// Add a digit to the Digit tree
//
// digits[5] [Short_t] ADC Count, -1 if not used
// digits[6] [Short_t] ADC Count, -1 if not used
//
- AddDigit(UShort_t(digits[0]), // Detector #
- Char_t(digits[1]), // Ring ID
- UShort_t(digits[2]), // Sector #
- UShort_t(digits[3]), // Strip #
- UShort_t(digits[4]), // ADC Count1
- Short_t(digits[5]), // ADC Count2
- Short_t(digits[6])); // ADC Count3
+ AddDigitByFields(UShort_t(digits[0]), // Detector #
+ Char_t(digits[1]), // Ring ID
+ UShort_t(digits[2]), // Sector #
+ UShort_t(digits[3]), // Strip #
+ UShort_t(digits[4]), // ADC Count1
+ Short_t(digits[5]), // ADC Count2
+ Short_t(digits[6])); // ADC Count3
}
//____________________________________________________________________
void
-AliFMD::AddDigit(UShort_t detector,
- Char_t ring,
- UShort_t sector,
- UShort_t strip,
- UShort_t count1,
- Short_t count2,
- Short_t count3)
+AliFMD::AddDigitByFields(UShort_t detector,
+ Char_t ring,
+ UShort_t sector,
+ UShort_t strip,
+ UShort_t count1,
+ Short_t count2,
+ Short_t count3)
{
// add a real digit - as coming from data
//
// digits[6] [Short_t] ADC Count, -1 if not used
// digits[7] [Short_t] ADC Count, -1 if not used
//
- AddSDigit(UShort_t(digits[0]), // Detector #
- Char_t(digits[1]), // Ring ID
- UShort_t(digits[2]), // Sector #
- UShort_t(digits[3]), // Strip #
- Float_t(digits[4]), // Edep
- UShort_t(digits[5]), // ADC Count1
- Short_t(digits[6]), // ADC Count2
- Short_t(digits[7])); // ADC Count3
+ AddSDigitByFields(UShort_t(digits[0]), // Detector #
+ Char_t(digits[1]), // Ring ID
+ UShort_t(digits[2]), // Sector #
+ UShort_t(digits[3]), // Strip #
+ Float_t(digits[4]), // Edep
+ UShort_t(digits[5]), // ADC Count1
+ Short_t(digits[6]), // ADC Count2
+ Short_t(digits[7])); // ADC Count3
}
//____________________________________________________________________
void
-AliFMD::AddSDigit(UShort_t detector,
- Char_t ring,
- UShort_t sector,
- UShort_t strip,
- Float_t edep,
- UShort_t count1,
- Short_t count2,
- Short_t count3)
+AliFMD::AddSDigitByFields(UShort_t detector,
+ Char_t ring,
+ UShort_t sector,
+ UShort_t strip,
+ Float_t edep,
+ UShort_t count1,
+ Short_t count2,
+ Short_t count3)
{
// add a summable digit
//
virtual TClonesArray* SDigits() { return fSDigits; }
virtual void ResetSDigits();
virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
- virtual void AddHit(Int_t track,
- UShort_t detector,
- Char_t ring,
- UShort_t sector,
- UShort_t strip,
- Float_t x=0,
- Float_t y=0,
- Float_t z=0,
- Float_t px=0,
- Float_t py=0,
- Float_t pz=0,
- Float_t edep=0,
- Int_t pdg=0,
- Float_t t=0);
- virtual void AddDigit(Int_t *digits);
- virtual void AddDigit(UShort_t detector=0,
- Char_t ring='\0',
- UShort_t sector=0,
- UShort_t strip=0,
- UShort_t count1=0,
- Short_t count2=-1,
- Short_t count3=-1);
+ virtual void AddHitByFields(Int_t track,
+ UShort_t detector,
+ Char_t ring,
+ UShort_t sector,
+ UShort_t strip,
+ Float_t x=0,
+ Float_t y=0,
+ Float_t z=0,
+ Float_t px=0,
+ Float_t py=0,
+ Float_t pz=0,
+ Float_t edep=0,
+ Int_t pdg=0,
+ Float_t t=0);
+ virtual void AddDigit(Int_t *digits, Int_t* notused=0);
+ virtual void AddDigitByFields(UShort_t detector=0,
+ Char_t ring='\0',
+ UShort_t sector=0,
+ UShort_t strip=0,
+ UShort_t count1=0,
+ Short_t count2=-1,
+ Short_t count3=-1);
virtual void AddSDigit(Int_t *digits);
- virtual void AddSDigit(UShort_t detector=0,
- Char_t ring='\0',
- UShort_t sector=0,
- UShort_t strip=0,
- Float_t edep=0,
- UShort_t count1=0,
- Short_t count2=-1,
- Short_t count3=-1);
+ virtual void AddSDigitByFields(UShort_t detector=0,
+ Char_t ring='\0',
+ UShort_t sector=0,
+ UShort_t strip=0,
+ Float_t edep=0,
+ UShort_t count1=0,
+ Short_t count2=-1,
+ Short_t count3=-1);
// Digitisation
virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
// maxSec Maximum number of sectors per ring
// maxStr Maximum number of strips per sector
fData = new Bool_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
- Clear();
+ Reset();
}
//__________________________________________________________
//__________________________________________________________
void
-AliFMDBoolMap::Clear(const Bool_t& val)
+AliFMDBoolMap::Reset(const Bool_t& val)
{
// Reset map to val
for (size_t i = 0; i < fMaxDetectors * fMaxRings
size_t maxStr = kMaxStrips);
virtual ~AliFMDBoolMap() { delete [] fData; }
AliFMDBoolMap& operator=(const AliFMDBoolMap& other);
- virtual void Clear(const Bool_t& v=Bool_t());
+ virtual void Reset(const Bool_t& v=Bool_t());
virtual Bool_t& operator()(UShort_t det,
- Char_t ring,
- UShort_t sec,
- UShort_t str);
+ 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;
+ 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
Fatal("SumContributions", "no run loader");
// Clear array of deposited energies
- fEdep.Clear();
+ fEdep.Reset();
// Get the FMD loader
AliLoader* inFMD = fRunLoader->GetLoader("FMDLoader");
Short_t count2,
Short_t count3) const
{
- fmd->AddDigit(detector, ring, sector, strip, count1, count2, count3);
+ fmd->AddDigitByFields(detector, ring, sector, strip, count1, count2, count3);
}
//____________________________________________________________________
Short_t count2,
Short_t count3) const
{
- fmd->AddSDigit(detector, ring, sector, strip, edep, count1, count2, count3);
+ fmd->AddSDigitByFields(detector, ring, sector, strip, edep,
+ count1, count2, count3);
}
Short_t /* count2 */,
Short_t /* count3 */) const {}
- AliRunLoader* fRunLoader;
+ AliRunLoader* fRunLoader; // Run loader
AliFMDEdepMap fEdep; // Cache of Energy from hits
UShort_t fVA1MipRange; // How many MIPs the pre-amp can do
UShort_t fAltroChannelSize; // Largest # to store in 1 ADC chan.
//____________________________________________________________________
void
-AliFMDEdepMap::Clear(const AliFMDEdepHitPair& val)
+AliFMDEdepMap::Reset(const AliFMDEdepHitPair& val)
{
for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
i++) fData[i] = val;
size_t maxStr = kMaxStrips);
virtual ~AliFMDEdepMap() { delete [] fData; }
AliFMDEdepMap& operator=(const AliFMDEdepMap& other);
- virtual void Clear(const AliFMDEdepHitPair& val=AliFMDEdepHitPair());
+ virtual void Reset(const AliFMDEdepHitPair& val=AliFMDEdepHitPair());
virtual AliFMDEdepHitPair& operator()(UShort_t detector,
Char_t ring,
UShort_t sector,
AliFMDGeometry*
AliFMDGeometry::Instance()
{
+ // Return (newly created) singleton instance
if (!fgInstance) fgInstance = new AliFMDGeometry;
return fgInstance;
}
AliFMDGeometry::AliFMDGeometry()
: AliGeometry("FMD", "Forward multiplicity")
{
+ // PROTECTED
+ // Default constructor
fUseFMD1 = kTRUE;
fUseFMD2 = kTRUE;
fUseFMD3 = kTRUE;
fIsInitialized = kFALSE;
}
+//____________________________________________________________________
+AliFMDGeometry::AliFMDGeometry(const AliFMDGeometry& other)
+ : AliGeometry(other),
+ fIsInitialized(other.fIsInitialized),
+ fInner(other.fInner),
+ fOuter(other.fOuter),
+ fFMD1(other.fFMD1),
+ fFMD2(other.fFMD2),
+ fFMD3(other.fFMD3),
+ fUseFMD1(other.fUseFMD1),
+ fUseFMD2(other.fUseFMD2),
+ fUseFMD3(other.fUseFMD3)
+{
+ // PROTECTED
+ // Copy constructor
+}
+
+
+
+//____________________________________________________________________
+AliFMDGeometry&
+AliFMDGeometry::operator=(const AliFMDGeometry& other)
+{
+ // PROTECTED
+ // Assignment operator
+ fUseFMD1 = other.fUseFMD1;
+ fUseFMD2 = other.fUseFMD2;
+ fUseFMD3 = other.fUseFMD3;
+ fFMD1 = other.fFMD1;
+ fFMD2 = other.fFMD2;
+ fFMD3 = other.fFMD3;
+ fInner = other.fInner;
+ fOuter = other.fOuter;
+ fIsInitialized = other.fIsInitialized;
+ return *this;
+}
+
//____________________________________________________________________
void
AliFMDGeometry::Init()
{
+ // Initialize the the singleton if not done so already
if (fIsInitialized) return;
fInner->Init();
fOuter->Init();
AliFMDDetector*
AliFMDGeometry::GetDetector(Int_t i) const
{
+ // Get the ith detector. i should be one of 1, 2, or 3. If an
+ // invalid value is passed, 0 (NULL) is returned.
switch (i) {
case 1: return fUseFMD1 ? static_cast<AliFMDDetector*>(fFMD1) : 0;
case 2: return fUseFMD2 ? static_cast<AliFMDDetector*>(fFMD2) : 0;
AliFMDRing*
AliFMDGeometry::GetRing(Char_t i) const
{
+ // Get the ith ring. i should be one of 'I' or 'O' (case
+ // insensitive). If an invalid parameter is passed, 0 (NULL) is
+ // returned.
switch (i) {
case 'I':
case 'i': return fInner;
void
AliFMDGeometry::Enable(Int_t i)
{
+ // Enable the ith detector. i should be one of 1, 2, or 3
switch (i) {
case 1: fUseFMD1 = kTRUE; break;
case 2: fUseFMD2 = kTRUE; break;
void
AliFMDGeometry::Disable(Int_t i)
{
+ // Disable the ith detector. i should be one of 1, 2, or 3
switch (i) {
case 1: fUseFMD1 = kFALSE; break;
case 2: fUseFMD2 = kFALSE; break;
//____________________________________________________________________
void
AliFMDGeometry::Detector2XYZ(UShort_t detector,
- Char_t ring,
- UShort_t sector,
- UShort_t strip,
- Double_t& x,
- Double_t& y,
- Double_t& z) const
+ Char_t ring,
+ UShort_t sector,
+ UShort_t strip,
+ Double_t& x,
+ Double_t& y,
+ Double_t& z) const
{
+ // Translate detector coordinates (detector, ring, sector, strip) to
+ // spatial coordinates (x, y, z) in the master reference frame of
+ // ALICE.
AliFMDDetector* det = GetDetector(detector);
if (!det) return;
det->Detector2XYZ(ring, sector, strip, x, y, z);
TVector3& pos,
TMatrix& /* mat */) const
{
+ // Get the global coordinates cooresponding to the reconstructed
+ // point p. The coordiates is returned in the 3-vector pos passed
+ // to this member function. The matrix mat is used for rotations.
GetGlobal(p, pos);
}
void
AliFMDGeometry::GetGlobal(const AliRecPoint* p, TVector3& pos) const
{
+ // Get the global coordinates cooresponding to the reconstructed
+ // point p. The coordiates is returned in the 3-vector pos passed
+ // to this member function. Note, as AliRecPoint only has places for
+ // 3 indicies, it is assumed that the ring hit is an inner ring -
+ // which obviously needn't be the case. This makes the member
+ // function pretty darn useless.
+ // FIXME: Implement this function to work with outer rings too.
Double_t x, y, z;
TVector3 local;
p->GetLocalPosition(local);
Bool_t
AliFMDGeometry::Impact(const TParticle* /* particle */) const
{
+ // Return true, if the particle will hit the active detector
+ // elements, and false if not. Should be used for fast
+ // simulations. Note, that the function currently return false
+ // always.
+ // FIXME: Implement this function.
return kFALSE;
}
//
// $Id$
//
+// Forward Multiplicity Detector based on Silicon wafers.
+//
+// This class is a singleton that handles the geometry parameters of
+// the FMD detectors.
+//
#ifndef ALIGEOMETRY_H
# include <AliGeometry.h>
#endif
-#ifndef ROOT_TObjArray
-# include <TObjArray.h>
-#endif
class TVector3;
class TMatrix;
class TParticle;
virtual void GetGlobal(const AliRecPoint* p, TVector3& pos) const;
virtual Bool_t Impact(const TParticle* particle) const;
protected:
- Bool_t fIsInitialized;
+ Bool_t fIsInitialized; // Whether singleton is initalized
AliFMDRing* fInner; // Inner ring geometry information
AliFMDRing* fOuter; // Outer ring geometry information
AliFMD1* fFMD1; // FMD1 geometry information
Bool_t fUseFMD1; // Wheter to Use FMD1 or not
Bool_t fUseFMD2; // Wheter to Use FMD2 or not
Bool_t fUseFMD3; // Wheter to Use FMD3 or not
- static AliFMDGeometry* fgInstance;
+ static AliFMDGeometry* fgInstance; // Singleton instance
AliFMDGeometry();
+ AliFMDGeometry(const AliFMDGeometry& other);
+ AliFMDGeometry& operator=(const AliFMDGeometry& other);
virtual ~AliFMDGeometry() {}
-
+
ClassDef(AliFMDGeometry,1); //
};
// Reset internal data
AliFMDMultAlgorithm::PreEvent(tree, ipZ);
fCurrentVertexZ = ipZ;
- fEmpty.Clear(kFALSE);
+ fEmpty.Reset(kFALSE);
// Make a branch in the reconstruction tree.
const Int_t kBufferSize = 16000;
{
// Reconstruct event from digits in tree
// Get the FMD branch holding the digits.
+ // FIXME: The vertex may not be known yet, so we may have to move
+ // some of this to FillESD.
AliDebug(1, "Reconstructing from digits in a tree");
TBranch *digitBranch = digitsTree->GetBranch("FMD");
void
AliFMDReconstructor::ProcessDigits(TClonesArray* digits) const
{
+ // For each digit, find the pseudo rapdity, azimuthal angle, and
+ // number of corrected ADC counts, and pass it on to the algorithms
+ // used.
Int_t nDigits = digits->GetEntries();
AliDebug(1, Form("Got %d digits", nDigits));
for (Int_t i = 0; i < nDigits; i++) {
AliESD* /* esd*/) const
{
// nothing to be done
+ // FIXME: The vertex may not be known when Reconstruct is executed,
+ // so we may have to move some of that member function here.
}
AliDebug(20, Form("Processing hit in FMD%d%c[%2d,%3d]: %f",
detector, ring, sector, strip, fCurrentDeltaE));
- fFMD->AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),
- UShort_t(detector), ring, UShort_t(sector), UShort_t(strip),
- fCurrentV.X(), fCurrentV.Y(), fCurrentV.Z(),
- fCurrentP.X(), fCurrentP.Y(), fCurrentP.Z(),
- fCurrentDeltaE, fCurrentPdg, fCurrentV.T());
+ fFMD->AddHitByFields(gAlice->GetMCApp()->GetCurrentTrackNumber(),
+ UShort_t(detector), ring, UShort_t(sector),
+ UShort_t(strip),
+ fCurrentV.X(), fCurrentV.Y(), fCurrentV.Z(),
+ fCurrentP.X(), fCurrentP.Y(), fCurrentP.Z(),
+ fCurrentDeltaE, fCurrentPdg, fCurrentV.T());
fCurrentDeltaE = -1;
}
}
Bool_t useDIPO = kTRUE;
Bool_t useFMD = kTRUE;
Bool_t useFRAME = kTRUE;
- Bool_t useHALL = kTRUE;
+ Bool_t useHALL = kFALSE;
Bool_t useITS = kTRUE;
Bool_t useMAG = kTRUE;
Bool_t useMUON = kTRUE;
Bool_t useTOF = kTRUE;
Bool_t useTPC = kTRUE;
Bool_t useTRD = kTRUE;
- Bool_t useZDC = kTRUE;
+ Bool_t useZDC = kFALSE;
Bool_t useEMCAL = kTRUE;
Bool_t useVZERO = kTRUE;