29 virtual void endJob();
48 : jetMinPt_((
float)iConfig.getParameter<double>(
"jet_minPt")),
49 jetMaxEta_((
float)iConfig.getParameter<double>(
"jet_maxEta")),
50 doVtxConstrain_(iConfig.getParameter<
bool>(
"doVtxConstrain")),
51 useCaloJets_(iConfig.getParameter<
bool>(
"useCaloJets")),
52 primaryVtxConstrain_(iConfig.getParameter<
bool>(
"primaryVtxConstrain")),
53 deltaZ_((
float)iConfig.getParameter<double>(
"deltaZ")),
54 minNtracksHighPt_(iConfig.getParameter<
int>(
"jet_minNtracksHighPt")),
55 minNtracksLowPt_(iConfig.getParameter<
int>(
"jet_minNtracksLowPt")),
56 minJetEtLowPt_(iConfig.getParameter<double>(
"jet_minJetEtLowPt")),
57 minJetEtHighPt_(iConfig.getParameter<double>(
"jet_minJetEtHighPt")),
58 displaced_(iConfig.getParameter<
bool>(
"displaced")),
62 produces<TkHTMissCollection>(
"TkCaloHTMiss");
64 produces<TkHTMissCollection>(
"L1TrackerHTMissExtended");
66 produces<TkHTMissCollection>(
"L1TrackerHTMiss");
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);
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);
~L1TkHTMissProducer() override
void produce(edm::Event &, const edm::EventSetup &) override
const edm::EDGetTokenT< TkJetCollection > jetToken_
const unsigned int minNtracksLowPt_
const float minJetEtHighPt_
const bool doVtxConstrain_
#define DEFINE_FWK_MODULE(type)
L1TkHTMissProducer(const edm::ParameterSet &)
std::vector< TkHTMiss > TkHTMissCollection
Log< level::Error, false > LogError
std::vector< Vertex > VertexCollection
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
void setVtx(const float &zvtx)
const bool primaryVtxConstrain_
const edm::EDGetTokenT< VertexCollection > pvToken_
Log< level::Warning, false > LogWarning
std::vector< TkJet > TkJetCollection