From 73042f0190050b5b5f317a6327d5ae1849e730d5 Mon Sep 17 00:00:00 2001 From: kowal2 Date: Fri, 30 Jun 2000 12:07:50 +0000 Subject: [PATCH] Updated from the TPC-PreRelease branch --- TPC/AliArrayI.h | 4 +- TPC/AliClusters.cxx | 43 +- TPC/AliClusters.h | 7 +- TPC/AliClustersArray.cxx | 31 +- TPC/AliClustersArray.h | 5 +- TPC/AliDetectorParam.h | 2 +- TPC/AliDigits.cxx | 108 +- TPC/AliDigits.h | 29 +- TPC/AliH2F.cxx | 135 +- TPC/AliH2F.h | 22 +- TPC/AliSegmentArray.cxx | 50 +- TPC/AliSegmentArray.h | 35 +- TPC/AliSimDigits.cxx | 63 +- TPC/AliSimDigits.h | 21 +- TPC/AliTPC.cxx | 1578 ++++------------- TPC/AliTPC.h | 212 +-- ...sterFinder.cxx => AliTPCClusterFinder.cxx} | 336 ++-- ...iClusterFinder.h => AliTPCClusterFinder.h} | 98 +- TPC/AliTPCClustersArray.cxx | 14 +- TPC/AliTPCClustersArray.h | 2 +- TPC/AliTPCClustersRow.cxx | 23 +- TPC/AliTPCClustersRow.h | 1 + ...liTPCTestTracking.C => AliTPCComparison.C} | 189 +- TPC/AliTPCDisplayClusters.C | 54 + ...PCDigitDisplay.C => AliTPCDisplayDigits.C} | 33 +- TPC/AliTPCFindClusters.C | 52 + TPC/AliTPCFindTracks.C | 23 + TPC/AliTPCHits2Digits.C | 73 +- TPC/AliTPCPRF2D.cxx | 113 +- TPC/AliTPCPRF2D.h | 8 +- TPC/AliTPCParam.cxx | 181 +- TPC/AliTPCParam.h | 81 +- TPC/AliTPCParamCR.cxx | 10 +- TPC/AliTPCParamCR.h | 7 +- TPC/AliTPCParamSR.cxx | 14 +- TPC/AliTPCParamSR.h | 11 +- TPC/AliTPCRF1D.cxx | 70 +- TPC/AliTPCRF1D.h | 28 +- TPC/AliTPCTestClustering.C | 78 - TPC/AliTPCcluster.cxx | 55 + TPC/AliTPCcluster.h | 120 ++ TPC/AliTPCclusterer.cxx | 254 +++ TPC/AliTPCclusterer.h | 65 + TPC/AliTPCtest.C | 32 + TPC/AliTPCtrack.cxx | 476 +++++ TPC/AliTPCtrack.h | 205 +++ TPC/AliTPCtracker.cxx | 513 ++++++ TPC/AliTPCtracker.h | 172 ++ TPC/AliTPCv0.cxx | 89 +- TPC/AliTPCv0.h | 4 +- TPC/AliTPCv1.cxx | 129 +- TPC/AliTPCv1.h | 4 +- TPC/AliTPCv2.cxx | 179 +- TPC/AliTPCv2.h | 4 +- TPC/AliTPCv3.cxx | 125 +- TPC/AliTPCv3.h | 4 +- TPC/Makefile | 13 +- TPC/ParamTest.C | 15 - TPC/SetTPCParamOptional.C | 8 + TPC/TPCAnal.C | 542 ------ TPC/TPCLinkDef.h | 6 +- TPC/TPCtest.C | 27 - TPC/template.C | 48 - 63 files changed, 3771 insertions(+), 3162 deletions(-) rename TPC/{AliClusterFinder.cxx => AliTPCClusterFinder.cxx} (76%) rename TPC/{AliClusterFinder.h => AliTPCClusterFinder.h} (81%) rename TPC/{AliTPCTestTracking.C => AliTPCComparison.C} (73%) create mode 100644 TPC/AliTPCDisplayClusters.C rename TPC/{AliTPCDigitDisplay.C => AliTPCDisplayDigits.C} (66%) create mode 100644 TPC/AliTPCFindClusters.C create mode 100644 TPC/AliTPCFindTracks.C delete mode 100644 TPC/AliTPCTestClustering.C create mode 100644 TPC/AliTPCcluster.cxx create mode 100644 TPC/AliTPCcluster.h create mode 100644 TPC/AliTPCclusterer.cxx create mode 100644 TPC/AliTPCclusterer.h create mode 100644 TPC/AliTPCtest.C create mode 100644 TPC/AliTPCtrack.cxx create mode 100644 TPC/AliTPCtrack.h create mode 100644 TPC/AliTPCtracker.cxx create mode 100644 TPC/AliTPCtracker.h delete mode 100644 TPC/ParamTest.C create mode 100644 TPC/SetTPCParamOptional.C delete mode 100644 TPC/TPCAnal.C delete mode 100644 TPC/TPCtest.C delete mode 100644 TPC/template.C diff --git a/TPC/AliArrayI.h b/TPC/AliArrayI.h index d73c210524c..f06a03a9a33 100644 --- a/TPC/AliArrayI.h +++ b/TPC/AliArrayI.h @@ -1,5 +1,5 @@ -#ifndef AliArrayI_H -#define AliArrayI_H +#ifndef ALIARRAYI_H +#define ALIARRAYI_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ diff --git a/TPC/AliClusters.cxx b/TPC/AliClusters.cxx index 9c3d830c789..60f6ed146fb 100644 --- a/TPC/AliClusters.cxx +++ b/TPC/AliClusters.cxx @@ -15,6 +15,16 @@ /* $Log$ +Revision 1.2.4.2 2000/06/14 16:45:13 kowal2 +Improved algorithms. Compiler warnings removed. + +Revision 1.2.4.1 2000/06/09 07:09:29 kowal2 + +Clustering and tracking classes are splitted from the simulation ones + +Revision 1.2 2000/04/17 09:37:33 kowal2 +removed obsolete AliTPCDigitsDisplay.C + Revision 1.1.4.2 2000/04/10 11:34:02 kowal2 Clusters handling in a new data structure @@ -51,11 +61,24 @@ AliClusters::AliClusters() { // //default constructor + // fNclusters=0; fClusters =0; fClass =0; } +//________________________________________________________________________ +AliClusters::~AliClusters() +{ + // + //default destructor + // + if (fClusters !=0) fClusters->Clear(); + delete fClusters; +} + +//_________________________________________________________________________ + Bool_t AliClusters::SetClass(const Text_t *classname) { // @@ -73,10 +96,10 @@ Bool_t AliClusters::SetClass(const Text_t *classname) Error("AliClusters", "%s is not a valid class name", classname); return kFALSE; } - if (!fClass->InheritsFrom(AliCluster::Class())) { - Error("AliClusters", "%s does not inherit from AliCluster", classname); - return kFALSE; - } + if (!fClass->InheritsFrom(TObject::Class())) { + Error("AliClusters", "%s does not inherit from TObject", classname); + return kFALSE; + } return kTRUE; } @@ -97,15 +120,13 @@ void AliClusters::SetArray(Int_t length) //_____________________________________________________________________________ -const AliCluster* AliClusters::operator[](Int_t i) +const TObject* AliClusters::operator[](Int_t i) { // // return cluster at internal position i // if (fClusters==0) return 0; - void * cl = fClusters->UncheckedAt(i); - if (cl==0) return 0; - return (AliCluster*)cl; + return fClusters->UncheckedAt(i); } //_____________________________________________________________________________ void AliClusters::Sort() @@ -115,7 +136,7 @@ void AliClusters::Sort() } //_____________________________________________________________________________ -AliCluster * AliClusters::InsertCluster( const AliCluster * c) +TObject * AliClusters::InsertCluster( const TObject * c) { // // Add a simulated cluster copy to the list @@ -126,7 +147,7 @@ AliCluster * AliClusters::InsertCluster( const AliCluster * c) } if(!fClusters) fClusters=new TClonesArray(fClass->GetName(),1000); TClonesArray &lclusters = *fClusters; - return new(lclusters[fNclusters++]) AliCluster(*c); + return new(lclusters[fNclusters++]) AliCluster(*((AliCluster*)c)); } //_____________________________________________________________________________ @@ -152,7 +173,7 @@ Int_t AliClusters::Find(Double_t y) const //_____________________________________________________________________________ -void AliClusters::Draw(Float_t shiftx, Float_t shifty, +void AliClusters::DrawClusters(Float_t shiftx, Float_t shifty, Int_t color, Int_t size, Int_t style) { diff --git a/TPC/AliClusters.h b/TPC/AliClusters.h index c042fe58417..c24c42bdab8 100644 --- a/TPC/AliClusters.h +++ b/TPC/AliClusters.h @@ -18,13 +18,14 @@ class TObjArray; class AliClusters : public AliSegmentID{ public: AliClusters(); - virtual AliCluster* InsertCluster(const AliCluster* c ); //insert copy of cluster - const AliCluster* operator[](Int_t i); + ~AliClusters(); + virtual TObject* InsertCluster(const TObject* c ); //insert copy of cluster + const TObject* operator[](Int_t i); virtual Int_t Find(Double_t y) const; //find nearest cluster in y direction void Sort(); TClonesArray * GetArray(){return fClusters;} void SetArray(Int_t length); //construct clonnes array of objects of type fClass - void Draw(Float_t shiftx, Float_t shifty, Int_t color, Int_t size, Int_t style); + void DrawClusters(Float_t shiftx, Float_t shifty, Int_t color, Int_t size, Int_t style); Bool_t SetClass(const Text_t *classname); protected: TClonesArray * fClusters; diff --git a/TPC/AliClustersArray.cxx b/TPC/AliClustersArray.cxx index 1aa56f3fb19..6207f93bd1a 100644 --- a/TPC/AliClustersArray.cxx +++ b/TPC/AliClustersArray.cxx @@ -15,6 +15,22 @@ /* $Log$ +Revision 1.2.4.4 2000/06/26 07:39:42 kowal2 +Changes to obey the coding rules + +Revision 1.2.4.3 2000/06/25 08:38:41 kowal2 +Splitted from AliTPCtracking + +Revision 1.2.4.2 2000/06/14 16:45:13 kowal2 +Improved algorithms. Compiler warnings removed. + +Revision 1.2.4.1 2000/06/09 07:09:29 kowal2 + +Clustering and tracking classes are splitted from the simulation ones + +Revision 1.2 2000/04/17 09:37:33 kowal2 +removed obsolete AliTPCDigitsDisplay.C + Revision 1.1.4.2 2000/04/10 11:34:02 kowal2 Clusters handling in a new data structure @@ -23,9 +39,9 @@ Clusters handling in a new data structure /////////////////////////////////////////////////////////////////////////////// // // -// AliClustersArray object // +// AliClustersArray object // // -// Origin: Marian Ivanov , GSI Darmstadt +// Origin: Marian Ivanov , GSI Darmstadt // // // // // /////////////////////////////////////////////////////////////////////////////// @@ -39,7 +55,6 @@ Clusters handling in a new data structure #include "AliCluster.h" #include "AliClusters.h" -#include "AliClusterFinder.h" #include "AliDetectorParam.h" #include "AliClustersArray.h" @@ -68,21 +83,21 @@ Bool_t AliClustersArray::SetClusterType(Text_t * classname) } if (!gROOT) - ::Fatal("AliTPCClustersArray", "ROOT system not initialized"); + ::Fatal("AliClustersArray", "ROOT system not initialized"); fClusterType = gROOT->GetClass(classname); if (!fClusterType) { - Error("AliTPCClustersArray", "%s is not a valid class name", classname); + Error("AliClustersArray", "%s is not a valid class name", classname); return kFALSE; } - if (!fClusterType->InheritsFrom(AliCluster::Class())) { - Error("AliTPCClustersArray", "%s does not inherit from AliCluster", classname); + if (!fClusterType->InheritsFrom(TObject::Class())) { + Error("AliClustersArray", "%s does not inherit from TObject", classname); return kFALSE; } return kTRUE; } -Bool_t AliClustersArray::Setup(AliDetectorParam *param) +Bool_t AliClustersArray::Setup(const AliDetectorParam *param) { // //make copy of param object diff --git a/TPC/AliClustersArray.h b/TPC/AliClustersArray.h index b9c4ce780ac..a41c67a7413 100644 --- a/TPC/AliClustersArray.h +++ b/TPC/AliClustersArray.h @@ -14,7 +14,7 @@ class AliClustersFinder; class AliClustersArray : public AliSegmentArray { public: AliClustersArray(); - virtual Bool_t Setup(AliDetectorParam *param); + virtual Bool_t Setup(const AliDetectorParam *param); const AliDetectorParam * GetParam() {return fParam;} AliClustersFinder * GetFinder() {return fClFinder;} virtual Bool_t SetParam(AliDetectorParam * param); @@ -26,6 +26,9 @@ protected: AliClustersFinder * fClFinder; //!pointer to cluster finder object TClass *fClusterType; //! ClassDef(AliClustersArray,1) +private: + AliClustersArray(const AliClustersArray& r); //dummy copy constructor + AliClustersArray &operator=(const AliClustersArray& r);//dummy assignment operator }; #endif diff --git a/TPC/AliDetectorParam.h b/TPC/AliDetectorParam.h index 1277ad7c9aa..46cd7ab8494 100644 --- a/TPC/AliDetectorParam.h +++ b/TPC/AliDetectorParam.h @@ -17,7 +17,7 @@ class AliDetectorParam : public TNamed { public: AliDetectorParam(){;} - virtual Int_t GetNSegmentsTotal(){return 0;} //get total nuber of segments + virtual Int_t GetNSegmentsTotal() const {return 0;} //get total nuber of segments virtual Bool_t Get1DIndex(Int_t *index, const Int_t * arrindex) {return kFALSE;} //transform multidimensional index to one dimesional virtual Bool_t GetNDIndex(const Int_t * index1, Int_t * arrIndex) {return kFALSE;} diff --git a/TPC/AliDigits.cxx b/TPC/AliDigits.cxx index d28a4a538a5..f22c53f940e 100644 --- a/TPC/AliDigits.cxx +++ b/TPC/AliDigits.cxx @@ -14,13 +14,34 @@ **************************************************************************/ /* + $Log$ +Revision 1.2.4.3 2000/06/26 07:39:42 kowal2 +Changes to obey the coding rules + +Revision 1.2.4.2 2000/06/25 08:38:41 kowal2 +Splitted from AliTPCtracking + +Revision 1.2.4.1 2000/06/14 16:45:13 kowal2 +Improved algorithms. Compiler warnings removed. + +Revision 1.2 2000/04/17 09:37:33 kowal2 +removed obsolete AliTPCDigitsDisplay.C + Revision 1.1.4.2 2000/04/10 11:37:42 kowal2 Digits handling in a new data structure */ +/*MI change -- for Rule checker + -- added copy constructor and assignmet operator + -- new GetSize return size of object in Bytes + -- added GetDigitSize and GetOverTh function + -- added GetNRows, GetNCols function + -- for Marek -I had it in my code +*/ + /////////////////////////////////////////////////////////////////////////////// // // // Alice digits array object AliDigits // @@ -49,16 +70,46 @@ ClassImp(AliDigits) AliDigits::AliDigits() { + // + //default constructor fIndex = 0; fElements = 0; fThreshold =0; Invalidate(); } +AliDigits::AliDigits(const AliDigits& digits) +{ + // + //copy constructor + fNrows = digits.fNrows; + fNcols = digits.fNcols; + fElements = new AliArrayS(*(digits.fElements)); + fIndex = new AliArrayI(*(digits.fIndex)); + fBufType = digits.fBufType; + fThreshold = digits.fThreshold; + fNelems = digits.fNelems; +} + +AliDigits & AliDigits::operator =(const AliDigits & digits) +{ + //assignment operator + fNrows = digits.fNrows; + fNcols = digits.fNcols; + if (fElements) delete fElements; + fElements = new AliArrayS(*(digits.fElements)); + if (fIndex) delete fIndex; + fIndex = new AliArrayI(*(digits.fIndex)); + fBufType = digits.fBufType; + fThreshold = digits.fThreshold; + fNelems = digits.fNelems; + return (*this); +} + AliDigits::~AliDigits() { // - //defaulta destructor + //default destructor if (fIndex !=0 ) fIndex->Delete();; if (fElements != 0) fElements->Delete(); @@ -115,8 +166,57 @@ void AliDigits::Allocate(Int_t rows, Int_t columns) } +Int_t AliDigits::GetSize() +{ + // + //return size of object + // + Int_t size = sizeof(this); + if (fIndex!=0) size+= sizeof(fIndex)+fIndex->GetSize()*sizeof(Int_t); + if (fElements!=0) size+= sizeof(fElements)+fElements->GetSize()*sizeof(Short_t); + return size; +} + +Int_t AliDigits::GetDigitSize() //return total size of pure digit +{ + // + //return size of PURE DIGITS + // + if (fElements==0) return 0; + else return sizeof(fElements)+fElements->GetSize()*sizeof(Short_t); +} + +Int_t AliDigits::GetOverTh(Float_t threshold,Float_t x1, Float_t x2, Float_t y1, Float_t y2) +{ + // + //return number of digits over threshold + // + if ( (fElements==0) || (fElements->GetSize()<=0)) return 0; + + if (x1<=x2) { + x1=0; + x2=fNrows; + } + if (y1<=y2) { + y1=0; + y2=fNcols; + } + Int_t over=0; + + Bool_t cont=First(); + for ( cont=First(); cont==kTRUE;cont=Next()) { + if ( (CurrentRow()x2)) continue; + if ( (CurrentColumn()y2)) continue; + if (CurrentDigit()>threshold) over++; + } + return over; +} + + Short_t AliDigits::GetDigit(Int_t row, Int_t column) { + // + // return digit for given row and collumn if (fBufType ==0) return GetDigitFast(row,column); if (fBufType ==1) return GetDigit1(row,column); @@ -215,7 +315,7 @@ AliH2F * AliDigits::GenerHisto() return his; } -AliH2F * AliDigits::Draw(const char *option,Float_t x1, Float_t x2, Float_t y1, Float_t y2) +AliH2F *AliDigits::DrawDigits(const char *option,Float_t x1, Float_t x2, Float_t y1, Float_t y2) { // //draw digits in given array @@ -243,8 +343,8 @@ void AliDigits::ExpandBuffer1() for (i =0,k=0 ;ifN; - for (i=0;ifN; + for (i=0;iAt(i); else { diff --git a/TPC/AliDigits.h b/TPC/AliDigits.h index 201f8871f89..a4aa29f0600 100644 --- a/TPC/AliDigits.h +++ b/TPC/AliDigits.h @@ -18,10 +18,12 @@ class AliH2F; class AliDigits: public AliSegmentID{ public: AliDigits(); - ~AliDigits(); - inline Short_t GetDigitFast(Int_t row, Int_t column); //return value at given row and collumn - inline void SetDigitFast(Short_t value,Int_t row, Int_t column); //set value at given row and collumn - inline Bool_t BoundsOK(const char *where, Int_t row, Int_t col) ; //Check If Bound Ok + AliDigits(const AliDigits &digits); //copy constructor + AliDigits &operator = (const AliDigits & digits); //assignment operator + virtual ~AliDigits(); + Short_t GetDigitFast(Int_t row, Int_t column); //return value at given row and collumn + void SetDigitFast(Short_t value,Int_t row, Int_t column); //set value at given row and collumn + Bool_t BoundsOK(const char *where, Int_t row, Int_t col) ; //Check If Bound Ok Bool_t OutOfBoundsError(const char *where, Int_t row, Int_t column); virtual void Allocate(Int_t rows, Int_t columns); //construct empty buffer fDigits with size rows x columns virtual Short_t GetDigit(Int_t row, Int_t column); @@ -29,15 +31,20 @@ public: virtual void CompresBuffer(Int_t bufferType,Int_t threshold); //compres buffer according buffertype algorithm virtual Bool_t First(); //adjust first valid current digit virtual Bool_t Next(); //addjust next valid current digit - void SetThreshold(Int_t th) {fThreshold = th;} - Int_t GetThreshold() {return fThreshold;} + void SetThreshold(Int_t th) {fThreshold = th;} //set threshold + Int_t GetThreshold() {return fThreshold;} //return threshold + Int_t GetNRows(){return fNrows;} + Int_t GetNCols(){return fNcols;} Int_t CurrentRow(){ return fCurrentRow;} //return current row Int_t CurrentColumn(){ return fCurrentCol;} //return current column Int_t CurrentDigit() {return fElements->At(fCurrentIndex);} //return degit for current row and column void AcceptHisto(AliH2F * his); //update buffer for - it will content histogram values AliH2F * GenerHisto(); //generate 2 dimensional histogram with digits - AliH2F * Draw( const char *option=0,Float_t x1=-1, Float_t x2=-1, Float_t y1=-1, Float_t y2=-1); //draw digits - Int_t GetSize() {return fNelems;} //return main buffer size + AliH2F *DrawDigits( const char *option=0,Float_t x1=-1, Float_t x2=-1, Float_t y1=-1, Float_t y2=-1); //draw digits + + Int_t GetSize();//return total size of object in bytes + Int_t GetDigitSize(); //return total size of pure digits + Int_t GetOverTh(Float_t threshold,Float_t x1=-1, Float_t x2=-1, Float_t y1=-1, Float_t y2=-1); //return number of digits over threshold protected: virtual void Invalidate(); void ExpandBuffer1(); //expand buffer of type to twodimensional array @@ -74,7 +81,7 @@ inline Bool_t AliDigits::BoundsOK(const char *where, Int_t row, Int_t col) return kTRUE; } -Short_t AliDigits::GetDigitFast(Int_t row, Int_t column) +inline Short_t AliDigits::GetDigitFast(Int_t row, Int_t column) { // //return digit from fDigits array @@ -83,13 +90,13 @@ Short_t AliDigits::GetDigitFast(Int_t row, Int_t column) return fElements->At(fIndex->At(column)+row); } -void AliDigits::SetDigitFast(Short_t value, Int_t row, Int_t column) +inline void AliDigits::SetDigitFast(Short_t value, Int_t row, Int_t column) { // //set digit // if ( (row<0) || (row>=fNrows) || (column<0) || (column>=fNrows) ) - ::Error("AliDigits::SetDigitFast", "row %d col %d out of bounds (size: %d x %d, this: 0x%08x)", + Error("AliDigits::SetDigitFast", "row %d col %d out of bounds (size: %d x %d, this: 0x%08x)", row, column, fNrows, fNcols, this); (*fElements)[fIndex->At(column)+row]=value; } diff --git a/TPC/AliH2F.cxx b/TPC/AliH2F.cxx index da02e6e807f..76e1c02140b 100644 --- a/TPC/AliH2F.cxx +++ b/TPC/AliH2F.cxx @@ -15,11 +15,21 @@ /* $Log$ +Revision 1.2.4.2 2000/06/26 07:39:42 kowal2 +Changes to obey the coding rules + +Revision 1.2.4.1 2000/06/25 08:38:41 kowal2 +Splitted from AliTPCtracking + +Revision 1.2 2000/04/17 09:37:33 kowal2 +removed obsolete AliTPCDigitsDisplay.C + Revision 1.1.4.2 2000/04/10 11:32:37 kowal2 "ROOT"-based class with some extra functionality */ +// //---------------------------------------------------------------------------- // Author: Marian Ivanov @@ -33,7 +43,7 @@ Revision 1.1.4.2 2000/04/10 11:32:37 kowal2 #include "AliTPC.h" #include "TRandom.h" #include "AliCluster.h" -#include "AliClusterFinder.h" +#include "AliTPCClusterFinder.h" //*KEEP,TMath. // other include files follow here @@ -46,11 +56,8 @@ ClassImp(AliH2F) //*********************************************************************** AliH2F::AliH2F():TH2F() { - fSigmaX2 = 1.; - fSigmaY2 = 1.; - fdx = 1; - fdy=1; - fFitMatrix.ResizeTo(5,1); + // + } AliH2F::AliH2F(const Text_t *name,const Text_t *title, Int_t nbinsx,Axis_t xlow,Axis_t xup @@ -58,24 +65,25 @@ AliH2F::AliH2F(const Text_t *name,const Text_t *title, TH2F(name,title,nbinsx,xlow,xup ,nbinsy,ylow,yup) { - fSigmaX2 = 1.; - fSigmaY2 = 1.; - fdx = 1; - fdy=1; - fFitMatrix.ResizeTo(5,1); + // + } AliH2F::~AliH2F() { + // } -AliH2F::AliH2F(const AliH2F &) +AliH2F::AliH2F(const AliH2F &his) { + // + } -AliH2F & AliH2F::operator = (const AliH2F &) +AliH2F & AliH2F::operator = (const AliH2F & his) { - return *this; + // + return *this; } TClonesArray * AliH2F::FindPeaks(Float_t threshold, Float_t noise) @@ -84,7 +92,7 @@ TClonesArray * AliH2F::FindPeaks(Float_t threshold, Float_t noise) //firstly we need to create object for cluster finding //and fill it with contents of histogram - AliClusterFinder cfinder; + AliTPCClusterFinder cfinder; cfinder.SetThreshold(threshold); cfinder.SetNoise(noise); cfinder.GetHisto(this); @@ -93,6 +101,7 @@ TClonesArray * AliH2F::FindPeaks(Float_t threshold, Float_t noise) void AliH2F::ClearSpectrum() { + //clera histogram Int_t dimx = fXaxis.GetNbins(); Int_t dimy = fYaxis.GetNbins(); for (Int_t i = 0 ;i0){ + fSegment->Delete(); + delete fSegment; + } + if (fTree) delete fTree; + if (fTreeIndex) delete fTreeIndex; + if (fClass!=0) delete fClass; +} + + Bool_t AliSegmentArray::SetClass(Text_t *classname) { // @@ -120,16 +154,6 @@ Bool_t AliSegmentArray::SetClass(Text_t *classname) return kTRUE; } -AliSegmentArray::~AliSegmentArray() -{ - if (fNSegment>0){ - fSegment->Delete(); - delete fSegment; - } - if (fTree) delete fTree; - if (fTreeIndex) delete fTreeIndex; - if (fClass!=0) delete fClass; -} AliSegmentID * AliSegmentArray::NewSegment() { @@ -313,10 +337,10 @@ void AliSegmentArray::StoreSegment(Int_t index) // //make segment persistent // - const AliSegmentID * segment = (*this)[index]; - if (segment == 0 ) return; + const AliSegmentID * ksegment = (*this)[index]; + if (ksegment == 0 ) return; if (fTree==0) MakeTree(); - fBranch->SetAddress(&segment); + fBranch->SetAddress(&ksegment); fTree->Fill(); } diff --git a/TPC/AliSegmentArray.h b/TPC/AliSegmentArray.h index 6ac9caf270b..1e64d9311ad 100644 --- a/TPC/AliSegmentArray.h +++ b/TPC/AliSegmentArray.h @@ -1,5 +1,5 @@ -#ifndef ALISEGARRAY_H -#define ALISEGARRAY_H +#ifndef ALISEGMENTARRAY_H +#define ALISEGMENTARRAY_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ @@ -12,22 +12,21 @@ #include "TNamed.h" #include "TError.h" -//#include "AliSegmentID.h" +#include "TObjArray.h" class TTree; class TBranch; class AliArrayI; class AliSegmentID; -class TObjArray; class AliSegmentArray: public TNamed{ public: AliSegmentArray(); - AliSegmentArray(Text_t *classname, Int_t n); // - Bool_t SetClass(Text_t *classname); //set class of stored object - ~AliSegmentArray(); - inline const AliSegmentID * At(Int_t i); //return pointer to segment with index i - inline const AliSegmentID * operator[](Int_t i); //return pointer to segment with index i + AliSegmentArray(Text_t *classname, Int_t n); // + virtual ~AliSegmentArray(); + Bool_t SetClass(Text_t *classname); //set class of stored object + const AliSegmentID * At(Int_t i); //return pointer to segment with index i + const AliSegmentID * operator[](Int_t i); //return pointer to segment with index i Bool_t AddSegment(AliSegmentID *segment); // add segment to array AliSegmentID * AddSegment(Int_t index); //create objet and set index @@ -45,10 +44,12 @@ public: Bool_t MakeDictionary(Int_t size);//create index table for tree TClass * GetClass() {return fClass;} -public: +protected: + AliSegmentArray(const AliSegmentArray &segment); //copy constructor + AliSegmentArray &operator = (const AliSegmentArray & segment); //assignment operator TObjArray * fSegment; //!pointer to array of pointers to segment AliArrayI * fTreeIndex; //!pointers(index) table in tree - Int_t fNSegment; + Int_t fNSegment; //number of alocated segments TTree * fTree; //!tree with segment objects TBranch * fBranch; //!total branch private: @@ -58,21 +59,23 @@ private: -const AliSegmentID* AliSegmentArray::operator[](Int_t i) +inline const AliSegmentID* AliSegmentArray::operator[](Int_t i) { // //return segment with given index // if ( (i<0) || (i>=fNSegment)) return 0; - return (AliSegmentID *)((*fSegment)[i]); + return (AliSegmentID *)(fSegment->At(i)); + } -const AliSegmentID* AliSegmentArray::At(Int_t i) + +inline const AliSegmentID* AliSegmentArray::At(Int_t i) { // //return segment with given index // if ( (i<0) || (i>=fNSegment)) return 0; - return (AliSegmentID *)((*fSegment)[i]); + return (AliSegmentID *)(fSegment->At(i)); } -#endif //ALISEGARRAY_H +#endif //ALISEGMENTARRAY_H diff --git a/TPC/AliSimDigits.cxx b/TPC/AliSimDigits.cxx index 32093fa0933..338ff2e0fc6 100644 --- a/TPC/AliSimDigits.cxx +++ b/TPC/AliSimDigits.cxx @@ -15,12 +15,25 @@ /* $Log$ +Revision 1.2.4.3 2000/06/26 07:39:42 kowal2 +Changes to obey the coding rules + +Revision 1.2.4.2 2000/06/25 08:38:41 kowal2 +Splitted from AliTPCtracking + +Revision 1.2.4.1 2000/06/14 16:45:13 kowal2 +Improved algorithms. Compiler warnings removed. + +Revision 1.2 2000/04/17 09:37:33 kowal2 +removed obsolete AliTPCDigitsDisplay.C + Revision 1.1.4.2 2000/04/10 11:37:42 kowal2 Digits handling in a new data structure */ +// /////////////////////////////////////////////////////////////////////////////// // // @@ -153,9 +166,9 @@ Int_t AliSimDigits::GetTrackID1(Int_t row, Int_t column, Int_t level) n1 = fTrIndex->At(i); Int_t rownew = 0; Int_t rowold=0; - Int_t ID; + Int_t id; for (i = n1;(iAt(i); if (num<0) { rownew-=num; @@ -165,17 +178,17 @@ Int_t AliSimDigits::GetTrackID1(Int_t row, Int_t column, Int_t level) num = fTracks->At(i); rownew+=num; i++; - ID = fTracks->At(i); + id = fTracks->At(i); } } else { rowold = rownew; rownew+=num; i++; - ID = fTracks->At(i); + id = fTracks->At(i); } -ID-=2; - if ( (row>=rowold) && (row<=rownew) ) return ID; + id-=2; + if ( (row>=rowold) && (row<=rownew) ) return id; if (row < rownew ) return -2; //empty track } return -2; @@ -184,7 +197,7 @@ ID-=2; void AliSimDigits::ExpandTrackBuffer1() { // - //expand track compressed according algorithm 1 (track ID comression independent to the digit compression) + //expand track compressed according algorithm 1 (track id comression independent to the digit compression) // !!in expanded tracks we don't use fTrIndex array // fTrBufType = 0; @@ -199,16 +212,16 @@ void AliSimDigits::ExpandTrackBuffer1() Int_t level = 0; Int_t col=0; Int_t row = 0; - Int_t N=fTracks->fN; + Int_t n=fTracks->fN; // - for (i=0;iAt(i); if (num<0) row-=num; //negative number mean number of zeroes (no tracks of gibven level no need to write to array) else { i++; - Int_t ID = fTracks->At(i); - for (j = 0; jAt(i); + for (j = 0; j=fNrows) { row=0; @@ -226,7 +239,7 @@ void AliSimDigits::ExpandTrackBuffer1() void AliSimDigits::CompresTrackBuffer1() { // - //comress track according algorithm 1 (track ID comression independent to the digit compression) + //comress track according algorithm 1 (track id comression independent to the digit compression) // fTrBufType = 1; @@ -237,18 +250,18 @@ void AliSimDigits::CompresTrackBuffer1() Int_t icurrent=-1; //current index Int_t izero; //number of zero - Int_t inum; //number of digits with the same current track ID - Int_t lastID =0; //last track ID + Int_t inum; //number of digits with the same current track id + Int_t lastID =0; //last track id for (Int_t lev =0; lev 0 ) { //if we have some tracks in buffer icurrent++; if ((icurrent+1)>=buf->fN) buf->Expand(icurrent*2); @@ -261,7 +274,7 @@ void AliSimDigits::CompresTrackBuffer1() izero++; } else - if (ID != lastID) + if (id != lastID) if ( izero > 0 ) { //if we have currently izero count of non tracks digits icurrent++; @@ -269,16 +282,16 @@ void AliSimDigits::CompresTrackBuffer1() (*buf)[icurrent]= -izero; //write how many under zero inum++; izero = 0; - lastID = ID; + lastID = id; } else{ - //if we change track ID from another track ID + //if we change track id from another track id icurrent++; if ((icurrent+1)>=buf->fN) buf->Expand(icurrent*2); (*buf)[icurrent] = inum; icurrent++; (*buf)[icurrent] = lastID; - lastID = ID; + lastID = id; inum = 1; izero = 0; } @@ -298,7 +311,7 @@ void AliSimDigits::CompresTrackBuffer1() if ((icurrent+1)>=buf->fN) buf->Expand(icurrent*2); (*buf)[icurrent] = inum; icurrent++; - (*buf)[icurrent] = ID; + (*buf)[icurrent] = id; } }//end of loop over columns }//end of loop over differnet track level @@ -314,21 +327,21 @@ void AliSimDigits::CompresTrackBuffer1() void AliSimDigits::ExpandTrackBuffer2() { // - //comress track according algorithm 2 (track ID comression according digit compression) + //comress track according algorithm 2 (track id comression according digit compression) fTrBufType = 0; } void AliSimDigits::CompresTrackBuffer2() { // - //comress track according algorithm 2 (track ID comression according digit compression) + //comress track according algorithm 2 (track id comression according digit compression) fTrBufType = 2; } Int_t AliSimDigits::GetTrackID2(Int_t row, Int_t column, Int_t level) { - //returnb track ID of digits - for buffer compresion 2 + //returnb track id of digits - for buffer compresion 2 return -2; } diff --git a/TPC/AliSimDigits.h b/TPC/AliSimDigits.h index 61a3e44736d..e4b9074e35e 100644 --- a/TPC/AliSimDigits.h +++ b/TPC/AliSimDigits.h @@ -18,10 +18,10 @@ class AliH2F; class AliSimDigits : public AliDigits{ public: AliSimDigits(); - ~AliSimDigits(); + virtual ~AliSimDigits(); void AllocateTrack(Int_t length); //construct empty buffer fTracks with size rows x column x length (number of tracks for one digit) - inline Int_t GetTrackIDFast(Int_t row, Int_t column,Int_t level); //return track ID at given row and collumn - inline void SetTrackIDFast(Int_t value,Int_t row, Int_t column,Int_t level); //set ID track at given row and collumn + Int_t GetTrackIDFast(Int_t row, Int_t column,Int_t level); //return track ID at given row and collumn + void SetTrackIDFast(Int_t value,Int_t row, Int_t column,Int_t level); //set ID track at given row and collumn virtual Int_t GetTrackID(Int_t row, Int_t column, Int_t level); virtual void ExpandTrackBuffer(); //expand buffer to twodimensional array virtual void CompresTrackBuffer(Int_t bufType); //compres buffer according buffertype algorithm @@ -29,7 +29,7 @@ public: Float_t x1=-1, Float_t x2=-1, Float_t y1=-1, Float_t y2=-1); //draw tracks TClonesArray * GenerTPCClonesArray(TClonesArray * arr); //generate TClonnesArray of digits //only for demonstration purpose -public: +private: void InvalidateTrack(); Int_t GetTrackID1(Int_t row, Int_t column, Int_t level); //returnb track ID of digits - for buffer compresion 1 @@ -50,7 +50,7 @@ public: -Int_t AliSimDigits::GetTrackIDFast(Int_t row, Int_t column,Int_t level) +inline Int_t AliSimDigits::GetTrackIDFast(Int_t row, Int_t column,Int_t level) { // //return track ID at given row and column @@ -58,9 +58,10 @@ Int_t AliSimDigits::GetTrackIDFast(Int_t row, Int_t column,Int_t level) return fTracks->At(level*fNrows*fNcols+fNrows*column+row); } -void AliSimDigits::SetTrackIDFast(Int_t value,Int_t row, Int_t column,Int_t level) +inline void AliSimDigits::SetTrackIDFast(Int_t value,Int_t row, Int_t column,Int_t level) { -value+=2; + // + value+=2; //set ID track at given row and collumn // fTracks[level][fTrIndex[level][column]+row]=value; if ( (row<0) || (row>=fNrows) || (column<0) || (column>=fNcols) ) @@ -73,3 +74,9 @@ value+=2; #endif + + + + + + diff --git a/TPC/AliTPC.cxx b/TPC/AliTPC.cxx index bc2d6ba318b..4a60d9e7c51 100644 --- a/TPC/AliTPC.cxx +++ b/TPC/AliTPC.cxx @@ -15,6 +15,23 @@ /* $Log$ +Revision 1.19.2.4 2000/06/26 07:39:42 kowal2 +Changes to obey the coding rules + +Revision 1.19.2.3 2000/06/25 08:38:41 kowal2 +Splitted from AliTPCtracking + +Revision 1.19.2.2 2000/06/16 12:59:28 kowal2 +Changed parameter settings + +Revision 1.19.2.1 2000/06/09 07:15:07 kowal2 + +Defaults loaded automatically (hard-wired) +Optional parameters can be set via macro called in the constructor + +Revision 1.19 2000/04/18 19:00:59 fca +Small bug fixes to TPC files + Revision 1.18 2000/04/17 09:37:33 kowal2 removed obsolete AliTPCDigitsDisplay.C @@ -58,6 +75,8 @@ Introduction of the Copyright and cvs Log // // /////////////////////////////////////////////////////////////////////////////// +// + #include #include #include @@ -68,13 +87,14 @@ Introduction of the Copyright and cvs Log #include #include "TParticle.h" #include "AliTPC.h" +#include #include "AliRun.h" #include #include #include "AliMC.h" -#include "AliTPCParam.h" +#include "AliTPCParamSR.h" #include "AliTPCPRF2D.h" #include "AliTPCRF1D.h" #include "AliDigits.h" @@ -86,7 +106,11 @@ Introduction of the Copyright and cvs Log #include "AliTPCClustersRow.h" #include "AliTPCClustersArray.h" +#include "AliTPCcluster.h" +#include "AliTPCclusterer.h" +#include "AliTPCtracker.h" +#include ClassImp(AliTPC) @@ -97,17 +121,13 @@ AliTPC::AliTPC() // Default constructor // fIshunt = 0; - fClusters = 0; fHits = 0; fDigits = 0; - fTracks = 0; fNsectors = 0; - fNtracks = 0; - fNclusters= 0; //MI changes fDigitsArray = 0; fClustersArray = 0; - fTPCParam = 0; + fTPCParam=0; } //_____________________________________________________________________________ @@ -125,20 +145,27 @@ AliTPC::AliTPC(const char *name, const char *title) //MI change fDigitsArray = 0; fClustersArray= 0; - fTPCParam = 0; // // Initialise counters - fClusters = 0; - fTracks = 0; fNsectors = 0; - fNtracks = 0; - fNclusters= 0; // fIshunt = 0; // // Initialise color attributes SetMarkerColor(kYellow); + + // + // Set TPC parameters + // + + if (!strcmp(title,"Default")) { + fTPCParam = new AliTPCParamSR; + } else { + cerr<<"AliTPC warning: in Config.C you must set non-default parameters\n"; + fTPCParam=0; + } + } //_____________________________________________________________________________ @@ -147,39 +174,13 @@ AliTPC::~AliTPC() // // TPC destructor // + fIshunt = 0; delete fHits; delete fDigits; - delete fClusters; - delete fTracks; - if (fDigitsArray!=0) delete fDigitsArray; - if (fClustersArray!=0) delete fClustersArray; - - if (fTPCParam) delete fTPCParam; + delete fTPCParam; } -//_____________________________________________________________________________ -void AliTPC::AddCluster(Float_t *hits, Int_t *tracks) -{ - // - // Add a simulated cluster to the list - // - if(!fClusters) fClusters=new TClonesArray("AliTPCcluster",10000); - TClonesArray &lclusters = *fClusters; - new(lclusters[fNclusters++]) AliTPCcluster(hits,tracks); -} - -//_____________________________________________________________________________ -void AliTPC::AddCluster(const AliTPCcluster &c) -{ - // - // Add a simulated cluster copy to the list - // - if(!fClusters) fClusters=new TClonesArray("AliTPCcluster",900000); - TClonesArray &lclusters = *fClusters; - new(lclusters[fNclusters++]) AliTPCcluster(c); -} - //_____________________________________________________________________________ void AliTPC::AddHit(Int_t track, Int_t *vol, Float_t *hits) { @@ -190,27 +191,6 @@ void AliTPC::AddHit(Int_t track, Int_t *vol, Float_t *hits) new(lhits[fNhits++]) AliTPChit(fIshunt,track,vol,hits); } -//_____________________________________________________________________________ -void AliTPC::AddTrack(Float_t *hits) -{ - // - // Add a track to the list of tracks - // - TClonesArray <racks = *fTracks; - new(ltracks[fNtracks++]) AliTPCtrack(hits); -} - -//_____________________________________________________________________________ -void AliTPC::AddTrack(const AliTPCtrack& t) -{ - // - // Add a track copy to the list of tracks - // - if(!fTracks) fTracks=new TClonesArray("AliTPCtrack",10000); - TClonesArray <racks = *fTracks; - new(ltracks[fNtracks++]) AliTPCtrack(t); -} - //_____________________________________________________________________________ void AliTPC::BuildGeometry() { @@ -218,7 +198,7 @@ void AliTPC::BuildGeometry() // // Build TPC ROOT TNode geometry for the event display // - TNode *Node, *Top; + TNode *nNode, *nTop; TTUBS *tubs; Int_t i; const int kColorTPC=19; @@ -227,23 +207,23 @@ void AliTPC::BuildGeometry() const Double_t kRaddeg=180./TMath::Pi(); - Float_t InnerOpenAngle = fTPCParam->GetInnerAngle(); - Float_t OuterOpenAngle = fTPCParam->GetOuterAngle(); + Float_t innerOpenAngle = fTPCParam->GetInnerAngle(); + Float_t outerOpenAngle = fTPCParam->GetOuterAngle(); - Float_t InnerAngleShift = fTPCParam->GetInnerAngleShift(); - Float_t OuterAngleShift = fTPCParam->GetOuterAngleShift(); + Float_t innerAngleShift = fTPCParam->GetInnerAngleShift(); + Float_t outerAngleShift = fTPCParam->GetOuterAngleShift(); Int_t nLo = fTPCParam->GetNInnerSector()/2; Int_t nHi = fTPCParam->GetNOuterSector()/2; - const Double_t loAng = (Double_t)TMath::Nint(InnerOpenAngle*kRaddeg); - const Double_t hiAng = (Double_t)TMath::Nint(OuterOpenAngle*kRaddeg); - const Double_t loAngSh = (Double_t)TMath::Nint(InnerAngleShift*kRaddeg); - const Double_t hiAngSh = (Double_t)TMath::Nint(OuterAngleShift*kRaddeg); + const Double_t kloAng = (Double_t)TMath::Nint(innerOpenAngle*kRaddeg); + const Double_t khiAng = (Double_t)TMath::Nint(outerOpenAngle*kRaddeg); + const Double_t kloAngSh = (Double_t)TMath::Nint(innerAngleShift*kRaddeg); + const Double_t khiAngSh = (Double_t)TMath::Nint(outerAngleShift*kRaddeg); - const Double_t loCorr = 1/TMath::Cos(0.5*loAng*kDegrad); - const Double_t hiCorr = 1/TMath::Cos(0.5*hiAng*kDegrad); + const Double_t kloCorr = 1/TMath::Cos(0.5*kloAng*kDegrad); + const Double_t khiCorr = 1/TMath::Cos(0.5*khiAng*kDegrad); Double_t rl,ru; @@ -252,7 +232,7 @@ void AliTPC::BuildGeometry() // Get ALICE top node // - Top=gAlice->GetGeometry()->GetNode("alice"); + nTop=gAlice->GetGeometry()->GetNode("alice"); // inner sectors @@ -266,13 +246,13 @@ void AliTPC::BuildGeometry() sprintf(title,"TPC low sector %3d",i); title[24]='\0'; - tubs = new TTUBS(name,title,"void",rl*loCorr,ru*loCorr,250., - loAng*(i-0.5)+loAngSh,loAng*(i+0.5)+loAngSh); + tubs = new TTUBS(name,title,"void",rl*kloCorr,ru*kloCorr,250., + kloAng*(i-0.5)+kloAngSh,kloAng*(i+0.5)+kloAngSh); tubs->SetNumberOfDivisions(1); - Top->cd(); - Node = new TNode(name,title,name,0,0,0,""); - Node->SetLineColor(kColorTPC); - fNodes->Add(Node); + nTop->cd(); + nNode = new TNode(name,title,name,0,0,0,""); + nNode->SetLineColor(kColorTPC); + fNodes->Add(nNode); } // Outer sectors @@ -285,19 +265,16 @@ void AliTPC::BuildGeometry() name[4]='\0'; sprintf(title,"TPC upper sector %d",i); title[24]='\0'; - tubs = new TTUBS(name,title,"void",rl*hiCorr,ru*hiCorr,250, - hiAng*(i-0.5)+hiAngSh,hiAng*(i+0.5)+hiAngSh); + tubs = new TTUBS(name,title,"void",rl*khiCorr,ru*khiCorr,250, + khiAng*(i-0.5)+khiAngSh,khiAng*(i+0.5)+khiAngSh); tubs->SetNumberOfDivisions(1); - Top->cd(); - Node = new TNode(name,title,name,0,0,0,""); - Node->SetLineColor(kColorTPC); - fNodes->Add(Node); + nTop->cd(); + nNode = new TNode(name,title,name,0,0,0,""); + nNode->SetLineColor(kColorTPC); + fNodes->Add(nNode); } - -} - - +} //_____________________________________________________________________________ Int_t AliTPC::DistancetoPrimitive(Int_t , Int_t ) @@ -309,333 +286,11 @@ Int_t AliTPC::DistancetoPrimitive(Int_t , Int_t ) return 9999; } -//_____________________________________________________________________________ -static Double_t SigmaY2(Double_t r, Double_t tgl, Double_t pt) -{ - // - // Parametrised error of the cluster reconstruction (pad direction) - // - pt=TMath::Abs(pt)*1000.; - Double_t x=r/pt; - tgl=TMath::Abs(tgl); - Double_t s=a_rphi - b_rphi*r*tgl + c_rphi*x*x + d_rphi*x; - if (s<0.4e-3) s=0.4e-3; - s*=1.3; //Iouri Belikov - return s; -} - -//_____________________________________________________________________________ -static Double_t SigmaZ2(Double_t r, Double_t tgl) -{ - // - // Parametrised error of the cluster reconstruction (drift direction) - // - tgl=TMath::Abs(tgl); - Double_t s=a_z - b_z*r*tgl + c_z*tgl*tgl; - if (s<0.4e-3) s=0.4e-3; - s*=1.3; //Iouri Belikov - return s; -} - -//_____________________________________________________________________________ -inline Double_t f1(Double_t x1,Double_t y1, - Double_t x2,Double_t y2, - Double_t x3,Double_t y3) -{ - //----------------------------------------------------------------- - // Initial approximation of the track curvature - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - Double_t d=(x2-x1)*(y3-y2)-(x3-x2)*(y2-y1); - Double_t a=0.5*((y3-y2)*(y2*y2-y1*y1+x2*x2-x1*x1)- - (y2-y1)*(y3*y3-y2*y2+x3*x3-x2*x2)); - Double_t b=0.5*((x2-x1)*(y3*y3-y2*y2+x3*x3-x2*x2)- - (x3-x2)*(y2*y2-y1*y1+x2*x2-x1*x1)); - - Double_t xr=TMath::Abs(d/(d*x1-a)), yr=d/(d*y1-b); - - return -xr*yr/sqrt(xr*xr+yr*yr); -} - - -//_____________________________________________________________________________ -inline Double_t f2(Double_t x1,Double_t y1, - Double_t x2,Double_t y2, - Double_t x3,Double_t y3) -{ - //----------------------------------------------------------------- - // Initial approximation of the track curvature times center of curvature - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - Double_t d=(x2-x1)*(y3-y2)-(x3-x2)*(y2-y1); - Double_t a=0.5*((y3-y2)*(y2*y2-y1*y1+x2*x2-x1*x1)- - (y2-y1)*(y3*y3-y2*y2+x3*x3-x2*x2)); - Double_t b=0.5*((x2-x1)*(y3*y3-y2*y2+x3*x3-x2*x2)- - (x3-x2)*(y2*y2-y1*y1+x2*x2-x1*x1)); - - Double_t xr=TMath::Abs(d/(d*x1-a)), yr=d/(d*y1-b); - - return -a/(d*y1-b)*xr/sqrt(xr*xr+yr*yr); -} - -//_____________________________________________________________________________ -inline Double_t f3(Double_t x1,Double_t y1, - Double_t x2,Double_t y2, - Double_t z1,Double_t z2) -{ - //----------------------------------------------------------------- - // Initial approximation of the tangent of the track dip angle - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - return (z1 - z2)/sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); -} - -//_____________________________________________________________________________ -static Int_t FindProlongation(AliTPCtrack& t, const AliTPCSector *sec, - Int_t s, Int_t rf=0) -{ - //----------------------------------------------------------------- - // This function tries to find a track prolongation. - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - const Int_t ROWS_TO_SKIP=(t<10) ? 10 : Int_t(0.5*sec->GetNRows()); - const Float_t MAX_CHI2=12.; - Int_t try_again=ROWS_TO_SKIP; - Double_t alpha=sec->GetAlpha(); - Int_t ns=Int_t(2*TMath::Pi()/alpha+0.5); - - for (Int_t nr=sec->GetRowNumber(t.GetX())-1; nr>=rf; nr--) { - Double_t x=sec->GetX(nr), ymax=sec->GetMaxY(nr); - if (!t.PropagateTo(x)) return 0; - - AliTPCcluster *cl=0; - Double_t max_chi2=MAX_CHI2; - const AliTPCRow& row=sec[s][nr]; - Double_t sy2=SigmaY2(t.GetX(),t.GetTgl(),t.GetPt()); - Double_t sz2=SigmaZ2(t.GetX(),t.GetTgl()); - Double_t road=5.*sqrt(t.GetSigmaY2() + sy2), y=t.GetY(), z=t.GetZ(); - - if (road>30) { - if (t>4) cerr<fY > y+road) break; - if (c->IsUsed()) continue; - if ((c->fZ - z)*(c->fZ - z) > 25.*(t.GetSigmaZ2() + sz2)) continue; - Double_t chi2=t.GetPredictedChi2(c); - if (chi2 > max_chi2) continue; - max_chi2=chi2; - cl=c; - } - } - if (cl) { - t.Update(cl,max_chi2); - cl->fdEdX=sec->GetPadPitchWidth()*TMath::Sqrt((1+t.GetTgl()*t.GetTgl())/ - (1-(t.GetC()*x-t.GetEta())*(t.GetC()*x-t.GetEta()))); - try_again=ROWS_TO_SKIP; - } else { - if (try_again==0) break; - if (y > ymax) { - s = (s+1) % ns; - if (!t.Rotate(alpha)) return 0; - } else if (y <-ymax) { - s = (s-1+ns) % ns; - if (!t.Rotate(-alpha)) return 0; - } - try_again--; - } - } - - return 1; - -} - - -//_____________________________________________________________________________ -static void MakeSeeds(TObjArray& seeds,const AliTPCSector *sec, Int_t max_sec, -Int_t i1, Int_t i2) -{ - //----------------------------------------------------------------- - // This function creates track seeds. - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - TMatrix C(5,5); TVector x(5); - Double_t alpha=sec->GetAlpha(), shift=sec->GetAlphaShift(); - Double_t cs=cos(alpha), sn=sin(alpha); - for (Int_t ns=0; nsGetX(i1), y1=r1[is]->fY, z1=r1[is]->fZ; - for (Int_t js=0; js < nl+nm+nu; js++) { - const AliTPCcluster *cl; - Int_t ks; - Double_t x2=sec->GetX(i2), y2, z2, tmp; - - if (jsfY; z2=cl->fZ; - tmp= x2*cs+y2*sn; - y2 =-x2*sn+y2*cs; x2=tmp; - } else - if (jsfY; z2=cl->fZ; - } else { - ks=(ns+1)%max_sec; - const AliTPCRow& r2=sec[(ns+1)%max_sec][i2]; - cl=r2[js-nl-nm]; - y2=cl->fY; z2=cl->fZ; - tmp=x2*cs-y2*sn; - y2 =x2*sn+y2*cs; x2=tmp; - } - - Double_t zz=z1 - z1/x1*(x1-x2); - if (TMath::Abs(zz-z2)>5) continue; - - Double_t d=(x2-x1)*(0.-y2)-(0.-x2)*(y2-y1); - if (d==0.) {cerr<<"MakeSeeds warning: Straight seed !\n"; continue;} - - Double_t x3=0., y3=0.;//gRandom->Gaus(0.,TMath::Sqrt(cl->fSigmaY2)); - - x(0)=y1; - x(1)=z1; - x(2)=f1(x1,y1,x2,y2,x3,y3); - x(3)=f2(x1,y1,x2,y2,x3,y3); - x(4)=f3(x1,y1,x2,y2,z1,z2); - - if (TMath::Abs(x(2)*x1-x(3)) >= 0.999) continue; - - if (TMath::Abs(x(4)) > 1.2) continue; - - Double_t a=asin(x(3)); - Double_t zv=z1 - x(4)/x(2)*(a+asin(x(2)*x1-x(3))); - if (TMath::Abs(zv)>10.) continue; - - TMatrix X(6,6); X=0.; - X(0,0)=r1[is]->fSigmaY2; X(1,1)=r1[is]->fSigmaZ2; - X(2,2)=cl->fSigmaY2; X(3,3)=cl->fSigmaZ2; - X(4,4)=cl->fSigmaY2; X(5,5)=cl->fSigmaZ2; - //X(4,4)=3./12.; X(5,5)=3./12.; - TMatrix F(5,6); F.UnitMatrix(); - Double_t sy=sqrt(X(0,0)), sz=sqrt(X(1,1)); - F(2,0)=(f1(x1,y1+sy,x2,y2,x3,y3)-x(2))/sy; - F(2,2)=(f1(x1,y1,x2,y2+sy,x3,y3)-x(2))/sy; - F(2,4)=(f1(x1,y1,x2,y2,x3,y3+sy)-x(2))/sy; - F(3,0)=(f2(x1,y1+sy,x2,y2,x3,y3)-x(3))/sy; - F(3,2)=(f2(x1,y1,x2,y2+sy,x3,y3)-x(3))/sy; - F(3,4)=(f2(x1,y1,x2,y2,x3,y3+sy)-x(3))/sy; - F(4,0)=(f3(x1,y1+sy,x2,y2,z1,z2)-x(4))/sy; - F(4,1)=(f3(x1,y1,x2,y2,z1+sz,z2)-x(4))/sz; - F(4,2)=(f3(x1,y1,x2,y2+sy,z1,z2)-x(4))/sy; - F(4,3)=(f3(x1,y1,x2,y2,z1,z2+sz)-x(4))/sz; - F(4,4)=0; - F(3,3)=0; - - TMatrix t(F,TMatrix::kMult,X); - C.Mult(t,TMatrix(TMatrix::kTransposed,F)); - - AliTPCtrack *track=new AliTPCtrack(r1[is], x, C, x1, ns*alpha+shift); - Int_t rc=FindProlongation(*track,sec,ns,i2); - if (rc<0 || *track<(i1-i2)/2) delete track; - else seeds.AddLast(track); - } - } - } -} - -//_____________________________________________________________________________ -AliTPCParam *AliTPCSector::param; -void AliTPC::Clusters2Tracks() -{ +void AliTPC::Clusters2Tracks(TFile *of) { //----------------------------------------------------------------- // This is a track finder. - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch //----------------------------------------------------------------- - if (!fClusters) return; - - AliTPCParam *p=fTPCParam; - AliTPCSector::SetParam(p); - - const Int_t nis=p->GetNInnerSector()/2; - AliTPCSSector *ssec=new AliTPCSSector[nis]; - Int_t nrow_low=ssec->GetNRows(); - - const Int_t nos=p->GetNOuterSector()/2; - AliTPCLSector *lsec=new AliTPCLSector[nos]; - Int_t nrow_up=lsec->GetNRows(); - - Int_t ncl=fClusters->GetEntriesFast(); - while (ncl--) { - AliTPCcluster *c=(AliTPCcluster*)fClusters->UncheckedAt(ncl); - Int_t sec=c->fSector, row=c->fPadRow; - - if (sec 2.*TMath::Pi()) alpha -= 2.*TMath::Pi(); - if (alpha < 0. ) alpha += 2.*TMath::Pi(); - Int_t ns=Int_t(alpha/lsec->GetAlpha())%nos; - - if (!FindProlongation(t,lsec,ns)) continue; - - alpha=t.GetAlpha() + 0.5*ssec->GetAlpha() - ssec->GetAlphaShift(); - if (alpha > 2.*TMath::Pi()) alpha -= 2.*TMath::Pi(); - if (alpha < 0. ) alpha += 2.*TMath::Pi(); - ns=Int_t(alpha/ssec->GetAlpha())%nis; //index of the inner sector needed - - alpha=ns*ssec->GetAlpha() - t.GetAlpha(); - if (!t.Rotate(alpha)) continue; - - if (!FindProlongation(t,ssec,ns)) continue; - - if (t >= Int_t(0.4*nrows)) { - AddTrack(t); - t.UseClusters(); - cerr<Field()->Integ(); - Float_t SXMGMX=gAlice->Field()->Max(); + Int_t iSXFLD=gAlice->Field()->Integ(); + Float_t sXMGMX=gAlice->Field()->Max(); Float_t amat[5]; // atomic numbers Float_t zmat[5]; // z @@ -667,26 +322,26 @@ void AliTPC::CreateMaterials() // Ne - Float_t a_ne = 20.18; - Float_t z_ne = 10.; + Float_t aNe = 20.18; + Float_t zNe = 10.; density = 0.0009; - AliMaterial(20,"Ne",a_ne,z_ne,density,999.,999.); + AliMaterial(20,"Ne",aNe,zNe,density,999.,999.); // Ar - Float_t a_ar = 39.948; - Float_t z_ar = 18.; + Float_t aAr = 39.948; + Float_t zAr = 18.; density = 0.001782; - AliMaterial(21,"Ar",a_ar,z_ar,density,999.,999.); + AliMaterial(21,"Ar",aAr,zAr,density,999.,999.); - Float_t a_pure[2]; + Float_t aPure[2]; - a_pure[0] = a_ne; - a_pure[1] = a_ar; + aPure[0] = aNe; + aPure[1] = aAr; //-------------------------------------------------------------- @@ -756,7 +411,7 @@ void AliTPC::CreateMaterials() Float_t am=0; Int_t nc; - Float_t a,z,rho,absl,X0,buf[1]; + Float_t a,z,rho,absl,x0,buf[1]; Int_t nbuf; for(nc = 0;ncGfmate((*fIdmate)[fMixtComp[nc]],namate,a,z,rho,X0,absl,buf,nbuf); + gMC->Gfmate((*fIdmate)[fMixtComp[nc]],namate,a,z,rho,x0,absl,buf,nbuf); amat[nc] = a; zmat[nc] = z; Int_t nnc = (fMixtComp[nc]>=20) ? fMixtComp[nc]%20 : fMixtComp[nc]%10; - am += fMixtProp[nc]*((fMixtComp[nc]>=20) ? a_pure[nnc] : amol[nnc]); + am += fMixtProp[nc]*((fMixtComp[nc]>=20) ? aPure[nnc] : amol[nnc]); density += fMixtProp[nc]*rho; // density of the mixture } @@ -783,7 +438,7 @@ void AliTPC::CreateMaterials() Int_t nnc = (fMixtComp[nc]>=20) ? fMixtComp[nc]%20 : fMixtComp[nc]%10; - wmat[nc] = fMixtProp[nc]*((fMixtComp[nc]>=20) ? a_pure[nnc] : amol[nnc])/am; + wmat[nc] = fMixtProp[nc]*((fMixtComp[nc]>=20) ? aPure[nnc] : amol[nnc])/am; } @@ -791,15 +446,15 @@ void AliTPC::CreateMaterials() AliMixture(32,"Drift gas 2",amat,zmat,density,fNoComp,wmat); AliMixture(33,"Drift gas 3",amat,zmat,density,fNoComp,wmat); - AliMedium(2, "Drift gas 1", 31, 0, ISXFLD, SXMGMX, 10., 999.,.1, .001, .001); - AliMedium(3, "Drift gas 2", 32, 0, ISXFLD, SXMGMX, 10., 999.,.1, .001, .001); - AliMedium(4, "Drift gas 3", 33, 1, ISXFLD, SXMGMX, 10., 999.,.1, .001, .001); + AliMedium(2, "Drift gas 1", 31, 0, iSXFLD, sXMGMX, 10., 999.,.1, .001, .001); + AliMedium(3, "Drift gas 2", 32, 0, iSXFLD, sXMGMX, 10., 999.,.1, .001, .001); + AliMedium(4, "Drift gas 3", 33, 1, iSXFLD, sXMGMX, 10., 999.,.1, .001, .001); // Air AliMaterial(24, "Air", 14.61, 7.3, .001205, 30420., 67500.); - AliMedium(24, "Air", 24, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, .1); + AliMedium(24, "Air", 24, 0, iSXFLD, sXMGMX, 10., .1, .1, .1, .1); //---------------------------------------------------------------------- // solid materials @@ -809,13 +464,13 @@ void AliTPC::CreateMaterials() AliMaterial(30, "Al", 26.98, 13., 2.7, 8.9, 37.2); - AliMedium(0, "Al",30, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, .1); + AliMedium(0, "Al",30, 0, iSXFLD, sXMGMX, 10., .1, .1, .1, .1); // Si AliMaterial(31, "Si", 28.086, 14.,2.33, 9.36, 999.); - AliMedium(7, "Al",31, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, .1); + AliMedium(7, "Al",31, 0, iSXFLD, sXMGMX, 10., .1, .1, .1, .1); // Mylar C5H4O2 @@ -836,7 +491,7 @@ void AliTPC::CreateMaterials() AliMixture(32, "Mylar",amat,zmat,density,-3,wmat); - AliMedium(5, "Mylar",32, 0, ISXFLD, SXMGMX, 10., .1, .1, .001, .01); + AliMedium(5, "Mylar",32, 0, iSXFLD, sXMGMX, 10., .1, .1, .001, .01); @@ -845,7 +500,7 @@ void AliTPC::CreateMaterials() AliMaterial(33,"C normal",12.011,6.,2.265,18.8,999.); - AliMedium(6,"C normal",33,0, ISXFLD, SXMGMX, 10., .1, .1, .001, .01); + AliMedium(6,"C normal",33,0, iSXFLD, sXMGMX, 10., .1, .1, .001, .01); // G10 for inner and outr field cage // G10 is 60% SiO2 + 40% epoxy, right now I use A and Z for SiO2 @@ -867,270 +522,72 @@ void AliTPC::CreateMaterials() AliMixture(34,"G10 aux.",amat,zmat,density,-2,wmat); - gMC->Gfmate((*fIdmate)[34],namate,a,z,rho,X0,absl,buf,nbuf); + gMC->Gfmate((*fIdmate)[34],namate,a,z,rho,x0,absl,buf,nbuf); Float_t thickX0 = 0.0052; // field cage in X0 units Float_t thick = 2.; // in cm - X0=19.4; // G10 + x0=19.4; // G10 - rhoFactor = X0*thickX0/thick; + rhoFactor = x0*thickX0/thick; density = rho*rhoFactor; AliMaterial(35,"G10-fc",a,z,density,999.,999.); - AliMedium(8,"G10-fc",35,0, ISXFLD, SXMGMX, 10., .1, .1, .001, .01); + AliMedium(8,"G10-fc",35,0, iSXFLD, sXMGMX, 10., .1, .1, .001, .01); thickX0 = 0.0027; // inner vessel (eta <0.9) thick=0.5; - rhoFactor = X0*thickX0/thick; + rhoFactor = x0*thickX0/thick; density = rho*rhoFactor; AliMaterial(36,"G10-iv",a,z,density,999.,999.); - AliMedium(9,"G10-iv",36,0, ISXFLD, SXMGMX, 10., .1, .1, .001, .01); + AliMedium(9,"G10-iv",36,0, iSXFLD, sXMGMX, 10., .1, .1, .001, .01); // Carbon fibre - gMC->Gfmate((*fIdmate)[33],namate,a,z,rho,X0,absl,buf,nbuf); + gMC->Gfmate((*fIdmate)[33],namate,a,z,rho,x0,absl,buf,nbuf); thickX0 = 0.0133; // outer vessel thick=3.0; - rhoFactor = X0*thickX0/thick; + rhoFactor = x0*thickX0/thick; density = rho*rhoFactor; AliMaterial(37,"C-ov",a,z,density,999.,999.); - AliMedium(10,"C-ov",37,0, ISXFLD, SXMGMX, 10., .1, .1, .001, .01); + AliMedium(10,"C-ov",37,0, iSXFLD, sXMGMX, 10., .1, .1, .001, .01); thickX0=0.015; // inner vessel (cone, eta > 0.9) thick=1.5; - rhoFactor = X0*thickX0/thick; + rhoFactor = x0*thickX0/thick; density = rho*rhoFactor; AliMaterial(38,"C-ivc",a,z,density,999.,999.); - AliMedium(11,"C-ivc",38,0, ISXFLD, SXMGMX, 10., .1, .1, .001, .01); + AliMedium(11,"C-ivc",38,0, iSXFLD, sXMGMX, 10., .1, .1, .001, .01); // - AliMedium(12,"CO2",10,0, ISXFLD, SXMGMX, 10., 999.,.1, .001, .001); + AliMedium(12,"CO2",10,0, iSXFLD, sXMGMX, 10., 999.,.1, .001, .001); } -//_____________________________________________________________________________ -struct Bin { - UShort_t q; - UInt_t mask; - Bin(); -}; -Bin::Bin() {q=0; mask=0xFFFFFFFE;} - -struct Peak { - Int_t k; - UInt_t mask; -}; -inline Bool_t IsMaximum(Int_t k, Int_t max, const Bin *bins) { - UShort_t q=bins[k].q; - if (q==1023) return kFALSE; - if (bins[k-max].q > q) return kFALSE; - if (bins[k-1 ].q > q) return kFALSE; - if (bins[k+max].q > q) return kFALSE; - if (bins[k+1 ].q > q) return kFALSE; - if (bins[k-max-1].q > q) return kFALSE; - if (bins[k+max-1].q > q) return kFALSE; - if (bins[k+max+1].q > q) return kFALSE; - if (bins[k-max+1].q > q) return kFALSE; - return kTRUE; -} -static void FindPeaks(Int_t k, Int_t max, Bin *bins, Peak *peaks, Int_t& n) { -//if (n>=31) return; - if (n<31) - if (IsMaximum(k,max,bins)) { - peaks[n].k=k; peaks[n].mask=(2<GetMaxTBin()+2; - - TTree *t = (TTree *)gDirectory->Get("TreeD_75x40_100x60"); - AliSimDigits digarr, *dummy=&digarr; - t->GetBranch("Segment")->SetAddress(&dummy); - Stat_t sectors_by_rows = t->GetEntries(); - for (Int_t n=0; nGetEvent(n); - Int_t sec, row; - if (!par->AdjustSectorRow(digarr.GetID(),sec,row)) { - cerr<<"AliTPC warning: invalid segment ID ! "<GetPadRowRadii(sec,row); - - Int_t npads, sign; - { - Int_t nis=par->GetNInnerSector(), nos=par->GetNOuterSector(); - if (sec < nis) { - npads = par->GetNPadsLow(row); - sign = (sec < nis/2) ? 1 : -1; - } else { - npads = par->GetNPadsUp(row); - sign = ((sec-nis) < nos/2) ? 1 : -1; - } - } - - const Int_t MAXBIN=MAXZ*(npads+2); - Bin *bins=new Bin[MAXBIN]; - - digarr.First(); - do { - Short_t dig=digarr.CurrentDigit(); - if (dig<=par->GetZeroSup()) continue; - Int_t j=digarr.CurrentRow()+1, i=digarr.CurrentColumn()+1; - bins[i*MAXZ+j].q=dig; - bins[i*MAXZ+j].mask=1; - } while (digarr.Next()); - - Int_t ncl=0; - for (Int_t i=0; i30) continue; - - Int_t k,l; - for (k=0; k1 || dj>1) continue; - if (bins[peaks[k].k].q > bins[peaks[l].k].q) { - peaks[l].mask=peaks[k].mask; - peaks[l].k*=-1; - } else { - peaks[k].mask=peaks[l].mask; - peaks[k].k*=-1; - break; - } - } - } - - for (k=0; kGetPadPitchWidth(sec)*par->GetPadPitchWidth(sec); - if (s2 != 0.) { - c.fSigmaY2 *= 0.064*1.3*1.3; - if (secGetNInnerSector()) c.fSigmaY2 *= 1.44*1.44; - } - - s2 = c.fSigmaZ2/c.fQ - c.fZ*c.fZ; - c.fSigmaZ2 = s2 + 1./12.; - c.fSigmaZ2 *= par->GetZWidth()*par->GetZWidth(); - if (s2 != 0.) { - c.fSigmaZ2 *= 0.10*1.3*1.3; - if (secGetNInnerSector()) c.fSigmaZ2 *= 1.33*1.33; - } - - c.fY = (c.fY - 0.5 - 0.5*npads)*par->GetPadPitchWidth(sec); - c.fZ = par->GetZWidth()*(c.fZ-1); - c.fZ -= 3.*par->GetZSigma(); // PASA delay - c.fZ = sign*(z_end - c.fZ); - - if (rx<230./250.*TMath::Abs(c.fZ)) continue; - - c.fSector=sec; - c.fPadRow=row; - Int_t ki=peaks[k].k/MAXZ, kj=peaks[k].k - ki*MAXZ; - c.fTracks[0]=digarr.GetTrackID(kj-1,ki-1,0); - c.fTracks[1]=digarr.GetTrackID(kj-1,ki-1,1); - c.fTracks[2]=digarr.GetTrackID(kj-1,ki-1,2); - - c.fQ=bins[peaks[k].k].q; - - if (ki==1 || ki==npads || kj==1 || kj==MAXZ-2) { - c.fSigmaY2 *= 25.; - c.fSigmaZ2 *= 4.; - } - - AddCluster(c); ncl++; - } - } - - cerr<<"sector, row, compressed digits, clusters: " - <IsOpen()) { + cerr<<"AliTPC::Hits2Clusters(): output file not open !\n"; + return; + } if(fTPCParam == 0){ printf("AliTPCParam MUST be created firstly\n"); return; } - Float_t sigma_rphi,sigma_z,cl_rphi,cl_z; + Float_t sigmaRphi,sigmaZ,clRphi,clZ; // TParticle *particle; // pointer to a given particle AliTPChit *tpcHit; // pointer to a sigle TPC hit - TClonesArray *Particles; //pointer to the particle list + TClonesArray *particles; //pointer to the particle list Int_t sector,nhits; Int_t ipart; Float_t xyz[5]; @@ -1162,8 +646,20 @@ void AliTPC::Hits2Clusters() // Get the access to the tracks //--------------------------------------------------------------- - TTree *TH = gAlice->TreeH(); - Stat_t ntracks = TH->GetEntries(); + TTree *tH = gAlice->TreeH(); + Stat_t ntracks = tH->GetEntries(); + particles=gAlice->Particles(); + + //Switch to the output file + of->cd(); + + fTPCParam->Write(fTPCParam->GetTitle()); + AliTPCClustersArray carray; + carray.Setup(fTPCParam); + carray.SetClusterType("AliTPCcluster"); + carray.MakeTree(); + + Int_t nclusters=0; //cluster counter //------------------------------------------------------------ // Loop over all sectors (72 sectors for 20 deg @@ -1184,13 +680,11 @@ void AliTPC::Hits2Clusters() for(Int_t track=0;trackGetEvent(track); + tH->GetEvent(track); // - // Get number of the TPC hits and a pointer - // to the particles + // Get number of the TPC hits // nhits=fHits->GetEntriesFast(); - Particles=gAlice->Particles(); // // Loop over hits // @@ -1200,7 +694,7 @@ void AliTPC::Hits2Clusters() sector=tpcHit->fSector; // sector number if(sector != isec) continue; //terminate iteration ipart=tpcHit->fTrack; - particle=(TParticle*)Particles->UncheckedAt(ipart); + particle=(TParticle*)particles->UncheckedAt(ipart); pl=particle->Pz(); pt=particle->Pt(); if(pt < 1.e-9) pt=1.e-9; @@ -1208,23 +702,23 @@ void AliTPC::Hits2Clusters() tanth = TMath::Abs(tanth); rpad=TMath::Sqrt(tpcHit->fX*tpcHit->fX + tpcHit->fY*tpcHit->fY); ratio=0.001*rpad/pt; // pt must be in MeV/c - historical reason - + // space-point resolutions - sigma_rphi=SigmaY2(rpad,tanth,pt); - sigma_z =SigmaZ2(rpad,tanth ); + sigmaRphi=SigmaY2(rpad,tanth,pt); + sigmaZ =SigmaZ2(rpad,tanth ); // cluster widths - cl_rphi=ac_rphi-bc_rphi*rpad*tanth+cc_rphi*ratio*ratio; - cl_z=ac_z-bc_z*rpad*tanth+cc_z*tanth*tanth; + clRphi=kACrphi-kBCrphi*rpad*tanth+kCCrphi*ratio*ratio; + clZ=kACz-kBCz*rpad*tanth+kCCz*tanth*tanth; // temporary protection - if(sigma_rphi < 0.) sigma_rphi=0.4e-3; - if(sigma_z < 0.) sigma_z=0.4e-3; - if(cl_rphi < 0.) cl_rphi=2.5e-3; - if(cl_z < 0.) cl_z=2.5e-5; + if(sigmaRphi < 0.) sigmaRphi=0.4e-3; + if(sigmaZ < 0.) sigmaZ=0.4e-3; + if(clRphi < 0.) clRphi=2.5e-3; + if(clZ < 0.) clZ=2.5e-5; // @@ -1232,21 +726,46 @@ void AliTPC::Hits2Clusters() // smearing --> rotate to the 1 (13) or to the 25 (49) sector, // then the inaccuracy in a X-Y plane is only along Y (pad row)! // - //Float_t xprim= tpcHit->fX*cph + tpcHit->fY*sph; + Float_t xprim= tpcHit->fX*cph + tpcHit->fY*sph; Float_t yprim=-tpcHit->fX*sph + tpcHit->fY*cph; - xyz[0]=gRandom->Gaus(yprim,TMath::Sqrt(sigma_rphi)); // y - xyz[1]=gRandom->Gaus(tpcHit->fZ,TMath::Sqrt(sigma_z)); // z + xyz[0]=gRandom->Gaus(yprim,TMath::Sqrt(sigmaRphi)); // y + Float_t alpha=(isec < fTPCParam->GetNInnerSector()) ? + fTPCParam->GetInnerAngle() : fTPCParam->GetOuterAngle(); + Float_t ymax=xprim*TMath::Tan(0.5*alpha); + if (TMath::Abs(xyz[0])>ymax) xyz[0]=yprim; + xyz[1]=gRandom->Gaus(tpcHit->fZ,TMath::Sqrt(sigmaZ)); // z + if (TMath::Abs(xyz[1])>fTPCParam->GetZLength()) xyz[1]=tpcHit->fZ; xyz[2]=tpcHit->fQ; // q - xyz[3]=sigma_rphi; // fSigmaY2 - xyz[4]=sigma_z; // fSigmaZ2 - - Int_t tracks[5]={tpcHit->fTrack, -1, -1, sector, tpcHit->fPadRow}; - AddCluster(xyz,tracks); - + xyz[3]=sigmaRphi; // fSigmaY2 + xyz[4]=sigmaZ; // fSigmaZ2 + + AliTPCClustersRow *clrow=carray.GetRow(sector,tpcHit->fPadRow); + if (!clrow) clrow=carray.CreateRow(sector,tpcHit->fPadRow); + + Int_t tracks[3]={tpcHit->fTrack, -1, -1}; + AliTPCcluster cluster(xyz,tracks); + + clrow->InsertCluster(&cluster); nclusters++; + } // end of loop over hits - } // end of loop over tracks - + + } // end of loop over tracks + + Int_t nrows=fTPCParam->GetNRow(isec); + for (Int_t irow=0; irowWrite(); + + savedir->cd(); //switch back to the input file } // end of function @@ -1268,13 +787,13 @@ void AliTPC::Hits2ExactClustersSector(Int_t isec) // TParticle *particle; // pointer to a given particle AliTPChit *tpcHit; // pointer to a sigle TPC hit - TClonesArray *Particles; //pointer to the particle list + TClonesArray *particles; //pointer to the particle list Int_t sector,nhits; Int_t ipart; - const Int_t cmaxhits=30000; - TVector * xxxx = new TVector(cmaxhits*4); + const Int_t kcmaxhits=30000; + TVector * xxxx = new TVector(kcmaxhits*4); TVector & xxx = *xxxx; - Int_t maxhits = cmaxhits; + Int_t maxhits = kcmaxhits; //construct array for each padrow for (Int_t i=0; iGetNRow(isec);i++) fClustersArray->CreateRow(isec,i); @@ -1283,10 +802,10 @@ void AliTPC::Hits2ExactClustersSector(Int_t isec) // Get the access to the tracks //--------------------------------------------------------------- - TTree *TH = gAlice->TreeH(); - Stat_t ntracks = TH->GetEntries(); - Particles=gAlice->Particles(); - Int_t npart = Particles->GetEntriesFast(); + TTree *tH = gAlice->TreeH(); + Stat_t ntracks = tH->GetEntries(); + particles=gAlice->Particles(); + Int_t npart = particles->GetEntriesFast(); //------------------------------------------------------------ // Loop over tracks @@ -1294,7 +813,7 @@ void AliTPC::Hits2ExactClustersSector(Int_t isec) for(Int_t track=0;trackGetEvent(track); + tH->GetEvent(track); // // Get number of the TPC hits and a pointer // to the particles @@ -1311,7 +830,7 @@ void AliTPC::Hits2ExactClustersSector(Int_t isec) sector=tpcHit->fSector; // sector number if(sector != isec) continue; ipart=tpcHit->fTrack; - if (ipartUncheckedAt(ipart); + if (ipartUncheckedAt(ipart); //find row number @@ -1322,7 +841,7 @@ void AliTPC::Hits2ExactClustersSector(Int_t isec) if (lastrow<0) lastrow=currentrow; if (currentrow==lastrow){ if ( currentIndex>=maxhits){ - maxhits+=cmaxhits; + maxhits+=kcmaxhits; xxx.ResizeTo(4*maxhits); } xxx(currentIndex*4)=x[0]; @@ -1362,7 +881,7 @@ void AliTPC::Hits2ExactClustersSector(Int_t isec) sumx2z+=xxx(index*4+2)*x2; sumq+=xxx(index*4+3); } - Float_t CentralPad = (fTPCParam->GetNPads(isec,lastrow)-1)/2; + Float_t centralPad = (fTPCParam->GetNPads(isec,lastrow)-1)/2; Float_t det=currentIndex*(sumx2*sumx4-sumx3*sumx3)-sumx*(sumx*sumx4-sumx2*sumx3)+ sumx2*(sumx*sumx3-sumx2*sumx2); @@ -1376,7 +895,7 @@ void AliTPC::Hits2ExactClustersSector(Int_t isec) Float_t detbz=currentIndex*(sumxz*sumx4-sumx2z*sumx3)-sumz*(sumx*sumx4-sumx2*sumx3)+ sumx2*(sumx*sumx2z-sumx2*sumxz); - Float_t y=detay/det+CentralPad; + Float_t y=detay/det+centralPad; Float_t z=detaz/det; Float_t by=detby/det; //y angle Float_t bz=detbz/det; //z angle @@ -1442,8 +961,8 @@ void AliTPC::Hits2DigitsSector(Int_t isec) //------------------------------------------------------- - TTree *TH = gAlice->TreeH(); // pointer to the hits tree - Stat_t ntracks = TH->GetEntries(); + TTree *tH = gAlice->TreeH(); // pointer to the hits tree + Stat_t ntracks = tH->GetEntries(); if( ntracks > 0){ @@ -1459,7 +978,7 @@ void AliTPC::Hits2DigitsSector(Int_t isec) row= new TObjArray* [nrows]; - MakeSector(isec,nrows,TH,ntracks,row); + MakeSector(isec,nrows,tH,ntracks,row); //-------------------------------------------------------- // Digitize this sector, row by row @@ -1480,7 +999,7 @@ void AliTPC::Hits2DigitsSector(Int_t isec) fDigitsArray->StoreRow(isec,i); - Int_t ndig = dig->GetSize(); + Int_t ndig = dig->GetDigitSize(); printf("*** Sector, row, compressed digits %d %d %d ***\n",isec,i,ndig); @@ -1519,26 +1038,26 @@ void AliTPC::DigitizeRow(Int_t irow,Int_t isec,TObjArray **rows) fCurrentIndex[1]= isec; - Int_t n_of_pads = fTPCParam->GetNPads(isec,irow); - Int_t n_of_tbins = fTPCParam->GetMaxTBin(); - Int_t IndexRange[4]; + Int_t nofPads = fTPCParam->GetNPads(isec,irow); + Int_t nofTbins = fTPCParam->GetMaxTBin(); + Int_t indexRange[4]; // // Integrated signal for this row // and a single track signal // - TMatrix *m1 = new TMatrix(0,n_of_pads,0,n_of_tbins); // integrated - TMatrix *m2 = new TMatrix(0,n_of_pads,0,n_of_tbins); // single + TMatrix *m1 = new TMatrix(0,nofPads,0,nofTbins); // integrated + TMatrix *m2 = new TMatrix(0,nofPads,0,nofTbins); // single // - TMatrix &Total = *m1; + TMatrix &total = *m1; // Array of pointers to the label-signal list - Int_t NofDigits = n_of_pads*n_of_tbins; // number of digits for this row - Float_t **pList = new Float_t* [NofDigits]; + Int_t nofDigits = nofPads*nofTbins; // number of digits for this row + Float_t **pList = new Float_t* [nofDigits]; Int_t lp; Int_t i1; - for(lp=0;lpZero(); // clear single track signal matrix - Float_t TrackLabel = GetSignal(rows[row],i1,m2,m1,IndexRange); - GetList(TrackLabel,n_of_pads,m2,IndexRange,pList); + Float_t trackLabel = GetSignal(rows[row],i1,m2,m1,indexRange); + GetList(trackLabel,nofPads,m2,indexRange,pList); } - else GetSignal(rows[row],i1,0,m1,IndexRange); + else GetSignal(rows[row],i1,0,m1,indexRange); } } Int_t tracks[3]; AliDigits *dig = fDigitsArray->GetRow(isec,irow); - for(Int_t ip=0;ipGaus(q,fTPCParam->GetNoise()*fTPCParam->GetNoiseNormFac()); q = (Int_t)q; if(q <=zerosup) continue; // do not fill zeros - if(q > adc_sat) q = adc_sat; // saturation + if(q > fTPCParam->GetADCSat()) q = fTPCParam->GetADCSat(); // saturation // // "real" signal or electronic noise (list = -1)? @@ -1605,7 +1124,7 @@ void AliTPC::DigitizeRow(Int_t irow,Int_t isec,TObjArray **rows) // This row has been digitized, delete nonused stuff // - for(lp=0;lpGetNPads(fCurrentIndex[1],fCurrentIndex[3])-1)/2; + Int_t centralPad = (fTPCParam->GetNPads(fCurrentIndex[1],fCurrentIndex[3])-1)/2; Int_t nElectrons = (tv->GetNrows()-1)/4; - IndexRange[0]=9999; // min pad - IndexRange[1]=-1; // max pad - IndexRange[2]=9999; //min time - IndexRange[3]=-1; // max time + indexRange[0]=9999; // min pad + indexRange[1]=-1; // max pad + indexRange[2]=9999; //min time + indexRange[3]=-1; // max time // Float_t IneffFactor = 0.5; // inefficiency in the gain close to the edge, as above @@ -1664,7 +1183,7 @@ Float_t AliTPC::GetSignal(TObjArray *p1, Int_t ntr, TMatrix *m1, TMatrix *m2, if (n>0) for (Int_t i =0; iGetResBin(i); - Int_t pad=index[1]+CentralPad; //in digit coordinates central pad has coordinate 0 + Int_t pad=index[1]+centralPad; //in digit coordinates central pad has coordinate 0 if ( ( pad<(fTPCParam->GetNPads(fCurrentIndex[1],fCurrentIndex[3]))) && (pad>0)) { Int_t time=index[2]; Float_t weight = fTPCParam->GetResWeight(i); //we normalise response to ADC channel @@ -1672,10 +1191,10 @@ Float_t AliTPC::GetSignal(TObjArray *p1, Int_t ntr, TMatrix *m1, TMatrix *m2, if (m1!=0) signal(pad,time)+=weight; total(pad,time)+=weight; - IndexRange[0]=TMath::Min(IndexRange[0],pad); - IndexRange[1]=TMath::Max(IndexRange[1],pad); - IndexRange[2]=TMath::Min(IndexRange[2],time); - IndexRange[3]=TMath::Max(IndexRange[3],time); + indexRange[0]=TMath::Min(indexRange[0],pad); + indexRange[1]=TMath::Max(indexRange[1],pad); + indexRange[2]=TMath::Min(indexRange[2],time); + indexRange[3]=TMath::Max(indexRange[3],time); } } } // end of loop over electrons @@ -1684,7 +1203,7 @@ Float_t AliTPC::GetSignal(TObjArray *p1, Int_t ntr, TMatrix *m1, TMatrix *m2, } //_____________________________________________________________________________ -void AliTPC::GetList(Float_t label,Int_t np,TMatrix *m,Int_t *IndexRange, +void AliTPC::GetList(Float_t label,Int_t np,TMatrix *m,Int_t *indexRange, Float_t **pList) { //---------------------------------------------------------------------- @@ -1699,8 +1218,8 @@ void AliTPC::GetList(Float_t label,Int_t np,TMatrix *m,Int_t *IndexRange, // lop over nonzero digits - for(Int_t it=IndexRange[2];ithighest){ - *(pList[GlobalIndex]+5) = middle; - *(pList[GlobalIndex]+4) = highest; - *(pList[GlobalIndex]+3) = signal(ip,it); + *(pList[globalIndex]+5) = middle; + *(pList[globalIndex]+4) = highest; + *(pList[globalIndex]+3) = signal(ip,it); - *(pList[GlobalIndex]+2) = *(pList[GlobalIndex]+1); - *(pList[GlobalIndex]+1) = *pList[GlobalIndex]; - *pList[GlobalIndex] = label; + *(pList[globalIndex]+2) = *(pList[globalIndex]+1); + *(pList[globalIndex]+1) = *pList[globalIndex]; + *pList[globalIndex] = label; } else if (signal(ip,it)>middle){ - *(pList[GlobalIndex]+5) = middle; - *(pList[GlobalIndex]+4) = signal(ip,it); + *(pList[globalIndex]+5) = middle; + *(pList[globalIndex]+4) = signal(ip,it); - *(pList[GlobalIndex]+2) = *(pList[GlobalIndex]+1); - *(pList[GlobalIndex]+1) = label; + *(pList[globalIndex]+2) = *(pList[globalIndex]+1); + *(pList[globalIndex]+1) = label; } else{ - *(pList[GlobalIndex]+5) = signal(ip,it); - *(pList[GlobalIndex]+2) = label; + *(pList[globalIndex]+5) = signal(ip,it); + *(pList[globalIndex]+2) = label; } } @@ -1805,7 +1324,7 @@ void AliTPC::MakeSector(Int_t isec,Int_t nrows,TTree *TH, for(i=0; i0){ + if(nofElectrons[i]>0){ TVector &v = *tracks[i]; v(0) = previousTrack; - tracks[i]->ResizeTo(4*n_of_electrons[i]+1); // shrink if necessary + tracks[i]->ResizeTo(4*nofElectrons[i]+1); // shrink if necessary row[i]->Add(tracks[i]); } else{ @@ -1854,7 +1373,7 @@ void AliTPC::MakeSector(Int_t isec,Int_t nrows,TTree *TH, } } - n_of_electrons[i]=0; + nofElectrons[i]=0; tracks[i] = new TVector(481); // TVectors for the next fTrack } // end of loop over rows @@ -1862,7 +1381,7 @@ void AliTPC::MakeSector(Int_t isec,Int_t nrows,TTree *TH, previousTrack=currentTrack; // update track label } - Int_t QI = (Int_t) (tpcHit->fQ); // energy loss (number of electrons) + Int_t qI = (Int_t) (tpcHit->fQ); // energy loss (number of electrons) //--------------------------------------------------- // Calculate the electron attachment probability @@ -1872,7 +1391,7 @@ void AliTPC::MakeSector(Int_t isec,Int_t nrows,TTree *TH, Float_t time = 1.e6*(fTPCParam->GetZLength()-TMath::Abs(tpcHit->fZ)) /fTPCParam->GetDriftV(); // in microseconds! - Float_t AttProb = fTPCParam->GetAttCoef()* + Float_t attProb = fTPCParam->GetAttCoef()* fTPCParam->GetOxyCont()*time; // fraction! //----------------------------------------------- @@ -1880,9 +1399,9 @@ void AliTPC::MakeSector(Int_t isec,Int_t nrows,TTree *TH, //----------------------------------------------- Int_t index[3]; index[1]=isec; - for(Int_t nel=0;nelRndm(0)) < AttProb) continue; // electron lost! + if((gRandom->Rndm(0)) < attProb) continue; // electron lost! xyz[0]=tpcHit->fX; xyz[1]=tpcHit->fY; xyz[2]=tpcHit->fZ; @@ -1890,26 +1409,26 @@ void AliTPC::MakeSector(Int_t isec,Int_t nrows,TTree *TH, index[0]=1; TransportElectron(xyz,index); //MI change -august - Int_t row_number; + Int_t rowNumber; fTPCParam->GetPadRow(xyz,index); //MI change august - row_number = index[2]; + rowNumber = index[2]; //transform position to local digit coordinates //relative to nearest pad row - if ((row_number<0)||row_number>=fTPCParam->GetNRow(isec)) continue; - n_of_electrons[row_number]++; + if ((rowNumber<0)||rowNumber>=fTPCParam->GetNRow(isec)) continue; + nofElectrons[rowNumber]++; //---------------------------------- // Expand vector if necessary //---------------------------------- - if(n_of_electrons[row_number]>120){ - Int_t range = tracks[row_number]->GetNrows(); - if((n_of_electrons[row_number])>(range-1)/4){ + if(nofElectrons[rowNumber]>120){ + Int_t range = tracks[rowNumber]->GetNrows(); + if((nofElectrons[rowNumber])>(range-1)/4){ - tracks[row_number]->ResizeTo(range+400); // Add 100 electrons + tracks[rowNumber]->ResizeTo(range+400); // Add 100 electrons } } - TVector &v = *tracks[row_number]; - Int_t idx = 4*n_of_electrons[row_number]-3; + TVector &v = *tracks[rowNumber]; + Int_t idx = 4*nofElectrons[rowNumber]-3; v(idx)= xyz[0]; // X - pad row coordinate v(idx+1)=xyz[1]; // Y - pad coordinate (along the pad-row) @@ -1925,10 +1444,10 @@ void AliTPC::MakeSector(Int_t isec,Int_t nrows,TTree *TH, // for(i=0;i0){ + if(nofElectrons[i]>0){ TVector &v = *tracks[i]; v(0) = previousTrack; - tracks[i]->ResizeTo(4*n_of_electrons[i]+1); // shrink if necessary + tracks[i]->ResizeTo(4*nofElectrons[i]+1); // shrink if necessary row[i]->Add(tracks[i]); } else{ @@ -1938,7 +1457,7 @@ void AliTPC::MakeSector(Int_t isec,Int_t nrows,TTree *TH, } delete [] tracks; - delete [] n_of_electrons; + delete [] nofElectrons; } // end of MakeSector @@ -1974,19 +1493,12 @@ void AliTPC::MakeBranch(Option_t* option) AliDetector::MakeBranch(option); - char *D = strstr(option,"D"); + char *d = strstr(option,"D"); - if (fDigits && gAlice->TreeD() && D) { + if (fDigits && gAlice->TreeD() && d) { gAlice->TreeD()->Branch(branchname,&fDigits, buffersize); printf("Making Branch %s for digits\n",branchname); } - - char *R = strstr(option,"R"); - - if (fClusters && gAlice->TreeR() && R) { - gAlice->TreeR()->Branch(branchname,&fClusters, buffersize); - printf("Making Branch %s for Clusters\n",branchname); - } } //_____________________________________________________________________________ @@ -1994,12 +1506,9 @@ void AliTPC::ResetDigits() { // // Reset number of digits and the digits array for this detector - // reset clusters // fNdigits = 0; if (fDigits) fDigits->Clear(); - fNclusters = 0; - if (fClusters) fClusters->Clear(); } //_____________________________________________________________________________ @@ -2092,8 +1601,10 @@ void AliTPC::SetSens(Int_t sens) fSens = sens; } -void AliTPC::SetSide(Float_t side) +void AliTPC::SetSide(Float_t side=0.) { + // choice of the TPC side + fSide = side; } @@ -2102,6 +1613,8 @@ void AliTPC::SetGasMixt(Int_t nc,Int_t c1,Int_t c2,Int_t c3,Float_t p1, Float_t p2,Float_t p3) { + // gax mixture definition + fNoComp = nc; fMixtComp[0]=c1; @@ -2133,11 +1646,11 @@ void AliTPC::TransportElectron(Float_t *xyz, Int_t *index) Float_t driftl=xyz[2]; if(driftl<0.01) driftl=0.01; driftl=TMath::Sqrt(driftl); - Float_t sig_t = driftl*(fTPCParam->GetDiffT()); - Float_t sig_l = driftl*(fTPCParam->GetDiffL()); - xyz[0]=gRandom->Gaus(xyz[0],sig_t); - xyz[1]=gRandom->Gaus(xyz[1],sig_t); - xyz[2]=gRandom->Gaus(xyz[2],sig_l); + Float_t sigT = driftl*(fTPCParam->GetDiffT()); + Float_t sigL = driftl*(fTPCParam->GetDiffL()); + xyz[0]=gRandom->Gaus(xyz[0],sigT); + xyz[1]=gRandom->Gaus(xyz[1],sigT); + xyz[2]=gRandom->Gaus(xyz[2],sigL); // ExB @@ -2161,75 +1674,13 @@ void AliTPC::Streamer(TBuffer &R__b) AliDetector::Streamer(R__b); if (R__v < 2) return; R__b >> fNsectors; - R__b >> fNclusters; - R__b >> fNtracks; - } else { R__b.WriteVersion(AliTPC::IsA()); AliDetector::Streamer(R__b); R__b << fNsectors; - R__b << fNclusters; - R__b << fNtracks; } } -ClassImp(AliTPCcluster) - -//_____________________________________________________________________________ -AliTPCcluster::AliTPCcluster(Float_t *hits, Int_t *lab) -{ - // - // Creates a simulated cluster for the TPC - // - fTracks[0] = lab[0]; - fTracks[1] = lab[1]; - fTracks[2] = lab[2]; - fSector = lab[3]; - fPadRow = lab[4]; - fY = hits[0]; - fZ = hits[1]; - fQ = hits[2]; - fSigmaY2 = hits[3]; - fSigmaZ2 = hits[4]; -} - -//_____________________________________________________________________________ -void AliTPCcluster::GetXYZ(Float_t *x, const AliTPCParam *par) const -{ - // - // Transformation from local to global coordinate system - // - x[0]=par->GetPadRowRadii(fSector,fPadRow); - x[1]=fY; - x[2]=fZ; - Float_t cs, sn, tmp; - par->AdjustCosSin(fSector,cs,sn); - tmp = x[0]*cs-x[1]*sn; - x[1]= x[0]*sn+x[1]*cs; x[0]=tmp; -} - -//_____________________________________________________________________________ -Int_t AliTPCcluster::Compare(TObject * o) -{ - // - // compare two clusters according y coordinata - // - AliTPCcluster *cl= (AliTPCcluster *)o; - if (fYfY) return -1; - if (fY==cl->fY) return 0; - return 1; -} - -Bool_t AliTPCcluster::IsSortable() const -{ - // - //make AliTPCcluster sortabale - // - return kTRUE; -} - - - ClassImp(AliTPCdigit) //_____________________________________________________________________________ @@ -2264,421 +1715,4 @@ AliHit(shunt,track) fQ = hits[3]; } - -ClassImp(AliTPCtrack) - -//_____________________________________________________________________________ -AliTPCtrack::AliTPCtrack(Float_t *hits) -{ - // - // Default creator for a TPC reconstructed track object - // - fX=hits[0]; // This is dummy code ! -} -//_________________________________________________________________________ - -AliTPCtrack::AliTPCtrack(const AliTPCcluster *c,const TVector& xx, - const TMatrix& CC, Double_t xref, Double_t alpha): - x(xx),C(CC),fClusters(200) -{ - //----------------------------------------------------------------- - // This is the main track constructor. - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - fX=xref; - fAlpha=alpha; - fChi2=0.; - fClusters.AddLast((AliTPCcluster*)(c)); -} - -//_____________________________________________________________________________ -AliTPCtrack::AliTPCtrack(const AliTPCtrack& t) : x(t.x), C(t.C), - fClusters(t.fClusters.GetEntriesFast()) -{ - //----------------------------------------------------------------- - // This is a track copy constructor. - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - fX=t.fX; - fChi2=t.fChi2; - fAlpha=t.fAlpha; - Int_t n=t.fClusters.GetEntriesFast(); - for (Int_t i=0; iGetSigmaY2(); - Double_t c =GetSigmaY2(); - if (c>co) return 1; - else if (c= 0.999) { - if (*this>4) cerr<<*this<<" AliTPCtrack warning: Propagation failed !\n"; - return 0; - } - - Double_t x1=fX, x2=x1+(xk-x1), dx=x2-x1, y1=x(0), z1=x(1); - Double_t c1=x(2)*x1 - x(3), r1=sqrt(1.- c1*c1); - Double_t c2=x(2)*x2 - x(3), r2=sqrt(1.- c2*c2); - - x(0) += dx*(c1+c2)/(r1+r2); - x(1) += dx*(c1+c2)/(c1*r2 + c2*r1)*x(4); - - TMatrix F(5,5); F.UnitMatrix(); - Double_t rr=r1+r2, cc=c1+c2, xx=x1+x2; - F(0,2)= dx*(rr*xx + cc*(c1*x1/r1+c2*x2/r2))/(rr*rr); - F(0,3)=-dx*(2*rr + cc*(c1/r1 + c2/r2))/(rr*rr); - Double_t cr=c1*r2+c2*r1; - F(1,2)= dx*x(4)*(cr*xx-cc*(r1*x2-c2*c1*x1/r1+r2*x1-c1*c2*x2/r2))/(cr*cr); - F(1,3)=-dx*x(4)*(2*cr + cc*(c2*c1/r1-r1 + c1*c2/r2-r2))/(cr*cr); - F(1,4)= dx*cc/cr; - TMatrix tmp(F,TMatrix::kMult,C); - C.Mult(tmp,TMatrix(TMatrix::kTransposed,F)); - - fX=x2; - - //Multiple scattering****************** - Double_t ey=x(2)*fX - x(3); - Double_t ex=sqrt(1-ey*ey); - Double_t ez=x(4); - TMatrix Q(5,5); Q=0.; - Q(2,2)=ez*ez+ey*ey; Q(2,3)=-ex*ey; Q(2,4)=-ex*ez; - Q(3,2)=Q(2,3); Q(3,3)= ez*ez+ex*ex; Q(3,4)=-ey*ez; - Q(4,2)=Q(2,4); Q(4,3)= Q(3,4); Q(4,4)=1.; - - F=0; - F(2,2)=-x(2)*ex; F(2,3)=-x(2)*ey; - F(3,2)=-ex*(x(2)*fX-ey); F(3,3)=-(1.+ x(2)*fX*ey - ey*ey); - F(4,2)=-ez*ex; F(4,3)=-ez*ey; F(4,4)=1.; - - tmp.Mult(F,Q); - Q.Mult(tmp,TMatrix(TMatrix::kTransposed,F)); - - Double_t p2=GetPt()*GetPt()*(1.+x(4)*x(4)); - Double_t beta2=p2/(p2 + pm*pm); - Double_t d=sqrt((x1-fX)*(x1-fX)+(y1-x(0))*(y1-x(0))+(z1-x(1))*(z1-x(1))); - Double_t theta2=14.1*14.1/(beta2*p2*1e6)*d/x0*rho; - Q*=theta2; - C+=Q; - - //Energy losses************************ - Double_t dE=0.153e-3/beta2*(log(5940*beta2/(1-beta2)) - beta2)*d*rho; - if (x1 < x2) dE=-dE; - x(2)*=(1.- sqrt(p2+pm*pm)/p2*dE); - //x(3)*=(1.- sqrt(p2+pm*pm)/p2*dE); - - return 1; -} - -//_____________________________________________________________________________ -void AliTPCtrack::PropagateToVertex(Double_t x0,Double_t rho,Double_t pm) -{ - //----------------------------------------------------------------- - // This function propagates tracks to the "vertex". - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - Double_t c=x(2)*fX - x(3); - Double_t tgf=-x(3)/(x(2)*x(0) + sqrt(1-c*c)); - Double_t snf=tgf/sqrt(1.+ tgf*tgf); - Double_t xv=(x(3)+snf)/x(2); - PropagateTo(xv,x0,rho,pm); -} - -//_____________________________________________________________________________ -void AliTPCtrack::Update(const AliTPCcluster *c, Double_t chisq) -{ - //----------------------------------------------------------------- - // This function associates a clusters with this track. - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - TMatrix H(2,5); H.UnitMatrix(); - TMatrix Ht(TMatrix::kTransposed,H); - TVector m(2); m(0)=c->fY; m(1)=c->fZ; - TMatrix V(2,2); V(0,0)=c->fSigmaY2; V(0,1)=0.; V(1,0)=0.; V(1,1)=c->fSigmaZ2; - - TMatrix tmp(H,TMatrix::kMult,C); - TMatrix R(tmp,TMatrix::kMult,Ht); R+=V; - - Double_t det=(Double_t)R(0,0)*R(1,1) - (Double_t)R(0,1)*R(1,0); - R(0,1)=R(0,0); R(0,0)=R(1,1); R(1,1)=R(0,1); - R(1,0)*=-1; R(0,1)=R(1,0); - R*=1./det; - - //R.Invert(); - - TMatrix K(C,TMatrix::kMult,Ht); K*=R; - - TVector savex=x; - x*=H; x-=m; - - x*=-1; x*=K; x+=savex; - if (TMath::Abs(x(2)*fX-x(3)) >= 0.999) { - if (*this>4) cerr<<*this<<" AliTPCtrack warning: Filtering failed !\n"; - x=savex; - return; - } - - TMatrix saveC=C; - C.Mult(K,tmp); C-=saveC; C*=-1; - - fClusters.AddLast((AliTPCcluster*)c); - fChi2 += chisq; -} - -//_____________________________________________________________________________ -Int_t AliTPCtrack::Rotate(Double_t alpha) -{ - //----------------------------------------------------------------- - // This function rotates this track. - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - fAlpha += alpha; - - Double_t x1=fX, y1=x(0); - Double_t ca=cos(alpha), sa=sin(alpha); - Double_t r1=x(2)*fX - x(3); - - fX = x1*ca + y1*sa; - x(0)=-x1*sa + y1*ca; - x(3)=x(3)*ca + (x(2)*y1 + sqrt(1.- r1*r1))*sa; - - Double_t r2=x(2)*fX - x(3); - if (TMath::Abs(r2) >= 0.999) { - if (*this>4) cerr<<*this<<" AliTPCtrack warning: Rotation failed !\n"; - return 0; - } - - Double_t y0=x(0) + sqrt(1.- r2*r2)/x(2); - if ((x(0)-y0)*x(2) >= 0.) { - if (*this>4) cerr<<*this<<" AliTPCtrack warning: Rotation failed !!!\n"; - return 0; - } - - TMatrix F(5,5); F.UnitMatrix(); - F(0,0)=ca; - F(3,0)=x(2)*sa; - F(3,2)=(y1 - r1*x1/sqrt(1.- r1*r1))*sa; - F(3,3)= ca + sa*r1/sqrt(1.- r1*r1); - TMatrix tmp(F,TMatrix::kMult,C); - // Double_t dy2=C(0,0); - C.Mult(tmp,TMatrix(TMatrix::kTransposed,F)); - // C(0,0)+=dy2*sa*sa*r1*r1/(1.- r1*r1); - // C(1,1)+=dy2*sa*sa*x(4)*x(4)/(1.- r1*r1); - - return 1; -} - -//_____________________________________________________________________________ -void AliTPCtrack::UseClusters() const -{ - //----------------------------------------------------------------- - // This function marks clusters associated with this track. - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - Int_t num_of_clusters=fClusters.GetEntriesFast(); - for (Int_t i=0; iUse(); - } -} - -//_____________________________________________________________________________ -Double_t AliTPCtrack::GetPredictedChi2(const AliTPCcluster *c) const -{ - //----------------------------------------------------------------- - // This function calculates a predicted chi2 increment. - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - TMatrix H(2,5); H.UnitMatrix(); - TVector m(2); m(0)=c->fY; m(1)=c->fZ; - TMatrix V(2,2); V(0,0)=c->fSigmaY2; V(0,1)=0.; V(1,0)=0.; V(1,1)=c->fSigmaZ2; - TVector res=x; res*=H; res-=m; //res*=-1; - TMatrix tmp(H,TMatrix::kMult,C); - TMatrix R(tmp,TMatrix::kMult,TMatrix(TMatrix::kTransposed,H)); R+=V; - - Double_t det=(Double_t)R(0,0)*R(1,1) - (Double_t)R(0,1)*R(1,0); - if (TMath::Abs(det) < 1.e-10) { - if (*this>4) cerr<<*this<<" AliTPCtrack warning: Singular matrix !\n"; - return 1e10; - } - R(0,1)=R(0,0); R(0,0)=R(1,1); R(1,1)=R(0,1); - R(1,0)*=-1; R(0,1)=R(1,0); - R*=1./det; - - //R.Invert(); - - TVector r=res; - res*=R; - return r*res; -} - -//_____________________________________________________________________________ -struct S { Int_t lab; Int_t max; }; -Int_t AliTPCtrack::GetLabel(Int_t nrows) const -{ - //----------------------------------------------------------------- - // This function returns the track label. If label<0, this track is fake. - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - Int_t num_of_clusters=fClusters.GetEntriesFast(); - S *s=new S[num_of_clusters]; - Int_t i; - for (i=0; ifTracks[0]); - Int_t j; - for (j=0; jmax) {max=s[i].max; lab=s[i].lab;} - - delete[] s; - - for (i=0; ifTracks[1]) == lab || - TMath::Abs(c->fTracks[2]) == lab ) max++; - } - - if (1.-Float_t(max)/num_of_clusters > 0.10) return -lab; - - Int_t tail=Int_t(0.08*nrows); - if (num_of_clusters < tail) return lab; - - max=0; - for (i=1; i<=tail; i++) { - AliTPCcluster *c=(AliTPCcluster*)fClusters.UncheckedAt(num_of_clusters-i); - if (lab == TMath::Abs(c->fTracks[0]) || - lab == TMath::Abs(c->fTracks[1]) || - lab == TMath::Abs(c->fTracks[2])) max++; - } - if (max < Int_t(0.5*tail)) return -lab; - - return lab; -} - -//_____________________________________________________________________________ -void AliTPCtrack::GetPxPyPz(Double_t& px, Double_t& py, Double_t& pz) const -{ - //----------------------------------------------------------------- - // This function returns reconstructed track momentum in the global system. - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - Double_t pt=TMath::Abs(GetPt()); // GeV/c - Double_t r=x(2)*fX-x(3); - Double_t y0=x(0) + sqrt(1.- r*r)/x(2); - px=-pt*(x(0)-y0)*x(2); //cos(phi); - py=-pt*(x(3)-fX*x(2)); //sin(phi); - pz=pt*x(4); - Double_t tmp=px*TMath::Cos(fAlpha) - py*TMath::Sin(fAlpha); - py=px*TMath::Sin(fAlpha) + py*TMath::Cos(fAlpha); - px=tmp; -} - -//_____________________________________________________________________________ -Double_t AliTPCtrack::GetdEdX(Double_t low, Double_t up) const { - //----------------------------------------------------------------- - // This funtion calculates dE/dX within the "low" and "up" cuts. - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------- - Int_t ncl=fClusters.GetEntriesFast(); - Int_t n=0; - Double_t *q=new Double_t[ncl]; - Int_t i; - for (i=1; ifQ)/cl->fdEdX; - if (cl->fSector<36) q[n-1]*=1.1; - } - - //stupid sorting - Int_t swap; - do { - swap=0; - for (i=0; ifY); - memmove(clusters+i+1 ,clusters+i,(num_of_clusters-i)*sizeof(AliTPCcluster*)); - clusters[i]=c; num_of_clusters++; -} -//___________________________________________________________________ - -Int_t AliTPCRow::Find(Double_t y) const { - //----------------------------------------------------------------------- - // Return the index of the nearest cluster - // - // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch - //----------------------------------------------------------------------- - if (y <= clusters[0]->fY) return 0; - if (y > clusters[num_of_clusters-1]->fY) return num_of_clusters; - Int_t b=0, e=num_of_clusters-1, m=(b+e)/2; - for (; b clusters[m]->fY) b=m+1; - else e=m; - } - return m; -} -//________________________________________________________________________ diff --git a/TPC/AliTPC.h b/TPC/AliTPC.h index fc8c1814978..a04870872b1 100644 --- a/TPC/AliTPC.h +++ b/TPC/AliTPC.h @@ -1,5 +1,5 @@ -#ifndef TPC_H -#define TPC_H +#ifndef ALITPC_H +#define ALITPC_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ @@ -11,13 +11,12 @@ #include "AliDetector.h" #include "AliHit.h" #include "AliDigit.h" -#include "AliTPCParam.h" #include #include #include -class AliTPCcluster; -class AliTPCtrack; +class TFile; + class AliTPCParam; class AliTPCDigitsArray; @@ -31,10 +30,6 @@ protected: Int_t fSecLows[6]; // List of lower sectors selected Int_t fSecUps[12]; // List of upper sectors selected Int_t fNsectors; // Number of sectors in TPC - Int_t fNclusters; // Number of clusters in TPC - Int_t fNtracks; // Number of tracks in TPC - TClonesArray *fClusters; // List of clusters for all sectors - TClonesArray *fTracks; // List of reconstructed tracks //MI changes AliTPCDigitsArray * fDigitsArray; //detector digit object AliTPCClustersArray * fClustersArray; //detector cluster object @@ -51,26 +46,20 @@ public: AliTPC(); AliTPC(const char *name, const char *title); virtual ~AliTPC(); - virtual void AddCluster(Float_t*, Int_t*); - /*virtual*/void AddCluster(const AliTPCcluster&); - virtual void AddHit(Int_t, Int_t*, Float_t*); - virtual void AddTrack(Float_t*); - /*virtual*/void AddTrack(const AliTPCtrack&); + virtual void AddHit(Int_t a1, Int_t *a2, Float_t *a3); Int_t DistancetoPrimitive(Int_t px, Int_t py); virtual void BuildGeometry(); virtual void CreateGeometry() {} virtual void CreateMaterials(); - virtual void Hits2Clusters(); + virtual void Hits2Clusters(TFile *of); virtual void Hits2ExactClustersSector(Int_t isec); // MI change calculate "exact" cluster position virtual void Hits2Digits(); //MI change virtual void Hits2DigitsSector(Int_t isec); //MI change virtual void Init(); virtual Int_t IsVersion() const =0; - virtual void Digits2Clusters(); - virtual void Clusters2Tracks(); - TClonesArray *Clusters() {return fClusters;} - TClonesArray *Tracks() {return fTracks;} + virtual void Digits2Clusters(TFile *of); + virtual void Clusters2Tracks(TFile *of); Int_t GetNsectors() {return fNsectors;} virtual void MakeBranch(Option_t *opt=" "); @@ -115,36 +104,6 @@ private: ClassDef(AliTPC,2) // Time Projection Chamber class }; -//_____________________________________________________________________________ - -class AliTPCcluster : public TObject { -public: - Int_t fTracks[3];//labels of overlapped tracks - Int_t fSector; //sector number - Int_t fPadRow; //PadRow number - Float_t fY ; //Y of cluster - Float_t fZ ; //Z of cluster - Float_t fQ ; //Q of cluster (in ADC counts) - Float_t fdEdX; //dE/dX inside this cluster - Float_t fSigmaY2; //Sigma Y square of cluster - Float_t fSigmaZ2; //Sigma Z square of cluster - -public: - AliTPCcluster() { - fTracks[0]=fTracks[1]=fTracks[2]=0; - fSector=fPadRow=0; - fY=fZ=fQ=fdEdX=fSigmaY2=fSigmaZ2=0.; - } - AliTPCcluster(Float_t *hits, Int_t*); - virtual ~AliTPCcluster() {;} - void Use() {fQ=-fQ;} //if fQ<0 cluster is already associated with a track - Int_t IsUsed() const {return (fQ<0) ? 1 : 0;} - void GetXYZ(Float_t *x, const AliTPCParam *) const; //Get global x,y,z - Bool_t IsSortable() const; - Int_t Compare(TObject *o) ; - ClassDef(AliTPCcluster,1) // Time Projection Chamber clusters -}; - //_____________________________________________________________________________ @@ -180,167 +139,14 @@ public: ClassDef(AliTPChit,1) // Time Projection Chamber hits }; - - -//_____________________________________________________________________________ -class AliTPCtrack : public TObject { -//----------------------------------------------------------------- -// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch -//----------------------------------------------------------------- - Double_t fAlpha; // rotation angle - Double_t fX; // X-coordinate of this track (reference plane) - TVector x; // vector of track parameters - TMatrix C; // covariance matrix of track parameters - TObjArray fClusters; // clusters belonging to this track - Double_t fChi2; // total chi2 value for this track -public: - AliTPCtrack(): x(5), C(5,5), fClusters(200) {fAlpha=fX=fChi2=0.;} - AliTPCtrack(Float_t *hits); - AliTPCtrack(const AliTPCcluster *c, const TVector& xx, const TMatrix& CC, - Double_t xr, Double_t alpha); - AliTPCtrack(const AliTPCtrack& t); - Int_t Compare(TObject *o); - Int_t PropagateTo(Double_t xr, - Double_t x0=28.94,Double_t rho=0.9e-3,Double_t pm=0.139); - void PropagateToVertex( - Double_t x0=36.66,Double_t rho=1.2e-3,Double_t pm=0.139); - void Update(const AliTPCcluster* c, Double_t chi2); - Int_t Rotate(Double_t angle); - - Bool_t IsSortable() const {return kTRUE;} - void UseClusters() const ; - Double_t GetPredictedChi2(const AliTPCcluster*) const ; - Int_t GetLabel(Int_t nrows) const ; - void GetPxPyPz(Double_t&, Double_t&, Double_t&) const ; - Double_t GetdEdX(Double_t low, Double_t up) const ; - Double_t GetX() const {return fX;} - Double_t GetY() const {return x(0);} - Double_t GetZ() const {return x(1);} - Double_t GetC() const {return x(2);} - Double_t GetEta() const {return x(3);} - Double_t GetTgl() const {return x(4);} - Double_t GetPt() const {return 0.3*0.2/GetC()/100;} - Double_t GetP() const { - return TMath::Abs(GetPt())*sqrt(1.+GetTgl()*GetTgl()); - } - Double_t GetSigmaY2() const {return C(0,0);} - Double_t GetSigmaZ2() const {return C(1,1);} - Double_t GetSigmaC2() const {return C(2,2);} - Double_t GetSigmaTgl2() const {return C(4,4);} - Double_t GetAlpha() const {return fAlpha;} - Double_t GetChi2() const {return fChi2;} - operator Int_t() const {return fClusters.GetEntriesFast();} - const AliTPCcluster *GetCluster(Int_t i) const { - return (const AliTPCcluster *)fClusters.UncheckedAt(i); - } - - ClassDef(AliTPCtrack,1) // Time Projection Chamber reconstructed tracks -}; +#endif -//----------------------------------------------------------------- -// Classes for internal tracking use. -//----------------------------------------------------------------- -const unsigned MAX_CLUSTER_PER_ROW=3500; -class AliTPCRow { -//----------------------------------------------------------------- -// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch -//----------------------------------------------------------------- - unsigned num_of_clusters; - const AliTPCcluster *clusters[MAX_CLUSTER_PER_ROW]; -public: - AliTPCRow() {num_of_clusters=0;} - void InsertCluster(const AliTPCcluster*); - operator Int_t() const {return num_of_clusters;} - const AliTPCcluster* operator[](Int_t i) const {return clusters[i];} - Int_t Find(Double_t y) const; -}; -class AliTPCSector { -//----------------------------------------------------------------- -// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch -//----------------------------------------------------------------- -protected: - unsigned num_of_rows; - AliTPCRow *row; - static AliTPCParam *param; -public: - AliTPCSector() { row = 0; num_of_rows=0; } - virtual ~AliTPCSector() { delete[] row; } - static void SetParam(AliTPCParam *p) { param=p; } - AliTPCRow& operator[](Int_t i) const { return *(row+i); } - Int_t GetNRows() const { return num_of_rows; } - virtual Double_t GetX(Int_t l) const = 0; - virtual Double_t GetMaxY(Int_t l) const = 0; - virtual Double_t GetAlpha() const = 0; - virtual Double_t GetAlphaShift() const = 0; - virtual Int_t GetRowNumber(Double_t x) const = 0; - virtual Double_t GetPadPitchWidth() const = 0; -}; -class AliTPCSSector : public AliTPCSector { -//----------------------------------------------------------------- -// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch -//----------------------------------------------------------------- -public: - AliTPCSSector(){ - if (!param) { - fprintf(stderr,"AliTPCSSector: parameters are not set !\n"); - return; - } - num_of_rows=param->GetNRowLow(); - row=new AliTPCRow[num_of_rows]; - } - virtual ~AliTPCSSector() {} - Double_t GetX(Int_t l) const { return param->GetPadRowRadiiLow(l); } - Double_t GetMaxY(Int_t l) const { return GetX(l)*tan(0.5*GetAlpha()); } - Double_t GetAlpha() const {return param->GetInnerAngle();} - Double_t GetAlphaShift() const {return param->GetInnerAngleShift();} - Double_t GetPadPitchWidth() const { - return param->GetInnerPadPitchWidth(); - } - Int_t GetRowNumber(Double_t x) const { - Double_t r=param->GetPadRowRadiiLow(param->GetNRowLow()-1); - if (x > r) return param->GetNRowLow(); - r=param->GetPadRowRadiiLow(0); - if (x < r) return -1; - return Int_t((x-r)/param->GetInnerPadPitchLength() + 0.5); - } -}; - -class AliTPCLSector : public AliTPCSector { -//----------------------------------------------------------------- -// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch -//----------------------------------------------------------------- -public: - AliTPCLSector(){ - if (!param) { - fprintf(stderr,"AliTPCLSector: parameters are not set !\n"); - return; - } - num_of_rows=param->GetNRowUp(); - row=new AliTPCRow[num_of_rows]; - } - virtual ~AliTPCLSector() {} - Double_t GetX(Int_t l) const { return param->GetPadRowRadiiUp(l); } - Double_t GetMaxY(Int_t l) const { return GetX(l)*tan(0.5*GetAlpha()); } - Double_t GetAlpha() const {return param->GetOuterAngle();} - Double_t GetAlphaShift() const {return param->GetOuterAngleShift();} - Double_t GetPadPitchWidth() const { - return param->GetOuterPadPitchWidth(); - } - Int_t GetRowNumber(Double_t x) const { - Double_t r=param->GetPadRowRadiiUp(param->GetNRowUp()-1); - if (x > r) return param->GetNRowUp(); - r=param->GetPadRowRadiiUp(0); - if (x < r) return -1; - return Int_t((x-r)/param->GetOuterPadPitchLength() + 0.5); - } -}; -#endif diff --git a/TPC/AliClusterFinder.cxx b/TPC/AliTPCClusterFinder.cxx similarity index 76% rename from TPC/AliClusterFinder.cxx rename to TPC/AliTPCClusterFinder.cxx index f2fcd3d7dce..8f7779add58 100644 --- a/TPC/AliClusterFinder.cxx +++ b/TPC/AliTPCClusterFinder.cxx @@ -15,9 +15,8 @@ /* $Log$ -Revision 1.1.4.2 2000/04/10 11:34:56 kowal2 - -Experimental cluster finder +Revision 1.1.2.1 2000/06/25 08:52:51 kowal2 +replacing AliClusterFinder */ @@ -39,6 +38,7 @@ Experimental cluster finder //direction nder threshold or response begin //to increase in given radial direction //----------------------------------------------------------------------------- + #include "TMinuit.h" #include "AliArrayI.h" #include "TClonesArray.h" @@ -47,9 +47,8 @@ Experimental cluster finder #include "AliH2F.h" #include "TMarker.h" #include "AliCluster.h" -#include "AliClusterFinder.h" - -#include "iostream.h" //I.Belikov +#include "AliTPCClusterFinder.h" +#include //direction constants possible direction in 8 different sectors // @@ -60,7 +59,7 @@ const Int_t kClStackSize =1000; -static AliClusterFinder * gClusterFinder; //for fitting routine +static AliTPCClusterFinder * gClusterFinder; //for fitting routine void gauss(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag) { @@ -88,14 +87,14 @@ void gauss(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag) } -ClassImp(AliClusterFinder) +ClassImp(AliTPCClusterFinder) + //ClassImp(AliCell) -AliClusterFinder::AliClusterFinder() +AliTPCClusterFinder::AliTPCClusterFinder() { fDigits =0; fDimX = 0; fDimY = 0; - fOver = 0; fNoiseTh = 3; fMulSigma2 = 16; //4 sigma fDirSigmaFac = 1.4; @@ -105,6 +104,9 @@ AliClusterFinder::AliClusterFinder() fStack = new AliArrayI; fStack->Set(kClStackSize); fClustersArray =0; + SetSigmaX(1,0,0); + SetSigmaY(1,0,0); + fDetectorParam = 0; ResetStatus(); @@ -116,16 +118,68 @@ AliClusterFinder::AliClusterFinder() } -AliClusterFinder::~AliClusterFinder() +AliTPCClusterFinder::~AliTPCClusterFinder() { if (fDigits != 0) delete fDigits; } -void AliClusterFinder::GetHisto(TH2F * his2) +void AliTPCClusterFinder::SetSigmaX(Float_t s0, Float_t s1x, Float_t s1y) +{ + fSigmaX[0]=s0; + fSigmaX[1]=s1x; + fSigmaX[2]=s1y; + +} +void AliTPCClusterFinder::SetSigmaY(Float_t s0, Float_t s1x, Float_t s1y) +{ + fSigmaY[0]=s0; + fSigmaY[1]=s1x; + fSigmaY[2]=s1y; +} + + + +Bool_t AliTPCClusterFinder::SetSigma2(Int_t i, Int_t j, Float_t & sigmax2, Float_t &sigmay2) +{ + // + //set sigmax2 and sigma y2 accordig i and j position of cell + // + + // Float_t x[3] = {ItoX(i),JtoY(j),0}; + Float_t x= ItoX(i); + Float_t y= JtoY(j); + + sigmax2= fSigmaX[0]+fSigmaX[1]*x+fSigmaX[2]*y; + sigmay2= fSigmaY[0]+fSigmaY[1]*x+fSigmaY[2]*y; + return kTRUE; +} + +/* +Bool_t AliTPCClusterFinder::SetSigma2(Int_t i, Int_t j, Float_t & sigmax2, Float_t &sigmay2) +{ + // + //set sigmax2 and sigma y2 accordig i and j position of cell + // + if (fDetectorParam==0) { + sigmax2=1; + sigmay2=1; + return kFALSE; + } + Float_t x[3] = {ItoX(i),JtoY(j),0}; + Float_t sigma[2]; + fDetectorParam->GetClusterSize(x,fDetectorIndex,0,0,sigma); + sigmax2=sigma[0]*(fX2-fX1)*(fX2-fX1)/(fDimX*fDimX); + sigmay2=sigma[1]*(fY2-fY1)*(fY2-fY1)/(fDimY*fDimY); + return kTRUE; +} +*/ + + +void AliTPCClusterFinder::GetHisto(TH2F * his2) { - Int_t idim =his2->GetNbinsX(); - Int_t jdim =his2->GetNbinsY(); + UInt_t idim =his2->GetNbinsX(); + UInt_t jdim =his2->GetNbinsY(); fX1 = his2->GetXaxis()->GetXmin(); fX2 = his2->GetXaxis()->GetXmax(); fY1 = his2->GetYaxis()->GetXmin(); @@ -136,17 +190,20 @@ void AliClusterFinder::GetHisto(TH2F * his2) rOK = kTRUE; fDimX = idim; fDimY = jdim; - //Int_t size =idim*jdim; + Int_t size =idim*jdim; if (fDigits !=0) delete fDigits; - fDigits = (AliCell*) new AliCell[idim*jdim]; + fDigits = (Int_t*) new Int_t[size]; + fCells = (AliCell*) new AliCell[size]; + } else rOK=kFALSE; for (Int_t i = 0; iGetBin(i+1,j+1); - AliCell * cell = GetCell(i,j); - if (cell!=0) cell->SetSignal(his2->GetBinContent(index)); + //AliCell * cell = GetCell(i,j); + //if (cell!=0) cell->SetSignal(his2->GetBinContent(index)); + SetSignal(his2->GetBinContent(index),i,j); } } @@ -154,7 +211,7 @@ void AliClusterFinder::GetHisto(TH2F * his2) -void AliClusterFinder::FindMaxima() +void AliTPCClusterFinder::FindMaxima() { for (Int_t i=0; ifSigmaY2=c->fSigmaY2*(fY2-fY1)*(fY2-fY1)/(fDimY*fDimY); c->fArea =c->fArea*(fX2-fX1)*(fY2-fY1)/(fDimX*fDimY); } -void AliClusterFinder::AddToStack(Int_t i, Int_t j, Int_t signal) +void AliTPCClusterFinder::AddToStack(Int_t i, Int_t j, Int_t signal) { // //add digit to stack @@ -188,13 +245,13 @@ void AliClusterFinder::AddToStack(Int_t i, Int_t j, Int_t signal) fStackIndex+=3; } -void AliClusterFinder::GetClusterStatistic(AliDigitCluster & cluster) +void AliTPCClusterFinder::GetClusterStatistic(AliDigitCluster & cluster) { // //calculate statistic of cluster // Double_t sumxw,sumyw,sumx2w,sumy2w,sumxyw,sumw; - Int_t minx,maxx,miny,maxy,maxQ; + Int_t minx,maxx,miny,maxy; sumxw=sumyw=sumx2w=sumy2w=sumxyw=sumw=0; minx=fDimX; maxx=-fDimX; @@ -202,13 +259,22 @@ void AliClusterFinder::GetClusterStatistic(AliDigitCluster & cluster) maxy=-fDimY; Int_t x0=fStack->At(0); Int_t y0=fStack->At(1); - maxQ=fStack->At(2); + Int_t maxQx =x0; + Int_t maxQy =y0; + Int_t maxQ=fStack->At(2); + + for (Int_t i = 0; iAt(i); Int_t y = fStack->At(i+1); Int_t dx=x-x0; Int_t dy=y-y0; Int_t w = fStack->At(i+2); + if (w>maxQ){ + maxQ = w; + maxQx = x; + maxQy=y; + } if (xmaxx) maxx=x; @@ -228,8 +294,8 @@ void AliClusterFinder::GetClusterStatistic(AliDigitCluster & cluster) cluster.fSigmaX2 = sumx2w/sumw-cluster.fX*cluster.fX; cluster.fSigmaY2 = sumy2w/sumw-cluster.fY*cluster.fY; cluster.fSigmaXY = sumxyw/sumw-cluster.fX*cluster.fY; - cluster.fMaxX = x0; - cluster.fMaxY = y0; + cluster.fMaxX = maxQx; + cluster.fMaxY = maxQy; cluster.fMax = maxQ; cluster.fArea = fStackIndex/3; cluster.fNx = maxx-minx+1; @@ -238,7 +304,7 @@ void AliClusterFinder::GetClusterStatistic(AliDigitCluster & cluster) cluster.fY +=y0; } } -void AliClusterFinder::GetClusterFit(AliDigitCluster & cluster) +void AliTPCClusterFinder::GetClusterFit(AliDigitCluster & cluster) { // //calculate statistic of cluster @@ -333,7 +399,7 @@ void AliClusterFinder::GetClusterFit(AliDigitCluster & cluster) } } -Bool_t AliClusterFinder::CheckIfDirBorder(Float_t x, Float_t y, +Bool_t AliTPCClusterFinder::CheckIfDirBorder(Float_t x, Float_t y, Int_t i,Int_t j) { // @@ -343,7 +409,8 @@ Bool_t AliClusterFinder::CheckIfDirBorder(Float_t x, Float_t y, //direction is given by the Float_t virtualcell; AliCell * cellor= GetCell(i,j); - + Int_t sigor = GetSignal(i,j); + //control derivation in direction //if function grows up in direction then there is border Float_t dx = i-x; @@ -359,28 +426,30 @@ Bool_t AliClusterFinder::CheckIfDirBorder(Float_t x, Float_t y, //I accept sigmax and sigma y bigge by factor sqrt(fDirsigmaFac) Float_t amp = TMath::Exp(-d2)*fCurrentMaxAmp*fDirAmpFac; //safety factor fDirFac>1 - if (cellor->GetSignal()>amp) return kTRUE; + if (sigor>amp) return kTRUE; if (dd==0) return kFALSE; dx/=dd; dy/=dd; virtualcell = GetVirtualSignal(i+dx,j+dy); if (virtualcell <=fThreshold) return kFALSE; - if (virtualcell>cellor->GetSignal()) - if (virtualcell>(cellor->GetSignal()+fNoiseTh)) - {cellor->SetDirBorder(fIndex+1); return kTRUE;} + if (virtualcell>sigor) + if (virtualcell>(sigor+fNoiseTh)) + {cellor->SetDirBorder(fIndex); return kTRUE;} else { virtualcell = GetVirtualSignal(i+2*dx,j+2*dy); - if (virtualcell>cellor->GetSignal()) - { cellor->SetDirBorder(fIndex+1); return kTRUE;} + if (virtualcell>sigor) + { cellor->SetDirBorder(fIndex); return kTRUE;} }; return kFALSE; } -Bool_t AliClusterFinder::IsMaximum(Int_t i, Int_t j) + + +Bool_t AliTPCClusterFinder::IsMaximum(Int_t i, Int_t j) { //there is maximum if given digits is 1 sigma over all adjacent //in 8 neighborow @@ -391,27 +460,29 @@ Bool_t AliClusterFinder::IsMaximum(Int_t i, Int_t j) Int_t overth=0; Int_t oversigma =0; AliCell * cell = GetCell(i,j); + Int_t signal = GetSignal(i,j); if (cell == 0) return kFALSE; for ( Int_t di=-1;di<=1;di++) for ( Int_t dj=-1;dj<=1;dj++){ if ( (di!=0) || (dj!=0)) { AliCell * cell2=GetCell(i+di,j+dj); + Int_t signal2 = GetSignal(i+di,j+dj); if (cell2 == 0) { over+=1; oversigma+=1; } else { - if (cell2->GetSignal()>cell->GetSignal()) return kFALSE; - if (cell2->GetSignal()>fThreshold) overth++; - if (cell2->GetSignal()==cell->GetSignal()) { + if (signal2>signal) return kFALSE; + if (signal2>fThreshold) overth++; + if (signal2==signal) { if (di<0) return kFALSE; if ( (di+dj)<0) return kFALSE; } - // if (cell->GetSignal()>=cell2->GetSignal()){ + // if (signal>=signal2){ over+=1; - if (cell->GetSignal()>fNoiseTh+cell2->GetSignal()) + if (signal>fNoiseTh+signal2) oversigma+=1; //} } @@ -423,24 +494,24 @@ Bool_t AliClusterFinder::IsMaximum(Int_t i, Int_t j) if (oversigma==8) { fCurrentMaxX = i; fCurrentMaxY = j; - fCurrentMaxAmp =cell->GetSignal(); - SetMaximum(fIndex+1,i,j); + fCurrentMaxAmp =signal; + SetMaximum(fIndex,i,j); return kTRUE; } //check if there exist virtual maximum - for (Float_t dii=0;(dii<1);dii+=0.5) - for (Float_t dj=0;(dj<1);dj+=0.5) - if (IsVirtualMaximum(Float_t(i)+dii,Float_t(j)+dj)){ - fCurrentMaxX = i+dii; - fCurrentMaxY = j+dj; - fCurrentMaxAmp =cell->GetSignal(); - SetMaximum(fIndex+1,i,j); + for (Float_t ddi=0.;(ddi<1.);ddi+=0.5) + for (Float_t ddj=0.;(ddj<1.);ddj+=0.5) + if (IsVirtualMaximum(Float_t(i)+ddi,Float_t(j)+ddj)){ + fCurrentMaxX = i+ddi; + fCurrentMaxY = j+ddj; + fCurrentMaxAmp =signal; + SetMaximum(fIndex,i,j); return kTRUE; } return kFALSE; } -Bool_t AliClusterFinder::IsVirtualMaximum(Float_t x, Float_t y) +Bool_t AliTPCClusterFinder::IsVirtualMaximum(Float_t x, Float_t y) { //there is maximum if given digits is 1 sigma over all adjacent //in 8 neighborow or @@ -475,11 +546,11 @@ Bool_t AliClusterFinder::IsVirtualMaximum(Float_t x, Float_t y) if (oversigma==8) res = kTRUE; else if ((over==8)&&(GetNType()==8)) res=kTRUE; else if (over ==8 ) - for ( Int_t dia=-2;dia<=2;dia++) + for ( Int_t di=-2;di<=2;di++) for ( Int_t dj=-2;dj<=2;dj++) - if ( (dia==2)||(dia==-2) || (dj==2)|| (dj==-2) ) + if ( (di==2)||(di==-2) || (dj==2)|| (dj==-2) ) { - Float_t virtualcell2=GetVirtualSignal(x+dia,y+dj); + Float_t virtualcell2=GetVirtualSignal(x+di,y+dj); if (virtualcell2 < 0) { over+=1; oversigma+=1; @@ -495,36 +566,36 @@ Bool_t AliClusterFinder::IsVirtualMaximum(Float_t x, Float_t y) } -void AliClusterFinder::ResetSignal() +void AliTPCClusterFinder::ResetSignal() { //reset dignals to 0 Int_t size = fDimX*fDimY; - AliCell *dig=fDigits; + AliCell *dig=fCells; if (rOK==kTRUE) for (Int_t i=0 ; i=0) && (i=0) && (j0) w=1/TMath::Sqrt(w); else w=9999999; AliCell * cel2 =GetCell(i+di,j+dj); + Int_t signal2 = GetSignal(i+di,j+dj); if (cel2!=0) { sumw+=w; - sum+= cel2->GetSignal()*w; + sum+= signal2*w; } } if (sumw>0) return (sum/sumw); @@ -553,35 +625,18 @@ Float_t AliClusterFinder::GetVirtualSignal(Float_t ri, Float_t rj) -void AliClusterFinder::Streamer(TBuffer & R__b) +void AliTPCClusterFinder::Streamer(TBuffer & R__b) { if (R__b.IsReading()) { // Version_t R__v = R__b.ReadVersion(); } else { - R__b.WriteVersion(AliClusterFinder::IsA()); + R__b.WriteVersion(AliTPCClusterFinder::IsA()); } } -Bool_t AliClusterFinder::SetSigma2(Int_t i, Int_t j, Float_t & sigmax2, Float_t &sigmay2) -{ - // - //set sigmax2 and sigma y2 accordig i and j position of cell - // - if (fDetectorParam==0) { - sigmax2=1; - sigmay2=1; - return kFALSE; - } - Float_t x[3] = {ItoX(i),JtoY(j),0}; - Float_t sigma[2]; - fDetectorParam->GetClusterSize(x,fDetectorIndex,0,0,sigma); - sigmax2=sigma[0]*(fX2-fX1)*(fX2-fX1)/(fDimX*fDimX); - sigmay2=sigma[1]*(fY2-fY1)*(fY2-fY1)/(fDimY*fDimY); - return kTRUE; -} -void AliClusterFinder::SetBlockIndex(Int_t * index) +void AliTPCClusterFinder::SetBlockIndex(Int_t * index) { // //calculate which indexes we must check for border @@ -615,17 +670,20 @@ void AliClusterFinder::SetBlockIndex(Int_t * index) //*********************************************************************** //*********************************************************************** -TClonesArray * AliClusterFinder::FindPeaks1(TClonesArray *arr) +TClonesArray * AliTPCClusterFinder::FindPeaks1(TClonesArray *arr) { //find peaks and write it in form of AliTPCcluster to array - TClonesArray * clusters; - if (arr==0) clusters=new TClonesArray("AliDigitCluster",300); - else clusters = arr; - fClustersArray = clusters; - AliDigitCluster c; - Int_t index = clusters->GetEntriesFast(); + if (arr==0){ + fClustersArray=new TClonesArray("AliDigitCluster",300); + fIndex=1; + } + else { + fClustersArray = arr; + fIndex = fClustersArray->GetEntriesFast(); + } + + AliDigitCluster c; ResetStatus(); - for (Int_t i=0; iGetEntriesFast(); - + if (arr==0){ + fClustersArray=new TClonesArray("AliDigitCluster",300); + fIndex=1; + } + else { + fClustersArray = arr; + fIndex = fClustersArray->GetEntriesFast(); + } + + AliDigitCluster c; ResetStatus(); for (Int_t i=0; iGetEntriesFast(); - + if (arr==0){ + fClustersArray=new TClonesArray("AliDigitCluster",300); + fIndex=1; + } + else { + fClustersArray = arr; + fIndex = fClustersArray->GetEntriesFast(); + } + + AliDigitCluster c; ResetStatus(); Int_t dmax=5; @@ -708,42 +772,43 @@ TClonesArray * AliClusterFinder::FindPeaks3(TClonesArray *arr) fStackIndex=0; if (IsMaximum(i,j) == kTRUE){ SetSigma2(i,j,fCurrentSigmaX2,fCurrentSigmaY2); - AddToStack(i,j,GetCell(i,j)->GetSignal()); + AddToStack(i,j,GetSignal(i,j)); //loop over different distance naccepted =1; for ( Int_t dd =1;((dd<=dmax) && (naccepted>0));dd++){ naccepted=0; for (Int_t di = -dd;di<=dd;di++){ - Int_t ddj = dd-TMath::Abs(di); + Int_t ddj = dd-abs(di); Int_t sigstart = (ddj>0) ? -1 : 0; for (Int_t sig = sigstart;sig<=1;sig+=2){ Int_t dj= sig*ddj; AliCell *cell= GetCell(i+di,j+dj); + Int_t signal = GetSignal(i+di,j+dj); if (cell==0) continue; Int_t index[6]; index[0]=di; index[1]=dj; if (dd>2) { SetBlockIndex(index); //adjust index to control - if ( IsBorder(fIndex+1,i+index[2],j+index[3]) || - IsBorder(fIndex+1,i+index[4],j+index[5])) { - cell->SetBorder(fIndex+1); + if ( IsBorder(fIndex,i+index[2],j+index[3]) || + IsBorder(fIndex,i+index[4],j+index[5])) { + cell->SetBorder(fIndex); continue; } } - if ( cell->GetSignal()<=fThreshold ){ + if ( signal<=fThreshold ){ //if under threshold - cell->SetThBorder(fIndex+1); - if (fBFit==kTRUE) AddToStack(i+di,j+dj,cell->GetSignal()); + cell->SetThBorder(fIndex); + if (fBFit==kTRUE) AddToStack(i+di,j+dj,signal); continue; } naccepted++; if (CheckIfDirBorder(fCurrentMaxX,fCurrentMaxY,i+di,j+dj) == kTRUE) { - if (fBFit==kFALSE) AddToStack(i+di,j+dj,cell->GetSignal()/2); + if (fBFit==kFALSE) AddToStack(i+di,j+dj,signal/2); continue; } - AddToStack(i+di,j+dj,cell->GetSignal()); + AddToStack(i+di,j+dj,signal); } //loop over sig dj } //loop over di @@ -758,13 +823,13 @@ TClonesArray * AliClusterFinder::FindPeaks3(TClonesArray *arr) // Transform(&c); //write cluster information to array - TClonesArray &lclusters = *clusters; + TClonesArray &lclusters = *fClustersArray; new(lclusters[fIndex++]) AliDigitCluster(c); // cout<<"fx="< fMulSigma2) { - SetDirBorder(fIndex+1,i,j); + SetDirBorder(fIndex,i,j); return; } } AliCell *cell = GetCell(i,j); - Int_t q=cell->GetSignal(); - cell->SetChecked(fIndex+1); + Int_t signal = GetSignal(i,j); + Int_t q=signal; + cell->SetChecked(fIndex); if ( (q>fThreshold) || (fBFit==kTRUE)) AddToStack(i,j,q); if ( q >fThreshold ) { AliCell * newcel; newcel = GetCell(i-1,j); - if (newcel !=0) if (!newcel->IsChecked(fIndex+1) ) Adjacent(i-1,j); + if (newcel !=0) if (!newcel->IsChecked(fIndex) ) Adjacent(i-1,j); newcel = GetCell(i,j-1); - if (newcel !=0) if (!newcel->IsChecked(fIndex+1) ) Adjacent(i,j-1); + if (newcel !=0) if (!newcel->IsChecked(fIndex) ) Adjacent(i,j-1); newcel = GetCell(i+1,j); - if (newcel !=0) if (!newcel->IsChecked(fIndex+1) ) Adjacent(i+1,j); + if (newcel !=0) if (!newcel->IsChecked(fIndex) ) Adjacent(i+1,j); newcel = GetCell(i,j+1); - if (newcel !=0) if (!newcel->IsChecked(fIndex+1) ) Adjacent(i,j+1); + if (newcel !=0) if (!newcel->IsChecked(fIndex) ) Adjacent(i,j+1); } - else cell->SetThBorder(fIndex+1); + else cell->SetThBorder(fIndex); } -AliH2F * AliClusterFinder::Draw( const char *option, +AliH2F * AliTPCClusterFinder::DrawHisto( const char *option=0, Float_t x1, Float_t x2, Float_t y1, Float_t y2) { // @@ -839,7 +905,7 @@ AliH2F * AliClusterFinder::Draw( const char *option, } -void AliClusterFinder::DrawCluster( +void AliTPCClusterFinder::DrawCluster( Int_t color, Int_t size, Int_t style) { @@ -860,7 +926,7 @@ void AliClusterFinder::DrawCluster( -AliH2F * AliClusterFinder::DrawBorders( const char *option, AliH2F *h, Int_t type , +AliH2F * AliTPCClusterFinder::DrawBorders( const char *option, AliH2F *h, Int_t type , Float_t x1, Float_t x2, Float_t y1, Float_t y2) { // diff --git a/TPC/AliClusterFinder.h b/TPC/AliTPCClusterFinder.h similarity index 81% rename from TPC/AliClusterFinder.h rename to TPC/AliTPCClusterFinder.h index 47a55dffc9c..d3094791a4a 100644 --- a/TPC/AliClusterFinder.h +++ b/TPC/AliTPCClusterFinder.h @@ -1,13 +1,12 @@ #ifndef TCLUSTERFINDER_H #define TCLUSTERFINDER_H -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ -/* $Id$ */ // include files and class forward declarations #include "TObject.h" #include "TH2.h" +#include "AliCluster.h" + class TClonesArray; class AliCluster; class AliCell; @@ -15,12 +14,13 @@ class AliArrayI; class AliDetectorParam; class TMinuit; class AliH2F; -class AliClusterFinder : public TObject { + +class AliTPCClusterFinder : public TObject { public: - AliClusterFinder(); + AliTPCClusterFinder(); // constructor which create cluster finder object - ~AliClusterFinder(); + ~AliTPCClusterFinder(); void GetHisto(TH2F * his2); //reset object to include histograms values TClonesArray * FindPeaks1( TClonesArray *arr=0); @@ -35,8 +35,6 @@ public: void SetDirSigmaFac(Float_t fac) {fDirSigmaFac = fac;} void SetDirAmpFac(Float_t fac) {fDirAmpFac = fac;} - void SetDetectorParam(AliDetectorParam*param) {fDetectorParam = param;} - //set Detector parameters -necesssary to estimate cluster size void SetDetectorIndex(Int_t *index) {fDetectorIndex = index;} //set index of described detector Bool_t SetSigma2(Int_t i, Int_t j, Float_t & sigmax2, Float_t & sigmay2); @@ -46,11 +44,15 @@ public: Int_t GetStackIndex(){return fStackIndex;} void SetBFit(Bool_t fit) {fBFit = fit;} TMinuit * GetMinuit() {return fMinuit;} - AliH2F * Draw( const char *option=0,Float_t x1=-1, Float_t x2=-1, Float_t y1=-1, Float_t y2=-1); + AliH2F * DrawHisto( const char *option,Float_t x1=-1, Float_t x2=-1, Float_t y1=-1, Float_t y2=-1); //draw digits void DrawCluster(Int_t color=5, Int_t size=5, Int_t style=4); AliH2F * DrawBorders( const char *option=0, AliH2F *his=0, Int_t type =0, Float_t x1=-1, Float_t x2=-1, Float_t y1=-1, Float_t y2=-1); //draw digits + + void SetSigmaX(Float_t s0, Float_t s1x, Float_t s1y); + void SetSigmaY(Float_t s0, Float_t s1x, Float_t s1y); + public: Bool_t IsMaximum(Int_t i, Int_t j); Bool_t IsVirtualMaximum(Float_t x, Float_t y); @@ -61,7 +63,11 @@ public: AliCell * GetCell(Int_t i, Int_t j); //return reference to the cell with index i,j void SetBlockIndex(Int_t *index); //calculate which indexes we must check for border + void SetDetectorParam(AliDetectorParam*param) {fDetectorParam = param;} + //set Detector parameters -necesssary to estimate cluster size + public: + void AddToStack(Int_t i, Int_t j, Int_t signal); //add given cell to the stack of particles void GetClusterStatistic(AliDigitCluster & cluster); @@ -85,9 +91,9 @@ public: inline void SetDirBorder(Int_t index, Int_t i, Int_t j); inline void SetMaximum(Int_t index, Int_t i, Int_t j); - - + inline Int_t GetSignal(Int_t i, Int_t j); + inline void SetSignal(Int_t signal, Int_t i, Int_t j); Float_t GetVirtualSignal(Float_t ri, Float_t rj); //create new virtual cell and interpolate signal at position ri,rj @@ -107,15 +113,21 @@ private: Float_t fThreshold; //treshold; Float_t fNoiseTh; //noise threshoshol to accept maximum - AliCell * fDigits; //field with all cell digits + Int_t *fDigits; //field with all digits + AliCell *fCells; //field with all cell status Int_t fIndex; //!index of current cluster AliArrayI * fStack; //!stack with digits index Int_t fStackIndex; //!stack index TMinuit *fMinuit; //!minuit object + + // AliDetectorParam * fDetectorParam; //pointer to detector param - finder is not owner Int_t * fDetectorIndex; // detector index - + // + Float_t fSigmaX[3]; //x cluster size parametrization + Float_t fSigmaY[3]; //y cluster size parametrization //original frame Float_t fX1; Float_t fY1; @@ -123,13 +135,12 @@ private: Float_t fY2; Int_t fDimX; Int_t fDimY; - Int_t fOver; - + // TClonesArray * fClustersArray; //array with current clusters Bool_t rOK; //signalize that all fields were initialised - ClassDef(AliClusterFinder,2) + ClassDef(AliTPCClusterFinder,2) }; @@ -138,18 +149,13 @@ private: //////////////////////////////////////////////////////////////////////////// //objec AliCell -const Int_t krCheck = 1; -const Int_t krBorder = 2; -const Int_t krThBorder = 4; -const Int_t krDirBorder = 8; -const Int_t krMaximum = 16; -const Int_t krIndexNull =0x1F; - class AliCell{ +private : + enum State {krCheck = 1,krBorder = 2,krThBorder = 4,krDirBorder = 8, krMaximum = 16,krIndexNull =0x1F}; public : - AliCell(Int_t signal =0, Int_t status = 0){fSignal =signal;fStatus = status;} + AliCell(Int_t status = 0){fStatus = status;} //at the begining set - void SetSignal(Int_t signal){fSignal = signal;} + void SetStatus(Int_t status){fStatus = status;} void SetChecked(Int_t index) {fStatus &=krIndexNull; fStatus+=(index<<5); fStatus|=krCheck;} void SetChecked() {fStatus|=krCheck;} @@ -177,30 +183,32 @@ public : Bool_t IsMaximum() {return ((fStatus&krMaximum)!=0);} Bool_t IsMaximum(Int_t index) {return ( ((fStatus&krMaximum)!=0) && ((fStatus>>5)==index));} - void Reset() { fStatus = 0; fSignal =0;} - Int_t GetSignal() {return fSignal;} + void Reset() { fStatus = 0;} + Int_t GetStatus() {return fStatus;} - private: - Int_t fSignal; Int_t fStatus; + // ClassDef(AliCell,0) }; -Int_t AliClusterFinder::GetSignal(Int_t i, Int_t j) -{ - AliCell *c = GetCell(i,j); - Int_t res; - if (c==0) res = -1; - else res = c->GetSignal(); - return res; +Int_t AliTPCClusterFinder::GetSignal(Int_t i, Int_t j) +{ + return ( (i>=0) && (i=0) && (j=0) && (i=0) && (jGetNRowsTotal()); } diff --git a/TPC/AliTPCClustersArray.h b/TPC/AliTPCClustersArray.h index 08f891a5e30..5b0abffad80 100644 --- a/TPC/AliTPCClustersArray.h +++ b/TPC/AliTPCClustersArray.h @@ -35,7 +35,7 @@ public: AliTPCClustersRow * LoadRow(Int_t sector,Int_t row); Bool_t StoreRow(Int_t sector,Int_t row); Bool_t ClearRow(Int_t sector,Int_t row); - Bool_t Setup(AliDetectorParam *param); + Bool_t Setup(const AliDetectorParam *param); //construct array according parameters in fParam Bool_t Update(); //blabla AliSegmentID * NewSegment(); //create new segment - AliTPCClustersRow diff --git a/TPC/AliTPCClustersRow.cxx b/TPC/AliTPCClustersRow.cxx index f44e6f9a7ec..17e5a5fcb3a 100644 --- a/TPC/AliTPCClustersRow.cxx +++ b/TPC/AliTPCClustersRow.cxx @@ -22,8 +22,8 @@ // // // // /////////////////////////////////////////////////////////////////////////////// -#include "AliTPC.h" -#include "AliCluster.h" +#include "AliTPCcluster.h" +#include #include "AliClusters.h" #include "AliTPCClustersRow.h" #include "TDirectory.h" @@ -46,9 +46,18 @@ AliTPCClustersRow::AliTPCClustersRow() } //_____________________________________________________________________________ -//AliTPCClustersRow::AliTPCClustersRow(Int_t size) -//{ -// fNclusters=0; -// fClusters = new TClonesArray("AliTPCcluster",size); -//} +TObject *AliTPCClustersRow::InsertCluster(const TObject *c) +{ + // + // Add a simulated cluster copy to the list + // + if (fClass==0) { + Error("AliClusters", "class type not specified"); + return 0; + } + if(!fClusters) fClusters=new TClonesArray(fClass->GetName(),1000); + TClonesArray &lclusters = *fClusters; + return new(lclusters[fNclusters++]) AliTPCcluster(*((AliTPCcluster*)c)); +} + diff --git a/TPC/AliTPCClustersRow.h b/TPC/AliTPCClustersRow.h index c7a5bd7ad70..18c0babc667 100644 --- a/TPC/AliTPCClustersRow.h +++ b/TPC/AliTPCClustersRow.h @@ -24,6 +24,7 @@ class TObjArray; class AliTPCClustersRow : public AliClusters{ public: AliTPCClustersRow(); + virtual TObject *InsertCluster(const TObject *c); public: diff --git a/TPC/AliTPCTestTracking.C b/TPC/AliTPCComparison.C similarity index 73% rename from TPC/AliTPCTestTracking.C rename to TPC/AliTPCComparison.C index 778b3b6cb8e..ee710286bee 100644 --- a/TPC/AliTPCTestTracking.C +++ b/TPC/AliTPCComparison.C @@ -6,70 +6,42 @@ struct GoodTrack { }; Int_t good_tracks(GoodTrack *gt, Int_t max); -void AliTPCTestTracking() { - const char *pname="75x40_100x60"; - -// Dynamically link some shared libs - - if (gClassTable->GetID("AliRun") < 0) { - gROOT->LoadMacro("loadlibs.C"); - loadlibs(); - } else { - delete gAlice; - gAlice=0; - } - -// Connect the Root Galice file containing Geometry, Kine and Hits - TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root"); - if (!file) file = new TFile("galice.root"); - //if (!file) file = TFile::Open("rfio:galice.root"); +Int_t AliTPCComparison() { + cerr<<"Doing comparison...\n"; -// Get AliRun object from file or create it if not on file - if (!gAlice) { - gAlice = (AliRun*)file->Get("gAlice"); - if (gAlice) printf("AliRun object found on file\n"); - if (!gAlice) gAlice = new AliRun("gAlice","Alice test program"); + TFile *cf=TFile::Open("AliTPCclusters.root"); + if (!cf->IsOpen()) {cerr<<"Can't open AliTPCclusters.root !\n"; return 1;} + AliTPCParam *digp= (AliTPCParam*)cf->Get("75x40_100x60"); + if (!digp) { cerr<<"TPC parameters have not been found !\n"; return 2; } + +// Load clusters + AliTPCClustersArray *ca=new AliTPCClustersArray; + ca->Setup(digp); + ca->SetClusterType("AliTPCcluster"); + ca->ConnectTree("Segment Tree"); + Int_t nentr=Int_t(ca->GetTree()->GetEntries()); + for (Int_t i=0; iLoadEntry(i); } - gAlice->GetEvent(0); - - AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC"); - Int_t ver=TPC->IsVersion(); - cerr<<"TPC version "<Get(pname); - if (digp!=0) TPC->SetParam(digp); - else cerr<<"Warning: default TPC parameters will be used !\n"; - - Int_t nrow_up=TPC->GetParam()->GetNRowUp(); - Int_t nrows=TPC->GetParam()->GetNRowLow()+nrow_up; - - switch (ver) { - case 1: - cerr<<"Making clusters...\n"; - TPC->Hits2Clusters(); - break; - case 2: - cerr<<"Looking for clusters...\n"; - TPC->Digits2Clusters(); - break; - default: - cerr<<"Invalid TPC version !\n"; - return; - } - - TClonesArray *clusters=TPC->Clusters(); - Int_t n=clusters->GetEntriesFast(); - cerr<<"Number of clusters "<Clusters2Tracks(); - timer.Stop(); timer.Print(); - Int_t nt=0; - TClonesArray *tracks=TPC->Tracks(); - if (tracks) nt=tracks->GetEntriesFast(); - cerr<<"Number of found tracks "<IsOpen()) {cerr<<"Can't open AliTPCtracks.root !\n"; return 3;} + TObjArray tarray(2000); + TTree *tracktree=(TTree*)tf->Get("TreeT"); + TBranch *tbranch=tracktree->GetBranch("tracks"); + Int_t nentr=tracktree->GetEntries(); + for (i=0; iSetAddress(&iotrack); + tracktree->GetEvent(i); + iotrack->CookLabel(ca); + tarray.AddLast(iotrack); + } + tf->Close(); + + delete ca; + cf->Close(); ///////////////////////////////////////////////////////////////////////// GoodTrack gt[7000]; @@ -130,12 +102,12 @@ void AliTPCTestTracking() { AliTPCtrack *track; Int_t i; - for (i=0; iUncheckedAt(i); - tlab=track->GetLabel(nrows); + for (i=0; iUncheckedAt(i); + tlab=track->GetLabel(); if (lab==TMath::Abs(tlab)) break; } - if (i==nt) { + if (i==nentr) { cerr<<"Track "<Fill((1/pt - 1/ptg)/(1/ptg)*100.); } + Float_t mom=track->GetP(); - Float_t dedx=track->GetdEdX(0.05,0.70); + Float_t dedx=track->GetdEdx(); hep->Fill(mom,dedx,1.); if (TMath::Abs(gt[ngood].code)==211) if (mom>0.4 && mom<0.5) { he->Fill(dedx,1.); } + } Stat_t ng=hgood->GetEntries(); cerr<<"Good tracks "<SetXTitle("p (Gev/c)"); hep->SetYTitle("dE/dX (Arb. Units)"); hep->Draw(); c1->cd(); + return 0; } Int_t good_tracks(GoodTrack *gt, Int_t max) { - const char *tname="TreeD_75x40_100x60"; - Int_t nt=0; - AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC"); - Int_t ver=TPC->IsVersion(); - AliTPCParam *digp= (AliTPCParam*)TPC->GetParam(); + TFile *file=TFile::Open("rfio:galice.root"); + if (!file->IsOpen()) {cerr<<"Can't open galice.root !\n"; exit(4);} + + if (!(gAlice=(AliRun*)file->Get("gAlice"))) { + cerr<<"gAlice have not been found on galice.root !\n"; + exit(5); + } + + gAlice->GetEvent(0); - Int_t nrow_up=TPC->GetParam()->GetNRowUp(); - Int_t nrows=TPC->GetParam()->GetNRowLow()+nrow_up; - Int_t zero=TPC->GetParam()->GetZeroSup(); + AliTPC *TPC=(AliTPC*)gAlice->GetDetector("TPC"); + Int_t ver = TPC->IsVersion(); + cerr<<"TPC version "<Get("75x40_100x60"); + if (!digp) { cerr<<"TPC parameters have not been found !\n"; exit(6); } + TPC->SetParam(digp); + + Int_t nrow_up=digp->GetNRowUp(); + Int_t nrows=digp->GetNRowLow()+nrow_up; + Int_t zero=digp->GetZeroSup(); Int_t gap=Int_t(0.125*nrows); Int_t good_number=Int_t(0.4*nrows); - //gAlice->GetEvent(0); TClonesArray *particles=gAlice->Particles(); Int_t np=particles->GetEntriesFast(); Int_t *good=new Int_t[np]; @@ -263,24 +249,38 @@ Int_t good_tracks(GoodTrack *gt, Int_t max) { switch (ver) { case 1: - TClonesArray *clusters=TPC->Clusters(); - Int_t n=0; - if (clusters) n=clusters->GetEntriesFast(); - for (Int_t i=0; iUncheckedAt(i); - Int_t lab=c->fTracks[0]; - if (lab<0) continue; //noise cluster - lab=TMath::Abs(lab); - Int_t sec=c->fSector, row=c->fPadRow; - if (sec>=digp->GetNInnerSector()) - if (row==nrow_up-1 ) good[lab]|=0x1000; - if (sec>=digp->GetNInnerSector()) - if (row==nrow_up-1-gap) good[lab]|=0x800; - good[lab]++; + { + TFile *cf=TFile::Open("AliTPCclusters.root"); + if (!cf->IsOpen()){cerr<<"Can't open AliTPCclusters.root !\n";exit(5);} + AliTPCClustersArray *ca=new AliTPCClustersArray; + ca->Setup(digp); + ca->SetClusterType("AliTPCcluster"); + ca->ConnectTree("Segment Tree"); + Int_t nrows=Int_t(ca->GetTree()->GetEntries()); + for (Int_t n=0; nLoadEntry(n); + Int_t sec,row; + digp->AdjustSectorRow(s->GetID(),sec,row); + AliTPCClustersRow &clrow = *ca->GetRow(sec,row); + Int_t ncl=clrow.GetArray()->GetEntriesFast(); + while (ncl--) { + AliTPCcluster *c=(AliTPCcluster*)clrow[ncl]; + Int_t lab=c->fTracks[0]; + if (lab<0) continue; //noise cluster + lab=TMath::Abs(lab); + if (sec>=digp->GetNInnerSector()) + if (row==nrow_up-1 ) good[lab]|=0x1000; + if (sec>=digp->GetNInnerSector()) + if (row==nrow_up-1-gap) good[lab]|=0x800; + good[lab]++; + } + ca->ClearRow(sec,row); } + cf->Close(); + } break; case 2: - TTree *TD=(TTree*)gDirectory->Get(tname); + TTree *TD=(TTree*)gDirectory->Get("TreeD_75x40_100x60"); AliSimDigits da, *digits=&da; TD->GetBranch("Segment")->SetAddress(&digits); Int_t *count = new Int_t[np]; @@ -318,7 +318,8 @@ Int_t good_tracks(GoodTrack *gt, Int_t max) { break; default: cerr<<"Invalid TPC version !\n"; - return; + file->Close(); + exit(7); } TTree *TH=gAlice->TreeH(); @@ -360,6 +361,12 @@ Int_t good_tracks(GoodTrack *gt, Int_t max) { if (nt==max) {cerr<<"Too many good tracks !\n"; break;} } delete[] good; + + delete gAlice; gAlice=0; + + file->Close(); return nt; } + + diff --git a/TPC/AliTPCDisplayClusters.C b/TPC/AliTPCDisplayClusters.C new file mode 100644 index 00000000000..515a661fc4b --- /dev/null +++ b/TPC/AliTPCDisplayClusters.C @@ -0,0 +1,54 @@ +Int_t AliTPCDisplayClusters() { + cerr<<"Displaying clusters...\n"; + + TFile *file=TFile::Open("galice.root"); + if (!file->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 1;} + + TFile *cf=TFile::Open("AliTPCclusters.root"); + if (!cf->IsOpen()){cerr<<"Can't open AliTPCclusters.root !\n"; return 3;} + + AliTPCParam *dig=(AliTPCParam *)cf->Get("75x40_100x60"); + if (!dig) {cerr<<"TPC parameters have not been found !\n"; return 2;} + + TCanvas *c1=new TCanvas("cdisplay", "Cluster display",0,0,700,730); + TView *v=new TView(1); + v->SetRange(-430,-560,-430,430,560,1710); + c1->Clear(); + c1->SetFillColor(1); + c1->SetTheta(90.); + c1->SetPhi(0.); + + AliTPCClustersArray *ca=new AliTPCClustersArray; + ca->Setup(dig); + ca->SetClusterType("AliTPCcluster"); + ca->ConnectTree("Segment Tree"); + Int_t nrows=Int_t(ca->GetTree()->GetEntries()); + for (Int_t n=0; nLoadEntry(n); + Int_t sec,row; + dig->AdjustSectorRow(s->GetID(),sec,row); + AliTPCClustersRow &clrow = *ca->GetRow(sec,row); + Int_t ncl=clrow.GetArray()->GetEntriesFast(); + TPolyMarker3D *pm=new TPolyMarker3D(ncl); + while (ncl--) { + AliTPCcluster *cl=(AliTPCcluster*)clrow[ncl]; + Double_t x=dig->GetPadRowRadii(sec,row), y=cl->GetY(), z=cl->GetZ(); + Float_t cs, sn, tmp; + dig->AdjustCosSin(sec,cs,sn); + tmp = x*cs-y*sn; y= x*sn+y*cs; x=tmp; + pm->SetPoint(ncl,x,y,z); + } + ca->ClearRow(sec,row); + pm->SetMarkerSize(1); pm->SetMarkerColor(2); pm->SetMarkerStyle(1); + pm->Draw(); + } + delete ca; + cf->Close(); + + TGeometry *geom=(TGeometry*)file->Get("AliceGeom"); + geom->Draw("same"); + c1->Modified(); c1->Update(); + + file->Close(); + return 0; +} diff --git a/TPC/AliTPCDigitDisplay.C b/TPC/AliTPCDisplayDigits.C similarity index 66% rename from TPC/AliTPCDigitDisplay.C rename to TPC/AliTPCDisplayDigits.C index a5ea3154dc2..30052cfc266 100644 --- a/TPC/AliTPCDigitDisplay.C +++ b/TPC/AliTPCDisplayDigits.C @@ -1,26 +1,20 @@ -void AliTPCDigitDisplay(int sec, int row, int lab=-1, +Int_t AliTPCDisplayDigits(int sec, int row, int lab=-1, int max_t_chan=500, float min_t=0., float max_t=500., int max_p_chan=150, float min_p=0., float max_p=150.) { -// Dynamically link some shared libs - if (gClassTable->GetID("AliRun") < 0) { - gROOT->LoadMacro("loadlibs.C"); - loadlibs(); - } + cerr<<"Displaying digits...\n"; // Connect the Root Galice file containing Geometry, Kine and Hits - TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root"); - if (f) f->Close(); - //f = new TFile("galice.root"); - f = TFile::Open("rfio:galice.root"); + TFile *f = TFile::Open("galice.root"); + if (!f->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 1;} - AliTPCParam *par=(AliTPCParam *)f.Get("75x40_100x60"); + AliTPCParam *par=(AliTPCParam *)f->Get("75x40_100x60"); char s[80]; sprintf(s,"Sector %d Row %d\n",sec,row); TH2F *h = new TH2F("h",s,max_t_chan,min_t,max_t,max_p_chan,min_p,max_p); - TTree *t=(TTree*)f.Get("TreeD_75x40_100x60"); + TTree *t=(TTree*)f->Get("TreeD_75x40_100x60"); AliSimDigits dummy, *digit=&dummy; t->GetBranch("Segment")->SetAddress(&digit); for (int i=0; iGetEntries(); i++) { @@ -29,7 +23,7 @@ void AliTPCDigitDisplay(int sec, int row, int lab=-1, par->AdjustSectorRow(digit->GetID(),ss,rr); if (ss==sec && rr==row) goto ok; } - return; + return 2; ok: int imax=0, jmax=0, qmax=0; @@ -47,18 +41,23 @@ ok: } h->Fill(i,j,dig); } while (digit->Next()); - if (qmax>0) {cerr<<"Peak (time,pad,q) : "<0){cerr<<"Peak (time,pad,q) : "<SetMaximum(100); gStyle->SetOptStat(0); - TCanvas *c1=new TCanvas("c1","TPC digits display",0,0,1110,680); + TCanvas *c1=new TCanvas("ddisplay","TPC digits display",0,0,1110,680); TPad *p1=new TPad("p1","",0,0,1,0.5); p1->Draw(); TPad *p2=new TPad("p2","",0,0.5,1,1); p2->Draw(); p2->cd(); - h->Draw("lego"); + h->DrawCopy("lego"); p1->cd(); - h->Draw("colz"); + h->DrawCopy("colz"); + + c1->Modified(); c1->Update(); + + f->Close(); + return 0; } diff --git a/TPC/AliTPCFindClusters.C b/TPC/AliTPCFindClusters.C new file mode 100644 index 00000000000..9810b22b2c3 --- /dev/null +++ b/TPC/AliTPCFindClusters.C @@ -0,0 +1,52 @@ +Int_t AliTPCFindClusters() { + TFile *out=TFile::Open("AliTPCclusters.root","new"); + if (!out->IsOpen()) {cerr<<"Delete old AliTPCclusters.root !\n"; return 1;} + TFile *in=TFile::Open("galice.root"); + if (!in->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 2;} + + if (!(gAlice=(AliRun*)in->Get("gAlice"))) { + cerr<<"gAlice have not been found on galice.root !\n"; + return 3; + } + + gAlice->GetEvent(0); + + AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC"); + Int_t ver = TPC->IsVersion(); + cerr<<"TPC version "<Get("75x40_100x60"); + if (!dig) {cerr<<"TPC parameters have not been found !\n"; return 4;} + + TStopwatch timer; + + switch (ver) { + case 1: + cerr<<"Making clusters...\n"; + { + AliTPCv1 &tpc=*((AliTPCv1*)TPC); + tpc.SetParam(dig); timer.Start(); tpc.Hits2Clusters(out); + } + break; + case 2: + cerr<<"Looking for clusters...\n"; + { + delete gAlice; gAlice=0; + AliTPCv2 tpc; + tpc.SetParam(dig); timer.Start(); tpc.Digits2Clusters(out); + } + break; + default: + cerr<<"Invalid TPC version !\n"; + return 5; + } + + timer.Stop(); timer.Print(); + + delete gAlice; gAlice=0; + + out->Close(); + in->Close(); + + return 0; +} diff --git a/TPC/AliTPCFindTracks.C b/TPC/AliTPCFindTracks.C new file mode 100644 index 00000000000..d6953a408ba --- /dev/null +++ b/TPC/AliTPCFindTracks.C @@ -0,0 +1,23 @@ +Int_t AliTPCFindTracks() { + cerr<<"Looking for tracks...\n"; + + TFile *out=TFile::Open("AliTPCtracks.root","new"); + if (!out->IsOpen()) {cerr<<"Delete old AliTPCtracks.root !\n"; return 1;} + + TFile *in=TFile::Open("AliTPCclusters.root"); + if (!in->IsOpen()) {cerr<<"Can't open AliTPCclusters.root !\n"; return 2;} + + AliTPCv2 TPC; + AliTPCParam *digp= (AliTPCParam*)in->Get("75x40_100x60"); + if (!digp) {cerr<<"TPC parameters have not been found !\n"; return 3;} + TPC.SetParam(digp); + + TStopwatch timer; + TPC.Clusters2Tracks(out); + timer.Stop(); timer.Print(); + + in->Close(); + out->Close(); + + return 0; +} diff --git a/TPC/AliTPCHits2Digits.C b/TPC/AliTPCHits2Digits.C index e4a424f8863..a9e85b807ae 100644 --- a/TPC/AliTPCHits2Digits.C +++ b/TPC/AliTPCHits2Digits.C @@ -1,34 +1,63 @@ -void TPCHits2Digits() +Int_t AliTPCHits2Digits() { - // Dynamically link some shared libs - if (gClassTable->GetID("AliRun") < 0) { - gROOT->LoadMacro("loadlibs.C"); - loadlibs(); - } - gROOT->LoadMacro("SetTPCParam.C"); - AliTPCParam *par=SetTPCParam(); + // new version by J.Belikov // Connect the Root Galice file containing Geometry, Kine and Hits + const char * inFile = "galice.root"; TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile); - if (file) file->Close(); + if (file) {file->Close(); delete file;} file = new TFile(inFile,"UPDATE"); - // Get AliRun object from file or create it if not on file + if (!file->IsOpen()) { + cerr<<"Can't open "<Get("gAlice"); - if (gAlice) printf("AliRun object found on file\n"); - if (!gAlice) gAlice = new AliRun("gAlice","Alice test program"); + if (!gAlice) { + cerr<<"AliTPCHits2Digits.C : AliRun object not found on file\n"; + return 2; + } gAlice->GetEvent(0); AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC"); - - cerr<<"Hits2Digits\n"; + +//Set response functions + + AliTPCParamSR *param=(AliTPCParamSR*)gDirectory->Get("75x40_100x60"); + AliTPCPRF2D * prfinner = new AliTPCPRF2D; + AliTPCPRF2D * prfouter = new AliTPCPRF2D; + AliTPCRF1D * rf = new AliTPCRF1D(kTRUE); + rf->SetGauss(param->GetZSigma(),param->GetZWidth(),1.); + rf->SetOffset(3*param->GetZSigma()); + rf->Update(); + + TDirectory *savedir=gDirectory; + TFile *f=TFile::Open("$ALICE_ROOT/TPC/AliTPCprf2d.root"); + if (!f->IsOpen()) { + cerr<<"Can't open $ALICE_ROOT/TPC/AliTPCprf2d.root !\n" + return 3; + } + prfinner->Read("prf_07504_Gati_056068_d02"); + prfouter->Read("prf_10006_Gati_047051_d03"); + f->Close(); + savedir->cd(); + + param->SetInnerPRF(prfinner); + param->SetOuterPRF(prfouter); + param->SetTimeRF(rf); + TPC->SetParam(param); + + cerr<<"Digitizing TPC...\n"; + //setup TPCDigitsArray AliTPCDigitsArray *arr = new AliTPCDigitsArray; arr->SetClass("AliSimDigits"); - arr->Setup(par); - TPC->SetParam(par); + arr->Setup(param); + TPC->SetParam(param); arr->MakeTree(); TPC->SetDigitsArray(arr); @@ -44,12 +73,16 @@ void TPCHits2Digits() TPC->Hits2DigitsSector(36+3); TPC->Hits2DigitsSector(36+1+18); TPC->Hits2DigitsSector(36+2+18); - TPC->Hits2DigitsSector(36+3+18); + TPC->Hits2DigitsSector(36+3+18); + //write results + char treeName[100]; - sprintf(treeName,"TreeD_%s",par->GetTitle()); + sprintf(treeName,"TreeD_%s",param->GetTitle()); TPC->GetDigitsArray()->GetTree()->Write(treeName); - par->Write(par->GetTitle()); - file->Close(); + + delete gAlice; gAlice=0; + file->Close(); delete file; + return 0; }; diff --git a/TPC/AliTPCPRF2D.cxx b/TPC/AliTPCPRF2D.cxx index bf0df1ec312..cf4b7803f41 100644 --- a/TPC/AliTPCPRF2D.cxx +++ b/TPC/AliTPCPRF2D.cxx @@ -15,6 +15,18 @@ /* $Log$ +Revision 1.4.4.3 2000/06/26 07:39:42 kowal2 +Changes to obey the coding rules + +Revision 1.4.4.2 2000/06/25 08:38:41 kowal2 +Splitted from AliTPCtracking + +Revision 1.4.4.1 2000/06/14 16:48:24 kowal2 +Parameter setting improved. Removed compiler warnings + +Revision 1.4 2000/04/17 09:37:33 kowal2 +removed obsolete AliTPCDigitsDisplay.C + Revision 1.3.8.2 2000/04/10 08:40:46 kowal2 Small changes by M. Ivanov, improvements of algorithms @@ -45,6 +57,8 @@ Introduction of the Copyright and cvs Log /////////////////////////////////////////////////////////////////////////////// +// + #include "TMath.h" #include "AliTPCPRF2D.h" #include "TF2.h" @@ -61,8 +75,8 @@ Introduction of the Copyright and cvs Log extern TStyle * gStyle; -static const Float_t sqrt12=3.46; -static const Int_t NPRF = 100; +const Float_t AliTPCPRF2D::fgSQRT12=3.46; +const Int_t AliTPCPRF2D::fgNPRF = 100; static Double_t funGauss2D(Double_t *x, Double_t * par) @@ -83,23 +97,23 @@ static Double_t funCosh2D(Double_t *x, Double_t * par) static Double_t funGati2D(Double_t *x, Double_t * par) { //Gati function -needde by the generic function object - Float_t K3=par[1]; - Float_t K3R=TMath::Sqrt(K3); - Float_t K2=(TMath::Pi()/2)*(1-K3R/2.); - Float_t K1=K2*K3R/(4*TMath::ATan(K3R)); + Float_t k3=par[1]; + Float_t k3R=TMath::Sqrt(k3); + Float_t k2=(TMath::Pi()/2)*(1-k3R/2.); + Float_t k1=k2*k3R/(4*TMath::ATan(k3R)); Float_t l=x[0]/par[0]; - Float_t tan2=TMath::TanH(K2*l); + Float_t tan2=TMath::TanH(k2*l); tan2*=tan2; - Float_t res = K1*(1-tan2)/(1+K3*tan2); + Float_t res = k1*(1-tan2)/(1+k3*tan2); //par[4] = is equal to k3Y - K3=par[4]; - K3R=TMath::Sqrt(K3); - K2=(TMath::Pi()/2)*(1-K3R/2.); - K1=K2*K3R/(4*TMath::ATan(K3R)); + k3=par[4]; + k3R=TMath::Sqrt(k3); + k2=(TMath::Pi()/2)*(1-k3R/2.); + k1=k2*k3R/(4*TMath::ATan(k3R)); l=x[1]/par[0]; - tan2=TMath::TanH(K2*l); + tan2=TMath::TanH(k2*l); tan2*=tan2; - res = res*K1*(1-tan2)/(1+K3*tan2); + res = res*k1*(1-tan2)/(1+k3*tan2); return res; } @@ -112,7 +126,7 @@ AliTPCPRF2D::AliTPCPRF2D() { //default constructor for response function object ffcharge = 0; - fNPRF =NPRF ; + fNPRF = fgNPRF ; fSigmaX = 0; fSigmaY = 0; @@ -130,8 +144,31 @@ AliTPCPRF2D::AliTPCPRF2D() SetY(-0.2,0.2,2); } +AliTPCPRF2D::AliTPCPRF2D(const AliTPCPRF2D &prf) +{ + // + memcpy(this, &prf, sizeof(prf)); + ffcharge = new Float_t[fNPRF*fNYdiv]; + memcpy(ffcharge,prf.ffcharge, fNPRF*fNYdiv); + fGRF = new TF2(*(prf.fGRF)); +} + +AliTPCPRF2D & AliTPCPRF2D::operator = (const AliTPCPRF2D &prf) +{ + // + if (ffcharge) delete ffcharge; + if (fGRF) delete fGRF; + memcpy(this, &prf, sizeof(prf)); + ffcharge = new Float_t[fNPRF*fNYdiv]; + memcpy(ffcharge,prf.ffcharge, fNPRF*fNYdiv); + fGRF = new TF2(*(prf.fGRF)); + return (*this); +} + + AliTPCPRF2D::~AliTPCPRF2D() { + // if (ffcharge!=0) delete [] ffcharge; if (fGRF !=0 ) fGRF->Delete(); } @@ -211,13 +248,13 @@ Float_t AliTPCPRF2D::GetPRF(Float_t xin, Float_t yin, Bool_t inter) fcharge =&(ffcharge[(i+2)*fNPRF]); z3 = GetPRFActiv(xin); } - Float_t a,b,c,d,K,L; + Float_t a,b,c,d,k,l; a=z1; b=(z2-z0)/2.; - K=z2-a-b; - L=(z3-z1)/2.-b; - d=L-2*K; - c=K-d; + k=z2-a-b; + l=(z3-z1)/2.-b; + d=l-2*k; + c=k-d; Float_t dy=y-Float_t(i); Float_t res = a+b*dy+c*dy*dy+d*dy*dy*dy; return res; @@ -234,13 +271,13 @@ Float_t AliTPCPRF2D::GetPRFActiv(Float_t xin) Int_t i = Int_t(x); if ( (i>0) && ((i+2)Delete(); fGRF = GRF; fkNorm = kNorm; - if (sigmaX ==0) sigmaX=(fWidth+fK*fHeightS)/sqrt12; - if (sigmaY ==0) sigmaY=(fWidth+fK*fHeightS)/sqrt12; + if (sigmaX ==0) sigmaX=(fWidth+fK*fHeightS)/fgSQRT12; + if (sigmaY ==0) sigmaY=(fWidth+fK*fHeightS)/fgSQRT12; fOrigSigmaX=sigmaX; fOrigSigmaY=sigmaY; fDStep = TMath::Sqrt(sigmaX*sigmaX+fWidth*fWidth/6.)/10.; @@ -630,7 +667,7 @@ void AliTPCPRF2D::DrawX(Float_t x1 ,Float_t x2,Float_t y, Bool_t inter) { //draw pad response function at interval at given y position if (fGRF==0) return ; - const Int_t N=100; + const Int_t kN=100; char s[100]; TCanvas * c1 = new TCanvas("canPRF","Pad response function",700,900); c1->cd(); @@ -642,13 +679,13 @@ void AliTPCPRF2D::DrawX(Float_t x1 ,Float_t x2,Float_t y, Bool_t inter) gStyle->SetOptFit(1); gStyle->SetOptStat(0); sprintf(s,"PRF response function for chevron pad"); - TH1F * hPRFc = new TH1F("hPRFc",s,N+1,x1,x2); + TH1F * hPRFc = new TH1F("hPRFc",s,kN+1,x1,x2); Float_t x=x1; Float_t y1; - for (Float_t i = 0;iFill(x,y1); }; @@ -689,9 +726,11 @@ void AliTPCPRF2D::DrawX(Float_t x1 ,Float_t x2,Float_t y, Bool_t inter) -void AliTPCPRF2D::Draw(Float_t x1 ,Float_t x2,Float_t y1, Float_t y2, +void AliTPCPRF2D::DrawPRF(Float_t x1 ,Float_t x2,Float_t y1, Float_t y2, Bool_t inter, Int_t Nx, Int_t Ny) { + //Draw PRF in range x1,x2,y1,y2 + //with x binning Nx and y bining Ny char s[100]; if (fGRF==0) return ; TCanvas * c1 = new TCanvas("canPRF","Pad response function",700,900); @@ -753,8 +792,12 @@ void AliTPCPRF2D::Draw(Float_t x1 ,Float_t x2,Float_t y1, Float_t y2, void AliTPCPRF2D::DrawDist(Float_t x1 ,Float_t x2,Float_t y1, Float_t y2, Bool_t inter, Int_t Nx, Int_t Ny, Float_t thr) { - const Float_t minth=0.00001; - if (thrminth) + if (sum>kminth) { ddx = (x-(sumx/sum)); } diff --git a/TPC/AliTPCPRF2D.h b/TPC/AliTPCPRF2D.h index 64aec8434c1..3b29b58e25b 100644 --- a/TPC/AliTPCPRF2D.h +++ b/TPC/AliTPCPRF2D.h @@ -22,6 +22,8 @@ class TArrayF; class AliTPCPRF2D : public TObject { public : AliTPCPRF2D(); + AliTPCPRF2D(const AliTPCPRF2D &prf); + AliTPCPRF2D & operator = (const AliTPCPRF2D &prf); ~AliTPCPRF2D(); void Update(); //recalculate tables for charge calculation Float_t GetGRF(Float_t xin, Float_t yin); @@ -33,7 +35,7 @@ public : //fixed y // void DrawY(Float_t y1, Float_t y2,Float_t x); //draw one dimensional response for fixed x - void Draw(Float_t x1, Float_t x2, Float_t y1, Float_t y2, + void DrawPRF(Float_t x1, Float_t x2, Float_t y1, Float_t y2, Bool_t inter=kFALSE, Int_t Nx=20, Int_t Ny=20); //draw two dimensional PRF @@ -116,6 +118,10 @@ private: Float_t fCurrentY; //in reality we calculate PRF only for one fixed y Float_t fDYtoWire; //! used to make PRF calculation faster in GetPRF Float_t fDStepM1; //! used in GetPRFActiv to make calculation faster + + static const Float_t fgSQRT12; //numeric constant + static const Int_t fgNPRF; //default number of division + ClassDef(AliTPCPRF2D,1) }; diff --git a/TPC/AliTPCParam.cxx b/TPC/AliTPCParam.cxx index 4f398d6aeb1..e2fe36669b7 100644 --- a/TPC/AliTPCParam.cxx +++ b/TPC/AliTPCParam.cxx @@ -15,6 +15,22 @@ /* $Log$ +Revision 1.8.4.4 2000/06/26 07:39:42 kowal2 +Changes to obey the coding rules + +Revision 1.8.4.3 2000/06/25 08:38:41 kowal2 +Splitted from AliTPCtracking + +Revision 1.8.4.2 2000/06/14 16:48:24 kowal2 +Parameter setting improved. Removed compiler warnings + +Revision 1.8.4.1 2000/06/09 07:12:21 kowal2 + +Updated defaults + +Revision 1.8 2000/04/17 09:37:33 kowal2 +removed obsolete AliTPCDigitsDisplay.C + Revision 1.7.8.2 2000/04/10 08:44:51 kowal2 New transformations added @@ -48,6 +64,7 @@ Introduction of the Copyright and cvs Log // // /////////////////////////////////////////////////////////////////////// +// #include #include @@ -56,89 +73,9 @@ Introduction of the Copyright and cvs Log #include -ClassImp(AliTPCParam) -const static Int_t kMaxRows=600; -// -//sector default parameters -// -const static Float_t kInnerRadiusLow = 81.6; -const static Float_t kOuterRadiusLow = 144.2; -const static Float_t kInnerRadiusUp = 143.6; -const static Float_t kOuterRadiusUp = 252.1; -const static Float_t kInnerAngle = 20; // 20 degrees -const static Float_t kInnerAngleShift = 10; -const static Float_t kOuterAngle = 20; // 20 degrees -const static Float_t kOuterAngleShift = 10; -const static Float_t kInnerFrameSpace = 1.5; -const static Float_t kOuterFrameSpace = 1.5; -const static Float_t kInnerWireMount = 1.15; -const static Float_t kOuterWireMount = 1.15; -const static Float_t kZLength =250.; -const static Int_t kGeometryType = 0; //straight rows -// -//wires default parameters -// -const static Int_t kNInnerWiresPerPad = 5; -const static Int_t kInnerDummyWire = 2; -const static Float_t kInnerOffWire = 0.5; -const static Int_t kNOuterWiresPerPad = 5; -const static Int_t kOuterDummyWire = 2; -const static Float_t kOuterOffWire = 0.5; -// -//pad default parameters -// -const static Float_t kInnerPadPitchLength = 2.05; -const static Float_t kInnerPadPitchWidth = 0.35; -const static Float_t kInnerPadLength = 2.05; -const static Float_t kInnerPadWidth = 0.35; -const static Float_t kOuterPadPitchLength = 2.05; -const static Float_t kOuterPadPitchWidth = 0.35; -const static Float_t kOuterPadLength = 2.05; -const static Float_t kOuterPadWidth = 0.35; -const static Bool_t kBMWPCReadout = kTRUE; //MWPC readout - another possibility GEM -const static Int_t kNCrossRows = 1; //number of rows to cross-talk - -// -//gas default parameters -// -const static Float_t kDiffT = 2.2e-2; -const static Float_t kDiffL = 2.2e-2; -const static Float_t kGasGain = 2.e4; -const static Float_t kDriftV =2.85e6; -const static Float_t kOmegaTau = 0.145; -const static Float_t kAttCoef = 250.; -const static Float_t kOxyCont = 5.e-6; -// -//electornic default parameters -// -const static Float_t kPadCoupling=0.5; -const static Int_t kZeroSup=5; -const static Float_t kNoise = 1000; -const static Float_t kChipGain = 12; -const static Float_t kChipNorm = 0.4; -const static Float_t kTSample = 2.e-7; -const static Float_t kTFWHM = 1.9e-7; //fwhm of charge distribution -const static Int_t kMaxTBin =512; -const static Int_t kADCSat =1024; -const static Float_t kADCDynRange =2000.; -// -// -// -const static Float_t kBField =0.2; -const static Float_t kNPrimLoss =10.9; -const static Float_t kNTotalLoss =39.9; -// -//transformation coeficients -// -const static Float_t kDegtoRad = 0.01745329251994; -const static Float_t kRadtoDeg = 57.29577951309; -// -//response constants -// -const static Int_t kNResponseMax=100; -const static Float_t kResponseThreshold=0.01; +ClassImp(AliTPCParam) //___________________________________________ @@ -151,6 +88,7 @@ AliTPCParam::AliTPCParam() fResponseBin = 0; fResponseWeight = 0; fRotAngle = 0; + SetTitle("75x40_100x60"); SetDefault(); } @@ -278,6 +216,7 @@ void AliTPCParam::SetSectorAngles(Float_t innerangle, Float_t innershift, Float { // // set opening angles + const static Float_t kDegtoRad = 0.01745329251994; fInnerAngle = innerangle; //opening angle of Inner sector fInnerAngleShift = innershift; //shift of first inner sector center to the 0 fOuterAngle = outerangle; //opening angle of outer sector @@ -348,6 +287,81 @@ void AliTPCParam::SetDefault() // //set default parameters // + const static Int_t kMaxRows=600; + // + //sector default parameters + // + const static Float_t kInnerRadiusLow = 87.35; + const static Float_t kOuterRadiusLow = 131.2; + const static Float_t kInnerRadiusUp = 130.6; + const static Float_t kOuterRadiusUp = 252.2; + const static Float_t kInnerAngle = 20; // 20 degrees + const static Float_t kInnerAngleShift = 10; + const static Float_t kOuterAngle = 20; // 20 degrees + const static Float_t kOuterAngleShift = 10; + const static Float_t kInnerFrameSpace = 1.5; + const static Float_t kOuterFrameSpace = 1.5; + const static Float_t kInnerWireMount = 1.15; + const static Float_t kOuterWireMount = 1.15; + const static Float_t kZLength =250.; + const static Int_t kGeometryType = 0; //straight rows + // + //wires default parameters + // + const static Int_t kNInnerWiresPerPad = 3; + const static Int_t kInnerDummyWire = 2; + const static Float_t kInnerOffWire = 0.5; + const static Int_t kNOuterWiresPerPad = 4; + const static Int_t kOuterDummyWire = 2; + const static Float_t kOuterOffWire = 0.5; + // + //pad default parameters + // + const static Float_t kInnerPadPitchLength = 0.75; + const static Float_t kInnerPadPitchWidth = 0.40; + const static Float_t kInnerPadLength = 0.75; + const static Float_t kInnerPadWidth = 0.40; + const static Float_t kOuterPadPitchLength = 1.0; + const static Float_t kOuterPadPitchWidth = 0.6; + const static Float_t kOuterPadLength = 1.0; + const static Float_t kOuterPadWidth = 0.6; + const static Bool_t kBMWPCReadout = kTRUE; //MWPC readout - another possibility GEM + const static Int_t kNCrossRows = 1; //number of rows to cross-talk + + // + //gas default parameters + // + const static Float_t kDiffT = 2.2e-2; + const static Float_t kDiffL = 2.2e-2; + const static Float_t kGasGain = 2.e4; + const static Float_t kDriftV =2.83e6; + const static Float_t kOmegaTau = 0.145; + const static Float_t kAttCoef = 250.; + const static Float_t kOxyCont = 5.e-6; + // + //electronic default parameters + // + const static Float_t kPadCoupling=0.5; + const static Int_t kZeroSup=2; + const static Float_t kNoise = 1000; + const static Float_t kChipGain = 12; + const static Float_t kChipNorm = 0.4; + const static Float_t kTSample = 2.e-7; + const static Float_t kTFWHM = 1.9e-7; //fwhm of charge distribution + const static Int_t kMaxTBin =445; + const static Int_t kADCSat =1024; + const static Float_t kADCDynRange =2000.; + // + // + // + const static Float_t kBField =0.2; + const static Float_t kNPrimLoss =10.9; + const static Float_t kNTotalLoss =39.9; + // + //response constants + // + const static Int_t kNResponseMax=100; + const static Float_t kResponseThreshold=0.01; fbStatus = kFALSE; // //set sector parameters @@ -428,6 +442,7 @@ Bool_t AliTPCParam::Update() // for example we can change size of pads and according this recalculate number // of pad rows, number of of pads in given row .... // + const Float_t kQel = 1.602e-19; // elementary charge fbStatus = kFALSE; Int_t i,j; //loop variables because HP @@ -466,8 +481,8 @@ Bool_t AliTPCParam::Update() fRotAngle[j+2] =angle; } fZWidth = fTSample*fDriftV; - fTotalNormFac = fPadCoupling*fChipNorm*q_el*1.e15*fChipGain*fADCSat/fADCDynRange; - fNoiseNormFac = q_el*1.e15*fChipGain*fADCSat/fADCDynRange; + fTotalNormFac = fPadCoupling*fChipNorm*kQel*1.e15*fChipGain*fADCSat/fADCDynRange; + fNoiseNormFac = kQel*1.e15*fChipGain*fADCSat/fADCDynRange; //wire section Int_t nwire; Float_t wspace; //available space for wire diff --git a/TPC/AliTPCParam.h b/TPC/AliTPCParam.h index 5979019fa9d..40efe2f480a 100644 --- a/TPC/AliTPCParam.h +++ b/TPC/AliTPCParam.h @@ -1,5 +1,5 @@ -#ifndef TPCParam_H -#define TPCParam_H +#ifndef ALITPCPARAM_H +#define ALITPCPARAM_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ @@ -12,14 +12,6 @@ #include "AliDetectorParam.h" #include "TMath.h" -// the last things from AliTPCSecGeo -const Float_t z_end = 250.; -const Float_t alpha_low=0.34906585; // 20 degrees -const Float_t alpha_up=0.34906585; // 20 degrees -const Float_t q_el = 1.602e-19; // elementary charge -const Float_t adc_sat = 1023; // dynamic range (10 bits) -const Float_t dyn_range = 2000.; // output dynamic range (mV) -// class AliTPCParam : public AliDetectorParam { @@ -38,37 +30,37 @@ public: Int_t Transform0to1(Float_t *xyz, Int_t *index) const; //trasforamtion from global to global - adjust index[0] sector //return value is equal to sector corresponding to global position - inline void Transform1to2(Float_t *xyz, Int_t *index) const; + void Transform1to2(Float_t *xyz, Int_t *index) const; //transformation to rotated coordinata - inline void Transform2to1(Float_t *xyz, Int_t *index) const; + void Transform2to1(Float_t *xyz, Int_t *index) const; //transformation from rotated coordinata to global coordinata - inline void Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const; + void Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const; //transform rotated coordinata of one sector to rotated //coordinata relative to another sector - inline Float_t Transform2to2NearestWire(Float_t *xyz, Int_t *index) const; + Float_t Transform2to2NearestWire(Float_t *xyz, Int_t *index) const; //round x position to nearest wire - inline Int_t Transform2to3(Float_t *xyz, Int_t *index) const; + Int_t Transform2to3(Float_t *xyz, Int_t *index) const; //calulate coresponding index[2] -pad row for straight rows //does not change xyz[] //return pad - row - inline void Transform3to4(Float_t *xyz, Int_t *index) const; + void Transform3to4(Float_t *xyz, Int_t *index) const; //valid only for straight rows straight rows //calculate xyz[0] position relative to given index //return pad - row - inline void Transform4to3(Float_t *xyz, Int_t *index) const; + void Transform4to3(Float_t *xyz, Int_t *index) const; //valid only for straight rows straight rows //transform xyz[0] position relative to given index - inline void Transform2to5( Float_t *xyz, Int_t *index) const; + void Transform2to5( Float_t *xyz, Int_t *index) const; //transform [x,y,z] to [r,rphi,z] - inline void Transform5to2(Float_t *xyz, Int_t *index) const; + void Transform5to2(Float_t *xyz, Int_t *index) const; //transform [r,rphi,z] coordinata to [x,y,z] - inline void Transform4to8(Float_t *xyz, Int_t *index) const; + void Transform4to8(Float_t *xyz, Int_t *index) const; //transform xyz coordinata to 'digit' coordinata - inline void Transform8to4(Float_t *xyz, Int_t *index) const; + void Transform8to4(Float_t *xyz, Int_t *index) const; //transform 'digit' coordinata to xyz coordinata - inline void Transform6to8(Float_t *xyz, Int_t *index) const; + void Transform6to8(Float_t *xyz, Int_t *index) const; //transform dr,f coordinata to 'digit' coordinata - inline void Transform8to6(Float_t *xyz, Int_t *index) const; + void Transform8to6(Float_t *xyz, Int_t *index) const; //transform 'digit' coordinata to dr,f coordinata virtual Int_t Transform2toPadRow(Float_t *xyz, Int_t *index) const{return 0;} @@ -78,7 +70,7 @@ public: //return pad row of point xyz - xyz is given in coordinate system -(given by index) //output system is 3 for straight row and 7 for cylindrical row virtual void XYZtoCRXYZ(Float_t *xyz, - Int_t §or, Int_t &padrow, Int_t option=3){;} + Int_t §or, Int_t &padrow, Int_t option=3) const {;} //transform global position to the position relative to the sector padrow //if option=0 X calculate absolute calculate sector //if option=1 X absolute use input sector @@ -115,9 +107,9 @@ public: Bool_t AdjustSectorRow(Int_t index, Int_t & sector, Int_t &row) const; //return sector and padrow //for given index - inline void AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const; + void AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const; //set cosinus and sinus of rotation angles for sector isec - inline Float_t GetAngle(Int_t isec) const; + Float_t GetAngle(Int_t isec) const; // //set sector parameters // @@ -283,9 +275,9 @@ public: // // get response data // - inline Int_t * GetResBin(Int_t i); + Int_t * GetResBin(Int_t i); //return response bin i - bin given by padrow [0] pad[1] timebin[2] - inline Float_t GetResWeight(Int_t i); + Float_t GetResWeight(Int_t i); //return weight of response bin i protected : @@ -406,35 +398,8 @@ inline Float_t AliTPCParam::GetResWeight(Int_t i) else return 0; } - -///////////////////////////////////////////////////////////////////////////// -// -//--------------------------------------------------------------------- -// ALICE TPC Cluster Parameters -//-------------------------------------------------------------------- -// -// -// Sigma rphi -const Float_t a_rphi=0.41818e-2; -const Float_t b_rphi=0.17460e-4; -const Float_t c_rphi=0.30993e-2; -const Float_t d_rphi=0.41061e-3; -// Sigma z -const Float_t a_z=0.39614e-2; -const Float_t b_z=0.22443e-4; -const Float_t c_z=0.51504e-1; -// Cluster width in rphi -const Float_t ac_rphi=0.18322; -const Float_t bc_rphi=0.59551e-3; -const Float_t cc_rphi=0.60952e-1; -// Cluster width in z -const Float_t ac_z=0.19081; -const Float_t bc_z=0.55938e-3; -const Float_t cc_z=0.30428; - - - -void AliTPCParam::AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const + +inline void AliTPCParam::AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const { // //set cosinus and sinus of rotation angles for sector isec @@ -443,7 +408,7 @@ void AliTPCParam::AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const sin=fRotAngle[isec*4+1]; } -Float_t AliTPCParam::GetAngle(Int_t isec) const +inline Float_t AliTPCParam::GetAngle(Int_t isec) const { // //return rotation angle of given sector diff --git a/TPC/AliTPCParamCR.cxx b/TPC/AliTPCParamCR.cxx index af7ac68cbf2..957397235eb 100644 --- a/TPC/AliTPCParamCR.cxx +++ b/TPC/AliTPCParamCR.cxx @@ -15,6 +15,12 @@ /* $Log$ +Revision 1.2.4.1 2000/06/14 16:48:24 kowal2 +Parameter setting improved. Removed compiler warnings + +Revision 1.2 2000/04/17 09:37:33 kowal2 +removed obsolete AliTPCDigitsDisplay.C + Revision 1.1.4.2 2000/04/10 11:36:13 kowal2 New Detector parameters handling class @@ -38,6 +44,8 @@ New Detector parameters handling class #include #include #include +#include "AliTPCPRF2D.h" +#include "AliTPCRF1D.h" @@ -73,7 +81,7 @@ void AliTPCParamCR::SetDefault() AliTPCParam::SetDefault(); } -Int_t AliTPCParamCR::CalcResponse(Float_t* xyz, Int_t * index) +Int_t AliTPCParamCR::CalcResponse(Float_t* xyz, Int_t * index, Int_t dummy) { // //calculate bin response as function of the input position -x diff --git a/TPC/AliTPCParamCR.h b/TPC/AliTPCParamCR.h index ed4d1e96ca9..7b7ddfb1ba0 100644 --- a/TPC/AliTPCParamCR.h +++ b/TPC/AliTPCParamCR.h @@ -8,15 +8,16 @@ //////////////////////////////////////////////// // Manager class for TPC parameters // //////////////////////////////////////////////// -#include "AliTPCPRF2D.h" -#include "AliTPCRF1D.h" #include "AliTPCParam.h" +class AliTPCRF1D; +class AliTPCPRF2D; + class AliTPCParamCR : public AliTPCParam { public: AliTPCParamCR(); virtual ~AliTPCParamCR(); - Int_t CalcResponse(Float_t* x, Int_t * index); + Int_t CalcResponse(Float_t* x, Int_t * index, Int_t dummy=0); //calculate bin response as function of the input position -x //return number of valid response bin diff --git a/TPC/AliTPCParamSR.cxx b/TPC/AliTPCParamSR.cxx index 92ce8cfbd7e..485132ff395 100644 --- a/TPC/AliTPCParamSR.cxx +++ b/TPC/AliTPCParamSR.cxx @@ -15,6 +15,16 @@ /* $Log$ +Revision 1.2.4.2 2000/06/14 16:48:24 kowal2 +Parameter setting improved. Removed compiler warnings + +Revision 1.2.4.1 2000/06/09 07:55:39 kowal2 + +Updated defaults + +Revision 1.2 2000/04/17 09:37:33 kowal2 +removed obsolete AliTPCDigitsDisplay.C + Revision 1.1.4.2 2000/04/10 11:36:13 kowal2 New Detector parameters handling class @@ -38,13 +48,15 @@ New Detector parameters handling class #include #include #include +#include "AliTPCPRF2D.h" +#include "AliTPCRF1D.h" ClassImp(AliTPCParamSR) const static Int_t kMaxRows=600; const static Float_t kEdgeSectorSpace = 2.5; -const static Float_t kFacSigmaPadRow=2.; +const static Float_t kFacSigmaPadRow=3.; const static Float_t kFacSigmaPad=3.; const static Float_t kFacSigmaTime=3.; diff --git a/TPC/AliTPCParamSR.h b/TPC/AliTPCParamSR.h index f288d9352a7..e7796150431 100644 --- a/TPC/AliTPCParamSR.h +++ b/TPC/AliTPCParamSR.h @@ -8,10 +8,11 @@ //////////////////////////////////////////////// // Manager class for TPC parameters // //////////////////////////////////////////////// -#include "AliTPCPRF2D.h" -#include "AliTPCRF1D.h" #include "AliTPCParam.h" +class AliTPCRF1D; +class AliTPCPRF2D; + class AliTPCParamSR : public AliTPCParam { public: AliTPCParamSR(); @@ -42,9 +43,9 @@ public: AliTPCPRF2D * GetInnerPRF() const {return fInnerPRF;} AliTPCPRF2D * GetOuterPRF() const {return fOuterPRF;} AliTPCRF1D * GetTimeRF() const {return fTimeRF;} - void SetFacSigmaPadRow(Float_t fac) {fFacSigmaPadRow=fac;} - void SetFacSigmaPad(Float_t fac) {fFacSigmaPad=fac;} - void SetFacSigmaTime(Float_t fac) {fFacSigmaTime=fac;} + void SetFacSigmaPadRow(Float_t fac=3.) {fFacSigmaPadRow=fac;} + void SetFacSigmaPad(Float_t fac=3.) {fFacSigmaPad=fac;} + void SetFacSigmaTime(Float_t fac=3.) {fFacSigmaTime=fac;} virtual Float_t GetPrimaryLoss(Float_t *x, Int_t *index, Float_t *angle); virtual Float_t GetTotalLoss(Float_t *x, Int_t *index, Float_t *angle); diff --git a/TPC/AliTPCRF1D.cxx b/TPC/AliTPCRF1D.cxx index c80e6464b13..45a4cfe53b8 100644 --- a/TPC/AliTPCRF1D.cxx +++ b/TPC/AliTPCRF1D.cxx @@ -15,6 +15,18 @@ /* $Log$ +Revision 1.5.4.3 2000/06/26 07:39:42 kowal2 +Changes to obey the coding rules + +Revision 1.5.4.2 2000/06/25 08:38:41 kowal2 +Splitted from AliTPCtracking + +Revision 1.5.4.1 2000/06/14 16:48:24 kowal2 +Parameter setting improved. Removed compiler warnings + +Revision 1.5 2000/04/17 09:37:33 kowal2 +removed obsolete AliTPCDigitsDisplay.C + Revision 1.4.8.2 2000/04/10 08:53:09 kowal2 Updates by M. Ivanov @@ -26,7 +38,7 @@ Introduction of the Copyright and cvs Log */ //----------------------------------------------------------------------------- -// $Header$ +// // // // Origin: Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk @@ -35,6 +47,8 @@ Introduction of the Copyright and cvs Log // //----------------------------------------------------------------------------- +// + #include "TMath.h" #include "AliTPCRF1D.h" #include "TF2.h" @@ -44,7 +58,10 @@ Introduction of the Copyright and cvs Log #include "TStyle.h" #include "TH1.h" -extern TStyle * gStyle; +extern TStyle * gStyle; + +Int_t AliTPCRF1D::fgNRF=100; //default number of interpolation points +Float_t AliTPCRF1D::fgRFDSTEP=0.01; //default step in cm static Double_t funGauss(Double_t *x, Double_t * par) { @@ -61,14 +78,14 @@ static Double_t funCosh(Double_t *x, Double_t * par) static Double_t funGati(Double_t *x, Double_t * par) { //Gati function -needde by the generic function object - Float_t K3=par[1]; - Float_t K3R=TMath::Sqrt(K3); - Float_t K2=(TMath::Pi()/2)*(1-K3R/2.); - Float_t K1=K2*K3R/(4*TMath::ATan(K3R)); + Float_t k3=par[1]; + Float_t k3R=TMath::Sqrt(k3); + Float_t k2=(TMath::Pi()/2)*(1-k3R/2.); + Float_t k1=k2*k3R/(4*TMath::ATan(k3R)); Float_t l=x[0]/par[0]; - Float_t tan2=TMath::TanH(K2*l); + Float_t tan2=TMath::TanH(k2*l); tan2*=tan2; - Float_t res = K1*(1-tan2)/(1+K3*tan2); + Float_t res = k1*(1-tan2)/(1+k3*tan2); return res; } @@ -82,9 +99,11 @@ AliTPCRF1D::AliTPCRF1D(Bool_t direct,Int_t np,Float_t step) { //default constructor for response function object fDirect=direct; - fNRF = np; + if (np!=0)fNRF = np; + else (fNRF=fgNRF); fcharge = new Float_t[fNRF]; - fDSTEPM1=1./step; + if (step>0) fDSTEPM1=1./step; + else fDSTEPM1 = 1./fgRFDSTEP; fSigma = 0; fGRF = 0; fkNorm = 0.5; @@ -93,9 +112,32 @@ AliTPCRF1D::AliTPCRF1D(Bool_t direct,Int_t np,Float_t step) fOffset = 0.; } +AliTPCRF1D::AliTPCRF1D(const AliTPCRF1D &prf) +{ + // + memcpy(this, &prf, sizeof(prf)); + fcharge = new Float_t[fNRF]; + memcpy(fcharge,prf.fcharge, fNRF); + fGRF = new TF1(*(prf.fGRF)); +} + +AliTPCRF1D & AliTPCRF1D::operator = (const AliTPCRF1D &prf) +{ + // + if (fcharge) delete fcharge; + if (fGRF) delete fGRF; + memcpy(this, &prf, sizeof(prf)); + fcharge = new Float_t[fNRF]; + memcpy(fcharge,prf.fcharge, fNRF); + fGRF = new TF1(*(prf.fGRF)); + return (*this); +} + + AliTPCRF1D::~AliTPCRF1D() { + // if (fcharge!=0) delete [] fcharge; if (fGRF !=0 ) fGRF->Delete(); } @@ -196,7 +238,7 @@ void AliTPCRF1D::SetGati(Float_t K3, Float_t padDistance, Float_t padWidth, sprintf(fType,"Gati"); } -void AliTPCRF1D::Draw(Float_t x1,Float_t x2,Int_t N) +void AliTPCRF1D::DrawRF(Float_t x1,Float_t x2,Int_t N) { // //Draw prf in selected region with nuber of diviision = n @@ -284,7 +326,7 @@ void AliTPCRF1D::Update() void AliTPCRF1D::Streamer(TBuffer &R__b) { // Stream an object of class AliTPCRF1D. - + Float_t dummy; if (R__b.IsReading()) { Version_t R__v = R__b.ReadVersion(); if (R__v) { } TObject::Streamer(R__b); @@ -298,7 +340,7 @@ void AliTPCRF1D::Streamer(TBuffer &R__b) R__b >> fType[4]; R__b >> forigsigma; R__b >> fkNorm; - R__b >> fK3X; + R__b >> dummy; //dummuy instead fK3X in previous R__b >> fPadDistance; R__b >> fInteg; R__b >> fOffset; @@ -337,7 +379,7 @@ void AliTPCRF1D::Streamer(TBuffer &R__b) R__b << fType[4]; R__b << forigsigma; R__b << fkNorm; - R__b << fK3X; + R__b << dummy; //dummuy instead fK3X in previouis R__b << fPadDistance; R__b << fInteg; R__b << fOffset; diff --git a/TPC/AliTPCRF1D.h b/TPC/AliTPCRF1D.h index 90744dd0616..4e777a0536e 100644 --- a/TPC/AliTPCRF1D.h +++ b/TPC/AliTPCRF1D.h @@ -1,5 +1,5 @@ -#ifndef AliTPCRF1D_H -#define AliTPCRF1D_H +#ifndef ALITPCRF1D_H +#define ALITPCRF1D_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ @@ -7,14 +7,11 @@ //////////////////////////////////////////////// // Manager class for AliTPCRF1D // -//////////////////////////////////////////////// +//////////////////////////////////////////////// // include files and class forward declarations -//DSTEP in cm -//NPRF in number of interpolation points -const Int_t NRF=100; -const Float_t RFDSTEP=0.01; + #include "TObject.h" #include "TMath.h" @@ -23,7 +20,9 @@ class TF1; class AliTPCRF1D : public TObject { public : - AliTPCRF1D(Bool_t direct=kFALSE,Int_t np=NRF,Float_t step=RFDSTEP ); + AliTPCRF1D(Bool_t direct=kFALSE,Int_t np=0,Float_t step=0 ); + AliTPCRF1D(const AliTPCRF1D &prf); + AliTPCRF1D & operator = (const AliTPCRF1D &prf); ~AliTPCRF1D(); Float_t GetRF(Float_t xin); //return RF in point xin Float_t GetGRF(Float_t xin); //return generic response function in xin @@ -44,7 +43,7 @@ public : //return pad width Float_t GetSigma(){return fSigma;} //return estimated sigma of RF - void Draw(Float_t x1=-3 ,Float_t x2 =3.,Int_t N = 200); + void DrawRF(Float_t x1=-3 ,Float_t x2 =3.,Int_t N = 200); //draw RF it don't delete histograms after drawing /// it's on user !!!! void Update(); @@ -65,15 +64,16 @@ private: //calculated during update Bool_t fDirect; //tell us if we use directly generalfunction - Float_t fK3X; - Float_t fPadDistance; - //charge type - char fType[5]; + + Float_t fPadDistance; //pad to wire distance + char fType[5]; //type of the parametrisation + static Int_t fgNRF;//default number of interpolation points + static Float_t fgRFDSTEP;//default step in cm ClassDef(AliTPCRF1D,2) }; -#endif /* AliTPCRF1D_H */ +#endif /* ALITPCRF1D_H */ diff --git a/TPC/AliTPCTestClustering.C b/TPC/AliTPCTestClustering.C deleted file mode 100644 index 956f8e68f6c..00000000000 --- a/TPC/AliTPCTestClustering.C +++ /dev/null @@ -1,78 +0,0 @@ -void AliTPCTestClustering() { - const char *pname="75x40_100x60"; - const char *tname="TreeD_75x40_100x60"; - -// Dynamically link some shared libs - - if (gClassTable->GetID("AliRun") < 0) { - gROOT->LoadMacro("loadlibs.C"); - loadlibs(); - } else { - delete gAlice; - gAlice=0; - } - -// Connect the Root Galice file containing Geometry, Kine and Hits - TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root"); - if (!file) file = new TFile("galice.root"); - //if (!file) file = TFile::Open("rfio:galice.root"); - -// Get AliRun object from file or create it if not on file - if (!gAlice) { - gAlice = (AliRun*)file->Get("gAlice"); - if (gAlice) printf("AliRun object found on file\n"); - if (!gAlice) gAlice = new AliRun("gAlice","Alice test program"); - } - - gAlice->GetEvent(0); - - AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC"); - int ver=TPC->IsVersion(); - cerr<<"TPC version "<Get(pname); - if (dig!=0) TPC->SetParam(dig); - else cerr<<"Warning: default TPC parameters will be used !\n"; - - switch (ver) { - case 1: - cerr<<"Making clusters...\n"; - TPC->Hits2Clusters(); - break; - case 2: - cerr<<"Looking for clusters...\n"; - TPC->Digits2Clusters(); - break; - default: - cerr<<"Invalid TPC version !\n"; - return; - } - TClonesArray *c=TPC->Clusters(); - int n=c->GetEntriesFast(); - cerr<<"Number of clusters "<UncheckedAt(i); - cl->GetXYZ(x,dig); - Double_t xx=x[0], yy=x[1], zz=x[2]; - pm->SetPoint(i,xx,yy,zz); - } - - c1=new TCanvas("c1", "Cluster display",0,0,700,730); - TView *v=new TView(1); - v->SetRange(-430,-560,-430,430,560,1710); - - c1->Clear(); - c1->SetFillColor(1); - c1->SetTheta(90.); - c1->SetPhi(0.); - - pm->SetMarkerSize(1); - pm->SetMarkerColor(2); - pm->SetMarkerStyle(1); - pm->Draw(); - - gAlice->GetGeometry()->Draw("same"); -} diff --git a/TPC/AliTPCcluster.cxx b/TPC/AliTPCcluster.cxx new file mode 100644 index 00000000000..f75e926c011 --- /dev/null +++ b/TPC/AliTPCcluster.cxx @@ -0,0 +1,55 @@ +/************************************************************************** + * 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. * + **************************************************************************/ + +/* +$Log$ +Revision 1.1.2.2 2000/06/25 08:38:41 kowal2 +Splitted from AliTPCtracking + +*/ + +//----------------------------------------------------------------- +// Implementation of the TPC cluster class +// +// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch +//----------------------------------------------------------------- + +#include "AliTPCcluster.h" + +ClassImp(AliTPCcluster) + +//_____________________________________________________________________________ +AliTPCcluster::AliTPCcluster() { + //default constructor + fTracks[0]=fTracks[1]=fTracks[2]=0; + fY=fZ=fQ=fSigmaY2=fSigmaZ2=0.; +} + +//_____________________________________________________________________________ +AliTPCcluster::AliTPCcluster(Float_t *hits, Int_t *lab) +{ + // + // Creates a simulated cluster for the TPC + // + fTracks[0] = lab[0]; + fTracks[1] = lab[1]; + fTracks[2] = lab[2]; + fY = hits[0]; + fZ = hits[1]; + fQ = hits[2]; + fSigmaY2 = hits[3]; + fSigmaZ2 = hits[4]; +} + diff --git a/TPC/AliTPCcluster.h b/TPC/AliTPCcluster.h new file mode 100644 index 00000000000..68601055f82 --- /dev/null +++ b/TPC/AliTPCcluster.h @@ -0,0 +1,120 @@ +#ifndef ALITPCCLUSTER_H +#define ALITPCCLUSTER_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +//------------------------------------------------------- +// TPC Cluster Class +// +// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch +//------------------------------------------------------- + +#include + +//_____________________________________________________________________________ +class AliTPCcluster : public TObject { +public: + AliTPCcluster(); + AliTPCcluster(Float_t *hits, Int_t *lab); + void Use(); + void SetLabel(Int_t lab, Int_t i); + void SetQ(Float_t q); + void SetY(Float_t y); + void SetZ(Float_t z); + void SetSigmaY2(Float_t sy2); + void SetSigmaZ2(Float_t sz2); + + Int_t IsUsed() const; + Int_t GetLabel(Int_t i) const; + Float_t GetQ() const; + Float_t GetY() const; + Float_t GetZ() const; + Float_t GetSigmaY2() const; + Float_t GetSigmaZ2() const; + +private: + Int_t fTracks[3];//labels of overlapped tracks + Float_t fQ ; //Q of cluster (in ADC counts) + Float_t fY ; //Y of cluster + Float_t fZ ; //Z of cluster + Float_t fSigmaY2; //Sigma Y square of cluster + Float_t fSigmaZ2; //Sigma Z square of cluster + + ClassDef(AliTPCcluster,1) // Time Projection Chamber clusters +}; + +inline void AliTPCcluster::Use() { + //if fQ<0 cluster is already associated with a track + fQ=-fQ; +} + +inline Int_t AliTPCcluster::IsUsed() const { + //is this cluster already associated with any track ? + return (fQ<0) ? 1 : 0; +} + +inline Int_t AliTPCcluster::GetLabel(Int_t i) const { + //return track label + return fTracks[i]; +} + +inline Float_t AliTPCcluster::GetQ() const { + //just to calm down our rule checker + return fQ; +} + +inline Float_t AliTPCcluster::GetY() const { + //just to calm down our rule checker + return fY; +} + +inline Float_t AliTPCcluster::GetZ() const { + //just to calm down our rule checker + return fZ; +} + +inline Float_t AliTPCcluster::GetSigmaY2() const { + //just to calm down our rule checker + return fSigmaY2; +} + +inline Float_t AliTPCcluster::GetSigmaZ2() const { + //just to calm down our rule checker + return fSigmaZ2; +} + +inline void AliTPCcluster::SetLabel(Int_t lab, Int_t i) { + //just to calm down our rule checker + fTracks[i]=lab; +} + +inline void AliTPCcluster::SetQ(Float_t q) { + //just to calm down our rule checker + fQ=q; +} + +inline void AliTPCcluster::SetY(Float_t y) { + //just to calm down our rule checker + fY=y; +} + +inline void AliTPCcluster::SetZ(Float_t z) { + //just to calm down our rule checker + fZ=z; +} + +inline void AliTPCcluster::SetSigmaY2(Float_t sy2) { + //just to calm down our rule checker + fSigmaY2=sy2; +} + +inline void AliTPCcluster::SetSigmaZ2(Float_t sz2) { + //just to calm down our rule checker + fSigmaZ2=sz2; +} + +#endif + + diff --git a/TPC/AliTPCclusterer.cxx b/TPC/AliTPCclusterer.cxx new file mode 100644 index 00000000000..0a7f5345e47 --- /dev/null +++ b/TPC/AliTPCclusterer.cxx @@ -0,0 +1,254 @@ +/************************************************************************** + * 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. * + **************************************************************************/ + +/* +$Log$ +Revision 1.1.2.1 2000/06/25 08:53:55 kowal2 +Splitted from AliTPCtracking + +*/ + +//------------------------------------------------------- +// Implementation of the TPC clusterer +// +// Origin: Jouri Belikov, CERN, Jouri.Belikov@cern.ch +//------------------------------------------------------- + +#include "AliTPCclusterer.h" +#include "AliTPCcluster.h" +#include +#include +#include "AliTPCClustersArray.h" +#include "AliTPCClustersRow.h" +#include "AliDigits.h" +#include "AliSimDigits.h" +#include "AliTPCParam.h" +#include + +void AliTPCclusterer::FindPeaks(Int_t k,Int_t max, +AliBin *b,Int_t *idx,UInt_t *msk,Int_t& n) { + //find local maxima + if (n<31) + if (IsMaximum(k,max,b)) { + idx[n]=k; msk[n]=(2<IsOpen()) { + cerr<<"AliTPC::Digits2Clusters(): output file not open !\n"; + return; + } + + const Int_t kMAXZ=par->GetMaxTBin()+2; + + TTree *t = (TTree *)gDirectory->Get("TreeD_75x40_100x60"); + AliSimDigits digarr, *dummy=&digarr; + t->GetBranch("Segment")->SetAddress(&dummy); + Stat_t nentries = t->GetEntries(); + + of->cd(); + + ((AliTPCParam*)par)->Write(par->GetTitle()); + AliTPCClustersArray carray; + carray.Setup(par); + carray.SetClusterType("AliTPCcluster"); + carray.MakeTree(); + + Int_t nclusters=0; + + for (Int_t n=0; nGetEvent(n); + Int_t sec, row; + if (!par->AdjustSectorRow(digarr.GetID(),sec,row)) { + cerr<<"AliTPC warning: invalid segment ID ! "<GetPadRowRadii(sec,row); + + Int_t npads, sign; + { + const Int_t kNIS=par->GetNInnerSector(), kNOS=par->GetNOuterSector(); + if (sec < kNIS) { + npads = par->GetNPadsLow(row); + sign = (sec < kNIS/2) ? 1 : -1; + } else { + npads = par->GetNPadsUp(row); + sign = ((sec-kNIS) < kNOS/2) ? 1 : -1; + } + } + + const Int_t kMAXBIN=kMAXZ*(npads+2); + AliBin *bins=new AliBin[kMAXBIN]; + for (Int_t ii=0;iiGetZeroSup()) continue; + Int_t j=digarr.CurrentRow()+1, i=digarr.CurrentColumn()+1; + bins[i*kMAXZ+j].SetQ(dig); + bins[i*kMAXZ+j].SetMask(1); + } while (digarr.Next()); + + Int_t ncl=0; + for (Int_t i=0; i30) continue; + + Int_t k,l; + for (k=0; k1 || dj>1) continue; + if (bins[idx[k]].GetQ() > bins[idx[l]].GetQ()) { + msk[l]=msk[k]; + idx[l]*=-1; + } else { + msk[k]=msk[l]; + idx[k]*=-1; + break; + } + } + } + + for (k=0; kGetPadPitchWidth(sec); + c.SetSigmaY2((s2 + 1./12.)*w*w); + if (s2 != 0.) { + c.SetSigmaY2(c.GetSigmaY2()*0.108); + if (secGetNInnerSector()) c.SetSigmaY2(c.GetSigmaY2()*2.07); + } + + s2 = c.GetSigmaZ2()/c.GetQ() - c.GetZ()*c.GetZ(); + w=par->GetZWidth(); + c.SetSigmaZ2((s2 + 1./12.)*w*w); + if (s2 != 0.) { + c.SetSigmaZ2(c.GetSigmaZ2()*0.169); + if (secGetNInnerSector()) c.SetSigmaZ2(c.GetSigmaZ2()*1.77); + } + + c.SetY((c.GetY() - 0.5 - 0.5*npads)*par->GetPadPitchWidth(sec)); + c.SetZ(par->GetZWidth()*(c.GetZ()-1)); + c.SetZ(c.GetZ() - 3.*par->GetZSigma()); // PASA delay + c.SetZ(sign*(par->GetZLength() - c.GetZ())); + + if (rx<230./250.*TMath::Abs(c.GetZ())) continue; + + Int_t ki=idx[k]/kMAXZ, kj=idx[k] - ki*kMAXZ; + c.SetLabel(digarr.GetTrackID(kj-1,ki-1,0),0); + c.SetLabel(digarr.GetTrackID(kj-1,ki-1,1),1); + c.SetLabel(digarr.GetTrackID(kj-1,ki-1,2),2); + + c.SetQ(bins[idx[k]].GetQ()); + + if (ki==1 || ki==npads || kj==1 || kj==kMAXZ-2) { + c.SetSigmaY2(c.GetSigmaY2()*25.); + c.SetSigmaZ2(c.GetSigmaZ2()*4.); + } + clrow->InsertCluster(&c); ncl++; + } + } + carray.StoreRow(sec,row); + carray.ClearRow(sec,row); + + cerr<<"sector, row, compressed digits, clusters: " + <Write(); + savedir->cd(); +} + diff --git a/TPC/AliTPCclusterer.h b/TPC/AliTPCclusterer.h new file mode 100644 index 00000000000..a85475b06aa --- /dev/null +++ b/TPC/AliTPCclusterer.h @@ -0,0 +1,65 @@ +#ifndef ALITPCCLUSTERER_H +#define ALITPCCLUSTERER_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +//------------------------------------------------------- +// TPC clusterer +// +// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch +//------------------------------------------------------- +#include + +#define kMAXCLUSTER 2500 + +class TFile; +class AliTPCParam; +class AliTPCcluster; + +class AliTPCclusterer { +public: + static void Digits2Clusters(const AliTPCParam *par, TFile *of); + +private: + class AliBin { + public: + UShort_t GetQ() const {return fQ;} + UInt_t GetMask() const {return fMask;} + void SetQ(UShort_t q) {fQ=q;} + void SetMask(UInt_t m) {fMask=m;} + private: + UShort_t fQ; //signal + UInt_t fMask; //peak mask + }; + +private: + static Bool_t IsMaximum(Int_t k, Int_t max, const AliBin *bins); + static void FindPeaks(Int_t k,Int_t m,AliBin*b,Int_t*idx,UInt_t*msk,Int_t&n); + static void MarkPeak(Int_t k, Int_t max, AliBin *bins, UInt_t m); + static void MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m, + AliTPCcluster &c); +}; + + +inline Bool_t AliTPCclusterer::IsMaximum(Int_t k,Int_t max,const AliBin *bins){ + //is this a local maximum ? + UShort_t q=bins[k].GetQ(); + if (q==1023) return kFALSE; + if (bins[k-max].GetQ() > q) return kFALSE; + if (bins[k-1 ].GetQ() > q) return kFALSE; + if (bins[k+max].GetQ() > q) return kFALSE; + if (bins[k+1 ].GetQ() > q) return kFALSE; + if (bins[k-max-1].GetQ() > q) return kFALSE; + if (bins[k+max-1].GetQ() > q) return kFALSE; + if (bins[k+max+1].GetQ() > q) return kFALSE; + if (bins[k-max+1].GetQ() > q) return kFALSE; + return kTRUE; +} + +//----------------------------------------------------------------- + +#endif + + diff --git a/TPC/AliTPCtest.C b/TPC/AliTPCtest.C new file mode 100644 index 00000000000..50ca9a2c152 --- /dev/null +++ b/TPC/AliTPCtest.C @@ -0,0 +1,32 @@ +Int_t AliTPCtest() { + Int_t rc=0; + +//Test TPC simulation + gROOT->LoadMacro("$(ALICE_ROOT)/macros/grun.C"); + grun(); + + Int_t ver=gAlice->GetDetector("TPC")->IsVersion(); + delete gAlice; gAlice=0; + if (ver==2) { + gROOT->LoadMacro("$(ALICE_ROOT)/TPC/AliTPCHits2Digits.C"); + if (rc=AliTPCHits2Digits()) return rc; + + gROOT->LoadMacro("$(ALICE_ROOT)/TPC/AliTPCDisplayDigits.C"); + if (rc=AliTPCDisplayDigits(1,1)) return rc; + } + +//Test TPC reconstruction + gROOT->LoadMacro("$(ALICE_ROOT)/TPC/AliTPCFindClusters.C"); + if (rc=AliTPCFindClusters()) return rc; + + gROOT->LoadMacro("$(ALICE_ROOT)/TPC/AliTPCDisplayClusters.C"); + if (rc=AliTPCDisplayClusters()) return rc; + + gROOT->LoadMacro("$(ALICE_ROOT)/TPC/AliTPCFindTracks.C"); + if (rc=AliTPCFindTracks()) return rc; + + gROOT->LoadMacro("$(ALICE_ROOT)/TPC/AliTPCComparison.C"); + if (rc=AliTPCComparison()) return rc; + + return rc; +} diff --git a/TPC/AliTPCtrack.cxx b/TPC/AliTPCtrack.cxx new file mode 100644 index 00000000000..b59e94bef83 --- /dev/null +++ b/TPC/AliTPCtrack.cxx @@ -0,0 +1,476 @@ +/************************************************************************** + * 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. * + **************************************************************************/ + +/* +$Log$ +Revision 1.1.2.2 2000/06/25 08:38:41 kowal2 +Splitted from AliTPCtracking + +*/ + +//----------------------------------------------------------------- +// Implementation of the TPC track class +// +// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch +//----------------------------------------------------------------- + +#include "AliTPCtrack.h" +#include "AliTPCcluster.h" +#include "AliTPCClustersRow.h" +#include "AliTPCClustersArray.h" + +ClassImp(AliTPCtrack) +//_________________________________________________________________________ +AliTPCtrack::AliTPCtrack(UInt_t index, const Double_t xx[5], +const Double_t cc[15], Double_t xref, Double_t alpha) { + //----------------------------------------------------------------- + // This is the main track constructor. + //----------------------------------------------------------------- + fLab=-1; + fChi2=0.; + fdEdx=0.; + + fAlpha=alpha; + fX=xref; + + fY=xx[0]; fZ=xx[1]; fC=xx[2]; fE=xx[3]; fT=xx[4]; + + fCyy=cc[0]; + fCzy=cc[1]; fCzz=cc[2]; + fCcy=cc[3]; fCcz=cc[4]; fCcc=cc[5]; + fCey=cc[6]; fCez=cc[7]; fCec=cc[8]; fCee=cc[9]; + fCty=cc[10]; fCtz=cc[11]; fCtc=cc[12]; fCte=cc[13]; fCtt=cc[14]; + + fN=0; + fIndex[fN++]=index; +} + +//_____________________________________________________________________________ +AliTPCtrack::AliTPCtrack(const AliTPCtrack& t) { + //----------------------------------------------------------------- + // This is a track copy constructor. + //----------------------------------------------------------------- + fLab=t.fLab; + fChi2=t.fChi2; + fdEdx=t.fdEdx; + + fAlpha=t.fAlpha; + fX=t.fX; + + fY=t.fY; fZ=t.fZ; fC=t.fC; fE=t.fE; fT=t.fT; + + fCyy=t.fCyy; + fCzy=t.fCzy; fCzz=t.fCzz; + fCcy=t.fCcy; fCcz=t.fCcz; fCcc=t.fCcc; + fCey=t.fCey; fCez=t.fCez; fCec=t.fCec; fCee=t.fCee; + fCty=t.fCty; fCtz=t.fCtz; fCtc=t.fCtc; fCte=t.fCte; fCtt=t.fCtt; + + fN=t.fN; + for (Int_t i=0; iGetSigmaY2(); + //Double_t c =GetSigmaY2(); + Double_t co=TMath::Abs(t->GetC()); + Double_t c =TMath::Abs(GetC()); + if (c>co) return 1; + else if (c= 0.99999) { + if (fN>4) cerr<GetSigmaY2(), r01=0., r11=c->GetSigmaZ2(); + r00+=fCyy; r01+=fCzy; r11+=fCzz; + Double_t det=r00*r11 - r01*r01; + Double_t tmp=r00; r00=r11/det; r11=tmp/det; r01=-r01/det; + + Double_t k00=fCyy*r00+fCzy*r01, k01=fCyy*r01+fCzy*r11; + Double_t k10=fCzy*r00+fCzz*r01, k11=fCzy*r01+fCzz*r11; + Double_t k20=fCcy*r00+fCcz*r01, k21=fCcy*r01+fCcz*r11; + Double_t k30=fCey*r00+fCez*r01, k31=fCey*r01+fCez*r11; + Double_t k40=fCty*r00+fCtz*r01, k41=fCty*r01+fCtz*r11; + + Double_t dy=c->GetY() - fY, dz=c->GetZ() - fZ; + Double_t cur=fC + k20*dy + k21*dz, eta=fE + k30*dy + k31*dz; + if (TMath::Abs(cur*fX-eta) >= 0.99999) { + if (fN>4) cerr<= 0.99999) { + if (fN>4) cerr<= 0.) { + if (fN>4) cerr<GetSigmaY2(), r01=0., r11=c->GetSigmaZ2(); + r00+=fCyy; r01+=fCzy; r11+=fCzz; + + Double_t det=r00*r11 - r01*r01; + if (TMath::Abs(det) < 1.e-10) { + if (fN>4) cerr<GetY() - fY, dz=c->GetZ() - fZ; + + return (dy*r00*dy + 2*r01*dy*dz + dz*r11*dz)/det; +} + +//_____________________________________________________________________________ +void AliTPCtrack::GetPxPyPz(Double_t& px, Double_t& py, Double_t& pz) const +{ + //----------------------------------------------------------------- + // This function returns reconstructed track momentum in the global system. + //----------------------------------------------------------------- + Double_t pt=TMath::Abs(GetPt()); // GeV/c + Double_t r=fC*fX-fE; + Double_t y0=fY + sqrt(1.- r*r)/fC; + px=-pt*(fY-y0)*fC; //cos(phi); + py=-pt*(fE-fX*fC); //sin(phi); + pz=pt*fT; + Double_t tmp=px*TMath::Cos(fAlpha) - py*TMath::Sin(fAlpha); + py=px*TMath::Sin(fAlpha) + py*TMath::Cos(fAlpha); + px=tmp; +} + +//_____________________________________________________________________________ +void AliTPCtrack::CookLabel(AliTPCClustersArray *ca) { + //----------------------------------------------------------------- + // This function cooks the track label. If label<0, this track is fake. + //----------------------------------------------------------------- + Int_t *lb=new Int_t[fN]; + Int_t *mx=new Int_t[fN]; + AliTPCcluster **clusters=new AliTPCcluster*[fN]; + + Int_t i; + Int_t sec,row,ncl; + for (i=0; iGetRow(sec,row); + clusters[i]=(AliTPCcluster*)(*clrow)[ncl]; + } + + Int_t lab=123456789; + for (i=0; iGetLabel(0)); + Int_t j; + for (j=0; jmax) {max=mx[i]; lab=lb[i];} + + for (i=0; iGetLabel(1)) == lab || + TMath::Abs(c->GetLabel(2)) == lab ) max++; + } + + SetLabel(-lab); + if (1.-Float_t(max)/fN <= 0.10) { + //Int_t tail=Int_t(0.08*fN); + Int_t tail=14; + max=0; + for (i=1; i<=tail; i++) { + AliTPCcluster *c=clusters[fN-i]; + if (lab == TMath::Abs(c->GetLabel(0)) || + lab == TMath::Abs(c->GetLabel(1)) || + lab == TMath::Abs(c->GetLabel(2))) max++; + } + if (max >= Int_t(0.5*tail)) SetLabel(lab); + } + + delete[] lb; + delete[] mx; + delete[] clusters; +} + +//____________________________________________________________________________ +void AliTPCtrack::Streamer(TBuffer &R__b) +{ + //----------------------------------------------------- + // This is AliTPCtrack streamer. + //----------------------------------------------------- + if (R__b.IsReading()) { + Version_t R__v = R__b.ReadVersion(); if (R__v) { } + TObject::Streamer(R__b); + R__b >> fLab; + R__b >> fChi2; + R__b >> fdEdx; + R__b >> fAlpha; + R__b >> fX; + R__b >> fY; + R__b >> fZ; + R__b >> fC; + R__b >> fE; + R__b >> fT; + R__b >> fCyy; + R__b >> fCzy; + R__b >> fCzz; + R__b >> fCcy; + R__b >> fCcz; + R__b >> fCcc; + R__b >> fCey; + R__b >> fCez; + R__b >> fCec; + R__b >> fCee; + R__b >> fCty; + R__b >> fCtz; + R__b >> fCtc; + R__b >> fCte; + R__b >> fCtt; + R__b >> fN; + for (Int_t i=0; i> fIndex[i]; + } else { + R__b.WriteVersion(AliTPCtrack::IsA()); + TObject::Streamer(R__b); + R__b << fLab; + R__b << fChi2; + R__b << fdEdx; + R__b << fAlpha; + R__b << fX; + R__b << fY; + R__b << fZ; + R__b << fC; + R__b << fE; + R__b << fT; + R__b << fCyy; + R__b << fCzy; + R__b << fCzz; + R__b << fCcy; + R__b << fCcz; + R__b << fCcc; + R__b << fCey; + R__b << fCez; + R__b << fCec; + R__b << fCee; + R__b << fCty; + R__b << fCtz; + R__b << fCtc; + R__b << fCte; + R__b << fCtt; + R__b << fN; + for (Int_t i=0; i +#include +#include + +class AliTPCClustersArray; +class AliTPCcluster; + +//_____________________________________________________________________________ +class AliTPCtrack : public TObject { +public: + AliTPCtrack(); + AliTPCtrack(UInt_t index, const Double_t xx[5], + const Double_t cc[15], Double_t xr, Double_t alpha); + AliTPCtrack(const AliTPCtrack& t); + Int_t Compare(TObject *o); + Int_t PropagateTo(Double_t xr, + Double_t x0=28.94,Double_t rho=0.9e-3,Double_t pm=0.139); + void PropagateToVertex( + Double_t x0=36.66,Double_t rho=1.2e-3,Double_t pm=0.139); + void Update(const AliTPCcluster* c, Double_t chi2, UInt_t i); + Int_t Rotate(Double_t angle); + void CookLabel(AliTPCClustersArray *carray); + void SetLabel(Int_t lab=0); + void SetdEdx(Float_t dedx); + + Double_t GetPredictedChi2(const AliTPCcluster *cluster) const; + Bool_t IsSortable() const; + Int_t GetLabel() const; + void GetPxPyPz(Double_t &px, Double_t &py, Double_t &pz) const; + Float_t GetdEdx() const; + Double_t GetX() const; + Double_t GetY() const; + Double_t GetZ() const; + Double_t GetC() const; + Double_t GetEta() const; + Double_t GetTgl() const; + Double_t GetPt() const; + Double_t GetP() const; + void GetCovariance(Double_t cov[15]) const; + Double_t GetSigmaY2() const; + Double_t GetSigmaZ2() const; + Double_t GetSigmaC2() const; + Double_t GetSigmaTgl2() const; + Double_t GetAlpha() const; + Double_t GetChi2() const; + Int_t GetNumberOfClusters() const; + void GetCluster(Int_t i, Int_t &sec, Int_t &row, Int_t &ncl) const; + +protected: + Short_t fN; // number of clusters +private: + Int_t fLab; // track label + Double_t fChi2; // total chi2 value for this track + Float_t fdEdx; // dE/dx + + Double_t fAlpha; // rotation angle + Double_t fX; // X-coordinate of this track (reference plane) + + Double_t fY; // Y-coordinate of the track + Double_t fZ; // Z-coordinate of the track + Double_t fC; // track curvature + Double_t fE; // C*x0 + Double_t fT; // tangent of the track dip angle + + Double_t fCyy; // covariance + Double_t fCzy, fCzz; // matrix + Double_t fCcy, fCcz, fCcc; // of the + Double_t fCey, fCez, fCec, fCee; // track + Double_t fCty, fCtz, fCtc, fCte, fCtt; // parameters + + UInt_t fIndex[200]; // (((row<<8)+sec)<<16)+index + + ClassDef(AliTPCtrack,1) // Time Projection Chamber reconstructed tracks +}; + +inline AliTPCtrack::AliTPCtrack() { + //default contructor + fN=0; +} + +inline void AliTPCtrack::SetLabel(Int_t lab) { + //just to calm down our rule checker + fLab=lab; +} + +inline void AliTPCtrack::SetdEdx(Float_t dedx) { + //just to calm down our rule checker + fdEdx=dedx; +} + +inline Bool_t AliTPCtrack::IsSortable() const { + //just to calm down our rule checker + return kTRUE; +} + +inline Int_t AliTPCtrack::GetLabel() const { + //just to calm down our rule checker + return fLab; +} + +inline Float_t AliTPCtrack::GetdEdx() const { + //just to calm down our rule checker + return fdEdx; +} + +inline Double_t AliTPCtrack::GetX() const { + //just to calm down our rule checker + return fX; +} + +inline Double_t AliTPCtrack::GetY() const { + //just to calm down our rule checker + return fY; +} + +inline Double_t AliTPCtrack::GetZ() const { + //just to calm down our rule checker + return fZ; +} + +inline Double_t AliTPCtrack::GetC() const { + //just to calm down our rule checker + return fC; +} + +inline Double_t AliTPCtrack::GetEta() const { + //just to calm down our rule checker + return fE; +} + +inline Double_t AliTPCtrack::GetTgl() const { + //just to calm down our rule checker + return fT; +} + +inline Double_t AliTPCtrack::GetPt() const { + //just to calm down our rule checker + return 0.3*0.2/GetC()/100; +} + +inline Double_t AliTPCtrack::GetP() const { + //just to calm down our rule checker + return TMath::Abs(GetPt())*sqrt(1.+GetTgl()*GetTgl()); +} + +inline Double_t AliTPCtrack::GetSigmaY2() const { + //just to calm down our rule checker + return fCyy; +} + +inline Double_t AliTPCtrack::GetSigmaZ2() const { + //just to calm down our rule checker + return fCzz; +} + +inline Double_t AliTPCtrack::GetSigmaC2() const { + //just to calm down our rule checker + return fCcc; +} + +inline Double_t AliTPCtrack::GetSigmaTgl2() const { + //just to calm down our rule checker + return fCtt; +} + +inline Double_t AliTPCtrack::GetAlpha() const { + //just to calm down our rule checker + return fAlpha; +} + +inline Double_t AliTPCtrack::GetChi2() const { + //just to calm down our rule checker + return fChi2; +} + +inline Int_t AliTPCtrack::GetNumberOfClusters() const { + //just to calm down our rule checker + return fN; +} + +inline +void AliTPCtrack::GetCluster(Int_t i,Int_t &sec,Int_t &row,Int_t &ncl) const { + //just to calm down our rule checker + Int_t index=fIndex[i]; + sec=(index&0xff000000)>>24; + row=(index&0x00ff0000)>>16; + ncl=(index&0x0000ffff)>>00; +} + +#endif + + diff --git a/TPC/AliTPCtracker.cxx b/TPC/AliTPCtracker.cxx new file mode 100644 index 00000000000..3577473d871 --- /dev/null +++ b/TPC/AliTPCtracker.cxx @@ -0,0 +1,513 @@ +/************************************************************************** + * 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. * + **************************************************************************/ + +/* +$Log$ +Revision 1.1.2.1 2000/06/25 08:53:55 kowal2 +Splitted from AliTPCtracking + +*/ + +//------------------------------------------------------- +// Implementation of the TPC tracker +// +// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch +//------------------------------------------------------- + +#include "AliTPCtracker.h" +#include "AliTPCcluster.h" +#include +#include +#include "AliTPCClustersArray.h" +#include "AliTPCClustersRow.h" + +const AliTPCParam *AliTPCtracker::AliTPCSector::fgParam; + +//_____________________________________________________________________________ +Double_t SigmaY2(Double_t r, Double_t tgl, Double_t pt) +{ + // + // Parametrised error of the cluster reconstruction (pad direction) + // + // Sigma rphi + const Float_t kArphi=0.41818e-2; + const Float_t kBrphi=0.17460e-4; + const Float_t kCrphi=0.30993e-2; + const Float_t kDrphi=0.41061e-3; + + pt=TMath::Abs(pt)*1000.; + Double_t x=r/pt; + tgl=TMath::Abs(tgl); + Double_t s=kArphi - kBrphi*r*tgl + kCrphi*x*x + kDrphi*x; + if (s<0.4e-3) s=0.4e-3; + s*=1.3; //Iouri Belikov + + return s; +} + +//_____________________________________________________________________________ +Double_t SigmaZ2(Double_t r, Double_t tgl) +{ + // + // Parametrised error of the cluster reconstruction (drift direction) + // + // Sigma z + const Float_t kAz=0.39614e-2; + const Float_t kBz=0.22443e-4; + const Float_t kCz=0.51504e-1; + + + tgl=TMath::Abs(tgl); + Double_t s=kAz - kBz*r*tgl + kCz*tgl*tgl; + if (s<0.4e-3) s=0.4e-3; + s*=1.3; //Iouri Belikov + + return s; +} + +//_____________________________________________________________________________ +inline Double_t f1(Double_t x1,Double_t y1, + Double_t x2,Double_t y2, + Double_t x3,Double_t y3) +{ + //----------------------------------------------------------------- + // Initial approximation of the track curvature + //----------------------------------------------------------------- + Double_t d=(x2-x1)*(y3-y2)-(x3-x2)*(y2-y1); + Double_t a=0.5*((y3-y2)*(y2*y2-y1*y1+x2*x2-x1*x1)- + (y2-y1)*(y3*y3-y2*y2+x3*x3-x2*x2)); + Double_t b=0.5*((x2-x1)*(y3*y3-y2*y2+x3*x3-x2*x2)- + (x3-x2)*(y2*y2-y1*y1+x2*x2-x1*x1)); + + Double_t xr=TMath::Abs(d/(d*x1-a)), yr=d/(d*y1-b); + + return -xr*yr/sqrt(xr*xr+yr*yr); +} + + +//_____________________________________________________________________________ +inline Double_t f2(Double_t x1,Double_t y1, + Double_t x2,Double_t y2, + Double_t x3,Double_t y3) +{ + //----------------------------------------------------------------- + // Initial approximation of the track curvature times center of curvature + //----------------------------------------------------------------- + Double_t d=(x2-x1)*(y3-y2)-(x3-x2)*(y2-y1); + Double_t a=0.5*((y3-y2)*(y2*y2-y1*y1+x2*x2-x1*x1)- + (y2-y1)*(y3*y3-y2*y2+x3*x3-x2*x2)); + Double_t b=0.5*((x2-x1)*(y3*y3-y2*y2+x3*x3-x2*x2)- + (x3-x2)*(y2*y2-y1*y1+x2*x2-x1*x1)); + + Double_t xr=TMath::Abs(d/(d*x1-a)), yr=d/(d*y1-b); + + return -a/(d*y1-b)*xr/sqrt(xr*xr+yr*yr); +} + +//_____________________________________________________________________________ +inline Double_t f3(Double_t x1,Double_t y1, + Double_t x2,Double_t y2, + Double_t z1,Double_t z2) +{ + //----------------------------------------------------------------- + // Initial approximation of the tangent of the track dip angle + //----------------------------------------------------------------- + return (z1 - z2)/sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); +} + +//_____________________________________________________________________________ +Int_t AliTPCtracker::FindProlongation(AliTPCseed& t, const AliTPCSector *sec, +Int_t s, Int_t rf) +{ + //----------------------------------------------------------------- + // This function tries to find a track prolongation. + //----------------------------------------------------------------- + const Int_t kSKIP=(t.GetNumberOfClusters()<10) ? + 10 : Int_t(0.5*sec->GetNRows()); + Int_t tryAgain=kSKIP; + Double_t alpha=sec->GetAlpha(); + Int_t ns=Int_t(2*TMath::Pi()/alpha+0.5); + + for (Int_t nr=sec->GetRowNumber(t.GetX())-1; nr>=rf; nr--) { + Double_t x=sec->GetX(nr), ymax=sec->GetMaxY(nr); + if (!t.PropagateTo(x)) return 0; + + AliTPCcluster *cl=0; + UInt_t index=0; + Double_t maxchi2=12.; + const AliTPCRow &krow=sec[s][nr]; + Double_t sy2=SigmaY2(t.GetX(),t.GetTgl(),t.GetPt()); + Double_t sz2=SigmaZ2(t.GetX(),t.GetTgl()); + Double_t road=4.*sqrt(t.GetSigmaY2() + sy2), y=t.GetY(), z=t.GetZ(); + + if (road>30) { + if (t.GetNumberOfClusters()>4) + cerr<GetY() > y+road) break; + if (c->IsUsed()) continue; + if ((c->GetZ()-z)*(c->GetZ()-z) > 16.*(t.GetSigmaZ2()+sz2)) continue; + Double_t chi2=t.GetPredictedChi2(c); + if (chi2 > maxchi2) continue; + maxchi2=chi2; + cl=c; + index=krow.GetIndex(i); + } + } + if (cl) { + Float_t l=sec->GetPadPitchWidth(); + t.SetSampledEdx(cl->GetQ()/l,t.GetNumberOfClusters()); + t.Update(cl,maxchi2,index); + tryAgain=kSKIP; + } else { + if (tryAgain==0) break; + if (y > ymax) { + s = (s+1) % ns; + if (!t.Rotate(alpha)) return 0; + } else if (y <-ymax) { + s = (s-1+ns) % ns; + if (!t.Rotate(-alpha)) return 0; + } + tryAgain--; + } + } + + return 1; + +} + +//_____________________________________________________________________________ +void +AliTPCtracker::MakeSeeds(TObjArray& seeds,const AliTPCSector *sec, Int_t max, +Int_t i1, Int_t i2) +{ + //----------------------------------------------------------------- + // This function creates track seeds. + //----------------------------------------------------------------- + Double_t x[5], c[15]; + + Double_t alpha=sec->GetAlpha(), shift=sec->GetAlphaShift(); + Double_t cs=cos(alpha), sn=sin(alpha); + + Double_t x1 =sec->GetX(i1); + Double_t xx2=sec->GetX(i2); + + for (Int_t ns=0; nsGetY(), z1=kr1[is]->GetZ(); + for (Int_t js=0; js < nl+nm+nu; js++) { + const AliTPCcluster *kcl; + Double_t x2, y2, z2; + Double_t x3=0.,y3=0.; + + if (jsGetY(); z2=kcl->GetZ(); + x2= xx2*cs+y2*sn; + y2=-xx2*sn+y2*cs; + } else + if (jsGetY(); z2=kcl->GetZ(); + } else { + const AliTPCRow& kr2=sec[(ns+1)%max][i2]; + kcl=kr2[js-nl-nm]; + y2=kcl->GetY(); z2=kcl->GetZ(); + x2=xx2*cs-y2*sn; + y2=xx2*sn+y2*cs; + } + + Double_t zz=z1 - z1/x1*(x1-x2); + if (TMath::Abs(zz-z2)>5.) continue; + + Double_t d=(x2-x1)*(0.-y2)-(0.-x2)*(y2-y1); + if (d==0.) {cerr<<"MakeSeeds warning: Straight seed !\n"; continue;} + + x[0]=y1; + x[1]=z1; + x[2]=f1(x1,y1,x2,y2,x3,y3); + if (TMath::Abs(x[2]) >= 0.0066) continue; + x[3]=f2(x1,y1,x2,y2,x3,y3); + //if (TMath::Abs(x[2]*x1-x[3]) >= 0.99999) continue; + x[4]=f3(x1,y1,x2,y2,z1,z2); + if (TMath::Abs(x[4]) > 1.2) continue; + Double_t a=asin(x[3]); + Double_t zv=z1 - x[4]/x[2]*(a+asin(x[2]*x1-x[3])); + if (TMath::Abs(zv)>10.) continue; + + Double_t sy1=kr1[is]->GetSigmaY2(), sz1=kr1[is]->GetSigmaZ2(); + Double_t sy2=kcl->GetSigmaY2(), sz2=kcl->GetSigmaZ2(); + Double_t sy3=100*0.025, sy=0.1, sz=0.1; + + Double_t f20=(f1(x1,y1+sy,x2,y2,x3,y3)-x[2])/sy; + Double_t f22=(f1(x1,y1,x2,y2+sy,x3,y3)-x[2])/sy; + Double_t f24=(f1(x1,y1,x2,y2,x3,y3+sy)-x[2])/sy; + Double_t f30=(f2(x1,y1+sy,x2,y2,x3,y3)-x[3])/sy; + Double_t f32=(f2(x1,y1,x2,y2+sy,x3,y3)-x[3])/sy; + Double_t f34=(f2(x1,y1,x2,y2,x3,y3+sy)-x[3])/sy; + Double_t f40=(f3(x1,y1+sy,x2,y2,z1,z2)-x[4])/sy; + Double_t f41=(f3(x1,y1,x2,y2,z1+sz,z2)-x[4])/sz; + Double_t f42=(f3(x1,y1,x2,y2+sy,z1,z2)-x[4])/sy; + Double_t f43=(f3(x1,y1,x2,y2,z1,z2+sz)-x[4])/sz; + + c[0]=sy1; + c[1]=0.; c[2]=sz1; + c[3]=f20*sy1; c[4]=0.; c[5]=f20*sy1*f20+f22*sy2*f22+f24*sy3*f24; + c[6]=f30*sy1; c[7]=0.; c[8]=f30*sy1*f20+f32*sy2*f22+f34*sy3*f24; + c[9]=f30*sy1*f30+f32*sy2*f32+f34*sy3*f34; + c[10]=f40*sy1; c[11]=f41*sz1; c[12]=f40*sy1*f20+f42*sy2*f22; + c[13]=f40*sy1*f30+f42*sy2*f32; + c[14]=f40*sy1*f40+f41*sz1*f41+f42*sy2*f42+f43*sz2*f43; + + UInt_t index=kr1.GetIndex(is); + AliTPCseed *track=new AliTPCseed(index, x, c, x1, ns*alpha+shift); + Float_t l=sec->GetPadPitchWidth(); + track->SetSampledEdx(kr1[is]->GetQ()/l,0); + + Int_t rc=FindProlongation(*track,sec,ns,i2); + if (rc<0 || track->GetNumberOfClusters()<(i1-i2)/2) delete track; + else seeds.AddLast(track); + } + } + } +} + +//_____________________________________________________________________________ +void AliTPCtracker::Clusters2Tracks(const AliTPCParam *par, TFile *of) { + //----------------------------------------------------------------- + // This is a track finder. + //----------------------------------------------------------------- + TDirectory *savedir=gDirectory; + + if (!of->IsOpen()) { + cerr<<"AliTPC::Clusters2Tracks(): output file not open !\n"; + return; + } + + AliTPCClustersArray carray; + carray.Setup(par); + carray.SetClusterType("AliTPCcluster"); + carray.ConnectTree("Segment Tree"); + + of->cd(); + TTree tracktree("TreeT","Tree with TPC tracks"); + AliTPCtrack *iotrack=0; + tracktree.Branch("tracks","AliTPCtrack",&iotrack,32000,0); + + AliTPCSector::SetParam(par); + + const Int_t kNIS=par->GetNInnerSector()/2; + AliTPCSSector *ssec=new AliTPCSSector[kNIS]; + Int_t nlow=ssec->GetNRows(); + + const Int_t kNOS=par->GetNOuterSector()/2; + AliTPCLSector *lsec=new AliTPCLSector[kNOS]; + Int_t nup=lsec->GetNRows(); + + //Load outer sectors + UInt_t index; + Int_t i,j; + + j=Int_t(carray.GetTree()->GetEntries()); + for (i=0; iAdjustSectorRow(s->GetID(),sec,row); + if (secGetArray()->GetEntriesFast(); + while (ncl--) { + AliTPCcluster *c=(AliTPCcluster*)(*clrow)[ncl]; + index=(((sec<<8)+row)<<16)+ncl; + lsec[(sec-kNIS*2)%kNOS][row].InsertCluster(c,index); + } + } + + //find track seeds + TObjArray seeds(20000); + Int_t nrows=nlow+nup; + Int_t gap=Int_t(0.125*nrows), shift=Int_t(0.5*gap); + MakeSeeds(seeds, lsec, kNOS, nup-1, nup-1-gap); + MakeSeeds(seeds, lsec, kNOS, nup-1-shift, nup-1-shift-gap); + seeds.Sort(); + + //tracking in outer sectors + Int_t nseed=seeds.GetEntriesFast(); + for (i=0; i 2.*TMath::Pi()) alpha -= 2.*TMath::Pi(); + if (alpha < 0. ) alpha += 2.*TMath::Pi(); + Int_t ns=Int_t(alpha/lsec->GetAlpha())%kNOS; + + if (FindProlongation(t,lsec,ns)) { + t.UseClusters(&carray); + continue; + } + delete seeds.RemoveAt(i); + } + + //unload outer sectors + for (i=0; iGetEntries()); + for (i=0; iAdjustSectorRow(s->GetID(),sec,row); + if (sec>=kNIS*2) continue; + AliTPCClustersRow *clrow=carray.GetRow(sec,row); + Int_t ncl=clrow->GetArray()->GetEntriesFast(); + while (ncl--) { + AliTPCcluster *c=(AliTPCcluster*)(*clrow)[ncl]; + index=(((sec<<8)+row)<<16)+ncl; + ssec[sec%kNIS][row].InsertCluster(c,index); + } + } + + //tracking in inner sectors + Int_t found=0; + for (i=0; iGetAlphaShift(); + if (alpha > 2.*TMath::Pi()) alpha -= 2.*TMath::Pi(); + if (alpha < 0. ) alpha += 2.*TMath::Pi(); + Int_t ns=Int_t(alpha/ssec->GetAlpha())%kNIS; + + alpha=ns*ssec->GetAlpha() + ssec->GetAlphaShift() - t.GetAlpha(); + + if (t.Rotate(alpha)) { + if (FindProlongation(t,ssec,ns)) { + if (t.GetNumberOfClusters() >= Int_t(0.4*nrows)) { + t.CookdEdx(); + //t.CookLabel(&carray); + iotrack=pt; + tracktree.Fill(); + t.UseClusters(&carray,nc); + cerr<cd(); +} + +//_________________________________________________________________________ +void +AliTPCtracker::AliTPCRow::InsertCluster(const AliTPCcluster* c, UInt_t index) { + //----------------------------------------------------------------------- + // Insert a cluster into this pad row in accordence with its y-coordinate + //----------------------------------------------------------------------- + if (fN==kMAXCLUSTER) { + cerr<<"AliTPCRow::InsertCluster(): Too many clusters !\n"; return; + } + if (fN==0) {fIndex[0]=index; fClusters[fN++]=c; return;} + Int_t i=Find(c->GetY()); + memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTPCcluster*)); + memmove(fIndex +i+1 ,fIndex +i,(fN-i)*sizeof(UInt_t)); + fIndex[i]=index; fClusters[i]=c; fN++; +} + +//___________________________________________________________________ +Int_t AliTPCtracker::AliTPCRow::Find(Double_t y) const { + //----------------------------------------------------------------------- + // Return the index of the nearest cluster + //----------------------------------------------------------------------- + if (y <= fClusters[0]->GetY()) return 0; + if (y > fClusters[fN-1]->GetY()) return fN; + Int_t b=0, e=fN-1, m=(b+e)/2; + for (; b fClusters[m]->GetY()) b=m+1; + else e=m; + } + return m; +} + +//_____________________________________________________________________________ +void AliTPCtracker::AliTPCseed::CookdEdx(Double_t low, Double_t up) { + //----------------------------------------------------------------- + // This funtion calculates dE/dX within the "low" and "up" cuts. + //----------------------------------------------------------------- + Int_t i; + + Int_t swap;//stupid sorting + do { + swap=0; + for (i=0; iGetRow(sec,row); + AliTPCcluster *c=(AliTPCcluster*)(*clrow)[ncl]; + c->Use(); + } +} + + diff --git a/TPC/AliTPCtracker.h b/TPC/AliTPCtracker.h new file mode 100644 index 00000000000..e6ff93eeb4a --- /dev/null +++ b/TPC/AliTPCtracker.h @@ -0,0 +1,172 @@ +#ifndef ALITPCTRACKER_H +#define ALITPCTRACKER_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +//------------------------------------------------------- +// TPC tracker +// +// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch +//------------------------------------------------------- + +#include "AliTPCtrack.h" +#include "AliTPCParam.h" + +#define kMAXCLUSTER 2500 + +class TFile; + +class AliTPCtracker { +public: + static void Clusters2Tracks(const AliTPCParam *par, TFile *of); + +//**************** Internal tracker class ********************** + class AliTPCRow { + public: + AliTPCRow() {fN=0;} + void InsertCluster(const AliTPCcluster *c, UInt_t index); + operator int() const {return fN;} + const AliTPCcluster* operator[](Int_t i) const {return fClusters[i];} + UInt_t GetIndex(Int_t i) const {return fIndex[i];} + Int_t Find(Double_t y) const; + + private: + unsigned fN; //number of clusters + const AliTPCcluster *fClusters[kMAXCLUSTER]; //pointers to clusters + UInt_t fIndex[kMAXCLUSTER]; //indeces of clusters + + private: + AliTPCRow(const AliTPCRow& r); //dummy copy constructor + AliTPCRow &operator=(const AliTPCRow& r); //dummy assignment operator + }; + +//**************** Internal tracker class ********************** + class AliTPCSector { + public: + AliTPCSector() { fN=0; fRow = 0; } + virtual ~AliTPCSector() { delete[] fRow; } + static void SetParam(const AliTPCParam *p) { fgParam=p; } + AliTPCRow& operator[](Int_t i) const { return *(fRow+i); } + Int_t GetNRows() const { return fN; } + virtual Double_t GetX(Int_t l) const = 0; + virtual Double_t GetMaxY(Int_t l) const = 0; + virtual Double_t GetAlpha() const = 0; + virtual Double_t GetAlphaShift() const = 0; + virtual Int_t GetRowNumber(Double_t x) const = 0; + virtual Double_t GetPadPitchWidth() const = 0; + + protected: + unsigned fN; //number of pad rows + AliTPCRow *fRow; //array of pad rows + static const AliTPCParam *fgParam; //TPC parameters + + private: + AliTPCSector(const AliTPCSector &s); //dummy copy contructor + AliTPCSector& operator=(const AliTPCSector &s);//dummy assignment operator + }; + +//**************** Internal tracker class ********************** + class AliTPCSSector : public AliTPCSector { + public: + AliTPCSSector(); + Double_t GetX(Int_t l) const { return fgParam->GetPadRowRadiiLow(l); } + Double_t GetMaxY(Int_t l) const { + return GetX(l)*TMath::Tan(0.5*GetAlpha()); + } + Double_t GetAlpha() const {return fgParam->GetInnerAngle();} + Double_t GetAlphaShift() const {return fgParam->GetInnerAngleShift();} + Double_t GetPadPitchWidth() const { + return fgParam->GetInnerPadPitchWidth(); + } + Int_t GetRowNumber(Double_t x) const; + }; + +//**************** Internal tracker class ********************** + class AliTPCLSector : public AliTPCSector { + public: + AliTPCLSector(); + Double_t GetX(Int_t l) const { return fgParam->GetPadRowRadiiUp(l); } + Double_t GetMaxY(Int_t l) const { + return GetX(l)*TMath::Tan(0.5*GetAlpha()); + } + Double_t GetAlpha() const {return fgParam->GetOuterAngle();} + Double_t GetAlphaShift() const {return fgParam->GetOuterAngleShift();} + Double_t GetPadPitchWidth() const { + return fgParam->GetOuterPadPitchWidth(); + } + Int_t GetRowNumber(Double_t x) const; + }; + +//**************** Internal tracker class ********************** + class AliTPCseed : public AliTPCtrack { + public: + AliTPCseed():AliTPCtrack(){} + AliTPCseed(UInt_t index, const Double_t xx[5], + const Double_t cc[15], Double_t xr, Double_t alpha): + AliTPCtrack(index, xx, cc, xr, alpha) {} + void SetSampledEdx(Float_t q, Int_t i) { + Double_t c=GetC(), e=GetEta(), t=GetTgl(), x=GetX(); + q *= TMath::Sqrt((1-(c*x-e)*(c*x-e))/(1+t*t)); + fdEdx[i]=q; + } + void UseClusters(AliTPCClustersArray *ca, Int_t n=0); + void CookdEdx(Double_t low=0.05, Double_t up=0.70); + + private: + Float_t fdEdx[200]; //array of dE/dx samples + }; + +private: + static Int_t + FindProlongation(AliTPCseed& t,const AliTPCSector *sec,Int_t s,Int_t rf=0); + static void + MakeSeeds(TObjArray &sd,const AliTPCSector *s,Int_t max,Int_t i1,Int_t i2); +}; + +inline AliTPCtracker::AliTPCSSector::AliTPCSSector() { + //default constructor + if (!fgParam) { + fprintf(stderr,"AliTPCSSector: parameters are not set !\n"); + return; + } + fN=fgParam->GetNRowLow(); + fRow=new AliTPCRow[fN]; +} + +inline +Int_t AliTPCtracker::AliTPCSSector::GetRowNumber(Double_t x) const { + //return pad row number for this x + Double_t r=fgParam->GetPadRowRadiiLow(fgParam->GetNRowLow()-1); + if (x > r) return fgParam->GetNRowLow(); + r=fgParam->GetPadRowRadiiLow(0); + if (x < r) return -1; + return Int_t((x-r)/fgParam->GetInnerPadPitchLength() + 0.5); +} + +inline AliTPCtracker::AliTPCLSector::AliTPCLSector(){ + //default constructor + if (!fgParam) { + fprintf(stderr,"AliTPCLSector: parameters are not set !\n"); + return; + } + fN=fgParam->GetNRowUp(); + fRow=new AliTPCRow[fN]; +} + +inline +Int_t AliTPCtracker::AliTPCLSector::GetRowNumber(Double_t x) const { + //return pad row number for this x + Double_t r=fgParam->GetPadRowRadiiUp(fgParam->GetNRowUp()-1); + if (x > r) return fgParam->GetNRowUp(); + r=fgParam->GetPadRowRadiiUp(0); + if (x < r) return -1; + return Int_t((x-r)/fgParam->GetOuterPadPitchLength() + 0.5); +} + +//----------------------------------------------------------------- + +#endif + + diff --git a/TPC/AliTPCv0.cxx b/TPC/AliTPCv0.cxx index 3701f183db7..db6c9d448ba 100644 --- a/TPC/AliTPCv0.cxx +++ b/TPC/AliTPCv0.cxx @@ -15,6 +15,23 @@ /* $Log$ +Revision 1.15.2.4 2000/06/26 07:39:42 kowal2 +Changes to obey the coding rules + +Revision 1.15.2.3 2000/06/25 08:38:41 kowal2 +Splitted from AliTPCtracking + +Revision 1.15.2.2 2000/06/16 12:58:13 kowal2 +Changed parameter settings + +Revision 1.15.2.1 2000/06/09 07:15:07 kowal2 + +Defaults loaded automatically (hard-wired) +Optional parameters can be set via macro called in the constructor + +Revision 1.15 2000/05/15 10:00:30 kowal2 +Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova + Revision 1.14 2000/04/17 09:37:33 kowal2 removed obsolete AliTPCDigitsDisplay.C @@ -38,6 +55,7 @@ Revision 1.10 1999/09/29 09:24:34 fca Introduction of the Copyright and cvs Log */ +// /////////////////////////////////////////////////////////////////////////////// // // @@ -63,7 +81,7 @@ Introduction of the Copyright and cvs Log #include "AliMC.h" #include "AliConst.h" -#include "AliTPCParam.h" +#include "AliTPCParamSR.h" #include "AliTPCDigitsArray.h" ClassImp(AliTPCv0) @@ -75,6 +93,11 @@ AliTPCv0::AliTPCv0(const char *name, const char *title) // // Standard creator for TPC version 0 // + + SetGasMixt(2,20,10,-1,0.9,0.1,0.); + + if (fTPCParam) + fTPCParam->Write(fTPCParam->GetTitle()); } //_____________________________________________________________________________ @@ -181,59 +204,59 @@ void AliTPCv0::CreateGeometry() gMC->Gsvolu("TPSG", "TUBE", idtmed[2], dm, 3); - Float_t z_side = dm[2]; // 1/2 of the side gas thickness + Float_t zSide = dm[2]; // 1/2 of the side gas thickness //----------------------------------------------------------- // Readout chambers , 25% of X0, I use Al as the material //----------------------------------------------------------- - Float_t InnerOpenAngle = fTPCParam->GetInnerAngle(); - Float_t OuterOpenAngle = fTPCParam->GetOuterAngle(); + Float_t innerOpenAngle = fTPCParam->GetInnerAngle(); + Float_t outerOpenAngle = fTPCParam->GetOuterAngle(); - Float_t InnerAngleShift = fTPCParam->GetInnerAngleShift(); - Float_t OuterAngleShift = fTPCParam->GetOuterAngleShift(); + Float_t innerAngleShift = fTPCParam->GetInnerAngleShift(); + Float_t outerAngleShift = fTPCParam->GetOuterAngleShift(); Int_t nInnerSector = fTPCParam->GetNInnerSector()/2; Int_t nOuterSector = fTPCParam->GetNOuterSector()/2; - Float_t InSecLowEdge = fTPCParam->GetInnerRadiusLow(); - Float_t InSecUpEdge = fTPCParam->GetInnerRadiusUp(); + Float_t inSecLowEdge = fTPCParam->GetInnerRadiusLow(); + Float_t inSecUpEdge = fTPCParam->GetInnerRadiusUp(); - Float_t OuSecLowEdge = fTPCParam->GetOuterRadiusLow(); - Float_t OuSecUpEdge = fTPCParam->GetOuterRadiusUp(); + Float_t ouSecLowEdge = fTPCParam->GetOuterRadiusLow(); + Float_t ouSecUpEdge = fTPCParam->GetOuterRadiusUp(); - Float_t SecThick = 2.225; // Al + Float_t secThick = 2.225; // Al // S (Inner) sectors - Float_t LowEdge = fTPCParam->GetInnerFrameSpace(); + Float_t lowEdge = fTPCParam->GetInnerFrameSpace(); - dm[0] = InSecLowEdge*TMath::Tan(0.5*InnerOpenAngle)-LowEdge; - dm[1] = InSecUpEdge*TMath::Tan(0.5*InnerOpenAngle)-LowEdge; - dm[2] = SecThick; - dm[3] = 0.5*(InSecUpEdge-InSecLowEdge); + dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-lowEdge; + dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-lowEdge; + dm[2] = secThick; + dm[3] = 0.5*(inSecUpEdge-inSecLowEdge); - Float_t xCenterS = InSecLowEdge+dm[3]; + Float_t xCenterS = inSecLowEdge+dm[3]; gMC->Gsvolu("TRCS", "TRD1", idtmed[0], dm, 4); // L (Outer) sectors - Float_t UpEdge = fTPCParam->GetOuterFrameSpace(); + Float_t upEdge = fTPCParam->GetOuterFrameSpace(); - dm[0] = OuSecLowEdge*TMath::Tan(0.5*OuterOpenAngle)-UpEdge; - dm[1] = OuSecUpEdge*TMath::Tan(0.5*OuterOpenAngle)-UpEdge; - dm[2] = SecThick; - dm[3] = 0.5*(OuSecUpEdge-OuSecLowEdge); + dm[0] = ouSecLowEdge*TMath::Tan(0.5*outerOpenAngle)-upEdge; + dm[1] = ouSecUpEdge*TMath::Tan(0.5*outerOpenAngle)-upEdge; + dm[2] = secThick; + dm[3] = 0.5*(ouSecUpEdge-ouSecLowEdge); - Float_t xCenterL = OuSecLowEdge+dm[3]; + Float_t xCenterL = ouSecLowEdge+dm[3]; gMC->Gsvolu("TRCL", "TRD1", idtmed[0], dm, 4); - Float_t z1 = -z_side + SecThick*0.5; + Float_t z1 = -zSide + secThick*0.5; //------------------------------------------------------------------ // Positioning of the S-sector readout chambers @@ -247,7 +270,7 @@ void AliTPCv0::CreateGeometry() for(ns=0;nsGspos("TPEC",1,"TPSG",0.,0.,z0,0,"ONLY"); @@ -450,7 +473,7 @@ void AliTPCv0::CreateGeometry() gMC->Gsposp("TPWI",2,"TPWC",0.,0.,0.,0,"ONLY",dm,3); - z0 = z_side - 1.9 - 2.; + z0 = zSide - 1.9 - 2.; gMC->Gspos("TPWC",1,"TPSG",0.,0.,z0,0,"ONLY"); @@ -478,7 +501,7 @@ void AliTPCv0::CreateGeometry() for(ns=0;nsGspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY"); gMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[nRotMat], "ONLY"); diff --git a/TPC/AliTPCv0.h b/TPC/AliTPCv0.h index b123d9149b5..842842cf05b 100644 --- a/TPC/AliTPCv0.h +++ b/TPC/AliTPCv0.h @@ -1,5 +1,5 @@ -#ifndef TPCv0_H -#define TPCv0_H +#ifndef ALITPCV0_H +#define ALITPCV0_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ diff --git a/TPC/AliTPCv1.cxx b/TPC/AliTPCv1.cxx index 5bd6aa48b6f..23a4af0c92e 100644 --- a/TPC/AliTPCv1.cxx +++ b/TPC/AliTPCv1.cxx @@ -15,6 +15,23 @@ /* $Log$ +Revision 1.17.2.4 2000/06/26 07:39:42 kowal2 +Changes to obey the coding rules + +Revision 1.17.2.3 2000/06/25 08:38:41 kowal2 +Splitted from AliTPCtracking + +Revision 1.17.2.2 2000/06/16 12:58:13 kowal2 +Changed parameter settings + +Revision 1.17.2.1 2000/06/09 07:15:07 kowal2 + +Defaults loaded automatically (hard-wired) +Optional parameters can be set via macro called in the constructor + +Revision 1.17 2000/05/15 10:00:30 kowal2 +Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova + Revision 1.16 2000/04/17 09:37:33 kowal2 removed obsolete AliTPCDigitsDisplay.C @@ -40,6 +57,7 @@ Introduction of the Copyright and cvs Log */ +// /////////////////////////////////////////////////////////////////////////////// // // // Time Projection Chamber version 1 -- detailed TPC and fast simulation // @@ -67,7 +85,9 @@ Introduction of the Copyright and cvs Log #include "AliConst.h" #include "AliTPCParam.h" +#include "AliTPCParamSR.h" #include "AliTPCDigitsArray.h" +#include ClassImp(AliTPCv1) @@ -78,6 +98,11 @@ AliTPCv1::AliTPCv1(const char *name, const char *title) // Standard constructor for Time Projection Chamber // fIdSens1=fIdSens2=0; + + SetGasMixt(2,20,10,-1,0.9,0.1,0.); + + if (fTPCParam) + fTPCParam->Write(fTPCParam->GetTitle()); } //_____________________________________________________________________________ @@ -185,67 +210,67 @@ void AliTPCv1::CreateGeometry() gMC->Gsvolu("TPSG", "TUBE", idtmed[2], dm, 3); - Float_t z_side = dm[2]; // 1/2 of the side gas thickness + Float_t zSide = dm[2]; // 1/2 of the side gas thickness //----------------------------------------------------------- // Readout chambers , 25% of X0, I use Al as the material //----------------------------------------------------------- - Float_t InnerOpenAngle = fTPCParam->GetInnerAngle(); - Float_t OuterOpenAngle = fTPCParam->GetOuterAngle(); + Float_t innerOpenAngle = fTPCParam->GetInnerAngle(); + Float_t outerOpenAngle = fTPCParam->GetOuterAngle(); - Float_t InnerAngleShift = fTPCParam->GetInnerAngleShift(); - Float_t OuterAngleShift = fTPCParam->GetOuterAngleShift(); + Float_t innerAngleShift = fTPCParam->GetInnerAngleShift(); + Float_t outerAngleShift = fTPCParam->GetOuterAngleShift(); Int_t nInnerSector = fTPCParam->GetNInnerSector()/2; Int_t nOuterSector = fTPCParam->GetNOuterSector()/2; - Float_t InSecLowEdge = fTPCParam->GetInnerRadiusLow(); - Float_t InSecUpEdge = fTPCParam->GetInnerRadiusUp(); + Float_t inSecLowEdge = fTPCParam->GetInnerRadiusLow(); + Float_t inSecUpEdge = fTPCParam->GetInnerRadiusUp(); - Float_t OuSecLowEdge = fTPCParam->GetOuterRadiusLow(); - Float_t OuSecUpEdge = fTPCParam->GetOuterRadiusUp(); + Float_t ouSecLowEdge = fTPCParam->GetOuterRadiusLow(); + Float_t ouSecUpEdge = fTPCParam->GetOuterRadiusUp(); - Float_t SecThick = 2.225; // Al + Float_t secThick = 2.225; // Al // S (Inner) sectors - Float_t LowEdge = fTPCParam->GetInnerFrameSpace(); + Float_t lowEdge = fTPCParam->GetInnerFrameSpace(); - dm[0] = InSecLowEdge*TMath::Tan(0.5*InnerOpenAngle)-LowEdge; - dm[1] = InSecUpEdge*TMath::Tan(0.5*InnerOpenAngle)-LowEdge; - dm[2] = 0.5*SecThick; - dm[3] = 0.5*(InSecUpEdge-InSecLowEdge); + dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-lowEdge; + dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-lowEdge; + dm[2] = 0.5*secThick; + dm[3] = 0.5*(inSecUpEdge-inSecLowEdge); - Float_t xCenterS = InSecLowEdge+dm[3]; + Float_t xCenterS = inSecLowEdge+dm[3]; gMC->Gsvolu("TRCS", "TRD1", idtmed[0], dm, 4); // L (Outer) sectors - Float_t UpEdge = fTPCParam->GetOuterFrameSpace(); + Float_t upEdge = fTPCParam->GetOuterFrameSpace(); - dm[0] = OuSecLowEdge*TMath::Tan(0.5*OuterOpenAngle)-UpEdge; - dm[1] = OuSecUpEdge*TMath::Tan(0.5*OuterOpenAngle)-UpEdge; - dm[2] = 0.5*SecThick; - dm[3] = 0.5*(OuSecUpEdge-OuSecLowEdge); + dm[0] = ouSecLowEdge*TMath::Tan(0.5*outerOpenAngle)-upEdge; + dm[1] = ouSecUpEdge*TMath::Tan(0.5*outerOpenAngle)-upEdge; + dm[2] = 0.5*secThick; + dm[3] = 0.5*(ouSecUpEdge-ouSecLowEdge); - Float_t xCenterL = OuSecLowEdge+dm[3]; + Float_t xCenterL = ouSecLowEdge+dm[3]; gMC->Gsvolu("TRCL", "TRD1", idtmed[0], dm, 4); - Float_t z1 = -z_side + SecThick*0.5; + Float_t z1 = -zSide + secThick*0.5; //------------------------------------------------------------------ // S sectors - "gas sectors" (TRD1) //------------------------------------------------------------------ - dm[0] = InSecLowEdge*TMath::Tan(0.5*InnerOpenAngle)-0.01; - dm[1] = InSecUpEdge*TMath::Tan(0.5*InnerOpenAngle)-0.01; + dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-0.01; + dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-0.01; dm[2] = 0.5*(250. - 0.001); - dm[3] = 0.5*(InSecUpEdge-InSecLowEdge); + dm[3] = 0.5*(inSecUpEdge-inSecLowEdge); gMC->Gsvolu("TSGA", "TRD1", idtmed[3], dm, 4); // nonsensitive @@ -256,13 +281,13 @@ void AliTPCv1::CreateGeometry() Int_t ns; Float_t r1,r2,zz; - Float_t StripThick = 0.01; // 100 microns + Float_t stripThick = 0.01; // 100 microns Float_t dead; gMC->Gsvolu("TSST", "TRD1", idtmed[4], dm, 0); dm[2] = 0.5*(250. - 0.002); - dm[3] = 0.5 * StripThick; + dm[3] = 0.5 * stripThick; // S-sector @@ -272,11 +297,11 @@ void AliTPCv1::CreateGeometry() for (ns = 0; ns < fTPCParam->GetNRowLow(); ns++) { r1 = fTPCParam->GetPadRowRadiiLow(ns); - r2 = r1 + StripThick; - dm[0] = r1 * TMath::Tan(0.5*InnerOpenAngle) - dead; - dm[1] = r2 * TMath::Tan(0.5*InnerOpenAngle) - dead; + r2 = r1 + stripThick; + dm[0] = r1 * TMath::Tan(0.5*innerOpenAngle) - dead; + dm[1] = r2 * TMath::Tan(0.5*innerOpenAngle) - dead; - zz = -InSecLowEdge -0.5*(InSecUpEdge-InSecLowEdge); + zz = -inSecLowEdge -0.5*(inSecUpEdge-inSecLowEdge); zz += r1; zz += dm[3]; @@ -289,27 +314,27 @@ void AliTPCv1::CreateGeometry() // L sectors - "gas sectors" (PGON to avoid overlaps) //----------------------------------------------------------------- - dm[0] = 360.*kDegrad - 0.5*OuterOpenAngle; + dm[0] = 360.*kDegrad - 0.5*outerOpenAngle; dm[0] *= kRaddeg; dm[0] = (Float_t)TMath::Nint(dm[0]); - dm[1] = OuterOpenAngle*kRaddeg; + dm[1] = outerOpenAngle*kRaddeg; dm[1] = (Float_t)TMath::Nint(dm[1]); dm[2] = 1.; dm[3] = 4.; dm[4] = 0.002; - dm[5] = OuSecLowEdge; - dm[6] = 252.*TMath::Cos(0.5*OuterOpenAngle)-0.002; + dm[5] = ouSecLowEdge; + dm[6] = 252.*TMath::Cos(0.5*outerOpenAngle)-0.002; dm[7] = dm[4]+0.2; dm[8] = dm[5]; dm[9] = dm[6]; dm[10] = dm[7]; - dm[11] = OuSecLowEdge; - dm[12] = OuSecUpEdge; + dm[11] = ouSecLowEdge; + dm[12] = ouSecUpEdge; dm[13] = 250.; dm[14] = dm[11]; @@ -327,11 +352,11 @@ void AliTPCv1::CreateGeometry() gMC->Gsvolu("TLST", "PGON", idtmed[4], dm, 0); - dm[0] = 360.*kDegrad - 0.5*OuterOpenAngle; + dm[0] = 360.*kDegrad - 0.5*outerOpenAngle; dm[0] *= kRaddeg; dm[0] = (Float_t)TMath::Nint(dm[0]); - dm[1] = OuterOpenAngle*kRaddeg; + dm[1] = outerOpenAngle*kRaddeg; dm[1] = (Float_t)TMath::Nint(dm[1]); dm[2] = 1.; @@ -341,12 +366,12 @@ void AliTPCv1::CreateGeometry() dead = fTPCParam->GetOuterWireMount(); - Float_t xx = dead/TMath::Tan(0.5*OuterOpenAngle); + Float_t xx = dead/TMath::Tan(0.5*outerOpenAngle); for(ns=0;nsGetNRowUp();ns++){ r1 = fTPCParam->GetPadRowRadiiUp(ns)-xx; - r2 = r1 + StripThick; + r2 = r1 + stripThick; dm[5] = r1; dm[6] = r2; @@ -378,7 +403,7 @@ void AliTPCv1::CreateGeometry() for(ns=0;nsGspos("TPEC",1,"TPSG",0.,0.,z0,0,"ONLY"); @@ -630,7 +655,7 @@ void AliTPCv1::CreateGeometry() gMC->Gsposp("TPWI",2,"TPWC",0.,0.,0.,0,"ONLY",dm,3); - z0 = z_side - 1.9 - 2.; + z0 = zSide - 1.9 - 2.; gMC->Gspos("TPWC",1,"TPSG",0.,0.,z0,0,"ONLY"); @@ -658,7 +683,7 @@ void AliTPCv1::CreateGeometry() for(ns=0;nsGspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY"); gMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[nRotMat], "ONLY"); diff --git a/TPC/AliTPCv1.h b/TPC/AliTPCv1.h index 04001b2061b..547eac1adac 100644 --- a/TPC/AliTPCv1.h +++ b/TPC/AliTPCv1.h @@ -1,5 +1,5 @@ -#ifndef TPCv1_H -#define TPCv1_H +#ifndef ALITPCV1_H +#define ALITPCV1_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ diff --git a/TPC/AliTPCv2.cxx b/TPC/AliTPCv2.cxx index fd6db7c9790..93f716fa280 100644 --- a/TPC/AliTPCv2.cxx +++ b/TPC/AliTPCv2.cxx @@ -15,6 +15,23 @@ /* $Log$ +Revision 1.21.2.4 2000/06/26 07:39:42 kowal2 +Changes to obey the coding rules + +Revision 1.21.2.3 2000/06/25 08:38:41 kowal2 +Splitted from AliTPCtracking + +Revision 1.21.2.2 2000/06/16 12:58:13 kowal2 +Changed parameter settings + +Revision 1.21.2.1 2000/06/09 07:15:07 kowal2 + +Defaults loaded automatically (hard-wired) +Optional parameters can be set via macro called in the constructor + +Revision 1.21 2000/05/15 10:00:30 kowal2 +Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova + Revision 1.20 2000/04/17 09:37:33 kowal2 removed obsolete AliTPCDigitsDisplay.C @@ -44,6 +61,7 @@ Introduction of the Copyright and cvs Log */ +// /////////////////////////////////////////////////////////////////////////////// // // // Time Projection Chamber version 2 -- detailed TPC and slow simulation // @@ -65,6 +83,8 @@ Introduction of the Copyright and cvs Log #include "AliRun.h" #include "AliConst.h" #include "AliPDG.h" +#include "AliTPCParam.h" +#include "AliTPCParamSR.h" ClassImp(AliTPCv2) @@ -78,6 +98,19 @@ AliTPCv2::AliTPCv2(const char *name, const char *title) : fIdSens1=0; fIdSens2=0; SetBufferSize(128000); + + SetGasMixt(2,20,10,-1,0.9,0.1,0.); // Ne-CO2 90-10 + + // Default sectors + + SetSecAL(4); + SetSecAU(4); + SetSecLows(1, 2, 3, 19, 20, 21); + SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1); + SetSens(1); // sensitive strips + + if (fTPCParam) + fTPCParam->Write(fTPCParam->GetTitle()); } //_____________________________________________________________________________ @@ -105,7 +138,7 @@ void AliTPCv2::CreateGeometry() Int_t nRotMat = 0; - Int_t i,ifl1,ifl2; + Int_t i,ifl1,ifl2=0; Int_t nInnerSector = fTPCParam->GetNInnerSector()/2; Int_t nOuterSector = fTPCParam->GetNOuterSector()/2; @@ -232,63 +265,63 @@ void AliTPCv2::CreateGeometry() gMC->Gsvolu("TPSG", "TUBE", idtmed[2], dm, 3); - Float_t z_side = dm[2]; // 1/2 of the side gas thickness + Float_t zSide = dm[2]; // 1/2 of the side gas thickness //------------------------------------------------------------ // Readout chambers , 25% of X0, I use Al as the material //------------------------------------------------------------ - Float_t InnerOpenAngle = fTPCParam->GetInnerAngle(); - Float_t OuterOpenAngle = fTPCParam->GetOuterAngle(); + Float_t innerOpenAngle = fTPCParam->GetInnerAngle(); + Float_t outerOpenAngle = fTPCParam->GetOuterAngle(); - Float_t InnerAngleShift = fTPCParam->GetInnerAngleShift(); - Float_t OuterAngleShift = fTPCParam->GetOuterAngleShift(); + Float_t innerAngleShift = fTPCParam->GetInnerAngleShift(); + Float_t outerAngleShift = fTPCParam->GetOuterAngleShift(); - Float_t InSecLowEdge = fTPCParam->GetInnerRadiusLow(); - Float_t InSecUpEdge = fTPCParam->GetInnerRadiusUp(); + Float_t inSecLowEdge = fTPCParam->GetInnerRadiusLow(); + Float_t inSecUpEdge = fTPCParam->GetInnerRadiusUp(); - Float_t OuSecLowEdge = fTPCParam->GetOuterRadiusLow(); - Float_t OuSecUpEdge = fTPCParam->GetOuterRadiusUp(); + Float_t ouSecLowEdge = fTPCParam->GetOuterRadiusLow(); + Float_t ouSecUpEdge = fTPCParam->GetOuterRadiusUp(); - Float_t SecThick = 2.225; // Al + Float_t secThick = 2.225; // Al - Float_t LowEdge = fTPCParam->GetInnerFrameSpace(); + Float_t lowEdge = fTPCParam->GetInnerFrameSpace(); // S (Inner) sectors - dm[0] = InSecLowEdge*TMath::Tan(0.5*InnerOpenAngle)-LowEdge; - dm[1] = InSecUpEdge*TMath::Tan(0.5*InnerOpenAngle)-LowEdge; - dm[2] = 0.5*SecThick; - dm[3] = 0.5*(InSecUpEdge-InSecLowEdge); + dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-lowEdge; + dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-lowEdge; + dm[2] = 0.5*secThick; + dm[3] = 0.5*(inSecUpEdge-inSecLowEdge); - Float_t xCenterS = InSecLowEdge+dm[3]; + Float_t xCenterS = inSecLowEdge+dm[3]; gMC->Gsvolu("TRCS", "TRD1", idtmed[0], dm, 4); // L (Outer) sectors - Float_t UpEdge = fTPCParam->GetOuterFrameSpace(); + Float_t upEdge = fTPCParam->GetOuterFrameSpace(); - dm[0] = OuSecLowEdge*TMath::Tan(0.5*OuterOpenAngle)-UpEdge; - dm[1] = OuSecUpEdge*TMath::Tan(0.5*OuterOpenAngle)-UpEdge; - dm[2] = 0.5*SecThick; - dm[3] = 0.5*(OuSecUpEdge-OuSecLowEdge); + dm[0] = ouSecLowEdge*TMath::Tan(0.5*outerOpenAngle)-upEdge; + dm[1] = ouSecUpEdge*TMath::Tan(0.5*outerOpenAngle)-upEdge; + dm[2] = 0.5*secThick; + dm[3] = 0.5*(ouSecUpEdge-ouSecLowEdge); - Float_t xCenterL = OuSecLowEdge+dm[3]; + Float_t xCenterL = ouSecLowEdge+dm[3]; gMC->Gsvolu("TRCL", "TRD1", idtmed[0], dm, 4); - Float_t z1 = -z_side + SecThick*0.5; + Float_t z1 = -zSide + secThick*0.5; //------------------------------------------------------------------ // S sectors - "gas sectors" (TRD1) //------------------------------------------------------------------ - dm[0] = InSecLowEdge*TMath::Tan(0.5*InnerOpenAngle)-0.01; - dm[1] = InSecUpEdge*TMath::Tan(0.5*InnerOpenAngle)-0.01; + dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-0.01; + dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-0.01; dm[2] = 0.5*(250. - 0.001); - dm[3] = 0.5*(InSecUpEdge-InSecLowEdge); + dm[3] = 0.5*(inSecUpEdge-inSecLowEdge); gMC->Gsvolu("TSGA", "TRD1", idtmed[4], dm, 4); // sensitive @@ -303,13 +336,13 @@ void AliTPCv2::CreateGeometry() Float_t r1,r2,zz; - Float_t StripThick = 0.01; // 100 microns + Float_t stripThick = 0.01; // 100 microns Float_t dead; gMC->Gsvolu("TSST", "TRD1", idtmed[4], dm, 0); dm[2] = 0.5*(250. - 0.002); - dm[3] = 0.5 * StripThick; + dm[3] = 0.5 * stripThick; dead= fTPCParam->GetInnerWireMount(); @@ -317,11 +350,11 @@ void AliTPCv2::CreateGeometry() for (ns = 0; ns < fTPCParam->GetNRowLow(); ns++) { r1 = fTPCParam->GetPadRowRadiiLow(ns); - r2 = r1 + StripThick; - dm[0] = r1 * TMath::Tan(0.5*InnerOpenAngle) - dead; - dm[1] = r2 * TMath::Tan(0.5*InnerOpenAngle) - dead; + r2 = r1 + stripThick; + dm[0] = r1 * TMath::Tan(0.5*innerOpenAngle) - dead; + dm[1] = r2 * TMath::Tan(0.5*innerOpenAngle) - dead; - zz = -InSecLowEdge -0.5*(InSecUpEdge-InSecLowEdge); + zz = -inSecLowEdge -0.5*(inSecUpEdge-inSecLowEdge); zz += r1; zz += dm[3]; @@ -339,27 +372,27 @@ void AliTPCv2::CreateGeometry() // L sectors - "gas sectors" (PGON to avoid overlaps) //----------------------------------------------------------------- - dm[0] = 360.*kDegrad - 0.5*OuterOpenAngle; + dm[0] = 360.*kDegrad - 0.5*outerOpenAngle; dm[0] *= kRaddeg; dm[0] = (Float_t)TMath::Nint(dm[0]); - dm[1] = OuterOpenAngle*kRaddeg; + dm[1] = outerOpenAngle*kRaddeg; dm[1] = (Float_t)TMath::Nint(dm[1]); dm[2] = 1.; dm[3] = 4.; dm[4] = 0.002; - dm[5] = OuSecLowEdge; - dm[6] = 252.*TMath::Cos(0.5*OuterOpenAngle)-0.002; + dm[5] = ouSecLowEdge; + dm[6] = 252.*TMath::Cos(0.5*outerOpenAngle)-0.002; dm[7] = dm[4]+0.2; dm[8] = dm[5]; dm[9] = dm[6]; dm[10] = dm[7]; - dm[11] = OuSecLowEdge; - dm[12] = OuSecUpEdge; + dm[11] = ouSecLowEdge; + dm[12] = ouSecUpEdge; dm[13] = 250.; dm[14] = dm[11]; @@ -373,15 +406,15 @@ void AliTPCv2::CreateGeometry() Float_t r1,r2; Float_t dead = fTPCParam->GetOuterWireMount(); - Float_t StripThick = 0.01; // 100 microns + Float_t stripThick = 0.01; // 100 microns gMC->Gsvolu("TLST", "PGON", idtmed[4], dm, 0); - dm[0] = 360.*kDegrad - 0.5*OuterOpenAngle; + dm[0] = 360.*kDegrad - 0.5*outerOpenAngle; dm[0] *= kRaddeg; dm[0] = (Float_t)TMath::Nint(dm[0]); - dm[1] = OuterOpenAngle*kRaddeg; + dm[1] = outerOpenAngle*kRaddeg; dm[1] = (Float_t)TMath::Nint(dm[1]); dm[2] = 1.; @@ -389,12 +422,12 @@ void AliTPCv2::CreateGeometry() dm[7] = 250.; - Float_t xx = dead/TMath::Tan(0.5*OuterOpenAngle); + Float_t xx = dead/TMath::Tan(0.5*outerOpenAngle); for(ns=0;nsGetNRowUp();ns++){ r1 = fTPCParam->GetPadRowRadiiUp(ns)-xx; - r2 = r1 + StripThick; + r2 = r1 + stripThick; dm[5] = r1; dm[6] = r2; @@ -430,7 +463,7 @@ void AliTPCv2::CreateGeometry() for(ns=0;nsGspos("TPEC",1,"TPSG",0.,0.,z0,0,"ONLY"); @@ -742,7 +775,7 @@ void AliTPCv2::CreateGeometry() gMC->Gsposp("TPWI",2,"TPWC",0.,0.,0.,0,"ONLY",dm,3); - z0 = z_side - 1.9 - 2.; + z0 = zSide - 1.9 - 2.; gMC->Gspos("TPWC",1,"TPSG",0.,0.,z0,0,"ONLY"); @@ -770,7 +803,7 @@ void AliTPCv2::CreateGeometry() for(ns=0;nsGspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY"); gMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[nRotMat], "ONLY"); @@ -1028,12 +1061,12 @@ void AliTPCv2::StepManager() // // parameters used for the energy loss calculations // - const Float_t prim = 14.35; // number of primary collisions per 1 cm - const Float_t poti = 20.77e-9; // first ionization potential for Ne/CO2 - const Float_t w_ion = 35.97e-9; // energy for the ion-electron pair creation + const Float_t kprim = 14.35; // number of primary collisions per 1 cm + const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2 + const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation - const Float_t big = 1.e10; + const Float_t kbig = 1.e10; Int_t id,copy; Float_t hits[4]; @@ -1045,7 +1078,7 @@ void AliTPCv2::StepManager() // - gMC->SetMaxStep(big); + gMC->SetMaxStep(kbig); if(!gMC->IsTrackAlive()) return; // particle has disappeared @@ -1122,7 +1155,7 @@ void AliTPCv2::StepManager() if(gMC->TrackStep() > 0) { - Int_t nel = (Int_t)(((gMC->Edep())-poti)/w_ion) + 1; + Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1; nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV gMC->TrackPosition(pos); @@ -1143,16 +1176,16 @@ void AliTPCv2::StepManager() TLorentzVector mom; gMC->TrackMomentum(mom); Float_t ptot=mom.Rho(); - Float_t beta_gamma = ptot/gMC->TrackMass(); + Float_t betaGamma = ptot/gMC->TrackMass(); Int_t pid=gMC->TrackPid(); if((pid==kElectron || pid==kPositron) && ptot > 0.002) { - pp = prim*1.58; // electrons above 20 MeV/c are on the plateau! + pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau! } else { - pp=prim*BetheBloch(beta_gamma); + pp=kprim*BetheBloch(betaGamma); if(TMath::Abs(charge) > 1.) pp *= (charge*charge); } @@ -1171,20 +1204,22 @@ Float_t AliTPCv2::BetheBloch(Float_t bg) // // Bethe-Bloch energy loss formula // - const Double_t p1=0.76176e-1; - const Double_t p2=10.632; - const Double_t p3=0.13279e-4; - const Double_t p4=1.8631; - const Double_t p5=1.9479; + const Double_t kp1=0.76176e-1; + const Double_t kp2=10.632; + const Double_t kp3=0.13279e-4; + const Double_t kp4=1.8631; + const Double_t kp5=1.9479; Double_t dbg = (Double_t) bg; Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg); - Double_t aa = TMath::Power(beta,p4); - Double_t bb = TMath::Power(1./dbg,p5); + Double_t aa = TMath::Power(beta,kp4); + Double_t bb = TMath::Power(1./dbg,kp5); - bb=TMath::Log(p3+bb); + bb=TMath::Log(kp3+bb); - return ((Float_t)((p2-aa-bb)*p1/aa)); + return ((Float_t)((kp2-aa-bb)*kp1/aa)); } + + diff --git a/TPC/AliTPCv2.h b/TPC/AliTPCv2.h index d5afe7608e2..c0c33811b70 100644 --- a/TPC/AliTPCv2.h +++ b/TPC/AliTPCv2.h @@ -1,5 +1,5 @@ -#ifndef TPCv2_H -#define TPCv2_H +#ifndef ALITPCV2_H +#define ALITPCV2_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ diff --git a/TPC/AliTPCv3.cxx b/TPC/AliTPCv3.cxx index 91204433d93..cfa07046242 100644 --- a/TPC/AliTPCv3.cxx +++ b/TPC/AliTPCv3.cxx @@ -15,6 +15,23 @@ /* $Log$ +Revision 1.13.2.4 2000/06/26 07:39:42 kowal2 +Changes to obey the coding rules + +Revision 1.13.2.3 2000/06/25 08:38:41 kowal2 +Splitted from AliTPCtracking + +Revision 1.13.2.2 2000/06/16 12:58:13 kowal2 +Changed parameter settings + +Revision 1.13.2.1 2000/06/09 07:15:07 kowal2 + +Defaults loaded automatically (hard-wired) +Optional parameters can be set via macro called in the constructor + +Revision 1.13 2000/05/15 10:00:30 kowal2 +Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova + Revision 1.12 2000/04/17 09:37:33 kowal2 removed obsolete AliTPCDigitsDisplay.C @@ -43,6 +60,7 @@ Introduction of the Copyright and cvs Log */ +// /////////////////////////////////////////////////////////////////////////////// // // // Time Projection Chamber version 3 -- detailed TPC and slow simulation // @@ -63,7 +81,9 @@ Introduction of the Copyright and cvs Log #include "AliConst.h" #include "AliTPCDigitsArray.h" #include"AliTPCParam.h" +#include"AliTPCParamSR.h" #include "AliPDG.h" +#include ClassImp(AliTPCv3) @@ -76,6 +96,11 @@ AliTPCv3::AliTPCv3(const char *name, const char *title) : // SetBufferSize(128000); + + SetGasMixt(2,20,10,-1,0.9,0.1,0.); + + if (fTPCParam) + fTPCParam->Write(fTPCParam->GetTitle()); } //_____________________________________________________________________________ @@ -181,58 +206,58 @@ void AliTPCv3::CreateGeometry() gMC->Gsvolu("TPSG", "TUBE", idtmed[2], dm, 3); - Float_t z_side = dm[2]; // 1/2 of the side gas thickness + Float_t zSide = dm[2]; // 1/2 of the side gas thickness //----------------------------------------------------------- // Readout chambers , 25% of X0, I use Al as the material //----------------------------------------------------------- - Float_t InnerOpenAngle = fTPCParam->GetInnerAngle(); - Float_t OuterOpenAngle = fTPCParam->GetOuterAngle(); + Float_t innerOpenAngle = fTPCParam->GetInnerAngle(); + Float_t outerOpenAngle = fTPCParam->GetOuterAngle(); - Float_t InnerAngleShift = fTPCParam->GetInnerAngleShift(); - Float_t OuterAngleShift = fTPCParam->GetOuterAngleShift(); + Float_t innerAngleShift = fTPCParam->GetInnerAngleShift(); + Float_t outerAngleShift = fTPCParam->GetOuterAngleShift(); Int_t nInnerSector = fTPCParam->GetNInnerSector()/2; Int_t nOuterSector = fTPCParam->GetNOuterSector()/2; - Float_t InSecLowEdge = fTPCParam->GetInnerRadiusLow(); - Float_t InSecUpEdge = fTPCParam->GetInnerRadiusUp(); + Float_t inSecLowEdge = fTPCParam->GetInnerRadiusLow(); + Float_t inSecUpEdge = fTPCParam->GetInnerRadiusUp(); - Float_t OuSecLowEdge = fTPCParam->GetOuterRadiusLow(); - Float_t OuSecUpEdge = fTPCParam->GetOuterRadiusUp(); + Float_t ouSecLowEdge = fTPCParam->GetOuterRadiusLow(); + Float_t ouSecUpEdge = fTPCParam->GetOuterRadiusUp(); - Float_t SecThick = 2.225; // Al + Float_t secThick = 2.225; // Al - Float_t LowEdge = fTPCParam->GetInnerFrameSpace(); + Float_t lowEdge = fTPCParam->GetInnerFrameSpace(); // S (Inner) sectors - dm[0] = InSecLowEdge*TMath::Tan(0.5*InnerOpenAngle)-LowEdge; - dm[1] = InSecUpEdge*TMath::Tan(0.5*InnerOpenAngle)-LowEdge; - dm[2] = SecThick; - dm[3] = 0.5*(InSecUpEdge-InSecLowEdge); + dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-lowEdge; + dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-lowEdge; + dm[2] = secThick; + dm[3] = 0.5*(inSecUpEdge-inSecLowEdge); - Float_t xCenterS = InSecLowEdge+dm[3]; + Float_t xCenterS = inSecLowEdge+dm[3]; gMC->Gsvolu("TRCS", "TRD1", idtmed[0], dm, 4); // L (Outer) sectors - Float_t UpEdge = fTPCParam->GetOuterFrameSpace(); + Float_t upEdge = fTPCParam->GetOuterFrameSpace(); - dm[0] = OuSecLowEdge*TMath::Tan(0.5*OuterOpenAngle)-UpEdge; - dm[1] = OuSecUpEdge*TMath::Tan(0.5*OuterOpenAngle)-UpEdge; - dm[2] = SecThick; - dm[3] = 0.5*(OuSecUpEdge-OuSecLowEdge); + dm[0] = ouSecLowEdge*TMath::Tan(0.5*outerOpenAngle)-upEdge; + dm[1] = ouSecUpEdge*TMath::Tan(0.5*outerOpenAngle)-upEdge; + dm[2] = secThick; + dm[3] = 0.5*(ouSecUpEdge-ouSecLowEdge); - Float_t xCenterL = OuSecLowEdge+dm[3]; + Float_t xCenterL = ouSecLowEdge+dm[3]; gMC->Gsvolu("TRCL", "TRD1", idtmed[0], dm, 4); - Float_t z1 = -z_side + SecThick*0.5; + Float_t z1 = -zSide + secThick*0.5; //------------------------------------------------------------------ // Positioning of the S-sector readout chambers @@ -246,7 +271,7 @@ void AliTPCv3::CreateGeometry() for(ns=0;nsGspos("TPEC",1,"TPSG",0.,0.,z0,0,"ONLY"); @@ -449,7 +474,7 @@ void AliTPCv3::CreateGeometry() gMC->Gsposp("TPWI",2,"TPWC",0.,0.,0.,0,"ONLY",dm,3); - z0 = z_side - 1.9 - 2.; + z0 = zSide - 1.9 - 2.; gMC->Gspos("TPWC",1,"TPSG",0.,0.,z0,0,"ONLY"); @@ -477,7 +502,7 @@ void AliTPCv3::CreateGeometry() for(ns=0;nsGspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY"); gMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[nRotMat], "ONLY"); @@ -735,12 +760,12 @@ void AliTPCv3::StepManager() // // parameters used for the energy loss calculations // - const Float_t prim = 14.35; // number of primary collisions per 1 cm - const Float_t poti = 20.77e-9; // first ionization potential for Ne/CO2 - const Float_t w_ion = 35.97e-9; // energy for the ion-electron pair creation + const Float_t kprim = 14.35; // number of primary collisions per 1 cm + const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2 + const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation - const Float_t big = 1.e10; + const Float_t kbig = 1.e10; Int_t id,copy; TLorentzVector pos; @@ -753,7 +778,7 @@ void AliTPCv3::StepManager() // - gMC->SetMaxStep(big); + gMC->SetMaxStep(kbig); if(!gMC->IsTrackAlive()) return; // particle has disappeared @@ -775,7 +800,7 @@ void AliTPCv3::StepManager() if(gMC->TrackStep() > 0) { - Int_t nel = (Int_t)(((gMC->Edep())-poti)/w_ion) + 1; + Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1; nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV gMC->TrackPosition(pos); @@ -803,16 +828,16 @@ void AliTPCv3::StepManager() TLorentzVector mom; gMC->TrackMomentum(mom); Float_t ptot=mom.Rho(); - Float_t beta_gamma = ptot/gMC->TrackMass(); + Float_t betaGamma = ptot/gMC->TrackMass(); Int_t pid=gMC->TrackPid(); if((pid==kElectron || pid==kPositron) && ptot > 0.002) { - pp = prim*1.58; // electrons above 20 MeV/c are on the plateau! + pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau! } else { - pp=prim*BetheBloch(beta_gamma); + pp=kprim*BetheBloch(betaGamma); if(TMath::Abs(charge) > 1.) pp *= (charge*charge); } @@ -831,20 +856,20 @@ Float_t AliTPCv3::BetheBloch(Float_t bg) // // Bethe-Bloch energy loss formula // - const Double_t p1=0.76176e-1; - const Double_t p2=10.632; - const Double_t p3=0.13279e-4; - const Double_t p4=1.8631; - const Double_t p5=1.9479; + const Double_t kp1=0.76176e-1; + const Double_t kp2=10.632; + const Double_t kp3=0.13279e-4; + const Double_t kp4=1.8631; + const Double_t kp5=1.9479; Double_t dbg = (Double_t) bg; Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg); - Double_t aa = TMath::Power(beta,p4); - Double_t bb = TMath::Power(1./dbg,p5); + Double_t aa = TMath::Power(beta,kp4); + Double_t bb = TMath::Power(1./dbg,kp5); - bb=TMath::Log(p3+bb); + bb=TMath::Log(kp3+bb); - return ((Float_t)((p2-aa-bb)*p1/aa)); + return ((Float_t)((kp2-aa-bb)*kp1/aa)); } diff --git a/TPC/AliTPCv3.h b/TPC/AliTPCv3.h index 6b4f43076e6..34d6cd3f809 100644 --- a/TPC/AliTPCv3.h +++ b/TPC/AliTPCv3.h @@ -1,5 +1,5 @@ -#ifndef TPCv3_H -#define TPCv3_H +#ifndef ALITPCV3_H +#define ALITPCV3_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ diff --git a/TPC/Makefile b/TPC/Makefile index b8c0e7c37b9..9906775d546 100644 --- a/TPC/Makefile +++ b/TPC/Makefile @@ -1,4 +1,4 @@ -############################### TPC Makefile ################################## +############################## TPC Makefile ################################## # Include machine specific definitions @@ -9,15 +9,17 @@ PACKAGE = TPC # C++ sources -SRCS = AliTPC.cxx AliTPCv0.cxx AliTPCv1.cxx AliTPCv2.cxx \ +SRCS = AliDigits.cxx AliSegmentArray.cxx AliTPCClusterFinder.cxx AliTPC.cxx AliTPCv0.cxx AliTPCv1.cxx AliTPCv2.cxx \ AliTPCv3.cxx AliDetectorParam.cxx AliTPCParam.cxx \ AliTPCParamSR.cxx AliTPCParamCR.cxx AliTPCPRF2D.cxx \ AliTPCRF1D.cxx AliArrayI.cxx AliArrayS.cxx \ - AliSegmentID.cxx AliSegmentArray.cxx AliDigits.cxx \ + AliSegmentID.cxx \ AliSimDigits.cxx AliDigitsArray.cxx AliTPCDigitsArray.cxx \ AliCluster.cxx AliClusters.cxx AliClustersArray.cxx \ - AliClusterFinder.cxx AliTPCClustersRow.cxx \ - AliTPCClustersArray.cxx AliH2F.cxx + AliTPCClustersRow.cxx \ + AliTPCClustersArray.cxx AliH2F.cxx \ + AliTPCcluster.cxx AliTPCclusterer.cxx \ + AliTPCtrack.cxx AliTPCtracker.cxx # C++ Headers @@ -77,4 +79,5 @@ include $(ALICE_ROOT)/conf/GeneralMacros -include tgt_$(ALICE_TARGET)/Make-depend +check : $(CHECKS) diff --git a/TPC/ParamTest.C b/TPC/ParamTest.C deleted file mode 100644 index bfa035cb986..00000000000 --- a/TPC/ParamTest.C +++ /dev/null @@ -1,15 +0,0 @@ -TFile f("prf2d.root"); -AliTPCPRF2D prf1; -AliTPCPRF2D prf2; -AliTPCRF1D rf(kTRUE); -rf.SetGauss(0.3,0.5,1) -rf.Update(); -prf1.Read("prf_205035_Gati_062074_d03"); -prf2.Read("prf_205035_Gati_062074_d03"); -AliTPCParamSR param; -param.SetInnerPRF(&prf1) -param.SetOuterPRF(&prf2) -param.SetTimeRF(&rf); -Float_t x[3]={5.1,0,100} -Int_t index[3] -param.CalcResponse(x,index) diff --git a/TPC/SetTPCParamOptional.C b/TPC/SetTPCParamOptional.C new file mode 100644 index 00000000000..baca15ee9cb --- /dev/null +++ b/TPC/SetTPCParamOptional.C @@ -0,0 +1,8 @@ +AliTPCParam *SetTPCParamOptional(){ + + // optional set of parameters + + AliTPCParam *par=new AliTPCParamSR; + par->SetTitle("optional"); //This is a dummy code ! Just to change something + return par; +} diff --git a/TPC/TPCAnal.C b/TPC/TPCAnal.C deleted file mode 100644 index 29cea2554c7..00000000000 --- a/TPC/TPCAnal.C +++ /dev/null @@ -1,542 +0,0 @@ -/* -#include "alles.h" -extern AliTPCParam *gTPCParam; -extern AliTPCClustersArray * gCalcClusters; -extern AliTPCClustersArray * gDifClusters; -*/ - - - -TH1F * GetDX(Float_t x1=-2, Float_t x2=3, Float_t a1=-1, Float_t a2=1) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hd = new TH1F("delta x", "dx",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - // if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - // if ( (cl->fGenerTrack != cl->fTracks[0])) continue; - if ( (cl->fAngleXfAngleX>a1) ) hd->Fill(cl->fDx); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - -TH1F * GetDY(Float_t x1=-2, Float_t x2=3, Float_t a1=-1, Float_t a2=1) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hd = new TH1F("delta y", "dy",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - //if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - //if ( (cl->fGenerTrack != cl->fTracks[0])) continue; - // if (cl->fNy!=2) continue; - if ((cl->fAngleYfAngleY>a1) ) hd->Fill(cl->fDy); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - - - -TH1F * GetNX(Float_t x1=0, Float_t x2=7, Float_t a1=-1, Float_t a2=1) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hd = new TH1F("N x", "N x",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ((cl->fAngleXfAngleX>a1) ) hd->Fill(cl->fNx); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - -TH1F * GetNY(Float_t x1=-0, Float_t x2=7, Float_t a1=-1, Float_t a2=1) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hd = new TH1F("N y", "N y",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - if ( (cl->fAngleYfAngleY>a1) ) hd->Fill(cl->fNy); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - - - - -TH1F * GetAngleX(Float_t x1=-2, Float_t x2=3) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hdx = new TH1F("Angle x", "Angle x",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hdx->Fill(cl->fAngleX); - } - arr->ClearSegment(clrow->GetID()); - } - return hdx; -} - -TH1F * GetAngleX2(Float_t x1=-2, Float_t x2=3) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hdx = new TH1F("Angle x2", "Angle x2",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hdx->Fill(cl->fAngleX*cl->fAngleX); - } - arr->ClearSegment(clrow->GetID()); - } - return hdx; -} - -TH1F * GetAngleY(Float_t x1=-2, Float_t x2=3) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hdx = new TH1F("Angle y", "Angle y",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hdx->Fill(cl->fAngleY); - } - arr->ClearSegment(clrow->GetID()); - } - return hdx; -} - -TH1F * GetAngleY2(Float_t x1=-2, Float_t x2=3) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hdx = new TH1F("Angle y2", "Angle y2",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hdx->Fill(cl->fAngleY*cl->fAngleY); - } - arr->ClearSegment(clrow->GetID()); - } - return hdx; -} - - -TH1F * GetKmax(Float_t x1=0, Float_t x2=200) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hd = new TH1F("Max ADC", "Max ADC",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(cl->fMax); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - - -TH1F * GetQ(Float_t x1=0, Float_t x2=200) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hd = new TH1F("Integral Q", "Integral Q",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(cl->fQ); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - - -TH1F * GetCalcQ(Float_t x1=0, Float_t x2=1) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hd = new TH1F("kCalcQ", "kCalcQ",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(cl->fOrigQ); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - - -TH1F * GetCalcQSQR(Float_t x1=0, Float_t x2=1) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hd = new TH1F("kCalcQSQRt", "kCalcQSQRt",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(TMath::Sqrt(cl->fOrigQ)); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - - - -TH1F * GetQDivQ(Float_t x1=0, Float_t x2=1) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hd = new TH1F("kQdivCalcQ", "kQDivCalcQ",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - // if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(cl->fQ/cl->fOrigQ); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - - - -TH1F * GetKmaxDivQ(Float_t x1=0, Float_t x2=1) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hd = new TH1F("kMaxdivQ", "kMaxDivQ",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(cl->fMax/cl->fQ); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - - - - - - - - -TH2F * GetDXvRow(Float_t x1=0, Float_t x2=20, Float_t y1=0, Float_t y2=3) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH2F * hd = new TH2F("delta x versur row ", "DXvRow",33,x1,x2,33,y1,y2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - Int_t sector,row; - gTPCParam->AdjustSectorRow(clrow->GetID(),sector,row); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(row,cl->fDx,1); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - - -TH1F * GetSigmaX(Float_t x1=0, Float_t x2=2) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hd = new TH1F("SigmaX", "SigmaX",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(TMath::Sqrt(cl->fSigmaX2)); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - - -TH1F * GetSigmaY(Float_t x1=0, Float_t x2=2) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hd = new TH1F("SigmaY", "SigmaY",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(TMath::Sqrt(cl->fSigmaY2)); - } - arr->ClearSegment(clrow->GetID()); - } - - return hd; -} - -TH1F * GetArea(Float_t x1=0, Float_t x2=40) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH1F * hd = new TH1F("Cluster area", "cluster area",33,x1,x2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(cl->fArea); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - - -TH2F * GetSigmaXvX(Float_t x1=0, Float_t x2=500,Float_t y1=0, Float_t y2=1) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH2F * hd = new TH2F("SigmaXvX", "SigmaXvX",33,x1,x2,33,y1,y2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(cl->fX,TMath::Sqrt(cl->fSigmaX2),1); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - -TH2F * GetSigmaYvX(Float_t x1=0, Float_t x2=500,Float_t y1=0, Float_t y2=1) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH2F * hd = new TH2F("SigmaYvX", "SigmaYvX",33,x1,x2,33,y1,y2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(cl->fX,TMath::Sqrt(cl->fSigmaY2),1); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - -TH2F * GetDeltaXvX(Float_t x1=0, Float_t x2=500,Float_t y1=0, Float_t y2=3) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH2F * hd = new TH2F("DeltaXvX", "DeltaXvX",33,x1,x2,33,y1,y2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(cl->fX,cl->fDy,1); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - -TH2F * GetDeltaYvX(Float_t x1=0, Float_t x2=500,Float_t y1=0, Float_t y2=0.5) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH2F * hd = new TH2F("DeltaYvX", "DeltaYvX",33,x1,x2,33,y1,y2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(cl->fX,cl->fDy,1); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - -TH2F * GetAreavX(Float_t x1=0, Float_t x2=500,Float_t y1=0, Float_t y2=20) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH2F * hd = new TH2F("AreavX", "AreavX",33,x1,x2,33,y1,y2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(cl->fX,cl->fArea,1); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - - -TH2F * GetKvX(Float_t x1=0, Float_t x2=500,Float_t y1=0, Float_t y2=20) -{ - AliTPCClustersArray *arr=gDifClusters; - if (arr==0) return 0; - TH2F * hd = new TH2F("KvX", "KvX",33,x1,x2,33,y1,y2); - Int_t nsegment = (Int_t)arr->GetTree()->GetEntries(); - Int_t segment; - for (segment = 0; segmentLoadEntry(segment); - if (clrow==0) continue; - Int_t ncluster = clrow->GetArray()->GetEntriesFast(); - for (Int_t i = 0; iGetArray()->UncheckedAt(i); - if ( (cl->fGenerTrack != cl->fTracks[0]) || (cl->fTracks[1]>0)) continue; - hd->Fill(cl->fX,cl->fMax,1); - } - arr->ClearSegment(clrow->GetID()); - } - return hd; -} - diff --git a/TPC/TPCLinkDef.h b/TPC/TPCLinkDef.h index c6f824b16ea..195273dff94 100644 --- a/TPC/TPCLinkDef.h +++ b/TPC/TPCLinkDef.h @@ -4,6 +4,7 @@ /* $Id$ */ + #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; @@ -16,7 +17,7 @@ #pragma link C++ class AliTPChit; #pragma link C++ class AliTPCdigit; #pragma link C++ class AliTPCcluster; -#pragma link C++ class AliTPCtrack; +#pragma link C++ class AliTPCtrack-; #pragma link C++ class AliTPCParam-; #pragma link C++ class AliTPCParamSR-; @@ -44,8 +45,7 @@ #pragma link C++ class AliTPCDigitsArray; -#pragma link C++ class AliClusterFinder-; -#pragma link C++ class AliCell; +#pragma link C++ class AliTPCClusterFinder-; #pragma link C++ class AliH2F; diff --git a/TPC/TPCtest.C b/TPC/TPCtest.C deleted file mode 100644 index ba48bf75a5e..00000000000 --- a/TPC/TPCtest.C +++ /dev/null @@ -1,27 +0,0 @@ -void TPCtest() -{ -// Connect the Root Galice file containing Geometry, Kine and Hits -TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root"); - if (!file) file = new TFile("galice.root","UPDATE"); - -// Get AliRun object from file or create it if not on file - if (!gAlice) { - gAlice = (AliRun*)file->Get("gAlice"); - if (gAlice) printf("AliRun object found on file\n"); - if (!gAlice) gAlice = new AliRun("gAlice","Alice test program"); - } - -gAlice->GetEvent(0); -AliDetector *TPC = gAlice->GetDetector("TPC"); -Int_t en; - -((AliTPC*)TPC)->Hits2Digits(); - -TClonesArray *Digits = TPC->Digits(); - -en = gAlice->TreeD()->GetEntries(); -printf("entries = %d\n",en); - -gAlice->TreeD()->Write(); - -} diff --git a/TPC/template.C b/TPC/template.C deleted file mode 100644 index 51db59f1e51..00000000000 --- a/TPC/template.C +++ /dev/null @@ -1,48 +0,0 @@ -void MakeClusterTree(Int_t n) -{ - TFile * f = new TFile("pokus.root","recreate"); - AliTPCClustersArray arr; - arr.MakeArray(10000); - arr.MakeTree(); - for (Int_t i=0;iSetIndex(i); - arr.AddSegment(row); - } - for (Int_t i=0;iWrite("pokus1"); - - -} - - -void MakeTree(Int_t n) -{ - AliSegmentArray arr; - - TFile * f= new TFile("pokus.root","recreate"); - arr.MakeArray(10000); - arr.MakeTree(); - // for (Int_t i=0;iRndm())*n))); - - //for (Int_t i=0;iRndm())*n)); - for (Int_t i=0;iWrite("pokus1"); -} - -void ConnectTree(Int_t n,AliSegmentArray *a) -{ - AliSegmentArray &arr= *a; - // TFile * f = new TFile("pokus.root","update"); - TFile * f = new TFile("pokus.root","update"); - arr.MakeArray(10000); - arr.ConnectTree("pokus1"); - for (Int_t i=0;iGetID()!=i) cout<