CMS 3D CMS Logo

ElseMETProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: METProducers
4 // Class: ElseMETProducer
5 //
6 //
7 
8 //____________________________________________________________________________||
10 
15 
17 
24 
26 
27 #include <cstring>
28 
29 //____________________________________________________________________________||
30 namespace cms {
31 
32  //____________________________________________________________________________||
34  : inputToken_(consumes<edm::View<reco::Candidate> >(iConfig.getParameter<edm::InputTag>("src"))),
35  globalThreshold_(iConfig.getParameter<double>("globalThreshold")) {
36  std::string alias = iConfig.exists("alias") ? iConfig.getParameter<std::string>("alias") : "";
37 
38  produces<reco::METCollection>().setBranchAlias(alias);
39  }
40 
41  //____________________________________________________________________________||
44  event.getByToken(inputToken_, input);
45 
46  METAlgo algo;
47  CommonMETData commonMETdata = algo.run(*input.product(), globalThreshold_);
48 
49  math::XYZTLorentzVector p4(commonMETdata.mex, commonMETdata.mey, 0.0, commonMETdata.met);
50  math::XYZPoint vtx(0, 0, 0);
51  reco::MET met(commonMETdata.sumet, p4, vtx);
52  auto metcoll = std::make_unique<reco::METCollection>();
53  metcoll->push_back(met);
54  event.put(std::move(metcoll));
55  }
56 
57  //____________________________________________________________________________||
59 } // namespace cms
60 
61 //____________________________________________________________________________||
CommonMETData::met
double met
Definition: CommonMETData.h:14
METAlgo
Definition: METAlgo.h:29
Handle.h
input
static const std::string input
Definition: EdmProvDump.cc:48
configurableAnalysis::Candidate
char Candidate[]
Definition: modules.cc:20
ElseMETProducer.h
sistrip::View
View
Definition: ConstantsForView.h:26
METAlgo.h
cms::ElseMETProducer
Definition: ElseMETProducer.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
CommonMETData
Structure containing data common to all types of MET.
Definition: CommonMETData.h:12
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
cms::ElseMETProducer::ElseMETProducer
ElseMETProducer(const edm::ParameterSet &)
Definition: ElseMETProducer.cc:33
BTaggingMonitor_cfi.met
met
Definition: BTaggingMonitor_cfi.py:84
cmsdt::algo
algo
Definition: constants.h:164
reco::MET
Definition: MET.h:41
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
CommonMETData::mex
double mex
Definition: CommonMETData.h:15
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cms::ElseMETProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: ElseMETProducer.cc:42
CommonMETData::sumet
double sumet
Definition: CommonMETData.h:18
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
edm::ParameterSet
Definition: ParameterSet.h:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
Event.h
LorentzVector.h
p4
double p4[4]
Definition: TauolaWrapper.h:92
cms::ElseMETProducer::inputToken_
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_
Definition: ElseMETProducer.h:40
CommonMETData.h
edm::EventSetup
Definition: EventSetup.h:57
InputTag.h
MET.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
SiStripOfflineCRack_cfg.alias
alias
Definition: SiStripOfflineCRack_cfg.py:128
METFwd.h
Point3D.h
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ConsumesCollector.h
ParameterSet.h
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
CommonMETData::mey
double mey
Definition: CommonMETData.h:16
cms::ElseMETProducer::globalThreshold_
double globalThreshold_
Definition: ElseMETProducer.h:42
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21