CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HLTDQMFilterEffHists< ObjType > Class Template Reference

#include <HLTDQMFilterEffHists.h>

Public Member Functions

void bookHists (DQMStore::IBooker &iBooker, const std::vector< edm::ParameterSet > &histConfigs)
 
void fillHists (const ObjType &obj, const edm::Event &event, const edm::EventSetup &setup, const trigger::TriggerEvent &trigEvt)
 
 HLTDQMFilterEffHists (const edm::ParameterSet &config, std::string baseHistName, std::string hltProcess)
 

Static Public Member Functions

static edm::ParameterSetDescription makePSetDescription ()
 
static edm::ParameterSetDescription makePSetDescriptionHistConfigs ()
 

Private Member Functions

void book1D (DQMStore::IBooker &iBooker, const edm::ParameterSet &histConfig)
 
void book2D (DQMStore::IBooker &iBooker, const edm::ParameterSet &histConfig)
 

Private Attributes

std::string baseHistName_
 
std::string filterName_
 
std::string folderName_
 
std::vector< std::unique_ptr< HLTDQMHist< ObjType > > > histsPass_
 
std::vector< std::unique_ptr< HLTDQMHist< ObjType > > > histsTot_
 
std::string histTitle_
 
std::string hltProcess_
 
VarRangeCutColl< ObjType > rangeCuts_
 

Detailed Description

template<typename ObjType>
class HLTDQMFilterEffHists< ObjType >

Definition at line 36 of file HLTDQMFilterEffHists.h.

Constructor & Destructor Documentation

template<typename ObjType >
HLTDQMFilterEffHists< ObjType >::HLTDQMFilterEffHists ( const edm::ParameterSet config,
std::string  baseHistName,
std::string  hltProcess 
)
explicit

Definition at line 65 of file HLTDQMFilterEffHists.h.

67  :
68  rangeCuts_(config.getParameter<std::vector<edm::ParameterSet> >("rangeCuts")),
69  filterName_(config.getParameter<std::string>("filterName")),
70  histTitle_(config.getParameter<std::string>("histTitle")),
71  folderName_(config.getParameter<std::string>("folderName")),
72  baseHistName_(std::move(baseHistName)),
73  hltProcess_(std::move(hltProcess))
74 {
75 
76 }
T getParameter(std::string const &) const
VarRangeCutColl< ObjType > rangeCuts_
def move(src, dest)
Definition: eostools.py:511

Member Function Documentation

template<typename ObjType >
void HLTDQMFilterEffHists< ObjType >::book1D ( DQMStore::IBooker iBooker,
const edm::ParameterSet histConfig 
)
private

Definition at line 130 of file HLTDQMFilterEffHists.h.

References HLTDQMFilterEffHists< ObjType >::baseHistName_, RecoTauDiscriminantConfiguration::binLowEdges, DQMStore::IBooker::book1D(), Exception, HLTDQMFilterEffHists< ObjType >::filterName_, edm::ParameterSet::getParameter(), create_public_lumi_plots::hist, HLTDQMFilterEffHists< ObjType >::histsPass_, HLTDQMFilterEffHists< ObjType >::histsTot_, HLTDQMFilterEffHists< ObjType >::histTitle_, eostools::move(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by HLTDQMFilterEffHists< ObjType >::bookHists().

131 {
132  auto binLowEdgesDouble = histConfig.getParameter<std::vector<double> >("binLowEdges");
133  std::vector<float> binLowEdges;
134  for(double lowEdge : binLowEdgesDouble) binLowEdges.push_back(lowEdge);
135  auto nameSuffex = histConfig.getParameter<std::string>("nameSuffex");
136  auto mePass = iBooker.book1D((baseHistName_+filterName_+nameSuffex+"_pass").c_str(),
137  (histTitle_+nameSuffex+" Pass").c_str(),
138  binLowEdges.size()-1,&binLowEdges[0]);
139  std::unique_ptr<HLTDQMHist<ObjType> > hist;
140  auto vsVar = histConfig.getParameter<std::string>("vsVar");
141  auto vsVarFunc = hltdqm::getUnaryFuncFloat<ObjType>(vsVar);
142  if(!vsVarFunc) {
143  throw cms::Exception("ConfigError")<<" vsVar "<<vsVar<<" is giving null ptr (likely empty) in "<<__FILE__<<","<<__LINE__<<std::endl;
144  }
145  VarRangeCutColl<ObjType> rangeCuts(histConfig.getParameter<std::vector<edm::ParameterSet> >("rangeCuts"));
146  hist = std::make_unique<HLTDQMHist1D<ObjType,float> >(mePass->getTH1(),vsVar,vsVarFunc,rangeCuts);
147  histsPass_.emplace_back(std::move(hist));
148  auto meTot = iBooker.book1D((baseHistName_+filterName_+nameSuffex+"_tot").c_str(),
149  (histTitle_+nameSuffex+" Total").c_str(),
150  binLowEdges.size()-1,&binLowEdges[0]);
151  hist = std::make_unique<HLTDQMHist1D<ObjType,float> >(meTot->getTH1(),vsVar,vsVarFunc,rangeCuts);
152  histsTot_.emplace_back(std::move(hist));
153 
154 }
T getParameter(std::string const &) const
std::vector< std::unique_ptr< HLTDQMHist< ObjType > > > histsPass_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
std::vector< std::unique_ptr< HLTDQMHist< ObjType > > > histsTot_
def move(src, dest)
Definition: eostools.py:511
template<typename ObjType >
void HLTDQMFilterEffHists< ObjType >::book2D ( DQMStore::IBooker iBooker,
const edm::ParameterSet histConfig 
)
private

Definition at line 157 of file HLTDQMFilterEffHists.h.

References HLTDQMFilterEffHists< ObjType >::baseHistName_, DQMStore::IBooker::book2D(), Exception, HLTDQMFilterEffHists< ObjType >::filterName_, edm::ParameterSet::getParameter(), create_public_lumi_plots::hist, HLTDQMFilterEffHists< ObjType >::histsPass_, HLTDQMFilterEffHists< ObjType >::histsTot_, HLTDQMFilterEffHists< ObjType >::histTitle_, eostools::move(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by HLTDQMFilterEffHists< ObjType >::bookHists().

158 {
159  auto xBinLowEdgesDouble = histConfig.getParameter<std::vector<double> >("xBinLowEdges");
160  auto yBinLowEdgesDouble = histConfig.getParameter<std::vector<double> >("yBinLowEdges");
161  std::vector<float> xBinLowEdges;
162  std::vector<float> yBinLowEdges;
163  for(double lowEdge : xBinLowEdgesDouble) xBinLowEdges.push_back(lowEdge);
164  for(double lowEdge : yBinLowEdgesDouble) yBinLowEdges.push_back(lowEdge);
165  auto nameSuffex = histConfig.getParameter<std::string>("nameSuffex");
166  auto mePass = iBooker.book2D((baseHistName_+filterName_+nameSuffex+"_pass").c_str(),
167  (histTitle_+nameSuffex+" Pass").c_str(),
168  xBinLowEdges.size()-1,&xBinLowEdges[0],
169  yBinLowEdges.size()-1,&yBinLowEdges[0]);
170  std::unique_ptr<HLTDQMHist<ObjType> > hist;
171  auto xVar = histConfig.getParameter<std::string>("xVar");
172  auto yVar = histConfig.getParameter<std::string>("yVar");
173  auto xVarFunc = hltdqm::getUnaryFuncFloat<ObjType>(xVar);
174  auto yVarFunc = hltdqm::getUnaryFuncFloat<ObjType>(yVar);
175  if(!xVarFunc || !yVarFunc) {
176  throw cms::Exception("ConfigError")<<" xVar "<<xVar<<" or yVar "<<yVar<<" is giving null ptr (likely empty str passed)"<<std::endl;
177  }
178  VarRangeCutColl<ObjType> rangeCuts(histConfig.getParameter<std::vector<edm::ParameterSet> >("rangeCuts"));
179 
180 
181  //really? really no MonitorElement::getTH2...sigh
182  hist = std::make_unique<HLTDQMHist2D<ObjType,float> >(static_cast<TH2*>(mePass->getTH1()),xVar,yVar,xVarFunc,yVarFunc,rangeCuts);
183  histsPass_.emplace_back(std::move(hist));
184 
185  auto meTot = iBooker.book2D((baseHistName_+filterName_+nameSuffex+"_tot").c_str(),
186  (histTitle_+nameSuffex+" Total").c_str(),
187  xBinLowEdges.size()-1,&xBinLowEdges[0],
188  yBinLowEdges.size()-1,&yBinLowEdges[0]);
189 
190  hist = std::make_unique<HLTDQMHist2D<ObjType,float> >(static_cast<TH2*>(meTot->getTH1()),xVar,yVar,xVarFunc,yVarFunc,rangeCuts);
191  histsTot_.emplace_back(std::move(hist));
192 }
T getParameter(std::string const &) const
std::vector< std::unique_ptr< HLTDQMHist< ObjType > > > histsPass_
std::vector< std::unique_ptr< HLTDQMHist< ObjType > > > histsTot_
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
def move(src, dest)
Definition: eostools.py:511
template<typename ObjType >
void HLTDQMFilterEffHists< ObjType >::bookHists ( DQMStore::IBooker iBooker,
const std::vector< edm::ParameterSet > &  histConfigs 
)

Definition at line 114 of file HLTDQMFilterEffHists.h.

References HLTDQMFilterEffHists< ObjType >::book1D(), HLTDQMFilterEffHists< ObjType >::book2D(), Exception, HLTDQMFilterEffHists< ObjType >::folderName_, DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by HLTDQMFilterTnPEffHists< TagType, ProbeType >::bookHists().

115 {
116  iBooker.setCurrentFolder(folderName_);
117  for(auto& histConfig : histConfigs){
118  std::string histType = histConfig.getParameter<std::string>("histType");
119  if(histType=="1D"){
120  book1D(iBooker,histConfig);
121  }else if(histType=="2D"){
122  book2D(iBooker,histConfig);
123  }else{
124  throw cms::Exception("ConfigError")<<" histType "<<histType<<" not recognised"<<std::endl;
125  }
126  }
127 }
void book2D(DQMStore::IBooker &iBooker, const edm::ParameterSet &histConfig)
void book1D(DQMStore::IBooker &iBooker, const edm::ParameterSet &histConfig)
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
template<typename ObjType>
void HLTDQMFilterEffHists< ObjType >::fillHists ( const ObjType &  obj,
const edm::Event event,
const edm::EventSetup setup,
const trigger::TriggerEvent trigEvt 
)

Definition at line 195 of file HLTDQMFilterEffHists.h.

References HLTDQMFilterEffHists< ObjType >::filterName_, create_public_lumi_plots::hist, HLTDQMFilterEffHists< ObjType >::histsPass_, HLTDQMFilterEffHists< ObjType >::histsTot_, HLTDQMFilterEffHists< ObjType >::hltProcess_, hltdqm::passTrig(), and HLTDQMFilterEffHists< ObjType >::rangeCuts_.

Referenced by HLTDQMFilterTnPEffHists< TagType, ProbeType >::fillHists().

199 {
200 
201  for(auto& hist : histsTot_){
202  hist->fill(obj,event,setup,rangeCuts_);
203  }
204 
205  if(hltdqm::passTrig(obj.eta(),obj.phi(),trigEvt,filterName_,hltProcess_)){
206  for(auto& hist : histsPass_){
207  hist->fill(obj,event,setup,rangeCuts_);
208  }
209 
210  }
211 }
VarRangeCutColl< ObjType > rangeCuts_
std::vector< std::unique_ptr< HLTDQMHist< ObjType > > > histsPass_
std::vector< std::unique_ptr< HLTDQMHist< ObjType > > > histsTot_
bool passTrig(const float objEta, float objPhi, const trigger::TriggerEvent &trigEvt, const std::string &filterName, const std::string &processName)
Definition: UtilFuncs.h:14
template<typename ObjType >
edm::ParameterSetDescription HLTDQMFilterEffHists< ObjType >::makePSetDescription ( )
static

Definition at line 79 of file HLTDQMFilterEffHists.h.

References edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addVPSet(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by HLTDQMFilterTnPEffHists< TagType, ProbeType >::makePSetDescription().

80 {
82  desc.addVPSet("rangeCuts",VarRangeCut<ObjType>::makePSetDescription(),std::vector<edm::ParameterSet>());
83  desc.add<std::string>("filterName","");
84  desc.add<std::string>("histTitle","");
85  desc.add<std::string>("folderName","");
86  return desc;
87 }
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
template<typename ObjType >
edm::ParameterSetDescription HLTDQMFilterEffHists< ObjType >::makePSetDescriptionHistConfigs ( )
static

Definition at line 90 of file HLTDQMFilterEffHists.h.

References edm::ParameterSetDescription::addVPSet(), edm::ParameterSetDescription::ifValue(), eostools::move(), and or.

Referenced by HLTDQMFilterTnPEffHists< TagType, ProbeType >::makePSetDescriptionHistConfigs().

91 {
93 
94  //what this is doing is trival and is left as an exercise to the reader
95  auto histDescCases =
96  "1D" >>
97  (edm::ParameterDescription<std::vector<double> >("binLowEdges",std::vector<double>(),true) and
98  edm::ParameterDescription<std::string>("nameSuffex","",true) and
99  edm::ParameterDescription<std::string>("vsVar","",true)) or
100  "2D" >>
101  (edm::ParameterDescription<std::vector<double> >("xBinLowEdges",std::vector<double>(),true) and
102  edm::ParameterDescription<std::vector<double> >("yBinLowEdges",std::vector<double>(),true) and
103  edm::ParameterDescription<std::string>("nameSuffex","",true) and
104  edm::ParameterDescription<std::string>("xVar","",true) and
105  edm::ParameterDescription<std::string>("yVar","",true));
106 
107  desc.ifValue(edm::ParameterDescription<std::string>("histType","1D",true), std::move(histDescCases));
108  desc.addVPSet("rangeCuts",VarRangeCut<ObjType>::makePSetDescription(),std::vector<edm::ParameterSet>());
109  return desc;
110 }
return((rh^lh)&mask)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:152
HLT enums.
static edm::ParameterSetDescription makePSetDescription()
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

template<typename ObjType>
std::string HLTDQMFilterEffHists< ObjType >::baseHistName_
private
template<typename ObjType>
std::string HLTDQMFilterEffHists< ObjType >::filterName_
private
template<typename ObjType>
std::string HLTDQMFilterEffHists< ObjType >::folderName_
private

Definition at line 58 of file HLTDQMFilterEffHists.h.

Referenced by HLTDQMFilterEffHists< ObjType >::bookHists().

template<typename ObjType>
std::vector<std::unique_ptr<HLTDQMHist<ObjType> > > HLTDQMFilterEffHists< ObjType >::histsPass_
private
template<typename ObjType>
std::vector<std::unique_ptr<HLTDQMHist<ObjType> > > HLTDQMFilterEffHists< ObjType >::histsTot_
private
template<typename ObjType>
std::string HLTDQMFilterEffHists< ObjType >::histTitle_
private
template<typename ObjType>
std::string HLTDQMFilterEffHists< ObjType >::hltProcess_
private

Definition at line 60 of file HLTDQMFilterEffHists.h.

Referenced by HLTDQMFilterEffHists< ObjType >::fillHists().

template<typename ObjType>
VarRangeCutColl<ObjType> HLTDQMFilterEffHists< ObjType >::rangeCuts_
private

Definition at line 55 of file HLTDQMFilterEffHists.h.

Referenced by HLTDQMFilterEffHists< ObjType >::fillHists().