44 double totalHad = 0.0;
45 double MaxTowerEm = 0.0;
46 double MaxTowerHad = 0.0;
47 double sumEtInpHF = 0.0;
48 double sumEtInmHF = 0.0;
49 double MExInpHF = 0.0;
50 double MEyInpHF = 0.0;
51 double MExInmHF = 0.0;
52 double MEyInmHF = 0.0;
54 if( towers->size() == 0 )
58 const Point vtx( 0.0, 0.0, 0.0 );
64 for( ; towerCand != towers->
end(); towerCand++ )
66 const Candidate* candidate = &(*towerCand);
71 double caloTowerEt=calotower->
et();
72 double caloTowerHadEt=calotower->
hadEt();
73 double caloTowerEmEt=calotower->
emEt();
74 if(caloTowerEt < globalThreshold)
continue;
75 totalEt += caloTowerEt;
76 totalEm += caloTowerEmEt;
80 bool hadIsDone =
false;
81 bool emIsDone =
false;
83 while ( --cell >= 0 && (!hadIsDone || !emIsDone) )
91 if( caloTowerHadEt > MaxTowerHad ) MaxTowerHad = caloTowerHadEt;
97 if( caloTowerHadEt > MaxTowerHad ) MaxTowerHad = caloTowerHadEt;
104 if( caloTowerHadEt > MaxTowerHad ) MaxTowerHad = caloTowerHadEt;
105 if( caloTowerEmEt > MaxTowerEm ) MaxTowerEm = caloTowerEmEt;
114 totalEm -= caloTowerEmEt;
115 totalEt -= caloTowerEt;
119 if (calotower->
eta()>=0)
121 sumEtInpHF += caloTowerEt;
122 MExInpHF -= (caloTowerEt *
cos(calotower->
phi()));
123 MEyInpHF -= (caloTowerEt *
sin(calotower->
phi()));
127 sumEtInmHF += caloTowerEt;
128 MExInmHF -= (caloTowerEt *
cos(calotower->
phi()));
129 MEyInmHF -= (caloTowerEt *
sin(calotower->
phi()));
137 if( caloTowerEmEt > MaxTowerEm ) MaxTowerEm = caloTowerEmEt;
155 totalHad += (totalEt - totalEm);
159 LorentzVector METpHF(MExInpHF, MEyInpHF, 0,
sqrt(MExInpHF*MExInpHF + MEyInpHF*MEyInpHF));
160 LorentzVector METmHF(MExInmHF, MEyInmHF, 0,
sqrt(MExInmHF*MExInmHF + MEyInmHF*MEyInmHF));
170 met.
mex -= (MExInmHF + MExInpHF);
171 met.
mey -= (MEyInmHF + MEyInpHF);
172 met.
sumet -= (sumEtInpHF + sumEtInmHF);
182 const Point vtx( 0.0, 0.0, 0.0 );
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
size_t constituentsSize() const
HcalSubdetector subdet() const
get the subdetector
DetId constituent(size_t i) const
Sin< T >::type sin(const T &t)
MET made from CaloTowers.
virtual double eta() const
momentum pseudorapidity
Cos< T >::type cos(const T &t)
Structure containing data common to all types of MET.
virtual const_iterator begin() const
first daughter const_iterator
reco::CaloMET addInfo(edm::Handle< edm::View< reco::Candidate > > towers, CommonMETData met, bool noHF, double globalThreshold)
Make CaloMET. Assumes MET is made from CaloTowerCandidates.
math::XYZTLorentzVector LorentzVector
double et(double vtxZ) const
const_iterator end() const
virtual double phi() const
momentum azimuthal angle
double EtFractionHadronic