85 std::vector<TkJet>::const_iterator jetIter;
87 if (!L1TkJetsHandle.isValid() && !
displaced_) {
88 LogError(
"TkHTMissProducer") <<
"\nWarning: TkJetCollection not found in the event. Exit\n";
93 LogError(
"TkHTMissProducer") <<
"\nWarning: TkJetExtendedCollection not found in the event. Exit\n";
101 bool foundVtx =
false;
106 if (!L1VertexHandle.isValid()) {
107 LogError(
"L1TkHTMissProducer") <<
"\nWarning: TkPrimaryVertexCollection not found in the event. Exit\n";
110 std::vector<TkPrimaryVertex>::const_iterator vtxIter = L1VertexHandle->begin();
113 evtZVtx = vtxIter->zvertex();
124 float zvtx_jetpt = -1.0;
125 float jetVtxMax = 99.;
128 for (jetIter = L1TkJetsHandle->begin(); jetIter != L1TkJetsHandle->end(); ++jetIter) {
129 int ibx = jetIter->bx();
133 float tmp_jet_vtx = jetIter->jetVtx();
134 float tmp_jet_pt = jetIter->pt();
135 float tmp_jet_eta = jetIter->eta();
140 if (fabs(tmp_jet_vtx) > jetVtxMax)
144 if (tmp_jet_pt > zvtx_jetpt) {
145 evtZVtx = tmp_jet_vtx;
146 zvtx_jetpt = tmp_jet_pt;
152 float sumPx_calo = 0;
153 float sumPy_calo = 0;
157 LogWarning(
"L1TkHTMissProducer") <<
"Didn't find any z vertex (based on jet vertices) for this event!\n";
160 for (jetIter = L1TkJetsHandle->begin(); jetIter != L1TkJetsHandle->end(); ++jetIter) {
161 int ibx = jetIter->bx();
165 float tmp_jet_px = jetIter->px();
166 float tmp_jet_py = jetIter->py();
167 float tmp_jet_et = jetIter->et();
168 float tmp_jet_vtx = jetIter->jetVtx();
175 bool VtxRequirement =
false;
177 VtxRequirement = fabs(tmp_jet_vtx - evtZVtx) <
deltaZ_;
180 sumPx_calo += tmp_jet_px;
181 sumPy_calo += tmp_jet_py;
182 HT_calo += tmp_jet_et;
187 float et =
sqrt(sumPx_calo * sumPx_calo + sumPy_calo * sumPy_calo);
190 TkHTMiss tkHTM(missingEt, HT_calo, jetCollRef, L1VtxRef);
193 tkHTM.setVtx(evtZVtx);
206 for (jetIter = L1TkJetsHandle->begin(); jetIter != L1TkJetsHandle->end(); ++jetIter) {
207 float tmp_jet_px = jetIter->px();
208 float tmp_jet_py = jetIter->py();
209 float tmp_jet_et = jetIter->et();
210 float tmp_jet_pt = jetIter->pt();
225 float et =
sqrt(sumPx * sumPx + sumPy * sumPy);
228 TkHTMiss tkHTM(missingEt, HT, jetCollRef, L1VtxRef);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< TkJetCollection > jetToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< TkHTMiss > TkHTMissCollection
Log< level::Error, false > LogError
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
std::vector< pat::MHT > MHTCollection
unsigned int minNtracksLowPt_
unsigned int minNtracksHighPt_
bool primaryVtxConstrain_
const edm::EDGetTokenT< TkPrimaryVertexCollection > pvToken_
Log< level::Warning, false > LogWarning