CMS 3D CMS Logo

TtFullHadSignalSelMVAComputer.cc
Go to the documentation of this file.
2 
5 
7 
12 
14  : jetsToken_(consumes<std::vector<pat::Jet> >(cfg.getParameter<edm::InputTag>("jets"))) {
15  produces<double>("DiscSel");
16 }
17 
19 
21  std::unique_ptr<double> pOutDisc(new double);
22 
23  mvaComputer.update<TtFullHadSignalSelMVARcd>(setup, "ttFullHadSignalSelMVA");
24 
25  // read name of the last processor in the MVA calibration
26  // (to be used as meta information)
28  setup.get<TtFullHadSignalSelMVARcd>().get(calibContainer);
29  std::vector<PhysicsTools::Calibration::VarProcessor*> processors =
30  (calibContainer->find("ttFullHadSignalSelMVA")).getProcessors();
31 
33  evt.getByToken(jetsToken_, jets);
34 
35  //calculation of InputVariables
36  //see TopQuarkAnalysis/TopTools/interface/TtFullHadSignalSel.h
37  // /src/TtFullHadSignalSel.cc
38  //all objects, jets, which are needed for the calculation
39  //of the input-variables have to be passed to this class
41 
42  double discrim = evaluateTtFullHadSignalSel(mvaComputer, selection);
43 
44  *pOutDisc = discrim;
45 
46  evt.put(std::move(pOutDisc), "DiscSel");
47 
48  DiscSel = discrim;
49 }
50 
52 
54 
55 // implement the plugins for the computer container
56 // -> register TtFullHadSignalSelMVARcd
57 // -> define TtFullHadSignalSelMVAFileSource
58 MVA_COMPUTER_CONTAINER_IMPLEMENT(TtFullHadSignalSelMVA);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
selection
main part
Definition: corrVsCorr.py:100
#define MVA_COMPUTER_CONTAINER_IMPLEMENT(N)
Definition: HelperMacros.h:53
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
Definition: HeavyIon.h:7
Definition: Jet.py:1
TtFullHadSignalSelMVAComputer(const edm::ParameterSet &)
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
bool update(const Calibration::MVAComputer *computer)
PhysicsTools::MVAComputerCache mvaComputer
HLT enums.
double evaluateTtFullHadSignalSel(PhysicsTools::MVAComputerCache &mvaComputer, const TtFullHadSignalSel &sigsel, double weight=1.0, const bool isSignal=false)
void produce(edm::Event &evt, const edm::EventSetup &setup) override
def move(src, dest)
Definition: eostools.py:511