FairRoot/PandaRoot
Public Member Functions | List of all members
PndTrkSttClusterFinder Class Reference

#include <PndTrkSttClusterFinder.h>

Public Member Functions

 PndTrkSttClusterFinder ()
 
virtual ~PndTrkSttClusterFinder ()
 
Short_t FindTrackPattern (bool *InclusionListStt, Short_t *ListHitsinCluster, Short_t(*ListParContiguous)[6], Short_t MAXHITSINCLUSTER, Short_t *nParContiguous, Short_t number_straws, Short_t SeedHit, Short_t *SttStrawOn, Short_t *TubeID)
 
void GetClusters (bool *InclusionListStt, Short_t ListParContiguous[][6], Short_t *ListSttParHits, Short_t *nParContiguous, Short_t nSttParHit, const Short_t MAXFOUNDCLUSTERS, const Short_t MAXHITSINCLUSTER, const Short_t MAXSTTHITS, const Short_t NUMBER_STRAWS, Short_t *StrawCode, Short_t *StrawCode2, Short_t *SttStrawOn, TClonesArray *SttTubeArray, Short_t *TubeID, Short_t *ListHitsinCluster, Short_t &nFoundClusters, Short_t *nHitsinCluster)
 
 ClassDef (PndTrkSttClusterFinder, 1)
 

Detailed Description

Definition at line 7 of file PndTrkSttClusterFinder.h.

Constructor & Destructor Documentation

PndTrkSttClusterFinder::PndTrkSttClusterFinder ( )

Default constructor

Definition at line 20 of file PndTrkSttClusterFinder.cxx.

20 {};
PndTrkSttClusterFinder::~PndTrkSttClusterFinder ( )
virtual

Destructor

Definition at line 23 of file PndTrkSttClusterFinder.cxx.

23 {};

Member Function Documentation

PndTrkSttClusterFinder::ClassDef ( PndTrkSttClusterFinder  ,
 
)
Short_t PndTrkSttClusterFinder::FindTrackPattern ( bool *  InclusionListStt,
Short_t *  ListHitsinCluster,
Short_t(*)  ListParContiguous[6],
Short_t  MAXHITSINCLUSTER,
Short_t *  nParContiguous,
Short_t  number_straws,
Short_t  SeedHit,
Short_t *  SttStrawOn,
Short_t *  TubeID 
)

Definition at line 28 of file PndTrkSttClusterFinder.cxx.

References i, and MAXHITSINCLUSTER.

41 {
42 
43  Short_t
44  ContiguousTube,
45  CurrentTube,
46  i;
47 
48 
49 /*
50  Short_t tCurrentListofTubes[ MAXHITSINCLUSTER ]; // current list of tubes forming the cluster;
51 
52  Vec <Short_t>
53  CurrentListofTubes(tCurrentListofTubes,MAXHITSINCLUSTER , "CurrentListofTubes");
54 
55 */
56 
57  Short_t CurrentListofTubes[ MAXHITSINCLUSTER ]; // current list of tubes forming the cluster;
58 
59 
60 
61 // the following is a necessary initialization every time a new cluster is searched starting from a given seed hit;
62 
63 /*
64  bool tAlreadyConsidered[ number_straws ] ; // for each Stt Straw;
65  memset ( tAlreadyConsidered,false, sizeof( tAlreadyConsidered ));
66  Vec<bool> AlreadyConsidered(tAlreadyConsidered,number_straws,"AlreadyConsidered");
67 */
68 
69  bool AlreadyConsidered[ number_straws ] ; // for each Stt Straw;
70  memset ( AlreadyConsidered,false, sizeof( AlreadyConsidered ));
71 
72  // algorithm of clusterization by proximity only;
73 
74  Short_t nHitsinCluster = 1;
75  Short_t nHitsAnalyzed = 0;
76  ListHitsinCluster[0] = SeedHit;
77  CurrentListofTubes[0] = TubeID[ SeedHit ];
78 
79  // the following variable is to make sure that the number of hits in the cluster
80  // will be <= MAXHITSINCLUSTER;
81  bool go = true;
82 
83  // nParContiguous[i] is the number of contiguous straws to the i-th straw (therefore the dimension
84  // is nParContiguous[4542] since nParContiguous[4542-1] = contiguous of straw n. 4542;
85  // ListParContiguous is the List in TubeID contiguous to a given Tube number;
86  // it MUST be used as follows : ListParContiguous[ j-1 ][i] = the TubeID of the (i+1)th contiguous straw
87  // to the j-th straw (tube number); therefore the dimension is ListParContiguous[4542][6];
88 
89  while(nHitsAnalyzed < nHitsinCluster && go){ // main loop;
90  CurrentTube = CurrentListofTubes[nHitsAnalyzed];
91  AlreadyConsidered[ CurrentTube-1 ] = true;
92  nHitsAnalyzed++;
93  for(i=0;i< nParContiguous[ CurrentTube-1 ] ; i++ ) {
94  // SttStrawOn is -1 if the Tube was not hit, it is the Stt Hit number in opposite case;
95  ContiguousTube = ListParContiguous[ CurrentTube-1 ][i];
96 
97  if( AlreadyConsidered[ ContiguousTube-1 ])continue;
98 
99  if ( SttStrawOn[ ContiguousTube-1 ] > -1 ){
100  if(! InclusionListStt[ SttStrawOn[ ContiguousTube-1] ] ) continue;
101 
102 
103  // CurrentListofHits is the List of Stt HIT numbers belonging to the present cluster;
104  ListHitsinCluster[nHitsinCluster] = SttStrawOn[ ContiguousTube -1 ] ;
105  CurrentListofTubes[nHitsinCluster] = ContiguousTube ;
106  AlreadyConsidered[ ContiguousTube-1 ] = true;
107  nHitsinCluster ++ ;
108  if( nHitsinCluster == MAXHITSINCLUSTER){
109  go = false;
110  break;
111  } // end of if( nHitsinCluster
112  }
113  } // end of for(i=0;i< InOut->n ...
114  } // end of while(nRemaining > 0)
115 
116  return nHitsinCluster;
117 
118 }
Int_t i
Definition: run_full.C:25
const int MAXHITSINCLUSTER
void PndTrkSttClusterFinder::GetClusters ( bool *  InclusionListStt,
Short_t  ListParContiguous[][6],
Short_t *  ListSttParHits,
Short_t *  nParContiguous,
Short_t  nSttParHit,
const Short_t  MAXFOUNDCLUSTERS,
const Short_t  MAXHITSINCLUSTER,
const Short_t  MAXSTTHITS,
const Short_t  NUMBER_STRAWS,
Short_t *  StrawCode,
Short_t *  StrawCode2,
Short_t *  SttStrawOn,
TClonesArray *  SttTubeArray,
Short_t *  TubeID,
Short_t *  ListHitsinCluster,
Short_t &  nFoundClusters,
Short_t *  nHitsinCluster 
)

Definition at line 125 of file PndTrkSttClusterFinder.cxx.

References i.

Referenced by PndTrkTracking2::Exec().

147  {
148 
149 /*
150  bool tinclusion_list_stt[MAXSTTHITS];
151  Vec <bool> inclusion_list_stt(tinclusion_list_stt,MAXSTTHITS,"inclusion_list_stt");
152 */
153  bool inclusion_list_stt[MAXSTTHITS];
154 
155  Short_t i,
156  iParHit,
157  icode,
158  icode2;
159 
160  for(i=0; i<MAXSTTHITS ; i++) {
161  inclusion_list_stt[i]=InclusionListStt[i];
162  }
163 
164  nFoundClusters = 0;
165 
166  for(iParHit=0; iParHit<nSttParHit ; iParHit++) {
167 
168 
169 
170  if(! inclusion_list_stt[ListSttParHits[iParHit]]) continue;
171  icode = StrawCode[TubeID[ListSttParHits[iParHit]]-1];
172  icode2 = StrawCode2[TubeID[ListSttParHits[iParHit]]-1];
173  if(!(
174  icode == 13 || icode == 23 ||
175  icode == 10 ||icode == 20 ||
176  icode == 15 ||icode == 25 ||
177  icode == 12 ||icode == 22 ||
178 
179  icode2 == 13 ||icode2 == 23 ||
180  icode2 == 10 ||icode2 == 20 ||
181  icode2 == 15 ||icode2 == 25 ||
182  icode2 == 12 || icode2 == 22
183  )
184  ) continue; // only seeds at the external boundary of the STT
185 
186  //---------
187 
188  // find the cluster starting from the seed Stt axial hit; the cluster will not have more than MAXHITSINCLUSTER hits;
189 
190 
191 // in the following inclusion list the Stt multiple hits are NOT included NOR the hit already used in a previous cluster;
192 
193  nHitsinCluster[nFoundClusters] = FindTrackPattern(
194 /*
195  tinclusion_list_stt, // input; here it is the exclusion of Stt hits for Stt multiple hits
196  // OR because the hit was already used in another cluster;
197 */
198 
199  inclusion_list_stt, // input; here it is the exclusion of Stt hits for Stt multiple hits
200  // OR because the hit was already used in another cluster;
201 
202  &ListHitsinCluster[nFoundClusters*MAXHITSINCLUSTER], // output
203  ListParContiguous, // input, this is the list of contiguous TubeID ;
204  MAXHITSINCLUSTER, // input;
205  nParContiguous, // input; number of contiguous Stt axial straws to a given Stt axial straw;
206  NUMBER_STRAWS, // input
207  ListSttParHits[iParHit],// input, the Seed Hit;
208  SttStrawOn, // input; SttStrawOn[i] >= 0 --> it is the Stt hit
209  // number corresponding to Stt i-th Tube ID;
210  // SttStrawOn[i] == -1 --> i-th Stt straw NOT hit;
211  TubeID // input
212  );
213  // the found hits cannot partecipate to the formation of any other connected cluster, so exclude them;
214  for(i=0; i< nHitsinCluster[nFoundClusters]; i++) {
215  inclusion_list_stt[ ListHitsinCluster[nFoundClusters*MAXHITSINCLUSTER + i] ]= false;
216  }
217  nFoundClusters++;
218  if( nFoundClusters == MAXFOUNDCLUSTERS) break;
219  } // end of for(iParHit=0; iParHit<nSttParHit ; iParHit++)
220  }
Int_t i
Definition: run_full.C:25
const int MAXFOUNDCLUSTERS
const int MAXHITSINCLUSTER
Short_t FindTrackPattern(bool *InclusionListStt, Short_t *ListHitsinCluster, Short_t(*ListParContiguous)[6], Short_t MAXHITSINCLUSTER, Short_t *nParContiguous, Short_t number_straws, Short_t SeedHit, Short_t *SttStrawOn, Short_t *TubeID)

The documentation for this class was generated from the following files: