29 initializeSpecificCaloMETData(specific);
34 double sumEtInpHF = 0.0;
35 double sumEtInmHF = 0.0;
36 double MExInpHF = 0.0;
37 double MEyInpHF = 0.0;
38 double MExInmHF = 0.0;
39 double MEyInmHF = 0.0;
44 if (!calotower)
continue;
45 if(calotower->
et() < globalThreshold)
continue;
46 update_totalEt_totalEm(totalEt, totalEm, calotower, noHF);
50 update_sumEtInpHF_MExInpHF_MEyInpHF_sumEtInmHF_MExInmHF_MEyInmHF(sumEtInpHF, MExInpHF, MEyInpHF, sumEtInmHF, MExInmHF, MEyInmHF, calotower);
53 double totalHad = totalEt - totalEm;
55 if(noHF) remove_HF_from_MET(met, sumEtInpHF, MExInpHF, MEyInpHF, sumEtInmHF, MExInmHF, MEyInmHF);
57 if(!noHF) add_MET_in_HF(specific, sumEtInpHF, MExInpHF, MEyInpHF, sumEtInmHF, MExInmHF, MEyInmHF);
60 specific.
EtFractionEm = (totalEt == 0.0)? 0.0 : totalEm/totalEt;
63 const Point vtx(0.0, 0.0, 0.0);
96 DetId detIdHcal = find_DetId_of_HCAL_cell_in_constituent_of(calotower);
104 totalEt += calotower->
et();
105 totalEm += calotower->
emEt();
111 DetId detIdHcal = find_DetId_of_HCAL_cell_in_constituent_of(calotower);
112 DetId detIdEcal = find_DetId_of_ECAL_cell_in_constituent_of(calotower);
114 if( !detIdHcal.
null() )
119 if( calotower->
hadEt() > MaxTowerHad ) MaxTowerHad = calotower->
hadEt();
120 if( calotower->
emEt() > MaxTowerEm ) MaxTowerEm = calotower->
emEt();
125 if( !detIdEcal.
null() )
127 if( calotower->
emEt() > MaxTowerEm ) MaxTowerEm = calotower->
emEt();
134 DetId detIdEcal = find_DetId_of_ECAL_cell_in_constituent_of(calotower);
135 if(detIdEcal.
null())
return;
140 EmEtInEB += calotower->
emEt();
144 EmEtInEE += calotower->
emEt();
151 DetId detIdHcal = find_DetId_of_HCAL_cell_in_constituent_of(calotower);
152 if(detIdHcal.
null())
return;
157 HadEtInHB += calotower->
hadEt();
158 HadEtInHO += calotower->
outerEt();
163 HadEtInHE += calotower->
hadEt();
168 HadEtInHF += calotower->
hadEt();
169 EmEtInHF += calotower->
emEt();
176 DetId detIdHcal = find_DetId_of_HCAL_cell_in_constituent_of(calotower);
177 if(detIdHcal.
null())
return;
182 if (calotower->
eta() >= 0)
184 sumEtInpHF += calotower->
et();
185 MExInpHF -= (calotower->
et() *
cos(calotower->
phi()));
186 MEyInpHF -= (calotower->
et() *
sin(calotower->
phi()));
190 sumEtInmHF += calotower->
et();
191 MExInmHF -= (calotower->
et() *
cos(calotower->
phi()));
192 MEyInmHF -= (calotower->
et() *
sin(calotower->
phi()));
199 met.
mex -= (MExInmHF + MExInpHF);
200 met.
mey -= (MEyInmHF + MEyInpHF);
201 met.
sumet -= (sumEtInpHF + sumEtInmHF);
208 LorentzVector METpHF(MExInpHF, MEyInpHF, 0,
sqrt(MExInpHF*MExInpHF + MEyInpHF*MEyInpHF));
209 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)
tuple met
____________________________________________________________________________||
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, const 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