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  //____________________________________________________________________________||
34  : inputToken_(consumes<edm::View<reco::Candidate> >(iConfig.getParameter<edm::InputTag>("src"))),
35  calculateSignificance_(iConfig.getParameter<bool>("calculateSignificance")),
36  resolutions_(nullptr),
37  globalThreshold_(iConfig.getParameter<double>("globalThreshold")) {
38  noHF_ = iConfig.getParameter<bool>("noHF");
39 
40  std::string alias = iConfig.exists("alias") ? iConfig.getParameter<std::string>("alias") : "";
41 
42  produces<reco::CaloMETCollection>().setBranchAlias(alias);
43 
46  }
47 
48  //____________________________________________________________________________||
50  if (resolutions_)
51  delete resolutions_;
52  }
53 
54  //____________________________________________________________________________||
57  event.getByToken(inputToken_, input);
58 
59  METAlgo algo;
60  CommonMETData commonMETdata = algo.run(*input.product(), globalThreshold_);
61 
62  CaloSpecificAlgo calospecalgo;
63  reco::CaloMET calomet = calospecalgo.addInfo(input, commonMETdata, noHF_, globalThreshold_);
64 
65  /*
66  if( calculateSignificance_ )
67  {
68  SignCaloSpecificAlgo signcalospecalgo;
69  signcalospecalgo.calculateBaseCaloMET(input, commonMETdata, *resolutions_, noHF_, globalThreshold_);
70  calomet.SetMetSignificance(signcalospecalgo.getSignificance());
71  calomet.setSignificanceMatrix(signcalospecalgo.getSignificanceMatrix());
72  }
73 */
74  auto calometcoll = std::make_unique<reco::CaloMETCollection>();
75  calometcoll->push_back(calomet);
76  event.put(std::move(calometcoll));
77  }
78 
79  //____________________________________________________________________________||
81 } // namespace cms
82 
83 //____________________________________________________________________________||
CaloSpecificAlgo
Definition: CaloSpecificAlgo.h:37
METAlgo
Definition: METAlgo.h:29
Handle.h
electrons_cff.bool
bool
Definition: electrons_cff.py:372
input
static const std::string input
Definition: EdmProvDump.cc:48
configurableAnalysis::Candidate
char Candidate[]
Definition: modules.cc:20
sistrip::View
View
Definition: ConstantsForView.h:26
METAlgo.h
edm
HLT enums.
Definition: AlignableModifier.h:19
cms::CaloMETProducer::~CaloMETProducer
~CaloMETProducer() override
Definition: CaloMETProducer.cc:49
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
CaloMETFwd.h
cms::CaloMETProducer::inputToken_
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_
Definition: CaloMETProducer.h:47
SignAlgoResolutions.h
reco::CaloMET
Definition: CaloMET.h:21
cmsdt::algo
algo
Definition: constants.h:164
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
CaloMET.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:674
cms::CaloMETProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: CaloMETProducer.cc:55
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
cms::CaloMETProducer
Definition: CaloMETProducer.h:40
cms::CaloMETProducer::resolutions_
metsig::SignAlgoResolutions * resolutions_
Definition: CaloMETProducer.h:50
cms::CaloMETProducer::globalThreshold_
double globalThreshold_
Definition: CaloMETProducer.h:54
CaloMETProducer.h
cms::CaloMETProducer::calculateSignificance_
bool calculateSignificance_
Definition: CaloMETProducer.h:49
CommonMETData.h
edm::EventSetup
Definition: EventSetup.h:57
InputTag.h
CaloSpecificAlgo.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
metsig::SignAlgoResolutions
Definition: SignAlgoResolutions.h:61
cms::CaloMETProducer::CaloMETProducer
CaloMETProducer(const edm::ParameterSet &)
Definition: CaloMETProducer.cc:33
SiStripOfflineCRack_cfg.alias
alias
Definition: SiStripOfflineCRack_cfg.py:129
METFwd.h
ConsumesCollector.h
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
SignCaloSpecificAlgo.h
cms::CaloMETProducer::noHF_
bool noHF_
Definition: CaloMETProducer.h:52
CaloSpecificAlgo::addInfo
reco::CaloMET addInfo(edm::Handle< edm::View< reco::Candidate > > towers, const CommonMETData &met, bool noHF, double globalThreshold)
Definition: CaloSpecificAlgo.cc:26
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21