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)
71 std::vector<int> closestToWMassIndices;
72 closestToWMassIndices.push_back(-1);
73 closestToWMassIndices.push_back(-1);
74 for(
int idx=0; idx<maxNJets; ++idx){
75 if(
useBTagging_ && (!isLJet[idx] || (cntBJets<=2 && isBJet[idx])))
continue;
76 for(
int jdx=(idx+1); jdx<maxNJets; ++jdx){
77 if(
useBTagging_ && (!isLJet[jdx] || (cntBJets<=2 && isBJet[jdx]) || (cntBJets==3 && isBJet[idx] && isBJet[jdx])))
continue;
81 if( wDist<0. || wDist>fabs(sum.mass()-
wMass_) ){
82 wDist=fabs(sum.mass()-
wMass_);
83 closestToWMassIndices.clear();
84 closestToWMassIndices.push_back(idx);
85 closestToWMassIndices.push_back(jdx);
101 (*jets)[closestToWMassIndices[0]].p4()+
102 (*jets)[closestToWMassIndices[1]].p4();
104 for(
int idx=0; idx<maxNJets; ++idx){
107 if( idx!=closestToWMassIndices[0] && idx!=closestToWMassIndices[1] ){
110 for(
int jdx=0; jdx<maxNJets; ++jdx){
113 if( jdx!=closestToWMassIndices[0] && jdx!=closestToWMassIndices[1] && jdx!=idx ){
115 if( deltaTop<0. || deltaTop>fabs(hadTop.mass()-lepTop.mass()) ){
116 deltaTop=fabs(hadTop.mass()-lepTop.mass());
bool isValid(const int &idx, const edm::Handle< std::vector< pat::Jet > > &jets)
check if index is in valid range of selected jets
reco::ShallowClonePtrCandidate * lepton_
reco::ShallowClonePtrCandidate * lightQBar_
int neutrinoSolutionType_
TtSemiLepHypWMassDeltaTopMass(const edm::ParameterSet &)
reco::ShallowClonePtrCandidate * neutrino_
~TtSemiLepHypWMassDeltaTopMass()
reco::ShallowClonePtrCandidate * hadronicB_
std::string bTagAlgorithm_
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
double maxBDiscLightJets_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
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
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
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 ...