23 return text.find(pattern)!=std::string::npos;
50 float d0 = 0.0,
dz=0.0;
52 d0=-(el.
gsfTrack()->dxy(pv_position));
55 edm::LogError(
"SUSY_HLT_SingleLepton") <<
"Could not read electron.gsfTrack().\n";
64 +
std::max(0.0, iso.sumNeutralHadronEt + iso.sumPhotonEt -0.5 * iso.sumPUPt);
65 const float relisowithdb = absiso/el.
pt();
67 bool pass_conversion =
false;
72 edm::LogError(
"SUSY_HLT_SingleLepton") <<
"Electron conversion matching failed.\n";
81 edm::LogError(
"SUSY_HLT_SingleLepton") <<
"Could not read electron.superCluster().\n";
86 }
else if(fabs(etasc)>1.479){
87 if(fabs(dEtaIn)>0.0106)
return false;
88 if(fabs(dPhiIn)>0.0359)
return false;
89 if(sigmaietaieta>0.0305)
return false;
90 if(hOverE>0.0835)
return false;
91 if(fabs(d0)>0.0163)
return false;
92 if(fabs(
dz)>0.5999)
return false;
93 if(fabs(ooemoop)>0.1126)
return false;
94 if(relisowithdb>0.2075)
return false;
95 if(!pass_conversion)
return false;
97 if(fabs(dEtaIn)>0.0091)
return false;
98 if(fabs(dPhiIn)>0.031)
return false;
99 if(sigmaietaieta>0.0106)
return false;
100 if(hOverE>0.0532)
return false;
101 if(fabs(d0)>0.0126)
return false;
102 if(fabs(
dz)>0.0116)
return false;
103 if(fabs(ooemoop)>0.0609)
return false;
104 if(relisowithdb>0.1649)
return false;
105 if(!pass_conversion)
return false;
114 if(mu.
globalTrack()->normalizedChi2()>=10.)
return false;
115 if(mu.
globalTrack()->hitPattern().numberOfValidMuonHits()<=0)
return false;
117 edm::LogWarning(
"SUSY_HLT_SingleLepton") <<
"Could not read muon.globalTrack().\n";
122 if(fabs(mu.
muonBestTrack()->dxy(pv_position))>=0.2)
return false;
123 if(fabs(mu.
muonBestTrack()->dz(pv_position))>=0.5)
return false;
125 edm::LogWarning(
"SUSY_HLT_SingleLepton") <<
"Could not read muon.muonBestTrack().\n";
129 if(mu.
innerTrack()->hitPattern().numberOfValidPixelHits()<=0)
return false;
130 if(mu.
innerTrack()->hitPattern().trackerLayersWithMeasurement()<=5)
return false;
132 edm::LogWarning(
"SUSY_HLT_SingleLepton") <<
"Could not read muon.innerTrack().\n";
140 theElectronTag_(ps.getParameter<
edm::InputTag>(
"electronCollection")),
142 theMuonTag_(ps.getParameter<
edm::InputTag>(
"muonCollection")),
144 thePfMETTag_(ps.getParameter<
edm::InputTag>(
"pfMetCollection")),
146 thePfJetTag_(ps.getParameter<
edm::InputTag>(
"pfJetCollection")),
148 theJetTagTag_(ps.getParameter<
edm::InputTag>(
"jetTagCollection")),
151 theVertexCollectionTag_(ps.getParameter<
edm::InputTag>(
"vertexCollection")),
153 theConversionCollectionTag_(ps.getParameter<
edm::InputTag>(
"conversionCollection")),
155 theBeamSpotTag_(ps.getParameter<
edm::InputTag>(
"beamSpot")),
156 theBeamSpot_(consumes<
reco::
BeamSpot>(theBeamSpotTag_)),
158 theLeptonFilterTag_(ps.getParameter<
edm::InputTag>(
"leptonFilter")),
159 theHLTHTTag_(ps.getParameter<
edm::InputTag>(
"hltHt")),
161 theHLTMETTag_(ps.getParameter<
edm::InputTag>(
"hltMet")),
163 theHLTJetCollectionTag_(ps.getParameter<
edm::InputTag>(
"hltJets")),
165 theHLTJetTagCollectionTag_(ps.getParameter<
edm::InputTag>(
"hltJetTags")),
168 theTriggerResultsTag_(ps.getParameter<
edm::InputTag>(
"triggerResults")),
169 theTriggerResults_(consumes<
edm::TriggerResults>(theTriggerResultsTag_)),
170 theTrigSummaryTag_(ps.getParameter<
edm::InputTag>(
"trigSummary")),
171 theTrigSummary_(consumes<
trigger::TriggerEvent>(theTrigSummaryTag_)),
175 HLTProcess_(ps.getParameter<
std::
string>(
"hltProcess")),
177 triggerPath_(ps.getParameter<
std::
string>(
"triggerPath")),
178 triggerPathAuxiliary_(ps.getParameter<
std::
string>(
"triggerPathAuxiliary")),
179 triggerPathLeptonAuxiliary_(ps.getParameter<
std::
string>(
"triggerPathLeptonAuxiliary")),
181 csvlCut_(ps.getUntrackedParameter<double>(
"csvlCut")),
182 csvmCut_(ps.getUntrackedParameter<double>(
"csvmCut")),
183 csvtCut_(ps.getUntrackedParameter<double>(
"csvtCut")),
185 jetPtCut_(ps.getUntrackedParameter<double>(
"jetPtCut")),
186 jetEtaCut_(ps.getUntrackedParameter<double>(
"jetEtaCut")),
187 metCut_(ps.getUntrackedParameter<double>(
"metCut")),
188 htCut_(ps.getUntrackedParameter<double>(
"htCut")),
190 lep_pt_threshold_(ps.getUntrackedParameter<double>(
"leptonPtThreshold")),
191 ht_threshold_(ps.getUntrackedParameter<double>(
"htThreshold")),
192 met_threshold_(ps.getUntrackedParameter<double>(
"metThreshold")),
193 csv_threshold_(ps.getUntrackedParameter<double>(
"csvThreshold")),
212 <<
"Constructor SUSY_HLT_SingleLepton::SUSY_HLT_SingleLepton\n";
217 <<
"Destructor SUSY_HLT_SingleLepton::~SUSY_HLT_SingleLepton\n";
225 <<
"Initialization of HLTConfigProvider failed!!\n";
229 bool pathFound =
false;
239 edm::LogInfo(
"SUSY_HLT_SingleLepton") <<
"SUSY_HLT_SingleLepton::beginRun\n";
244 edm::LogInfo(
"SUSY_HLT_SingleLepton") <<
"SUSY_HLT_SingleLepton::bookHistograms\n";
257 if(is_mu && !is_ele){
260 }
else if(is_ele && !is_mu){
267 (
";"+
Lepton+
" p_{T} [GeV];").c_str(),
270 (
";"+
Lepton+
" #eta;").c_str(),
273 (
";"+
Lepton+
" #phi;").c_str(),
296 (
"Numerator;Offline "+lepton+
" p_{T} [GeV];").c_str(),
299 (
"Denominator;Offline "+lepton+
" p_{T} [GeV];").c_str(),
302 "Numerator;Offline H_{T} [GeV];",
305 "Denominator;Offline H_{T} [GeV];",
310 "Numerator;Offline MET [GeV];",
313 "Denominator;Offline MET [GeV];",
319 "Numerator;Offline Max CSV Discriminant;",
322 "Denominator;Offline Max CSV Discriminant;",
326 "Numerator;Offline CSV Requirement;",
329 "Denominator;Offline CSV Requirements;",
340 edm::LogInfo(
"SUSY_HLT_SingleLepton") <<
"SUSY_HLT_SingleLepton::beginLuminosityBlock\n";
344 edm::LogInfo(
"SUSY_HLT_SingleLepton") <<
"SUSY_HLT_SingleLepton::analyze\n";
371 if( !HLTJetCollection.
isValid() ){
381 if( !HLTJetTagCollection.
isValid() ){
391 if( !VertexCollection.
isValid() ){
401 if( !ConversionCollection.
isValid() ){
421 if( !pfMETCollection.
isValid() ){
431 if( !pfJetCollection.
isValid() ){
441 if( !jetTagCollection.
isValid() ){
451 if( !ElectronCollection.
isValid() ){
461 if( !MuonCollection.
isValid() ){
479 if( !triggerSummary.
isValid() ){
486 std::vector<float> ptLepton, etaLepton, phiLepton;
491 if( !(filterIndex >= triggerSummary->
sizeFilters()) ){
492 size_t ilep = 0, num_keys = triggerSummary->
filterKeys(filterIndex).size();
493 ptLepton.resize(num_keys);
494 etaLepton.resize(num_keys);
495 phiLepton.resize(num_keys);
496 for(
const auto &
key: triggerSummary->
filterKeys(filterIndex)){
503 ptLepton.at(ilep)=foundObject.
pt();
504 etaLepton.at(ilep)=foundObject.
eta();
505 phiLepton.at(ilep)=foundObject.
phi();
512 const float hlt_ht = ((HLTHT.
isValid() && HLTHT->size())?HLTHT->front().sumEt():-1.0);
514 const float hlt_met = ((HLTMET.
isValid() && HLTMET->size())?HLTMET->front().pt():-1.0);
518 float hlt_csv = -1.0;
520 for(
const auto &
jet: *HLTJetTagCollection){
521 if(
jet.second>hlt_csv) hlt_csv =
jet.second;
527 bool hasFired =
false;
528 bool hasFiredAuxiliary =
false;
529 bool hasFiredLeptonAuxiliary =
false;
532 for(
unsigned int hltIndex = 0; hltIndex < trigNames.
size(); ++hltIndex ){
533 if(hltresults->
wasrun(hltIndex) && hltresults->
accept(hltIndex)){
546 for(
const auto &pfjet: *pfJetCollection){
555 if(pfMETCollection.
isValid() && pfMETCollection->size()){
556 pfMET = pfMETCollection->front().et();
561 unsigned num_csvl = 0;
562 unsigned num_csvm = 0;
563 unsigned num_csvt = 0;
564 if(jetTagCollection.
isValid()){
565 for(
const auto &
jet: *jetTagCollection){
566 const float CSV =
jet.second;
586 double lep_max_pt = -1.0;
587 if(VertexCollection.
isValid() && VertexCollection->size()){
589 if(ElectronCollection.
isValid()
590 && ConversionCollection.
isValid()
592 for(
const auto &
electron: *ElectronCollection){
593 if(IsGood(
electron, VertexCollection->front().position(),
602 for(
const auto &
muon: *MuonCollection){
603 if(IsGood(
muon, VertexCollection->front().position())){
604 if(
muon.pt()>lep_max_pt){
605 lep_max_pt=
muon.pt();
620 if(ht_plateau && met_plateau && csv_plateau
631 if(lep_plateau && met_plateau && csv_plateau){
637 if(lep_plateau && ht_plateau && csv_plateau){
643 if(lep_plateau && ht_plateau && met_plateau){
700 <<
"SUSY_HLT_SingleLepton::endLuminosityBlock\n";
704 edm::LogInfo(
"SUSY_HLT_SingleLepton") <<
"SUSY_HLT_SingleLepton::endRun\n";
const PflowIsolationVariables & pfIsolationVariables() const
edm::InputTag theElectronTag_
virtual double pt() const final
transverse momentum
bool wasrun() const
Was at least one path run?
edm::EDGetTokenT< edm::TriggerResults > theTriggerResults_
edm::InputTag theLeptonFilterTag_
std::string triggerPathLeptonAuxiliary_
edm::InputTag theConversionCollectionTag_
trigger::size_type sizeFilters() const
float eSuperClusterOverP() const
edm::InputTag theMuonTag_
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
virtual TrackRef innerTrack() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< reco::MuonCollection > theMuonCollection_
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::METCollection > theHLTMET_
virtual ~SUSY_HLT_SingleLepton()
edm::InputTag theTriggerResultsTag_
bool accept() const
Has at least one path accepted the event?
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &e) override
const std::vector< std::string > & triggerNames() const
names of trigger paths
const Keys & filterKeys(trigger::size_type index) const
void endRun(const edm::Run &run, const edm::EventSetup &eSetup) override
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
HLTConfigProvider fHltConfig_
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
bool isGlobalMuon() const
MonitorElement * h_triggerLepPt_
std::vector< Vertex > VertexCollection
collection of Vertex objects
MonitorElement * h_pfMetTurnOn_den_
math::XYZPoint Point
point in the space
void analyze(const edm::Event &e, const edm::EventSetup &eSetup) override
MonitorElement * h_leptonTurnOn_num_
MonitorElement * h_CSVTurnOn_num_
Strings::size_type size() const
MonitorElement * h_pfHTTurnOn_num_
JetFloatAssociation::Container JetTagCollection
edm::EDGetTokenT< reco::JetTagCollection > theJetTagCollection_
MonitorElement * h_CSVTurnOn_den_
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
edm::EDGetTokenT< reco::CaloJetCollection > theHLTJetCollection_
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
std::vector< Muon > MuonCollection
collection of Muon objects
float full5x5_sigmaIetaIeta() const
edm::InputTag theHLTMETTag_
Single trigger physics object (e.g., an isolated muon)
edm::EDGetTokenT< reco::GsfElectronCollection > theElectronCollection_
float deltaEtaSuperClusterTrackAtVtx() const
edm::InputTag theJetTagTag_
virtual TrackRef muonBestTrack() const
edm::InputTag thePfMETTag_
const TriggerObjectCollection & getObjects() const
void endLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &eSetup) override
edm::EDGetTokenT< reco::ConversionCollection > theConversionCollection_
MonitorElement * h_btagTurnOn_den_
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
float deltaPhiSuperClusterTrackAtVtx() const
float hcalOverEcal() const
MonitorElement * book1D(Args &&...args)
math::XYZPoint Point
point in the space
MonitorElement * h_triggerLepPhi_
edm::InputTag thePfJetTag_
std::vector< Electron > ElectronCollection
collectin of Electron objects
edm::EDGetTokenT< reco::JetTagCollection > theHLTJetTagCollection_
edm::InputTag theHLTJetCollectionTag_
edm::EDGetTokenT< reco::BeamSpot > theBeamSpot_
int numberOfMatchedStations(ArbitrationType type=SegmentAndTrackArbitration) const
edm::InputTag theTrigSummaryTag_
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
edm::EDGetTokenT< reco::PFJetCollection > thePfJetCollection_
static const char *const trigNames[]
edm::InputTag theBeamSpotTag_
MonitorElement * h_pfHTTurnOn_den_
void setCurrentFolder(const std::string &fullpath)
void beginLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &eSetup) override
std::string const & triggerName(unsigned int index) const
MonitorElement * h_triggerLepEta_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
MonitorElement * h_pfMetTurnOn_num_
edm::EDGetTokenT< reco::PFMETCollection > thePfMETCollection_
edm::EDGetTokenT< reco::VertexCollection > theVertexCollection_
std::vector< PFJet > PFJetCollection
collection of PFJet objects
edm::InputTag theHLTHTTag_
std::string triggerPathAuxiliary_
MonitorElement * h_btagTurnOn_num_
const Point & position() const
position
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
MonitorElement * h_maxCSV_
SUSY_HLT_SingleLepton(const edm::ParameterSet &ps)
MonitorElement * h_leptonTurnOn_den_
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
edm::EDGetTokenT< reco::METCollection > theHLTHT_
edm::InputTag theVertexCollectionTag_
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
edm::InputTag theHLTJetTagCollectionTag_