Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added hep17 folder, 2d eff plots for egammaHLT DQM and Validation #19699

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions DQMOffline/Trigger/interface/EgHLTEgCutCodes.h
Expand Up @@ -46,11 +46,11 @@ namespace egHLT {
HLTISOLHAD =0x00040000,
HLTISOLEM =0x00080000,
//track quaility cuts (hlt track algo isnt very forgiving)
CTFTRACK =0x00010000,
CTFTRACK =0x01000000,
//hlt quantities that are slightly different to reco
HLTDETAIN =0x00020000,
HLTDPHIIN =0x00040000,
HLTINVEINVP =0x00080000,
HLTDETAIN =0x02000000,
HLTDPHIIN =0x04000000,
HLTINVEINVP =0x08000000,
//flag that if its set, shows the code is invalid
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise they were similar to:
HLTISOLTRKSPHO=0x00020000,
HLTISOLHAD =0x00040000,
HLTISOLEM =0x00080000
I ask Gabi and she also thinks its a bug.

INVALID =0x80000000

Expand Down
4 changes: 2 additions & 2 deletions DQMOffline/Trigger/interface/EgHLTEleHLTFilterMon.h
Expand Up @@ -56,7 +56,7 @@ namespace egHLT {
private:
std::string filterName_;
const TrigCodes::TrigBitSet filterBit_;

bool doHEP_;
//we own the pointers in the vectors
//std::vector<MonElemManagerBase<OffEle>*> eleMonElems_;
std::vector<MonElemManagerBase<trigger::TriggerObject>*> trigMonElems_;
Expand All @@ -76,7 +76,7 @@ namespace egHLT {
EleHLTFilterMon(const EleHLTFilterMon&){}
EleHLTFilterMon& operator=(const EleHLTFilterMon&){return *this;}
public:
EleHLTFilterMon(MonElemFuncs& monElemFuncs, const std::string& filterName,TrigCodes::TrigBitSet filterBit,const BinData& bins,const CutMasks& masks);
EleHLTFilterMon(MonElemFuncs& monElemFuncs, const std::string& filterName,TrigCodes::TrigBitSet filterBit,const BinData& bins,const CutMasks& masks, bool doHEP);
~EleHLTFilterMon();


Expand Down
8 changes: 8 additions & 0 deletions DQMOffline/Trigger/interface/EgHLTMonElemFuncs.h
Expand Up @@ -13,6 +13,7 @@
#include "DQMOffline/Trigger/interface/EgHLTOffPho.h"
#include "DQMOffline/Trigger/interface/EgHLTMonElemWithCut.h"
#include "DQMOffline/Trigger/interface/EgHLTMonElemMgrEBEE.h"
#include "DQMOffline/Trigger/interface/EgHLTMonElemMgrHEP.h"
#include "DQMOffline/Trigger/interface/EgHLTDQMCut.h"
#include "DQMOffline/Trigger/interface/EgHLTMonElemContainer.h"
#include "DQMOffline/Trigger/interface/EgHLTBinData.h"
Expand Down Expand Up @@ -44,6 +45,9 @@ namespace egHLT {
void initStdEffHists(std::vector<MonElemWithCutBase<OffPho>*>& histVec,const std::string& filterName,const std::string& baseName,int nrBins,double xMin,double xMax,float (OffPho::*vsVarFunc)()const,const CutMasks& masks);
void initStdEffHists(std::vector<MonElemWithCutBase<OffPho>*>& histVec,const std::string& filterName,const std::string& baseName,const BinData::Data1D& bins,float (OffPho::*vsVarFunc)()const,const CutMasks& masks);

//for hep region plots
void initStdEleHistsHEP(std::vector<MonElemManagerBase<OffEle>*>& histVec,const std::string& filterName,const std::string& baseName,const BinData& bins);
void initStdPhoHistsHEP(std::vector<MonElemManagerBase<OffPho>*>& histVec,const std::string& filterName,const std::string& baseName,const BinData& bins);
//we own the passed in pointer
void initStdEleCutHists(std::vector<MonElemWithCutBase<OffEle>*>& histVec,const std::string& filterName,const std::string& baseName,const BinData& bins,EgHLTDQMCut<OffEle>* cut=nullptr);
void initStdPhoCutHists(std::vector<MonElemWithCutBase<OffPho>*>& histVec,const std::string& filterName,const std::string& baseName,const BinData& bins,EgHLTDQMCut<OffPho>* cut=nullptr);
Expand Down Expand Up @@ -84,6 +88,10 @@ namespace egHLT {
histVec.push_back(new MonElemMgrEBEE<T,varType>(iBooker, name,title,binData.nr,binData.min,binData.max,varFunc));
}

template<class T,typename varType> void addStdHistHEP( std::vector<MonElemManagerBase<T>*>& histVec,const std::string& name,const std::string& title,
const BinData::Data1D& binData,varType (T::*varFunc)()const){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the new template looks to be the exact same thing as the old one?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah - its a MonELemMgrHEP..:( got it

histVec.push_back(new MonElemMgrHEP<T,varType>(iBooker, name,title,binData.nr,binData.min,binData.max,varFunc));
}
//this function is special in that it figures out the Et cut from the trigger name
//it then passes the cut as normal into the other addTightLooseTrigHist functions
//it also makes an uncut et distribution
Expand Down
59 changes: 59 additions & 0 deletions DQMOffline/Trigger/interface/EgHLTMonElemMgrHEP.h
@@ -0,0 +1,59 @@
#ifndef DQMOFFLINE_TRIGGER_EGHLTMONELEMMGRHEP
#define DQMOFFLINE_TRIGGER_EGHLTMONELEMMGRHEP


#include "DQMOffline/Trigger/interface/EgHLTMonElemManager.h"

namespace egHLT {
template<class T,typename varType> class MonElemMgrHEP : public MonElemManagerBase<T>{
private:
MonElemManager<T,varType> hep17_;
MonElemManager<T,varType> hem17_;

public:
MonElemMgrHEP(DQMStore::IBooker &iBooker, const std::string& name,const std::string& title,int nrBins,float min,float max,varType (T::*varFunc)()const):
hep17_(iBooker, name+"_hep17","hep "+title,nrBins,min,max,varFunc),
hem17_(iBooker, name+"_hem17","hem "+title,nrBins,min,max,varFunc){}

~MonElemMgrHEP() override{}

void fill(const T& obj,float weight) override;

};

template<class T,typename varType> void MonElemMgrHEP<T,varType>::fill(const T& obj,float weight)
{
if(obj.detEta()<3.0 && obj.detEta()>1.3 && obj.phi()< -0.52 && obj.phi()>-0.87) hep17_.fill(obj,weight);
if(obj.detEta()>-3.0 && obj.detEta()<-1.3 && obj.phi()< -0.52 && obj.phi() >-0.87) hem17_.fill(obj,weight);
}





template<class T,typename varTypeX,typename varTypeY> class MonElemMgr2DHEP : public MonElemManagerBase<T>{

private:
MonElemManager2D<T,varTypeX,varTypeY> hep17_;
MonElemManager2D<T,varTypeX,varTypeY> hem17_;

public:
MonElemMgr2DHEP(DQMStore::IBooker &iBooker, const std::string& name,const std::string& title,int nrBinsX,double xMin,double xMax,int nrBinsY,double yMin,double yMax,
varTypeX (T::*varFuncX)()const,varTypeY (T::*varFuncY)()const):
hep17_(iBooker, name+"_hep17","Hep17 "+title,nrBinsX,xMin,xMax,nrBinsY,yMin,yMax,varFuncX,varFuncY),
hem17_(iBooker, name+"_hem17","Hem17 "+title,nrBinsX,xMin,xMax,nrBinsY,yMin,yMax,varFuncX,varFuncY){}

~MonElemMgr2DHEP(){}

void fill(const T& obj,float weight);

};

template<class T,typename varTypeX,typename varTypeY> void MonElemMgr2DHEP<T,varTypeX,varTypeY>::fill(const T& obj,float weight)
{
if(obj.detEta()<3.0 && obj.detEta()>1.3 && obj.phi()< -0.52 && obj.phi()>-0.87) hep17_.fill(obj,weight);
if(obj.detEta()>-3.0 && obj.detEta()<-1.3 && obj.phi()< -0.52 && obj.phi() >-0.87) hem17_.fill(obj,weight);
}
}
#endif

3 changes: 2 additions & 1 deletion DQMOffline/Trigger/interface/EgHLTOfflineSource.h
Expand Up @@ -68,7 +68,8 @@ class EgHLTOfflineSource : public DQMEDAnalyzer {
std::vector<egHLT::MonElemContainer<egHLT::OffPho>*> phoMonElems_; //mon elements for monitoring photons, we own them

std::string dirName_;

std::string subdirName_;
bool dohep_;
egHLT::OffEvt offEvt_;
egHLT::OffHelper offEvtHelper_;// this is where up wrap up nasty code which will be replaced by offical tools at some point
std::unique_ptr<egHLT::TrigCodes> trigCodes; // the only place instantiate them
Expand Down
4 changes: 2 additions & 2 deletions DQMOffline/Trigger/interface/EgHLTPhoHLTFilterMon.h
Expand Up @@ -56,7 +56,7 @@ namespace egHLT {
private:
std::string filterName_;
const TrigCodes::TrigBitSet filterBit_;

bool doHEP_;
//we own the pointers in the vectors
std::vector<MonElemManagerBase<trigger::TriggerObject>*> trigMonElems_;
std::vector<MonElemContainer<OffPho>*> phoEffHists_;
Expand All @@ -73,7 +73,7 @@ namespace egHLT {
PhoHLTFilterMon(const PhoHLTFilterMon&){}
PhoHLTFilterMon& operator=(const PhoHLTFilterMon&){return *this;}
public:
PhoHLTFilterMon(MonElemFuncs& monElemFuncs, std::string filterName,TrigCodes::TrigBitSet filterBit,const BinData& bins,const CutMasks& masks);
PhoHLTFilterMon(MonElemFuncs& monElemFuncs, std::string filterName,TrigCodes::TrigBitSet filterBit,const BinData& bins,const CutMasks& masks, bool doHEP);
~PhoHLTFilterMon();


Expand Down
6 changes: 6 additions & 0 deletions DQMOffline/Trigger/python/DQMOffline_Trigger_cff.py
Expand Up @@ -84,10 +84,16 @@

# offline DQM for running also on AOD (w/o the need of the RECO step on-the-fly)
## ADD here sequences/modules which rely ONLY on collections stored in the AOD format

egHLTOffDQMSource_HEP17 = egHLTOffDQMSource.clone()
egHLTOffDQMSource_HEP17.subDQMDirName=cms.string('HEP17')
egHLTOffDQMSource_HEP17.doHEP =cms.bool(True)

offlineHLTSourceOnAOD = cms.Sequence(
hltResults *
lumiMonitorHLTsequence *
egHLTOffDQMSource * ## NEEDED in VALIDATION, not really in MONITORING
egHLTOffDQMSource_HEP17 * ## NEEDED in VALIDATION, not really in MONITORING
muonFullOfflineDQM *
HLTTauDQMOffline *
fsqHLTOfflineSourceSequence *
Expand Down
3 changes: 2 additions & 1 deletion DQMOffline/Trigger/python/EgHLTOfflineSource_cfi.py
Expand Up @@ -10,7 +10,7 @@
egHLTOffDQMSource = cms.EDAnalyzer("EgHLTOfflineSource",
egHLTOffFiltersToMon,
binData = cms.PSet(egHLTOffDQMBinData,),

doHEP =cms.bool(False),
#products we need
triggerSummaryLabel = cms.InputTag("hltTriggerSummaryAOD","","HLT"),
hltTag = cms.string("HLT"),
Expand All @@ -29,6 +29,7 @@
HBHERecHitCollection = cms.InputTag("hbhereco"),
HFRecHitCollection = cms.InputTag("hfreco"),
DQMDirName=cms.string("HLT/EGM"),
subDQMDirName=cms.string("Source_Histos"),

BeamSpotProducer = cms.InputTag("offlineBeamSpot"),
CaloTowers = cms.InputTag("towerMaker"),
Expand Down
3 changes: 2 additions & 1 deletion DQMOffline/Trigger/python/ExoticaMonitoring_Client_cff.py
@@ -1,6 +1,6 @@
import FWCore.ParameterSet.Config as cms

from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
from DQMOffline.Trigger.HEP17Monitoring_Client_cff import *
from DQMOffline.Trigger.HTMonitoring_Client_cff import *
from DQMOffline.Trigger.METMonitoring_Client_cff import *

Expand Down Expand Up @@ -199,6 +199,7 @@
+ metClient
+ METplusTrackEfficiency
+ muonEfficiency
+ hep17Efficiency
)

from DQMOffline.Trigger.TrackingMonitoring_Client_cff import *
Expand Down
26 changes: 26 additions & 0 deletions DQMOffline/Trigger/python/HEP17Monitoring_Client_cff.py
@@ -0,0 +1,26 @@
import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester

hep17Efficiency = DQMEDHarvester("DQMGenericClient",
subDirs = cms.untracked.vstring("HLT/EgOffline/HEP17/*"),
verbose = cms.untracked.uint32(0), # Set to 2 for all messages
resolution = cms.vstring(),
efficiency = cms.vstring(
"ratio_et 'HEP17/HEM17; Et [GeV]; ratio' egamma_passFilter_et_hep17 egamma_passFilter_et_hem17",
"ratio_hOverE 'HEP17/HEM17; hOverE; ratio' egamma_passFilter_hOverE_hep17 egamma_passFilter_hOverE_hem17",
# "ratio_isolEM 'HEP17/HEM17; isolEM [GeV]; ratio' egamma_passFilter_isolEM_hep17 egamma_passFilter_isolEM_hem17",
# "ratio_isolHad 'HEP17/HEM17; isolHad [GeV]; ratio' egamma_passFilter_isolHad_hep17 egamma_passFilter_isolHad_hem17",
"ratio_sigmaIEtaIEta 'HEP17/HEM17; sigmaIEtaIEta; ratio' egamma_passFilter_sigmaIEtaIEta_hep17 egamma_passFilter_sigmaIEtaIEta_hem17",
"ratio_energy 'HEP17/HEM17; energy [GeV]; ratio' egamma_passFilter_energy_hep17 egamma_passFilter_energy_hem17",
"ratio_r9 'HEP17/HEM17; r9 ;ratio' egamma_passFilter_maxr9_hep17 egamma_passFilter_maxr9_hem17",

"ratio_phi 'HEP17/HEM17; phi [rad] ;ratio' egamma_passFilter_phi_hep17 egamma_passFilter_phi_hem17",
# "ratio_isolNrTrks 'HEP17/HEM17; isolNrTrks [GeV]; ratio' egamma_passFilter_isolNrTrks_hep17 egamma_passFilter_isolNrTrks_hem17",
"ratio_etSC 'HEP17/HEM17; etSC [GeV]; ratio' egamma_passFilter_etSC_hep17 egamma_passFilter_etSC_hem17",
"ratio_HLTenergy HEP17/HEM17; HLTenergy [GeV]; ratio' egamma_passFilter_HLTenergy_hep17 egamma_passFilter_HLTenergy_hem17",
"ratio_HLTphi 'HEP17/HEM17; HLTphi [rad]; ratio' egamma_passFilter_HLTphi_hep17 egamma_passFilter_HLTphi_hem17",
),
efficiencyProfile = cms.untracked.vstring(
),

)
34 changes: 24 additions & 10 deletions DQMOffline/Trigger/src/EgHLTEleHLTFilterMon.cc
Expand Up @@ -10,15 +10,17 @@

using namespace egHLT;

EleHLTFilterMon::EleHLTFilterMon(MonElemFuncs& monElemFuncs,const std::string& filterName,TrigCodes::TrigBitSet filterBit,const BinData& bins,const CutMasks& masks):
EleHLTFilterMon::EleHLTFilterMon(MonElemFuncs& monElemFuncs,const std::string& filterName,TrigCodes::TrigBitSet filterBit,const BinData& bins,const CutMasks& masks,bool doHEP):
filterName_(filterName),
filterBit_(filterBit)
filterBit_(filterBit),
doHEP_(doHEP)
{
bool doChargeSep = false;
bool monHLTFailedEle = false;
bool doFakeRate=false;
bool doTagAndProbe=false;
bool doN1andSingleEffs=false;
std::string histname="egamma";

eleMonElems_.push_back(new MonElemContainer<OffEle>());
//---Morse-------
Expand All @@ -28,10 +30,14 @@ EleHLTFilterMon::EleHLTFilterMon(MonElemFuncs& monElemFuncs,const std::string& f
eleMonElems_.push_back(new MonElemContainer<OffEle>("_posCharge"," q=+1 ",new ChargeCut<OffEle>(1)));
eleMonElems_.push_back(new MonElemContainer<OffEle>("_negCharge"," q=-1 ",new ChargeCut<OffEle>(-1)));
}

for(auto & eleMonElem : eleMonElems_){
monElemFuncs.initStdEleHists(eleMonElem->monElems(),filterName,filterName_+"_gsfEle_passFilter"+eleMonElem->name(),bins);
if(doHEP_){
monElemFuncs.initStdEleHistsHEP(eleMonElem->monElems(),filterName,histname+"_passFilter"+eleMonElem->name(),bins);
}else{
monElemFuncs.initStdEleHists(eleMonElem->monElems(),filterName,filterName_+"_gsfEle_passFilter"+eleMonElem->name(),bins);
}
}

if(monHLTFailedEle){
eleFailMonElems_.push_back(new MonElemContainer<OffEle>());
if(doChargeSep) {
Expand All @@ -40,9 +46,12 @@ EleHLTFilterMon::EleHLTFilterMon(MonElemFuncs& monElemFuncs,const std::string& f
}
}
for(size_t i=0;i<eleFailMonElems_.size();i++){
monElemFuncs.initStdEleHists(eleFailMonElems_[i]->monElems(),filterName,filterName_+"_gsfEle_failFilter"+eleMonElems_[i]->name(),bins);
if(doHEP_){
monElemFuncs.initStdEleHistsHEP(eleMonElems_[i]->monElems(),filterName,histname+"_passFilter"+eleMonElems_[i]->name(),bins);
}else{
monElemFuncs.initStdEleHists(eleFailMonElems_[i]->monElems(),filterName,filterName_+"_gsfEle_failFilter"+eleMonElems_[i]->name(),bins);
}
}


int effProbeCutCode = masks.probeEle;
int effTagCutCode = masks.stdEle;
Expand All @@ -62,6 +71,8 @@ EleHLTFilterMon::EleHLTFilterMon(MonElemFuncs& monElemFuncs,const std::string& f
// filterName_+"_gsfEle_effVsCharge"+eleEffHists_[i]->name(),bins.charge,&OffEle::chargeF);
}
}
if(!doHEP_)
{
typedef MonElemManager<ParticlePair<OffEle>,float > DiEleMon;
diEleMassBothME_ = new DiEleMon(monElemFuncs.getIB(), filterName_+"_diEle_bothPassFilter_mass",
filterName_+"_diEle_bothPassFilter Mass;M_{ee} (GeV/c^{2})",
Expand All @@ -76,21 +87,23 @@ EleHLTFilterMon::EleHLTFilterMon(MonElemFuncs& monElemFuncs,const std::string& f
diEleMassOnlyOneHighME_ = new DiEleMon(monElemFuncs.getIB(), filterName_+"_diEle_onlyOnePassFilter_massHigh",
filterName_+"_diEle_onlyOnePassFilter Mass;M_{ee} (GeV/c^{2})",
bins.massHigh.nr,bins.massHigh.min,bins.massHigh.max,&ParticlePair<OffEle>::mass);

}
}

EleHLTFilterMon::~EleHLTFilterMon()
{
for(auto & eleMonElem : eleMonElems_) delete eleMonElem;
for(auto & eleFailMonElem : eleFailMonElems_) delete eleFailMonElem;
for(auto & eleEffHist : eleEffHists_) delete eleEffHist;
if(!doHEP_)
{
delete diEleMassBothME_;
delete diEleMassOnlyOneME_;
delete diEleMassBothHighME_;
delete diEleMassOnlyOneHighME_;
}
}


void EleHLTFilterMon::fill(const OffEvt& evt,float weight)
{
for(size_t eleNr=0;eleNr<evt.eles().size();eleNr++){
Expand All @@ -108,7 +121,8 @@ void EleHLTFilterMon::fill(const OffEvt& evt,float weight)
for(size_t ele2Nr=ele1Nr+1;ele2Nr<evt.eles().size();ele2Nr++){
const OffEle& ele1 = evt.eles()[ele1Nr];
const OffEle& ele2 = evt.eles()[ele2Nr];

if(!doHEP_)
{
if((ele1.trigBits()&ele2.trigBits()&filterBit_)==filterBit_) {
diEleMassBothME_->fill(ParticlePair<OffEle>(ele1,ele2),weight);
diEleMassBothHighME_->fill(ParticlePair<OffEle>(ele1,ele2),weight);
Expand All @@ -118,7 +132,7 @@ void EleHLTFilterMon::fill(const OffEvt& evt,float weight)
diEleMassOnlyOneHighME_->fill(ParticlePair<OffEle>(ele1,ele2),weight);
}

}
}//end inner ele loop
}//end outer ele loop
}//end check if filter is present
Expand Down