test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
sp_tf.h
Go to the documentation of this file.
1 // This C++ header file was automatically generated
2 // by VPPC from a Verilog HDL project.
3 // VPPC web-page: http://www.phys.ufl.edu/~madorsky/vppc/
4 
5 // Author : madorsky
6 // Timestamp : Fri Feb 1 08:50:46 2013
7 
8 #ifndef __sp_tf_h_file__
9 #define __sp_tf_h_file__
10 
11 #include <memory>
12 #include <map>
13 
14 #include <stdio.h>
15 #include <stdlib.h>
16 
22 
26 
29 #include <TMath.h>
30 //#include <TCanvas.h>
31 #include <TLorentzVector.h>
32 
33 #include "TTree.h"
34 #include "TNtuple.h"
35 
36 #include <TStyle.h>
37 #include <TLegend.h>
38 #include <TF1.h>
39 #include <TH2.h>
40 #include <TH1F.h>
41 #include <TFile.h>
43 
46 
47 #include "TFile.h"
48 #include "TH1.h"
50 
51 #include <vector>
52 #include <iostream>
56 
57 #include "Riostream.h"
58 #include "vppc_sim_lib.h"
59 #include "sp.h"
60 
61 
63 
65 
66 #include <stdio.h>
67 #include <stdlib.h>
68 #include <math.h>
69 
71 
72 
74 //#include "L1Trigger/L1TMuonEndCap/plugins/L1TMuonTFAlgorithm.h"
75 
76 
77 using namespace L1TMuon;
78 using namespace edm;
79 using namespace reco;
80 
82 
83 //class sptf : public edm::EDProducer
84 class sptf : public edm::EDProducer
85 {
86  public:
87 
88  sptf(const PSet&);
89  //sptf(std::vector<edm::InputTag>, std::vector<edm::InputTag>);
90  ~sptf() {}
91  sptf() {cout << "Hello there.\n";}
92  void produce(edm::Event&, const edm::EventSetup&);
93  void beginJob();
94  //void beginRun(const edm::Run&, const edm::EventSetup&);
95  //void endRun(const edm::Run&, const edm::EventSetup&);
96  void endJob();
97  //void runEvent();
98 
99  private:
100 
101 
102  vector<int> the_bxValue;
103  vector< vector<int> > the_primSelector;
104  vector< vector<int> > the_inputOrder;
105  vector< vector<int> > the_bx_jitter;
106  vector< vector<int> > the_endcap;
107  vector< vector<int> > the_sector;
108  vector< vector<int> > the_subsector;
109  vector< vector<int> > the_station;
110  vector< vector<int> > the_valid;
111  vector< vector<int> > the_quality;
112  vector< vector<int> > the_pattern;
113  vector< vector<int> > the_wiregroup;
114  vector< vector<int> > the_cscid;
115  vector< vector<int> > the_bend;
116  vector< vector<int> > the_halfstrip;
117 
118  vector<int> the_emuPhi;
119  vector<int> the_emuTheta;
120  vector<int> the_emuPhhit;
121  vector<int> the_emuPhzvl;
122  vector<int> the_emuStrip;
123  vector<int> the_emuStraight;
124  vector<int> the_emuQuality;
125  vector<int> the_emuLayer;
126 
127  vector<int> GetPhi() {return the_emuPhi;}
128  vector<int> GetTheta() {return the_emuTheta;}
129  vector<int> GetPhhit() {return the_emuPhhit;}
130  vector<int> GetPhzvl() {return the_emuPhzvl;}
131  vector<int> GetStrip() {return the_emuStrip;}
132  vector<int> GetStraight() {return the_emuStraight;}
133  vector<int> GetLayer() {return the_emuLayer;}
134  vector<int> GetQuality() {return the_emuQuality;}
135 
136  int count;
137 
138  void defparam();
139  void build();
140  bool built;
141  bool glbl_gsr;
142 
143 
144  //std::vector<ConvertedHit> ConvHits;
145  //edm::ParameterSet LUTparam;
146  //CSCSectorReceiverLUT* srLUTs_[5][2];
147 
148  //these probably need to be killed wherever they exist due to conflict with local "station" variables.
149  // unsigned _station;
150  // unsigned _cscid;
151 
152  static const unsigned _max_ev = 21; // maximum events [hack]
153  static const unsigned _seg_ch = 2; // segments per chamber
154  static const unsigned _bw_ph = 8; // bit widths of ph and th outputs, reduced precision
155  static const unsigned _bw_th = 7; // have to be derived from pattern width on top level
156  static const unsigned _bw_fph = 12; // bit widths of ph and th, full precision
157  static const unsigned _bw_fth = 8;
158  static const unsigned _bw_wg = 7; // wiregroup input bit width (0..111)
159  static const unsigned _bw_ds = 7; // bit width of dblstrip input (max 80 for ME234/1 with double-width strips)
160  static const unsigned _bw_hs = 8; // width of halfstrip input
161  static const unsigned _pat_w_st3 = 3; // pattern half-width for stations 3,4
162  static const unsigned _pat_w_st1 = _pat_w_st3 + 1; // pattern half-width for station 1
163  static const unsigned _full_pat_w_st3 = (1 << (_pat_w_st3+1)) - 1; // number of input bits for stations 3,4
164  static const unsigned _full_pat_w_st1 = (1 << (_pat_w_st1+1)) - 1; // number of input bits for st 1
165  static const unsigned _padding_w_st1 = _full_pat_w_st1 / 2; // width of zero padding for station copies
166  static const unsigned _padding_w_st3 = _full_pat_w_st3 / 2;
167  static const unsigned _red_pat_w_st3 = _pat_w_st3 * 2 + 1; // full pattern widths (aka reduced pattern)
168  static const unsigned _red_pat_w_st1 = _pat_w_st1 * 2 + 1;
169  static const unsigned _th_ch11 = _seg_ch * _seg_ch; // number of th outputs for ME1/1
170  static const unsigned _ph_raw_w = (1 << _pat_w_st3) * 15; // strips per section, calculated so ph pattern would cover +/- 8 deg in st 1
171  static const unsigned _th_raw_w = (1 << _bw_th);
172  static const unsigned _fold = 4; // number of folds for pattern detectors, do not set to 1
173  static const unsigned _bw_q = 4;
174  static const unsigned _bw_addr = 7;
175  static const unsigned _max_drift = 3; // max possible drifttime
176  static const unsigned _bw_phi = 12; // bit widths of precise phi and eta outputs
177  static const unsigned _bw_eta = 7;
178  static const unsigned _ph_hit_w = 44; // (40+4) width of ph raw hits, max coverage +8 to cover possible chamber displacement
179  static const unsigned _ph_hit_w20 = _ph_hit_w; // for 20 deg chambers
180  static const unsigned _ph_hit_w10 = 24; // (20+4) for 10 deg chambers
181  static const unsigned _th_hit_w = 64; // (56+8) width of th raw hits, max coverage +8 to cover possible chamber displacement
182  static const unsigned _th_mem_sz = (1 << _bw_addr);
183  static const unsigned _th_corr_mem_sz = (1 << _bw_addr);
184  static const unsigned _mult_bw = _bw_fph + 11;
185  static const unsigned _zone_overlap = 2;
186  static const unsigned _bwr = 6; // rank width
187  static const unsigned _bpow = 6; // (1 << _bpow) is count of input ranks
188  static const unsigned _cnr = (1 << _bpow); //internal rank count
189  static const unsigned _cnrex = _ph_raw_w; // actual input rank count, must be even
190 
202 
203  // multiplier bit width (phi + factor)
204  // ph zone boundaries for chambers that cover more than one zone
205 // hardcoded boundaries must match boundaries in ph_th_match module
206 
209  // sorter parameters
210 
211  // io
216  // precise parameters
217 /*
218  * wire [bw_phi-1:0] phi [2:0];
219  wire [bw_eta-1:0] eta [2:0];
220  wire [12:0] pt [2:0];
221  wire [2:0] sign;
222  wire [3:0] modeMem [2:0];
223  wire [4:0] etaPT [2:0];
224  wire [2:0] FR;
229  signal_storage r_ini__storage; signal_ r_ini; // reg data for memory or register
230  signal_storage wei__storage; signal_ wei; // write enable for memory or register
231  signal_storage clki__storage; signal_ clki; // write clock
232  // ph_init storage is full-precision now
233 // chamber index is 0..11 to include ME11a and b
234 signal_storage ph_init__storage; signal_ ph_init; // [station][chamber]
235  // arrays below contains values for each chamber
236 // chamber count is ME1=12*2 ME2,3,4=9*3, total 51
237 signal_storage th_init__storage; signal_ th_init; // chamber origins in th
238  signal_storage ph_disp__storage; signal_ ph_disp; // chamber displacements in ph
239  signal_storage th_disp__storage; signal_ th_disp; // chamber displacements in th
240  // event storage
273 
274  signal_storage r_outo__storage; signal_ r_outo; // output data from memory or register
275  // ph quality codes output [zone][key_strip]
288  // numbers of best ranks [zone][num]
290  // best ranks [zone][num]
292  signal_storage ph_match__storage; signal_ ph_match; // matching ph
293  signal_storage th_match__storage; signal_ th_match; // matching th, 2 segments
294  signal_storage th_match11__storage; signal_ th_match11; // matching th for ME11 (station 0 only), 4 segments (due to th duplication)
295  // precise phi and theta of best tracks
296 // [best_track_num]
300  // ph and th deltas from best stations
301 // [best_track_num], last index: [0] - best pair of stations, [1] - second best pair
306  // ranks [best_track_num]
308  // segment IDs
309 // [best_track_num][station 0-3]
317 
339  signal_storage st_cnt__storage; signal_ st_cnt; // station count
349  unsigned k;
350 
351  void init ();
353  std::vector<edm::InputTag> _tpinputs;
354  std::vector<edm::InputTag> _convTrkInputs;
355 };
356 #endif
Definition: sp_tf.h:84
vector< int > GetPhi()
Definition: sp_tf.h:127
signal_storage _wiregroup__storage
Definition: sp_tf.h:264
int i
Definition: DBlmapReader.cc:9
unsigned k
Definition: sp_tf.h:349
vector< int > the_emuPhhit
Definition: sp_tf.h:120
signal_storage j__storage
Definition: sp_tf.h:322
signal_storage _halfstrip__storage
Definition: sp_tf.h:260
vector< int > GetPhzvl()
Definition: sp_tf.h:130
vector< vector< int > > the_bx_jitter
Definition: sp_tf.h:105
signal_storage wiregroup__storage
Definition: sp_tf.h:242
signal_storage code__storage
Definition: sp_tf.h:327
signal_storage ph_ranko__storage
Definition: sp_tf.h:276
signal_storage quality__storage
Definition: sp_tf.h:241
signal_storage _event__storage
Definition: sp_tf.h:252
signal_storage _sector__storage
Definition: sp_tf.h:255
signal_storage ph_q__storage
Definition: sp_tf.h:291
signal_storage hstri__storage
Definition: sp_tf.h:214
signal_storage ph_match__storage
Definition: sp_tf.h:292
vector< int > GetPhhit()
Definition: sp_tf.h:129
signal_storage line__storage
Definition: sp_tf.h:265
signal_storage stat__storage
Definition: sp_tf.h:334
signal_storage kp__storage
Definition: sp_tf.h:348
int kp
signal_storage _station__storage
Definition: sp_tf.h:257
int ipr
Definition: HydjetWrapper.h:68
signal_storage v5__storage
Definition: sp_tf.h:250
signal_storage tphi__storage
Definition: sp_tf.h:268
vector< vector< int > > the_sector
Definition: sp_tf.h:107
signal_storage hstrip__storage
Definition: sp_tf.h:243
bool built
Definition: sp_tf.h:140
sptf()
Definition: sp_tf.h:91
signal_storage th_match__storage
Definition: sp_tf.h:293
signal_storage good_ev__storage
Definition: sp_tf.h:267
signal_storage ph_zone__storage
Definition: sp_tf.h:283
int init
Definition: HydjetWrapper.h:67
signal_storage addri__storage
Definition: sp_tf.h:228
signal_storage end_time__storage
Definition: sp_tf.h:315
vector< int > the_bxValue
Definition: sp_tf.h:102
signal_storage iseg__storage
Definition: sp_tf.h:340
signal_storage pps_csi__storage
Definition: sp_tf.h:226
signal_storage th11__storage
Definition: sp_tf.h:278
vector< vector< int > > the_inputOrder
Definition: sp_tf.h:104
signal_storage pi__storage
Definition: sp_tf.h:321
signal_storage th_match11__storage
Definition: sp_tf.h:294
bool ev
signal_storage bt_delta_ph__storage
Definition: sp_tf.h:302
signal_storage _valid__storage
Definition: sp_tf.h:261
vector< int > the_emuLayer
Definition: sp_tf.h:125
signal_storage st__storage
Definition: sp_tf.h:338
signal_storage r_outo__storage
Definition: sp_tf.h:274
signal_storage iev__storage
Definition: sp_tf.h:328
int ii
Definition: cuy.py:588
vector< int > the_emuTheta
Definition: sp_tf.h:119
signal_storage seli__storage
Definition: sp_tf.h:227
signal_storage bt_sign_ph__storage
Definition: sp_tf.h:304
signal_storage qi__storage
Definition: sp_tf.h:212
signal_storage _cscid__storage
Definition: sp_tf.h:258
void beginJob()
Definition: Breakpoints.cc:15
vector< int > the_emuStraight
Definition: sp_tf.h:123
signal_storage ipr__storage
Definition: sp_tf.h:326
signal_storage found_tr__storage
Definition: sp_tf.h:336
vector< vector< int > > the_halfstrip
Definition: sp_tf.h:116
vector< vector< int > > the_subsector
Definition: sp_tf.h:108
const Double_t pi
vector< int > GetStraight()
Definition: sp_tf.h:132
signal_storage v3__storage
Definition: sp_tf.h:248
signal_storage wgi__storage
Definition: sp_tf.h:213
static const double pts[33]
Definition: Constants.h:30
tuple d
Definition: ztail.py:151
vector< vector< int > > the_station
Definition: sp_tf.h:109
signal_storage patt_vi__storage
Definition: sp_tf.h:284
vector< vector< int > > the_bend
Definition: sp_tf.h:115
signal_storage cpati__storage
Definition: sp_tf.h:215
edm::ParameterSet PSet
Definition: DiagMaker.cc:74
signal_storage iadr__storage
Definition: sp_tf.h:318
signal_storage clki__storage
Definition: sp_tf.h:231
vector< int > GetStrip()
Definition: sp_tf.h:131
signal_storage ph_init__storage
Definition: sp_tf.h:234
signal_storage _endcap__storage
Definition: sp_tf.h:254
signal_storage im__storage
Definition: sp_tf.h:329
signal_storage ir__storage
Definition: sp_tf.h:331
signal_storage begin_time__storage
Definition: sp_tf.h:314
signal_storage ich__storage
Definition: sp_tf.h:345
vector< vector< int > > the_pattern
Definition: sp_tf.h:112
int j
Definition: DBlmapReader.cc:9
signal_storage clctpat__storage
Definition: sp_tf.h:244
signal_storage bt_theta__storage
Definition: sp_tf.h:298
signal_storage zi__storage
Definition: sp_tf.h:341
vector< int > GetTheta()
Definition: sp_tf.h:128
vector< int > the_emuStrip
Definition: sp_tf.h:122
signal_storage th_init__storage
Definition: sp_tf.h:237
signal_storage iz__storage
Definition: sp_tf.h:330
signal_storage ph_num__storage
Definition: sp_tf.h:289
signal_storage patt_ci__storage
Definition: sp_tf.h:286
signal_storage good_ev_cnt__storage
Definition: sp_tf.h:335
signal_storage ist__storage
Definition: sp_tf.h:324
signal_storage isg__storage
Definition: sp_tf.h:346
signal_storage ph_disp__storage
Definition: sp_tf.h:238
signal_storage ibx__storage
Definition: sp_tf.h:344
signal_storage best_tracks__storage
Definition: sp_tf.h:333
signal_storage bt_hi__storage
Definition: sp_tf.h:311
signal_storage ip__storage
Definition: sp_tf.h:343
vector< int > the_emuQuality
Definition: sp_tf.h:124
signal_storage elapsed_time__storage
Definition: sp_tf.h:316
signal_storage ii__storage
Definition: sp_tf.h:347
signal_storage _bx_jitter__storage
Definition: sp_tf.h:253
signal_storage sn__storage
Definition: sp_tf.h:323
~sptf()
Definition: sp_tf.h:90
signal_storage i__storage
Definition: sp_tf.h:320
signal_storage patt_hi__storage
Definition: sp_tf.h:285
signal_storage bt_vi__storage
Definition: sp_tf.h:310
sp uut
Definition: sp_tf.h:352
signal_storage _quality__storage
Definition: sp_tf.h:262
signal_storage v1__storage
Definition: sp_tf.h:246
signal_storage b__storage
Definition: sp_tf.h:270
signal_storage v0__storage
Definition: sp_tf.h:245
signal_storage bt_delta_th__storage
Definition: sp_tf.h:303
double b
Definition: hdecay.h:120
signal_storage th_disp__storage
Definition: sp_tf.h:239
vector< int > GetQuality()
Definition: sp_tf.h:134
signal_storage si__storage
Definition: sp_tf.h:342
vector< vector< int > > the_cscid
Definition: sp_tf.h:114
signal_storage bt_si__storage
Definition: sp_tf.h:313
signal_storage ev__storage
Definition: sp_tf.h:266
signal_storage bt_ci__storage
Definition: sp_tf.h:312
vector< vector< int > > the_endcap
Definition: sp_tf.h:106
vector< vector< int > > the_primSelector
Definition: sp_tf.h:103
signal_storage wei__storage
Definition: sp_tf.h:230
signal_storage pts__storage
Definition: sp_tf.h:272
vector< int > GetLayer()
Definition: sp_tf.h:133
vector< vector< int > > the_quality
Definition: sp_tf.h:111
signal_storage r_ini__storage
Definition: sp_tf.h:229
double a
Definition: hdecay.h:121
signal_storage s__storage
Definition: sp_tf.h:319
signal_storage csi__storage
Definition: sp_tf.h:225
signal_storage phzvl__storage
Definition: sp_tf.h:281
signal_storage v4__storage
Definition: sp_tf.h:249
std::vector< edm::InputTag > _convTrkInputs
Definition: sp_tf.h:354
signal_storage _subsector__storage
Definition: sp_tf.h:256
signal_storage bt_phi__storage
Definition: sp_tf.h:297
signal_storage bt_sign_th__storage
Definition: sp_tf.h:305
vector< int > the_emuPhzvl
Definition: sp_tf.h:121
tuple cout
Definition: gather_cfg.py:145
signal_storage bt_cpattern__storage
Definition: sp_tf.h:299
signal_storage pr_cnt__storage
Definition: sp_tf.h:251
signal_storage ph__storage
Definition: sp_tf.h:277
signal_storage me11a__storage
Definition: sp_tf.h:282
Definition: sp.h:21
signal_storage patt_si__storage
Definition: sp_tf.h:287
int count
Definition: sp_tf.h:136
signal_storage th__storage
Definition: sp_tf.h:279
vector< vector< int > > the_valid
Definition: sp_tf.h:110
signal_storage st_cnt__storage
Definition: sp_tf.h:339
signal_storage _bend__storage
Definition: sp_tf.h:259
signal_storage vl__storage
Definition: sp_tf.h:280
std::vector< edm::InputTag > _tpinputs
Definition: sp_tf.h:353
vector< vector< int > > the_wiregroup
Definition: sp_tf.h:113
signal_storage bt_rank__storage
Definition: sp_tf.h:307
bool glbl_gsr
Definition: sp_tf.h:141
signal_storage in__storage
Definition: sp_tf.h:332
signal_storage found_cand__storage
Definition: sp_tf.h:337
signal_storage v2__storage
Definition: sp_tf.h:247
signal_storage a__storage
Definition: sp_tf.h:269
vector< int > the_emuPhi
Definition: sp_tf.h:118
signal_storage _pattern__storage
Definition: sp_tf.h:263
signal_storage d__storage
Definition: sp_tf.h:271
signal_storage icid__storage
Definition: sp_tf.h:325