6 : jetsToken_(consumes<std::
vector<pat::
Jet> >(cfg.getParameter<edm::
InputTag>(
"jets"))) {
12 if (cfg.
exists(
"jetCorrectionLevel")) {
15 produces<std::vector<std::pair<reco::CompositeCandidate, std::vector<int> > > >();
24 std::vector<std::vector<int> > matchVec;
28 matchVec = *matchHandle;
30 std::vector<int> dummyMatch;
31 for (
unsigned int i = 0;
i < 4; ++
i)
32 dummyMatch.push_back(-1);
33 matchVec.push_back(dummyMatch);
37 std::unique_ptr<std::vector<std::pair<reco::CompositeCandidate, std::vector<int> > > > pOut(
39 std::unique_ptr<int> pKey(
new int);
42 unsigned int idMatch = 0;
43 typedef std::vector<std::vector<int> >::iterator MatchVecIterator;
44 for (MatchVecIterator
match = matchVec.begin();
match != matchVec.end(); ++
match) {
49 pOut->push_back(std::make_pair(
hypo(), *
match));
83 addFourMomenta.
set(wBar);
86 addFourMomenta.
set(topBar);
91 addFourMomenta.
set(w);
94 addFourMomenta.
set(top);
99 addFourMomenta.
set(hyp);
109 <<
"Unconfigured jetCorrectionLevel. Please use an appropriate, non-empty string.\n";
112 if (!(quarkType ==
"wQuarkMix" || quarkType ==
"udsQuark" || quarkType ==
"cQuark" || quarkType ==
"bQuark"))
113 throw cms::Exception(
"Configuration") << quarkType <<
" is unknown as a quarkType for the jetCorrectionLevel.\n";
120 if (level ==
"L5Flavor:" || level ==
"L6UE:" || level ==
"L7Parton:") {
121 if (quarkType ==
"wQuarkMix") {
124 if (quarkType ==
"udsQuark") {
127 if (quarkType ==
"cQuark") {
130 if (quarkType ==
"bQuark") {
145 std::string step = correctionLevel.substr(0, correctionLevel.find(
':'));
146 std::string flavor = correctionLevel.substr(1 + correctionLevel.find(
':'));
147 float corrFactor = 1.;
148 if (flavor ==
"wMix")
149 corrFactor = 0.75 * ptr->jecFactor(step,
"uds") + 0.25 * ptr->jecFactor(step,
"charm");
151 corrFactor = ptr->jecFactor(step, flavor);
152 return std::make_unique<reco::ShallowClonePtrCandidate>(ptr, ptr->charge(), ptr->p4() * corrFactor, ptr->vertex());
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
int key() const
return key
std::unique_ptr< reco::ShallowClonePtrCandidate > makeCandidate(const edm::Handle< C > &handle, const int &idx)
use one object in a collection to set a ShallowClonePtrCandidate
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static const std::string LightPBar
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::string jetCorrectionLevel(const std::string &quarkType)
helper function to construct the proper correction level string for corresponding quarkType ...
static const std::string LightQ
std::unique_ptr< reco::ShallowClonePtrCandidate > b_
static const std::string Top
std::unique_ptr< reco::ShallowClonePtrCandidate > lightP_
static const std::string LightP
static const std::string WMinus
static const std::string B
virtual void buildHypo(edm::Event &event, const edm::Handle< std::vector< pat::Jet > > &jets, std::vector< int > &jetPartonAssociation, const unsigned int iComb)=0
build event hypothesis from the reco objects of a full-hadronic event
std::unique_ptr< reco::ShallowClonePtrCandidate > bBar_
std::unique_ptr< reco::ShallowClonePtrCandidate > lightQ_
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
void produce(edm::Event &, const edm::EventSetup &) override
produce the event hypothesis as CompositeCandidate and Key
edm::EDGetTokenT< std::vector< std::vector< int > > > matchToken_
std::string jetCorrectionLevel_
static const std::string WPlus
std::unique_ptr< reco::ShallowClonePtrCandidate > lightPBar_
static const std::string BBar
static const std::string TopBar
virtual void buildKey()=0
build the event hypothesis key
T getParameter(std::string const &) const
void resetCandidates()
reset candidate pointers before hypo build process
TtFullHadHypothesis(const edm::ParameterSet &cfg)
default constructor
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
void set(reco::Candidate &c) const
set up a candidate
static const std::string LightQBar
reco::CompositeCandidate hypo()
return event hypothesis
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
input label for all necessary collections
std::unique_ptr< reco::ShallowClonePtrCandidate > lightQBar_