70 double getPtScaledCut(
double pt, std::vector<double>&
parameters);
71 bool selectMatchedTrack(
double& d_r,
double& d_phi,
double& d_eta,
double& tk_pt,
float& eg_eta);
110 iConfig.getParameter<edm::
InputTag>(
"L1TrackInputTag"))),
142 produces<TkElectronCollection>(
label);
164 L1TTTrackCollectionType::const_iterator trackIter;
168 <<
"\nWarning: L1EmCollection not found in the event. Exit" << std::endl;
171 if (!L1TTTrackHandle.
isValid()) {
172 throw cms::Exception(
"TkEmProducer") <<
"\nWarning: L1TTTrackCollectionType not found in the event. Exit."
178 for (egIter = eGammaCollection.
begin(0); egIter != eGammaCollection.
end(0); ++egIter) {
182 float e_ele = egIter->energy();
183 float eta_ele = egIter->eta();
185 float cosh_eta_ele = cosh(eta_ele);
186 if (cosh_eta_ele > 0.0)
187 et_ele = e_ele / cosh_eta_ele;
196 for (trackIter = L1TTTrackHandle->begin(); trackIter != L1TTTrackHandle->end(); ++trackIter) {
198 double trkPt_fit = trackIter->momentum().perp();
200 double trkPt = trkPt_fit;
223 float trkisol =
isolation(L1TTTrackHandle, itrack);
225 trkisol = trkisol / et_ele;
228 TkElectron trkEm(P4, EGammaRef, matchedL1TrackPtr, trkisol);
237 result->push_back(trkEm);
242 result->push_back(trkEm);
300 L1TTTrackCollectionType::const_iterator trackIter;
308 for (trackIter = trkHandle->begin(); trackIter != trkHandle->end(); ++trackIter) {
309 if (itr++ != match_index) {
315 float dZ =
std::abs(trackIter->POCA().z() - matchedTrkPtr->POCA().z());
317 float phi1 = trackIter->momentum().phi();
318 float phi2 = matchedTrkPtr->momentum().phi();
320 float dEta = (trackIter->momentum().eta() - matchedTrkPtr->momentum().eta());
321 float dR2 = (dPhi * dPhi + dEta * dEta);
323 if (dR2 > dRMin2 && dR2 < dRMax2 && dZ < deltaZ_ && trackIter->momentum().perp() >
pTMinTra_) {
324 sumPt += trackIter->momentum().perp();
332 return (parameters[0] + parameters[1] *
exp(parameters[2] * pt));
335 double& d_r,
double& d_phi,
double& d_eta,
double& tk_pt,
float& eg_eta) {
344 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_iterator end(int bx) const
const edm::EDGetTokenT< EGammaBxCollection > egToken_
L1TkElectronTrackProducer(const edm::ParameterSet &)
std::vector< L1TTTrackType > L1TTTrackCollectionType
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< TkElectron > TkElectronCollection
edm::Ref< EGammaBxCollection > EGammaRef
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
static constexpr float EB_MaxEta
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 > geomToken_
Exp< T >::type exp(const T &t)
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 addDefault(ParameterSetDescription const &psetDescription)
void produce(edm::Event &, const edm::EventSetup &) override
Abs< T >::type abs(const T &t)
void setTrackCurvature(double trackCurvature)
void doMatch(BXVector< l1t::EGamma >::const_iterator egIter, const edm::Ptr< L1TTTrackType > &pTrk, double &dph, double &dr, double &deta)
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
unsigned int minNStubsIsoTracks_
std::vector< double > dPhiCutoff_
float isolation(const edm::Handle< L1TTTrackCollectionType > &trkHandle, int match_index)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T const * product() const
Class to store the L1 Track Trigger tracks.
T const * product() const
T getParameter(std::string const &) 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_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const_iterator begin(int bx) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)