56 produces<std::vector<TtHadEvtSolution> >();
79 bool jetsFound =
false;
83 if (jets->size() >= 6) jetsFound =
true;
88 std::vector<TtHadEvtSolution> * evtsols =
new std::vector<TtHadEvtSolution>();
90 for (
unsigned int p=0;
p<3;
p++) {
91 for (
unsigned int q=
p+1;
q<4;
q++) {
92 for (
unsigned int j=
q+1;
j<5;
j++) {
93 for (
unsigned int k=
j+1;
k<6;
k++) {
94 for (
unsigned int bh=0; bh!=jets->size(); bh++) {
95 if(!(bh==
p || bh==
q || bh==
j || bh==
k)) {
96 for (
unsigned int bbarh=0; bbarh!=jets->size(); bbarh++) {
97 if (!(bbarh==
p || bbarh==
q || bbarh==
j || bbarh==
k) && !(bbarh==bh)) {
101 std::vector<TtHadEvtSolution> asol;
105 asol[0].setHadp(jets,
p);
106 asol[0].setHadq(jets,
q);
107 asol[0].setHadj(jets,
j);
108 asol[0].setHadk(jets,
k);
109 asol[0].setHadb(jets, bh);
110 asol[0].setHadbbar(jets, bbarh);
114 asol[1].setHadp(jets,
p);
115 asol[1].setHadq(jets,
j);
116 asol[1].setHadj(jets,
q);
117 asol[1].setHadk(jets,
k);
118 asol[1].setHadb(jets, bh);
119 asol[1].setHadbbar(jets, bbarh);
123 asol[2].setHadp(jets,
p);
124 asol[2].setHadq(jets,
k);
125 asol[2].setHadj(jets,
j);
126 asol[2].setHadk(jets,
q);
127 asol[2].setHadb(jets, bh);
128 asol[2].setHadbbar(jets, bbarh);
131 for(
unsigned int i=0;
i!=asol.size();
i++){
137 std::cout<<
"Fitting needed to decide on best solution, enable fitting!"<<std::endl;
141 for(
unsigned int i=0;
i!=asol.size();
i++){
142 (*myLRSignalSelObservables)(asol[
i]);
147 for(
unsigned int i=0;
i!=asol.size();
i++){
148 (*myLRSignalSelCalc)(asol[
i]);
153 for(
unsigned int i=0;
i!=asol.size();
i++){
154 (*myLRJetCombObservables)(asol[
i]);
159 for(
unsigned int i=0;
i!=asol.size();
i++){
160 (*myLRJetCombCalc)(asol[
i]);
167 for(
unsigned int i=0;
i!=asol.size();
i++){
168 evtsols->push_back(asol[
i]);
181 int simpleBestJetComb = (*mySimpleBestJetComb)(*evtsols);
183 for(
size_t s=0;
s<evtsols->size();
s++){
184 (*evtsols)[
s].setSimpleBestJetComb(simpleBestJetComb);
187 int bestSolution = -999;
188 int bestSolutionChangeW1Q = -999;
189 int bestSolutionChangeW2Q = -999;
192 std::vector<const reco::Candidate*> quarks;
199 quarks.push_back( &genp );
200 quarks.push_back( &genq );
201 quarks.push_back( &genb );
202 quarks.push_back( &genj );
203 quarks.push_back( &genk );
204 quarks.push_back( &genbbar );
205 std::vector<const reco::Candidate*>
jets;
206 for(
size_t s=0;
s<evtsols->size();
s++) {
214 jets.push_back( &jetp );
215 jets.push_back( &jetq );
216 jets.push_back( &jetbh );
217 jets.push_back( &jetj );
218 jets.push_back( &jetk );
219 jets.push_back( &jetbbar );
221 (*evtsols)[
s].setGenEvt(genEvt);
236 bestSolutionChangeW2Q = 0;
239 bestSolutionChangeW1Q = 0;
243 bestSolutionChangeW1Q = 1;
248 bestSolutionChangeW2Q = 1;
251 bestSolutionChangeW1Q = 1;
255 bestSolutionChangeW1Q = 0;
260 bestSolutionChangeW2Q = 0;
263 bestSolutionChangeW1Q = 0;
266 bestSolutionChangeW1Q = 1;
271 for(
size_t s=0;
s<evtsols->size();
s++) {
272 (*evtsols)[
s].setMCBestJetComb(bestSolution);
273 (*evtsols)[
s].setMCChangeW1Q(bestSolutionChangeW1Q);
274 (*evtsols)[
s].setMCChangeW2Q(bestSolutionChangeW2Q);
281 std::unique_ptr<std::vector<TtHadEvtSolution> > pOut(evtsols);
284 std::cout<<
"No calibrated solutions built, because only "<<jets->size()<<
" were present";
286 std::unique_ptr<std::vector<TtHadEvtSolution> > pOut(evtsols);
T getParameter(std::string const &) const
const reco::GenParticle * b() const
return b quark if available; 0 else
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
TtHadLRSignalSelObservables * myLRSignalSelObservables
TtHadSimpleBestJetComb * mySimpleBestJetComb
TtFullHadKinFitter * myKinFitter
std::vector< int > lrJetCombObs_
TtHadEvtSolution addKinFitInfo(TtHadEvtSolution *asol)
add kin fit information to the old event solution (in for legacy reasons)
edm::EDGetTokenT< std::vector< pat::Jet > > jetSrcToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::string lrSignalSelFile_
Steering class for the overall hadronic top likelihood.
std::string lrJetCombFile_
TtHadLRJetCombCalc * myLRJetCombCalc
std::vector< unsigned int > constraints_
Class to calculate the jet combination LR value and purity from a root-file with fit functions...
Based on the TtSemiSimpleBestJetComb.by: Jan Heyninck version: TtSemiSimpleBestJetComb.cc,v 1.2 2007/06/09 01:17:40 lowette Exp.
const reco::GenParticle * daughterQuarkOfWPlus(bool invertQuarkCharge=false, bool invertBosonCharge=false) const
return quark daughter quark of W boson
const reco::GenParticle * bBar() const
return anti-b quark if available; 0 else
edm::EDGetTokenT< TtGenEvent > genEvtToken_
~TtHadEvtSolutionMaker()
destructor
TtHadEvtSolutionMaker(const edm::ParameterSet &iConfig)
constructor
TtHadLRJetCombObservables * myLRJetCombObservables
int getMatchForParton(const unsigned int part, const unsigned int comb=0)
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
void setJetParametrisation(int jp)
const reco::GenParticle * daughterQuarkBarOfWMinus() const
return anti-quark daughter of anti-W boson
TtHadLRSignalSelCalc * myLRSignalSelCalc
const reco::GenParticle * daughterQuarkBarOfWPlus() const
return anti-quark daughter of W boson
double getSumDistances(const unsigned int comb=0)
const reco::GenParticle * daughterQuarkOfWMinus() const
return quark daughter of anti-W boson
double getDistanceForParton(const unsigned int part, const unsigned int comb=0)
std::vector< int > lrSignalSelObs_