33 double sumEtInpHF = 0.0;
34 double sumEtInmHF = 0.0;
35 double MExInpHF = 0.0;
36 double MEyInpHF = 0.0;
37 double MExInmHF = 0.0;
38 double MEyInmHF = 0.0;
43 if (!calotower)
continue;
45 update_totalEt_totalEm(totalEt, totalEm, calotower, noHF);
49 update_sumEtInpHF_MExInpHF_MEyInpHF_sumEtInmHF_MExInmHF_MEyInmHF(sumEtInpHF, MExInpHF, MEyInpHF, sumEtInmHF, MExInmHF, MEyInmHF, calotower);
52 double totalHad = totalEt - totalEm;
54 if(noHF) remove_HF_from_MET(met, sumEtInpHF, MExInpHF, MEyInpHF, sumEtInmHF, MExInmHF, MEyInmHF);
56 if(!noHF) add_MET_in_HF(specific, sumEtInpHF, MExInpHF, MEyInpHF, sumEtInmHF, MExInmHF, MEyInmHF);
59 specific.
EtFractionEm = (totalEt == 0.0)? 0.0 : totalEm/totalEt;
72 DetId detIdHcal = find_DetId_of_HCAL_cell_in_constituent_of(calotower);
80 totalEt += calotower->
et();
81 totalEm += calotower->
emEt();
87 DetId detIdHcal = find_DetId_of_HCAL_cell_in_constituent_of(calotower);
88 DetId detIdEcal = find_DetId_of_ECAL_cell_in_constituent_of(calotower);
90 if( !detIdHcal.
null() )
95 if( calotower->
hadEt() > MaxTowerHad ) MaxTowerHad = calotower->
hadEt();
96 if( calotower->
emEt() > MaxTowerEm ) MaxTowerEm = calotower->
emEt();
101 if( !detIdEcal.
null() )
103 if( calotower->
emEt() > MaxTowerEm ) MaxTowerEm = calotower->
emEt();
110 DetId detIdEcal = find_DetId_of_ECAL_cell_in_constituent_of(calotower);
111 if(detIdEcal.
null())
return;
116 EmEtInEB += calotower->
emEt();
120 EmEtInEE += calotower->
emEt();
127 DetId detIdHcal = find_DetId_of_HCAL_cell_in_constituent_of(calotower);
128 if(detIdHcal.
null())
return;
133 HadEtInHB += calotower->
hadEt();
134 HadEtInHO += calotower->
outerEt();
139 HadEtInHE += calotower->
hadEt();
144 HadEtInHF += calotower->
hadEt();
145 EmEtInHF += calotower->
emEt();
152 DetId detIdHcal = find_DetId_of_HCAL_cell_in_constituent_of(calotower);
153 if(detIdHcal.
null())
return;
158 if (calotower->
eta() >= 0)
160 sumEtInpHF += calotower->
et();
161 MExInpHF -= (calotower->
et() *
cos(calotower->
phi()));
162 MEyInpHF -= (calotower->
et() *
sin(calotower->
phi()));
166 sumEtInmHF += calotower->
et();
167 MExInmHF -= (calotower->
et() *
cos(calotower->
phi()));
168 MEyInmHF -= (calotower->
et() *
sin(calotower->
phi()));
175 met.
mex -= (MExInmHF + MExInpHF);
176 met.
mey -= (MEyInmHF + MEyInpHF);
177 met.
sumet -= (sumEtInpHF + sumEtInmHF);
184 LorentzVector METpHF(MExInpHF, MEyInpHF, 0,
sqrt(MExInpHF*MExInpHF + MEyInpHF*MEyInpHF));
185 LorentzVector METmHF(MExInmHF, MEyInmHF, 0,
sqrt(MExInmHF*MExInmHF + MEyInmHF*MEyInmHF));
DetId find_DetId_of_HCAL_cell_in_constituent_of(const CaloTower *calotower)
void update_HadEtInHB_HadEtInHE_HadEtInHO_HadEtInHF_EmEtInHF(float &HadEtInHB, float &HadEtInHE, float &HadEtInHO, float &HadEtInHF, float &EmEtInHF, const CaloTower *calotower, bool noHF)
void remove_HF_from_MET(CommonMETData &met, double sumEtInpHF, double MExInpHF, double MEyInpHF, double sumEtInmHF, double MExInmHF, double MEyInmHF)
double eta() const final
momentum pseudorapidity
size_t constituentsSize() const
HcalSubdetector subdet() const
get the subdetector
void add_MET_in_HF(SpecificCaloMETData &specific, double sumEtInpHF, double MExInpHF, double MEyInpHF, double sumEtInmHF, double MExInmHF, double MEyInmHF)
DetId constituent(size_t i) const
Sin< T >::type sin(const T &t)
void update_EmEtInEB_EmEtInEE(float &EmEtInEB, float &EmEtInEE, const CaloTower *calotower)
void update_totalEt_totalEm(double &totalEt, double &totalEm, const CaloTower *calotower, bool noHF)
void update_sumEtInpHF_MExInpHF_MEyInpHF_sumEtInmHF_MExInmHF_MEyInmHF(double &sumEtInpHF, double &MExInpHF, double &MEyInpHF, double &sumEtInmHF, double &MExInmHF, double &MEyInmHF, const CaloTower *calotower)
Cos< T >::type cos(const T &t)
Structure containing data common to all types of MET.
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
reco::CaloMET addInfo(edm::Handle< edm::View< reco::Candidate > > towers, const CommonMETData &met, bool noHF, double globalThreshold)
bool null() const
is this a null id ?
void update_MaxTowerEm_MaxTowerHad(float &MaxTowerEm, float &MaxTowerHad, const CaloTower *calotower, bool noHF)
math::XYZTLorentzVector LorentzVector
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
double et(double vtxZ) const
double phi() const final
momentum azimuthal angle
DetId find_DetId_of_ECAL_cell_in_constituent_of(const CaloTower *calotower)