6 maxNJets_ (cfg.getParameter<int> (
"maxNJets" )),
7 wMass_ (cfg.getParameter<double> (
"wMass" )),
8 useBTagging_ (cfg.getParameter<bool> (
"useBTagging" )),
9 bTagAlgorithm_ (cfg.getParameter<std::string>(
"bTagAlgorithm" )),
10 minBDiscBJets_ (cfg.getParameter<double> (
"minBDiscBJets" )),
11 maxBDiscLightJets_ (cfg.getParameter<double> (
"maxBDiscLightJets" )),
12 neutrinoSolutionType_(cfg.getParameter<int> (
"neutrinoSolutionType"))
16 <<
"Parameter maxNJets can not be set to " <<
maxNJets_ <<
". \n"
17 <<
"It has to be larger than 4 or can be set to -1 to take all jets.";
27 std::vector<int>&
match,
const unsigned int iComb)
29 if(leps->empty() || mets->empty() ||
jets->size()<4){
37 std::vector<bool> isBJet;
38 std::vector<bool> isLJet;
41 for(
int idx=0; idx<maxNJets; ++idx) {
49 for(
unsigned int i=0;
i<5; ++
i)
57 std::vector<int> closestToWMassIndices;
58 closestToWMassIndices.push_back(-1);
59 closestToWMassIndices.push_back(-1);
60 for(
int idx=0; idx<maxNJets; ++idx){
61 if(
useBTagging_ && (!isLJet[idx] || (cntBJets<=2 && isBJet[idx])))
continue;
62 for(
int jdx=(idx+1); jdx<maxNJets; ++jdx){
63 if(
useBTagging_ && (!isLJet[jdx] || (cntBJets<=2 && isBJet[jdx]) || (cntBJets==3 && isBJet[idx] && isBJet[jdx])))
continue;
67 if( wDist<0. || wDist>fabs(sum.mass()-
wMass_) ){
68 wDist=fabs(sum.mass()-
wMass_);
69 closestToWMassIndices.clear();
70 closestToWMassIndices.push_back(idx);
71 closestToWMassIndices.push_back(jdx);
83 for(
int idx=0; idx<maxNJets; ++idx){
86 if( idx!=closestToWMassIndices[0] && idx!=closestToWMassIndices[1] ){
88 (*jets)[closestToWMassIndices[0]].p4()+
89 (*jets)[closestToWMassIndices[1]].p4()+
91 if( maxPt<0. || maxPt<sum.pt() ){
106 for(
int idx=0; idx<maxNJets; ++idx){
109 if( idx!=closestToWMassIndices[0] && idx!=closestToWMassIndices[1] && idx!=hadB) {
111 (*jets)[idx].p4()+(*leps)[ 0 ].p4();
112 if( maxPt<0. || maxPt<sum.pt() ){
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets
double maxBDiscLightJets_
reco::ShallowClonePtrCandidate * lepton_
reco::ShallowClonePtrCandidate * lightQBar_
int neutrinoSolutionType_
reco::ShallowClonePtrCandidate * neutrino_
std::string bTagAlgorithm_
reco::ShallowClonePtrCandidate * hadronicB_
TtSemiLepHypWMassMaxSumPt(const edm::ParameterSet &)
~TtSemiLepHypWMassMaxSumPt()
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
virtual void buildHypo(edm::Event &, const edm::Handle< edm::View< reco::RecoCandidate > > &, const edm::Handle< std::vector< pat::MET > > &, const edm::Handle< std::vector< pat::Jet > > &, std::vector< int > &, const unsigned int iComb)
build event hypothesis from the reco objects of a semi-leptonic event
void setCandidate(const edm::Handle< C > &handle, const int &idx, reco::ShallowClonePtrCandidate *&clone)
use one object in a collection to set a ShallowClonePtrCandidate
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
reco::ShallowClonePtrCandidate * lightQ_
reco::ShallowClonePtrCandidate * leptonicB_
std::string jetCorrectionLevel(const std::string &quarkType)
helper function to construct the proper correction level string for corresponding quarkType ...