16 lepsToken_ (consumes< edm::
View<
reco::RecoCandidate> >(cfg.getParameter<edm::
InputTag>(
"leps" ))),
17 jetsToken_ (consumes< std::vector<pat::
Jet> >(cfg.getParameter<edm::
InputTag>(
"jets" ))),
18 metsToken_ (consumes< std::vector<pat::
MET> >(cfg.getParameter<edm::
InputTag>(
"mets" ))),
19 matchingToken_ (mayConsume< std::vector< std::vector<int> > >(cfg.getParameter<edm::
InputTag>(
"matching"))),
20 maxNJets_ (cfg.getParameter<int> (
"maxNJets")),
21 leptonType_(readLeptonType(cfg.getParameter<std::
string>(
"leptonType")))
32 for(
unsigned int i = 0;
i < 5;
i++)
54 if( leptons->empty() )
return;
64 if( mets->empty() )
return;
75 if( jets->size() <
nPartons )
return;
80 std::vector<int> matching;
84 if( matchingHandle->empty() )
86 <<
"Empty vector from jet-parton matching. This should not happen! \n";
87 matching = *(matchingHandle->begin());
88 if(matching.size() <
nPartons)
return;
91 for(
unsigned int i = 0;
i < matching.size(); ++
i) {
92 if(matching[
i] == -3)
continue;
93 if(matching[
i] < 0 || matching[
i] >= (
int)jets->size())
100 matching.push_back( -1 );
112 std::vector<int> jetIndices;
113 for(
unsigned int i=0;
i<jets->size(); ++
i) {
115 jetIndices.push_back(i);
118 std::vector<int> combi;
131 for(
unsigned int cnt = 0; cnt < TMath::Factorial( combi.size() ); ++cnt) {
139 bool trueCombi =
false;
144 for(
unsigned int i = 0;
i < matching.size(); ++
i) {
145 if(combi[
i]!=matching[
i] && matching[
i]!=-3) {
153 values.
add(
"target", trueCombi);
158 next_permutation( combi.begin() , combi.end() );
172 log <<
"Number of events... \n"
173 <<
"...passed to the trainer : " << std::setw(7) <<
nEvents[0] <<
"\n"
174 <<
"...rejected since no lepton candidate : " << std::setw(7) <<
nEvents[0]-
nEvents[1] <<
"\n"
175 <<
"...rejected since no MET object : " << std::setw(7) <<
nEvents[1]-
nEvents[2] <<
"\n"
176 <<
"...rejected since not enough jets : " << std::setw(7) <<
nEvents[2]-
nEvents[3] <<
"\n"
177 <<
"...rejected due to bad jet-parton matching : " << std::setw(7) <<
nEvents[3]-
nEvents[4] <<
"\n"
178 <<
"...accepted for training : " << std::setw(7) <<
nEvents[4] <<
"\n";
188 <<
"Chosen leptonType is not supported: " << str <<
"\n";
PhysicsTools::MVAComputerCache mvaComputer
Analysis-level MET class.
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
static const unsigned int nPartons
edm::EDGetTokenT< edm::View< reco::RecoCandidate > > lepsToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define MVA_TRAINER_IMPLEMENT(N)
WDecay::LeptonType readLeptonType(const std::string &str)
WDecay::LeptonType leptonType_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual void analyze(const edm::Event &evt, const edm::EventSetup &setup)
Class derived from the TopGenEvent for ttbar events.
edm::EDGetTokenT< TtGenEvent > genEvtToken_
~TtSemiLepJetCombMVATrainer()
edm::EDGetTokenT< std::vector< std::vector< int > > > matchingToken_
void evaluateTtSemiLepJetComb(PhysicsTools::Variable::ValueList &values, const TtSemiLepJetComb &jetComb)
Common calculator class to keep multivariate analysis variables for jet combinations in semi-leptonic...
TtSemiLepJetCombMVATrainer(const edm::ParameterSet &)
edm::EDGetTokenT< std::vector< pat::MET > > metsToken_
bool next_combination(BidIt n_begin, BidIt n_end, BidIt r_begin, BidIt r_end)
genEvtToken_(mayConsume< TtGenEvent >(genEvt_))
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")