40 for(
unsigned int j=0;
j<triggerPaths.size(); ++
j){
41 if(
accept(event, triggerTable, triggerPaths[
j])){
146 template <
typename Object>
182 template <
typename Object>
184 src_( cfg.getParameter<edm::InputTag>(
"src" )),
185 select_( cfg.getParameter<std::string>(
"select")),
211 template <
typename Object>
216 if( !event.
getByLabel(src_, src) )
return false;
220 if(!electronId_.label().empty()) {
221 if( !event.
getByLabel(electronId_, electronId) )
return false;
228 if(dynamic_cast<const reco::GsfElectron*>(&*
obj)){
229 unsigned int idx =
obj-src->begin();
230 if( electronId_.label().empty() ?
true : (*electronId)[src->refAt(idx)]>0.99 ){
231 if(select_(*
obj))++n;
236 if(select_(*
obj))++n;
239 bool accept=(min_>=0 ? n>=min_:
true) && (max_>=0 ? n<=max_:
true);
240 return (min_<0 && max_<0) ? (n>0):accept;
244 template <
typename Object>
249 if( !event.
getByLabel(src_, src) )
return false;
257 if(!btagLabel_.label().empty()){
258 if( !event.
getByLabel(src_, bjets) )
return false;
259 if( !event.
getByLabel(btagLabel_, btagger) )
return false;
265 if( !event.
getByLabel(jetIDLabel_, jetID) )
return false;
270 if(!jetCorrector_.empty()){
272 if(setup.
find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
278 <<
"------------------------------------------------------------------------------------- \n"
279 <<
" No JetCorrectionsRecord available from EventSetup: \n"
280 <<
" - Jets will not be corrected. \n"
281 <<
" - If you want to change this add the following lines to your cfg file \n"
283 <<
" ## load jet corrections \n"
284 <<
" process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
285 <<
" process.prefer(\"ak5CaloL2L3\") \n"
287 <<
"------------------------------------------------------------------------------------- \n";
295 unsigned int idx =
obj-src->begin();
296 if( btagLabel_.label().empty() ?
true : (*btagger)[bjets->refAt(idx)]>btagWorkingPoint_ ){
297 bool passedJetID=
true;
299 if( jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(src->refAt(idx).get())){
300 passedJetID=(*jetIDSelect_)((*jetID)[src->refAt(idx)]);
309 bool accept=(min_>=0 ? n>=min_:
true) && (max_>=0 ? n<=max_:
true);
310 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 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
edm::InputTag btagLabel_
choice for b-tag as extra selection type
StringCutObjectSelector< Object > select_
string cut selector
SelectionStep(const edm::ParameterSet &cfg)
default constructor