13 etaRanges(pSet.getParameter< vector<double> >(
"etaRanges")),
14 ptRanges(pSet.getParameter< vector<double> >(
"ptRanges")),
17 moduleConfig(pSet.getParameter< vector<
edm::
ParameterSet> >(
"tagConfig")),
18 flavPlots_(pSet.getParameter<
std::
string >(
"flavPlots")),
19 makeDiffPlots_(pSet.getParameter<
bool >(
"differentialPlots"))
40 for (vector<edm::ParameterSet>::const_iterator iModule =
moduleConfig.begin();
42 const string& dataFormatType = iModule->exists(
"type") ?
43 iModule->getParameter<
string>(
"type") :
45 if (dataFormatType ==
"JetTag") {
52 }
else if (dataFormatType ==
"TagCorrelation") {
69 bool etaActive_ , ptActive_;
70 double etaMin_, etaMax_, ptMin_, ptMax_;
93 return EtaPtBin(etaActive_, etaMin_, etaMax_, ptActive_, ptMin_, ptMax_);
103 const int iEtaStart = -1 ;
105 const int iPtStart = -1 ;
110 int iTag = -1;
int iTagCorr = -1;
int iInfoTag = -1;
111 for (vector<edm::ParameterSet>::const_iterator iModule =
moduleConfig.begin();
114 const string& dataFormatType = iModule->exists(
"type") ?
115 iModule->getParameter<
string>(
"type") :
117 const bool& doCTagPlots = iModule->exists(
"doCTagPlots") ?
118 iModule->getParameter<
bool>(
"doCTagPlots") :
121 if (dataFormatType ==
"JetTag") {
123 const string& folderName = iModule->getParameter<
string>(
"folder");
126 auto differentialPlotsConstantEta = std::make_unique< std::vector<std::unique_ptr<BTagDifferentialPlot>> >();
127 auto differentialPlotsConstantPt = std::make_unique< std::vector<std::unique_ptr<BTagDifferentialPlot>> >();
130 const double& effBConst =
131 iModule->getParameter<
edm::ParameterSet>(
"parameters").getParameter<double>(
"effBConst");
134 for (
int iEta = iEtaStart; iEta < iEtaEnd; iEta++) {
136 differentialPlotsConstantEta->push_back(
std::move(etaConstDifferentialPlot));
139 for (
int iPt = iPtStart; iPt < iPtEnd; iPt++) {
142 differentialPlotsConstantPt->push_back(
std::move(ptConstDifferentialPlot));
146 for (
int iEta = iEtaStart; iEta < iEtaEnd; iEta++) {
148 for (
int iPt = iPtStart; iPt < iPtEnd; iPt++) {
153 bool doDifferentialPlots = iModule->exists(
"differentialPlots") && iModule->getParameter<
bool>(
"differentialPlots") ==
true;
154 std::shared_ptr<JetTagPlotter> jetTagPlotter = std::make_shared<JetTagPlotter>(folderName, etaPtBin,
160 (*differentialPlotsConstantEta)[iEta+1]->addBinPlotter(jetTagPlotter);
161 (*differentialPlotsConstantPt)[iPt+1] ->addBinPlotter(jetTagPlotter);
167 differentialPlots.at(iTag).reserve(differentialPlotsConstantEta->size() + differentialPlotsConstantPt->size());
168 differentialPlots.at(iTag).insert(
differentialPlots.at(iTag).end(), std::make_move_iterator(differentialPlotsConstantEta->begin()), std::make_move_iterator(differentialPlotsConstantEta->end()));
169 differentialPlots.at(iTag).insert(
differentialPlots.at(iTag).end(), std::make_move_iterator(differentialPlotsConstantPt->begin()), std::make_move_iterator(differentialPlotsConstantPt->end()));
174 }
else if (dataFormatType ==
"TagCorrelation") {
180 for (
int iEta = iEtaStart; iEta != iEtaEnd; ++iEta) {
182 for (
int iPt = iPtStart; iPt != iPtEnd; ++iPt) {
185 std::unique_ptr<TagCorrelationPlotter> tagCorrelationPlotter = std::make_unique<TagCorrelationPlotter>(label1.
label(), label2.label(), etaPtBin,
187 mcPlots_, doCTagPlots,
true, ibook);
195 const string& folderName = iModule->getParameter<
string>(
"folder");
197 for (
int iEta = iEtaStart; iEta < iEtaEnd; iEta++) {
199 for (
int iPt = iPtStart; iPt < iPtEnd; iPt++) {
204 std::unique_ptr<BaseTagInfoPlotter> jetTagPlotter = theFactory.
buildPlotter(dataFormatType, moduleLabel.
label(),
216 for (
unsigned int iJetLabel = 0; iJetLabel !=
binJetTagPlotters.size(); ++iJetLabel) {
218 for (
int iPlotter = 0; iPlotter != plotterSize; ++iPlotter) {
226 iPlotter->process(ibook);
234 for (
auto& iPlotter: iJetLabel) {
235 iPlotter->finalize(ibook, iget);
242 for (
int iPlotter = 0; iPlotter != plotterSize; ++iPlotter) {
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
std::unique_ptr< BaseTagInfoPlotter > buildPlotter(const std::string &dataFormatType, const std::string &tagName, const EtaPtBin &etaPtBin, const edm::ParameterSet &pSet, const std::string &folderName, unsigned int mc, bool wf, DQMStore::IBooker &ibook)