82 std::vector<TkJet>::const_iterator jetIter;
85 LogError(
"TkHTMissProducer") <<
"\nWarning: TkJetCollection not found in the event. Exit\n";
90 LogError(
"TkHTMissProducer") <<
"\nWarning: TkJetExtendedCollection not found in the event. Exit\n";
98 bool foundVtx =
false;
103 if (!L1VertexHandle.
isValid()) {
104 LogError(
"L1TkHTMissProducer") <<
"\nWarning: VertexCollection not found in the event. Exit\n";
107 std::vector<Vertex>::const_iterator vtxIter = L1VertexHandle->begin();
110 evtZVtx = vtxIter->z0();
121 float zvtx_jetpt = -1.0;
122 float jetVtxMax = 99.;
125 for (jetIter = L1TkJetsHandle->begin(); jetIter != L1TkJetsHandle->end(); ++jetIter) {
126 int ibx = jetIter->bx();
130 float tmp_jet_vtx = jetIter->jetVtx();
131 float tmp_jet_pt = jetIter->pt();
132 float tmp_jet_eta = jetIter->eta();
137 if (
std::abs(tmp_jet_vtx) > jetVtxMax)
141 if (tmp_jet_pt > zvtx_jetpt) {
142 evtZVtx = tmp_jet_vtx;
143 zvtx_jetpt = tmp_jet_pt;
149 float sumPx_calo = 0;
150 float sumPy_calo = 0;
154 LogWarning(
"L1TkHTMissProducer") <<
"Didn't find any z vertex (based on jet vertices) for this event!\n";
157 for (jetIter = L1TkJetsHandle->begin(); jetIter != L1TkJetsHandle->end(); ++jetIter) {
158 int ibx = jetIter->bx();
162 float tmp_jet_px = jetIter->px();
163 float tmp_jet_py = jetIter->py();
164 float tmp_jet_et = jetIter->et();
165 float tmp_jet_vtx = jetIter->jetVtx();
172 bool VtxRequirement =
false;
177 sumPx_calo += tmp_jet_px;
178 sumPy_calo += tmp_jet_py;
179 HT_calo += tmp_jet_et;
184 float et =
sqrt(sumPx_calo * sumPx_calo + sumPy_calo * sumPy_calo);
187 TkHTMiss tkHTM(missingEt, HT_calo, jetCollRef, L1VtxRef);
190 tkHTM.setVtx(evtZVtx);
203 for (jetIter = L1TkJetsHandle->begin(); jetIter != L1TkJetsHandle->end(); ++jetIter) {
204 float tmp_jet_px = jetIter->px();
205 float tmp_jet_py = jetIter->py();
206 float tmp_jet_et = jetIter->et();
207 float tmp_jet_pt = jetIter->pt();
222 float et =
sqrt(sumPx * sumPx + sumPy * sumPy);
225 TkHTMiss tkHTM(missingEt,
HT, jetCollRef, L1VtxRef);
const edm::EDGetTokenT< TkJetCollection > jetToken_
const unsigned int minNtracksLowPt_
const float minJetEtHighPt_
const bool doVtxConstrain_
std::vector< TkHTMiss > TkHTMissCollection
Log< level::Error, false > LogError
const float minJetEtLowPt_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
const unsigned int minNtracksHighPt_
Abs< T >::type abs(const T &t)
std::vector< pat::MHT > MHTCollection
const bool primaryVtxConstrain_
const edm::EDGetTokenT< VertexCollection > pvToken_
Log< level::Warning, false > LogWarning