63 debugOn(iConfig.getUntrackedParameter<
bool>(
"debugOn")),
65 ptmin(iConfig.getUntrackedParameter<double>(
"ptmin")),
66 thresh(iConfig.getUntrackedParameter<
int>(
"thresh")),
67 numtrack(iConfig.getUntrackedParameter<unsigned
int>(
"numtrack")),
85 bool passesRunControl =
false;
90 edm::LogInfo(
"FilterOutLowPt")<<
"run number:" <<iEvent.
id().
run()<<
" keeping runs:"<<runControlNumber<<std::endl;
97 edm::LogInfo(
"FilterOutLowPt")<<
"run number"<< runControlNumber <<
" match!"<<std::endl;
99 passesRunControl =
true;
103 if (!passesRunControl)
return false;
120 reco::TrackCollection::const_iterator itk = tkColl->begin();
121 reco::TrackCollection::const_iterator itk_e = tkColl->end();
122 for(;itk!=itk_e;++itk){
127 fraction = numhighpurity;
128 if(fraction>=
thresh) accepted=
true;
132 int ievt = iEvent.
id().
event();
133 int irun = iEvent.
id().
run();
137 edm::LogInfo(
"FilterOutLowPt")<<
" Run " << irun <<
" Event " << ievt <<
" Lumi Block " << ils <<
" Bunch Crossing " << bx <<
" Fraction " << fraction <<
" NTracks " << tkColl->size() <<
" Accepted " << accepted << std::endl;
142 unsigned int iRun = iEvent.
id().
run();
147 std::pair<int,int> mypass = std::make_pair(1,0);
148 if(accepted) mypass.second = 1;
166 <<
"###################################### \n" 167 <<
"# FilterOutLowPt::endJob() report \n" 168 <<
"# Number of analyzed events: "<<
trials<<
" \n" 169 <<
"# Number of accpeted events: "<<
passes<<
" \n" 170 <<
"# Efficiency: "<< eff*100 <<
" +/- " << eff_err*100 <<
" %\n" 171 <<
"######################################";
173 edm::LogVerbatim(
"FilterOutLowPt")<<
"###################################### \n" 174 <<
"# Filter Summary events accepted by run";
176 edm::LogVerbatim(
"FilterOutLowPt")<<
"# run:" << it.first <<
" => events tested: " << (it.second).
first <<
" | events passed: " << (it.second).second;
177 edm::LogVerbatim(
"FilterOutLowPt")<<
"###################################### \n";
184 std::vector<unsigned int> defaultRuns;
185 defaultRuns.push_back(0);
188 desc.
setComment(
"Filters out soft events without at least `numtrack` tracks with pT> `ptmin`");
196 desc.
addUntracked<std::vector<unsigned int> >(
"runControlNumber",defaultRuns);
197 descriptions.
add(
"filterOutLowPt", desc);
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken
EventNumber_t event() const
EventAuxiliary const & eventAuxiliary() const override
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TrackQuality
track quality
const unsigned int numtrack
std::vector< Track > TrackCollection
collection of Tracks
int bunchCrossing() const
edm::LuminosityBlockNumber_t luminosityBlock() const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
void setComment(std::string const &value)
#define DEFINE_FWK_MODULE(type)
std::map< unsigned int, std::pair< int, int > > eventsInRun_
FilterOutLowPt(const edm::ParameterSet &)
bool filter(edm::Event &, const edm::EventSetup &) override
reco::TrackBase::TrackQuality _trackQuality
static TrackQuality qualityByName(const std::string &name)
T const * product() const
bool accepted(std::vector< std::string_view > const &, std::string_view)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
~FilterOutLowPt() override
const std::vector< unsigned int > runControlNumbers_
static void fillDescriptions(edm::ConfigurationDescriptions &)