]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSpackageSSD.h
Updated for coding convenstions compilation errors and warnings and the like.
[u/mrichter/AliRoot.git] / ITS / AliITSpackageSSD.h
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"
10 #include "TClonesArray.h"
11 #include "AliITS.h"
12
13 #include "AliITSclusterSSD.h"
14
15
16 class AliITSpackageSSD : public TObject
17 {
18  public:
19   AliITSpackageSSD(); 
20
21   AliITSpackageSSD(Int_t len, TClonesArray *clustersP, TClonesArray *clustersP);  
22   AliITSpackageSSD(TClonesArray *clustersP, TClonesArray *clustersP);   
23
24   ~AliITSpackageSSD();
25   
26   AliITSpackageSSD(const AliITSpackageSSD &package); 
27   AliITSpackageSSD&  operator=( const AliITSpackageSSD & package);
28   //Add cluster in side N, clindex is an index of this cluster in TClonesArray
29   
30   void     AddNSideCluster(Int_t clindex) {(*fClusterNIndexes)[fNclustersN++]=clindex;} 
31   void     AddPSideCluster(Int_t clindex) {(*fClusterPIndexes)[fNclustersP++]=clindex;} 
32
33   void     AddCluster(Int_t clindex, Bool_t side){
34               (side)?(*fClusterNIndexes)[fNclustersN++]= 
35                    clindex:(*fClusterPIndexes)[fNclustersP++]=clindex;}
36         
37 //Returns index of one side cluster in TClonesArray, NOT AliITSclusterSSD
38   Int_t    GetNSideClusterIdx(Int_t index); //input index is number of cluster in this package 
39   Int_t    GetPSideClusterIdx(Int_t index); //returns index in TClonesArray
40   Int_t    GetClusterIdx(Int_t index,Bool_t side)
41                 {return (side)?GetPSideClusterIdx(index):GetNSideClusterIdx(index);}
42  
43   AliITSclusterSSD*    GetNSideCluster(Int_t index);
44   AliITSclusterSSD*    GetPSideCluster(Int_t index); //index is 
45   AliITSclusterSSD*    GetCluster(Int_t index, Bool_t side)
46                 {return (side)?GetPSideCluster(index):GetNSideCluster(index);}
47                         
48   Int_t    GetNextPIdx(Int_t OI); //Returns index of next P cluster in package; OI == Original Inedx (in TClonesArray)
49   Int_t    GetPrvPIdx(Int_t OI);  //Returns index of previous P cluster in package; OI == Original Inedx (in TClonesArray)
50   Int_t    GetNextNIdx(Int_t OI); //Returns index of next N cluster in package; OI == Original Inedx (in TClonesArray)
51   Int_t    GetPrvNIdx(Int_t OI);  //Returns index of previous N cluster in package; OI == Original Inedx (in TClonesArray)
52
53   Int_t    GetNumOfClustersN (){return fNclustersN;}  
54   Int_t    GetNumOfClustersP(){return fNclustersP;}   
55   Int_t    GetNumOfClusters() {return fNclustersP+fNclustersN;}  
56   Int_t    GetNumOfClusters(Bool_t side) {return (side)?fNclustersP:fNclustersN;}
57   
58   //returns number of clusters belonging to package,
59   //that crosses with only one cluster on the other side 
60   //There might be only 2 such a clusters:
61   //on the begining and on the end of the package
62   //
63   Bool_t    GetClusterWithOneCross(Int_t & index, Bool_t& side );  
64   void      DelCluster(Int_t index, Bool_t side);
65   void      DelPCluster(Int_t index);
66   void      DelNCluster(Int_t index);
67   void      DelClusterOI(Int_t index, Bool_t side); //OI indicates that it is Original Index
68   void      DelPClusterOI(Int_t index); //it means value in look up table
69   void      DelNClusterOI(Int_t index);  
70   
71   void      SplitPackage(Int_t pi, Int_t ni, AliITSpackageSSD* pkg);
72   void      GetAllCombinations(Int_t**array,Int_t &num,Int_t size);
73   
74   void      ConsumeClusters();
75   void      PrintClusters();
76   
77 protected:
78   
79   TClonesArray *fClustersN;   //Pointer to array of clusters - only to have direct acces to 
80   TClonesArray *fClustersP;   //clusters
81   Int_t    fNclustersN;
82   Int_t    fNclustersP;
83   TArrayI *fClusterNIndexes;
84   TArrayI *fClusterPIndexes;
85   static const Bool_t SIDEP=kTRUE;
86   static const Bool_t SIDEN=kFALSE;
87
88
89 /***************/
90 /*   Methods   */
91 /***************/
92
93   
94   void    MakeCombin(Int_t**arr, Int_t& nu, Int_t np, Int_t *occup,Int_t size);
95   Bool_t  IsFree(Int_t idx, Int_t nn, Int_t *lis);
96   
97
98                  
99 private:
100                  
101 //-------------------------------------------------------                
102   ClassDef(AliITSpackageSSD,1)  
103 };
104
105 #endif
106
107
108
109
110
111
112