+++ /dev/null
-/**************************************************************************
- * 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$ */
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// TRD reconstructed point //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-#include "AliRun.h"
-
-#include "AliTRDgeometry.h"
-#include "AliTRDrecPoint.h"
-
-ClassImp(AliTRDrecPoint)
-
-//_____________________________________________________________________________
-AliTRDrecPoint::AliTRDrecPoint()
- :AliRecPoint()
- ,fDetector(0)
- ,fTimeBin(0)
- ,fUsed(0)
- ,fY(0)
- ,fZ(0)
- ,fSigmaY2(0)
- ,fSigmaZ2(0)
-{
- //
- // Default constructor
- //
-
- for (Int_t i = 0; i < 3; i++) {
- fTracks[i] = 0;
- }
- fGeom = AliTRDgeometry::GetGeometry();
-
-}
-
-//_____________________________________________________________________________
-AliTRDrecPoint::AliTRDrecPoint(const char * opt)
- :AliRecPoint(opt)
- ,fDetector(0)
- ,fTimeBin(0)
- ,fUsed(0)
- ,fY(0)
- ,fZ(0)
- ,fSigmaY2(0)
- ,fSigmaZ2(0)
-{
- //
- // Standard constructor
- //
-
- for (Int_t i = 0; i < 3; i++) {
- fTracks[i] = 0;
- }
- fGeom = AliTRDgeometry::GetGeometry();
-
-}
-
-//_____________________________________________________________________________
-AliTRDrecPoint::~AliTRDrecPoint()
-{
- //
- // AliTRDrecPoint destructor
- //
-
-}
-
-//_____________________________________________________________________________
-void AliTRDrecPoint::AddDigit(Int_t digit)
-{
- //
- // Adds the index of a digit to the digits list
- //
-
- // First resize the list
- // (no clusters with more than 3 digits for the TRD
- if ((fMulDigit == 0) &&
- (fMaxDigit >= 5)) {
- fMaxDigit = 5;
- delete fDigitsList;
- fDigitsList = new int[fMaxDigit];
- }
-
- // Increase the size of the list if necessary
- if (fMulDigit >= fMaxDigit) {
- fMaxDigit *= 2;
- Int_t *tempo = new Int_t[fMaxDigit];
- Int_t index;
- for (index = 0; index < fMulDigit; index++) {
- tempo[index] = fDigitsList[index];
- }
- delete fDigitsList;
- fDigitsList = tempo;
- }
-
- fDigitsList[fMulDigit++] = digit;
-
-}
-
-//_____________________________________________________________________________
-void AliTRDrecPoint::SetLocalPosition(TVector3 & /*pos*/)
-{
- //
- // Sets the position of the point in the local coordinate system
- // (row,col,time) and calculates the error matrix in the same
- // system.
- //
-
- AliFatal("Not implemented");
-
-}
-
-//_____________________________________________________________________________
-void AliTRDrecPoint::SetTrackingYZ(Float_t /*sigmaY*/, Float_t /*sigmaZ*/)
-{
- //
- // Sets the position of the point in the local coordinate system
- // of tracking sector
- //
-
- AliFatal("Not implemented");
-
-}
-
-//_____________________________________________________________________________
-void AliTRDrecPoint::AddTrackIndex(Int_t *track)
-{
- //
- // Adds track index. Currently assumed that track is an array of
- // size 9, and up to 3 track indexes are stored in fTracks[3].
- // Indexes are sorted according to:
- // 1) index of max number of appearances is stored first
- // 2) if two or more indexes appear equal number of times, the lowest
- // ones are stored first;
- //
-
- const Int_t kSize = 9;
- Int_t entries[kSize][2];
-
- Int_t i = 0;
- Int_t j = 0;
- Int_t k = 0;
- Int_t index;
-
- Bool_t indexAdded;
-
- for (i = 0; i < kSize; i++) {
- entries[i][0] = -1;
- entries[i][1] = 0;
- }
-
- for (k = 0; k < kSize; k++) {
- index = track[k];
- indexAdded = kFALSE;
- j = 0;
- if (index >= 0) {
- while ((!indexAdded) && (j < kSize)) {
- if ((entries[j][0] == index) ||
- (entries[j][1] == 0)) {
- entries[j][0] = index;
- entries[j][1] = entries[j][1]+1;
- indexAdded = kTRUE;
- }
- j++;
- }
- }
- }
-
- // Sort by number of appearances and index value
- Int_t swap = 1;
- Int_t tmp0;
- Int_t tmp1;
- while (swap > 0) {
- swap = 0;
- for (i = 0; i < (kSize - 1); i++) {
- if ((entries[i][0] >= 0) &&
- (entries[i+1][0] >= 0)) {
- if ((entries[i][1] < entries[i+1][1]) ||
- ((entries[i][1] == entries[i+1][1]) &&
- (entries[i][0] > entries[i+1][0]))) {
- tmp0 = entries[i][0];
- tmp1 = entries[i][1];
- entries[i][0] = entries[i+1][0];
- entries[i][1] = entries[i+1][1];
- entries[i+1][0] = tmp0;
- entries[i+1][1] = tmp1;
- swap++;
- }
- }
- }
- }
-
- // Set track indexes
- for(i = 0; i < 3; i++) {
- fTracks[i] = entries[i][0];
- }
-
- return;
-
-}
-
-
-
-
-
-
-
+++ /dev/null
-#ifndef ALITRDRECPOINT_H
-#define ALITRDRECPOINT_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// TRD reconstructed point //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-#include "AliRecPoint.h"
-
-class AliTRDrecPoint : public AliRecPoint {
-
- public:
-
- AliTRDrecPoint();
- AliTRDrecPoint(const char * opt);
- virtual ~AliTRDrecPoint();
-
- virtual void Print(Option_t* ) const {};
- virtual void AddDigit(Int_t digit);
- virtual void AddDigit(AliDigitNew& ) {};
-
- void SetEnergy(Float_t amp) { fAmp = amp; }
- void SetDetector(Int_t det) { fDetector = det; }
- void SetLocalPosition(TVector3 &pos);
- void SetLocalRow(Float_t r) { fLocPos.SetX(r); }
- void SetLocalCol(Float_t c) { fLocPos.SetY(c); }
- void SetLocalTime(Float_t t) { fLocPos.SetZ(t); }
-
- void SetLocalTimeBin(Int_t tb) { fTimeBin = tb; }
- void SetTrackingYZ(Float_t fSigmaY = 0.0, Float_t fSigmaZ = 0.0);
-
- Int_t GetDetector() const { return fDetector; }
- Int_t GetDigit(Int_t i = 0) const { if (i < fMulDigit) return fDigitsList[i];
- else return -1; }
- Float_t GetLocalRow() const { return fLocPos(0); }
- Float_t GetLocalCol() const { return fLocPos(1); }
- Float_t GetLocalTime() const { return fLocPos(2); }
-
- Int_t GetLocalTimeBin() const { return Int_t(fLocPos(2)); }
- Float_t GetSigmaY2() const { return fSigmaY2; }
- Float_t GetSigmaZ2() const { return fSigmaZ2; }
- Float_t GetY() const { return fY; }
- Float_t GetZ() const { return fZ; }
-
- Int_t IsUsed() const { return fUsed; }
- void Use() { fUsed++; }
- Int_t GetTrackIndex(Int_t i) const { return fTracks[i]; }
- void AddTrackIndex(Int_t *i);
-
- protected:
-
- Int_t fDetector; // TRD detector number
- Int_t fTimeBin; // Time bin number within the detector
- Int_t fUsed; // 0 initially and incremented if the point is "used"
- Int_t fTracks[3]; // Labels of overlapped tracks
- Float_t fY; // Local Rphi coordinate (cm) within tracking sector
- Float_t fZ; // Local Z coordinate (cm) within tracking sector
- Float_t fSigmaY2; // Y variance (cm)
- Float_t fSigmaZ2; // Z variance (cm)
-
- ClassDef(AliTRDrecPoint,1) // Reconstructed point for the TRD
-
-};
-
-#endif