13 if( !event.
getByToken(src_, src) )
return false;
22 if(!btagLabel_.isUninitialized()){
23 if( !event.
getByToken(src_, bjets) )
return false;
24 if( !event.
getByToken(btagLabel_, btagger) )
return false;
25 if( !event.
getByToken(pvs_, pvertex) )
return false;
31 if( !event.
getByToken(jetIDLabel_, jetID) )
return false;
37 if(!jetCorrector_.empty()){
39 if(setup.
find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
45 <<
"------------------------------------------------------------------------------------- \n" 46 <<
" No JetCorrectionsRecord available from EventSetup: \n" 47 <<
" - Jets will not be corrected. \n" 48 <<
" - If you want to change this add the following lines to your cfg file \n" 50 <<
" ## load jet corrections \n" 51 <<
" process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n" 52 <<
" process.prefer(\"ak5CaloL2L3\") \n" 54 <<
"------------------------------------------------------------------------------------- \n";
62 unsigned int idx =
obj-src->begin();
63 if( btagLabel_.isUninitialized() ?
true : (*btagger)[bjets->refAt(idx)]>btagWorkingPoint_ ){
64 bool passedJetID=
true;
66 if( jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(src->refAt(idx).get())){
67 passedJetID=(*jetIDSelect_)((*jetID)[src->refAt(idx)]);
76 bool accept=(min_>=0 ? n>=min_:
true) && (max_>=0 ? n<=max_:
true);
77 return (min_<0 && max_<0) ? (n>0):accept;
82 failed_(
false), maxNJets_(maxNJets), wMass_(wMass), massWBoson_(-1.), massTopQuark_(-1.),tmassWBoson_(-1),tmassTopQuark_(-1),mlb_(-1)
183 std::vector<int> maxPtIndices;
184 maxPtIndices.push_back(-1);
185 maxPtIndices.push_back(-1);
186 maxPtIndices.push_back(-1);
188 for(
int jdx=0; jdx<
maxNJets_; ++jdx){
if(jdx<=
idx)
continue;
189 for(
int kdx=0; kdx<
maxNJets_; ++kdx){
if(kdx==
idx || kdx==jdx)
continue;
191 if( maxPt<0. || maxPt<sum.pt() ){
193 maxPtIndices.clear();
194 maxPtIndices.push_back(
idx);
195 maxPtIndices.push_back(jdx);
196 maxPtIndices.push_back(kdx);
202 jets[maxPtIndices[1]].p4()+
203 jets[maxPtIndices[2]].p4()).
mass();
208 std::vector<int> wMassIndices;
209 wMassIndices.push_back(-1);
210 wMassIndices.push_back(-1);
211 for(
unsigned idx=0;
idx<maxPtIndices.size(); ++
idx){
212 for(
unsigned jdx=0; jdx<maxPtIndices.size(); ++jdx){
213 if( jdx==
idx || maxPtIndices[
idx]>maxPtIndices[jdx] )
continue;
215 if( wDist<0. || wDist>fabs(sum.mass()-
wMass_) ){
216 wDist=fabs(sum.mass()-
wMass_);
217 wMassIndices.clear();
218 wMassIndices.push_back(maxPtIndices[
idx]);
219 wMassIndices.push_back(maxPtIndices[jdx]);
224 jets[wMassIndices[1]].p4()).
mass();
bool failed_
indicate failed associations
virtual void scaleEnergy(double fScale)
scale energy of the jet
bool select(const edm::Event &event) override
apply selection
double masslb(reco::RecoCandidate *mu, const reco::MET &met, const reco::Jet &b)
calculate mlb estimate
double massTopQuark(const std::vector< reco::Jet > &jets)
calculate top quark mass estimate
void operator()(const std::vector< reco::Jet > &jets)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double wMass_
paramater of the w boson mass
Base class for all types of Jets.
double px() const final
x coordinate of momentum vector
double tmassTopQuark(reco::RecoCandidate *mu, const reco::MET &met, const reco::Jet &b)
calculate top quark transverse mass estimate
def setup(process, global_tag, zero_tesla=False)
double massWBoson(const std::vector< reco::Jet > &jets)
calculate W boson mass estimate
CalculateHLT(int maxNJets, double wMass)
default constructor
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
double massWBoson_
cache of w boson mass estimate
double mlb_
cache of mlb estimate
double massTopQuark_
cache of top quark mass estimate
const LorentzVector & p4() const final
four-momentum Lorentz vector
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
maxNJets
maximum number of jets taken into account per event for each hypothesis (this parameter is used in th...
double tmassWBoson(reco::RecoCandidate *mu, const reco::MET &met, const reco::Jet &b)
calculate W boson transverse mass estimate
double tmassWBoson_
cache of W boson transverse mass estimate
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
double py() const final
y coordinate of momentum vector
int maxNJets_
max. number of jets to be considered
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
double tmassTopQuark_
cache of top quark transverse mass estimate
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Power< A, B >::type pow(const A &a, const B &b)