69 produces<std::vector<TtSemiEvtSolution> >();
91 bool leptonFound =
false;
101 if (!electrons->empty())
106 bool metFound =
false;
113 bool jetsFound =
false;
116 if (jets->size() >= 4)
122 std::vector<TtSemiEvtSolution>* evtsols =
new std::vector<TtSemiEvtSolution>();
123 if (leptonFound && metFound && jetsFound) {
126 if (jets->size() < nrCombJets)
127 nrCombJets = jets->size();
129 for (
unsigned int p = 0;
p < nrCombJets;
p++) {
130 for (
unsigned int q = 0;
q < nrCombJets;
q++) {
131 for (
unsigned int bh = 0; bh < nrCombJets; bh++) {
132 if (
q >
p && !(bh ==
p || bh ==
q)) {
133 for (
unsigned int bl = 0; bl < nrCombJets; bl++) {
134 if (!(bl ==
p || bl ==
q || bl == bh)) {
156 if (genEvt->numberOfBQuarks() ==
158 genEvt->numberOfLeptons() ==
164 (*myLRSignalSelObservables)(asol, *
jets);
170 (*myLRSignalSelCalc)(asol);
175 (*myLRJetCombObservables)(asol,
iEvent);
180 (*myLRJetCombCalc)(asol);
187 evtsols->push_back(asol);
197 int bestSolution = -999;
198 int bestSolutionChangeWQ = -999;
201 if (genEvt->numberOfBQuarks() ==
203 genEvt->numberOfLeptons() ==
205 std::vector<const reco::Candidate*> quarks;
210 quarks.push_back(&genp);
211 quarks.push_back(&genq);
212 quarks.push_back(&genbh);
213 quarks.push_back(&genbl);
214 std::vector<const reco::Candidate*> recjets;
215 for (
size_t s = 0;
s < evtsols->size();
s++) {
221 recjets.push_back(&jetp);
222 recjets.push_back(&jetq);
223 recjets.push_back(&jetbh);
224 recjets.push_back(&jetbl);
226 (*evtsols)[
s].setGenEvt(genEvt);
235 bestSolutionChangeWQ = 0;
238 bestSolutionChangeWQ = 1;
243 for (
size_t s = 0;
s < evtsols->size();
s++) {
244 (*evtsols)[
s].setMCBestJetComb(bestSolution);
245 (*evtsols)[
s].setMCChangeWQ(bestSolutionChangeWQ);
250 int simpleBestJetComb = (*mySimpleBestJetComb)(*evtsols);
251 for (
size_t s = 0;
s < evtsols->size();
s++)
252 (*evtsols)[
s].setSimpleBestJetComb(simpleBestJetComb);
256 float bestLRVal = -1000000;
257 int bestSol = (*evtsols)[0].getLRBestJetComb();
258 for (
size_t s = 0;
s < evtsols->size();
s++) {
259 if ((*evtsols)[
s].getLRJetCombLRval() > bestLRVal) {
260 bestLRVal = (*evtsols)[
s].getLRJetCombLRval();
264 for (
size_t s = 0;
s < evtsols->size();
s++) {
265 (*evtsols)[
s].setLRBestJetComb(bestSol);
270 std::unique_ptr<std::vector<TtSemiEvtSolution> > pOut(evtsols);
283 std::unique_ptr<std::vector<TtSemiEvtSolution> > pOut(evtsols);
301 throw cms::Exception(
"WrongConfig") <<
"Chosen jet parametrization is not supported: " << val <<
"\n";
326 throw cms::Exception(
"WrongConfig") <<
"Chosen fit constraint is not supported: " << val <<
"\n";
333 std::vector<TtSemiLepKinFitter::Constraint>
result;
334 for (
unsigned i = 0;
i < val.size(); ++
i) {
void setLepb(const edm::Handle< std::vector< pat::Jet > > &jet, int i)
TtSemiLRJetCombCalc * myLRJetCombCalc
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< std::vector< pat::Electron > > electronSrcToken_
Param
supported parameterizations
TtSemiLepKinFitter * myKinFitter
TtSemiLRJetCombObservables * myLRJetCombObservables
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TtSemiSimpleBestJetComb * mySimpleBestJetComb
std::vector< unsigned > constraints_
void setGenEvt(const edm::Handle< TtGenEvent > &aGenEvt)
TtSemiLepKinFitter::Param param(unsigned)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
edm::EDGetTokenT< std::vector< pat::Muon > > muonSrcToken_
Simple method to get the correct jet combination in semileptonic ttbar events.
void setHadp(const edm::Handle< std::vector< pat::Jet > > &jet, int i)
void setLeptonParametrisation(int lp)
void setMuon(const edm::Handle< std::vector< pat::Muon > > &muon, int i)
Class to calculate the jet combination LR value and purity from a root-file with fit functions...
~TtSemiEvtSolutionMaker() override
destructor
void setJetCorrectionScheme(int scheme)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< std::vector< pat::MET > > metSrcToken_
void setJetParametrisation(int jp)
Class to calculate the jet combination LR value and purity from a root-file with fit functions...
tuple genp
produce generated paricles in acceptance #
TtSemiEvtSolutionMaker(const edm::ParameterSet &iConfig)
constructor
void setElectron(const edm::Handle< std::vector< pat::Electron > > &elec, int i)
std::string lrSignalSelFile_
TtSemiEvtSolution addKinFitInfo(TtSemiEvtSolution *asol)
add kin fit information to the old event solution (in for legacy reasons)
Steering class for the overall top-lepton likelihood.
edm::EDGetTokenT< std::vector< pat::Jet > > jetSrcToken_
T getParameter(std::string const &) const
TtSemiLepKinFitter::Constraint constraint(unsigned)
int getMatchForParton(const unsigned int part, const unsigned int comb=0)
void setNeutrinoParametrisation(int mp)
edm::EDGetTokenT< TtGenEvent > genEvtToken_
void setNeutrino(const edm::Handle< std::vector< pat::MET > > &met, int i)
std::vector< int > lrSignalSelObs_
std::vector< TtSemiLepKinFitter::Constraint > constraints(std::vector< unsigned > &)
TtSemiLRSignalSelObservables * myLRSignalSelObservables
double getSumDistances(const unsigned int comb=0)
void setHadb(const edm::Handle< std::vector< pat::Jet > > &jet, int i)
std::string leptonFlavour_
std::string lrJetCombFile_
std::vector< int > lrJetCombObs_
void setHadq(const edm::Handle< std::vector< pat::Jet > > &jet, int i)
Constraint
supported constraints
TtSemiLRSignalSelCalc * myLRSignalSelCalc
double getDistanceForParton(const unsigned int part, const unsigned int comb=0)