CMS 3D CMS Logo

CaloMETProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: METProducers
4 // Class: CaloMETProducer
5 //
6 //
7 
8 //____________________________________________________________________________||
10 
12 
14 
16 
21 
26 
27 #include <cstring>
28 
29 //____________________________________________________________________________||
30 namespace cms
31 {
32 
33 //____________________________________________________________________________||
35  : inputToken_(consumes<edm::View<reco::Candidate> >(iConfig.getParameter<edm::InputTag>("src")))
36  , calculateSignificance_(iConfig.getParameter<bool>("calculateSignificance"))
37  , resolutions_(nullptr)
38  , globalThreshold_(iConfig.getParameter<double>("globalThreshold"))
39  {
40  noHF_ = iConfig.getParameter<bool>("noHF");
41 
42  std::string alias = iConfig.exists("alias") ? iConfig.getParameter<std::string>("alias") : "";
43 
44  produces<reco::CaloMETCollection>().setBranchAlias(alias);
45 
47  }
48 
49 //____________________________________________________________________________||
51  {
52  if (resolutions_) delete resolutions_;
53  }
54 
55 //____________________________________________________________________________||
57  {
59  event.getByToken(inputToken_, input);
60 
61  METAlgo algo;
62  CommonMETData commonMETdata = algo.run(*input.product(), globalThreshold_);
63 
64  CaloSpecificAlgo calospecalgo;
65  reco::CaloMET calomet = calospecalgo.addInfo(input, commonMETdata, noHF_, globalThreshold_);
66 
67  /*
68  if( calculateSignificance_ )
69  {
70  SignCaloSpecificAlgo signcalospecalgo;
71  signcalospecalgo.calculateBaseCaloMET(input, commonMETdata, *resolutions_, noHF_, globalThreshold_);
72  calomet.SetMetSignificance(signcalospecalgo.getSignificance());
73  calomet.setSignificanceMatrix(signcalospecalgo.getSignificanceMatrix());
74  }
75 */
76  auto calometcoll = std::make_unique<reco::CaloMETCollection>();
77  calometcoll->push_back(calomet);
78  event.put(std::move(calometcoll));
79  }
80 
81 //____________________________________________________________________________||
83 }
84 
85 //____________________________________________________________________________||
T getParameter(std::string const &) const
#define nullptr
bool exists(std::string const &parameterName) const
checks if a parameter exists
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
static std::string const input
Definition: EdmProvDump.cc:48
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
CommonMETData run(const edm::View< reco::Candidate > &candidates, double globalThreshold=0.0)
Definition: METAlgo.cc:16
Structure containing data common to all types of MET.
Definition: CommonMETData.h:12
Namespace of DDCMS conversion namespace.
CaloMETProducer(const edm::ParameterSet &)
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_
T const * product() const
Definition: Handle.h:74
reco::CaloMET addInfo(edm::Handle< edm::View< reco::Candidate > > towers, const CommonMETData &met, bool noHF, double globalThreshold)
void produce(edm::Event &, const edm::EventSetup &) override
fixed size matrix
HLT enums.
metsig::SignAlgoResolutions * resolutions_
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1