FairRoot/PandaRoot
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PndSttStrawMap Class Reference

#include <PndSttStrawMap.h>

Inheritance diagram for PndSttStrawMap:

Public Member Functions

 PndSttStrawMap ()
 
 PndSttStrawMap (TClonesArray *const stt_tube_array)
 
 PndSttStrawMap (const PndSttStrawMap &)=delete
 
PndSttStrawMapoperator= (const PndSttStrawMap &)=delete
 
const vector< int > & GetStrawRow (int sector, int row) const
 
const vector< vector< int > > & GetStrawSector (int sector) const
 
int GetSector (int strawindex) const
 
int FindPhiSector (double phi) const
 
int GetRow (int strawindex) const
 
int GetLeftSector (int sector) const
 
int GetRightSector (int sector) const
 
bool IsEdgeStraw (int strawindex) const
 
int IsSectorBorderStraw (int strawindex) const
 
bool IsAxialStraw (int strawindex) const
 
bool IsSkewedStraw (int strawindex) const
 
bool IsAxialRow (int rowindex) const
 
bool IsSkewedRow (int rowindex) const
 
PndSttTubeGetTube (int strawindex) const
 
void GenerateStrawMap (TClonesArray *const stt_tube_array)
 

Private Member Functions

void GenerateAngles ()
 

Private Attributes

map< int, vector< vector< int > > > fStrawIndex
 
vector< int > fSectorOfStraw
 
vector< int > fRowOfStraw
 
vector< bool > fAxialStraw
 
bool fStrawMapInitialized
 
TClonesArray * fTubeArray
 
vector< double > fSectorStart
 
vector< double > fSectorEnd
 

Detailed Description

Definition at line 22 of file PndSttStrawMap.h.

Constructor & Destructor Documentation

PndSttStrawMap::PndSttStrawMap ( )

Definition at line 21 of file PndSttStrawMap.cxx.

References GenerateAngles().

23 {
25 }
bool fStrawMapInitialized
TClonesArray * fTubeArray
PndSttStrawMap::PndSttStrawMap ( TClonesArray *const  stt_tube_array)

Definition at line 27 of file PndSttStrawMap.cxx.

References GenerateAngles(), and GenerateStrawMap().

29 {
31  GenerateStrawMap(stt_tube_array);
32 }
void GenerateStrawMap(TClonesArray *const stt_tube_array)
bool fStrawMapInitialized
TClonesArray * fTubeArray
PndSttStrawMap::PndSttStrawMap ( const PndSttStrawMap )
delete

Member Function Documentation

int PndSttStrawMap::FindPhiSector ( double  phi) const

Definition at line 98 of file PndSttStrawMap.cxx.

References fSectorEnd, fSectorStart, and Pi.

Referenced by PndMvdSttGemRiemannTrackFinder::AddHits(), and PndMvdSttGemRiemannTrackFinder::GetStrawSector().

99 {
100  int sector = 0;
101  if (phi < 0) phi += 2*TMath::Pi();
102  while ( !( (phi > fSectorStart.at(sector)) && (phi < fSectorEnd.at(sector)) )
103  && !( (sector == 4) && ( (phi > fSectorStart.at(4)) || (phi < fSectorEnd.at(4)) ) ) ) {
104  sector++;
105  sector %= 6;
106  }
107  return sector;
108 }
vector< double > fSectorStart
Double_t Pi
vector< double > fSectorEnd
void PndSttStrawMap::GenerateAngles ( )
private

Definition at line 34 of file PndSttStrawMap.cxx.

References fSectorEnd, fSectorStart, and Pi.

Referenced by PndSttStrawMap().

35 {
36  fSectorStart.push_back(1.57);
37  fSectorEnd.push_back(2.62);
38  fSectorStart.push_back(2.62);
39  fSectorEnd.push_back(-2.62+2*TMath::Pi());
40  fSectorStart.push_back(-2.62+2*TMath::Pi());
41  fSectorEnd.push_back(-1.57+2*TMath::Pi());
42  fSectorStart.push_back(-1.57+2*TMath::Pi());
43  fSectorEnd.push_back(-0.52+2*TMath::Pi());
44  fSectorStart.push_back(-0.52+2*TMath::Pi());
45  fSectorEnd.push_back(0.52);
46  fSectorStart.push_back(0.52);
47  fSectorEnd.push_back(1.57);
48 }
vector< double > fSectorStart
Double_t Pi
vector< double > fSectorEnd
void PndSttStrawMap::GenerateStrawMap ( TClonesArray *const  stt_tube_array)

Definition at line 50 of file PndSttStrawMap.cxx.

References fAxialStraw, fRowOfStraw, fSectorEnd, fSectorOfStraw, fSectorStart, fStrawIndex, fStrawMapInitialized, fTubeArray, PndSttTube::GetPosition(), GetTube(), PndSttTube::GetWireDirection(), i, phi, Pi, and row.

Referenced by PndSttSkewedCombineTask::Init(), PndSttStrawMap(), and PndMvdSttGemRiemannTrackFinder::SetSttTubeArray().

51 {
52  fTubeArray = stt_tube_array;
53 
54  vector<int> currentRow;
55  int sector = 0;
56  int lastsector = 0;
57  int row = 0;
58  fSectorOfStraw.push_back(-1);
59  fRowOfStraw.push_back(-1);
60  fAxialStraw.push_back(false);
61  // cout << "Generating straw map for " << fTubeArray->GetEntriesFast() << " straws." << endl;
62  for (int i = 1; i < fTubeArray->GetEntriesFast(); i++) {
63  // cout << "Finding tube." << endl;
64  PndSttTube* tube = GetTube(i);
65  // cout << "Tube address: " << tube << endl;
66  bool isaxial = (tube->GetWireDirection().Theta() < 0.001);
67  // cout << "Axial Straw: " << isaxial << endl;
68  // cout << "Wire Direction: ";
69 // tube->GetWireDirection().Print();
70  double phi = tube->GetPosition().Phi();
71  // cout << "Phi: " << phi << endl;
72  if (phi < 0) phi += 2*TMath::Pi();
73  // cout << "Checking sector." << endl;
74  while ( !( (phi > fSectorStart.at(sector)) && (phi < fSectorEnd.at(sector)) )
75  && !( (sector == 4) && ( (phi > fSectorStart.at(4)) || (phi < fSectorEnd.at(4)) ) ) ) {
76  sector++;
77  sector %= 6;
78  }
79  if (sector != lastsector) {
80  fStrawIndex[lastsector].push_back(currentRow);
81  currentRow.clear();
82  // cout << "SECTOR COMPLETE: Row " << row << " added to sector " << lastsector << endl;
83  }
84  if (sector < lastsector) row++;
85  lastsector = sector;
86  currentRow.push_back(i);
87  fSectorOfStraw.push_back(sector);
88  fRowOfStraw.push_back(row);
89  fAxialStraw.push_back(isaxial);
90  // cout << "Straw " << i << " added to " << sector << ", " << row << endl;
91  }
92  fStrawIndex[lastsector].push_back(currentRow);
93  // cout << "STT COMPLETE. SECTOR COMPLETE: Row " << row << " added to sector " << lastsector << endl;
94 
95  fStrawMapInitialized = true;
96 }
int row
Definition: anaLmdDigi.C:67
vector< double > fSectorStart
Int_t i
Definition: run_full.C:25
vector< int > fSectorOfStraw
vector< bool > fAxialStraw
PndSttTube * GetTube(int strawindex) const
map< int, vector< vector< int > > > fStrawIndex
TVector3 GetPosition()
Definition: PndSttTube.cxx:87
bool fStrawMapInitialized
vector< int > fRowOfStraw
Double_t Pi
TVector3 GetWireDirection()
Definition: PndSttTube.cxx:107
vector< double > fSectorEnd
TClonesArray * fTubeArray
int PndSttStrawMap::GetLeftSector ( int  sector) const
inline

Definition at line 36 of file PndSttStrawMap.h.

Referenced by PndMvdSttGemRiemannTrackFinder::AssignSkewedSttHits(), and PndMvdSttGemRiemannTrackFinder::AssignSttHits().

36 {return ((sector +1) % 6);}
int PndSttStrawMap::GetRightSector ( int  sector) const
inline

Definition at line 37 of file PndSttStrawMap.h.

Referenced by PndMvdSttGemRiemannTrackFinder::AssignSkewedSttHits(), and PndMvdSttGemRiemannTrackFinder::AssignSttHits().

37 {return ((sector +5) % 6);}
int PndSttStrawMap::GetRow ( int  strawindex) const
inline

Definition at line 35 of file PndSttStrawMap.h.

References fRowOfStraw.

Referenced by PndMvdSttGemRiemannTrackFinder::CheckBoarderHitsStt(), PndSttSkewedCombineTask::Exec(), IsEdgeStraw(), and IsSectorBorderStraw().

35 {return fRowOfStraw.at(strawindex);}
vector< int > fRowOfStraw
int PndSttStrawMap::GetSector ( int  strawindex) const
inline
const vector<int>& PndSttStrawMap::GetStrawRow ( int  sector,
int  row 
) const
inline

Definition at line 31 of file PndSttStrawMap.h.

References fStrawIndex.

Referenced by IsAxialRow(), IsEdgeStraw(), IsSectorBorderStraw(), and IsSkewedRow().

31 {return (fStrawIndex.find(sector))->second.at(row);}
int row
Definition: anaLmdDigi.C:67
map< int, vector< vector< int > > > fStrawIndex
const vector<vector<int> >& PndSttStrawMap::GetStrawSector ( int  sector) const
inline

Definition at line 32 of file PndSttStrawMap.h.

References fStrawIndex.

32 {return (fStrawIndex.find(sector))->second;}
map< int, vector< vector< int > > > fStrawIndex
PndSttTube* PndSttStrawMap::GetTube ( int  strawindex) const
inline

Definition at line 48 of file PndSttStrawMap.h.

References fTubeArray.

Referenced by GenerateStrawMap().

48 {return (PndSttTube*)fTubeArray->At(strawindex);}
TClonesArray * fTubeArray
bool PndSttStrawMap::IsAxialRow ( int  rowindex) const

Definition at line 137 of file PndSttStrawMap.cxx.

References GetStrawRow(), and IsAxialStraw().

138 {
139  //only works if all straws in one row are of the same type
140  //which is the case for the current geometry
141  return IsAxialStraw(GetStrawRow(0, rowindex).at(0));
142 }
const vector< int > & GetStrawRow(int sector, int row) const
bool IsAxialStraw(int strawindex) const
bool PndSttStrawMap::IsAxialStraw ( int  strawindex) const
inline

Definition at line 42 of file PndSttStrawMap.h.

References fAxialStraw.

Referenced by IsAxialRow().

42 {return fAxialStraw.at(strawindex);}
vector< bool > fAxialStraw
bool PndSttStrawMap::IsEdgeStraw ( int  strawindex) const

Definition at line 110 of file PndSttStrawMap.cxx.

References GetRow(), GetSector(), and GetStrawRow().

Referenced by PndSttCellTrackFinderData::FindHitNeighborsEventBased(), and PndSttCellTrackFinderData::FindHitNeighborsTimeBased().

111 {
112  if (GetRow(strawindex) == 0) return true;
113  int endstraw = 0; //there is no straw index 0
114  switch (GetSector(strawindex)) {
115  case 0: endstraw = GetStrawRow(GetSector(strawindex), GetRow(strawindex)).front();
116  break;
117  case 2: endstraw = GetStrawRow(GetSector(strawindex), GetRow(strawindex)).back();
118  break;
119  case 3: endstraw = GetStrawRow(GetSector(strawindex), GetRow(strawindex)).front();
120  break;
121  case 5: endstraw = GetStrawRow(GetSector(strawindex), GetRow(strawindex)).back();
122  break;
123  default: return false;
124  };
125  return (strawindex == endstraw);
126 }
int GetSector(int strawindex) const
const vector< int > & GetStrawRow(int sector, int row) const
int GetRow(int strawindex) const
int PndSttStrawMap::IsSectorBorderStraw ( int  strawindex) const

Definition at line 128 of file PndSttStrawMap.cxx.

References GetRow(), GetSector(), and GetStrawRow().

Referenced by PndMvdSttGemRiemannTrackFinder::AssignSttHits().

129 {
130  int endstrawcw = GetStrawRow(GetSector(strawindex), GetRow(strawindex)).front();
131  int endstrawccw = GetStrawRow(GetSector(strawindex), GetRow(strawindex)).back();
132  if (strawindex == endstrawcw) return -1;
133  if (strawindex == endstrawccw) return 1;
134  return 0;
135 }
int GetSector(int strawindex) const
const vector< int > & GetStrawRow(int sector, int row) const
int GetRow(int strawindex) const
bool PndSttStrawMap::IsSkewedRow ( int  rowindex) const

Definition at line 144 of file PndSttStrawMap.cxx.

References GetStrawRow(), and IsSkewedStraw().

145 {
146  //only works if all straws in one row are of the same type
147  //which is the case for the current geometry
148  return IsSkewedStraw(GetStrawRow(0, rowindex).at(0));
149 }
const vector< int > & GetStrawRow(int sector, int row) const
bool IsSkewedStraw(int strawindex) const
bool PndSttStrawMap::IsSkewedStraw ( int  strawindex) const
inline
PndSttStrawMap& PndSttStrawMap::operator= ( const PndSttStrawMap )
delete

Member Data Documentation

vector<bool> PndSttStrawMap::fAxialStraw
private

Definition at line 59 of file PndSttStrawMap.h.

Referenced by GenerateStrawMap(), IsAxialStraw(), and IsSkewedStraw().

vector<int> PndSttStrawMap::fRowOfStraw
private

Definition at line 58 of file PndSttStrawMap.h.

Referenced by GenerateStrawMap(), and GetRow().

vector<double> PndSttStrawMap::fSectorEnd
private

Definition at line 65 of file PndSttStrawMap.h.

Referenced by FindPhiSector(), GenerateAngles(), and GenerateStrawMap().

vector<int> PndSttStrawMap::fSectorOfStraw
private

Definition at line 57 of file PndSttStrawMap.h.

Referenced by GenerateStrawMap(), and GetSector().

vector<double> PndSttStrawMap::fSectorStart
private

Definition at line 64 of file PndSttStrawMap.h.

Referenced by FindPhiSector(), GenerateAngles(), and GenerateStrawMap().

map<int, vector< vector<int> > > PndSttStrawMap::fStrawIndex
private

Definition at line 56 of file PndSttStrawMap.h.

Referenced by GenerateStrawMap(), GetStrawRow(), and GetStrawSector().

bool PndSttStrawMap::fStrawMapInitialized
private

Definition at line 60 of file PndSttStrawMap.h.

Referenced by GenerateStrawMap().

TClonesArray* PndSttStrawMap::fTubeArray
private

Definition at line 62 of file PndSttStrawMap.h.

Referenced by GenerateStrawMap(), and GetTube().


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