#include "AliTRDclusterizer.h"
#include "AliTRDtracker.h"
#include "AliTRDpidESD.h"
-#include "AliTRDgtuTrack.h"
#include "AliTRDrawData.h"
#include "AliTRDdigitsManager.h"
#include "AliTRDtrackerV1.h"
#include "TClonesArray.h"
#include "AliTRDgtuSim.h"
-#include "AliTRDmcmTracklet.h"
#include "AliTRDgtuTMU.h"
#include "AliTRDtrackGTU.h"
#include "AliTRDtrackletWord.h"
+++ /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 module global track (GTU) //
-// //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-#include <TMath.h>
-#include <TMatrixD.h>
-#include <TObjArray.h>
-
-#include "AliLog.h"
-
-//#include "AliTRDReconstructor.h"
-//#include "AliTRDcalibDB.h"
-#include "AliTRDgeometry.h"
-#include "AliTRDltuTracklet.h"
-#include "AliTRDgtuTrack.h"
-#include "Cal/AliTRDCalPID.h"
-
-ClassImp(AliTRDgtuTrack)
-
-//_____________________________________________________________________________
-AliTRDgtuTrack::AliTRDgtuTrack()
- :TObject()
- ,fTracklets(new TObjArray(400))
- ,fYproj(0)
- ,fZproj(0)
- ,fSlope(0)
- ,fDetector(-1)
- ,fNtracklets(0)
- ,fNplanes(0)
- ,fNclusters(0)
- ,fPt(0)
- ,fPhi(0)
- ,fEta(0)
- ,fLabel(-1)
- ,fPID(0)
- ,fIsElectron(kFALSE)
-{
- //
- // Default constructor
- //
-
-}
-
-//_____________________________________________________________________________
-AliTRDgtuTrack::AliTRDgtuTrack(const AliTRDgtuTrack &t)
- :TObject(t)
- ,fTracklets(NULL)
- ,fYproj(t.fYproj)
- ,fZproj(t.fZproj)
- ,fSlope(t.fSlope)
- ,fDetector(t.fDetector)
- ,fNtracklets(t.fNtracklets)
- ,fNplanes(t.fNplanes)
- ,fNclusters(t.fNclusters)
- ,fPt(t.fPt)
- ,fPhi(t.fPhi)
- ,fEta(t.fEta)
- ,fLabel(t.fLabel)
- ,fPID(t.fPID)
- ,fIsElectron(t.fIsElectron)
-{
- //
- // Copy contructor
- //
-
-}
-
-//_____________________________________________________________________________
-AliTRDgtuTrack &AliTRDgtuTrack::operator=(const AliTRDgtuTrack &t)
-{
- //
- // Assignment operator
- //
-
- if (this != &t) ((AliTRDgtuTrack &) t).Copy(*this);
-
- return *this;
-
-}
-
-//_____________________________________________________________________________
-void AliTRDgtuTrack::Copy(TObject &t) const
-{
- //
- // Copy function
- //
-
- ((AliTRDgtuTrack &) t).fTracklets = NULL;
- ((AliTRDgtuTrack &) t).fYproj = fYproj;
- ((AliTRDgtuTrack &) t).fZproj = fZproj;
- ((AliTRDgtuTrack &) t).fSlope = fSlope;
- ((AliTRDgtuTrack &) t).fDetector = fDetector;
- ((AliTRDgtuTrack &) t).fNtracklets = fNtracklets;
- ((AliTRDgtuTrack &) t).fNplanes = fNplanes;
- ((AliTRDgtuTrack &) t).fNclusters = fNclusters;
- ((AliTRDgtuTrack &) t).fPt = fPt;
- ((AliTRDgtuTrack &) t).fPhi = fPhi;
- ((AliTRDgtuTrack &) t).fEta = fEta;
- ((AliTRDgtuTrack &) t).fLabel = fLabel;
- ((AliTRDgtuTrack &) t).fPID = fPID;
- ((AliTRDgtuTrack &) t).fIsElectron = fIsElectron;
-
-}
-
-//_____________________________________________________________________________
-AliTRDgtuTrack::~AliTRDgtuTrack()
-{
- //
- // Destructor
- //
-
- if (fTracklets) {
- //fTracklets->Delete();
- fTracklets->Clear();
- delete fTracklets;
- fTracklets = 0;
- }
-
-}
-
-//_____________________________________________________________________________
-void AliTRDgtuTrack::AddTracklet(AliTRDltuTracklet *trk)
-{
- //
- // Add a LTU tracklet to this track
- //
-
- Tracklets()->Add(trk);
-
-}
-
-//_____________________________________________________________________________
-AliTRDltuTracklet *AliTRDgtuTrack::GetTracklet(Int_t pos) const
-{
- //
- // Return LTU tracklet at position "pos"
- //
-
- if (fTracklets == 0) {
- return 0;
- }
- void *trk = fTracklets->UncheckedAt(pos);
- if (trk == 0) {
- return 0;
- }
-
- return (AliTRDltuTracklet *) trk;
-
-}
-
-//_____________________________________________________________________________
-Int_t AliTRDgtuTrack::Compare(const TObject *o) const
-{
- //
- // Compare function for sorting the tracks
- //
-
- AliTRDgtuTrack *gtutrack = (AliTRDgtuTrack *) o;
-
- if (fYproj < gtutrack->GetYproj()) {
- return -1;
- }
- if (fYproj == gtutrack->GetYproj()) {
- return 0;
- }
-
- return +1;
-
-}
-
-//_____________________________________________________________________________
-void AliTRDgtuTrack::Reset()
-{
- //
- // Reset the track information
- //
-
- fYproj = 0.0;
- fZproj = 0.0;
- fSlope = 0.0;
- fDetector = -1;
- fNtracklets = 0;
- fNplanes = 0;
- fNclusters = 0;
- fPt = 0.0;
- fPhi = 0.0;
- fEta = 0.0;
- fLabel = -1;
- fPID = 0.0;
- fIsElectron = kFALSE;
-
-}
-
-//_____________________________________________________________________________
-void AliTRDgtuTrack::Track(Float_t xpl, Float_t field)
-{
- //
- // Calculate the kinematics of the found track
- //
-
- Int_t i = 0;
- Int_t iDet = 0;
- Int_t nDet = 0;
- Bool_t newDetector;
-
- AliTRDltuTracklet *trk;
- Int_t nTracklets = GetNtracklets();
- Float_t fC[kNmaxTrk][3]; // X, Y, Z coordinates of segments
-
- fYproj = 0.0;
- fZproj = 0.0;
- fSlope = 0.0;
- fNclusters = 0;
- fNplanes = 0;
- fNtracklets = GetNtracklets();
- Int_t inDetector[kNlayer];
- for (i = 0; i < kNlayer; i++) {
- inDetector[i] = -1;
- }
-
- for (i = 0; i < nTracklets; i++) {
-
- trk = GetTracklet(i);
- fYproj += trk->GetYproj(xpl);
- fZproj += trk->GetZproj(xpl);
- fSlope += trk->GetSlope();
- fNclusters += trk->GetNclusters();
- iDet = trk->GetDetector();
-
- newDetector = kTRUE;
- for (Int_t id = 0; id < nDet; id++) {
- if (iDet == inDetector[id]) {
- newDetector = kFALSE;
- break;
- }
- }
- if (newDetector) {
- inDetector[nDet++] = iDet;
- fNplanes++;
- }
-
- fC[i][0] = trk->GetTime0();
- fC[i][1] = trk->GetOffset();
- fC[i][2] = trk->GetRowz();
-
- }
- fYproj /= (Float_t) nTracklets;
- fZproj /= (Float_t) nTracklets;
- fSlope /= (Float_t) nTracklets;
-
- Float_t x[kNmaxTrk+1];
- Float_t y[kNmaxTrk+1];
- Float_t z[kNmaxTrk+1];
- Bool_t count[kNmaxTrk];
- for (i = 0; i < kNmaxTrk; i++) {
- count[i] = kFALSE;
- }
-
- Int_t iXmin = -1;
- Int_t j = 0;
- x[0] = y[0] = z[0] = 0.0;
- while (j < nTracklets) {
- iXmin = -1;
- for (i = 0; i < nTracklets; i++) {
- if (count[i]) continue;
- if (iXmin == -1) {
- iXmin = i;
- continue;
- }
- if (fC[i][0] < fC[iXmin][0]) {
- iXmin = i;
- }
- }
- x[j+1] = fC[iXmin][0];
- y[j+1] = fC[iXmin][1];
- z[j+1] = fC[iXmin][2];
- j++;
- count[iXmin] = kTRUE;
- }
-
- TMatrixD smatrix(2,2);
- TMatrixD sums(2,1);
- TMatrixD res(2,1);
- Double_t xv, yv;
- Float_t a, b;
-
- smatrix.Zero();
- sums.Zero();
- for (i = 0; i < nTracklets; i++) {
- xv = (Double_t) x[i+1];
- yv = (Double_t) y[i+1];
- smatrix(0,0) += 1.0;
- smatrix(1,1) += xv*xv;
- smatrix(0,1) += xv;
- smatrix(1,0) += xv;
- sums(0,0) += yv;
- sums(1,0) += xv*yv;
- }
- res = smatrix.Invert() * sums;
- a = res(0,0);
- b = res(1,0);
-
- Float_t dist = AliTRDgeometry::GetTime0(1) - AliTRDgeometry::GetTime0(0);
- Float_t fx1 = x[1] + dist * (Float_t) (nTracklets-1) / 6.0;
- Float_t fy1 = a + b * fx1;
- Float_t fx2 = x[nTracklets] - dist * (Float_t) (nTracklets-1) / 6.0;
- Float_t fy2 = a + b * fx2;
- Float_t d12 = TMath::Sqrt((fx2-fx1)*(fx2-fx1)+(fy2-fy1)*(fy2-fy1));
- Float_t alpha = TMath::ATan(fy2/fx2) - TMath::ATan(fy1/fx1);
- Float_t r = (d12 / 2.0) / TMath::Sin(alpha);
-
- fPt = 0.3 * field * 0.01 * r;
-
- Float_t d1 = fx1*fx1 + fy1*fy1;
- Float_t d2 = fx2*fx2 + fy2*fy2;
- Float_t d = fx1*fy2 - fx2*fy1;
-
- Float_t xc = (d1*fy2 - d2*fy1) / (2.0*d);
- Float_t yc = (d2*fx1 - d1*fx2) / (2.0*d);
-
- if (yc != 0.0) {
- fPhi = TMath::ATan(xc/yc);
- }
- else {
- fPhi = TMath::PiOver2();
- }
-
- fPhi *= 180.0/TMath::Pi();
-
- smatrix.Zero();
- sums.Zero();
- for (i = 0; i < nTracklets+1; i++) {
- xv = (Double_t) z[i];
- yv = (Double_t) x[i];
- smatrix(0,0) += 1.0;
- smatrix(1,1) += xv*xv;
- smatrix(0,1) += xv;
- smatrix(1,0) += xv;
- sums(0,0) += yv;
- sums(1,0) += xv*yv;
- }
- res = smatrix.Invert() * sums;
- a = res(0,0);
- b = res(1,0);
- Float_t theta = TMath::ATan(b);
-
- if (theta < 0.0) {
- theta = TMath::Pi() + theta;
- }
- if (theta == 0.0) {
- fEta = 0.0;
- }
- else {
- fEta = -TMath::Log(TMath::Tan(theta/2.0));
- }
-
-}
-
-//_____________________________________________________________________________
-void AliTRDgtuTrack::MakePID()
-{
- //
- // Electron likelihood signal
- //
-
- Int_t i = 0;
-
- // Avoid dependency on libTRDrec.pkg (CBL)
- //AliTRDcalibDB *calibration = AliTRDcalibDB::Instance();
- //if (!calibration) {
- // AliError("No instance of AliTRDcalibDB.");
- // return;
- //}
- //
- //AliTRDrecoParam *rec = AliTRDReconstructor::RecoParam();
- //if (!rec) {
- // AliError("No TRD reco param.");
- // return;
- //}
- //const AliTRDCalPID *pd = calibration->GetPIDObject(rec->GetPIDMethod());
-
- AliTRDltuTracklet *trk;
- Int_t nTracklets = GetNtracklets();
- Int_t det;
- Int_t pla;
- Float_t sl;
- Float_t th;
- Float_t q;
- Float_t probPio = 1.0;
- Float_t probEle = 1.0;
-
- for (i = 0; i < nTracklets; i++) {
-
- trk = GetTracklet(i);
-
- sl = TMath::Abs(trk->GetSlope()); // Tracklet inclination in X-y plane
- th = trk->GetRowz()/trk->GetTime0(); // Tracklet inclination in X-z plane
- th = TMath::ATan(TMath::Abs(th));
-
- q = trk->GetQ()
- * TMath::Cos(sl/180.0*TMath::Pi())
- * TMath::Cos(th/180.0*TMath::Pi());
-
- det = trk->GetDetector();
- pla = trk->GetPlane(det);
-
- // Unclear yet factor to match the PS distributions = 5.8
- // not explained only by the tail filter ...
- // AliRoot v4-03-07 , v4-03-Release
- //q = q * 5.8;
-
- // HEAD28Mar06
- // Temporary (B. Vulpescu):
- // The charge distributions do not match the new changes in simulation (A. Bercuci),
- // which are nevertheless now in agreement with the beam tests.
- // Some tricks will be used to still have reasonable results
- // To match the existing charge distributions, the charge per layer has to be modified
- // as folows:
- /*
- if (k == 0) {
- // electrons
- q = 4.3 * q + 95.0;
- } else {
- // others
- q = 4.2 * q + 70.0;
- }
- */
- // Since at tracking time we have no information on the particle type, we will modify
- // instead the charge distributions accordingly. This will slow down the sampling.
- // The modified distributions are in TRDdEdxHistogramsV1_BV.root and the CDB has
- // been regenerated with AliTRDCreateDummyCDB.C
- // The new PIDLQ data base has the version :
- // I-AliCDBLocal::Get: CDB object retrieved: path "TRD/Calib/PIDLQ"; run range [0,0];
- // version v0_s1
-
- // HEAD28Mar06 new distributions: factor = 6.0
-
- // A.Bercuci on 2nd May 2007
- // Temporary modification to deal with more energy slices. The values
- // attached to charge slices and track length are dummy
- Float_t dedx[3];
- dedx[0] = dedx[1] = q*3.; dedx[2] = 0.;
- //Float_t length = 3.7;
-
- //probEle *= pd->GetProbability(0, TMath::Abs(fPt), dedx, length, 0);
- //probPio *= pd->GetProbability(2, TMath::Abs(fPt), dedx, length, 0);
-
- }
-
- if ((probEle + probPio) > 0.0) {
- fPID = probEle/(probEle + probPio);
- }
- else {
- fPID = 0.0;
- }
-
- // Thresholds for LQ cut at 90% electron efficiency (from AliRoot v4-03-07)
- // P [GeV/c] fPIDcut (between 0 and 1)
- // 2 0.925
- // 3 0.915
- // 4 0.875
- // 5 0.855
- // 6 0.845
- // 8 0.785
- // 10 0.735
- //
- // PIDcut = 0.978 - 0.024 * P[GeV/c]
- //Float_t PIDcut = 0.978 - 0.024 * TMath::Abs(fPt);
-
- // HEAD28Mar06 with modified distributions (A. Bercuci changes, P. Shukla distributions)
- //Float_t fPIDcut = 0.829 - 0.032 * TMath::Abs(fPt);
-
- // HEAD28Mar06 with new generated distributions (pol2 fit)
- Float_t absPt = TMath::Abs(fPt);
- //Float_t fPIDcut = 0.9575 - 0.0832 * absPt + 0.0037 * absPt*absPt; // 800 bins in dEdx
- Float_t fPIDcut = 0.9482 - 0.0795 * absPt + 0.0035 * absPt*absPt; // 200 bins in dEdx
-
- fIsElectron = kFALSE;
- if (fPID >= fPIDcut) {
- fIsElectron = kTRUE;
- }
-
-}
-
-//_____________________________________________________________________________
-void AliTRDgtuTrack::CookLabel()
-{
- //
- // Cook the track label from tracklets labels
- //
-
- AliTRDltuTracklet *trk;
-
- const Int_t kMaxTracks = 10;
- Int_t trackLabel[kMaxTracks];
- Int_t trackCount[kMaxTracks];
- for (Int_t it = 0; it < kMaxTracks; it++) {
- trackLabel[it] = -1;
- trackCount[it] = 0;
- }
-
- Bool_t counted;
- Int_t label;
- Int_t nTracks = 0;
- for (Int_t itrk = 0; itrk < fNtracklets; itrk++) {
-
- trk = GetTracklet(itrk);
-
- if (trk->GetLabel() == -1) {
- continue;
- }
-
- label = trk->GetLabel();
-
- counted = kFALSE;
- for (Int_t it = 0; it < nTracks; it++) {
- if (label == trackLabel[it]) {
- trackCount[it]++;
- counted = kTRUE;
- break;
- }
- }
- if (!counted) {
- trackLabel[nTracks] = label;
- trackCount[nTracks]++;
- nTracks++;
- if (nTracks == kMaxTracks) {
- Warning("CookLabel","Too many tracks for this tracklet.");
- nTracks--;
- break;
- }
- }
-
- }
-
- Float_t frac = 4.0 / 5.0;
- for (Int_t it = 0; it < kMaxTracks; it++) {
- if (trackCount[it] >= (Int_t) (frac*fNtracklets)) {
- fLabel = trackLabel[it];
- break;
- }
- }
-
-}
-
-//_____________________________________________________________________________
-void AliTRDgtuTrack::ResetTracklets()
-{
- //
- // Resets the list of tracklets
- //
-
- if (fTracklets) {
- //fTracklets->Delete();
- fTracklets->Clear();
- }
-
-}
-
-//_____________________________________________________________________________
-TObjArray *AliTRDgtuTrack::Tracklets()
-{
- //
- // Returns the list of tracklets
- //
-
- if (!fTracklets) {
- fTracklets = new TObjArray(400);
- }
-
- return fTracklets;
-
-}
-
-//_____________________________________________________________________________
-Int_t AliTRDgtuTrack::GetNtracklets() const
-{
- //
- // Returns the number of tracklets
- //
-
- if (fTracklets) {
- return fTracklets->GetEntriesFast();
- }
-
- return 0;
-
-}
+++ /dev/null
-#ifndef ALITRDGTUTRACK_H
-#define ALITRDGTUTRACK_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// TRD module global track (GTU) //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-#include <TObject.h>
-
-class AliTRDltuTracklet;
-
-class AliTRDgtuTrack : public TObject {
-
- public:
-
- enum { kNmaxTrk = 12, kNlayer = 6 };
-
- AliTRDgtuTrack();
- AliTRDgtuTrack(const AliTRDgtuTrack &t);
- virtual ~AliTRDgtuTrack();
- AliTRDgtuTrack &operator=(const AliTRDgtuTrack &t);
-
- virtual void Copy(TObject &t) const;
-
- Bool_t IsSortable() const { return kTRUE; }
- virtual Int_t Compare(const TObject *o) const;
- void Reset();
- void ResetTracklets();
- void Track(Float_t xpl, Float_t field);
- void CookLabel();
- void SetDetector(Int_t det) { fDetector = det; };
- void MakePID();
- void AddTracklet(AliTRDltuTracklet *trk);
- Int_t GetNtracklets() const;
-
- AliTRDltuTracklet *GetTracklet(Int_t pos) const;
- TObjArray *Tracklets();
-
- Float_t GetYproj() const { return fYproj; };
- Float_t GetZproj() const { return fZproj; };
- Float_t GetSlope() const { return fSlope; };
- Int_t GetTracklets() const { return fNtracklets; };
- Int_t GetPlanes() const { return fNplanes; };
- Int_t GetClusters() const { return fNclusters; };
- Float_t GetPt() const { return fPt; };
- Float_t GetPhi() const { return fPhi; };
- Float_t GetEta() const { return fEta; };
- Int_t GetLabel() const { return fLabel; };
- Int_t GetDetector() const { return fDetector; };
- Float_t GetPID() const { return fPID; };
- Bool_t IsElectron() const { return fIsElectron; };
-
- protected:
-
- TObjArray *fTracklets; //! Array of LTU tracklets
-
- Float_t fYproj; // Average y-projection
- Float_t fZproj; // Average z-projection
- Float_t fSlope; // Average slope
-
- Int_t fDetector; // First detector in the module
-
- Int_t fNtracklets; // Number of tracklets
- Int_t fNplanes; // Number of TRD planes
- Int_t fNclusters; // Total number of clusters
-
- Float_t fPt; // Transverse momentum
- Float_t fPhi; // Phi angle at the vertex
- Float_t fEta; // Eta at the vertex
- Int_t fLabel; // Track label
- Float_t fPID; // PID electron likelihood
- Bool_t fIsElectron; // Electron flag
-
- ClassDef(AliTRDgtuTrack,2) // TRD module global track (GTU)
-
-};
-
-#endif
+++ /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. *
- **************************************************************************/
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// //
-// TRD chamber local track (LTU, tracklet) //
-// //
-// Author: //
-// Bogdan Vulpescu //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-#include <TMath.h>
-
-#include "AliTRDltuTracklet.h"
-
-ClassImp(AliTRDltuTracklet)
-
-//_____________________________________________________________________________
-AliTRDltuTracklet::AliTRDltuTracklet()
- :TObject()
- ,fX(0)
- ,fY(0)
- ,fSlope(0)
- ,fRowz(0)
- ,fDetector(0)
- ,fRow(0)
- ,fNclusters(0)
- ,fLabel(0)
- ,fQ(0)
-{
- //
- // AliTRDltuTracklet default constructor
- //
-
-}
-
-//_____________________________________________________________________________
-AliTRDltuTracklet::AliTRDltuTracklet(Int_t det, Int_t row, Float_t rowz
- , Float_t slope, Float_t offset, Float_t time
- , Int_t ncl, Int_t label, Float_t q)
- :TObject()
- ,fX(time)
- ,fY(offset)
- ,fSlope(slope)
- ,fRowz(rowz)
- ,fDetector(det)
- ,fRow(row)
- ,fNclusters(ncl)
- ,fLabel(label)
- ,fQ(q)
-{
- //
- // AliTRDltuTracklet constructor
- //
-
-}
-
-//_____________________________________________________________________________
-AliTRDltuTracklet::~AliTRDltuTracklet()
-{
- //
- // Destructor
- //
-
-}
-
-//_____________________________________________________________________________
-Float_t AliTRDltuTracklet::GetPt(Float_t field) const
-{
- //
- // Transverse momentum calculation
- // Curvature R = (fX*fX + fY*fY) / (2 * sin(alpha))
- // alpha = angle deviation from "infinite momentum"
- //
- // Consistent with AliTRDmcmTracklet::GetPt(...)
- //
-
- Float_t infSlope = TMath::ATan(fY/fX) / TMath::Pi()*180.0;
- Float_t alpha = fSlope - infSlope;
- Float_t r = TMath::Sqrt(fX*fX + fY*fY)
- / (2.0 * TMath::Sin(alpha/180.0*TMath::Pi()));
-
- Float_t pt = 0.3 * field * 0.01 * r;
-
- return pt;
-
-}
-
-//_____________________________________________________________________________
-Int_t AliTRDltuTracklet::Compare(const TObject *o) const
-{
- //
- // compare two LTU tracklets according to the intercept point Y1
- //
-
- AliTRDltuTracklet *ltutrk = (AliTRDltuTracklet *) o;
-
- if (fRow != ltutrk->fRow) {
- return +1;
- }
- if (fDetector != ltutrk->fDetector) {
- return +1;
- }
-
- if (fY < ltutrk->fY) {
- return -1;
- }
- if (fY == ltutrk->fY) {
- return 0;
- }
-
- return 1;
-
-}
-
-//_____________________________________________________________________________
-Float_t AliTRDltuTracklet::GetYproj(Float_t xpl) const
-{
- //
- // y-projection (bending plane) onto the median plane
- //
-
- Float_t yproj = fY + TMath::Tan(fSlope/180.0*TMath::Pi()) * (xpl - fX);
-
- return yproj;
-
-}
-
-//_____________________________________________________________________________
-Float_t AliTRDltuTracklet::GetZproj(Float_t xpl) const
-{
- //
- // z-projection (using pad row center) onto the median plane
- //
-
- Float_t zproj = fRowz * xpl / fX;
-
- return zproj;
-
-}
-
+++ /dev/null
-#ifndef ALITRDLTUTRACKLET_H
-#define ALITRDLTUTRACKLET_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// TRD LTU tracklet //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-#include <TObject.h>
-
-class AliTRDltuTracklet : public TObject {
-
- public:
-
- enum { kNplan = 6 };
-
- AliTRDltuTracklet();
- AliTRDltuTracklet(Int_t det, Int_t row, Float_t rowz, Float_t slope, Float_t offset
- ,Float_t time, Int_t ncl, Int_t label, Float_t q);
- virtual ~AliTRDltuTracklet();
-
- Bool_t IsSortable() const { return kTRUE; }
- virtual Int_t Compare(const TObject *o) const;
-
- Int_t GetDetector() const { return fDetector; };
- Int_t GetPlane(Int_t det) const { return ((Int_t) (det % kNplan)); };
- Int_t GetRow() const { return fRow; };
- Int_t GetNclusters() const { return fNclusters; };
- Float_t GetSlope() const { return fSlope; };
- Float_t GetOffset() const { return fY; };
- Float_t GetTime0() const { return fX; };
- Float_t GetRowz() const { return fRowz; };
- Float_t GetYproj(Float_t xpl) const;
- Float_t GetZproj(Float_t xpl) const;
- Int_t GetLabel() const { return fLabel; };
- Float_t GetPt(Float_t field) const;
- Float_t GetQ() const { return fQ; };
-
- protected:
-
- Float_t fX; // Distance vertex to entrance window
- Float_t fY; // Tracklet offset at entrance window
- Float_t fSlope; // Tracklet slope
- Float_t fRowz; // z coordinate of the pad row center
- Int_t fDetector; // Detector number
- Int_t fRow; // Pad row number
- Int_t fNclusters; // Number of clusters
- Int_t fLabel; // MC track label
- Float_t fQ; // Charge sum divided by number of clusters
-
- ClassDef(AliTRDltuTracklet,2) // LTU tracklet
-
-};
-
-#endif
#include "AliTRDtrackletGTU.h"
#include "AliTRDtrackletWord.h"
-#include "AliTRDmcmTracklet.h"
#include "AliTRDtrackletMCM.h"
#include "AliLog.h"
#include "AliTRDgtuParam.h"
+++ /dev/null
-/**************************************************************************\r
-* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
-* *\r
-* Author: The ALICE Off-line Project. *\r
-* Contributors are mentioned in the code where appropriate. *\r
-* *\r
-* Permission to use, copy, modify and distribute this software and its *\r
-* documentation strictly for non-commercial purposes is hereby granted *\r
-* without fee, provided that the above copyright notice appears in all *\r
-* copies and that both the copyright notice and this permission notice *\r
-* appear in the supporting documentation. The authors make no claims *\r
-* about the suitability of this software for any purpose. It is *\r
-* provided "as is" without express or implied warranty. *\r
-**************************************************************************/\r
-\r
-/* $Id: AliTRDtrapAlu.cxx 25891 2008-05-19 14:58:18Z fca $ */\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-// //\r
-// TRAP-ALU implementation //\r
-// //\r
-// Author: //\r
-// Clemens Haltebourg <halteb@physi.uni-heidelberg.de> //\r
-// //\r
-// Usage of the class: //\r
-// Declaration of class instances: AliTRDtrapAlu a,b,c; //\r
-// Initialization: a.Init(2,11); b.Init(4,4); c.Init(5,4);//\r
-// Assigning values: a.AssignDouble(5.7); b.AssignInt(3); //\r
-// (you can also do b.AssignDouble(3) with same effect); //\r
-// Calculation: c = a*b; //\r
-// Test if c has right value: c.WriteWord(); //\r
-// Don't declare pointers; operators not overridden for pointer types; //\r
-// You have to dereference yourself; //\r
-// Use operators +,-,*,/ only with instances of the class; don't do //\r
-// things like c=a*2 but rather b.AssignInt(2); c=a*b; //\r
-// //\r
-///////////////////////////////////////////////////////////////////////////////\r
-\r
-#include "AliTRDtrapAlu.h"\r
-\r
-ClassImp(AliTRDtrapAlu)\r
-\r
-//_____________________________________________________________________________ \r
-AliTRDtrapAlu::AliTRDtrapAlu():TObject()\r
-\r
- ,fValue(0)\r
- ,fPreCom(0)\r
- ,fPostCom(0)\r
- ,fuRestriction(0)\r
- ,flRestriction(0)\r
- ,fSigned(kFALSE)\r
-\r
-{\r
- \r
- // default constructor\r
- \r
-}\r
-\r
-//_____________________________________________________________________________ \r
-AliTRDtrapAlu::~AliTRDtrapAlu(){\r
- //destructor\r
-}\r
-\r
-//_____________________________________________________________________________ \r
-void AliTRDtrapAlu::Init(const Int_t& precom, const Int_t& postcom, const Int_t& lRestriction, const Int_t& uRestriction){\r
- // initialization: characterizes the bit-word (nr of pre- and post-comma bits, boundaries)\r
- fPostCom = postcom;\r
- fPreCom = precom;\r
- fValue = 0; //currently, re-initialization kills the value\r
- fSigned = kFALSE;\r
-\r
- if (fPreCom + fPostCom > 32 || fPreCom > 31) {fPreCom = 1; fPostCom = 0;return;} // prevent pre-comma part exceeding 31 spaces\r
- if (fPreCom <= 0) {fPreCom = 1;}\r
- if (fPostCom < 0) {fPostCom = 0;}\r
- \r
- Int_t lut = LUT(fPreCom + fPostCom)-1;\r
- if (uRestriction <= -1 || uRestriction > lut) {fuRestriction = lut;}\r
- else {fuRestriction = uRestriction;}\r
- if (lRestriction <= -1 || lRestriction > fuRestriction) {flRestriction = -lut;}\r
- else {flRestriction = lRestriction;}\r
- // up to now you can only choose a non-negative lower restriction (e.g. if you want your values to be >=0) ; can't deal with asymmetric borders; have to be implemented if needed\r
-}\r
-\r
-//_____________________________________________________________________________ \r
-Double_t AliTRDtrapAlu::GetValueWhole() const { \r
- // get the actual value (respecting pre- and post-comma parts) in integer-description\r
- Double_t valPre = (Double_t)(fValue>>fPostCom);\r
- Double_t valPost = 0.0;\r
- for(Int_t i = 0; i<=fPostCom-1; i++){\r
- Double_t num = (fValue>>i)&1;\r
- Double_t denom = LUT(fPostCom-i);\r
- valPost = valPost + num/denom;\r
- }\r
- Double_t val = valPre + valPost;\r
- return val;\r
- }\r
-\r
-//_____________________________________________________________________________ \r
-void AliTRDtrapAlu::WriteWord(){\r
- // for debugging purposes\r
- printf("bit-word: ");\r
- if (fSigned == true) printf("-");\r
- for(Int_t i = fPostCom + fPreCom - 1; i >= fPostCom; i--){ //read from behind in order to write the word from left to right\r
- printf("%d",(fValue>>i) & 1);\r
- }\r
- printf(".");\r
- for (Int_t j = fPostCom - 1; j >= 0; j--){\r
- printf("%d",(fValue>>j) & 1);\r
- }\r
- printf("\n");\r
- \r
-}\r
-\r
-//_____________________________________________________________________________ \r
-AliTRDtrapAlu& AliTRDtrapAlu::AssignInt(const Int_t& first){ \r
- // assign an integer\r
-\r
- // parameter "first" is an integer for the pre-comma part (not UInt in order to match the error case first<0)\r
- fSigned = kFALSE;\r
- Int_t exponent = fPreCom + fPostCom;\r
-\r
- \r
- if (first<0) {\r
- fValue = 0; //setting fValue to 0; first should not be negative\r
- fValue = fValue & 0;\r
- return *this;\r
- }\r
-\r
- if (CheckUSize(first<<fPostCom) == kFALSE){\r
- \r
- //setting fValue to maximum; first was to big\r
- fValue = fuRestriction;\r
- fValue = fValue & (LUT(exponent)-1);\r
- return *this;\r
- }\r
-\r
- if (CheckLSize(first<<fPostCom) == kFALSE){\r
- \r
- //setting fValue to minimum; first was to small\r
- fValue = flRestriction;\r
- fValue = fValue & (LUT(exponent)-1);\r
- return *this;\r
- }\r
-\r
- \r
- fValue = first;\r
- fValue = fValue<<fPostCom; \r
- fValue = fValue & (LUT(exponent)-1);\r
- \r
- return *this;\r
- \r
-}\r
-\r
-//_____________________________________________________________________________ \r
-AliTRDtrapAlu& AliTRDtrapAlu::AssignDouble(const Double_t& first){\r
- // assign a double\r
- \r
- fSigned = kFALSE;\r
- Int_t exponent = fPreCom + fPostCom;\r
- Int_t firstPre = 0; //integer part of first\r
- Int_t firstPost = 0; //comma part of first (cut off with enough accuracy\r
- Int_t c = 0;\r
- Double_t firstPreFloat = 0;\r
- \r
- \r
- Int_t power1 = LUT(exponent);\r
- \r
- firstPre = (Int_t)first;\r
- firstPreFloat = firstPre;\r
- \r
- if(firstPre < 0){\r
- fValue = 0;\r
- fValue = fValue & 0;\r
- return *this;\r
- }\r
- \r
- if(CheckUSize((Int_t)(first*LUT(fPostCom))) == kFALSE){\r
- \r
- //fValue = MakePower(2,fPreCom) - 1;\r
- fValue = fuRestriction;\r
- fValue = fValue & (power1 - 1);\r
- return *this;\r
- }\r
- \r
- if(CheckLSize((Int_t)(first*LUT(fPostCom))) == kFALSE){\r
- \r
- //fValue = MakePower(2,fPreCom) - 1;\r
- fValue = flRestriction;\r
- fValue = fValue & (power1 - 1);\r
- return *this;\r
- }\r
- \r
-\r
- fValue = firstPre;\r
- \r
- //get post comma part with adequate accuracy\r
- firstPost = (Int_t)((first - firstPreFloat)*LUT(fPostCom));\r
- for(Int_t i = 1; i <= fPostCom; i++) {\r
- c = (firstPost>>(fPostCom - i)) & 1;\r
- fValue = fValue<<1;\r
- fValue = fValue | c;\r
- }\r
-\r
- fValue = fValue & (power1 - 1);\r
- return *this;\r
-}\r
-\r
-//_____________________________________________________________________________ \r
-AliTRDtrapAlu& AliTRDtrapAlu::operator=(const AliTRDtrapAlu& binary){\r
- // assign an object of type AliTRDtrapAlu\r
-\r
- Int_t c = 0;\r
- //Int_t exponent = fPreCom + fPostCom;\r
- \r
- \r
- Int_t power1 = LUT(fPreCom + fPostCom);\r
-\r
- fValue = binary.GetValue(); // in case this==&binary : binary's values are overwritten\r
- Int_t diffPost = binary.GetPost()-fPostCom;\r
- Int_t check = 0;\r
- if(diffPost<0) check = fValue<<(-diffPost);\r
- else check = fValue>>(diffPost);\r
- if (CheckUSize(check)==kFALSE){ //checking size of pre-comma part\r
- \r
- //setting fValue to maximum\r
- \r
- \r
- fValue = fuRestriction; // fuRestriction >= 0 \r
- fValue = fValue & (power1 - 1);\r
- fSigned = kFALSE;\r
- return *this;\r
- }\r
-\r
- Int_t val = (binary.GetSign()==kFALSE) ? check : -check; \r
- if (CheckLSize(val)==kFALSE){ //checking size of pre-comma part\r
- \r
- //setting fValue to minimum\r
- \r
- \r
- if (flRestriction < 0) {\r
- fValue = -flRestriction;\r
- fSigned = kTRUE;\r
- }\r
- else {\r
- fValue = flRestriction;\r
- fSigned = kFALSE;\r
- }\r
- fValue = fValue & (power1 - 1);\r
- return *this;\r
- }\r
- \r
- if (this == & binary) return *this;\r
- \r
- fSigned = kFALSE;\r
- Int_t iValue = fValue;\r
- fValue = fValue>>(binary.GetPost()); //only keep the valid pre-comma bits\r
- \r
- //append existing post-comma bits to fValue; cut off or add 0 if post-comma numbers don`t match\r
- for(Int_t i = 1; i <= fPostCom; i++){\r
- if(i <= (binary.GetPost())){\r
- c = ((iValue)>>(binary.GetPost()-i)) & 1;\r
- }\r
- else{\r
- c = 0;\r
- }\r
- fValue = fValue<<1;\r
- fValue = fValue | c;\r
- }\r
- \r
- fValue = fValue & (power1 - 1);\r
- fSigned = binary.GetSign();\r
- return *this;\r
-}\r
-\r
-//_____________________________________________________________________________ \r
-AliTRDtrapAlu AliTRDtrapAlu::operator+(const AliTRDtrapAlu& binary){ \r
- // + operator\r
-\r
- //no const parameter because referenced object will be changed\r
- \r
- AliTRDtrapAlu alu;\r
- \r
- Int_t binPre = binary.GetPre();\r
- Int_t binPost = binary.GetPost();\r
- Int_t binVal = binary.GetValue();\r
- \r
- Int_t min = Min(binPost,fPostCom);\r
- Int_t max = Max(binPre,fPreCom);\r
- \r
- Int_t shift = binPost - min;\r
- Int_t add1 = (binVal)>>(shift); //for addition: cut off at minimum accuracy\r
- shift = fPostCom - min;\r
- Int_t add2 = fValue>>(shift);\r
- if(binary.GetSign() == kTRUE) add1 = -add1;\r
- if(fSigned == kTRUE) add2 = -add2;\r
- Int_t add = add1 + add2;\r
- \r
- /*\r
- //because the parameter "binary" could be a reference to the object to which Mem() is a reference, do not change Mem() until you have extracted all information from "binary"; otherwise you change the information you would like to read\r
- Mem().Init(max + 1,min); //buffer: enough space for pre-comma,post-comma according to accuracy\r
- Mem().AssignFormatted(Max(add,-add));\r
- Mem().SetSign(add);\r
- \r
-\r
- //Mem().FastInit(max+1,min,add);\r
- return Mem();*/\r
- \r
- alu.Init(max + 1,min); //buffer: enough space for pre-comma,post-comma according to accuracy\r
- alu.AssignFormatted(Max(add,-add));\r
- alu.SetSign(add);\r
- \r
- return alu;\r
-\r
-}\r
-\r
-//_____________________________________________________________________________ \r
-AliTRDtrapAlu AliTRDtrapAlu::operator-(const AliTRDtrapAlu& binary){\r
- // - operator \r
-\r
- AliTRDtrapAlu alu;\r
-\r
- Int_t binPre = binary.GetPre();\r
- Int_t binPost = binary.GetPost();\r
- Int_t binVal = binary.GetValue();\r
-\r
-\r
- Int_t min = Min(binPost,fPostCom);\r
- Int_t max = Max(binPre,fPreCom);\r
-\r
- Int_t shift = binPost - min;\r
- Int_t sub1 = (binVal)>>(shift); //for addition: cut off at minimum accuracy\r
- shift = fPostCom - min;\r
- Int_t sub2 = fValue>>(shift);\r
- if(binary.GetSign() == kTRUE) sub1 = -sub1;\r
- if(fSigned == kTRUE) sub2 = -sub2;\r
- Int_t sub = sub2 - sub1; // order of subtraction is important\r
- \r
-/*\r
- Mem().Init(max + 1,min); //buffer: enough space for pre-comma, post-comma according to accuracy\r
- Mem().AssignFormatted(Max(sub,-sub)); \r
- Mem().SetSign(sub);\r
- //Mem().FastInit(max+1,min,sub);\r
- return Mem();*/\r
- \r
- alu.Init(max + 1,min);\r
- alu.AssignFormatted(Max(sub,-sub)); \r
- alu.SetSign(sub);\r
-\r
- return alu;\r
-\r
-} \r
-\r
-//_____________________________________________________________________________ \r
-AliTRDtrapAlu AliTRDtrapAlu::operator*(const AliTRDtrapAlu& binary){\r
- // * operator\r
- \r
- AliTRDtrapAlu alu;\r
-\r
- Int_t binPre = binary.GetPre();\r
- Int_t binPost = binary.GetPost();\r
-\r
-\r
- Int_t min = Min(binPost,fPostCom);\r
- Int_t max = Max(binPre,fPreCom);\r
-\r
- \r
- Int_t mult1 = binary.GetValue();\r
- Int_t mult2 = fValue;\r
- Int_t shift = (Int_t)(fPostCom + binPost - min);\r
- Double_t fmult1 = (Double_t)mult1;\r
- Double_t fmult2 = (Double_t)mult2;\r
- (fmult1 > fmult2) ? fmult1 = fmult1/LUT(shift) : fmult2 = fmult2/LUT(shift);\r
- \r
- \r
- if (binary.GetSign() == kTRUE) fmult1 = -fmult1;\r
- if (fSigned == kTRUE) fmult2 = -fmult2;\r
- Double_t fmult = fmult1*fmult2;\r
- Int_t mult = (Int_t)fmult;\r
- Int_t sign = 1;\r
- if(mult<0) sign = -1;\r
- mult = Max(mult,-mult);\r
- //Int_t shift = fPostCom + binPost - min;\r
- //mult = mult>>(shift);\r
-\r
-/*\r
- Mem().Init(2 * max + 1, min); // +1 to consider the borrow from the past-comma part; accuracy of past-comma part is determined by the minimum; therefore, for the result not more accuracy is guaranteed\r
- // be aware that this only works if 2*max+1+min <= 32!! adjusting the pre-comma place to the value would consume too much time\r
-\r
- Mem().AssignFormatted(mult);\r
- Mem().SetSign(sign);\r
- //mult = sign*mult;\r
- //Mem().FastInit(2*max+1,min,mult);\r
- return Mem();*/\r
- \r
- alu.Init(2 * max + 1, min); // +1 to consider the borrow from the past-comma part; accuracy of past-comma part is determined by the minimum; therefore, for the result not more accuracy is guaranteed\r
-// be aware that this only works if 2*max+1+min <= 32!! adjusting the pre-comma place to the value would consume too much time\r
-\r
- alu.AssignFormatted(mult);\r
- alu.SetSign(sign);\r
- \r
- return alu;\r
-}\r
- \r
-//_____________________________________________________________________________ \r
-AliTRDtrapAlu AliTRDtrapAlu::operator/(const AliTRDtrapAlu& binary){\r
- // / operator\r
- \r
- AliTRDtrapAlu alu;\r
-\r
- Int_t binPre = binary.GetPre();\r
- Int_t binPost = binary.GetPost();\r
- Int_t min = Min(binPost,fPostCom);\r
- Int_t max = Max(binPre,fPreCom);\r
- \r
- Int_t div1 = binary.GetValue(); //value in integer format\r
- Int_t div2 = fValue;\r
- \r
- // this approach does not always work because it can exceed the range of integers\r
- //Int_t numerator = div2 * LUT(min);\r
- Int_t numerator = div2;\r
- if (fSigned == kTRUE) numerator = numerator*(-1);\r
- Int_t denominator = div1;\r
- if (binary.GetSign() == kTRUE) denominator = denominator*(-1);\r
- Double_t fdiv = 0.0;\r
- Double_t fLUT = 0.0;\r
- Int_t div = 0;\r
- \r
-\r
- if (div1 == 0){\r
- /*Mem().Init(max + 1,min);\r
- Mem().AssignFormatted(LUT(max+min+1)-1); // division by 0: set to max value\r
- //Mem().FastInit(max+1,min,div1);\r
- return Mem();*/\r
- alu.Init(max + 1,min);\r
- alu.AssignFormatted(LUT(max+min+1)-1); // division by 0: set to max value\r
- return alu;\r
- }\r
- \r
- fdiv = (Double_t)numerator/denominator;\r
- \r
- Int_t shift = fPostCom - binPost;\r
- \r
- if(shift>0){\r
- //denominator = denominator * LUT(shift);\r
- fLUT = (Double_t)LUT(min)/LUT(shift);\r
- }\r
- else {\r
- if(shift<0) {\r
- shift = -shift;\r
- //numerator = numerator * LUT(shift);\r
- fLUT = (Double_t)LUT(min)*LUT(shift);\r
- }\r
- else {\r
- fLUT = (Double_t)LUT(min);\r
- }\r
- }\r
-\r
- fdiv = fdiv*fLUT;\r
- div = (Int_t)fdiv;\r
- \r
- Int_t sign = (div>=0) ? 1 : -1;\r
- div = Max(div,-div);\r
- \r
- // chose min as past-comma part because from a division of integers you can't get only an integer\r
- \r
- /*Mem().Init(max + 1,min); // max+1+min must <= 32!!\r
- Mem().SetSign(sign);\r
- Mem().AssignFormatted(div);\r
- \r
- return Mem();*/\r
-\r
- alu.Init(max + 1,min); // max+1+min must <= 32!!\r
- alu.SetSign(sign);\r
- alu.AssignFormatted(div);\r
- \r
- return alu;\r
-\r
- \r
-}\r
-\r
-//_____________________________________________________________________________ \r
-Int_t AliTRDtrapAlu::MakePower(const Int_t& base,const Int_t& exponent)const{\r
-// calculate "base" to the power of "exponent"\r
- Int_t result = 1;\r
- \r
- for(Int_t i = 1; i <= exponent; i++){\r
- result = result * base;\r
- }\r
- return result;\r
-}\r
-\r
-//_____________________________________________________________________________ \r
-Int_t AliTRDtrapAlu::LUT(const Int_t& index){ \r
- // simple look-up table for base=2\r
- \r
- AliTRDtrapAlu alu;\r
-\r
- static Bool_t fLUT = kFALSE;\r
- static Int_t gLUT[30];\r
- if (fLUT == kFALSE) {\r
- gLUT[0] = 1;\r
- for(Int_t i = 1; i<30; i++) {\r
- gLUT[i] = gLUT[i-1] * 2;\r
- }\r
- fLUT = kTRUE;\r
- } \r
- if (index >=0 && index < 30){\r
- return gLUT[index];\r
- }\r
- else {\r
- \r
- //return Mem().MakePower(2,index);\r
- return alu.MakePower(2,index);\r
- }\r
-}\r
+++ /dev/null
-#ifndef ALITRDTRAPALU_H\r
-#define ALITRDTRAPALU_H\r
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- * See cxx source for full Copyright notice */\r
-\r
-/* $Id: AliTRDtrapAlu.h 23387 2008-01-17 17:25:16Z cblume $ */\r
-\r
-////////////////////////////////////////////////////////////////////////////\r
-// //\r
-// TRAP-ALU implementation //\r
-// //\r
-////////////////////////////////////////////////////////////////////////////\r
-\r
-#include <TObject.h>\r
-\r
-class AliTRDtrapAlu:public TObject {\r
- \r
- public:\r
- \r
- AliTRDtrapAlu();\r
- //AliTRDtrapAlu(AliTRDtrapAlu& bin); //copy constructor\r
- virtual ~AliTRDtrapAlu();\r
-\r
-\r
- void Init(const Int_t& precom=10, const Int_t& postcom=2\r
- , const Int_t& lRestriction = -1, const Int_t& uRestriction = -1);\r
-\r
- Int_t GetValue () const { \r
- // return the value \r
- return fValue;\r
- }\r
-\r
- Int_t GetSignedValue ()const{ \r
- // return the value with its sign\r
- if(fSigned == kFALSE) return fValue;\r
- else return fValue*(-1);\r
- }\r
-\r
- Int_t GetValuePre ()const{\r
- // return value of pre-comma part as integer\r
- Int_t valPre = fValue>>fPostCom;\r
- return valPre; \r
- }\r
-\r
- Double_t GetValueWhole() const; \r
-\r
- Int_t GetPre()const{\r
- // return nr of pre-comma bits\r
- return fPreCom;\r
- }\r
-\r
- Int_t GetPost()const{\r
- // return nr of past-comma bits\r
- return fPostCom;\r
- }\r
-\r
- Bool_t GetSign()const{\r
- // return true if signed\r
- if(fSigned == kTRUE) return kTRUE;\r
- return kFALSE;\r
- }\r
- \r
- Bool_t CheckUSize(const Int_t& val)const{\r
- // compare value to the upper restriction\r
- if(val>fuRestriction) return kFALSE;\r
- return kTRUE;\r
- }\r
-\r
- Bool_t CheckLSize(const Int_t& val)const{\r
- // compare value to the lower restriction\r
- if(val<flRestriction) return kFALSE;\r
- return kTRUE;\r
- }\r
-\r
- void AssignFormatted(const Int_t& formVal){ \r
- // assign a value with proper format; assigns formVal directly to fValue; better not use explicitely\r
- fValue = formVal;\r
- //fValue = fValue & (LUT(fPreCom + fPostCom) - 1); // no cut-off wanted\r
- } \r
-\r
- void SetSign(const Int_t& s){\r
- // sets the sign\r
- if(s >= 0) fSigned = kFALSE;\r
- if(s < 0) fSigned = kTRUE;\r
- }\r
-\r
- void WriteWord(); \r
-\r
- AliTRDtrapAlu& AssignInt(const Int_t& first); // in case a decimal integer is assigned to a binary; \r
- AliTRDtrapAlu& AssignDouble(const Double_t& first); // change "Double_t" into "Float_t"\r
- AliTRDtrapAlu& operator=(const AliTRDtrapAlu& binary);\r
- \r
- AliTRDtrapAlu operator+(const AliTRDtrapAlu& binary); //binary is not const, because in a+(b*c) binary is reference to the object, to which Mem() is also a reference and this object is changed\r
- AliTRDtrapAlu operator-(const AliTRDtrapAlu& binary);\r
- AliTRDtrapAlu operator*(const AliTRDtrapAlu& binary);\r
- AliTRDtrapAlu operator/(const AliTRDtrapAlu& binary);\r
-\r
- protected:\r
-\r
- // void FastInit(const Int_t& precom = 10, const Int_t& postcom = 2, const Int_t& formVal = 0); //meant to combine definition of format with integer-value assignment; not to apply by user \r
-\r
- //the following two functions encapsulate global static members; can only be changed by member functions (visibility only inside class)\r
-\r
- Int_t MakePower(const Int_t& base=1,const Int_t& exponent=1)const;\r
-\r
- /*static AliTRDtrapAlu& Mem() { \r
- // a global instance of the class, which is only defined once\r
- static AliTRDtrapAlu fAuxiliary;\r
- return fAuxiliary;\r
- }*/\r
-\r
- static Int_t LUT(const Int_t& index);\r
- \r
- const Int_t& Min(const Int_t& comp1, const Int_t& comp2)const{\r
- // return the minimum\r
- if (comp1 <= comp2) return comp1;\r
- return comp2;\r
- }\r
-\r
- const Int_t& Max(const Int_t& comp1, const Int_t& comp2)const{\r
- // return the maximum\r
- if (comp1 >= comp2) return comp1;\r
- return comp2;\r
- }\r
-\r
- //static AliTRDtrapAlu fAlu;\r
-\r
- Int_t fValue; // the value in integers\r
- Int_t fPreCom; // number of pre-comma bits\r
- Int_t fPostCom; // number of past-comma bits\r
- Int_t fuRestriction; // the upper restriction for the value\r
- Int_t flRestriction; // the lower restriction for the value\r
- Bool_t fSigned; // signed value? \r
-\r
- ClassDef(AliTRDtrapAlu,1) // TRAP-ALU\r
-\r
-};\r
-#endif\r
-\r
-\r
+++ /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. *
- **************************************************************************/
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// TRD trigger parameters class //
-// //
-// Request an instance with AliTRDCommonParam::Instance() //
-// Then request the needed values //
-// //
-// Author: //
-// Bogdan Vulpescu //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-#include "AliTRDgeometry.h"
-
-#include "AliTRDtrigParam.h"
-
-ClassImp(AliTRDtrigParam)
-
-AliTRDtrigParam *AliTRDtrigParam::fgInstance = 0;
-Bool_t AliTRDtrigParam::fgTerminated = kFALSE;
-
-//_ singleton implementation __________________________________________________
-AliTRDtrigParam *AliTRDtrigParam::Instance()
-{
- //
- // Singleton implementation
- // Returns an instance of this class, it is created if neccessary
- //
-
- if (fgTerminated != kFALSE) {
- return 0;
- }
-
- if (fgInstance == 0) {
- fgInstance = new AliTRDtrigParam();
- }
-
- return fgInstance;
-
-}
-
-//_____________________________________________________________________________
-void AliTRDtrigParam::Terminate()
-{
- //
- // Singleton implementation
- // Deletes the instance of this class and sets the terminated flag,
- // instances cannot be requested anymore
- // This function can be called several times.
- //
-
- fgTerminated = kTRUE;
-
- if (fgInstance != 0) {
- delete fgInstance;
- fgInstance = 0;
- }
-
-}
-
-//_____________________________________________________________________________
-AliTRDtrigParam::AliTRDtrigParam()
- :TObject()
- ,fTime1(2)
- ,fTime2(22)
- ,fClusThr(10.0)
- ,fPadThr(1)
- ,fSum10(2)
- ,fSum12(10)
- ,fTCOn(1)
- ,fTCnexp(1)
- ,fFilterType(0)
- ,fR1(0)
- ,fR2(0)
- ,fC1(0)
- ,fC2(0)
- ,fPedestal(0)
- ,fADCnoise(0)
- ,fDeltaY(2.0)
- ,fDeltaS(2.5)
- ,fXprojPlane(0)
- ,fLtuPtCut(2.3)
- ,fGtuPtCut(3.0)
- ,fHighPt(10.0)
- ,fNPartJetLow(5)
- ,fNPartJetHigh(3)
- ,fJetLowPt(3.0)
- ,fJetHighPt(5.0)
-{
- //
- // AliTRDtrigParam default constructor
- //
-
- // PASA.v.4
- if (fTCnexp == 1) {
- fR1 = 1.1563;
- fR2 = 0.1299;
- fC1 = 0.0657;
- fC2 = 0.0000;
- }
- else if (fTCnexp == 2) {
- fR1 = 1.1563;
- fR2 = 0.1299;
- fC1 = 0.1141;
- fC2 = 0.6241;
- }
-
- Init();
-
-}
-
-//_____________________________________________________________________________
-AliTRDtrigParam::AliTRDtrigParam(const AliTRDtrigParam &p)
- :TObject(p)
- ,fTime1(p.fTime1)
- ,fTime2(p.fTime2)
- ,fClusThr(p.fClusThr)
- ,fPadThr(p.fPadThr)
- ,fSum10(p.fSum10)
- ,fSum12(p.fSum12)
- ,fTCOn(p.fTCOn)
- ,fTCnexp(p.fTCnexp)
- ,fFilterType(p.fFilterType)
- ,fR1(p.fR1)
- ,fR2(p.fR2)
- ,fC1(p.fC1)
- ,fC2(p.fC2)
- ,fPedestal(p.fPedestal)
- ,fADCnoise(p.fADCnoise)
- ,fDeltaY(p.fDeltaY)
- ,fDeltaS(p.fDeltaS)
- ,fXprojPlane(p.fXprojPlane)
- ,fLtuPtCut(p.fLtuPtCut)
- ,fGtuPtCut(p.fGtuPtCut)
- ,fHighPt(p.fHighPt)
- ,fNPartJetLow(p.fNPartJetLow)
- ,fNPartJetHigh(p.fNPartJetHigh)
- ,fJetLowPt(p.fJetLowPt)
- ,fJetHighPt(p.fJetHighPt)
-{
- //
- // AliTRDtrigParam copy constructor
- //
-
-}
-
-//_____________________________________________________________________________
-AliTRDtrigParam::~AliTRDtrigParam()
-{
- //
- // AliTRDtrigParam destructor
- //
-
-}
-
-//_____________________________________________________________________________
-AliTRDtrigParam &AliTRDtrigParam::operator=(const AliTRDtrigParam &p)
-{
- //
- // Assignment operator
- //
-
- if (this != &p) ((AliTRDtrigParam &) p).Copy(*this);
- return *this;
-
-}
-
-//_____________________________________________________________________________
-void AliTRDtrigParam::Copy(TObject &p) const
-{
- //
- // Copy function
- //
-
- ((AliTRDtrigParam &) p).fTime1 = fTime1;
- ((AliTRDtrigParam &) p).fTime2 = fTime2;
- ((AliTRDtrigParam &) p).fClusThr = fClusThr;
- ((AliTRDtrigParam &) p).fPadThr = fPadThr;
- ((AliTRDtrigParam &) p).fSum10 = fSum10;
- ((AliTRDtrigParam &) p).fSum12 = fSum12;
- ((AliTRDtrigParam &) p).fTCOn = fTCOn;
- ((AliTRDtrigParam &) p).fTCnexp = fTCnexp;
- ((AliTRDtrigParam &) p).fFilterType = fFilterType;
- ((AliTRDtrigParam &) p).fR1 = fR1;
- ((AliTRDtrigParam &) p).fR2 = fR2;
- ((AliTRDtrigParam &) p).fC1 = fC1;
- ((AliTRDtrigParam &) p).fC2 = fC2;
- ((AliTRDtrigParam &) p).fPedestal = fPedestal;
- ((AliTRDtrigParam &) p).fADCnoise = fADCnoise;
- ((AliTRDtrigParam &) p).fDeltaY = fDeltaY;
- ((AliTRDtrigParam &) p).fDeltaS = fDeltaS;
- ((AliTRDtrigParam &) p).fXprojPlane = fXprojPlane;
- ((AliTRDtrigParam &) p).fLtuPtCut = fLtuPtCut;
- ((AliTRDtrigParam &) p).fGtuPtCut = fGtuPtCut;
- ((AliTRDtrigParam &) p).fHighPt = fHighPt;
- ((AliTRDtrigParam &) p).fNPartJetLow = fNPartJetLow;
- ((AliTRDtrigParam &) p).fNPartJetHigh = fNPartJetHigh;
- ((AliTRDtrigParam &) p).fJetLowPt = fJetLowPt;
- ((AliTRDtrigParam &) p).fJetHighPt = fJetHighPt;
-
-}
-
-//_____________________________________________________________________________
-void AliTRDtrigParam::Init()
-{
- //
- // Initialize the other parameters
- //
-
- Float_t xPlane0;
- Float_t xPlane5;
-
- xPlane0 = AliTRDgeometry::GetTime0(0)
- - AliTRDgeometry::CdrHght()
- - 0.5*AliTRDgeometry::CamHght();
- xPlane5 = AliTRDgeometry::GetTime0(5)
- - AliTRDgeometry::CdrHght()
- - 0.5*AliTRDgeometry::CamHght();
- fXprojPlane = 0.5 * (xPlane0 + xPlane5);
-
-}
-
+++ /dev/null
-#ifndef ALITRDTRIGPARAM_H
-#define ALITRDTRIGPARAM_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// TRD trigger parameters class //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-#include "TObject.h"
-
-class AliTRDtrigParam : public TObject {
-
- public:
-
- AliTRDtrigParam(const AliTRDtrigParam &p);
- virtual ~AliTRDtrigParam();
- AliTRDtrigParam &operator=(const AliTRDtrigParam &p);
-
- static AliTRDtrigParam *Instance();
- static void Terminate();
-
- virtual void Copy(TObject &p) const;
-
- void Init();
-
- Int_t GetTime1() const { return fTime1; };
- Int_t GetTime2() const { return fTime2; };
- Float_t GetClusThr() const { return fClusThr; };
- Float_t GetPadThr() const { return fPadThr; };
- Int_t GetSum10() const { return fSum10; };
- Int_t GetSum12() const { return fSum12; };
- Int_t GetTailCancelation() const { return fTCOn; };
- Int_t GetNexponential() const { return fTCnexp; };
- Int_t GetFilterType() const { return fFilterType; };
- void GetFilterParam(Float_t &r1, Float_t &r2, Float_t &c1, Float_t &c2, Float_t &ped) const
- { r1 = fR1;
- r2 = fR2;
- c1 = fC1;
- c2 = fC2;
- ped = fPedestal; };
- Float_t GetADCnoise() const { return fADCnoise; };
- Float_t GetDeltaY() const { return fDeltaY; };
- Float_t GetDeltaS() const { return fDeltaS; };
- Float_t GetXprojPlane() const { return fXprojPlane; };
- Float_t GetLtuPtCut() const { return fLtuPtCut; };
- Float_t GetGtuPtCut() const { return fGtuPtCut; };
- Float_t GetHighPt() const { return fHighPt; };
- Int_t GetNPartJetLow() const { return fNPartJetLow; };
- Int_t GetNPartJetHigh() const { return fNPartJetHigh; };
- Float_t GetJetLowPt() const { return fJetLowPt; };
- Float_t GetJetHighPt() const { return fJetHighPt; };
-
- void SetTimeRange(Int_t time1, Int_t time2) { fTime1 = time1;
- fTime2 = time2; };
- void SetClusThr(Float_t clth) { fClusThr = clth; };
- void SetPadThr(Float_t path) { fPadThr = path; };
- void SetSum10(Int_t sum) { fSum10 = sum; };
- void SetSum12(Int_t sum) { fSum12 = sum; };
- void SetTailCancelation(Int_t tcOn = 0) { fTCOn = tcOn; };
- void SetNexponential(Int_t nexp = 1) { fTCnexp = nexp; };
- void SetFilterType(Int_t ftype = 0) { fFilterType = ftype; };
- void SetFilterParam(Float_t r1, Float_t r2, Float_t c1, Float_t c2, Float_t ped)
- { fR1 = r1;
- fR2 = r2;
- fC1 = c1;
- fC2 = c2;
- fPedestal = ped; };
- void SetADCnoise(Float_t adcn) { fADCnoise = adcn; };
- void SetDeltaY(Float_t dy) { fDeltaY = dy; };
- void SetDeltaS(Float_t ds) { fDeltaS = ds; };
- void SetLtuPtCut(Float_t ptcut) { fLtuPtCut = ptcut; };
- void SetGtuPtCut(Float_t ptcut) { fGtuPtCut = ptcut; };
- void SetHighPt(Float_t hpt) { fHighPt = hpt; };
- void SetNPartJetLow(Int_t npj) { fNPartJetLow = npj; };
- void SetNPartJetHigh(Int_t npj) { fNPartJetHigh = npj; };
- void SetJetLowPt(Float_t thr) { fJetLowPt = thr; };
- void SetJetHighPt(Float_t thr) { fJetHighPt = thr; };
-
- protected:
-
- static AliTRDtrigParam *fgInstance; // Instance of this class (singleton implementation)
- static Bool_t fgTerminated; // Defines if this class has already been terminated
-
- Int_t fTime1; // First time bin for tracking (incl.)
- Int_t fTime2; // Last time bin for tracking (incl.)
- Float_t fClusThr; // Cluster threshold
- Float_t fPadThr; // Pad threshold
- Int_t fSum10; // MCM CreateSeeds: Min_Thr_Left_Neighbour
- Int_t fSum12; // MCM CreateSeeds: Min_Sum_From_Two_Neighbours
- Int_t fTCOn; // Tail cancelation flag
- Int_t fTCnexp; // Number of exp in filter
- Int_t fFilterType; // Filter type (0=A - analog, 1=D - digital)
-
- // Filter parameters (1 = long, 2 = short component)
- Float_t fR1; // Time constant [microseconds]
- Float_t fR2; // Time constant [microseconds]
- Float_t fC1; // Weight
- Float_t fC2; // Weight
- Float_t fPedestal; // ADC baseline
- Float_t fADCnoise; // ADC noise (not contained in the digitizer)
-
- Float_t fDeltaY; // Y (offset) matching window in the GTU
- Float_t fDeltaS; // Slope matching window in the GTU
-
- Float_t fXprojPlane; // Projection plane (X) for GTU matching
-
- Float_t fLtuPtCut; // Local pt cut
- Float_t fGtuPtCut; // Global pt cut
-
- Float_t fHighPt; // High pt selection
-
- Int_t fNPartJetLow; // Number of tracks for jet (low)
- Int_t fNPartJetHigh; // Number of tracks for jet (high)
- Float_t fJetLowPt; // Low pt threshold for jet particles
- Float_t fJetHighPt; // High pt threshold for jet particles
-
- private:
-
- // This is a singleton, constructor is private!
- AliTRDtrigParam();
-
- ClassDef(AliTRDtrigParam,3) // TRD trigger parameter class
-
-};
-
-#endif
AliTRDSensor.cxx
AliTRDSensorArray.cxx
AliTRDalignment.cxx
- AliTRDmcmTracklet.cxx
AliTRDtrapConfig.cxx
AliTRDmcmSim.cxx
- AliTRDmcm.cxx
- AliTRDtrigParam.cxx
+ AliTRDmcmTracklet.cxx
AliTRDtrackGTU.cxx
AliTRDtrackletBase.cxx
AliTRDtrackletGTU.cxx
AliTRDtrackletMCM.cxx
AliTRDtrackletWord.cxx
- AliTRDltuTracklet.cxx
- AliTRDgtuTrack.cxx
AliTRDgtuSim.cxx
AliTRDgtuTMU.cxx
- AliTRDtrapAlu.cxx
AliTRDhit.cxx
AliTRDrecoParam.cxx
AliTRDSimParam.cxx
AliTRDcluster.cxx
AliTRDclusterizer.cxx
AliTRDtransform.cxx
- AliTRDtracklet.cxx
AliTRDtrack.cxx
+ AliTRDtracklet.cxx
AliTRDtracker.cxx
AliTRDseed.cxx
AliTRDpropagationLayer.cxx
#pragma link C++ class AliTRDSensor+;
#pragma link C++ class AliTRDSensorArray+;
-#pragma link C++ class AliTRDmcmTracklet+;
#pragma link C++ class AliTRDmcmSim+;
-#pragma link C++ class AliTRDmcm+;
+#pragma link C++ class AliTRDmcmTracklet+;
#pragma link C++ class AliTRDtrapConfig+;
-#pragma link C++ class AliTRDtrigParam;
#pragma link C++ class AliTRDtrackletBase+;
#pragma link C++ class AliTRDtrackletGTU+;
#pragma link C++ class AliTRDtrackletMCM+;
#pragma link C++ class AliTRDtrackletWord+;
-#pragma link C++ class AliTRDltuTracklet+;
-#pragma link C++ class AliTRDgtuTrack+;
#pragma link C++ class AliTRDgtuSim+;
#pragma link C++ class AliTRDgtuTMU+;
#pragma link C++ class AliTRDtrackGTU+;
-#pragma link C++ class AliTRDtrapAlu++;
#pragma link C++ class AliTRDhit+;
AliTRDSensor.cxx \
AliTRDSensorArray.cxx \
AliTRDalignment.cxx \
- AliTRDmcmTracklet.cxx \
AliTRDtrapConfig.cxx \
AliTRDmcmSim.cxx \
- AliTRDmcm.cxx \
- AliTRDtrigParam.cxx \
+ AliTRDmcmTracklet.cxx \
AliTRDtrackGTU.cxx \
AliTRDtrackletBase.cxx \
AliTRDtrackletGTU.cxx \
AliTRDtrackletMCM.cxx \
AliTRDtrackletWord.cxx \
- AliTRDltuTracklet.cxx \
- AliTRDgtuTrack.cxx \
AliTRDgtuSim.cxx \
AliTRDgtuTMU.cxx \
- AliTRDtrapAlu.cxx \
AliTRDhit.cxx \
AliTRDrecoParam.cxx \
AliTRDSimParam.cxx \
SRCS= AliTRDcluster.cxx \
AliTRDclusterizer.cxx \
AliTRDtransform.cxx \
- AliTRDtracklet.cxx \
AliTRDtrack.cxx \
+ AliTRDtracklet.cxx \
AliTRDtracker.cxx \
AliTRDseed.cxx \
AliTRDpropagationLayer.cxx \