18 leps_ (cfg.getParameter<edm::InputTag>(
"leps" )),
19 jets_ (cfg.getParameter<edm::InputTag>(
"jets" )),
20 mets_ (cfg.getParameter<edm::InputTag>(
"mets" )),
21 matching_ (cfg.getParameter<edm::InputTag>(
"matching")),
22 maxNJets_ (cfg.getParameter<int> (
"maxNJets")),
23 leptonType_(readLeptonType(cfg.getParameter<std::
string>(
"leptonType")))
34 for(
unsigned int i = 0;
i < 5;
i++)
56 if( leptons->empty() )
return;
66 if( mets->empty() )
return;
77 if( jets->size() <
nPartons )
return;
82 std::vector<int> matching;
86 if( matchingHandle->empty() )
88 <<
"Empty vector from jet-parton matching. This should not happen! \n";
89 matching = *(matchingHandle->begin());
90 if(matching.size() <
nPartons)
return;
93 for(
unsigned int i = 0;
i < matching.size(); ++
i) {
94 if(matching[
i] == -3)
continue;
95 if(matching[
i] < 0 || matching[
i] >= (
int)jets->size())
102 matching.push_back( -1 );
114 std::vector<int> jetIndices;
115 for(
unsigned int i=0;
i<jets->size(); ++
i) {
117 jetIndices.push_back(i);
120 std::vector<int> combi;
133 for(
unsigned int cnt = 0; cnt < TMath::Factorial( combi.size() ); ++cnt) {
141 bool trueCombi =
false;
146 for(
unsigned int i = 0;
i < matching.size(); ++
i) {
147 if(combi[
i]!=matching[
i] && matching[
i]!=-3) {
155 values.
add(
"target", trueCombi);
160 next_permutation( combi.begin() , combi.end() );
174 log <<
"Number of events... \n"
175 <<
"...passed to the trainer : " << std::setw(7) <<
nEvents[0] <<
"\n"
176 <<
"...rejected since no lepton candidate : " << std::setw(7) <<
nEvents[0]-
nEvents[1] <<
"\n"
177 <<
"...rejected since no MET object : " << std::setw(7) <<
nEvents[1]-
nEvents[2] <<
"\n"
178 <<
"...rejected since not enough jets : " << std::setw(7) <<
nEvents[2]-
nEvents[3] <<
"\n"
179 <<
"...rejected due to bad jet-parton matching : " << std::setw(7) <<
nEvents[3]-
nEvents[4] <<
"\n"
180 <<
"...accepted for training : " << std::setw(7) <<
nEvents[4] <<
"\n";
190 <<
"Chosen leptonType is not supported: " << str <<
"\n";
PhysicsTools::MVAComputerCache mvaComputer
Analysis-level MET class.
static const unsigned int nPartons
#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)
~TtSemiLepJetCombMVATrainer()
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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 &)
bool next_combination(BidIt n_begin, BidIt n_end, BidIt r_begin, BidIt r_end)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")