CMS 3D CMS Logo

Functions
L1TkElectronTrackMatchAlgo Namespace Reference

Functions

GlobalPoint calorimeterPosition (double phi, double eta, double e)
 
double deltaEta (const GlobalPoint &epos, const edm::Ptr< L1TTTrackType > &pTrk)
 
double deltaPhi (const GlobalPoint &epos, const edm::Ptr< L1TTTrackType > &pTrk)
 
double deltaPhiClusterET (BXVector< l1t::EGamma >::const_iterator egIter, const edm::Ptr< L1TTTrackType > &pTrk)
 
double deltaPhiClusterET (l1t::EGammaBxCollection::const_iterator egIter, const edm::Ptr< L1TTTrackType > &pTrk)
 
double deltaR (const GlobalPoint &epos, const edm::Ptr< L1TTTrackType > &pTrk)
 
void doMatch (BXVector< l1t::EGamma >::const_iterator egIter, const edm::Ptr< L1TTTrackType > &pTrk, double &dph, double &dr, double &deta)
 
void doMatch (const GlobalPoint &epos, const edm::Ptr< L1TTTrackType > &pTrk, double &dph, double &dr, double &deta)
 
void doMatch (l1t::EGammaBxCollection::const_iterator egIter, const edm::Ptr< L1TTTrackType > &pTrk, double &dph, double &dr, double &deta)
 
void doMatchClusterET (BXVector< l1t::EGamma >::const_iterator egIter, const edm::Ptr< L1TTTrackType > &pTrk, double &dph, double &dr, double &deta)
 
void doMatchClusterET (l1t::EGammaBxCollection::const_iterator egIter, const edm::Ptr< L1TTTrackType > &pTrk, double &dph, double &dr, double &deta)
 

Function Documentation

◆ calorimeterPosition()

GlobalPoint L1TkElectronTrackMatchAlgo::calorimeterPosition ( double  phi,
double  eta,
double  e 
)

Definition at line 99 of file L1TkElectronTrackMatchAlgo.cc.

References funct::abs(), funct::cos(), LEDCalibrationChannels::depth, MillePedeFileConverter_cfg::e, eb_rperp, PVValHelper::eta, JetChargeProducer_cfi::exp, dqm-mbProfile::log, max_eb_eta, max_eb_z, alignCSCRings::r, funct::sin(), mathSSE::sqrt(), theta(), and x.

Referenced by deltaPhiClusterET(), doMatch(), and doMatchClusterET().

99  {
100  double x = 0.;
101  double y = 0.;
102  double z = 0.;
103  double depth = 0.89 * (7.7 + log(e));
104  double theta = 2 * atan(exp(-1 * eta));
105  double r = 0;
106  if (std::abs(eta) > max_eb_eta) {
107  double ecalZ = max_eb_z * std::abs(eta) / eta;
108 
109  r = ecalZ / cos(2 * atan(exp(-1 * eta))) + depth;
110  x = r * cos(phi) * sin(theta);
111  y = r * sin(phi) * sin(theta);
112  z = r * cos(theta);
113  } else {
114  double zface = sqrt(cos(theta) * cos(theta) / (1 - cos(theta) * cos(theta)) * eb_rperp * eb_rperp);
115  r = sqrt(eb_rperp * eb_rperp + zface * zface) + depth;
116  x = r * cos(phi) * sin(theta);
117  y = r * sin(phi) * sin(theta);
118  z = r * cos(theta);
119  }
120  GlobalPoint pos(x, y, z);
121  return pos;
122  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float float float z
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float x
Geom::Theta< T > theta() const

◆ deltaEta()

double L1TkElectronTrackMatchAlgo::deltaEta ( const GlobalPoint epos,
const edm::Ptr< L1TTTrackType > &  pTrk 
)

Definition at line 84 of file L1TkElectronTrackMatchAlgo.cc.

References funct::abs(), PV3DBase< T, PVType, FrameType >::eta(), dqm-mbProfile::log, M_PI, TTTrack< T >::momentum(), PV3DBase< T, PVType, FrameType >::perp(), TTTrack< T >::POCA(), funct::tan(), theta(), PV3DBase< T, PVType, FrameType >::z(), and HLTMuonOfflineAnalyzer_cfi::z0.

Referenced by deltaR(), doMatch(), and doMatchClusterET().

84  {
85  double corr_eta = 999.0;
86  double er = epos.perp();
87  double ez = epos.z();
88  double z0 = pTrk->POCA().z();
89  double theta = 0.0;
90  if (ez - z0 >= 0)
91  theta = atan(er / std::abs(ez - z0));
92  else
93  theta = M_PI - atan(er / std::abs(ez - z0));
94  corr_eta = -1.0 * log(tan(theta / 2.0));
95  double deleta = (corr_eta - pTrk->momentum().eta());
96  return deleta;
97  }
T perp() const
Definition: PV3DBase.h:69
T z() const
Definition: PV3DBase.h:61
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
Geom::Theta< T > theta() const

◆ deltaPhi()

double L1TkElectronTrackMatchAlgo::deltaPhi ( const GlobalPoint epos,
const edm::Ptr< L1TTTrackType > &  pTrk 
)

Definition at line 52 of file L1TkElectronTrackMatchAlgo.cc.

References reco::deltaPhi(), TTTrack< T >::momentum(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), and TTTrack< T >::rInv().

Referenced by deltaR(), and doMatch().

52  {
53  double er = epos.perp();
54  double curv = pTrk->rInv();
55 
56  double dphi_curv = (asin(er * curv / (2.0)));
57  double trk_phi_ecal = reco::deltaPhi(pTrk->momentum().phi(), dphi_curv);
58 
59  double dphi = reco::deltaPhi(trk_phi_ecal, epos.phi());
60  return dphi;
61  }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
T perp() const
Definition: PV3DBase.h:69
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66

◆ deltaPhiClusterET() [1/2]

double L1TkElectronTrackMatchAlgo::deltaPhiClusterET ( BXVector< l1t::EGamma >::const_iterator  egIter,
const edm::Ptr< L1TTTrackType > &  pTrk 
)

Referenced by doMatchClusterET().

◆ deltaPhiClusterET() [2/2]

double L1TkElectronTrackMatchAlgo::deltaPhiClusterET ( l1t::EGammaBxCollection::const_iterator  egIter,
const edm::Ptr< L1TTTrackType > &  pTrk 
)

Definition at line 63 of file L1TkElectronTrackMatchAlgo.cc.

References calorimeterPosition(), reco::deltaPhi(), EgHLTOffHistBins_cfi::et, TTTrack< T >::momentum(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), DiDispStaMuonMonitor_cfi::pt, and TTTrack< T >::rInv().

63  {
64  GlobalPoint epos = L1TkElectronTrackMatchAlgo::calorimeterPosition(egIter->phi(), egIter->eta(), egIter->energy());
65  double er = epos.perp();
66  double et = egIter->et();
67  double pt = pTrk->momentum().perp();
68  double curv = pTrk->rInv();
69 
70  double dphi_curv = (asin(er * curv * pt / (2.0 * et)));
71  double trk_phi_ecal = reco::deltaPhi(pTrk->momentum().phi(), dphi_curv);
72 
73  double dphi = reco::deltaPhi(trk_phi_ecal, epos.phi());
74  return dphi;
75  }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
T perp() const
Definition: PV3DBase.h:69
GlobalPoint calorimeterPosition(double phi, double eta, double e)
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66

◆ deltaR()

double L1TkElectronTrackMatchAlgo::deltaR ( const GlobalPoint epos,
const edm::Ptr< L1TTTrackType > &  pTrk 
)

Definition at line 77 of file L1TkElectronTrackMatchAlgo.cc.

References deltaEta(), deltaPhi(), HLT_2022v11_cff::dEta, HLT_2022v11_cff::dPhi, and mathSSE::sqrt().

Referenced by doMatch(), and doMatchClusterET().

77  {
78  //double dPhi = std::abs(reco::deltaPhi(epos.phi(), pTrk->momentum().phi()));
79  double dPhi = L1TkElectronTrackMatchAlgo::deltaPhi(epos, pTrk);
80  double dEta = deltaEta(epos, pTrk);
81  return sqrt(dPhi * dPhi + dEta * dEta);
82  }
static const double deltaEta
Definition: CaloConstants.h:8
T sqrt(T t)
Definition: SSEVec.h:19
double deltaPhi(const GlobalPoint &epos, const edm::Ptr< L1TTTrackType > &pTrk)

◆ doMatch() [1/3]

void L1TkElectronTrackMatchAlgo::doMatch ( BXVector< l1t::EGamma >::const_iterator  egIter,
const edm::Ptr< L1TTTrackType > &  pTrk,
double &  dph,
double &  dr,
double &  deta 
)

◆ doMatch() [2/3]

void L1TkElectronTrackMatchAlgo::doMatch ( const GlobalPoint epos,
const edm::Ptr< L1TTTrackType > &  pTrk,
double &  dph,
double &  dr,
double &  deta 
)

Definition at line 46 of file L1TkElectronTrackMatchAlgo.cc.

References deltaEta(), deltaPhi(), deltaR(), and flavorHistoryFilter_cfi::dr.

46  {
47  dph = L1TkElectronTrackMatchAlgo::deltaPhi(epos, pTrk);
49  deta = L1TkElectronTrackMatchAlgo::deltaEta(epos, pTrk);
50  }
double deltaR(const GlobalPoint &epos, const edm::Ptr< L1TTTrackType > &pTrk)
double deltaPhi(const GlobalPoint &epos, const edm::Ptr< L1TTTrackType > &pTrk)
double deltaEta(const GlobalPoint &epos, const edm::Ptr< L1TTTrackType > &pTrk)

◆ doMatch() [3/3]

void L1TkElectronTrackMatchAlgo::doMatch ( l1t::EGammaBxCollection::const_iterator  egIter,
const edm::Ptr< L1TTTrackType > &  pTrk,
double &  dph,
double &  dr,
double &  deta 
)

Definition at line 24 of file L1TkElectronTrackMatchAlgo.cc.

References calorimeterPosition(), deltaEta(), deltaPhi(), deltaR(), and flavorHistoryFilter_cfi::dr.

28  {
29  GlobalPoint egPos = L1TkElectronTrackMatchAlgo::calorimeterPosition(egIter->phi(), egIter->eta(), egIter->energy());
30  dph = L1TkElectronTrackMatchAlgo::deltaPhi(egPos, pTrk);
32  deta = L1TkElectronTrackMatchAlgo::deltaEta(egPos, pTrk);
33  }
GlobalPoint calorimeterPosition(double phi, double eta, double e)
double deltaR(const GlobalPoint &epos, const edm::Ptr< L1TTTrackType > &pTrk)
double deltaPhi(const GlobalPoint &epos, const edm::Ptr< L1TTTrackType > &pTrk)
double deltaEta(const GlobalPoint &epos, const edm::Ptr< L1TTTrackType > &pTrk)

◆ doMatchClusterET() [1/2]

void L1TkElectronTrackMatchAlgo::doMatchClusterET ( BXVector< l1t::EGamma >::const_iterator  egIter,
const edm::Ptr< L1TTTrackType > &  pTrk,
double &  dph,
double &  dr,
double &  deta 
)

◆ doMatchClusterET() [2/2]

void L1TkElectronTrackMatchAlgo::doMatchClusterET ( l1t::EGammaBxCollection::const_iterator  egIter,
const edm::Ptr< L1TTTrackType > &  pTrk,
double &  dph,
double &  dr,
double &  deta 
)

Definition at line 35 of file L1TkElectronTrackMatchAlgo.cc.

References calorimeterPosition(), deltaEta(), deltaPhiClusterET(), deltaR(), and flavorHistoryFilter_cfi::dr.

39  {
40  GlobalPoint egPos = L1TkElectronTrackMatchAlgo::calorimeterPosition(egIter->phi(), egIter->eta(), egIter->energy());
43  deta = L1TkElectronTrackMatchAlgo::deltaEta(egPos, pTrk);
44  }
GlobalPoint calorimeterPosition(double phi, double eta, double e)
double deltaPhiClusterET(BXVector< l1t::EGamma >::const_iterator egIter, const edm::Ptr< L1TTTrackType > &pTrk)
double deltaR(const GlobalPoint &epos, const edm::Ptr< L1TTTrackType > &pTrk)
double deltaEta(const GlobalPoint &epos, const edm::Ptr< L1TTTrackType > &pTrk)