Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Package - Phase2 L1CaloTrigger #30325

Merged
merged 9 commits into from
Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions L1Trigger/L1CaloTrigger/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<use name="DataFormats/Math"/>
<use name="FWCore/ParameterSet"/>
<use name="clhep"/>

<export>
<lib name="1"/>
</export>
25 changes: 25 additions & 0 deletions L1Trigger/L1CaloTrigger/interface/L1EGammaEECalibrator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef L1Trigger_L1CaloTrigger_L1EGammaEECalibrator_h
#define L1Trigger_L1CaloTrigger_L1EGammaEECalibrator_h

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include <vector>
#include <set>
#include <cmath>

class L1EGammaEECalibrator {
public:
explicit L1EGammaEECalibrator(const edm::ParameterSet&);

float calibrationFactor(const float& pt, const float& eta) const;

private:
int etaBin(float eta) const { return bin(eta_bins, std::abs(eta)); }
int ptBin(float pt) const { return bin(pt_bins, pt); }
int bin(const std::set<float>& container, float value) const;

std::set<float> eta_bins;
std::set<float> pt_bins;
std::vector<float> calib_factors;
};

#endif
46 changes: 46 additions & 0 deletions L1Trigger/L1CaloTrigger/interface/ParametricCalibration.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#ifndef L1Trigger_L1CaloTrigger_ParametricCalibration_h
#define L1Trigger_L1CaloTrigger_ParametricCalibration_h
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include <vector>
#include <cmath>
#include <iostream>

namespace l1tp2 {
class ParametricCalibration {
public:
ParametricCalibration() {}
ParametricCalibration(const edm::ParameterSet& cpset);
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

float operator()(const float pt, const float abseta) const {
rekovic marked this conversation as resolved.
Show resolved Hide resolved
int ptBin = -1;
for (unsigned int i = 0, n = pts.size(); i < n; ++i) {
if (pt < pts[i]) {
ptBin = i;
break;
}
}
int etaBin = -1;
for (unsigned int i = 0, n = etas.size(); i < n; ++i) {
if (abseta < etas[i]) {
etaBin = i;
break;
}
}

if (ptBin == -1 || etaBin == -1)
return 1;
else
return scales[ptBin * etas.size() + etaBin];
}

protected:
std::vector<float> etas, pts, scales;
};

}; // namespace l1tp2

#endif
32 changes: 32 additions & 0 deletions L1Trigger/L1CaloTrigger/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<use name="FWCore/Framework"/>
<use name="FWCore/ServiceRegistry"/>
<use name="SimDataFormats/CaloHit"/>
<use name="SimDataFormats/Track"/>
<use name="SimDataFormats/CaloTest"/>
<use name="Geometry/Records"/>
<use name="Geometry/CaloGeometry"/>
<use name="Geometry/HcalTowerAlgo"/>
<use name="Geometry/EcalAlgo"/>
<use name="Geometry/CaloTopology"/>
<use name="Geometry/CommonDetUnit"/>
<use name="DataFormats/EcalRecHit"/>
<use name="DataFormats/L1Trigger"/>
<use name="DataFormats/HcalDetId"/>
<use name="DataFormats/HcalRecHit"/>
<use name="DataFormats/EcalDigi"/>
<use name="DataFormats/HcalDigi"/>
<use name="DataFormats/Phase2L1CaloTrig"/>
<use name="SimCalorimetry/EcalEBTrigPrimProducers"/>
<use name="RecoLocalCalo/Configuration"/>
<use name="FastSimulation/CaloGeometryTools"/>
<use name="CalibFormats/CaloTPG"/>
<use name="L1Trigger/L1CaloTrigger"/>
<use name="DataFormats/L1THGCal"/>
<use name="L1Trigger/L1TCalorimeter"/>
<use name="FWCore/PluginManager"/>
<use name="FWCore/ParameterSet"/>
<use name="DataFormats/JetReco"/>
<use name="PhysicsTools/UtilAlgos"/>
<use name="root"/>
<use name="boost"/>
<flags EDM_PLUGIN="1"/>
Loading