Skip to content

Commit

Permalink
GT format: change charge convention, use eta and phi at vertex, use o…
Browse files Browse the repository at this point in the history
…n pv-based isolation. Set charge of TkElectrons
  • Loading branch information
cerminar committed Nov 17, 2023
1 parent 0937a2c commit 60dbc4c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
11 changes: 6 additions & 5 deletions DataFormats/L1TParticleFlow/interface/egamma.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ namespace l1ct {
id_score_t hwIDScore;
bool hwCharge;

phi_t hwVtxPhi() const { return hwCharge ? hwPhi + hwDPhi : hwPhi - hwDPhi; }
eta_t hwVtxEta() const { return hwEta + hwDEta; }
glbphi_t hwVtxPhi() const { return hwCharge ? hwPhi + hwDPhi : hwPhi - hwDPhi; }
glbeta_t hwVtxEta() const { return hwEta + hwDEta; }

inline bool operator==(const EGIsoEleObj &other) const {
return hwPt == other.hwPt && hwEta == other.hwEta && hwPhi == other.hwPhi && hwQual == other.hwQual &&
Expand Down Expand Up @@ -164,10 +164,11 @@ namespace l1ct {
l1gt::Electron ele;
ele.valid = hwPt != 0;
ele.v3.pt = CTtoGT_pt(hwPt);
ele.v3.phi = CTtoGT_phi(hwPhi);
ele.v3.eta = CTtoGT_eta(hwEta);
ele.v3.phi = CTtoGT_phi(hwVtxPhi());
ele.v3.eta = CTtoGT_eta(hwVtxEta());
ele.quality = hwQual;
ele.charge = hwCharge;
// NOTE: GT: 0 = positive, 1 = negative, CT: 0 = negative, 1 = positive
ele.charge = !hwCharge;
ele.z0 = hwZ0;
ele.isolation = hwIso;
return ele;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ void L1TCorrelatorLayer1Producer::putEgObjects(edm::Event &iEvent,
if (egele.hwPt == 0)
continue;

reco::Candidate::PolarLorentzVector mom(egele.floatPt(), egele.floatEta(), egele.floatPhi(), 0.);
reco::Candidate::PolarLorentzVector mom(egele.floatPt(), egele.floatVtxEta(), egele.floatVtxPhi(), 0.);

l1t::TkElectron tkele(reco::Candidate::LorentzVector(mom),
egele.srcCluster->constituentsAndFractions()[0].first,
Expand All @@ -1088,6 +1088,7 @@ void L1TCorrelatorLayer1Producer::putEgObjects(edm::Event &iEvent,
tkele.setPFIsol(egele.floatRelIso(l1ct::EGIsoEleObjEmu::IsoType::PfIso));
tkele.setEgBinaryWord(egele.pack(), l1t::TkElectron::HWEncoding::CT);
tkele.setIdScore(egele.floatIDScore());
tkele.setCharge(egele.intCharge());
tkeles->push_back(tkele);
nele_obj.push_back(tkeles->size() - 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ l1t::TkElectron L1TCtL2EgProducer::convertFromEmu(const l1ct::EGIsoEleObjEmu &eg
tkele.setPuppiIsol(egele.floatRelIso(l1ct::EGIsoEleObjEmu::IsoType::PuppiIso));
tkele.setEgBinaryWord(gteg.pack(), l1t::TkElectron::HWEncoding::GT);
tkele.setIdScore(egele.floatIDScore());
tkele.setCharge(egele.intCharge());
return tkele;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,29 @@
dZ=cms.double(0.6),
dRMin=cms.double(0.07),
dRMax=cms.double(0.30),
tkQualityChi2Max=cms.double(100),
),
tkIsoParametersTkEle=cms.PSet(
tkQualityPtMin=cms.double(2.),
dZ=cms.double(0.6),
dRMin=cms.double(0.03),
dRMax=cms.double(0.20),
tkQualityChi2Max=cms.double(1e10),
),
pfIsoParametersTkEm=cms.PSet(
tkQualityPtMin=cms.double(1.),
dZ=cms.double(0.6),
dRMin=cms.double(0.07),
dRMax=cms.double(0.30),
tkQualityChi2Max=cms.double(100),
),
pfIsoParametersTkEle=cms.PSet(
tkQualityPtMin=cms.double(1.),
dZ=cms.double(0.6),
dRMin=cms.double(0.03),
dRMax=cms.double(0.20),
tkQualityChi2Max=cms.double(1e10),
),
doTkIso=cms.bool(True),
doPfIso=cms.bool(True),
hwIsoTypeTkEle=cms.uint32(0),
hwIsoTypeTkEm=cms.uint32(2),
hwIsoTypeTkEm=cms.uint32(0),
doCompositeTkEle=cms.bool(False),
nCompCandPerCluster=cms.uint32(3),
compositeParametersTkEle=cms.PSet(
Expand Down

0 comments on commit 60dbc4c

Please sign in to comment.