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::analyze\n";
367 if( !HLTJetCollection.
isValid() ){
377 if( !HLTJetTagCollection.
isValid() ){
387 if( !VertexCollection.
isValid() ){
397 if( !ConversionCollection.
isValid() ){
417 if( !pfMETCollection.
isValid() ){
427 if( !pfJetCollection.
isValid() ){
437 if( !jetTagCollection.
isValid() ){
447 if( !ElectronCollection.
isValid() ){
457 if( !MuonCollection.
isValid() ){
475 if( !triggerSummary.
isValid() ){
482 std::vector<float> ptLepton, etaLepton, phiLepton;
487 if( !(filterIndex >= triggerSummary->
sizeFilters()) ){
488 size_t ilep = 0, num_keys = triggerSummary->
filterKeys(filterIndex).size();
489 ptLepton.resize(num_keys);
490 etaLepton.resize(num_keys);
491 phiLepton.resize(num_keys);
492 for(
const auto &
key: triggerSummary->
filterKeys(filterIndex)){
499 ptLepton.at(ilep)=foundObject.
pt();
500 etaLepton.at(ilep)=foundObject.
eta();
501 phiLepton.at(ilep)=foundObject.
phi();
508 const float hlt_ht = ((HLTHT.
isValid() && !HLTHT->empty())?HLTHT->front().sumEt():-1.0);
510 const float hlt_met = ((HLTMET.
isValid() && !HLTMET->empty())?HLTMET->front().pt():-1.0);
514 float hlt_csv = -1.0;
516 for(
const auto &
jet: *HLTJetTagCollection){
517 if(
jet.second>hlt_csv) hlt_csv =
jet.second;
523 bool hasFired =
false;
524 bool hasFiredAuxiliary =
false;
525 bool hasFiredLeptonAuxiliary =
false;
528 for(
unsigned int hltIndex = 0; hltIndex < trigNames.
size(); ++hltIndex ){
529 if(hltresults->
wasrun(hltIndex) && hltresults->
accept(hltIndex)){
542 for(
const auto &pfjet: *pfJetCollection){
551 if(pfMETCollection.
isValid() && !pfMETCollection->empty()){
552 pfMET = pfMETCollection->front().et();
557 unsigned num_csvl = 0;
558 unsigned num_csvm = 0;
559 unsigned num_csvt = 0;
560 if(jetTagCollection.
isValid()){
561 for(
const auto &
jet: *jetTagCollection){
562 const float CSV =
jet.second;
582 double lep_max_pt = -1.0;
583 if(VertexCollection.
isValid() && !VertexCollection->empty()){
585 if(ElectronCollection.
isValid()
586 && ConversionCollection.
isValid()
588 for(
const auto &
electron: *ElectronCollection){
589 if(IsGood(
electron, VertexCollection->front().position(),
598 for(
const auto &
muon: *MuonCollection){
599 if(IsGood(
muon, VertexCollection->front().position())){
600 if(
muon.pt()>lep_max_pt){
601 lep_max_pt=
muon.pt();
616 if(ht_plateau && met_plateau && csv_plateau
627 if(lep_plateau && met_plateau && csv_plateau){
633 if(lep_plateau && ht_plateau && csv_plateau){
639 if(lep_plateau && ht_plateau && met_plateau){
695 edm::LogInfo(
"SUSY_HLT_SingleLepton") <<
"SUSY_HLT_SingleLepton::endRun\n";
const PflowIsolationVariables & pfIsolationVariables() const
edm::InputTag theElectronTag_
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
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_
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)
MonitorElement * h_triggerLepPt_
double pt() const final
transverse momentum
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
void setCurrentFolder(std::string const &fullpath)
edm::InputTag thePfMETTag_
bool isGlobalMuon() const override
const TriggerObjectCollection & getObjects() const
edm::EDGetTokenT< reco::ConversionCollection > theConversionCollection_
MonitorElement * h_btagTurnOn_den_
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_
std::string const & triggerName(unsigned int index) const
MonitorElement * h_triggerLepEta_
~SUSY_HLT_SingleLepton() override
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_
SuperClusterRef superCluster() const override
reference to a SuperCluster
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_
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 TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
edm::InputTag theHLTJetTagCollectionTag_