1 #ifndef TOPHLTDQMHELPERS
2 #define TOPHLTDQMHELPERS
42 for(
unsigned int j=0;
j<triggerPaths.size(); ++
j){
43 if(
acceptHLT(event, triggerTable, triggerPaths[
j])){
172 template <
typename Object>
221 template <
typename Object>
223 src_( cfg.getParameter<edm::InputTag>(
"src" )),
224 select_( cfg.getParameter<std::string>(
"select")),
254 template <
typename Object>
259 if( !event.
getByLabel(src_, src) )
return false;
263 if(!electronId_.label().empty()) {
264 if( !event.
getByLabel(electronId_, electronId) )
return false;
271 if(dynamic_cast<const reco::GsfElectron*>(&*
obj)){
272 unsigned int idx =
obj-src->begin();
273 if( electronId_.label().empty() ?
true : ((int)(*electronId)[src->refAt(idx)] & eidPattern_) ){
274 if(select_(*
obj))++n;
279 if(select_(*
obj))++n;
282 bool accept=(min_>=0 ? n>=min_:
true) && (max_>=0 ? n<=max_:
true);
283 return (min_<0 && max_<0) ? (n>0):accept;
285 template <
typename Object>
290 if( !event.
getByLabel(src_, src) )
return false;
294 if(!electronId_.label().empty()) {
295 if( !event.
getByLabel(electronId_, electronId) )
return false;
302 if(select_(*
obj))++n;
304 bool accept=(min_>=0 ? n>=min_:
true) && (max_>=0 ? n<=max_:
true);
305 return (min_<0 && max_<0) ? (n>0):accept;
309 template <
typename Object>
314 if( !event.
getByLabel(src_, src) )
return false;
323 if(!btagLabel_.label().empty()){
324 if( !event.
getByLabel(src_, bjets) )
return false;
325 if( !event.
getByLabel(btagLabel_, btagger) )
return false;
326 if( !event.
getByLabel(pvs_, pvertex) )
return false;
332 if( !event.
getByLabel(jetIDLabel_, jetID) )
return false;
338 if(!jetCorrector_.empty()){
340 if(setup.
find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
346 <<
"------------------------------------------------------------------------------------- \n"
347 <<
" No JetCorrectionsRecord available from EventSetup: \n"
348 <<
" - Jets will not be corrected. \n"
349 <<
" - If you want to change this add the following lines to your cfg file \n"
351 <<
" ## load jet corrections \n"
352 <<
" process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
353 <<
" process.prefer(\"ak5CaloL2L3\") \n"
355 <<
"------------------------------------------------------------------------------------- \n";
363 unsigned int idx =
obj-src->begin();
364 if( btagLabel_.label().empty() ?
true : (*btagger)[bjets->refAt(idx)]>btagWorkingPoint_ ){
365 bool passedJetID=
true;
367 if( jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(src->refAt(idx).get())){
368 passedJetID=(*jetIDSelect_)((*jetID)[src->refAt(idx)]);
377 bool accept=(min_>=0 ? n>=min_:
true) && (max_>=0 ? n<=max_:
true);
378 return (min_<0 && max_<0) ? (n>0):accept;
edm::InputTag btagLabel_
choice for b-tag as extra selection type
T getParameter(std::string const &) const
edm::InputTag src_
input collection
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
bool failed_
indicate failed associations
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
bool acceptHLT(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
double masslb(reco::RecoCandidate *mu, const reco::MET &met, const reco::Jet &b)
calculate mlb estimate
edm::InputTag jetIDLabel_
jetID as an extra selection type
double massTopQuark(const std::vector< reco::Jet > &jets)
calculate top quark mass estimate
edm::InputTag electronId_
electronId label as extra selection type
void operator()(const std::vector< reco::Jet > &jets)
double wMass_
paramater of the w boson mass
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
Base class for all types of Jets.
int min_
min/max for object multiplicity
bool accept() const
Has at least one path accepted the event?
double tmassTopQuark(reco::RecoCandidate *mu, const reco::MET &met, const reco::Jet &b)
calculate top quark transverse mass estimate
bool exists(std::string const ¶meterName) const
checks if a parameter exists
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)
Strings const & triggerNames() const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
double massWBoson_
cache of w boson mass estimate
bool selectVertex(const edm::Event &event)
double mlb_
cache of mlb estimate
~CalculateHLT()
default destructor
double massTopQuark_
cache of top quark mass estimate
StringCutObjectSelector< reco::JetID > * jetIDSelect_
selection string on the jetID
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool select(const edm::Event &event)
apply selection
double tmassWBoson(reco::RecoCandidate *mu, const reco::MET &met, const reco::Jet &b)
calculate W boson transverse mass estimate
SelectionStepHLT(const edm::ParameterSet &cfg)
default constructor
StringCutObjectSelector< Object > select_
string cut selector
~SelectionStepHLT()
default destructor
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 ...
int maxNJets_
max. number of jets to be considered
double btagWorkingPoint_
choice of b-tag working point as extra selection type
std::string jetCorrector_
jet corrector as extra selection type
double tmassTopQuark_
cache of top quark transverse mass estimate
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")