CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <string.h>
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_(0)
38  , globalThreshold_(iConfig.getParameter<double>("globalThreshold"))
39  {
40  noHF_ = iConfig.getParameter<bool>("noHF");
41 
42  std::string alias(iConfig.getParameter<std::string>("alias"));
43  produces<reco::CaloMETCollection>().setBranchAlias(alias.c_str());
44 
46  }
47 
48 //____________________________________________________________________________||
50  {
51  if (resolutions_) delete resolutions_;
52  }
53 
54 //____________________________________________________________________________||
56  {
58  event.getByToken(inputToken_, input);
59 
60  METAlgo algo;
61  CommonMETData commonMETdata = algo.run(*input.product(), globalThreshold_);
62 
63  CaloSpecificAlgo calospecalgo;
64  reco::CaloMET calomet = calospecalgo.addInfo(input, commonMETdata, noHF_, globalThreshold_);
65 
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  std::auto_ptr<reco::CaloMETCollection> calometcoll;
75  calometcoll.reset(new reco::CaloMETCollection);
76  calometcoll->push_back(calomet);
77  event.put(calometcoll);
78  }
79 
80 //____________________________________________________________________________||
82 }
83 
84 //____________________________________________________________________________||
T getParameter(std::string const &) const
static std::string const input
Definition: EdmProvDump.cc:44
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
void setSignificanceMatrix(const TMatrixD &matrix)
Definition: MET.cc:155
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
DEFINE_FWK_MODULE(CaloMETProducer)
CaloMETProducer(const edm::ParameterSet &)
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_
TMatrixD getSignificanceMatrix() const
reco::CaloMET addInfo(edm::Handle< edm::View< reco::Candidate > > towers, const CommonMETData &met, bool noHF, double globalThreshold)
void calculateBaseCaloMET(edm::Handle< edm::View< reco::Candidate > > towers, const CommonMETData &met, const metsig::SignAlgoResolutions &resolutions, bool noHF, double globalthreshold)
T const * product() const
Definition: Handle.h:81
virtual void produce(edm::Event &, const edm::EventSetup &) override
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
metsig::SignAlgoResolutions * resolutions_
void SetMetSignificance(double metsig)
Definition: CaloMET.h:76