41#include "CaloGeoHelpers/CaloSampling.h"
121 if (tr_coll != NULL && tr_coll->
size() > tr_index) {
129 m_track.toIndexedElement(*tr_coll, tr_index);
130 if (!m_track.isValid()) {
146 if ( tr_ptr->param() != NULL ) {
147 m_tr_Zvtx = tr_ptr->param()->z0();
148 this->setEta(tr_ptr->param()->eta());
149 this->setPhi(tr_ptr->param()->phi0());
161 if (cl_coll != NULL && cl_coll->size() > cl_index) {
169 m_cluster.toIndexedElement(*cl_coll, cl_index);
170 if (!m_cluster.isValid()) {
180 this->setPt(cl_ptr->et());
184 m_cl_eta = cl_ptr->
eta();
185 m_cl_phi = cl_ptr->phi();
189 m_cl_EThad = cl_ptr->ehad1()/cosh(fabs(m_cl_eta));
191 m_cl_EThad = cl_ptr->ehad1();
195 if (cl_ptr->e277() != 0) {
196 m_cl_Rcore = cl_ptr->e237()/cl_ptr->e277();
203 if (cl_ptr->emaxs1()+cl_ptr->e2tsts1() > 0) {
204 m_cl_Eratio = (cl_ptr->emaxs1()-cl_ptr->e2tsts1()) / (cl_ptr->emaxs1()+cl_ptr->e2tsts1());
211 float tmp_cl_energy = cl_ptr->energy();
212 if (fabs(tmp_cl_energy) > 0.00001) {
213 m_cl_e_frac_S0 = ( cl_ptr->energy(CaloSampling::PreSamplerB) + cl_ptr->energy(CaloSampling::PreSamplerE)) / tmp_cl_energy;
214 m_cl_e_frac_S1 = ( cl_ptr->energy(CaloSampling::EMB1) + cl_ptr->energy(CaloSampling::EME1)) / tmp_cl_energy;
215 m_cl_e_frac_S2 = ( cl_ptr->energy(CaloSampling::EMB2) + cl_ptr->energy(CaloSampling::EME2)) / tmp_cl_energy;
216 m_cl_e_frac_S3 = ( cl_ptr->energy(CaloSampling::EMB3) + cl_ptr->energy(CaloSampling::EME3)) / tmp_cl_energy;
331 v_diff[
"Charge"] = std::abs( te1.
charge() - te2.
charge() );
332 v_diff[
"Eta"] = fabs( te1.
eta() - te2.
eta() );
333 double d_phi = fabs( te1.
phi() - te2.
phi() );
334 v_diff[
"Phi"] = (d_phi <
M_PI ? d_phi : 2*
M_PI - d_phi);
335 v_diff[
"Pt"] = 2 * fabs( (fabs(te1.
pt()) - fabs(te2.
pt())) / (fabs(te1.
pt())+fabs(te2.
pt())) );
336 v_diff[
"Zvtx"] = fabs( te1.
Zvtx() - te2.
Zvtx() );
339 v_diff[
"trkPhiEtCalo"] = (d_phi_extrapol <
M_PI ? d_phi_extrapol : 2*
M_PI - d_phi_extrapol);
343 v_diff[
"F0"] = fabs(te1.
F0() - te2.
F0());
344 v_diff[
"F1"] = fabs(te1.
F1() - te2.
F1());
345 v_diff[
"F2"] = fabs(te1.
F2() - te2.
F2());
346 v_diff[
"F3"] = fabs(te1.
F3() - te2.
F3());
354 return (
msg <<
"TrigElectron " << (te.
isValid() ?
"(valid)" :
"(not valid)")
355 <<
": RoI = " << te.
roiId() <<
"; Q = " << te.
charge()
356 <<
"; Et/Pt = " << te.
EtOverPt() <<
"; Pt = " << te.
pt()
358 <<
"; trkPt = " << te.
trkPt() <<
" +- " << te.
err_Pt()
359 <<
"; eta = " << te.
eta() <<
" +- " << te.
err_eta()
360 <<
"; phi = " << te.
phi() <<
" +- " << te.
err_phi()
364 <<
"; F0 = "<<te.
F0()<<
"; F1 = "<<te.
F1()<<
"; F2 = "<<te.
F2()<<
"; F3 = "<<te.
F3() );
A number of constexpr particle constants to avoid hardcoding them directly in various places.
MsgStream & operator<<(MsgStream &msg, const TrigElectron &te)
bool operator==(const TrigElectron &te1, const TrigElectron &te2)
Two TrigElectron are the same if they have the same cluster and the same track (and if valid,...
void diff(const TrigElectron &te1, const TrigElectron &te2, std::map< std::string, double > &v_diff)
Function compares two objects and returns "semi verbose" output in the form of map v_diff where varai...
size_type size() const noexcept
Returns the number of elements in the collection.
P4PtEtaPhiM(const double pt, const double eta, const double phi, const double m)
constructor with all data members
virtual double pt() const
get pt data member
virtual double eta() const
get eta data member
virtual double phi() const
get phi data member
Container from TrigEMCluster type objects.
Class with calibrated variables for egamma clustering.
float eta() const
get Eta (calibrated)
float m_tr_eta_at_calo
Track/Cluster matching quantities: eta and phi of track extrapolated to the calorimeter face.
bool isValid() const
accessor to get TrigElectron valid flag
TrigInDetTrack::AlgoId trackAlgo() const
accessors to return the tracking quantities
float m_cl_Eratio
Energy ratio in highest and 2nd highest strip pairs in 1st LAr sampling; Eratio = EmaxS1-E2ndS1 / Ema...
float m_cl_EThad
ET in first hadronic sampling: EThad=Ehad1/cosh(fabs(eta)
float trkPhiAtCalo() const
const TrigInDetTrack * track() const
accessor to get pointer to track (TrigInDetTrack)
float F0() const
accessors for calibrated energy fractions in each sampling - to reject noise
int nTRTHiThresholdHits() const
int m_tr_nr_trt_hits
number of TRT hits and high-threshold hits
float m_tr_Zvtx
Z of the track at closest approach (perigee) to the Z axis (maybe later to the beam?...
float caloEta() const
accessors to get cluster eta and phi (note baseclass eta and phi come from track)
float EtOverPt() const
accessor to ratio of cluster Et to track Pt
float Rcore() const
accessors for shower shape quantities
float m_cl_eta
Calorimeter quantities: Cluster eta and phi.
float trkPt() const
accessor to get pT of electron candidate track
TrigInDetTrack::AlgoId m_tr_Algo
Tracking quantities: ID of the tracking algorithm that produced the track in this electron.
unsigned int m_roiWord
roi word unique to L1 RoI (note: different from HLT RoI id)
float m_cl_Rcore
Energy ratio in 3x7 and 7x7 cells in 2nd LAr sampling; Rcore = e237/e277.
int roiId() const
accessor methods:
const TrigEMCluster * cluster() const
accessor to get pointer to cluster (TrigEMCluster)
ElementLink< TrigInDetTrackCollection > m_track
bool m_valid
To certify "good" TrigElectrons: used to be necessary for studies; now basically always true for elec...
int charge() const
accessor to return the track charge (sign of TrigInDetTrack pT)
ElementLink< TrigEMClusterContainer > m_cluster
ElementLinks to the track and calorimeter cluster in electron candidate.
float m_etoverpt
Ratio of cluster transverse energy to track transv.momentum.
float trkEtaAtCalo() const
accessor to get eta and phi of electron candidate track extrapolated the calorimeter
TrigElectron()
constructors; note: default constructor needed by POOL
float m_cl_e_frac_S0
Calibrated overall and per-sampling energy - to be used for cuts.
int m_tr_nr_trt_hithresh_hits
float err_Pt() const
accessors to get uncertainty in track parameters: Pt, eta, phi and Z of track perigee (Zvtx)
represents a LVL2 ID track