27#include "CaloGeoHelpers/CaloSampling.h"
63 unsigned int cluster_index ) :
88 if (cluster_cont != NULL && cluster_cont->
size() > cluster_index) {
95 m_cluster.toIndexedElement(*cluster_cont, cluster_index);
99 const TrigEMCluster* cl_ptr = (*cluster_cont)[cluster_index];
103 this->setPt(cl_ptr->et());
104 this->setEta(cl_ptr->eta());
105 this->setPhi(cl_ptr->phi());
110 if (cl_ptr->eta() != 0) {
111 m_HadEt = cl_ptr->ehad1()/cosh(fabs(cl_ptr->eta()));
113 m_HadEt = cl_ptr->ehad1();
117 if (cl_ptr->e277() != 0) {
118 m_rCore = cl_ptr->e237()/cl_ptr->e277();
125 if (cl_ptr->emaxs1()+cl_ptr->e2tsts1() > 0) {
126 m_energyRatio = (cl_ptr->emaxs1()-cl_ptr->e2tsts1()) / (cl_ptr->emaxs1()+cl_ptr->e2tsts1());
133 float tmp_cl_energy = cl_ptr->energy();
134 if (fabs(tmp_cl_energy) > 0.00001) {
135 m_cl_e_frac_S0 = ( cl_ptr->energy(CaloSampling::PreSamplerB) + cl_ptr->energy(CaloSampling::PreSamplerE)) / tmp_cl_energy;
136 m_cl_e_frac_S1 = ( cl_ptr->energy(CaloSampling::EMB1) + cl_ptr->energy(CaloSampling::EME1)) / tmp_cl_energy;
137 m_cl_e_frac_S2 = ( cl_ptr->energy(CaloSampling::EMB2) + cl_ptr->energy(CaloSampling::EME2)) / tmp_cl_energy;
138 m_cl_e_frac_S3 = ( cl_ptr->energy(CaloSampling::EMB3) + cl_ptr->energy(CaloSampling::EME3)) / tmp_cl_energy;
155 if (!m_cluster.isValid()) {
230 m_cluster.toIndexedElement( tp.m_cluster.getStorableObjectRef(), tp.m_cluster.index() );
262 v_diff[
"RoIword"] = tp1.
roiId() - tp2.
roiId();
264 if(fabs(tp1.
Et())+fabs(tp2.
Et()) !=0)
265 v_diff[
"Et"] = 2 * fabs( ( fabs(tp1.
Et()) - fabs(tp2.
Et() )) / ( fabs(tp1.
Et())+fabs(tp2.
Et()) ) );
266 v_diff[
"HadEt1"] = 0;
268 v_diff[
"HadEt1"] = 2 * fabs( ( fabs(tp1.
HadEt1()) - fabs(tp2.
HadEt1() )) / ( fabs(tp1.
HadEt1())+fabs(tp2.
HadEt1()) ) );
270 v_diff[
"rCore"] = fabs(tp1.
Reta() - tp2.
Reta());
271 v_diff[
"Eta"] = fabs( tp1.
eta() - tp2.
eta() );
272 double d_phi = fabs( tp1.
phi() - tp2.
phi() );
273 v_diff[
"Phi"] = (d_phi <
M_PI ? d_phi : 2*
M_PI - d_phi);
275 v_diff[
"F0"] = fabs(tp1.
F0() - tp2.
F0());
276 v_diff[
"F1"] = fabs(tp1.
F1() - tp2.
F1());
277 v_diff[
"F2"] = fabs(tp1.
F2() - tp2.
F2());
278 v_diff[
"F3"] = fabs(tp1.
F3() - tp2.
F3());
285 return (
msg <<
"TrigPhoton " << (tp.isValid() ?
"(valid)" :
"(not valid)")
286 <<
": RoI = " << tp.roiWord()
287 <<
"; Et = " << tp.Et()
288 <<
"; eta = " << tp.eta()
289 <<
"; phi = " << tp.phi()
290 <<
"; Delta_eta = " << tp.dEta() <<
"; Delta_phi = " << tp.dPhi()
291 <<
"; Eratio = " << tp.Eratio() <<
"; Rcore = " << tp.Reta()
293 <<
"; F0 = "<<tp.F0()<<
"; F1 = "<<tp.F1()<<
"; F2 = "<<tp.F2()<<
"; F3 = "<<tp.F3() );
MsgStream & operator<<(MsgStream &msg, const TrigPhoton &tp)
print TrigPhoton quantities
void diff(const TrigPhoton &tp1, const TrigPhoton &tp2, 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...
bool operator==(const TrigPhoton &tp1, const TrigPhoton &tp2)
Two TrigPhoton are the same if they have the same cluster (and if valid)
size_type size() const noexcept
Returns the number of elements in the collection.
I4Momentum is an abstract base class providing 4-momentum behavior.
P4PtEtaPhiMBase is a base class for classes with 4-momentum behavior, for which pt,...
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 HadEt() const
accessor for hadronic energy in 1st hadronic sampling behind cluster
float Fside() const
energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strips
float rCore() const
cluster energy in 3x7 cells / energy in 7x7 cells in 2nd sampling
float F0() const
accessors for calibrated energy and energy fraction in calo samples
int roiId() const
accessor to get RoI ID (should also introduce roiWord
float energyRatio() const
accessor for fraction difference of EM cluster emaxs1 and e2tsts1
TrigPhoton()
constructors; note: default constructor needed by POOL
float Et() const
accessor EM cluster et
float Weta2() const
cluster width (based on a 3x5 cluster - 2nd layer)
ElementLink< TrigEMClusterContainer > m_cluster
const TrigEMCluster * cluster() const
other accessors for shower shapes