CMS 3D CMS Logo

EmulatorClasses.h
Go to the documentation of this file.
1 #ifndef __EmulatorClasses_
2 #define __EmulatorClasses_
3 
6 
7 typedef std::vector<std::vector<PhiMemoryImage>> ImageCollector;
8 typedef std::vector<std::vector<int>> Code;
9 typedef std::vector<std::vector<std::vector<int>>> BXHold;
10 
11 //
12 
13 
15 
16  public:
17 
18  void SetValues(int phi,int theta,int ph_hit,int phzvl,int station,int sub,int id,int quality,int pattern,int wire,int strip,int BX){
19  _ph = phi;_th = theta;_phit = ph_hit;_phzvl = phzvl;_sta = station;_sub = sub;_id = id;_qual = quality;_patt = pattern;
20  _wire = wire;_strip = strip;_zhit = -999;_bx = BX;_th2 = -999;
21  };
22 
23  void SetNull(){
24  _ph = -999;_th = -999;_th2 = -999;_phit = -999;_phzvl = -999;_sta = -999;_sub = -999;_id = -999;_qual = -999;_patt = 0;
25  _wire = -999;_strip = -999;_zhit = -999;
26  };
27 
28  void SetId(int id){
29  _id = id;
30  };
31 
32  void SetStrip(int strip){
33  _strip = strip;
34  };
35 
36  void SetZhit(int zhit){_zhit = zhit;};
37  void SetTheta(int theta){_th = theta;};
38  void SetTheta2(int theta2){_th2 = theta2;};
40  void SetSectorIndex(int sectorIndex){_sectorIndex = sectorIndex;};
42  void AddTheta(int theta){_thetas.push_back(theta);};
43  void SetZoneWord(int zword){_ZoneWord = zword;};
44 
45  int Phi(){return _ph;};
46  int Theta(){return _th;};
47  int Theta2(){return _th2;};
48  int Ph_hit(){return _phit;};
49  int Phzvl(){return _phzvl;};
50  int Station(){return _sta;};
51  int Sub(){return _sub;};
52  int Id(){return _id;};
53  int Quality(){return _qual;};
54  int Pattern(){return _patt;};
55  int Wire(){return _wire;};
56  int Strip(){return _strip;};
57  int Zhit(){return _zhit;};
58  int BX(){return _bx;};
59  int SectorIndex(){return _sectorIndex;};
60  int IsNeighbor(){return _isNeighbor;};
62  std::vector<int> AllThetas(){return _thetas;};
63  int ZoneWord(){return _ZoneWord;};
64 
65  private:
68  std::vector<int> _thetas;
69 };
70 
71 struct ZonesOutput{
72  std::vector<PhiMemoryImage> zone;
73  std::vector<ConvertedHit> convertedhits;
74 };
75 
77  Code rank, layer,straightness, bxgroup;
78 };
79 
82  std::vector<ConvertedHit> hits;
83  // int bxgroup;
84 };
85 
86 struct Wier{
87  int rank, strip;
88 };
89 
90 class Winner{
91 
92  public:
93  //Default Constructor: rank & strip = 0///
94  Winner(){_rank = 0;_strip = 0;};
95 
96  int Rank(){return _rank;}
97  int Strip(){return _strip;}
98  int BXGroup(){return _bxgroup;}
99 
100  void SetValues(int rank, int strip){
101  _rank = rank;
102  _strip = strip;
103  }
104  void SetRank(int rank){
105  _rank = rank;
106  }
107 
108  void SetBXGroup(int bxgroup){
109  _bxgroup = bxgroup;
110  }
111 
112  private:
113  int _rank, _strip, _bxgroup;
114 
115 };
116 
118 
119  public:
120  void SetHits(std::vector<ConvertedHit> hits){_hits = hits;};
121  void SetWinners(std::vector<std::vector<Winner>> winners){_winners = winners;};
122  void SetValues(std::vector<std::vector<Winner>> winners, std::vector<ConvertedHit> hits){_winners = winners;_hits = hits;};
123 
124  std::vector<ConvertedHit> Hits(){return _hits;};
125  std::vector<std::vector<Winner>> Winners(){return _winners;};
126 
127  private:
128  std::vector<ConvertedHit> _hits;
129  std::vector<std::vector<Winner>> _winners;
130 
131 };
132 
133 typedef struct ThOutput { ConvertedHit x[4][3][4][2]; } ThOutput;
134 typedef struct ThOutput2 { int x[4][3][4][2]; } ThOutput2;
135 typedef struct PhOutput { ConvertedHit x[4][3][4]; } PhOutput;
137 
138  public:
139  void SetHits(std::vector<ConvertedHit> hits){_hits = hits;};
140  void SetWinners(std::vector<std::vector<Winner>> winners){_winners = winners;};
141  void SetThOut(ThOutput th_output){_th_output = th_output;};
142  void SetPhOut(PhOutput ph_output){_ph_output = ph_output;};
143  void SetSegment(std::vector<int> segment){_segment = segment;};
144  void SetValues(ThOutput th_output,PhOutput ph_output,std::vector<ConvertedHit> hits,std::vector<std::vector<Winner>> winners,std::vector<int> segment){
145  _th_output = th_output;
146  _ph_output = ph_output;
147  _hits = hits;
148  _winners = winners;
149  _segment = segment;
150  }
151 
153  _th_output2 = t2;
154  }
155 
156  std::vector<ConvertedHit> Hits(){return _hits;};
157  std::vector<std::vector<Winner>> Winners(){return _winners;};
158  ThOutput ThetaMatch(){return _th_output;};
159  ThOutput2 TMatch2(){return _th_output2;};
160  PhOutput PhiMatch(){return _ph_output;};
161  std::vector<int> Segment(){return _segment;};
162 
163  private:
164  std::vector<ConvertedHit> _hits;
165  std::vector<std::vector<Winner>> _winners;
169  std::vector<int> _segment;
170 
171 };
172 
174 
175  public:
176  void SetNull(){_Phi = -999;_Theta = -999;};
177  void SetValues(MatchingOutput Mout, std::vector<std::vector<int>> Deltas, int Phi, int Theta, Winner winner){
178  _Mout = Mout;_Deltas = Deltas;_Phi = Phi; _Theta = Theta;_winner = winner;
179  }
180 
181  MatchingOutput GetMatchOut(){return _Mout;};
182  std::vector<std::vector<int>> Deltas(){return _Deltas;};
183  int Phi(){return _Phi;};
184  int Theta(){return _Theta;};
185  Winner GetWinner(){return _winner;};
186 
187  private:
188  MatchingOutput _Mout;
189  std::vector<std::vector<int>> _Deltas;
190  int _Phi, _Theta;
192 
193 };
194 // 3 BX, 4 zones, 3 winners
195 typedef struct DeltaOutArr2 { DeltaOutput x[4][3]; } DeltaOutArr2;
196 typedef struct DeltaOutArr3 { DeltaOutput x[3][4][3]; } DeltaOutArr3;
197 
198 struct BTrack{
199 
200 BTrack(): phi(0),theta(0),clctpattern(0){}
201 
203  int phi;
204  int theta;
206  std::vector<std::vector<int>> deltas;
207  std::vector<ConvertedHit> AHits;
208 };
209 
210 #endif
DeltaOutput Deltas(MatchingOutput Mout, int zone, int winner)
Definition: Deltas.h:14
MatchingOutput GetMatchOut()
struct PhOutput PhOutput
void SetPhOut(PhOutput ph_output)
ThOutput ThetaMatch()
std::vector< std::vector< Winner > > Winners()
int Rank()
std::vector< std::vector< int > > Code
void SetNeighbor(int neighbor)
std::vector< int > _thetas
Geom::Theta< T > theta() const
int BXGroup()
void SetSegment(std::vector< int > segment)
Winner winner
void SetZoneWord(int zword)
void SetBXGroup(int bxgroup)
bool neighbor(int endcap, int sector, int SectIndex, int id, int sub, int station)
ThOutput2 TMatch2()
std::vector< ConvertedHit > Hits()
std::vector< std::vector< Winner > > Winners()
std::vector< std::vector< int > > deltas
void SetTheta(int theta)
void SetValues(ThOutput th_output, PhOutput ph_output, std::vector< ConvertedHit > hits, std::vector< std::vector< Winner >> winners, std::vector< int > segment)
void SetValues(std::vector< std::vector< Winner >> winners, std::vector< ConvertedHit > hits)
std::vector< PhiMemoryImage > zone
void SetStrip(int strip)
struct ThOutput ThOutput
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:16
std::vector< std::vector< std::vector< int > > > BXHold
void SetTheta2(int theta2)
std::vector< ConvertedHit > convertedhits
void SetRank(int rank)
std::vector< ConvertedHit > AHits
void SetTP(L1TMuon::TriggerPrimitive tp)
std::vector< std::vector< int > > _Deltas
ThOutput2 _th_output2
std::vector< int > _segment
struct DeltaOutArr2 DeltaOutArr2
std::vector< int > AllThetas()
L1TMuon::TriggerPrimitive TP()
void SetId(int id)
struct ThOutput2 ThOutput2
Winner GetWinner()
void SetValues(MatchingOutput Mout, std::vector< std::vector< int >> Deltas, int Phi, int Theta, Winner winner)
void SetHits(std::vector< ConvertedHit > hits)
void SetWinners(std::vector< std::vector< Winner >> winners)
std::vector< std::vector< Winner > > _winners
struct DeltaOutArr3 DeltaOutArr3
std::vector< int > Segment()
int Strip()
void setM2(ThOutput2 t2)
void AddTheta(int theta)
PhOutput PhiMatch()
void SetZhit(int zhit)
void SetValues(int phi, int theta, int ph_hit, int phzvl, int station, int sub, int id, int quality, int pattern, int wire, int strip, int BX)
std::vector< std::vector< int > > Deltas()
int clctpattern
int strip
void SetWinners(std::vector< std::vector< Winner >> winners)
void SetHits(std::vector< ConvertedHit > hits)
L1TMuon::TriggerPrimitive _tp
void SetThOut(ThOutput th_output)
std::vector< ConvertedHit > Hits()
QualityOutput detected
std::vector< ConvertedHit > hits
std::vector< std::vector< Winner > > _winners
void SetSectorIndex(int sectorIndex)
void SetValues(int rank, int strip)
std::vector< std::vector< PhiMemoryImage > > ImageCollector