69 double getPtScaledCut(
double pt, std::vector<double>&
parameters);
70 bool selectMatchedTrack(
double& d_r,
double& d_phi,
double& d_eta,
double& tk_pt,
float& eg_eta);
105 etMin_((
float)iConfig.getParameter<double>(
"ETmin")),
106 pTMinTra_((
float)iConfig.getParameter<double>(
"PTMINTRA")),
107 dRMin_((
float)iConfig.getParameter<double>(
"DRmin")),
108 dRMax_((
float)iConfig.getParameter<double>(
"DRmax")),
109 deltaZ_((
float)iConfig.getParameter<double>(
"DeltaZ")),
110 maxChi2IsoTracks_(iConfig.getParameter<double>(
"maxChi2IsoTracks")),
111 minNStubsIsoTracks_(iConfig.getParameter<
int>(
"minNStubsIsoTracks")),
112 isoCut_((
float)iConfig.getParameter<double>(
"IsoCut")),
113 relativeIsolation_(iConfig.getParameter<
bool>(
"RelativeIsolation")),
114 trkQualityChi2_((
float)iConfig.getParameter<double>(
"TrackChi2")),
115 trkQualityPtMin_((
float)iConfig.getParameter<double>(
"TrackMinPt")),
116 useTwoStubsPT_(iConfig.getParameter<
bool>(
"useTwoStubsPT")),
117 useClusterET_(iConfig.getParameter<
bool>(
"useClusterET")),
118 dPhiCutoff_(iConfig.getParameter<
std::
vector<double>>(
"TrackEGammaDeltaPhi")),
119 dRCutoff_(iConfig.getParameter<
std::
vector<double>>(
"TrackEGammaDeltaR")),
120 dEtaCutoff_(iConfig.getParameter<
std::
vector<double>>(
"TrackEGammaDeltaEta")),
121 matchType_(iConfig.getParameter<
std::
string>(
"TrackEGammaMatchType")),
124 iConfig.getParameter<
edm::
InputTag>(
"L1TrackInputTag"))),
126 produces<TkElectronCollection>(
label);
148 L1TTTrackCollectionType::const_iterator trackIter;
152 <<
"\nWarning: L1EmCollection not found in the event. Exit" << std::endl;
155 if (!L1TTTrackHandle.
isValid()) {
157 <<
"\nWarning: L1TTTrackCollectionType not found in the event. Exit." << std::endl;
162 for (egIter = eGammaCollection.
begin(0); egIter != eGammaCollection.
end(0); ++egIter) {
166 float e_ele = egIter->energy();
167 float eta_ele = egIter->eta();
169 float cosh_eta_ele = cosh(eta_ele);
170 if (cosh_eta_ele > 0.0)
171 et_ele = e_ele / cosh_eta_ele;
180 for (trackIter = L1TTTrackHandle->begin(); trackIter != L1TTTrackHandle->end(); ++trackIter) {
182 double trkPt_fit = trackIter->momentum().perp();
184 double trkPt = trkPt_fit;
207 float trkisol =
isolation(L1TTTrackHandle, itrack);
209 trkisol = trkisol / et_ele;
280 desc.add<
double>(
"ETmin", -1.0);
282 desc.add<
double>(
"TrackChi2", 10000000000.0);
283 desc.add<
double>(
"TrackMinPt", 10.0);
284 desc.add<
bool>(
"useTwoStubsPT",
false);
285 desc.add<
bool>(
"useClusterET",
false);
287 desc.add<std::vector<double>>(
"TrackEGammaDeltaPhi",
293 desc.add<std::vector<double>>(
"TrackEGammaDeltaR",
299 desc.add<std::vector<double>>(
"TrackEGammaDeltaEta",
305 desc.add<
bool>(
"RelativeIsolation",
true);
306 desc.add<
double>(
"IsoCut", -0.1);
307 desc.add<
double>(
"PTMINTRA", 2.0);
308 desc.add<
double>(
"DRmin", 0.03);
309 desc.add<
double>(
"DRmax", 0.2);
310 desc.add<
double>(
"maxChi2IsoTracks", 10000000000.0);
311 desc.add<
int>(
"minNStubsIsoTracks", 0);
312 desc.add<
double>(
"DeltaZ", 0.6);
313 descriptions.
add(
"L1TkElectrons",
desc);
322 desc.add<
double>(
"ETmin", -1.0);
324 desc.add<
double>(
"TrackChi2", 10000000000.0);
325 desc.add<
double>(
"TrackMinPt", 10.0);
326 desc.add<
bool>(
"useTwoStubsPT",
false);
327 desc.add<
bool>(
"useClusterET",
false);
329 desc.add<std::vector<double>>(
"TrackEGammaDeltaPhi",
335 desc.add<std::vector<double>>(
"TrackEGammaDeltaR",
341 desc.add<std::vector<double>>(
"TrackEGammaDeltaEta",
347 desc.add<
bool>(
"RelativeIsolation",
true);
348 desc.add<
double>(
"IsoCut", 0.1);
349 desc.add<
double>(
"PTMINTRA", 2.0);
350 desc.add<
double>(
"DRmin", 0.03);
351 desc.add<
double>(
"DRmax", 0.2);
352 desc.add<
double>(
"maxChi2IsoTracks", 10000000000.0);
353 desc.add<
int>(
"minNStubsIsoTracks", 0);
354 desc.add<
double>(
"DeltaZ", 0.6);
355 descriptions.
add(
"L1TkIsoElectrons",
desc);
364 desc.add<
double>(
"ETmin", -1.0);
366 desc.add<
double>(
"TrackChi2", 10000000000.0);
367 desc.add<
double>(
"TrackMinPt", 3.0);
368 desc.add<
bool>(
"useTwoStubsPT",
false);
369 desc.add<
bool>(
"useClusterET",
false);
371 desc.add<std::vector<double>>(
"TrackEGammaDeltaPhi",
377 desc.add<std::vector<double>>(
"TrackEGammaDeltaR",
383 desc.add<std::vector<double>>(
"TrackEGammaDeltaEta",
389 desc.add<
bool>(
"RelativeIsolation",
true);
390 desc.add<
double>(
"IsoCut", -0.1);
391 desc.add<
double>(
"PTMINTRA", 2.0);
392 desc.add<
double>(
"DRmin", 0.03);
393 desc.add<
double>(
"DRmax", 0.2);
394 desc.add<
double>(
"maxChi2IsoTracks", 10000000000.0);
395 desc.add<
int>(
"minNStubsIsoTracks", 0);
396 desc.add<
double>(
"DeltaZ", 0.6);
397 descriptions.
add(
"L1TkElectronsLoose",
desc);
406 desc.add<
double>(
"ETmin", -1.0);
408 desc.add<
double>(
"TrackChi2", 10000000000.0);
409 desc.add<
double>(
"TrackMinPt", 10.0);
410 desc.add<
bool>(
"useTwoStubsPT",
false);
411 desc.add<
bool>(
"useClusterET",
false);
413 desc.add<std::vector<double>>(
"TrackEGammaDeltaPhi",
419 desc.add<std::vector<double>>(
"TrackEGammaDeltaR",
425 desc.add<std::vector<double>>(
"TrackEGammaDeltaEta",
431 desc.add<
bool>(
"RelativeIsolation",
true);
432 desc.add<
double>(
"IsoCut", -0.1);
433 desc.add<
double>(
"PTMINTRA", 2.0);
434 desc.add<
double>(
"DRmin", 0.03);
435 desc.add<
double>(
"DRmax", 0.2);
436 desc.add<
double>(
"maxChi2IsoTracks", 10000000000.0);
437 desc.add<
int>(
"minNStubsIsoTracks", 0);
438 desc.add<
double>(
"DeltaZ", 0.6);
439 descriptions.
add(
"L1TkElectronsCrystal",
desc);
448 desc.add<
double>(
"ETmin", -1.0);
450 desc.add<
double>(
"TrackChi2", 10000000000.0);
451 desc.add<
double>(
"TrackMinPt", 10.0);
452 desc.add<
bool>(
"useTwoStubsPT",
false);
453 desc.add<
bool>(
"useClusterET",
false);
455 desc.add<std::vector<double>>(
"TrackEGammaDeltaPhi",
461 desc.add<std::vector<double>>(
"TrackEGammaDeltaR",
467 desc.add<std::vector<double>>(
"TrackEGammaDeltaEta",
473 desc.add<
bool>(
"RelativeIsolation",
true);
474 desc.add<
double>(
"IsoCut", 0.1);
475 desc.add<
double>(
"PTMINTRA", 2.0);
476 desc.add<
double>(
"DRmin", 0.03);
477 desc.add<
double>(
"DRmax", 0.2);
478 desc.add<
double>(
"maxChi2IsoTracks", 10000000000.0);
479 desc.add<
int>(
"minNStubsIsoTracks", 0);
480 desc.add<
double>(
"DeltaZ", 0.6);
481 descriptions.
add(
"L1TkIsoElectronsCrystal",
desc);
490 desc.add<
double>(
"ETmin", -1.0);
492 desc.add<
double>(
"TrackChi2", 10000000000.0);
493 desc.add<
double>(
"TrackMinPt", 3.0);
494 desc.add<
bool>(
"useTwoStubsPT",
false);
495 desc.add<
bool>(
"useClusterET",
false);
497 desc.add<std::vector<double>>(
"TrackEGammaDeltaPhi",
503 desc.add<std::vector<double>>(
"TrackEGammaDeltaR",
509 desc.add<std::vector<double>>(
"TrackEGammaDeltaEta",
515 desc.add<
bool>(
"RelativeIsolation",
true);
516 desc.add<
double>(
"IsoCut", -0.1);
517 desc.add<
double>(
"PTMINTRA", 2.0);
518 desc.add<
double>(
"DRmin", 0.03);
519 desc.add<
double>(
"DRmax", 0.2);
520 desc.add<
double>(
"maxChi2IsoTracks", 10000000000.0);
521 desc.add<
int>(
"minNStubsIsoTracks", 0);
522 desc.add<
double>(
"DeltaZ", 0.6);
523 descriptions.
add(
"L1TkElectronsLooseCrystal",
desc);
532 desc.add<
double>(
"ETmin", -1.0);
534 desc.add<
double>(
"TrackChi2", 10000000000.0);
535 desc.add<
double>(
"TrackMinPt", 10.0);
536 desc.add<
bool>(
"useTwoStubsPT",
false);
537 desc.add<
bool>(
"useClusterET",
false);
539 desc.add<std::vector<double>>(
"TrackEGammaDeltaPhi",
545 desc.add<std::vector<double>>(
"TrackEGammaDeltaR",
551 desc.add<std::vector<double>>(
"TrackEGammaDeltaEta",
557 desc.add<
bool>(
"RelativeIsolation",
true);
558 desc.add<
double>(
"IsoCut", -0.1);
559 desc.add<
double>(
"PTMINTRA", 2.0);
560 desc.add<
double>(
"DRmin", 0.03);
561 desc.add<
double>(
"DRmax", 0.2);
562 desc.add<
double>(
"maxChi2IsoTracks", 10000000000.0);
563 desc.add<
int>(
"minNStubsIsoTracks", 0);
564 desc.add<
double>(
"DeltaZ", 0.6);
565 descriptions.
add(
"L1TkElectronsEllipticMatchCrystal",
desc);
574 desc.add<
double>(
"ETmin", -1.0);
576 desc.add<
double>(
"TrackChi2", 10000000000.0);
577 desc.add<
double>(
"TrackMinPt", 10.0);
578 desc.add<
bool>(
"useTwoStubsPT",
false);
579 desc.add<
bool>(
"useClusterET",
false);
581 desc.add<std::vector<double>>(
"TrackEGammaDeltaPhi",
587 desc.add<std::vector<double>>(
"TrackEGammaDeltaR",
593 desc.add<std::vector<double>>(
"TrackEGammaDeltaEta",
599 desc.add<
bool>(
"RelativeIsolation",
true);
600 desc.add<
double>(
"IsoCut", -0.1);
601 desc.add<
double>(
"PTMINTRA", 2.0);
602 desc.add<
double>(
"DRmin", 0.03);
603 desc.add<
double>(
"DRmax", 0.2);
604 desc.add<
double>(
"maxChi2IsoTracks", 10000000000.0);
605 desc.add<
int>(
"minNStubsIsoTracks", 0);
606 desc.add<
double>(
"DeltaZ", 0.6);
607 descriptions.
add(
"L1TkElectronsHGC",
desc);
616 desc.add<
double>(
"ETmin", -1.0);
618 desc.add<
double>(
"TrackChi2", 10000000000.0);
619 desc.add<
double>(
"TrackMinPt", 10.0);
620 desc.add<
bool>(
"useTwoStubsPT",
false);
621 desc.add<
bool>(
"useClusterET",
false);
623 desc.add<std::vector<double>>(
"TrackEGammaDeltaPhi",
629 desc.add<std::vector<double>>(
"TrackEGammaDeltaR",
635 desc.add<std::vector<double>>(
"TrackEGammaDeltaEta",
641 desc.add<
bool>(
"RelativeIsolation",
true);
642 desc.add<
double>(
"IsoCut", -0.1);
643 desc.add<
double>(
"PTMINTRA", 2.0);
644 desc.add<
double>(
"DRmin", 0.03);
645 desc.add<
double>(
"DRmax", 0.2);
646 desc.add<
double>(
"maxChi2IsoTracks", 100);
647 desc.add<
int>(
"minNStubsIsoTracks", 4);
648 desc.add<
double>(
"DeltaZ", 0.6);
649 descriptions.
add(
"L1TkElectronsEllipticMatchHGC",
desc);
658 desc.add<
double>(
"ETmin", -1.0);
660 desc.add<
double>(
"TrackChi2", 10000000000.0);
661 desc.add<
double>(
"TrackMinPt", 10.0);
662 desc.add<
bool>(
"useTwoStubsPT",
false);
663 desc.add<
bool>(
"useClusterET",
false);
665 desc.add<std::vector<double>>(
"TrackEGammaDeltaPhi",
671 desc.add<std::vector<double>>(
"TrackEGammaDeltaR",
677 desc.add<std::vector<double>>(
"TrackEGammaDeltaEta",
683 desc.add<
bool>(
"RelativeIsolation",
true);
684 desc.add<
double>(
"IsoCut", 0.1);
685 desc.add<
double>(
"PTMINTRA", 2.0);
686 desc.add<
double>(
"DRmin", 0.03);
687 desc.add<
double>(
"DRmax", 0.4);
688 desc.add<
double>(
"maxChi2IsoTracks", 100);
689 desc.add<
int>(
"minNStubsIsoTracks", 4);
690 desc.add<
double>(
"DeltaZ", 1.0);
691 descriptions.
add(
"L1TkIsoElectronsHGC",
desc);
700 desc.add<
double>(
"ETmin", -1.0);
702 desc.add<
double>(
"TrackChi2", 10000000000.0);
703 desc.add<
double>(
"TrackMinPt", 3.0);
704 desc.add<
bool>(
"useTwoStubsPT",
false);
705 desc.add<
bool>(
"useClusterET",
false);
707 desc.add<std::vector<double>>(
"TrackEGammaDeltaPhi",
713 desc.add<std::vector<double>>(
"TrackEGammaDeltaR",
719 desc.add<std::vector<double>>(
"TrackEGammaDeltaEta",
725 desc.add<
bool>(
"RelativeIsolation",
true);
726 desc.add<
double>(
"IsoCut", -0.1);
727 desc.add<
double>(
"PTMINTRA", 2.0);
728 desc.add<
double>(
"DRmin", 0.03);
729 desc.add<
double>(
"DRmax", 0.2);
730 desc.add<
double>(
"maxChi2IsoTracks", 10000000000.0);
731 desc.add<
int>(
"minNStubsIsoTracks", 0);
732 desc.add<
double>(
"DeltaZ", 0.6);
733 descriptions.
add(
"L1TkElectronsLooseHGC",
desc);
742 L1TTTrackCollectionType::const_iterator trackIter;
750 for (trackIter = trkHandle->begin(); trackIter != trkHandle->end(); ++trackIter) {
751 if (itr++ != match_index) {
757 float dZ =
std::abs(trackIter->POCA().z() - matchedTrkPtr->
POCA().
z());
759 float phi1 = trackIter->momentum().phi();
762 float dEta = (trackIter->momentum().eta() - matchedTrkPtr->
momentum().
eta());
765 if (dR2 > dRMin2 && dR2 < dRMax2 && dZ < deltaZ_ && trackIter->momentum().perp() >
pTMinTra_) {
766 sumPt += trackIter->momentum().perp();
777 double& d_r,
double& d_phi,
double& d_eta,
double& tk_pt,
float& eg_eta) {
786 if ((d_eta / deta_max) * (d_eta / deta_max) + (d_phi / dphi_max) * (d_phi / dphi_max) < 1)
constexpr double deltaPhi(double phi1, double phi2)
const edm::EDGetTokenT< EGammaBxCollection > egToken_
L1TkElectronTrackProducer(const edm::ParameterSet &)
std::vector< L1TTTrackType > L1TTTrackCollectionType
std::vector< TkElectron > TkElectronCollection
const float maxChi2IsoTracks_
edm::Ref< EGammaBxCollection > EGammaRef
#define DEFINE_FWK_MODULE(type)
Geom::Phi< T > phi() const
static constexpr float EB_MaxEta
T const * product() const
void doMatchClusterET(BXVector< l1t::EGamma >::const_iterator egIter, const edm::Ptr< L1TTTrackType > &pTrk, double &dph, double &dr, double &deta)
~L1TkElectronTrackProducer() override
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomToken_
GlobalVector momentum() const
Track momentum.
const_iterator begin(int bx) const
const unsigned int minNStubsIsoTracks_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool selectMatchedTrack(double &d_r, double &d_phi, double &d_eta, double &tk_pt, float &eg_eta)
std::vector< T >::const_iterator const_iterator
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
std::vector< double > dEtaCutoff_
void produce(edm::Event &, const edm::EventSetup &) override
Abs< T >::type abs(const T &t)
double rInv() const
Track curvature.
void setTrackCurvature(double trackCurvature)
bool getData(T &iHolder) const
void doMatch(BXVector< l1t::EGamma >::const_iterator egIter, const edm::Ptr< L1TTTrackType > &pTrk, double &dph, double &dr, double &deta)
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
std::vector< double > dPhiCutoff_
float isolation(const edm::Handle< L1TTTrackCollectionType > &trkHandle, int match_index)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Class to store the L1 Track Trigger tracks.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const_iterator end(int bx) const
double getPtScaledCut(double pt, std::vector< double > ¶meters)
float pTFrom2(std::vector< TTTrack< Ref_Phase2TrackerDigi_ > >::const_iterator trk, const TrackerGeometry *tkGeometry)
bool primaryVtxConstrain_
std::vector< double > dRCutoff_
GlobalPoint POCA() const
POCA.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)