68 produces<std::vector<TtSemiEvtSolution> >();
90 bool leptonFound =
false;
94 if (muons->size() > 0) leptonFound =
true;
99 if (electrons->size() > 0) leptonFound =
true;
103 bool metFound =
false;
106 if (mets->size() > 0) metFound =
true;
109 bool jetsFound =
false;
112 if (jets->size() >= 4) jetsFound =
true;
117 std::vector<TtSemiEvtSolution> * evtsols =
new std::vector<TtSemiEvtSolution>();
118 if(leptonFound && metFound && jetsFound){
121 if (jets->size() < nrCombJets) nrCombJets = jets->size();
123 for (
unsigned int p=0;
p<nrCombJets;
p++) {
124 for (
unsigned int q=0;
q<nrCombJets;
q++) {
125 for (
unsigned int bh=0; bh<nrCombJets; bh++) {
126 if (
q>
p && !(bh==
p || bh==
q)) {
127 for (
unsigned int bl=0; bl<nrCombJets; bl++) {
128 if (!(bl==
p || bl==
q || bl==bh)) {
148 if (genEvt->numberOfBQuarks() == 2 &&
149 genEvt->numberOfLeptons() == 1) {
155 (*myLRSignalSelObservables)(asol, *
jets);
165 (*myLRJetCombObservables)(asol,
iEvent);
176 evtsols->push_back(asol);
186 int bestSolution = -999;
187 int bestSolutionChangeWQ = -999;
190 if (genEvt->numberOfBQuarks() == 2 &&
191 genEvt->numberOfLeptons() == 1) {
192 std::vector<const reco::Candidate*> quarks;
197 quarks.push_back( &genp );
198 quarks.push_back( &genq );
199 quarks.push_back( &genbh );
200 quarks.push_back( &genbl );
201 std::vector<const reco::Candidate*> recjets;
202 for(
size_t s=0;
s<evtsols->size();
s++) {
208 recjets.push_back( &jetp );
209 recjets.push_back( &jetq );
210 recjets.push_back( &jetbh );
211 recjets.push_back( &jetbl );
213 (*evtsols)[
s].setGenEvt(genEvt);
222 bestSolutionChangeWQ = 0;
225 bestSolutionChangeWQ = 1;
230 for(
size_t s=0;
s<evtsols->size();
s++) {
231 (*evtsols)[
s].setMCBestJetComb(bestSolution);
232 (*evtsols)[
s].setMCChangeWQ(bestSolutionChangeWQ);
237 int simpleBestJetComb = (*mySimpleBestJetComb)(*evtsols);
238 for(
size_t s=0;
s<evtsols->size();
s++) (*evtsols)[
s].setSimpleBestJetComb(simpleBestJetComb);
242 float bestLRVal = -1000000;
243 int bestSol = (*evtsols)[0].getLRBestJetComb();
244 for(
size_t s=0;
s<evtsols->size();
s++) {
245 if ((*evtsols)[
s].getLRJetCombLRval() > bestLRVal) {
246 bestLRVal = (*evtsols)[
s].getLRJetCombLRval();
250 for(
size_t s=0;
s<evtsols->size();
s++) {
251 (*evtsols)[
s].setLRBestJetComb(bestSol);
256 std::auto_ptr<std::vector<TtSemiEvtSolution> > pOut(evtsols);
270 std::auto_ptr<std::vector<TtSemiEvtSolution> > pOut(evtsols);
284 <<
"Chosen jet parametrization is not supported: " << val <<
"\n";
301 <<
"Chosen fit constraint is not supported: " << val <<
"\n";
309 std::vector<TtSemiLepKinFitter::Constraint>
result;
310 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)
TtSemiLRJetCombCalc * myLRJetCombCalc
Param
supported parameterizations
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
TtSemiLepKinFitter * myKinFitter
TtSemiLRJetCombObservables * myLRJetCombObservables
TtSemiSimpleBestJetComb * mySimpleBestJetComb
std::vector< unsigned > constraints_
void setGenEvt(const edm::Handle< TtGenEvent > &aGenEvt)
TtSemiLepKinFitter::Param param(unsigned)
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...
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void setJetCorrectionScheme(int scheme)
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 #
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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)
edm::InputTag electronSrc_
Steering class for the overall top-lepton likelihood.
TtSemiLepKinFitter::Constraint constraint(unsigned)
int getMatchForParton(const unsigned int part, const unsigned int comb=0)
void setNeutrinoParametrisation(int mp)
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)