|
|
Go to the documentation of this file.
14 nJetsConsideredToken_(consumes<
int>(
cfg.getParameter<
edm::
InputTag>(
"nJetsConsidered"))),
15 numberOfRealNeutrinoSolutions_(-1),
23 if (
cfg.exists(
"match")) {
27 if (
cfg.exists(
"neutrinoSolutionType"))
31 if (
cfg.exists(
"jetCorrectionLevel")) {
34 produces<std::vector<std::pair<reco::CompositeCandidate, std::vector<int> > > >();
36 produces<int>(
"NumberOfRealNeutrinoSolutions");
37 produces<int>(
"NumberOfConsideredJets");
70 std::vector<std::vector<int> > matchVec;
74 matchVec = *matchHandle;
76 std::vector<int> dummyMatch;
77 for (
unsigned int i = 0;
i < 4; ++
i)
78 dummyMatch.push_back(-1);
79 matchVec.push_back(dummyMatch);
83 std::unique_ptr<std::vector<std::pair<reco::CompositeCandidate, std::vector<int> > > > pOut(
85 std::unique_ptr<int> pKey(
new int);
86 std::unique_ptr<int> pNeutrinoSolutions(
new int);
87 std::unique_ptr<int> pJetsConsidered(
new int);
90 unsigned int idMatch = 0;
91 typedef std::vector<std::vector<int> >::iterator MatchVecIterator;
92 for (MatchVecIterator
match = matchVec.begin();
match != matchVec.end(); ++
match) {
97 pOut->push_back(std::make_pair(
hypo(), *
match));
109 evt.
put(
std::move(pNeutrinoSolutions),
"NumberOfRealNeutrinoSolutions");
113 evt.
put(
std::move(pJetsConsidered),
"NumberOfConsideredJets");
140 addFourMomenta.
set(lepW);
143 addFourMomenta.
set(lepTop);
148 addFourMomenta.
set(hadW);
151 addFourMomenta.
set(hadTop);
156 addFourMomenta.
set(hyp);
165 if (dynamic_cast<const reco::Muon*>(
cand)) {
167 }
else if (dynamic_cast<const reco::GsfElectron*>(
cand)) {
178 <<
"Unconfigured jetCorrectionLevel. Please use an appropriate, non-empty string.\n";
181 if (!(quarkType ==
"wQuarkMix" || quarkType ==
"udsQuark" || quarkType ==
"cQuark" || quarkType ==
"bQuark"))
182 throw cms::Exception(
"Configuration") << quarkType <<
" is unknown as a quarkType for the jetCorrectionLevel.\n";
189 if (
level ==
"L5Flavor:" ||
level ==
"L6UE:" ||
level ==
"L7Parton:") {
190 if (quarkType ==
"wQuarkMix") {
193 if (quarkType ==
"udsQuark") {
196 if (quarkType ==
"cQuark") {
199 if (quarkType ==
"bQuark") {
216 std::string step = correctionLevel.substr(0, correctionLevel.find(
':'));
217 std::string flavor = correctionLevel.substr(1 + correctionLevel.find(
':'));
218 float corrFactor = 1.;
219 if (flavor ==
"wMix")
240 <<
"Type of lepton given together with MET for solving neutrino kinematics is neither muon nor electron.\n";
244 ptr->
px(), ptr->
py(), pz,
sqrt(ptr->
px() * ptr->
px() + ptr->
py() * ptr->
py() + pz * pz));
252 std::vector<int>&
match) {
static const std::string LepW
static const std::string Nu
edm::EDGetTokenT< std::vector< pat::Jet > > jetsToken_
input label for all necessary collections
reco::CompositeCandidate hypo()
return event hypothesis
static const std::string Lep
int neutrinoSolutionType_
algorithm used to calculate neutrino solutions (see cfi for further details)
virtual void buildKey()=0
build the event hypothesis key
void setNeutrino(const edm::Handle< std::vector< pat::MET > > &met, const edm::Handle< edm::View< reco::RecoCandidate > > &leps, const int &idx, const int &type)
set neutrino, using mW = 80.4 to calculate the neutrino pz
void setCandidate(const edm::Handle< C > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone)
use one object in a collection to set a ShallowClonePtrCandidate
static const std::string HadP
static const std::string HadQ
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
double py() const final
y coordinate of momentum vector
void SetLepton(const pat::Particle &lepton, bool isMuon=true)
Set lepton.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
reco::ShallowClonePtrCandidate * leptonicB_
bool IsComplex() const
check for complex root
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
static const std::string LepTop
edm::EDGetTokenT< edm::View< reco::RecoCandidate > > lepsToken_
reco::ShallowClonePtrCandidate * lightQBar_
edm::EDGetTokenT< std::vector< std::vector< int > > > matchToken_
double Calculate(int type=1)
member functions
void produce(edm::Event &, const edm::EventSetup &) override
produce the event hypothesis as CompositeCandidate and Key
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
reco::ShallowClonePtrCandidate * lightQ_
const LorentzVector & p4() const final
four-momentum Lorentz vector
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
~TtSemiLepHypothesis() override
default destructor
int charge() const final
electric charge
std::string jetCorrectionLevel(const std::string &quarkType)
helper function to construct the proper correction level string for corresponding quarkType
static const std::string HadW
std::string jetCorrectionLevel_
const Point & vertex() const override
vertex position (overwritten by PF...)
nJetsConsidered
number of considered jets
void SetMET(const pat::MET &MET)
Set MET.
reco::ShallowClonePtrCandidate * hadronicB_
static const std::string LepB
static const std::string HadTop
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void set(reco::Candidate &c) const
set up a candidate
edm::EDGetTokenT< std::vector< pat::MET > > metsToken_
reco::ShallowClonePtrCandidate * lepton_
edm::EDGetTokenT< int > nJetsConsideredToken_
TtSemiLepHypothesis(const edm::ParameterSet &)
default constructor
static const std::string HadB
double px() const final
x coordinate of momentum vector
reco::ShallowClonePtrCandidate * neutrino_
int numberOfRealNeutrinoSolutions_
void buildHypo(const edm::Handle< edm::View< reco::RecoCandidate > > &leps, const edm::Handle< std::vector< pat::MET > > &mets, const edm::Handle< std::vector< pat::Jet > > &jets, std::vector< int > &jetPartonAssociation)
minimalistic build function for simple hypotheses
float jecFactor(const std::string &level, const std::string &flavor="none", const std::string &set="") const
void resetCandidates()
reset candidate pointers before hypo build process
WDecay::LeptonType leptonType(const reco::RecoCandidate *cand)
determine lepton type of reco candidate and return a corresponding WDecay::LeptonType; the type is kN...
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets