7 lepsToken_(consumes<edm::
View<
reco::RecoCandidate>>(cfg.getParameter<edm::
InputTag>(
"leps"))),
8 jetsToken_(consumes<std::
vector<pat::
Jet>>(cfg.getParameter<edm::
InputTag>(
"jets"))),
9 metsToken_(consumes<std::
vector<pat::
MET>>(cfg.getParameter<edm::
InputTag>(
"mets"))),
10 maxNJets_(cfg.getParameter<int>(
"maxNJets")),
11 maxNComb_(cfg.getParameter<int>(
"maxNComb")) {
12 produces<std::vector<std::vector<int>>>();
13 produces<std::vector<double>>(
"Discriminators");
14 produces<std::string>(
"Method");
15 produces<int>(
"NumberOfConsideredJets");
19 std::unique_ptr<std::vector<std::vector<int>>> pOut(
new std::vector<std::vector<int>>);
20 std::unique_ptr<std::vector<double>> pOutDisc(
new std::vector<double>);
21 std::unique_ptr<std::string> pOutMeth(
new std::string);
22 std::unique_ptr<int> pJetsConsidered(
new int);
29 std::vector<const PhysicsTools::Calibration::VarProcessor*> processors =
30 (calibContainer.find(
"ttSemiLepJetCombMVA")).getProcessors();
31 *pOutMeth = (processors[processors.size() - 3])->getInstanceName();
48 if (leptons->empty() || mets->empty() || jets->size() <
nPartons) {
49 std::vector<int> invalidCombi;
51 invalidCombi.push_back(-1);
52 pOut->push_back(invalidCombi);
54 pOutDisc->push_back(0.);
56 *pJetsConsidered = jets->size();
57 evt.
put(
std::move(pJetsConsidered),
"NumberOfConsideredJets");
66 std::vector<int> jetIndices;
67 for (
unsigned int i = 0;
i < jets->size(); ++
i) {
72 jetIndices.push_back(
i);
75 std::vector<int> combi;
79 typedef std::pair<double, std::vector<int>> discCombPair;
80 std::list<discCombPair> discCombList;
83 for (
int cnt = 0; cnt < TMath::Factorial(combi.size()); ++cnt) {
96 discCombList.push_back(std::make_pair(discrim, combi));
98 next_permutation(combi.begin(), combi.end());
107 unsigned int iDiscComb = 0;
108 typedef std::list<discCombPair>::reverse_iterator discCombIterator;
109 for (discCombIterator discCombPair = discCombList.rbegin(); discCombPair != discCombList.rend(); ++discCombPair) {
112 pOut->push_back(discCombPair->second);
113 pOutDisc->push_back(discCombPair->first);
118 evt.
put(
std::move(pJetsConsidered),
"NumberOfConsideredJets");
Analysis-level MET class.
static const unsigned int nPartons
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
edm::EDGetTokenT< std::vector< pat::MET > > metsToken_
bool getData(T &iHolder) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
edm::ESGetToken< PhysicsTools::Calibration::MVAComputerContainer, TtSemiLepJetCombMVARcd > mvaToken_
PhysicsTools::MVAComputerCache mvaComputer
void produce(edm::Event &evt, const edm::EventSetup &setup) override
void evaluateTtSemiLepJetComb(PhysicsTools::Variable::ValueList &values, const TtSemiLepJetComb &jetComb)
TtSemiLepJetCombMVAComputer(const edm::ParameterSet &)
Common calculator class to keep multivariate analysis variables for jet combinations in semi-leptonic...
edm::EDGetTokenT< edm::View< reco::RecoCandidate > > lepsToken_
bool next_combination(BidIt n_begin, BidIt n_end, BidIt r_begin, BidIt r_end)
#define MVA_COMPUTER_CONTAINER_IMPLEMENT(N)