67 produces<std::vector<TtSemiEvtSolution> >();
89 bool leptonFound =
false;
93 if (muons->size() > 0) leptonFound =
true;
98 if (electrons->size() > 0) leptonFound =
true;
102 bool metFound =
false;
105 if (mets->size() > 0) metFound =
true;
108 bool jetsFound =
false;
111 if (jets->size() >= 4) jetsFound =
true;
116 std::vector<TtSemiEvtSolution> * evtsols =
new std::vector<TtSemiEvtSolution>();
117 if(leptonFound && metFound && jetsFound){
120 if (jets->size() <
nrCombJets) nrCombJets = jets->size();
124 for (
unsigned int bh=0; bh<
nrCombJets; bh++) {
125 if (
q>
p && !(bh==
p || bh==
q)) {
126 for (
unsigned int bl=0; bl<
nrCombJets; bl++) {
127 if (!(bl==
p || bl==
q || bl==bh)) {
154 (*myLRSignalSelObservables)(asol, *
jets);
164 (*myLRJetCombObservables)(asol,
iEvent);
175 evtsols->push_back(asol);
185 int bestSolution = -999;
186 int bestSolutionChangeWQ = -999;
191 std::vector<const reco::Candidate*> quarks;
196 quarks.push_back( &genp );
197 quarks.push_back( &genq );
198 quarks.push_back( &genbh );
199 quarks.push_back( &genbl );
200 std::vector<const reco::Candidate*> recjets;
201 for(
size_t s=0;
s<evtsols->size();
s++) {
207 recjets.push_back( &jetp );
208 recjets.push_back( &jetq );
209 recjets.push_back( &jetbh );
210 recjets.push_back( &jetbl );
212 (*evtsols)[
s].setGenEvt(genEvt);
221 bestSolutionChangeWQ = 0;
224 bestSolutionChangeWQ = 1;
229 for(
size_t s=0;
s<evtsols->size();
s++) {
230 (*evtsols)[
s].setMCBestJetComb(bestSolution);
231 (*evtsols)[
s].setMCChangeWQ(bestSolutionChangeWQ);
236 int simpleBestJetComb = (*mySimpleBestJetComb)(*evtsols);
237 for(
size_t s=0;
s<evtsols->size();
s++) (*evtsols)[
s].setSimpleBestJetComb(simpleBestJetComb);
241 float bestLRVal = -1000000;
242 int bestSol = (*evtsols)[0].getLRBestJetComb();
243 for(
size_t s=0;
s<evtsols->size();
s++) {
244 if ((*evtsols)[
s].getLRJetCombLRval() > bestLRVal) {
245 bestLRVal = (*evtsols)[
s].getLRJetCombLRval();
249 for(
size_t s=0;
s<evtsols->size();
s++) {
250 (*evtsols)[
s].setLRBestJetComb(bestSol);
255 std::unique_ptr<std::vector<TtSemiEvtSolution> > pOut(evtsols);
269 std::unique_ptr<std::vector<TtSemiEvtSolution> > pOut(evtsols);
283 <<
"Chosen jet parametrization is not supported: " << val <<
"\n";
300 <<
"Chosen fit constraint is not supported: " << val <<
"\n";
308 std::vector<TtSemiLepKinFitter::Constraint>
result;
309 for(
unsigned i=0;
i<val.size(); ++
i){
T getParameter(std::string const &) const
void setLepb(const edm::Handle< std::vector< pat::Jet > > &jet, int i)
const reco::GenParticle * hadronicDecayB(bool excludeTauLeptons=false) const
get b of hadronic decay branch
TtSemiLRJetCombCalc * myLRJetCombCalc
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< std::vector< pat::Electron > > electronSrcToken_
Param
supported parameterizations
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
TtSemiLepKinFitter * myKinFitter
TtSemiLRJetCombObservables * myLRJetCombObservables
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TtSemiSimpleBestJetComb * mySimpleBestJetComb
std::vector< unsigned > constraints_
const reco::GenParticle * hadronicDecayQuarkBar() const
get light anti-quark of hadronic decay branch
void setGenEvt(const edm::Handle< TtGenEvent > &aGenEvt)
TtSemiLepKinFitter::Param param(unsigned)
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...
void setJetCorrectionScheme(int scheme)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< std::vector< pat::MET > > metSrcToken_
const reco::GenParticle * hadronicDecayQuark(bool invertFlavor=false) const
get light quark of hadronic decay branch
void setJetParametrisation(int jp)
Class to calculate the jet combination LR value and purity from a root-file with fit functions...
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)
int numberOfBQuarks(bool fromTopQuark=true) const
return number of b quarks in the decay chain
Steering class for the overall top-lepton likelihood.
edm::EDGetTokenT< std::vector< pat::Jet > > jetSrcToken_
const reco::GenParticle * leptonicDecayB(bool excludeTauLeptons=false) const
get b of leptonic decay branch
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
~TtSemiEvtSolutionMaker()
destructor
double getDistanceForParton(const unsigned int part, const unsigned int comb=0)
int numberOfLeptons(bool fromWBoson=true) const
return number of leptons in the decay chain