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"
14 class AliITSclusterSSD;
16 //-------------------------------------------------------------------
18 class AliITSpackageSSD : public TObject
23 AliITSpackageSSD(Int_t len, TClonesArray *clustersP, TClonesArray *clustersN);
24 AliITSpackageSSD(TClonesArray *clustersP, TClonesArray *clustersN);
28 AliITSpackageSSD(const AliITSpackageSSD &package);
29 AliITSpackageSSD& operator=( const AliITSpackageSSD & package);
30 //Add cluster in side N, clindex is an index of this cluster in TClonesArray
32 void AddNSideCluster(Int_t clindex) {(*fClusterNIndexes)[fNclustersN++]=clindex;}
33 void AddPSideCluster(Int_t clindex) {(*fClusterPIndexes)[fNclustersP++]=clindex;}
35 void AddCluster(Int_t clindex, Bool_t side){
36 (side)?(*fClusterNIndexes)[fNclustersN++]=
37 clindex:(*fClusterPIndexes)[fNclustersP++]=clindex;}
39 //Returns index of one side cluster in TClonesArray, NOT AliITSclusterSSD
40 Int_t GetNSideClusterIdx(Int_t index) const; //input index is number of cluster in this package
41 Int_t GetPSideClusterIdx(Int_t index) const; //returns index in TClonesArray
42 Int_t GetClusterIdx(Int_t index,Bool_t side) const
43 {return (side)?GetPSideClusterIdx(index):GetNSideClusterIdx(index);}
45 AliITSclusterSSD* GetNSideCluster(Int_t index);
46 AliITSclusterSSD* GetPSideCluster(Int_t index); //index is
47 AliITSclusterSSD* GetCluster(Int_t index, Bool_t side)
48 {return (side)?GetPSideCluster(index):GetNSideCluster(index);}
50 Int_t GetNextPIdx(Int_t OI) const; //Returns index of next P cluster in package; OI == Original Inedx (in TClonesArray)
51 Int_t GetPrvPIdx(Int_t OI) const; //Returns index of previous P cluster in package; OI == Original Inedx (in TClonesArray)
52 Int_t GetNextNIdx(Int_t OI) const; //Returns index of next N cluster in package; OI == Original Inedx (in TClonesArray)
53 Int_t GetPrvNIdx(Int_t OI) const; //Returns index of previous N cluster in package; OI == Original Inedx (in TClonesArray)
55 Int_t GetNumOfClustersN() const {return fNclustersN;}
56 Int_t GetNumOfClustersP() const {return fNclustersP;}
57 Int_t GetNumOfClusters() const {return fNclustersP+fNclustersN;}
58 Int_t GetNumOfClusters(Bool_t side) const {return (side)?fNclustersP:fNclustersN;}
60 //returns number of clusters belonging to package,
61 //that crosses with only one cluster on the other side
62 //There might be only 2 such a clusters:
63 //on the begining and on the end of the package
65 Bool_t GetClusterWithOneCross(Int_t & index, Bool_t& side );
66 void DelCluster(Int_t index, Bool_t side);
67 void DelPCluster(Int_t index);
68 void DelNCluster(Int_t index);
69 void DelClusterOI(Int_t index, Bool_t side); //OI indicates that it is Original Index
70 void DelPClusterOI(Int_t index); //it means value in look up table
71 void DelNClusterOI(Int_t index);
73 void SplitPackage(Int_t pi, Int_t ni, AliITSpackageSSD* pkg);
74 void GetAllCombinations(Int_t**array,Int_t &num,Int_t size);
76 void ConsumeClusters();
81 TClonesArray *fClustersN; //Pointer to array of clusters - only to have direct acces to
82 TClonesArray *fClustersP; //clusters
83 Int_t fNclustersN; // number of N clusters
84 Int_t fNclustersP; // number of P cluster
85 TArrayI *fClusterNIndexes; // array of pointers to the N clusters
86 TArrayI *fClusterPIndexes; // array of pointers to the P clusters
88 static const Bool_t fgkSIDEP; // boolean for P side
89 static const Bool_t fgkSIDEN; // boolean for N side
90 static const Int_t fgkDebug=0; // debugging flag
98 void MakeCombin(Int_t**arr, Int_t& nu, Int_t np, Int_t *occup,Int_t size);
99 Bool_t IsFree(Int_t idx, Int_t nn, const Int_t *lis) const;
105 //-------------------------------------------------------
106 ClassDef(AliITSpackageSSD,1)