30 initializeSpecificCaloMETData(specific);
35 double sumEtInpHF = 0.0;
36 double sumEtInmHF = 0.0;
37 double MExInpHF = 0.0;
38 double MEyInpHF = 0.0;
39 double MExInmHF = 0.0;
40 double MEyInmHF = 0.0;
45 if (!calotower)
continue;
46 if(calotower->
et() < globalThreshold)
continue;
47 update_totalEt_totalEm(totalEt, totalEm, calotower, noHF);
51 update_sumEtInpHF_MExInpHF_MEyInpHF_sumEtInmHF_MExInmHF_MEyInmHF(sumEtInpHF, MExInpHF, MEyInpHF, sumEtInmHF, MExInmHF, MEyInmHF, calotower);
54 double totalHad = totalEt - totalEm;
56 if(noHF) remove_HF_from_MET(met, sumEtInpHF, MExInpHF, MEyInpHF, sumEtInmHF, MExInmHF, MEyInmHF);
58 if(!noHF) add_MET_in_HF(specific, sumEtInpHF, MExInpHF, MEyInpHF, sumEtInmHF, MExInmHF, MEyInmHF);
61 specific.
EtFractionEm = (totalEt == 0.0)? 0.0 : totalEm/totalEt;
64 const Point vtx(0.0, 0.0, 0.0);
97 DetId detIdHcal = find_DetId_of_HCAL_cell_in_constituent_of(calotower);
105 totalEt += calotower->
et();
106 totalEm += calotower->
emEt();
112 DetId detIdHcal = find_DetId_of_HCAL_cell_in_constituent_of(calotower);
113 DetId detIdEcal = find_DetId_of_ECAL_cell_in_constituent_of(calotower);
115 if( !detIdHcal.
null() )
120 if( calotower->
hadEt() > MaxTowerHad ) MaxTowerHad = calotower->
hadEt();
121 if( calotower->
emEt() > MaxTowerEm ) MaxTowerEm = calotower->
emEt();
126 if( !detIdEcal.
null() )
128 if( calotower->
emEt() > MaxTowerEm ) MaxTowerEm = calotower->
emEt();
135 DetId detIdEcal = find_DetId_of_ECAL_cell_in_constituent_of(calotower);
136 if(detIdEcal.
null())
return;
141 EmEtInEB += calotower->
emEt();
145 EmEtInEE += calotower->
emEt();
152 DetId detIdHcal = find_DetId_of_HCAL_cell_in_constituent_of(calotower);
153 if(detIdHcal.
null())
return;
158 HadEtInHB += calotower->
hadEt();
159 HadEtInHO += calotower->
outerEt();
164 HadEtInHE += calotower->
hadEt();
169 HadEtInHF += calotower->
hadEt();
170 EmEtInHF += calotower->
emEt();
177 DetId detIdHcal = find_DetId_of_HCAL_cell_in_constituent_of(calotower);
178 if(detIdHcal.
null())
return;
183 if (calotower->
eta() >= 0)
185 sumEtInpHF += calotower->
et();
186 MExInpHF -= (calotower->
et() *
cos(calotower->
phi()));
187 MEyInpHF -= (calotower->
et() *
sin(calotower->
phi()));
191 sumEtInmHF += calotower->
et();
192 MExInmHF -= (calotower->
et() *
cos(calotower->
phi()));
193 MEyInmHF -= (calotower->
et() *
sin(calotower->
phi()));
200 met.
mex -= (MExInmHF + MExInpHF);
201 met.
mey -= (MEyInmHF + MEyInpHF);
202 met.
sumet -= (sumEtInpHF + sumEtInmHF);
209 LorentzVector METpHF(MExInpHF, MEyInpHF, 0,
sqrt(MExInpHF*MExInpHF + MEyInpHF*MEyInpHF));
210 LorentzVector METmHF(MExInmHF, MEyInmHF, 0,
sqrt(MExInmHF*MExInmHF + MEyInmHF*MEyInmHF));
DetId find_DetId_of_HCAL_cell_in_constituent_of(const CaloTower *calotower)
void initializeSpecificCaloMETData(SpecificCaloMETData &specific)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
void remove_HF_from_MET(CommonMETData &met, double sumEtInpHF, double MExInpHF, double MEyInpHF, double sumEtInmHF, double MExInmHF, double MEyInmHF)
size_t constituentsSize() const
HcalSubdetector subdet() const
get the subdetector
void update_HadEtInHB_HadEtInHE_HadEtInHO_HadEtInHF_EmEtInHF(double &HadEtInHB, double &HadEtInHE, double &HadEtInHO, double &HadEtInHF, double &EmEtInHF, const CaloTower *calotower, bool noHF)
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(double &EmEtInEB, double &EmEtInEE, const CaloTower *calotower)
void update_MaxTowerEm_MaxTowerHad(double &MaxTowerEm, double &MaxTowerHad, const CaloTower *calotower, bool noHF)
MET made from CaloTowers.
void update_totalEt_totalEm(double &totalEt, double &totalEm, const CaloTower *calotower, bool noHF)
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
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) ...
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
reco::CaloMET addInfo(edm::Handle< edm::View< reco::Candidate > > towers, CommonMETData met, bool noHF, double globalThreshold)
bool null() const
is this a null id ?
math::XYZTLorentzVector LorentzVector
double et(double vtxZ) const
DetId find_DetId_of_ECAL_cell_in_constituent_of(const CaloTower *calotower)
double EtFractionHadronic