1 #ifndef TOPHLTDQMHELPERS
2 #define TOPHLTDQMHELPERS
46 for(
unsigned int j=0;
j<triggerPaths.size(); ++
j){
47 if(
acceptHLT(event, triggerTable, triggerPaths[
j])){
176 template <
typename Object>
230 template <
typename Object>
232 src_( cfg.getParameter<edm::InputTag>(
"src" )),
233 select_( cfg.getParameter<std::
string>(
"select")),
268 template <
typename Object>
273 if( !event.
getByToken(srcToken_, src) )
return false;
277 if(!electronId_.label().empty()) {
278 if( !event.
getByToken(electronIdToken_, electronId) )
return false;
285 if(dynamic_cast<const reco::GsfElectron*>(&*
obj)){
286 unsigned int idx =
obj-src->begin();
287 if( electronId_.label().empty() ?
true : ((int)(*electronId)[src->refAt(idx)] & eidPattern_) ){
288 if(select_(*
obj))++n;
293 if(select_(*
obj))++n;
296 bool accept=(min_>=0 ? n>=min_:
true) && (max_>=0 ? n<=max_:
true);
297 return (min_<0 && max_<0) ? (n>0):accept;
299 template <
typename Object>
304 if( !event.
getByToken(srcToken_, src) )
return false;
308 if(!electronId_.label().empty()) {
309 if( !event.
getByToken(electronIdToken_, electronId) )
return false;
316 if(select_(*
obj))++n;
318 bool accept=(min_>=0 ? n>=min_:
true) && (max_>=0 ? n<=max_:
true);
319 return (min_<0 && max_<0) ? (n>0):accept;
323 template <
typename Object>
328 if( !event.
getByToken(srcToken_, src) )
return false;
337 if(!btagLabel_.label().empty()){
338 if( !event.
getByToken(srcToken_, bjets) )
return false;
339 if( !event.
getByToken(btagToken_, btagger) )
return false;
340 if( !event.
getByToken(pvsToken_, pvertex) )
return false;
346 if( !event.
getByToken(jetIDToken_, jetID) )
return false;
352 if(!jetCorrector_.empty()){
354 if(setup.
find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
360 <<
"------------------------------------------------------------------------------------- \n"
361 <<
" No JetCorrectionsRecord available from EventSetup: \n"
362 <<
" - Jets will not be corrected. \n"
363 <<
" - If you want to change this add the following lines to your cfg file \n"
365 <<
" ## load jet corrections \n"
366 <<
" process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
367 <<
" process.prefer(\"ak5CaloL2L3\") \n"
369 <<
"------------------------------------------------------------------------------------- \n";
377 unsigned int idx =
obj-src->begin();
378 if( btagLabel_.label().empty() ?
true : (*btagger)[bjets->refAt(idx)]>btagWorkingPoint_ ){
379 bool passedJetID=
true;
381 if( jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(src->refAt(idx).get())){
382 passedJetID=(*jetIDSelect_)((*jetID)[src->refAt(idx)]);
391 bool accept=(min_>=0 ? n>=min_:
true) && (max_>=0 ? n<=max_:
true);
392 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
tuple met
____________________________________________________________________________||
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)
edm::EDGetTokenT< edm::View< reco::Vertex > > pvsToken_
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)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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
edm::EDGetTokenT< edm::ValueMap< float > > electronIdToken_
SelectionStepHLT(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
default constructor
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
edm::EDGetTokenT< reco::JetIDValueMap > jetIDToken_
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 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
StringCutObjectSelector< Object > select_
string cut selector
~SelectionStepHLT()
default destructor
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
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
static std::string const triggerPaths
edm::EDGetTokenT< reco::JetTagCollection > btagToken_
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
edm::EDGetTokenT< edm::View< Object > > srcToken_