Skip to content

Commit

Permalink
Merge pull request cms-sw#1036 from mcepeda/changestontuples
Browse files Browse the repository at this point in the history
Minor changes to GMTMuons Dataformat to include physical variables
  • Loading branch information
epalencia committed Aug 1, 2022
2 parents a54d195 + 7254c6a commit 68343c3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 34 deletions.
9 changes: 9 additions & 0 deletions DataFormats/L1TMuonPhase2/interface/SAMuon.h
Expand Up @@ -8,6 +8,7 @@
#include "DataFormats/L1TMuon/interface/RegionalMuonCand.h"
#include "DataFormats/L1TMuon/interface/RegionalMuonCandFwd.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "L1Trigger/Phase2L1GMT/interface/Constants.h"

namespace l1t {

Expand All @@ -31,6 +32,14 @@ namespace l1t {
const uint hwBeta() const { return hwBeta_; }
void setBeta(uint beta) { hwBeta_ = beta; }

// For HLT
const double phZ0() const { return Phase2L1GMT::LSBSAz0*hwZ0();}
const double phD0() const { return Phase2L1GMT::LSBSAd0*hwD0();}
const double phPt() const { return Phase2L1GMT::LSBpt*hwPt();}
const double phEta() const { return Phase2L1GMT::LSBeta*hwEta();}
const double phPhi() const { return Phase2L1GMT::LSBphi*hwPhi();}
const int phCharge() const {return pow(-1,hwCharge()); }

const uint64_t word() const { return word_; }
void setWord(uint64_t word) { word_ = word; }
void print() const;
Expand Down
9 changes: 9 additions & 0 deletions DataFormats/L1TMuonPhase2/interface/TrackerMuon.h
Expand Up @@ -9,6 +9,7 @@
#include "DataFormats/L1TMuon/interface/RegionalMuonCandFwd.h"
#include "DataFormats/L1TMuonPhase2/interface/MuonStub.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "L1Trigger/Phase2L1GMT/interface/Constants.h"

namespace l1t {

Expand Down Expand Up @@ -43,6 +44,14 @@ namespace l1t {
void setMuonRef(const edm::Ref<l1t::RegionalMuonCandBxCollection>& p) { muRef_ = p; }
void setHwIsoSum(int isoSum) { hwIsoSum_ = isoSum; }
void setHwIsoSumAp(int isoSum) { hwIsoSumAp_ = isoSum; }

// For HLT
const double phZ0() const { return Phase2L1GMT::LSBGTz0*hwZ0();}
const double phD0() const { return Phase2L1GMT::LSBGTd0*hwD0();}
const double phPt() const { return Phase2L1GMT::LSBpt*hwPt();}
const double phEta() const { return Phase2L1GMT::LSBeta*hwEta();}
const double phPhi() const { return Phase2L1GMT::LSBphi*hwPhi();}
const int phCharge() const {return pow(-1,hwCharge()); }

const std::array<uint64_t, 2> word() const { return word_; }
void setWord(std::array<uint64_t, 2> word) { word_ = word; }
Expand Down
3 changes: 2 additions & 1 deletion L1Trigger/L1TNtuples/interface/L1AnalysisPhaseIIStep1.h
Expand Up @@ -184,7 +184,8 @@ namespace L1Analysis {
const float lsb_eta = Phase2L1GMT::LSBeta;
const float lsb_z0 = Phase2L1GMT::LSBGTz0;
const float lsb_d0 = Phase2L1GMT::LSBGTd0;

const float lsb_SA_z0 = Phase2L1GMT::LSBSAz0;
const float lsb_SA_d0 = Phase2L1GMT::LSBSAd0;

};
} // namespace L1Analysis
Expand Down
43 changes: 10 additions & 33 deletions L1Trigger/L1TNtuples/src/L1AnalysisPhaseIIStep1.cc
Expand Up @@ -623,21 +623,11 @@ void L1Analysis::L1AnalysisPhaseIIStep1::SetGmtMuon(const edm::Handle<std::vecto
for (unsigned int i = 0; i < gmtMuon->size() && l1extra_.nGmtMuons < maxL1Extra; i++) {
if (lsb_pt * gmtMuon->at(i).hwPt() > 0) {

/*std::cout<<Phase2L1GMT::LSBpt<<" "<<lsb_pt * gmtMuon->at(i).hwPt()<<" "<< gmtMuon->at(i).p4().pt()<<" "<<gmtMuon->at(i).pt()<<std::endl;
std::cout<<Phase2L1GMT::LSBeta<<" "<<lsb_eta * gmtMuon->at(i).hwEta()<<" "<< gmtMuon->at(i).p4().eta()<<" "<<gmtMuon->at(i).eta()<<std::endl;
std::cout<<Phase2L1GMT::LSBphi<<" "<<lsb_phi * gmtMuon->at(i).hwPhi()<<" "<< gmtMuon->at(i).p4().phi()<<" "<<gmtMuon->at(i).phi()<<std::endl;
*/

/* l1extra_.gmtMuonPt.push_back(lsb_pt * gmtMuon->at(i).hwPt()); //use pT
l1extra_.gmtMuonEta.push_back(lsb_eta * gmtMuon->at(i).hwEta());
l1extra_.gmtMuonPhi.push_back(lsb_phi * gmtMuon->at(i).hwPhi());
*/
l1extra_.gmtMuonPt.push_back(gmtMuon->at(i).pt());
l1extra_.gmtMuonEta.push_back(gmtMuon->at(i).eta());
l1extra_.gmtMuonPhi.push_back(gmtMuon->at(i).phi());

l1extra_.gmtMuonZ0.push_back(lsb_z0 * gmtMuon->at(i).hwZ0());
l1extra_.gmtMuonD0.push_back(lsb_d0 * gmtMuon->at(i).hwD0());
l1extra_.gmtMuonPt.push_back(gmtMuon->at(i).phPt());
l1extra_.gmtMuonEta.push_back(gmtMuon->at(i).phEta());
l1extra_.gmtMuonPhi.push_back(gmtMuon->at(i).phPhi());
l1extra_.gmtMuonZ0.push_back(gmtMuon->at(i).phZ0());
l1extra_.gmtMuonD0.push_back(gmtMuon->at(i).phD0());

l1extra_.gmtMuonIPt.push_back(gmtMuon->at(i).hwPt()); //rename?
l1extra_.gmtMuonIEta.push_back(gmtMuon->at(i).hwEta());
Expand All @@ -662,27 +652,14 @@ void L1Analysis::L1AnalysisPhaseIIStep1::SetGmtTkMuon(const edm::Handle<std::vec

unsigned maxL1Extra) {

/* const float lsb_pt = Phase2L1GMT::LSBpt;
const float lsb_phi = Phase2L1GMT::LSBphi;
const float lsb_eta = Phase2L1GMT::LSBeta;
const float lsb_z0 = Phase2L1GMT::LSBGTz0;
const float lsb_d0 = Phase2L1GMT::LSBGTd0;
*/

for (unsigned int i = 0; i < gmtTkMuon->size() && l1extra_.nGmtTkMuons < maxL1Extra; i++) {
if (lsb_pt * gmtTkMuon->at(i).hwPt() > 0) {

/*std::cout<<Phase2L1GMT::LSBpt<<" "<<lsb_pt * gmtTkMuon->at(i).hwPt()<<" "<< gmtTkMuon->at(i).p4().pt()<<" "<<gmtTkMuon->at(i).pt()<<std::endl;
std::cout<<Phase2L1GMT::LSBeta<<" "<<lsb_eta * gmtTkMuon->at(i).hwEta()<<" "<< gmtTkMuon->at(i).p4().eta()<<" "<<gmtTkMuon->at(i).eta()<<std::endl;
std::cout<<Phase2L1GMT::LSBphi<<" "<<lsb_phi * gmtTkMuon->at(i).hwPhi()<<" "<< gmtTkMuon->at(i).p4().phi()<<" "<<gmtTkMuon->at(i).phi()<<std::endl;
*/

l1extra_.gmtTkMuonPt.push_back(gmtTkMuon->at(i).pt());
l1extra_.gmtTkMuonEta.push_back(gmtTkMuon->at(i).eta());
l1extra_.gmtTkMuonPhi.push_back(gmtTkMuon->at(i).phi());

l1extra_.gmtTkMuonZ0.push_back(lsb_z0 * gmtTkMuon->at(i).hwZ0());
l1extra_.gmtTkMuonD0.push_back(lsb_d0 * gmtTkMuon->at(i).hwD0());
l1extra_.gmtTkMuonPt.push_back(gmtTkMuon->at(i).phPt());
l1extra_.gmtTkMuonEta.push_back(gmtTkMuon->at(i).phEta());
l1extra_.gmtTkMuonPhi.push_back(gmtTkMuon->at(i).phPhi());
l1extra_.gmtTkMuonZ0.push_back(gmtTkMuon->at(i).phZ0());
l1extra_.gmtTkMuonD0.push_back(gmtTkMuon->at(i).phD0());

l1extra_.gmtTkMuonIPt.push_back(gmtTkMuon->at(i).hwPt()); //rename?
l1extra_.gmtTkMuonIEta.push_back(gmtTkMuon->at(i).hwEta());
Expand Down

0 comments on commit 68343c3

Please sign in to comment.