CMS 3D CMS Logo

CylCowWLids.cc
Go to the documentation of this file.
1 //---------------------------
2 // Cylindrical Cow with Lids
3 //---------------------------
4 //
5 // Intended coverage: |eta| < 2.4 with D_z_beam_spot = +-3 cm (3 sigma)
6 // B-layer extends to 2.55.
7 // Layers 1 and 2 have somewhat longer barrels. It is assumed
8 // those will be needed / used for seed finding.
9 //
10 // Layers 3 - 9:
11 // Barrel: 0.0 - 1.0
12 // Transition: 1.0 - 1.4
13 // Endcap: 1.4 - 2.4
14 //
15 // Run root test/CylCowWLids.C to get a plot and dumps of
16 // edge coordinates and etas.
17 //
18 // Eta partitions for B / T / EC
19 
23 
24 #include <cmath>
25 
26 using namespace mkfit;
27 
28 namespace {
29  float getTheta(float r, float z) { return std::atan2(r, z); }
30 
31  float getEta(float r, float z) { return -1.0f * std::log(std::tan(getTheta(r, z) / 2.0f)); }
32 
33  // float getEta(float theta)
34  // {
35  // return -1.0f * std::log( std::tan(theta/2.0f) );
36  // }
37 
38  float getTgTheta(float eta) { return std::tan(2.0 * std::atan(std::exp(-eta))); }
39 
40  class CylCowWLidsCreator {
41  TrackerInfo& m_trkinfo;
42 
43  static constexpr float m_det_half_thickness = 0.005; // for 100 micron total
44 
45  //------------------------------------------------------------------------------
46 
47  void add_barrel(int lid, float r, float z, float eta) {
48  // printf("Adding barrel layer r=%.3f z=%.3f eta_t=%.3f\n", r, z, eta);
49 
50  LayerInfo& li = m_trkinfo.layer_nc(lid);
51 
53 
54  li.set_limits(r - m_det_half_thickness, r + m_det_half_thickness, -z, z);
55  li.set_propagate_to(li.rin());
56 
57  li.set_q_bin(2.0);
58  }
59 
60  void add_barrel_r_eta(int lid, float r, float eta) {
61  float z = r / getTgTheta(eta);
62 
63  add_barrel(lid, r, z, eta);
64  }
65 
66  void add_barrel_r_z(int lid, float r, float z) {
67  float eta = getEta(r, z);
68 
69  add_barrel(lid, r, z, eta);
70  }
71 
72  void add_endcap(int lid, float r, float z, float eta) {
73  float r_end = z * getTgTheta(eta);
74 
75  // printf("Adding endcap layer r=%.3f z=%.3f r_l=%.3f eta_l=%.3f\n", r, z, r_end, eta);
76 
77  {
78  LayerInfo& li = m_trkinfo.layer_nc(lid);
79 
81 
82  li.set_limits(r_end, r, z - m_det_half_thickness, z + m_det_half_thickness);
83  li.set_propagate_to(li.zmin());
84 
85  li.set_q_bin(1.5);
86  }
87  {
88  lid += 9;
89  LayerInfo& li = m_trkinfo.layer_nc(lid);
90 
92 
93  li.set_limits(r_end, r, -z - m_det_half_thickness, -z + m_det_half_thickness);
94  li.set_propagate_to(li.zmax());
95 
96  li.set_q_bin(1.5);
97  }
98  }
99 
100  //------------------------------------------------------------------------------
101 
102  public:
103  CylCowWLidsCreator(TrackerInfo& ti) : m_trkinfo(ti) {}
104 
105  void FillTrackerInfo() {
106  m_trkinfo.create_layers(10, 9, 9);
107 
108  // Actual coverage for tracks with z = 3cm is 2.4
109  float full_eta = 2.5;
110  float full_eta_pix_0 = 2.55; // To account for BS z-spread
111  float full_eta_ec_in[] = {0, 2.525, 2.515};
112 
113  float pix_0 = 4, pix_sep = 6;
114  float pix_z0 = 24, pix_zgrow = 6;
115 
116  float sct_sep = 10;
117  float sct_0 = pix_0 + 2 * pix_sep + sct_sep;
118  float sct_zgrow = 10;
119  float sct_z0 = pix_z0 + 2 * pix_zgrow + sct_zgrow;
120 
121  float pix_ec_zgap = 2;
122  float pix_ec_rextra = 2;
123 
124  float sct_ec_zgap = 4;
125  float sct_ec_rextra = 4;
126 
127  add_barrel_r_eta(0, pix_0, full_eta_pix_0);
128 
129  add_barrel_r_z(1, pix_0 + 1 * pix_sep, pix_z0 + 1 * pix_zgrow);
130  add_barrel_r_z(2, pix_0 + 2 * pix_sep, pix_z0 + 2 * pix_zgrow);
131  add_barrel_r_z(3, pix_0 + 3 * pix_sep, pix_z0 + 3 * pix_zgrow);
132 
133  for (int i = 0; i < 6; ++i) {
134  add_barrel_r_z(4 + i, sct_0 + i * sct_sep, sct_z0 + i * sct_zgrow);
135  }
136 
137  for (int i = 1; i < 4; ++i) {
138  add_endcap(9 + i, pix_0 + i * pix_sep + pix_ec_rextra, pix_z0 + i * pix_zgrow + pix_ec_zgap, full_eta_ec_in[i]);
139  }
140  for (int i = 0; i < 6; ++i) {
141  add_endcap(13 + i, sct_0 + i * sct_sep + sct_ec_rextra, sct_z0 + i * sct_zgrow + sct_ec_zgap, full_eta);
142  }
143  // + endcap disks at -z
144  }
145  };
146 
147  //============================================================================
148 
149  void Create_CylCowWLids(TrackerInfo& ti, IterationsInfo& ii, bool verbose) {
150  PropagationConfig& pconf = ti.prop_config_nc();
159  pconf.apply_tracker_info(&ti);
160 
161  CylCowWLidsCreator creator(ti);
162 
163  creator.FillTrackerInfo();
164 
165  if (verbose) {
166  printf("==========================================================================================\n");
167  }
168  printf("Create_CylCowWLids -- creation complete\n");
169 
170  if (verbose) {
171  printf("==========================================================================================\n");
172  for (int ii = 0; ii < ti.n_layers(); ++ii)
173  ti.layer(ii).print_layer();
174  printf("==========================================================================================\n");
175  }
176  }
177 
178 } // namespace
179 
180 void* TrackerInfoCreator_ptr = (void*)Create_CylCowWLids;
float rin() const
Definition: TrackerInfo.h:63
PropagationFlags forward_fit_pflags
bool verbose
void set_q_bin(float qb)
Definition: TrackerInfo.h:56
void print_layer() const
Definition: TrackerInfo.cc:55
PropagationFlags backward_fit_pflags
PropagationConfig & prop_config_nc()
Definition: TrackerInfo.h:213
float getTheta(float r, float z)
Definition: Hit.h:36
float getEta(float r, float z)
Definition: Hit.h:38
LayerInfo & layer_nc(int l)
Definition: TrackerInfo.h:200
float float float z
float zmax() const
Definition: TrackerInfo.h:67
PropagationFlags finding_inter_layer_pflags
float zmin() const
Definition: TrackerInfo.h:66
void set_limits(float r1, float r2, float z1, float z2)
Definition: TrackerInfo.cc:26
void set_layer_type(LayerType_e t)
Definition: TrackerInfo.h:50
int n_layers() const
Definition: TrackerInfo.h:198
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
PropagationFlags seed_fit_pflags
double f[11][100]
void create_layers(int n_brl, int n_ec_pos, int n_ec_neg)
Definition: TrackerInfo.cc:77
void * TrackerInfoCreator_ptr
Definition: CylCowWLids.cc:180
PropagationFlags pca_prop_pflags
ii
Definition: cuy.py:589
const LayerInfo & layer(int l) const
Definition: TrackerInfo.h:199
void apply_tracker_info(const TrackerInfo *ti)
Definition: TrackerInfo.cc:13
void set_propagate_to(float pto)
Definition: TrackerInfo.h:54
PropagationFlags finding_intra_layer_pflags