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:366
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
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
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:46
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:171
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
CaloMET.h
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
cms::CaloMETProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: CaloMETProducer.cc:55
edm::ParameterSet
Definition: ParameterSet.h:47
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:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
InputTag.h
CaloSpecificAlgo.h
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:128
METFwd.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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