skkwan / phase2-l1Calo-analyzer

0 stars 2 forks source link

Inconsistency in ID flags across collections #18

Closed skkwan closed 8 months ago

skkwan commented 8 months ago

Right now we use the quality bits of the Egamma collection the second bit correspond to the looseTkMatch WP since this is used in the menu I would need to reproduce the same working point when using the emulated DigitizedClusterCorrelator how can I do it? Naively I was expecting the same bits to be available in the digitized object

    /*
      * Create a l1t::EGamma object.
      */
    l1t::EGamma createL1TEGamma(void) const {
      // n.b. No photon WP, photonWP() always returns true
      int quality =
          (standaloneWP() * std::pow(2, 0)) + (looseL1TkMatchWP() * std::pow(2, 1)) + (photonWP() * std::pow(2, 2));

      // The constructor zeros out everyhing except the p4()
      l1t::EGamma eg = l1t::EGamma(p4(), etInt(), globalClusteriEta(), globalClusteriPhi(), quality, isoInt());

      // Write in fields that were zerod out
      eg.setRawEt(etInt());                // et as int
      eg.setTowerIEta(globalToweriEta());  // 0-33 in barrel
      eg.setTowerIPhi(globalToweriPhi());  // 0-71 in barrel
      eg.setIsoEt(isoInt());               // raw isolation sum as int
      eg.setShape(passesShowerShape());    // write shower shape flag to this field
      return eg;
    }

vs.

    /*
     * Create a l1tp2::DigitizedClusterCorrelator object, with corrTowPhiOffset specifying the offset necessary to correct the tower phi to the region
     * unique to each GCT card.
     */
    l1tp2::DigitizedClusterCorrelator createDigitizedClusterCorrelator(const int corrTowPhiOffset) const {
      return l1tp2::DigitizedClusterCorrelator(
          etFloat(),  // technically we are just multiplying and then dividing again by the LSB
          towEta,
          towPhi - corrTowPhiOffset,
          crEta,
          crPhi,
          hoe,
          is_iso,
          fb,
          timing,
          is_ss,
          brems,
          nGCTCard);
    }

From here

ap_uint<3> iso() const { return ((clusterData >> 33) & 0x7); }

and here

ap_uint<1> shape() const { return ((clusterData >> 47) & 0x1); }
Screenshot 2024-02-16 at 17 08 35 Screenshot 2024-02-16 at 17 09 24
skkwan commented 8 months ago

Duplicate/related to issue #14 , closing this one.