FairRoot/PandaRoot
PndTrkCategorizeStt.cxx
Go to the documentation of this file.
1 #include "PndTrkCategorizeStt.h"
2 
3 #include "PndSttTube.h"
4 #include "PndTrkConstants.h"
5 
6 #include "TClonesArray.h"
7 #include "TVector3.h"
8 
9 #include <stdlib.h>
10 #include <iostream>
11 #include <cmath>
12 
13 using namespace std;
14 
15 
18 
21 
22 //-----------------------------------------------------------
23 
25  // in this geametry there are 4542 Stt Straws (axial and skew);
26  const Short_t NUMBER_STRAWS, // number of Stt Straws in total;
27  TClonesArray *SttTubeArray, // input; array of the Stt tubes;
28  Short_t &nAxialOuterRight, // output; number of axial Stt, outer, on the right (looking into the beam);
29  Short_t &nAxialInnerRight, // output; number of axial Stt, inner, on the right (looking into the beam);
30  Short_t &nAxialOuterLeft, // output; number of axial Stt, outer, on the left (looking into the beam);
31  Short_t &nAxialInnerLeft, // output; number of axial Stt, inner, on the left (looking into the beam);
32 
33  Short_t *ListAxialOuterRight, // output; list of axial Stt, outer, on the right (looking into the beam);
34  Short_t *ListAxialInnerRight, // output; list of axial Stt, inner, on the lright (looking into the beam);
35  Short_t *ListAxialOuterLeft, // output; list of axial Stt, outer, on the left (looking into the beam);
36  Short_t *ListAxialInnerLeft, // output; list of axial Stt, inner, on the left (looking into the beam);
37 
38  Short_t &nSkewRight, // output; number of skew Stt, on the right (looking into the beam);
39  Short_t &nSkewLeft, // output; number of skew Stt, on the right (looking into the beam);
40  Short_t *ListSkewRight, // output; list of axial Stt, inner, on the lright (looking into the beam);
41  Short_t *ListSkewLeft // output; list of axial Stt, outer, on the left (looking into the beam);
42  )
43  {
44  int i;
45 
46 
47  double
48  r2,
49  x[NUMBER_STRAWS],
50  //Xwiredirection[NUMBER_STRAWS], //[R.K.02/2017] Unused variable?
51  y[NUMBER_STRAWS],
52  //Ywiredirection[NUMBER_STRAWS], //[R.K.02/2017] Unused variable?
53  //z[NUMBER_STRAWS], //[R.K.02/2017] Unused variable?
54  Zwiredirection[NUMBER_STRAWS];
55 
56  PndSttTube *pSttTube;
57 
58 
59  nAxialOuterRight = 0;
60  nAxialOuterLeft = 0;
61  nAxialInnerRight = 0;
62  nAxialInnerLeft = 0;
63  nSkewRight = 0;
64  nSkewLeft = 0;
65 
66 
67  // the total n. of STT straws is NUMBER_STRAWS;
68  for (i=1;i<= NUMBER_STRAWS; i++){
69  pSttTube = (PndSttTube *) SttTubeArray->At(i);
70  x[i-1] = pSttTube->GetPosition().X();
71  y[i-1] = pSttTube->GetPosition().Y();
72  //z[i-1] = pSttTube->GetPosition().Z(); //[R.K.02/2017] Unused variable?
73  //Xwiredirection[i-1] = pSttTube->GetWireDirection().X(); //[R.K.02/2017] Unused variable?
74  //Ywiredirection[i-1] = pSttTube->GetWireDirection().Y(); //[R.K.02/2017] Unused variable?
75  Zwiredirection[i-1] = pSttTube->GetWireDirection().Z();
76  }
77 
78 
79  for (i=0;i< NUMBER_STRAWS; i++){
80  if( fabs(Zwiredirection[i] -1.) > 1.e-5){
81  // skew straws;
82  if( x[i] < 0. ){
83  // left skew straws;
84  ListSkewLeft[nSkewLeft] = i+1;
85  nSkewLeft++;
86  } else {
87  // right skew straws;
88  ListSkewRight[nSkewRight] = i+1;
89  nSkewRight++;
90  }
91  } else{
92  r2 = x[i]*x[i] + y[i]*y[i];
93  // axial straws;
94  if( x[i] < 0. ){
95  // left axial straws;
96 
98  // inner;
99  ListAxialInnerLeft[nAxialInnerLeft] = i+1;
100  nAxialInnerLeft++;
101  } else {
102  // outer;
103  ListAxialOuterLeft[nAxialOuterLeft] = i+1;
104  nAxialOuterLeft++;
105  } // end of if( r2 < APOTEMAMINOUTERPARSTRAW * APOTEMAMINOUTERPARSTRAW )
106 
107  } else {
108  // right axial straws;
109 
111  // inner;
112  ListAxialInnerRight[nAxialInnerRight] = i+1;
113  nAxialInnerRight++;
114  } else {
115  // outer;
116  ListAxialOuterRight[nAxialOuterRight] = i+1;
117  nAxialOuterRight++;
118  } // end of if( r2 < APOTEMAMINOUTERPARSTRAW * APOTEMAMINOUTERPARSTRAW )
119  } // end of if( x[i] < 0. )
120 
121  } // end of if( fabs(Zwiredirection[i] -1.) > 1.e-5)
122 
123 
124  } // end of for (i=0;i< NUMBER_STRAWS; i++)
125 
126  }
127 //------------------ end function PndTrkCategorizeStt::CategorizeStt
128 
129 
130 
131 
133 
void CategorizeStt(const Short_t NUMBER_STRAWS, TClonesArray *SttTubeArray, Short_t &nAxialOuterRight, Short_t &nAxialInnerRight, Short_t &nAxialOuterLeft, Short_t &nAxialInnerLeft, Short_t *ListAxialOuterRight, Short_t *ListAxialInnerRight, Short_t *ListAxialOuterLeft, Short_t *ListAxialInnerLeft, Short_t &nSkewRight, Short_t &nSkewLeft, Short_t *ListSkewRight, Short_t *ListSkewLeft)
Int_t i
Definition: run_full.C:25
TVector3 GetPosition()
Definition: PndSttTube.cxx:87
const Double_t APOTEMAMINOUTERPARSTRAW
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
Double_t x
ClassImp(PndAnaContFact)
Double_t y
TVector3 GetWireDirection()
Definition: PndSttTube.cxx:107
double r2