40 for(
unsigned int j=0;
j<triggerPaths.size(); ++
j){
41 if(
accept(event, triggerTable, triggerPaths[
j])){
147 template <
typename Object>
194 template <
typename Object>
196 src_( cfg.getParameter<edm::InputTag>(
"src" )),
197 select_( cfg.getParameter<std::string>(
"select")),
227 template <
typename Object>
232 if( !event.
getByLabel(src_, src) )
return false;
236 if(!electronId_.label().empty()) {
237 if( !event.
getByLabel(electronId_, electronId) )
return false;
244 if(dynamic_cast<const reco::GsfElectron*>(&*
obj)){
245 unsigned int idx =
obj-src->begin();
246 if( electronId_.label().empty() ?
true : ((int)(*electronId)[src->refAt(idx)] & eidPattern_) ){
247 if(select_(*
obj))++n;
252 if(select_(*
obj))++n;
255 bool accept=(min_>=0 ? n>=min_:
true) && (max_>=0 ? n<=max_:
true);
256 return (min_<0 && max_<0) ? (n>0):accept;
260 template <
typename Object>
265 if( !event.
getByLabel(src_, src) )
return false;
273 if(!btagLabel_.label().empty()){
274 if( !event.
getByLabel(src_, bjets) )
return false;
275 if( !event.
getByLabel(btagLabel_, btagger) )
return false;
281 if( !event.
getByLabel(jetIDLabel_, jetID) )
return false;
286 if(!jetCorrector_.empty()){
288 if(setup.
find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
294 <<
"------------------------------------------------------------------------------------- \n"
295 <<
" No JetCorrectionsRecord available from EventSetup: \n"
296 <<
" - Jets will not be corrected. \n"
297 <<
" - If you want to change this add the following lines to your cfg file \n"
299 <<
" ## load jet corrections \n"
300 <<
" process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
301 <<
" process.prefer(\"ak5CaloL2L3\") \n"
303 <<
"------------------------------------------------------------------------------------- \n";
311 unsigned int idx =
obj-src->begin();
312 if( btagLabel_.label().empty() ?
true : (*btagger)[bjets->refAt(idx)]>btagWorkingPoint_ ){
313 bool passedJetID=
true;
315 if( jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(src->refAt(idx).get())){
316 passedJetID=(*jetIDSelect_)((*jetID)[src->refAt(idx)]);
325 bool accept=(min_>=0 ? n>=min_:
true) && (max_>=0 ? n<=max_:
true);
326 return (min_<0 && max_<0) ? (n>0):accept;
double massWBoson_
cache of w boson mass estimate
T getParameter(std::string const &) const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
bool select(const edm::Event &event)
apply selection
edm::InputTag src_
input collection
~Calculate()
default destructor
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
double massTopQuark_
cache of top quark mass estimate
bool accept() const
Has at least one path accepted the event?
double massTopQuark(const std::vector< reco::Jet > &jets)
calculate W boson mass estimate
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Strings const & triggerNames() const
double massWBoson(const std::vector< reco::Jet > &jets)
calculate W boson mass estimate
~SelectionStep()
default destructor
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
edm::InputTag jetIDLabel_
jetID as an extra selection type
Helper class for the calculation of a top and a W boson mass estime.
int min_
min/max for object multiplicity
tuple obj
Example code starts here #.
int maxNJets_
max. number of jets to be considered
double wMass_
paramater of the w boson mass
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
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
edm::InputTag electronId_
electronId label as extra selection type
double btagWorkingPoint_
choice of b-tag working point as extra selection type
Templated helper class to allow a selection on a certain object collection.
void operator()(const std::vector< reco::Jet > &jets)
bool failed_
indicate failed associations
Calculate(int maxNJets, double wMass)
default constructor
StringCutObjectSelector< reco::JetID > * jetIDSelect_
selection string on the jetID
std::string jetCorrector_
jet corrector as extra selection type
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
edm::InputTag btagLabel_
choice for b-tag as extra selection type
StringCutObjectSelector< Object > select_
string cut selector
SelectionStep(const edm::ParameterSet &cfg)
default constructor