]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSpackageSSD.h
fix some coding violations.
[u/mrichter/AliRoot.git] / ITS / AliITSpackageSSD.h
CommitLineData
b0f5e3fc 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
6//skowron@if.pw.edu.pl
7//
8#include "TObject.h"
9#include "TArrayI.h"
b0f5e3fc 10
55d2c544 11//#include "AliITSclusterSSD.h"
b0f5e3fc 12
e8189707 13class AliITS;
55d2c544 14class AliITSclusterSSD;
15
16//-------------------------------------------------------------------
b0f5e3fc 17
18class AliITSpackageSSD : public TObject
19{
20 public:
21 AliITSpackageSSD();
22
427cf8ad 23 AliITSpackageSSD(Int_t len, TClonesArray *clustersP, TClonesArray *clustersN);
24 AliITSpackageSSD(TClonesArray *clustersP, TClonesArray *clustersN);
b0f5e3fc 25
26 ~AliITSpackageSSD();
27
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
31
32 void AddNSideCluster(Int_t clindex) {(*fClusterNIndexes)[fNclustersN++]=clindex;}
33 void AddPSideCluster(Int_t clindex) {(*fClusterPIndexes)[fNclustersP++]=clindex;}
34
35 void AddCluster(Int_t clindex, Bool_t side){
36 (side)?(*fClusterNIndexes)[fNclustersN++]=
37 clindex:(*fClusterPIndexes)[fNclustersP++]=clindex;}
38
39//Returns index of one side cluster in TClonesArray, NOT AliITSclusterSSD
6ba216a4 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
55d2c544 42 Int_t GetClusterIdx(Int_t index,Bool_t side) const
b0f5e3fc 43 {return (side)?GetPSideClusterIdx(index):GetNSideClusterIdx(index);}
44
6ba216a4 45 AliITSclusterSSD* GetNSideCluster(Int_t index);
46 AliITSclusterSSD* GetPSideCluster(Int_t index); //index is
b0f5e3fc 47 AliITSclusterSSD* GetCluster(Int_t index, Bool_t side)
48 {return (side)?GetPSideCluster(index):GetNSideCluster(index);}
49
55d2c544 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)
54
55 Int_t GetNumOfClustersN() const {return fNclustersN;}
56 Int_t GetNumOfClustersP() const {return fNclustersP;}
57 Int_t GetNumOfClusters() const {return fNclustersP+fNclustersN;}
6ba216a4 58 Int_t GetNumOfClusters(Bool_t side) const {return (side)?fNclustersP:fNclustersN;}
b0f5e3fc 59
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
64 //
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);
72
73 void SplitPackage(Int_t pi, Int_t ni, AliITSpackageSSD* pkg);
74 void GetAllCombinations(Int_t**array,Int_t &num,Int_t size);
75
76 void ConsumeClusters();
77 void PrintClusters();
78
79protected:
80
81 TClonesArray *fClustersN; //Pointer to array of clusters - only to have direct acces to
82 TClonesArray *fClustersP; //clusters
55d2c544 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
e8189707 87
55d2c544 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
b0f5e3fc 91
92
93/***************/
94/* Methods */
95/***************/
96
97
98 void MakeCombin(Int_t**arr, Int_t& nu, Int_t np, Int_t *occup,Int_t size);
6ba216a4 99 Bool_t IsFree(Int_t idx, Int_t nn, const Int_t *lis) const;
b0f5e3fc 100
101
102
103private:
104
105//-------------------------------------------------------
106 ClassDef(AliITSpackageSSD,1)
107};
108
109#endif