Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-07 05:53:44

0001 //---------------------------
0002 // Cylindrical Cow with Lids
0003 //---------------------------
0004 //
0005 // Intended coverage: |eta| < 2.4 with D_z_beam_spot = +-3 cm (3 sigma)
0006 // B-layer extends to 2.55.
0007 // Layers 1 and 2 have somewhat longer barrels. It is assumed
0008 // those will be needed / used for seed finding.
0009 //
0010 // Layers 3 - 9:
0011 //   Barrel:     0.0 - 1.0
0012 //   Transition: 1.0 - 1.4
0013 //   Endcap:     1.4 - 2.4
0014 //
0015 // Run root test/CylCowWLids.C to get a plot and dumps of
0016 // edge coordinates and etas.
0017 //
0018 // Eta partitions for B / T / EC
0019 
0020 #include "RecoTracker/MkFitCore/interface/Config.h"
0021 #include "RecoTracker/MkFitCore/standalone/ConfigStandalone.h"
0022 #include "RecoTracker/MkFitCore/interface/TrackerInfo.h"
0023 
0024 #include <cmath>
0025 
0026 using namespace mkfit;
0027 
0028 namespace {
0029   float getTheta(float r, float z) { return std::atan2(r, z); }
0030 
0031   float getEta(float r, float z) { return -1.0f * std::log(std::tan(getTheta(r, z) / 2.0f)); }
0032 
0033   // float getEta(float theta)
0034   // {
0035   //   return -1.0f * std::log( std::tan(theta/2.0f) );
0036   // }
0037 
0038   float getTgTheta(float eta) { return std::tan(2.0 * std::atan(std::exp(-eta))); }
0039 
0040   class CylCowWLidsCreator {
0041     TrackerInfo& m_trkinfo;
0042 
0043     static constexpr float m_det_half_thickness = 0.005;  // for 100 micron total
0044 
0045     //------------------------------------------------------------------------------
0046 
0047     void add_barrel(int lid, float r, float z, float eta) {
0048       // printf("Adding barrel layer r=%.3f z=%.3f eta_t=%.3f\n", r, z, eta);
0049 
0050       LayerInfo& li = m_trkinfo.layer_nc(lid);
0051 
0052       li.set_layer_type(LayerInfo::Barrel);
0053 
0054       li.set_limits(r - m_det_half_thickness, r + m_det_half_thickness, -z, z);
0055       li.set_propagate_to(li.rin());
0056 
0057       li.set_q_bin(2.0);
0058     }
0059 
0060     void add_barrel_r_eta(int lid, float r, float eta) {
0061       float z = r / getTgTheta(eta);
0062 
0063       add_barrel(lid, r, z, eta);
0064     }
0065 
0066     void add_barrel_r_z(int lid, float r, float z) {
0067       float eta = getEta(r, z);
0068 
0069       add_barrel(lid, r, z, eta);
0070     }
0071 
0072     void add_endcap(int lid, float r, float z, float eta) {
0073       float r_end = z * getTgTheta(eta);
0074 
0075       // printf("Adding endcap layer r=%.3f z=%.3f r_l=%.3f eta_l=%.3f\n", r, z, r_end, eta);
0076 
0077       {
0078         LayerInfo& li = m_trkinfo.layer_nc(lid);
0079 
0080         li.set_layer_type(LayerInfo::EndCapPos);
0081 
0082         li.set_limits(r_end, r, z - m_det_half_thickness, z + m_det_half_thickness);
0083         li.set_propagate_to(li.zmin());
0084 
0085         li.set_q_bin(1.5);
0086       }
0087       {
0088         lid += 9;
0089         LayerInfo& li = m_trkinfo.layer_nc(lid);
0090 
0091         li.set_layer_type(LayerInfo::EndCapNeg);
0092 
0093         li.set_limits(r_end, r, -z - m_det_half_thickness, -z + m_det_half_thickness);
0094         li.set_propagate_to(li.zmax());
0095 
0096         li.set_q_bin(1.5);
0097       }
0098     }
0099 
0100     //------------------------------------------------------------------------------
0101 
0102   public:
0103     CylCowWLidsCreator(TrackerInfo& ti) : m_trkinfo(ti) {}
0104 
0105     void FillTrackerInfo() {
0106       m_trkinfo.create_layers(10, 9, 9);
0107 
0108       // Actual coverage for tracks with z = 3cm is 2.4
0109       float full_eta = 2.5;
0110       float full_eta_pix_0 = 2.55;  // To account for BS z-spread
0111       float full_eta_ec_in[] = {0, 2.525, 2.515};
0112 
0113       float pix_0 = 4, pix_sep = 6;
0114       float pix_z0 = 24, pix_zgrow = 6;
0115 
0116       float sct_sep = 10;
0117       float sct_0 = pix_0 + 2 * pix_sep + sct_sep;
0118       float sct_zgrow = 10;
0119       float sct_z0 = pix_z0 + 2 * pix_zgrow + sct_zgrow;
0120 
0121       float pix_ec_zgap = 2;
0122       float pix_ec_rextra = 2;
0123 
0124       float sct_ec_zgap = 4;
0125       float sct_ec_rextra = 4;
0126 
0127       add_barrel_r_eta(0, pix_0, full_eta_pix_0);
0128 
0129       add_barrel_r_z(1, pix_0 + 1 * pix_sep, pix_z0 + 1 * pix_zgrow);
0130       add_barrel_r_z(2, pix_0 + 2 * pix_sep, pix_z0 + 2 * pix_zgrow);
0131       add_barrel_r_z(3, pix_0 + 3 * pix_sep, pix_z0 + 3 * pix_zgrow);
0132 
0133       for (int i = 0; i < 6; ++i) {
0134         add_barrel_r_z(4 + i, sct_0 + i * sct_sep, sct_z0 + i * sct_zgrow);
0135       }
0136 
0137       for (int i = 1; i < 4; ++i) {
0138         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]);
0139       }
0140       for (int i = 0; i < 6; ++i) {
0141         add_endcap(13 + i, sct_0 + i * sct_sep + sct_ec_rextra, sct_z0 + i * sct_zgrow + sct_ec_zgap, full_eta);
0142       }
0143       // + endcap disks at -z
0144     }
0145   };
0146 
0147   //============================================================================
0148 
0149   void Create_CylCowWLids(TrackerInfo& ti, IterationsInfo& ii, bool verbose) {
0150     PropagationConfig pconf;
0151     pconf.backward_fit_to_pca = Config::includePCA;
0152     pconf.finding_requires_propagation_to_hit_pos = false;
0153     pconf.finding_inter_layer_pflags = PropagationFlags(PF_none);
0154     pconf.finding_intra_layer_pflags = PropagationFlags(PF_none);
0155     pconf.backward_fit_pflags = PropagationFlags(PF_use_param_b_field);
0156     pconf.forward_fit_pflags = PropagationFlags(PF_use_param_b_field);
0157     pconf.seed_fit_pflags = PropagationFlags(PF_none);
0158     pconf.pca_prop_pflags = PropagationFlags(PF_use_param_b_field);
0159     pconf.set_as_default();
0160 
0161     CylCowWLidsCreator creator(ti);
0162 
0163     creator.FillTrackerInfo();
0164 
0165     if (verbose) {
0166       printf("==========================================================================================\n");
0167     }
0168     printf("Create_CylCowWLids -- creation complete\n");
0169 
0170     if (verbose) {
0171       printf("==========================================================================================\n");
0172       for (int ii = 0; ii < ti.n_layers(); ++ii)
0173         ti.layer(ii).print_layer();
0174       printf("==========================================================================================\n");
0175     }
0176   }
0177 
0178 }  // namespace
0179 
0180 void* TrackerInfoCreator_ptr = (void*)Create_CylCowWLids;