6 jetsToken_(consumes<
std::vector<
pat::
Jet> >(cfg.getParameter<
edm::InputTag>(
"jets"))),
10 if( cfg.
exists(
"match") ) {
14 if( cfg.
exists(
"jetCorrectionLevel") ) {
17 produces<std::vector<std::pair<reco::CompositeCandidate, std::vector<int> > > >();
39 std::vector<std::vector<int> > matchVec;
43 matchVec = *matchHandle;
46 std::vector<int> dummyMatch;
47 for(
unsigned int i = 0;
i < 4; ++
i)
48 dummyMatch.push_back( -1 );
49 matchVec.push_back( dummyMatch );
53 std::unique_ptr<std::vector<std::pair<reco::CompositeCandidate, std::vector<int> > > >
55 std::unique_ptr<int> pKey(
new int);
58 unsigned int idMatch = 0;
59 typedef std::vector<std::vector<int> >::iterator MatchVecIterator;
60 for(MatchVecIterator
match = matchVec.begin();
match != matchVec.end(); ++
match) {
65 pOut->push_back( std::make_pair(
hypo(), *
match) );
104 addFourMomenta.
set( wBar );
107 addFourMomenta.
set( topBar );
112 addFourMomenta.
set( w );
115 addFourMomenta.
set( top );
120 addFourMomenta.
set( hyp );
132 <<
"Unconfigured jetCorrectionLevel. Please use an appropriate, non-empty string.\n";
135 if( !(quarkType==
"wQuarkMix" ||
136 quarkType==
"udsQuark" ||
137 quarkType==
"cQuark" ||
138 quarkType==
"bQuark") )
140 << quarkType <<
" is unknown as a quarkType for the jetCorrectionLevel.\n";
147 if( level==
"L5Flavor:" || level==
"L6UE:" || level==
"L7Parton:" ){
148 if(quarkType==
"wQuarkMix"){level+=
"wMix";}
149 if(quarkType==
"udsQuark" ){level+=
"uds";}
150 if(quarkType==
"cQuark" ){level+=
"charm";}
151 if(quarkType==
"bQuark" ){level+=
"bottom";}
167 std::string step = correctionLevel.substr(0,correctionLevel.find(
":"));
168 std::string flavor = correctionLevel.substr(1+correctionLevel.find(
":"));
169 float corrFactor = 1.;
173 corrFactor = ptr->
jecFactor(step, flavor);
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
int key() const
return key
void setCandidate(const edm::Handle< C > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone)
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 ...
def setup(process, global_tag, zero_tesla=False)
int charge() const final
electric charge
static const std::string LightQ
reco::ShallowClonePtrCandidate * lightPBar_
~TtFullHadHypothesis() override
default destructor
static const std::string Top
const Point & vertex() const override
vertex position (overwritten by PF...)
static const std::string LightP
reco::ShallowClonePtrCandidate * lightQBar_
static const std::string WMinus
const LorentzVector & p4() const final
four-momentum Lorentz vector
reco::ShallowClonePtrCandidate * lightP_
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
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
static const std::string BBar
static const std::string TopBar
virtual void buildKey()=0
build the event hypothesis key
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
reco::ShallowClonePtrCandidate * bBar_
void resetCandidates()
reset candidate pointers before hypo build process
reco::ShallowClonePtrCandidate * b_
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
float jecFactor(const std::string &level, const std::string &flavor="none", const std::string &set="") const
static const std::string LightQBar
reco::CompositeCandidate hypo()
return event hypothesis
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
input label for all necessary collections
reco::ShallowClonePtrCandidate * lightQ_