diff --git a/DataFormats/L1TCalorimeterPhase2/BuildFile.xml b/DataFormats/L1TCalorimeterPhase2/BuildFile.xml new file mode 100644 index 0000000000000..23d4dd3b113d6 --- /dev/null +++ b/DataFormats/L1TCalorimeterPhase2/BuildFile.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/DataFormats/L1TCalorimeterPhase2/interface/CaloCrystalCluster.h b/DataFormats/L1TCalorimeterPhase2/interface/CaloCrystalCluster.h new file mode 100644 index 0000000000000..6cdaf28b6fd99 --- /dev/null +++ b/DataFormats/L1TCalorimeterPhase2/interface/CaloCrystalCluster.h @@ -0,0 +1,152 @@ +#ifndef DataFormats_L1TCalorimeterPhase2_CaloCrystalsCluster_h +#define DataFormats_L1TCalorimeterPhase2_CaloCrystalsCluster_h + +#include +#include +#include +#include +#include "DataFormats/L1Trigger/interface/L1Candidate.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +namespace l1tp2 { + + class CaloCrystalCluster : public l1t::L1Candidate { + public: + CaloCrystalCluster() + : l1t::L1Candidate(), + calibratedPt_(0.), + hovere_(0.), + iso_(0.), + puCorrPt_(0.), + bremStrength_(0.), + e2x2_(0.), + e2x5_(0.), + e3x5_(0.), + e5x5_(0.), + standaloneWP_(0.), + electronWP98_(0.), + photonWP80_(0.), + electronWP90_(0.), + looseL1TkMatchWP_(0.), + stage2effMatch_(0.){}; + + CaloCrystalCluster(const PolarLorentzVector &p4, + float calibratedPt, + float hovere, + float iso, + DetId seedCrystal, + float puCorrPt = 0., + float bremStrength = 0., + float e2x2 = 0., + float e2x5 = 0., + float e3x5 = 0., + float e5x5 = 0., + bool standaloneWP = false, + bool electronWP98 = false, + bool photonWP80 = false, + bool electronWP90 = false, + bool looseL1TkMatchWP = false, + bool stage2effMatch = false) + : l1t::L1Candidate(p4), + calibratedPt_(calibratedPt), + hovere_(hovere), + iso_(iso), + seedCrystal_(seedCrystal), + puCorrPt_(puCorrPt), + bremStrength_(bremStrength), + e2x2_(e2x2), + e2x5_(e2x5), + e3x5_(e3x5), + e5x5_(e5x5), + standaloneWP_(standaloneWP), + electronWP98_(electronWP98), + photonWP80_(photonWP80), + electronWP90_(electronWP90), + looseL1TkMatchWP_(looseL1TkMatchWP), + stage2effMatch_(stage2effMatch){}; + + virtual ~CaloCrystalCluster(){}; + inline float calibratedPt() const { return calibratedPt_; }; + inline float hovere() const { return hovere_; }; + inline float isolation() const { return iso_; }; + inline float puCorrPt() const { return puCorrPt_; }; + inline float bremStrength() const { return bremStrength_; }; + inline DetId seedCrystal() const { return seedCrystal_; }; + void setCrystalPtInfo(std::vector info) { + std::sort(info.begin(), info.end()); + std::reverse(info.begin(), info.end()); + crystalPt_ = std::move(info); + }; + void setExperimentalParams(const std::map ¶ms) { experimentalParams_ = params; }; + const std::map &getExperimentalParams() const { return experimentalParams_; }; + inline float experimentalParam(std::string name) const { + auto iter = experimentalParams_.find(name); + if (iter != experimentalParams_.end()) { + return iter->second; + } else { + edm::LogWarning("CaloCrystalCluster") << "Error: no mapping for ExperimentalParam: " << name << std::endl; + return -99.; + } + }; + + inline float e2x2() const { return e2x2_; }; + inline float e2x5() const { return e2x5_; }; + inline float e3x5() const { return e3x5_; }; + inline float e5x5() const { return e5x5_; }; + inline float standaloneWP() const { return standaloneWP_; }; + inline float electronWP98() const { return electronWP98_; }; + inline float photonWP80() const { return photonWP80_; }; + inline float electronWP90() const { return electronWP90_; }; + inline float looseL1TkMatchWP() const { return looseL1TkMatchWP_; }; + inline float stage2effMatch() const { return stage2effMatch_; }; + + // The index range depends on the algorithm eta,phi window, currently 3x5 + // The pt should always be ordered. + inline float crystalPt(unsigned int index) const { return (index < crystalPt_.size()) ? crystalPt_[index] : 0.; }; + + private: + // pT calibrated to Stage-2 (Phase-I) L1EG Objects. NOTE + // all working points are defined with respect to cluster.pt(), + // not cluster.calibratedPt() + float calibratedPt_; + // HCal energy in region behind cluster (for size, look in producer) / ECal energy in cluster + float hovere_; + // ECal isolation (for outer window size, again look in producer) + float iso_; + // DetId of seed crystal used to make cluster (could be EBDetId or EEDetId) + DetId seedCrystal_; + // Pileup-corrected energy deposit, not studied carefully yet, don't use + float puCorrPt_; + // Bremstrahlung strength, should be proportional to the likelihood of a brem. + float bremStrength_; + // Shower shape variable - max 2x2 energy containing seed crystal + float e2x2_; + // Shower shape variable - max 2x5 energy containing seed crystal, phi centered + float e2x5_; + // Shower shape variable - 3x5 energy containing seed crystal, phi centered + float e3x5_; + // Shower shape variable - 5x5 energy containing centered on seed crystal + float e5x5_; + // Standalone L1EG WP + bool standaloneWP_; + // 98% efficient electron WP, for electrons above 35 GeV + bool electronWP98_; + // 80% efficient photon WP, for photons above 35 GeV + bool photonWP80_; + // 90% efficient electron based WP, early rise to efficiency plateau + bool electronWP90_; + // loose isolation and shower shape requirements to be used in conjunction with L1Trk matching + bool looseL1TkMatchWP_; + // Stage-2 L1EG efficiency matched WP, for rate comparisons + bool stage2effMatch_; + // Crystal pt (in order of strength) for all crystals in the cluster + std::vector crystalPt_; + // For investigating novel algorithm parameters + std::map experimentalParams_; + }; + + // Concrete collection of output objects (with extra tuning information) + typedef std::vector CaloCrystalClusterCollection; +} // namespace l1tp2 +#endif diff --git a/DataFormats/L1TCalorimeterPhase2/interface/CaloJet.h b/DataFormats/L1TCalorimeterPhase2/interface/CaloJet.h new file mode 100644 index 0000000000000..7f5418d0fc6e9 --- /dev/null +++ b/DataFormats/L1TCalorimeterPhase2/interface/CaloJet.h @@ -0,0 +1,59 @@ +#ifndef DataFormats_L1TCalorimeterPhase2_CaloJets_h +#define DataFormats_L1TCalorimeterPhase2_CaloJets_h + +#include +#include +#include +#include +#include "DataFormats/L1Trigger/interface/L1Candidate.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +namespace l1tp2 { + + class CaloJet : public l1t::L1Candidate { + public: + CaloJet() : l1t::L1Candidate(), calibratedPt_(0.), hovere_(0.), iso_(0.), puCorrPt_(0.){}; + + CaloJet(const PolarLorentzVector& p4, float calibratedPt, float hovere, float iso, float puCorrPt = 0.) + : l1t::L1Candidate(p4), calibratedPt_(calibratedPt), hovere_(hovere), iso_(iso), puCorrPt_(puCorrPt){}; + + inline float calibratedPt() const { return calibratedPt_; }; + inline float hovere() const { return hovere_; }; + inline float isolation() const { return iso_; }; + inline float puCorrPt() const { return puCorrPt_; }; + std::vector>& associated_l1EGs() { return associated_l1EGs_; }; + + void setExperimentalParams(const std::map& params) { experimentalParams_ = params; }; + void setAssociated_l1EGs(const std::vector> l1EGs) { associated_l1EGs_ = l1EGs; }; + + const std::map& experimentalParams() const { return experimentalParams_; }; + + inline float experimentalParam(std::string const& name) const { + auto iter = experimentalParams_.find(name); + if (iter != experimentalParams_.end()) { + return iter->second; + } else { + edm::LogWarning("CaloJet") << "Error: no mapping for ExperimentalParam: " << name << std::endl; + return -99.; + } + }; + + private: + // pT calibrated to get + float calibratedPt_; + // HCal energy in region behind cluster (for size, look in producer) / ECal energy in cluster + float hovere_; + // ECal isolation (for outer window size, again look in producer) + float iso_; + // Pileup-corrected energy deposit, not studied carefully yet, don't use + float puCorrPt_; + // For investigating novel algorithm parameters + std::map experimentalParams_; + // For decay mode related checks with CaloTaus + std::vector> associated_l1EGs_; + }; + + // Concrete collection of output objects (with extra tuning information) + typedef std::vector CaloJetsCollection; +} // namespace l1tp2 +#endif diff --git a/DataFormats/L1TCalorimeterPhase2/interface/CaloTower.h b/DataFormats/L1TCalorimeterPhase2/interface/CaloTower.h new file mode 100644 index 0000000000000..41c94d4e12fae --- /dev/null +++ b/DataFormats/L1TCalorimeterPhase2/interface/CaloTower.h @@ -0,0 +1,86 @@ +// Description: Collection representing remaining ECAL energy post-L1EG clustering +// and the associated HCAL tower. The ECAL crystal TPs "simEcalEBTriggerPrimitiveDigis" +// within a 5x5 tower region are clustered to retain this ECAL energy info for passing +// to the GCT or further algos. The HCAL energy from the "simHcalTriggerPrimitiveDigis" +// is not specifically used in the L1EG algo beyond H/E, so the HCAL values here +// correspond to the full, initial HCAL TP energy. + +#ifndef DataFormats_L1TCalorimeterPhase2_CaloTower_HH +#define DataFormats_L1TCalorimeterPhase2_CaloTower_HH + +#include +#include "DataFormats/L1Trigger/interface/L1Candidate.h" + +namespace l1tp2 { + + class CaloTower : public l1t::L1Candidate { + public: + CaloTower() + : l1t::L1Candidate(), + ecalTowerEt_(0.0), + hcalTowerEt_(0.0), + towerIPhi_(-99), + towerIEta_(-99), + towerPhi_(-99), + towerEta_(-99), + l1egTowerEt_(0.0), + nL1eg_(0), + l1egTrkSS_(0), + l1egTrkIso_(0), + l1egStandaloneSS_(0), + l1egStandaloneIso_(0), + isBarrel_(false){}; + + public: + inline float ecalTowerEt() const { return ecalTowerEt_; }; + inline float hcalTowerEt() const { return hcalTowerEt_; }; + inline int towerIPhi() const { return towerIPhi_; }; + inline int towerIEta() const { return towerIEta_; }; + inline float towerPhi() const { return towerPhi_; }; + inline float towerEta() const { return towerEta_; }; + inline float l1egTowerEt() const { return l1egTowerEt_; }; + inline int nL1eg() const { return nL1eg_; }; + inline int l1egTrkSS() const { return l1egTrkSS_; }; + inline int l1egTrkIso() const { return l1egTrkIso_; }; + inline int l1egStandaloneSS() const { return l1egStandaloneSS_; }; + inline int l1egStandaloneIso() const { return l1egStandaloneIso_; }; + inline bool isBarrel() const { return isBarrel_; }; + + void setEcalTowerEt(float et) { ecalTowerEt_ = et; }; + void setHcalTowerEt(float et) { hcalTowerEt_ = et; }; + void setTowerIPhi(int iPhi) { towerIPhi_ = iPhi; }; + void setTowerIEta(int iEta) { towerIEta_ = iEta; }; + void setTowerPhi(float phi) { towerPhi_ = phi; }; + void setTowerEta(float eta) { towerEta_ = eta; }; + void setL1egTowerEt(float et) { l1egTowerEt_ = et; }; + void setNL1eg(int n) { nL1eg_ = n; }; + void setL1egTrkSS(int trkSS) { l1egTrkSS_ = trkSS; }; + void setL1egTrkIso(int trkIso) { l1egTrkIso_ = trkIso; }; + void setL1egStandaloneSS(int staSS) { l1egStandaloneSS_ = staSS; }; + void setL1egStandaloneIso(int staIso) { l1egStandaloneIso_ = staIso; }; + void setIsBarrel(bool isBarrel) { isBarrel_ = isBarrel; }; + + private: + float ecalTowerEt_ = 0.0; + float hcalTowerEt_ = 0.0; + int towerIPhi_ = -99; + int towerIEta_ = -99; + float towerPhi_ = -99; + float towerEta_ = -99; + + // L1EG info + float l1egTowerEt_ = 0.0; + int nL1eg_ = 0; + int l1egTrkSS_ = 0; + int l1egTrkIso_ = 0; + int l1egStandaloneSS_ = 0; + int l1egStandaloneIso_ = 0; + + bool isBarrel_ = false; + }; + + // Collection of either ECAL or HCAL TPs with the Layer1 calibration constant attached, et_calibration + typedef std::vector CaloTowerCollection; + +} // namespace l1tp2 +#endif diff --git a/DataFormats/L1TCalorimeterPhase2/src/classes.h b/DataFormats/L1TCalorimeterPhase2/src/classes.h new file mode 100644 index 0000000000000..3c0d9bb3cb3c5 --- /dev/null +++ b/DataFormats/L1TCalorimeterPhase2/src/classes.h @@ -0,0 +1,13 @@ +/// //////////////////////////////////////// +/// Stacked Tracker Simulations /// +/// //////////////////////////////////////// + +#include "DataFormats/Common/interface/Wrapper.h" + +/*********************/ +/** L1 CALO TRIGGER **/ +/*********************/ + +#include "DataFormats/L1TCalorimeterPhase2/interface/CaloCrystalCluster.h" +#include "DataFormats/L1TCalorimeterPhase2/interface/CaloTower.h" +#include "DataFormats/L1TCalorimeterPhase2/interface/CaloJet.h" diff --git a/DataFormats/L1TCalorimeterPhase2/src/classes_def.xml b/DataFormats/L1TCalorimeterPhase2/src/classes_def.xml new file mode 100644 index 0000000000000..0c81ef7cc560d --- /dev/null +++ b/DataFormats/L1TCalorimeterPhase2/src/classes_def.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +