1 #ifndef ALIITSPACKAGESSD_H
2 #define ALIITSPACKAGESSD_H
3 //Class describing set of AliITSoneSideClusterSSDs, which contact each other.
4 //Piotr Krzysztof Skowronski
5 //Warsaw University of Technology
11 //#include "AliITSclusterSSD.h"
13 class AliITSclusterSSD;
15 //-------------------------------------------------------------------
17 class AliITSpackageSSD : public TObject
22 AliITSpackageSSD(Int_t len, TClonesArray *clustersP, TClonesArray *clustersN);
23 AliITSpackageSSD(TClonesArray *clustersP, TClonesArray *clustersN);
27 AliITSpackageSSD(const AliITSpackageSSD &package);
28 AliITSpackageSSD& operator=( const AliITSpackageSSD & package);
29 //Add cluster in side N, clindex is an index of this cluster in TClonesArray
31 void AddNSideCluster(Int_t clindex) {(*fClusterNIndexes)[fNclustersN++]=clindex;}
32 void AddPSideCluster(Int_t clindex) {(*fClusterPIndexes)[fNclustersP++]=clindex;}
34 void AddCluster(Int_t clindex, Bool_t side){
35 (side)?(*fClusterNIndexes)[fNclustersN++]=
36 clindex:(*fClusterPIndexes)[fNclustersP++]=clindex;}
38 //Returns index of one side cluster in TClonesArray, NOT AliITSclusterSSD
39 Int_t GetNSideClusterIdx(Int_t index) const; //input index is number of cluster in this package
40 Int_t GetPSideClusterIdx(Int_t index) const; //returns index in TClonesArray
41 Int_t GetClusterIdx(Int_t index,Bool_t side) const
42 {return (side)?GetPSideClusterIdx(index):GetNSideClusterIdx(index);}
44 AliITSclusterSSD* GetNSideCluster(Int_t index);
45 AliITSclusterSSD* GetPSideCluster(Int_t index); //index is
46 AliITSclusterSSD* GetCluster(Int_t index, Bool_t side)
47 {return (side)?GetPSideCluster(index):GetNSideCluster(index);}
49 Int_t GetNextPIdx(Int_t OI) const; //Returns index of next P cluster in package; OI == Original Inedx (in TClonesArray)
50 Int_t GetPrvPIdx(Int_t OI) const; //Returns index of previous P cluster in package; OI == Original Inedx (in TClonesArray)
51 Int_t GetNextNIdx(Int_t OI) const; //Returns index of next N cluster in package; OI == Original Inedx (in TClonesArray)
52 Int_t GetPrvNIdx(Int_t OI) const; //Returns index of previous N cluster in package; OI == Original Inedx (in TClonesArray)
54 Int_t GetNumOfClustersN() const {return fNclustersN;}
55 Int_t GetNumOfClustersP() const {return fNclustersP;}
56 Int_t GetNumOfClusters() const {return fNclustersP+fNclustersN;}
57 Int_t GetNumOfClusters(Bool_t side) const {return (side)?fNclustersP:fNclustersN;}
59 //returns number of clusters belonging to package,
60 //that crosses with only one cluster on the other side
61 //There might be only 2 such a clusters:
62 //on the begining and on the end of the package
64 Bool_t GetClusterWithOneCross(Int_t & index, Bool_t& side );
65 void DelCluster(Int_t index, Bool_t side);
66 void DelPCluster(Int_t index);
67 void DelNCluster(Int_t index);
68 void DelClusterOI(Int_t index, Bool_t side); //OI indicates that it is Original Index
69 void DelPClusterOI(Int_t index); //it means value in look up table
70 void DelNClusterOI(Int_t index);
72 void SplitPackage(Int_t pi, Int_t ni, AliITSpackageSSD* pkg);
73 void GetAllCombinations(Int_t**array,Int_t &num,Int_t size);
75 void ConsumeClusters();
80 TClonesArray *fClustersN; //Pointer to array of clusters - only to have direct acces to
81 TClonesArray *fClustersP; //clusters
82 Int_t fNclustersN; // number of N clusters
83 Int_t fNclustersP; // number of P cluster
84 TArrayI *fClusterNIndexes; // array of pointers to the N clusters
85 TArrayI *fClusterPIndexes; // array of pointers to the P clusters
87 static const Bool_t fgkSIDEP; // boolean for P side
88 static const Bool_t fgkSIDEN; // boolean for N side
89 static const Int_t fgkDebug=0; // debugging flag
97 void MakeCombin(Int_t**arr, Int_t& nu, Int_t np, Int_t *occup,Int_t size);
98 Bool_t IsFree(Int_t idx, Int_t nn, const Int_t *lis) const;
104 //-------------------------------------------------------
105 ClassDef(AliITSpackageSSD,1)