20 if ( a.
pt() == b.
pt() ){
30 return a.
pt() > b.
pt();
50 std::vector<l1t::EGamma> & outputEGammas) {
52 vector<pair<int,double> > etaGT;
54 for(
int i=0;
i<115;
i++)
55 etaGT.push_back( make_pair(
i,
i*(0.087/2.)) );
57 vector<pair<int,double> > phiGT;
59 for(
int i=0;
i<145;
i++)
60 phiGT.push_back( make_pair(
i,
i*(
M_PI/72.)) );
61 phiGT[144] = make_pair(0,2*
M_PI);
63 outputEGammas = inputEGammas;
65 for(
auto&
egamma : outputEGammas){
72 double minDistance = 99999.;
73 pair<int, double> closestPoint = make_pair(0,0.);
75 for(
const auto&
p : etaGT){
77 if(distance < minDistance){
83 int hwEta_GT = (eta>0) ? closestPoint.first : - closestPoint.first;
84 double eta_GT = (eta>0) ? closestPoint.second : - closestPoint.second;
87 closestPoint = make_pair(0,0.);
89 for(
const auto&
p : phiGT){
91 if(distance < minDistance){
97 int hwPhi_GT = closestPoint.first;
98 double phi_GT = closestPoint.second;
100 egamma.setHwEta(hwEta_GT);
101 egamma.setHwPhi(hwPhi_GT);
114 std::vector<l1t::EGamma>::iterator start_ = outputEGammas.begin();
115 std::vector<l1t::EGamma>::iterator end_ = outputEGammas.end();
116 BitonicSort<l1t::EGamma>(
down, start_, end_);
~Stage2Layer2DemuxEGAlgoFirmwareImp1() override
double pt() const final
transverse momentum
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
void processEvent(const std::vector< EGamma > &inputEgammas, std::vector< EGamma > &outputEgammas) override
Abs< T >::type abs(const T &t)
CaloParamsHelper const * params_
bool operator>(const l1t::Jet &a, l1t::Jet &b)
Stage2Layer2DemuxEGAlgoFirmwareImp1(CaloParamsHelper const *params)