]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSpackageSSD.h
Access function to local momenta renamed.
[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
11 #include "AliITSclusterSSD.h"
12
13 class AliITS;
14
15 class AliITSpackageSSD : public TObject
16 {
17  public:
18   AliITSpackageSSD(); 
19
20   AliITSpackageSSD(Int_t len, TClonesArray *clustersP, TClonesArray *clustersN);  
21   AliITSpackageSSD(TClonesArray *clustersP, TClonesArray *clustersN);   
22
23   ~AliITSpackageSSD();
24   
25   AliITSpackageSSD(const AliITSpackageSSD &package); 
26   AliITSpackageSSD&  operator=( const AliITSpackageSSD & package);
27   //Add cluster in side N, clindex is an index of this cluster in TClonesArray
28   
29   void     AddNSideCluster(Int_t clindex) {(*fClusterNIndexes)[fNclustersN++]=clindex;} 
30   void     AddPSideCluster(Int_t clindex) {(*fClusterPIndexes)[fNclustersP++]=clindex;} 
31
32   void     AddCluster(Int_t clindex, Bool_t side){
33               (side)?(*fClusterNIndexes)[fNclustersN++]= 
34                    clindex:(*fClusterPIndexes)[fNclustersP++]=clindex;}
35         
36 //Returns index of one side cluster in TClonesArray, NOT AliITSclusterSSD
37   Int_t    GetNSideClusterIdx(Int_t index); //input index is number of cluster in this package 
38   Int_t    GetPSideClusterIdx(Int_t index); //returns index in TClonesArray
39   Int_t    GetClusterIdx(Int_t index,Bool_t side)
40                 {return (side)?GetPSideClusterIdx(index):GetNSideClusterIdx(index);}
41  
42   AliITSclusterSSD*    GetNSideCluster(Int_t index);
43   AliITSclusterSSD*    GetPSideCluster(Int_t index); //index is 
44   AliITSclusterSSD*    GetCluster(Int_t index, Bool_t side)
45                 {return (side)?GetPSideCluster(index):GetNSideCluster(index);}
46                         
47   Int_t    GetNextPIdx(Int_t OI); //Returns index of next P cluster in package; OI == Original Inedx (in TClonesArray)
48   Int_t    GetPrvPIdx(Int_t OI);  //Returns index of previous P cluster in package; OI == Original Inedx (in TClonesArray)
49   Int_t    GetNextNIdx(Int_t OI); //Returns index of next N cluster in package; OI == Original Inedx (in TClonesArray)
50   Int_t    GetPrvNIdx(Int_t OI);  //Returns index of previous N cluster in package; OI == Original Inedx (in TClonesArray)
51
52   Int_t    GetNumOfClustersN (){return fNclustersN;}  
53   Int_t    GetNumOfClustersP(){return fNclustersP;}   
54   Int_t    GetNumOfClusters() {return fNclustersP+fNclustersN;}  
55   Int_t    GetNumOfClusters(Bool_t side) {return (side)?fNclustersP:fNclustersN;}
56   
57   //returns number of clusters belonging to package,
58   //that crosses with only one cluster on the other side 
59   //There might be only 2 such a clusters:
60   //on the begining and on the end of the package
61   //
62   Bool_t    GetClusterWithOneCross(Int_t & index, Bool_t& side );  
63   void      DelCluster(Int_t index, Bool_t side);
64   void      DelPCluster(Int_t index);
65   void      DelNCluster(Int_t index);
66   void      DelClusterOI(Int_t index, Bool_t side); //OI indicates that it is Original Index
67   void      DelPClusterOI(Int_t index); //it means value in look up table
68   void      DelNClusterOI(Int_t index);  
69   
70   void      SplitPackage(Int_t pi, Int_t ni, AliITSpackageSSD* pkg);
71   void      GetAllCombinations(Int_t**array,Int_t &num,Int_t size);
72   
73   void      ConsumeClusters();
74   void      PrintClusters();
75   
76 protected:
77   
78   TClonesArray *fClustersN;   //Pointer to array of clusters - only to have direct acces to 
79   TClonesArray *fClustersP;   //clusters
80   Int_t    fNclustersN;
81   Int_t    fNclustersP;
82   TArrayI *fClusterNIndexes;
83   TArrayI *fClusterPIndexes;
84
85   static const Bool_t fgkSIDEP;
86   static const Bool_t fgkSIDEN;
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