Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-21 23:14:24

0001 // To be included after SelectHitRange / Indices().
0002 
0003 #define MKFP(_V_) mkfp->_V_.ConstAt(mi, 0, 0)
0004 #define MKFPI(_V_, _i_, _j_) mkfp->_V_[iI].ConstAt(mi, _i_, _j_)
0005 #define MKFPAR(_i_) mkfp->Par[iI].ConstAt(mi, _i_, 0)
0006 #define MKFERR(_i_, _j_) mkfp->Err[iI].ConstAt(mi, _i_, _j_)
0007 
0008 const int iI = MkFitter::iP;
0009 TrackVec &recseeds = m_event->seedTracks_;
0010 int mi = 0;  // mplex index
0011 for (int ti = itrack; ti < end; ++ti, ++mi) {
0012   int label = MKFP(Label);
0013   int seed = MKFP(SeedIdx);
0014 
0015   float x = std::min(1000.f, MKFPAR(0)), y = std::min(1000.f, MKFPAR(1)), z = std::min(1000.f, MKFPAR(2));
0016   float r2 = x * x + y * y, r = std::sqrt(r2), phi = getPhi(x, y);
0017   float dphidx = -y / r2, dphidy = x / r2;
0018   float dphi2 = dphidx * dphidx * MKFERR(0, 0) + dphidy * dphidy * MKFERR(1, 1) + 2 * dphidx * dphidy * MKFERR(0, 1);
0019   float Dphi = dphi2 >= 0 ? 3 * std::sqrt(dphi2) : dphi2;
0020   float Dz = MKFERR(2, 2) >= 0 ? 3 * std::sqrt(MKFERR(2, 2)) : -1;
0021 
0022   float px = std::min(1000.f, MKFPAR(3)), py = std::min(1000.f, MKFPAR(4));
0023 
0024   std::vector<int> indices;
0025   m_event_of_hits.m_layers_of_hits[ilay].SelectHitIndices(z, phi, Dz, Dphi, indices, false);
0026   int nshi = indices.size();
0027 
0028   // Dump for
0029   // printf("Select hits: %2d %2d\n", MKFP(XHitSize), nshi);
0030   // if (MKFP(XHitSize) != nshi)
0031   // {
0032   //   // printf("Select hits: %2d %2d\n", MKFP(XHitSize), nshi);
0033   //   m_event_of_hits.m_layers_of_hits[ilay].SelectHitIndices(z, phi, Dz, Dphi, indices, false, true);
0034   //   printf("\n");
0035   // }
0036 
0037   static bool first = true;
0038   if (first) {
0039     printf(
0040         "ZZZ_ERR event/I:label/I:mc_pt/F:seed/I:seed_pt/F:seed_chi/F:cand/I:layer/I:chi2/F:Nh/I:"
0041         "pT/F:r/F:z/F:phi/F:eta/F:Dphi/F:Dz/F:"
0042         "etam/F:etaM/F:Nh2p/I:"
0043         "err00/F:err11/F:err22/F:err33/F:err44/F:err55/F"
0044         "\n");
0045     first = false;
0046   }
0047 
0048   // ./mkFit | perl -ne 'if (/^ZZZ_ERR/) { s/^ZZZ_ERR //og; print; }' xxx.rtt
0049 
0050   printf(
0051       "ZZZ_ERR %d %d %f "
0052       "%d %f %f %d "
0053       "%d %f %d "
0054       "%f %f %f %f %f %f %f "
0055       "%f %f %d "
0056       "%f %f %f %f %f %f\n",
0057       m_event->evtID(),
0058       label,
0059       m_event->simTracks_[label].pT(),
0060       seed,
0061       recseeds[seed].pT(),
0062       recseeds[seed].chi2(),
0063       MKFP(CandIdx),
0064       ilay,
0065       MKFP(Chi2),
0066       mkfp->countValidHits(mi),
0067       std::hypot(px, py),
0068       r,
0069       MKFPAR(2),
0070       phi,
0071       getEta(r, MKFPAR(2)),
0072       Dphi,
0073       Dz,
0074       getEta(r, z - Dz),
0075       getEta(r, z + Dz),
0076       MKFP(XHitSize),
0077       MKFERR(0, 0),
0078       MKFERR(1, 1),
0079       MKFERR(2, 2),
0080       MKFERR(3, 3),
0081       MKFERR(4, 4),
0082       MKFERR(5, 5));
0083 }
0084 
0085 #undef MKFP
0086 #undef MKFPI
0087 #undef MKFPAR
0088 #undef MKFERR