Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:04

0001 #include "DQMOffline/Trigger/interface/EgHLTMonElemFuncs.h"
0002 
0003 #include "DQMOffline/Trigger/interface/EgHLTMonElemMgrEBEE.h"
0004 #include "DQMOffline/Trigger/interface/EgHLTMonElemMgrHEP.h"
0005 #include "DQMOffline/Trigger/interface/EgHLTEgCutCodes.h"
0006 #include "DQMOffline/Trigger/interface/EgHLTDQMCut.h"
0007 #include "DQMOffline/Trigger/interface/EgHLTCutMasks.h"
0008 
0009 using namespace egHLT;
0010 
0011 void MonElemFuncs::initStdEleHists(std::vector<MonElemManagerBase<OffEle>*>& histVec,
0012                                    const std::string& filterName,
0013                                    const std::string& baseName,
0014                                    const BinData& bins) {
0015   addStdHist<OffEle, float>(
0016       histVec, baseName + "_energy", baseName + " reco CaloEnergy;reco CaloEnergy (GeV)", bins.energy, &OffEle::energy);
0017   addStdHist<OffEle, float>(histVec, baseName + "_et", baseName + " E_{T};E_{T} (GeV)", bins.et, &OffEle::et);
0018   addStdHist<OffEle, float>(histVec, baseName + "_etHigh", baseName + " E_{T};E_{T} (GeV)", bins.etHigh, &OffEle::et);
0019   addStdHist<OffEle, float>(
0020       histVec, baseName + "_etSC", baseName + " E^{SC}_{T};E^{SC}_{T} (GeV)", bins.et, &OffEle::etSC);
0021   addStdHist<OffEle, float>(histVec, baseName + "_eta", baseName + " #eta;#eta", bins.eta, &OffEle::detEta);
0022   addStdHist<OffEle, float>(histVec, baseName + "_phi", baseName + " #phi;#phi (rad)", bins.phi, &OffEle::phi);
0023   // addStdHist<OffEle,int>(histVec,baseName+"_charge",baseName+" Charge; charge",bins.charge,&OffEle::charge);
0024 
0025   addStdHist<OffEle, float>(histVec, baseName + "_hOverE", baseName + " H/E; H/E", bins.hOverE, &OffEle::hOverE);
0026   //----Morse
0027   addStdHist<OffEle, float>(histVec, baseName + "_maxr9", baseName + " MAXR9 ; MAXR9", bins.maxr9, &OffEle::r9);
0028   addStdHist<OffEle, float>(
0029       histVec, baseName + "_HLTenergy", baseName + " HLT Energy;HLT Energy (GeV)", bins.HLTenergy, &OffEle::hltEnergy);
0030   addStdHist<OffEle, float>(
0031       histVec, baseName + "_HLTeta", baseName + " HLT #eta;HLT #eta", bins.HLTeta, &OffEle::hltEta);
0032   addStdHist<OffEle, float>(
0033       histVec, baseName + "_HLTphi", baseName + " HLT #phi;HLT #phi (rad)", bins.HLTphi, &OffEle::hltPhi);
0034   //-------
0035   addStdHist<OffEle, float>(
0036       histVec, baseName + "_dPhiIn", baseName + " #Delta #phi_{in}; #Delta #phi_{in}", bins.dPhiIn, &OffEle::dPhiIn);
0037   addStdHist<OffEle, float>(
0038       histVec, baseName + "_dEtaIn", baseName + " #Delta #eta_{in}; #Delta #eta_{in}", bins.dEtaIn, &OffEle::dEtaIn);
0039   addStdHist<OffEle, float>(histVec,
0040                             baseName + "_sigmaIEtaIEta",
0041                             baseName + "#sigma_{i#etai#eta}; #sigma_{i#etai#eta}",
0042                             bins.sigEtaEta,
0043                             &OffEle::sigmaIEtaIEta);
0044   addStdHist<OffEle, float>(histVec, baseName + "_epIn", baseName + "E/p_{in}; E/p_{in}", bins.eOverP, &OffEle::epIn);
0045   addStdHist<OffEle, float>(
0046       histVec, baseName + "_epOut", baseName + "E/p_{out}; E/p_{out}", bins.eOverP, &OffEle::epOut);
0047   addStdHist<OffEle, float>(
0048       histVec, baseName + "_invEInvP", baseName + "1/E -1/p; 1/E - 1/p", bins.invEInvP, &OffEle::invEInvP);
0049 
0050   addStdHist<OffEle, float>(histVec,
0051                             baseName + "_e2x5Over5x5",
0052                             baseName + "E^{2x5}/E^{5x5}; E^{2x5}/E^{5x5}",
0053                             bins.e2x5,
0054                             &OffEle::e2x5MaxOver5x5);
0055   addStdHist<OffEle, float>(histVec,
0056                             baseName + "_e1x5Over5x5",
0057                             baseName + "E^{1x5}/E^{5x5}; E^{1x5}/E^{5x5}",
0058                             bins.e1x5,
0059                             &OffEle::e1x5Over5x5);
0060   //addStdHist<OffEle,float>(histVec,baseName+"_isolEM",baseName+"Isol EM; Isol EM (GeV)",bins.isolEm,&OffEle::isolEm);
0061   //addStdHist<OffEle,float>(histVec,baseName+"_isolHad",baseName+"Isol Had; Isol Had (GeV)",bins.isolHad,&OffEle::isolHad);
0062   //addStdHist<OffEle,float>(histVec,baseName+"_isolPtTrks",baseName+"Isol Pt Trks; Isol Pt Tracks (GeV/c)",bins.isolPtTrks,&OffEle::isolPtTrks);
0063   addStdHist<OffEle, float>(histVec,
0064                             baseName + "_hltIsolTrksEle",
0065                             baseName + "HLT Ele Isol Trks; HLT Ele Iso Tracks (GeV/c)",
0066                             bins.isolPtTrks,
0067                             &OffEle::hltIsolTrksEle);
0068   //addStdHist<OffEle,float>(histVec,baseName+"_hltIsolTrksPho",baseName+"HLT Pho Isol Trks; HLT Pho Iso Tracks (GeV/c)",bins.isolPtTrks,&OffEle::hltIsolTrksPho);
0069   addStdHist<OffEle, float>(histVec,
0070                             baseName + "_hltIsolHad",
0071                             baseName + "HLT Isol Had; HLT Isol Had (GeV)",
0072                             bins.isolHad,
0073                             &OffEle::hltIsolHad);
0074   addStdHist<OffEle, float>(
0075       histVec, baseName + "_hltIsolEm", baseName + "HLT Isol Em; HLT Isol Em (GeV)", bins.isolEm, &OffEle::hltIsolEm);
0076   addStdHist<OffEle, float>(histVec,
0077                             baseName + "_DeltaE",
0078                             baseName + "HLT Energy - reco SC Energy;HLT Energy - reco SC Energy (GeV)",
0079                             bins.deltaE,
0080                             &OffEle::DeltaE);
0081 
0082   histVec.push_back(new MonElemManager2D<OffEle, float, float>(iBooker,
0083                                                                baseName + "_etaVsPhi",
0084                                                                baseName + " #eta vs #phi;#eta;#phi (rad)",
0085                                                                bins.etaVsPhi.nrX,
0086                                                                bins.etaVsPhi.xMin,
0087                                                                bins.etaVsPhi.xMax,
0088                                                                bins.etaVsPhi.nrY,
0089                                                                bins.etaVsPhi.yMin,
0090                                                                bins.etaVsPhi.yMax,
0091                                                                &OffEle::detEta,
0092                                                                &OffEle::phi));
0093   histVec.push_back(
0094       new MonElemManager2D<OffEle, float, float>(iBooker,
0095                                                  baseName + "_HLTetaVsHLTphi",
0096                                                  baseName + " HLT #eta vs HLT #phi;HLT #eta;HLT #phi (rad)",
0097                                                  bins.etaVsPhi.nrX,
0098                                                  bins.etaVsPhi.xMin,
0099                                                  bins.etaVsPhi.xMax,
0100                                                  bins.etaVsPhi.nrY,
0101                                                  bins.etaVsPhi.yMin,
0102                                                  bins.etaVsPhi.yMax,
0103                                                  &OffEle::hltEta,
0104                                                  &OffEle::hltPhi));
0105 }
0106 
0107 void MonElemFuncs::initStdPhoHists(std::vector<MonElemManagerBase<OffPho>*>& histVec,
0108                                    const std::string& filterName,
0109                                    const std::string& baseName,
0110                                    const BinData& bins) {
0111   addStdHist<OffPho, float>(
0112       histVec, baseName + "_energy", baseName + " reco Energy;reco Energy (GeV)", bins.energy, &OffPho::energy);
0113   addStdHist<OffPho, float>(histVec, baseName + "_et", baseName + " E_{T};E_{T} (GeV)", bins.et, &OffPho::et);
0114   addStdHist<OffPho, float>(histVec, baseName + "_etHigh", baseName + " E_{T};E_{T} (GeV)", bins.etHigh, &OffPho::et);
0115   addStdHist<OffPho, float>(
0116       histVec, baseName + "_etSC", baseName + " E^{SC}_{T};E^{SC}_{T} (GeV)", bins.et, &OffPho::etSC);
0117   addStdHist<OffPho, float>(histVec, baseName + "_eta", baseName + " #eta;#eta", bins.eta, &OffPho::detEta);
0118   addStdHist<OffPho, float>(histVec, baseName + "_phi", baseName + " #phi;#phi (rad)", bins.phi, &OffPho::phi);
0119 
0120   addStdHist<OffPho, float>(histVec, baseName + "_hOverE", baseName + " H/E; H/E", bins.hOverE, &OffPho::hOverE);
0121   //----Morse
0122   //addStdHist<OffPho,float>(histVec,baseName+"_r9",baseName+" R9 ; R9",bins.r9,&OffPho::r9);
0123   //addStdHist<OffPho,float>(histVec,baseName+"_minr9",baseName+" MINR9 ; MINR9",bins.minr9,&OffPho::r9);
0124   addStdHist<OffPho, float>(histVec, baseName + "_maxr9", baseName + " MAXR9 ; MAXR9", bins.maxr9, &OffPho::r9);
0125   addStdHist<OffPho, float>(
0126       histVec, baseName + "_HLTenergy", baseName + " HLT Energy;HLT Energy (GeV)", bins.HLTenergy, &OffPho::hltEnergy);
0127   addStdHist<OffPho, float>(
0128       histVec, baseName + "_HLTeta", baseName + " HLT #eta;HLT #eta", bins.HLTeta, &OffPho::hltEta);
0129   addStdHist<OffPho, float>(
0130       histVec, baseName + "_HLTphi", baseName + " HLT #phi;HLT #phi (rad)", bins.HLTphi, &OffPho::hltPhi);
0131   //-------
0132   addStdHist<OffPho, float>(histVec,
0133                             baseName + "_sigmaIEtaIEta",
0134                             baseName + "#sigma_{i#etai#eta}; #sigma_{i#etai#eta}",
0135                             bins.sigEtaEta,
0136                             &OffPho::sigmaIEtaIEta);
0137   addStdHist<OffPho, float>(histVec,
0138                             baseName + "_e2x5Over5x5",
0139                             baseName + "E^{2x5}/E^{5x5}; E^{2x5}/E^{5x5}",
0140                             bins.e2x5,
0141                             &OffPho::e2x5MaxOver5x5);
0142   addStdHist<OffPho, float>(histVec,
0143                             baseName + "_e1x5Over5x5",
0144                             baseName + "E^{1x5}/E^{5x5}; E^{1x5}/E^{5x5}",
0145                             bins.e1x5,
0146                             &OffPho::e1x5Over5x5);
0147   addStdHist<OffPho, float>(
0148       histVec, baseName + "_isolEM", baseName + "Isol EM; Isol EM (GeV)", bins.isolEm, &OffPho::isolEm);
0149   addStdHist<OffPho, float>(
0150       histVec, baseName + "_isolHad", baseName + "Isol Had; Isol Had (GeV)", bins.isolHad, &OffPho::isolHad);
0151   addStdHist<OffPho, float>(histVec,
0152                             baseName + "_isolPtTrks",
0153                             baseName + "Isol Pt Trks; Isol Pt Tracks (GeV/c)",
0154                             bins.isolPtTrks,
0155                             &OffPho::isolPtTrks);
0156   addStdHist<OffPho, int>(histVec,
0157                           baseName + "_isolNrTrks",
0158                           baseName + "Isol Nr Trks; Isol Nr Tracks",
0159                           bins.isolNrTrks,
0160                           &OffPho::isolNrTrks);
0161   //addStdHist<OffPho,float>(histVec,baseName+"_hltIsolTrks",baseName+"HLT Isol Trks; HLT Iso Tracks (GeV/c)",bins.isolPtTrks,&OffPho::hltIsolTrks);
0162   //addStdHist<OffPho,float>(histVec,baseName+"_hltIsolHad",baseName+"HLT Isol Had; HLT Isol Had (GeV)",bins.isolPtTrks,&OffPho::hltIsolHad);
0163   addStdHist<OffPho, float>(histVec,
0164                             baseName + "_DeltaE",
0165                             baseName + "HLT Energy - reco SC Energy;HLT Energy - reco SC Energy (GeV)",
0166                             bins.deltaE,
0167                             &OffPho::DeltaE);
0168 
0169   histVec.push_back(new MonElemManager2D<OffPho, float, float>(iBooker,
0170                                                                baseName + "_etaVsPhi",
0171                                                                baseName + " #eta vs #phi;#eta;#phi (rad)",
0172                                                                bins.etaVsPhi.nrX,
0173                                                                bins.etaVsPhi.xMin,
0174                                                                bins.etaVsPhi.xMax,
0175                                                                bins.etaVsPhi.nrY,
0176                                                                bins.etaVsPhi.yMin,
0177                                                                bins.etaVsPhi.yMax,
0178                                                                &OffPho::detEta,
0179                                                                &OffPho::phi));
0180   histVec.push_back(
0181       new MonElemManager2D<OffPho, float, float>(iBooker,
0182                                                  baseName + "_HLTetaVsHLTphi",
0183                                                  baseName + " HLT #eta vs HLT #phi;HLT #eta;HLT #phi (rad)",
0184                                                  bins.etaVsPhi.nrX,
0185                                                  bins.etaVsPhi.xMin,
0186                                                  bins.etaVsPhi.xMax,
0187                                                  bins.etaVsPhi.nrY,
0188                                                  bins.etaVsPhi.yMin,
0189                                                  bins.etaVsPhi.yMax,
0190                                                  &OffPho::hltEta,
0191                                                  &OffPho::hltPhi));
0192 }
0193 
0194 void MonElemFuncs::initStdEleHistsHEP(std::vector<MonElemManagerBase<OffEle>*>& histVec,
0195                                       const std::string& filterName,
0196                                       const std::string& baseName,
0197                                       const BinData& bins) {
0198   addStdHistHEP<OffEle, float>(
0199       histVec, baseName + "_energy", baseName + " reco CaloEnergy;reco CaloEnergy (GeV)", bins.energy, &OffEle::energy);
0200   addStdHistHEP<OffEle, float>(histVec, baseName + "_et", baseName + " E_{T};E_{T} (GeV)", bins.et, &OffEle::et);
0201   addStdHistHEP<OffEle, float>(
0202       histVec, baseName + "_etHigh", baseName + " E_{T};E_{T} (GeV)", bins.etHigh, &OffEle::et);
0203   addStdHistHEP<OffEle, float>(
0204       histVec, baseName + "_etSC", baseName + " E^{SC}_{T};E^{SC}_{T} (GeV)", bins.et, &OffEle::etSC);
0205   addStdHistHEP<OffEle, float>(histVec, baseName + "_eta", baseName + " #eta;#eta", bins.eta, &OffEle::detEta);
0206   addStdHistHEP<OffEle, float>(histVec, baseName + "_phi", baseName + " #phi;#phi (rad)", bins.phi, &OffEle::phi);
0207   // addStdHist<OffEle,int>(histVec,baseName+"_charge",baseName+" Charge; charge",bins.charge,&OffEle::charge);
0208 
0209   addStdHistHEP<OffEle, float>(histVec, baseName + "_hOverE", baseName + " H/E; H/E", bins.hOverE, &OffEle::hOverE);
0210   //----Morse
0211   addStdHistHEP<OffEle, float>(histVec, baseName + "_maxr9", baseName + " MAXR9 ; MAXR9", bins.maxr9, &OffEle::r9);
0212   addStdHistHEP<OffEle, float>(
0213       histVec, baseName + "_HLTenergy", baseName + " HLT Energy;HLT Energy (GeV)", bins.HLTenergy, &OffEle::hltEnergy);
0214   addStdHistHEP<OffEle, float>(
0215       histVec, baseName + "_HLTeta", baseName + " HLT #eta;HLT #eta", bins.HLTeta, &OffEle::hltEta);
0216   addStdHistHEP<OffEle, float>(
0217       histVec, baseName + "_HLTphi", baseName + " HLT #phi;HLT #phi (rad)", bins.HLTphi, &OffEle::hltPhi);
0218   //-------
0219   addStdHistHEP<OffEle, float>(
0220       histVec, baseName + "_dPhiIn", baseName + " #Delta #phi_{in}; #Delta #phi_{in}", bins.dPhiIn, &OffEle::dPhiIn);
0221   addStdHistHEP<OffEle, float>(
0222       histVec, baseName + "_dEtaIn", baseName + " #Delta #eta_{in}; #Delta #eta_{in}", bins.dEtaIn, &OffEle::dEtaIn);
0223   addStdHistHEP<OffEle, float>(histVec,
0224                                baseName + "_sigmaIEtaIEta",
0225                                baseName + "#sigma_{i#etai#eta}; #sigma_{i#etai#eta}",
0226                                bins.sigEtaEta,
0227                                &OffEle::sigmaIEtaIEta);
0228   addStdHistHEP<OffEle, float>(
0229       histVec, baseName + "_epIn", baseName + "E/p_{in}; E/p_{in}", bins.eOverP, &OffEle::epIn);
0230   addStdHistHEP<OffEle, float>(
0231       histVec, baseName + "_epOut", baseName + "E/p_{out}; E/p_{out}", bins.eOverP, &OffEle::epOut);
0232   addStdHistHEP<OffEle, float>(
0233       histVec, baseName + "_invEInvP", baseName + "1/E -1/p; 1/E - 1/p", bins.invEInvP, &OffEle::invEInvP);
0234 
0235   addStdHistHEP<OffEle, float>(histVec,
0236                                baseName + "_e2x5Over5x5",
0237                                baseName + "E^{2x5}/E^{5x5}; E^{2x5}/E^{5x5}",
0238                                bins.e2x5,
0239                                &OffEle::e2x5MaxOver5x5);
0240   addStdHistHEP<OffEle, float>(histVec,
0241                                baseName + "_e1x5Over5x5",
0242                                baseName + "E^{1x5}/E^{5x5}; E^{1x5}/E^{5x5}",
0243                                bins.e1x5,
0244                                &OffEle::e1x5Over5x5);
0245   //addStdHist<OffEle,float>(histVec,baseName+"_isolEM",baseName+"Isol EM; Isol EM (GeV)",bins.isolEm,&OffEle::isolEm);
0246   //addStdHist<OffEle,float>(histVec,baseName+"_isolHad",baseName+"Isol Had; Isol Had (GeV)",bins.isolHad,&OffEle::isolHad);
0247   //addStdHist<OffEle,float>(histVec,baseName+"_isolPtTrks",baseName+"Isol Pt Trks; Isol Pt Tracks (GeV/c)",bins.isolPtTrks,&OffEle::isolPtTrks);
0248   addStdHistHEP<OffEle, float>(histVec,
0249                                baseName + "_hltIsolTrksEle",
0250                                baseName + "HLT Ele Isol Trks; HLT Ele Iso Tracks (GeV/c)",
0251                                bins.isolPtTrks,
0252                                &OffEle::hltIsolTrksEle);
0253   //addStdHist<OffEle,float>(histVec,baseName+"_hltIsolTrksPho",baseName+"HLT Pho Isol Trks; HLT Pho Iso Tracks (GeV/c)",bins.isolPtTrks,&OffEle::hltIsolTrksPho);
0254   addStdHistHEP<OffEle, float>(histVec,
0255                                baseName + "_hltIsolHad",
0256                                baseName + "HLT Isol Had; HLT Isol Had (GeV)",
0257                                bins.isolHad,
0258                                &OffEle::hltIsolHad);
0259   addStdHistHEP<OffEle, float>(
0260       histVec, baseName + "_hltIsolEm", baseName + "HLT Isol Em; HLT Isol Em (GeV)", bins.isolEm, &OffEle::hltIsolEm);
0261   addStdHistHEP<OffEle, float>(histVec,
0262                                baseName + "_DeltaE",
0263                                baseName + "HLT Energy - reco SC Energy;HLT Energy - reco SC Energy (GeV)",
0264                                bins.deltaE,
0265                                &OffEle::DeltaE);
0266   /*
0267   histVec.push_back(new MonElemManager2D<OffEle,float,float>(iBooker, baseName+"_etaVsPhi",
0268                                  baseName+" #eta vs #phi;#eta;#phi (rad)",
0269                                  bins.etaVsPhi.nrX,bins.etaVsPhi.xMin,bins.etaVsPhi.xMax,
0270                                  bins.etaVsPhi.nrY,bins.etaVsPhi.yMin,bins.etaVsPhi.yMax,
0271                                  &OffEle::detEta,&OffEle::phi));
0272   histVec.push_back(new MonElemManager2D<OffEle,float,float>(iBooker, baseName+"_HLTetaVsHLTphi",
0273                                  baseName+" HLT #eta vs HLT #phi;HLT #eta;HLT #phi (rad)",
0274                                  bins.etaVsPhi.nrX,bins.etaVsPhi.xMin,bins.etaVsPhi.xMax,
0275                                  bins.etaVsPhi.nrY,bins.etaVsPhi.yMin,bins.etaVsPhi.yMax,
0276                                  &OffEle::hltEta,&OffEle::hltPhi));
0277 */
0278 }
0279 
0280 void MonElemFuncs::initStdPhoHistsHEP(std::vector<MonElemManagerBase<OffPho>*>& histVec,
0281                                       const std::string& filterName,
0282                                       const std::string& baseName,
0283                                       const BinData& bins) {
0284   addStdHistHEP<OffPho, float>(
0285       histVec, baseName + "_energy", baseName + " reco Energy;reco Energy (GeV)", bins.energy, &OffPho::energy);
0286   addStdHistHEP<OffPho, float>(histVec, baseName + "_et", baseName + " E_{T};E_{T} (GeV)", bins.et, &OffPho::et);
0287   addStdHistHEP<OffPho, float>(
0288       histVec, baseName + "_etHigh", baseName + " E_{T};E_{T} (GeV)", bins.etHigh, &OffPho::et);
0289   addStdHistHEP<OffPho, float>(
0290       histVec, baseName + "_etSC", baseName + " E^{SC}_{T};E^{SC}_{T} (GeV)", bins.et, &OffPho::etSC);
0291   addStdHistHEP<OffPho, float>(histVec, baseName + "_eta", baseName + " #eta;#eta", bins.eta, &OffPho::detEta);
0292   addStdHistHEP<OffPho, float>(histVec, baseName + "_phi", baseName + " #phi;#phi (rad)", bins.phi, &OffPho::phi);
0293 
0294   addStdHistHEP<OffPho, float>(histVec, baseName + "_hOverE", baseName + " H/E; H/E", bins.hOverE, &OffPho::hOverE);
0295   //----Morse
0296   //addStdHist<OffPho,float>(histVec,baseName+"_r9",baseName+" R9 ; R9",bins.r9,&OffPho::r9);
0297   //addStdHist<OffPho,float>(histVec,baseName+"_minr9",baseName+" MINR9 ; MINR9",bins.minr9,&OffPho::r9);
0298   addStdHistHEP<OffPho, float>(histVec, baseName + "_maxr9", baseName + " MAXR9 ; MAXR9", bins.maxr9, &OffPho::r9);
0299   addStdHistHEP<OffPho, float>(
0300       histVec, baseName + "_HLTenergy", baseName + " HLT Energy;HLT Energy (GeV)", bins.HLTenergy, &OffPho::hltEnergy);
0301   addStdHistHEP<OffPho, float>(
0302       histVec, baseName + "_HLTeta", baseName + " HLT #eta;HLT #eta", bins.HLTeta, &OffPho::hltEta);
0303   addStdHistHEP<OffPho, float>(
0304       histVec, baseName + "_HLTphi", baseName + " HLT #phi;HLT #phi (rad)", bins.HLTphi, &OffPho::hltPhi);
0305   //-------
0306   addStdHistHEP<OffPho, float>(histVec,
0307                                baseName + "_sigmaIEtaIEta",
0308                                baseName + "#sigma_{i#etai#eta}; #sigma_{i#etai#eta}",
0309                                bins.sigEtaEta,
0310                                &OffPho::sigmaIEtaIEta);
0311   addStdHistHEP<OffPho, float>(histVec,
0312                                baseName + "_e2x5Over5x5",
0313                                baseName + "E^{2x5}/E^{5x5}; E^{2x5}/E^{5x5}",
0314                                bins.e2x5,
0315                                &OffPho::e2x5MaxOver5x5);
0316   addStdHistHEP<OffPho, float>(histVec,
0317                                baseName + "_e1x5Over5x5",
0318                                baseName + "E^{1x5}/E^{5x5}; E^{1x5}/E^{5x5}",
0319                                bins.e1x5,
0320                                &OffPho::e1x5Over5x5);
0321   addStdHistHEP<OffPho, float>(
0322       histVec, baseName + "_isolEM", baseName + "Isol EM; Isol EM (GeV)", bins.isolEm, &OffPho::isolEm);
0323   addStdHistHEP<OffPho, float>(
0324       histVec, baseName + "_isolHad", baseName + "Isol Had; Isol Had (GeV)", bins.isolHad, &OffPho::isolHad);
0325   addStdHistHEP<OffPho, float>(histVec,
0326                                baseName + "_isolPtTrks",
0327                                baseName + "Isol Pt Trks; Isol Pt Tracks (GeV/c)",
0328                                bins.isolPtTrks,
0329                                &OffPho::isolPtTrks);
0330   addStdHistHEP<OffPho, int>(histVec,
0331                              baseName + "_isolNrTrks",
0332                              baseName + "Isol Nr Trks; Isol Nr Tracks",
0333                              bins.isolNrTrks,
0334                              &OffPho::isolNrTrks);
0335   //addStdHist<OffPho,float>(histVec,baseName+"_hltIsolTrks",baseName+"HLT Isol Trks; HLT Iso Tracks (GeV/c)",bins.isolPtTrks,&OffPho::hltIsolTrks);
0336   //addStdHist<OffPho,float>(histVec,baseName+"_hltIsolHad",baseName+"HLT Isol Had; HLT Isol Had (GeV)",bins.isolPtTrks,&OffPho::hltIsolHad);
0337   addStdHistHEP<OffPho, float>(histVec,
0338                                baseName + "_DeltaE",
0339                                baseName + "HLT Energy - reco SC Energy;HLT Energy - reco SC Energy (GeV)",
0340                                bins.deltaE,
0341                                &OffPho::DeltaE);
0342   /* histVec.push_back(new MonElemManager2D<OffPho,float,float>(iBooker, baseName+"_etaVsPhi",
0343                                  baseName+" #eta vs #phi;#eta;#phi (rad)",
0344                                  bins.etaVsPhi.nrX,bins.etaVsPhi.xMin,bins.etaVsPhi.xMax,
0345                                  bins.etaVsPhi.nrY,bins.etaVsPhi.yMin,bins.etaVsPhi.yMax,
0346                                  &OffPho::detEta,&OffPho::phi));
0347   histVec.push_back(new MonElemManager2D<OffPho,float,float>(iBooker, baseName+"_HLTetaVsHLTphi",
0348                                  baseName+" HLT #eta vs HLT #phi;HLT #eta;HLT #phi (rad)",
0349                                  bins.etaVsPhi.nrX,bins.etaVsPhi.xMin,bins.etaVsPhi.xMax,
0350                                  bins.etaVsPhi.nrY,bins.etaVsPhi.yMin,bins.etaVsPhi.yMax,
0351                                  &OffPho::hltEta,&OffPho::hltPhi));
0352 
0353 */
0354 }
0355 
0356 void MonElemFuncs::initStdEffHists(std::vector<MonElemWithCutBase<OffEle>*>& histVec,
0357                                    const std::string& filterName,
0358                                    const std::string& baseName,
0359                                    const BinData::Data1D& bins,
0360                                    float (OffEle::*vsVarFunc)() const,
0361                                    const CutMasks& masks) {
0362   initStdEffHists(histVec, filterName, baseName, bins.nr, bins.min, bins.max, vsVarFunc, masks);
0363 }
0364 
0365 void MonElemFuncs::initStdEffHists(std::vector<MonElemWithCutBase<OffPho>*>& histVec,
0366                                    const std::string& filterName,
0367                                    const std::string& baseName,
0368                                    const BinData::Data1D& bins,
0369                                    float (OffPho::*vsVarFunc)() const,
0370                                    const CutMasks& masks) {
0371   initStdEffHists(histVec, filterName, baseName, bins.nr, bins.min, bins.max, vsVarFunc, masks);
0372 }
0373 
0374 void MonElemFuncs::initStdEffHists(std::vector<MonElemWithCutBase<OffEle>*>& histVec,
0375                                    const std::string& filterName,
0376                                    const std::string& baseName,
0377                                    int nrBins,
0378                                    double xMin,
0379                                    double xMax,
0380                                    float (OffEle::*vsVarFunc)() const,
0381                                    const CutMasks& masks) {
0382   //some convience typedefs, I hate typedefs but atleast here where they are defined is obvious
0383   using VarCut = EgHLTDQMVarCut<egHLT::OffEle>;
0384   typedef MonElemWithCutEBEE<OffEle, float> MonElemFloat;
0385   int stdCutCode = masks.stdEle;
0386 
0387   //first do the zero and all cuts histograms
0388   histVec.push_back(
0389       new MonElemFloat(iBooker, baseName + "_noCuts", baseName + " NoCuts", nrBins, xMin, xMax, vsVarFunc));
0390   histVec.push_back(new MonElemFloat(iBooker,
0391                                      baseName + "_allCuts",
0392                                      baseName + " All Cuts",
0393                                      nrBins,
0394                                      xMin,
0395                                      xMax,
0396                                      vsVarFunc,
0397                                      new VarCut(stdCutCode, &OffEle::cutCode)));
0398 
0399   //now for the n-1
0400   histVec.push_back(new MonElemFloat(iBooker,
0401                                      baseName + "_n1_dEtaIn",
0402                                      baseName + " N1 #Delta#eta_{in}",
0403                                      nrBins,
0404                                      xMin,
0405                                      xMax,
0406                                      vsVarFunc,
0407                                      new VarCut(~EgCutCodes::DETAIN & stdCutCode, &OffEle::cutCode)));
0408   histVec.push_back(new MonElemFloat(iBooker,
0409                                      baseName + "_n1_dPhiIn",
0410                                      baseName + " N1 #Delta#phi_{in}",
0411                                      nrBins,
0412                                      xMin,
0413                                      xMax,
0414                                      vsVarFunc,
0415                                      new VarCut(~EgCutCodes::DPHIIN & stdCutCode, &OffEle::cutCode)));
0416   histVec.push_back(new MonElemFloat(iBooker,
0417                                      baseName + "_n1_sigmaIEtaIEta",
0418                                      baseName + " N1 #sigma_{i#etai#eta}",
0419                                      nrBins,
0420                                      xMin,
0421                                      xMax,
0422                                      vsVarFunc,
0423                                      new VarCut(~EgCutCodes::SIGMAIETAIETA & stdCutCode, &OffEle::cutCode)));
0424   histVec.push_back(new MonElemFloat(iBooker,
0425                                      baseName + "_n1_hOverE",
0426                                      baseName + " N1 H/E",
0427                                      nrBins,
0428                                      xMin,
0429                                      xMax,
0430                                      vsVarFunc,
0431                                      new VarCut(~EgCutCodes::HADEM & stdCutCode, &OffEle::cutCode)));
0432   /* histVec.push_back(new MonElemFloat(iBooker,baseName+"_n1_isolEm",baseName+" N1 Isol Em",nrBins,xMin,xMax,vsVarFunc,
0433      new VarCut(~EgCutCodes::ISOLEM&stdCutCode,&OffEle::cutCode)));
0434      histVec.push_back(new MonElemFloat(iBooker,baseName+"_n1_isolHad",baseName+" N1 Isol Had",nrBins,xMin,xMax,vsVarFunc,
0435      new VarCut(~EgCutCodes::ISOLHAD&stdCutCode,&OffEle::cutCode)));
0436      histVec.push_back(new MonElemFloat(iBooker,baseName+"_n1_isolPtTrks",baseName+" N1 Isol Tracks",nrBins,xMin,xMax,vsVarFunc,
0437      new VarCut(~EgCutCodes::ISOLPTTRKS&stdCutCode,&OffEle::cutCode)));*/
0438   histVec.push_back(new MonElemFloat(iBooker,
0439                                      baseName + "_n1_hltIsolEm",
0440                                      baseName + " N1 HLT Isol Em",
0441                                      nrBins,
0442                                      xMin,
0443                                      xMax,
0444                                      vsVarFunc,
0445                                      new VarCut(~EgCutCodes::HLTISOLEM & stdCutCode, &OffEle::cutCode)));
0446   histVec.push_back(new MonElemFloat(iBooker,
0447                                      baseName + "_n1_hltIsolHad",
0448                                      baseName + " N1 HLT Isol Had",
0449                                      nrBins,
0450                                      xMin,
0451                                      xMax,
0452                                      vsVarFunc,
0453                                      new VarCut(~EgCutCodes::HLTISOLHAD & stdCutCode, &OffEle::cutCode)));
0454   histVec.push_back(new MonElemFloat(iBooker,
0455                                      baseName + "_n1_hltIsolTrksEle",
0456                                      baseName + " N1 HLT Isol Tracks Ele ",
0457                                      nrBins,
0458                                      xMin,
0459                                      xMax,
0460                                      vsVarFunc,
0461                                      new VarCut(~EgCutCodes::HLTISOLTRKSELE & stdCutCode, &OffEle::cutCode)));
0462   histVec.push_back(new MonElemFloat(iBooker,
0463                                      baseName + "_single_dEtaIn",
0464                                      baseName + " Single #Delta#eta_{in}",
0465                                      nrBins,
0466                                      xMin,
0467                                      xMax,
0468                                      vsVarFunc,
0469                                      new VarCut(EgCutCodes::DETAIN, &OffEle::cutCode)));
0470   histVec.push_back(new MonElemFloat(iBooker,
0471                                      baseName + "_single_dPhiIn",
0472                                      baseName + " Single #Delta#phi_{in}",
0473                                      nrBins,
0474                                      xMin,
0475                                      xMax,
0476                                      vsVarFunc,
0477                                      new VarCut(EgCutCodes::DPHIIN, &OffEle::cutCode)));
0478   histVec.push_back(new MonElemFloat(iBooker,
0479                                      baseName + "_single_sigmaIEtaIEta",
0480                                      baseName + " Single #sigma_{i#etai#eta}",
0481                                      nrBins,
0482                                      xMin,
0483                                      xMax,
0484                                      vsVarFunc,
0485                                      new VarCut(EgCutCodes::SIGMAIETAIETA, &OffEle::cutCode)));
0486   histVec.push_back(new MonElemFloat(iBooker,
0487                                      baseName + "_single_hOverE",
0488                                      baseName + " Single H/E",
0489                                      nrBins,
0490                                      xMin,
0491                                      xMax,
0492                                      vsVarFunc,
0493                                      new VarCut(EgCutCodes::HADEM, &OffEle::cutCode)));
0494   /* histVec.push_back(new MonElemFloat(iBooker,baseName+"_single_isolEm",baseName+" Single Isol Em",nrBins,xMin,xMax,vsVarFunc,
0495      new VarCut(EgCutCodes::ISOLEM,&OffEle::cutCode)));
0496      histVec.push_back(new MonElemFloat(iBooker,baseName+"_single_isolHad",baseName+" Single Isol Had",nrBins,xMin,xMax,vsVarFunc,
0497      new VarCut(EgCutCodes::ISOLHAD,&OffEle::cutCode)));
0498      histVec.push_back(new MonElemFloat(iBooker,baseName+"_single_isolPtTrks",baseName+" Single Isol Tracks",nrBins,xMin,xMax,vsVarFunc,
0499      new VarCut(EgCutCodes::ISOLPTTRKS,&OffEle::cutCode)));*/
0500   histVec.push_back(new MonElemFloat(iBooker,
0501                                      baseName + "_single_hltIsolEm",
0502                                      baseName + " Single HLT Isol Em",
0503                                      nrBins,
0504                                      xMin,
0505                                      xMax,
0506                                      vsVarFunc,
0507                                      new VarCut(EgCutCodes::HLTISOLEM, &OffEle::cutCode)));
0508   histVec.push_back(new MonElemFloat(iBooker,
0509                                      baseName + "_single_hltIsolHad",
0510                                      baseName + " Single HLT Isol Had",
0511                                      nrBins,
0512                                      xMin,
0513                                      xMax,
0514                                      vsVarFunc,
0515                                      new VarCut(EgCutCodes::HLTISOLHAD, &OffEle::cutCode)));
0516   histVec.push_back(new MonElemFloat(iBooker,
0517                                      baseName + "_single_hltIsolTrksEle",
0518                                      baseName + " Single HLT Isol Tracks Ele ",
0519                                      nrBins,
0520                                      xMin,
0521                                      xMax,
0522                                      vsVarFunc,
0523                                      new VarCut(EgCutCodes::HLTISOLTRKSELE, &OffEle::cutCode)));
0524   /*histVec.push_back(new MonElemFloat(iBooker,baseName+"_single_hltIsolTrksPho",baseName+" Single HLT Isol Tracks Pho ",nrBins,xMin,xMax,vsVarFunc,
0525     new VarCut(EgCutCodes::HLTISOLTRKSPHO,&OffEle::cutCode)));*/
0526 }
0527 
0528 void MonElemFuncs::initStdEffHists(std::vector<MonElemWithCutBase<OffPho>*>& histVec,
0529                                    const std::string& filterName,
0530                                    const std::string& baseName,
0531                                    int nrBins,
0532                                    double xMin,
0533                                    double xMax,
0534                                    float (OffPho::*vsVarFunc)() const,
0535                                    const CutMasks& masks) {
0536   //some convenience typedefs, I hate typedefs but atleast here where they are defined is obvious
0537   using VarCut = EgHLTDQMVarCut<egHLT::OffPho>;
0538   typedef MonElemWithCutEBEE<OffPho, float> MonElemFloat;
0539   int stdCutCode = masks.stdPho;
0540 
0541   histVec.push_back(
0542       new MonElemFloat(iBooker, baseName + "_noCuts", baseName + " NoCuts", nrBins, xMin, xMax, vsVarFunc));
0543   histVec.push_back(new MonElemFloat(iBooker,
0544                                      baseName + "_allCuts",
0545                                      baseName + " All Cuts",
0546                                      nrBins,
0547                                      xMin,
0548                                      xMax,
0549                                      vsVarFunc,
0550                                      new VarCut(stdCutCode, &OffPho::cutCode)));
0551 
0552   histVec.push_back(new MonElemFloat(iBooker,
0553                                      baseName + "_n1_sigmaIEtaIEta",
0554                                      baseName + " N1 #sigma_{i#etai#eta}",
0555                                      nrBins,
0556                                      xMin,
0557                                      xMax,
0558                                      vsVarFunc,
0559                                      new VarCut(~EgCutCodes::SIGMAIETAIETA & stdCutCode, &OffPho::cutCode)));
0560   //-----Morse------
0561   histVec.push_back(new MonElemFloat(iBooker,
0562                                      baseName + "_n1_hOverE",
0563                                      baseName + " N1 H/E",
0564                                      nrBins,
0565                                      xMin,
0566                                      xMax,
0567                                      vsVarFunc,
0568                                      new VarCut(~EgCutCodes::HADEM & stdCutCode, &OffPho::cutCode)));  //---BUG FIX!!--
0569   /*histVec.push_back(new MonElemFloat(iBooker,baseName+"_n1_minr9",baseName+" N1 MINR9",nrBins,xMin,xMax,vsVarFunc,
0570     new VarCut(~EgCutCodes::MINR9&stdCutCode,&OffPho::cutCode)));
0571     histVec.push_back(new MonElemFloat(iBooker,baseName+"_n1_maxr9",baseName+" N1 MAXR9",nrBins,xMin,xMax,vsVarFunc,
0572     new VarCut(~EgCutCodes::MAXR9&stdCutCode,&OffPho::cutCode)));*/
0573   //----------------
0574   histVec.push_back(new MonElemFloat(iBooker,
0575                                      baseName + "_n1_isolEm",
0576                                      baseName + " N1 Isol Em",
0577                                      nrBins,
0578                                      xMin,
0579                                      xMax,
0580                                      vsVarFunc,
0581                                      new VarCut(~EgCutCodes::ISOLEM & stdCutCode, &OffPho::cutCode)));
0582   histVec.push_back(new MonElemFloat(iBooker,
0583                                      baseName + "_n1_isolHad",
0584                                      baseName + " N1 Isol Had",
0585                                      nrBins,
0586                                      xMin,
0587                                      xMax,
0588                                      vsVarFunc,
0589                                      new VarCut(~EgCutCodes::ISOLHAD & stdCutCode, &OffPho::cutCode)));
0590   histVec.push_back(new MonElemFloat(iBooker,
0591                                      baseName + "_n1_isolPtTrks",
0592                                      baseName + " N1 Pt Isol Tracks",
0593                                      nrBins,
0594                                      xMin,
0595                                      xMax,
0596                                      vsVarFunc,
0597                                      new VarCut(~EgCutCodes::ISOLPTTRKS & stdCutCode, &OffPho::cutCode)));
0598   histVec.push_back(new MonElemFloat(iBooker,
0599                                      baseName + "_n1_isolNrTrks",
0600                                      baseName + " N1 Nr Isol Tracks",
0601                                      nrBins,
0602                                      xMin,
0603                                      xMax,
0604                                      vsVarFunc,
0605                                      new VarCut(~EgCutCodes::ISOLNRTRKS & stdCutCode, &OffPho::cutCode)));
0606 
0607   histVec.push_back(new MonElemFloat(iBooker,
0608                                      baseName + "_single_hOverE",
0609                                      baseName + " Single H/E",
0610                                      nrBins,
0611                                      xMin,
0612                                      xMax,
0613                                      vsVarFunc,
0614                                      new VarCut(EgCutCodes::HADEM, &OffPho::cutCode)));
0615   histVec.push_back(new MonElemFloat(iBooker,
0616                                      baseName + "_single_sigmaIEtaIEta",
0617                                      baseName + " Single #sigma_{i#etai#eta}",
0618                                      nrBins,
0619                                      xMin,
0620                                      xMax,
0621                                      vsVarFunc,
0622                                      new VarCut(EgCutCodes::SIGMAIETAIETA, &OffPho::cutCode)));
0623   histVec.push_back(new MonElemFloat(iBooker,
0624                                      baseName + "_single_isolEm",
0625                                      baseName + " Single Isol Em",
0626                                      nrBins,
0627                                      xMin,
0628                                      xMax,
0629                                      vsVarFunc,
0630                                      new VarCut(~EgCutCodes::ISOLEM, &OffPho::cutCode)));
0631   histVec.push_back(new MonElemFloat(iBooker,
0632                                      baseName + "_single_isolHad",
0633                                      baseName + " Single Isol Had",
0634                                      nrBins,
0635                                      xMin,
0636                                      xMax,
0637                                      vsVarFunc,
0638                                      new VarCut(~EgCutCodes::ISOLHAD, &OffPho::cutCode)));
0639   histVec.push_back(new MonElemFloat(iBooker,
0640                                      baseName + "_single_isolPtTrks",
0641                                      baseName + " Single Pt Isol Tracks",
0642                                      nrBins,
0643                                      xMin,
0644                                      xMax,
0645                                      vsVarFunc,
0646                                      new VarCut(~EgCutCodes::ISOLPTTRKS, &OffPho::cutCode)));
0647   /*histVec.push_back(new MonElemFloat(iBooker,baseName+"_single_hltIsolHad",baseName+" Single HLT Isol Had",nrBins,xMin,xMax,vsVarFunc,
0648     new VarCut(EgCutCodes::HLTISOLHAD,&OffPho::cutCode)));
0649     histVec.push_back(new MonElemFloat(iBooker,baseName+"_single_hltIsolTrksPho",baseName+" Single HLT Isol Tracks Pho ",nrBins,xMin,xMax,vsVarFunc,
0650     new VarCut(EgCutCodes::HLTISOLTRKSPHO,&OffPho::cutCode)));*/
0651 }
0652 
0653 //we own the passed in cut, so we give it to the first mon element and then clone it after that
0654 //only currently used for trigger tag and probe
0655 void MonElemFuncs::initStdEleCutHists(std::vector<MonElemWithCutBase<OffEle>*>& histVec,
0656                                       const std::string& filterName,
0657                                       const std::string& baseName,
0658                                       const BinData& bins,
0659                                       EgHLTDQMCut<OffEle>* cut) {
0660   histVec.push_back(new MonElemWithCutEBEE<OffEle, float>(iBooker,
0661                                                           baseName + "_et",
0662                                                           baseName + " E_{T};E_{T} (GeV)",
0663                                                           bins.et.nr,
0664                                                           bins.et.min,
0665                                                           bins.et.max,
0666                                                           &OffEle::et,
0667                                                           cut));
0668   histVec.push_back(new MonElemWithCutEBEE<OffEle, float>(iBooker,
0669                                                           baseName + "_eta",
0670                                                           baseName + " #eta;#eta",
0671                                                           bins.eta.nr,
0672                                                           bins.eta.min,
0673                                                           bins.eta.max,
0674                                                           &OffEle::detEta,
0675                                                           cut ? cut->clone() : nullptr));
0676   histVec.push_back(new MonElemWithCutEBEE<OffEle, float>(iBooker,
0677                                                           baseName + "_phi",
0678                                                           baseName + " #phi;#phi (rad)",
0679                                                           bins.phi.nr,
0680                                                           bins.phi.min,
0681                                                           bins.phi.max,
0682                                                           &OffEle::phi,
0683                                                           cut ? cut->clone() : nullptr));
0684   histVec.push_back(new MonElemWithCutEBEE<OffEle, int>(iBooker,
0685                                                         baseName + "_nVertex",
0686                                                         baseName + " nVertex;nVertex",
0687                                                         bins.nVertex.nr,
0688                                                         bins.nVertex.min,
0689                                                         bins.nVertex.max,
0690                                                         &OffEle::NVertex,
0691                                                         cut ? cut->clone() : nullptr));
0692   /*  histVec.push_back(new MonElemWithCutEBEE<OffEle,int>(iBooker,baseName+"_charge",
0693                                baseName+" Charge; charge",
0694                                bins.charge.nr,bins.charge.min,bins.charge.max,
0695                                &OffEle::charge,cut ? cut->clone():NULL)); */
0696 }
0697 
0698 void MonElemFuncs::initStdPhoCutHists(std::vector<MonElemWithCutBase<OffPho>*>& histVec,
0699                                       const std::string& filterName,
0700                                       const std::string& baseName,
0701                                       const BinData& bins,
0702                                       EgHLTDQMCut<OffPho>* cut) {
0703   histVec.push_back(new MonElemWithCutEBEE<OffPho, float>(iBooker,
0704                                                           baseName + "_et",
0705                                                           baseName + " E_{T};E_{T} (GeV)",
0706                                                           bins.et.nr,
0707                                                           bins.et.min,
0708                                                           bins.et.max,
0709                                                           &OffPho::et,
0710                                                           cut));
0711   histVec.push_back(new MonElemWithCutEBEE<OffPho, float>(iBooker,
0712                                                           baseName + "_eta",
0713                                                           baseName + " #eta;#eta",
0714                                                           bins.eta.nr,
0715                                                           bins.eta.min,
0716                                                           bins.eta.max,
0717                                                           &OffPho::detEta,
0718                                                           cut ? cut->clone() : nullptr));
0719   histVec.push_back(new MonElemWithCutEBEE<OffPho, float>(iBooker,
0720                                                           baseName + "_phi",
0721                                                           baseName + " #phi;#phi (rad)",
0722                                                           bins.phi.nr,
0723                                                           bins.phi.min,
0724                                                           bins.phi.max,
0725                                                           &OffPho::phi,
0726                                                           cut ? cut->clone() : nullptr));
0727   /* histVec.push_back(new MonElemWithCutEBEE<OffPho,int>(iBooker,baseName+"_charge",
0728                                baseName+" Charge; charge",
0729                                bins.charge.nr,bins.charge.min,bins.charge.max,
0730                                &OffPho::charge,cut ? cut->clone():NULL)); */
0731 }
0732 
0733 //we transfer ownership of eleCut to addTrigLooseTrigHist which transfers it to the eleMonElems
0734 void MonElemFuncs::initTightLooseTrigHists(std::vector<MonElemContainer<OffEle>*>& eleMonElems,
0735                                            const std::vector<std::string>& tightLooseTrigs,
0736                                            const BinData& bins,
0737                                            EgHLTDQMCut<OffEle>* eleCut) {
0738   for (size_t trigNr = 0; trigNr < tightLooseTrigs.size(); trigNr++) {
0739     std::vector<std::string> splitString;
0740     boost::split(splitString, tightLooseTrigs[trigNr], boost::is_any_of(std::string(":")));
0741     if (splitString.size() != 2)
0742       continue;  //format incorrect
0743     const std::string& tightTrig = splitString[0];
0744     const std::string& looseTrig = splitString[1];
0745     //this step is necessary as we want to transfer ownership of eleCut to the addTrigLooseTrigHist func on the last iteration
0746     //but clone it before that
0747     //perhaps my object ownership rules need to be re-evalulated
0748     if (trigNr != tightLooseTrigs.size() - 2)
0749       addTightLooseTrigHist(eleMonElems, tightTrig, looseTrig, eleCut->clone(), "gsfEle", bins);
0750     else
0751       addTightLooseTrigHist(eleMonElems, tightTrig, looseTrig, eleCut, "gsfEle", bins);
0752   }
0753 }
0754 
0755 void MonElemFuncs::initTightLooseTrigHists(std::vector<MonElemContainer<OffPho>*>& phoMonElems,
0756                                            const std::vector<std::string>& tightLooseTrigs,
0757                                            const BinData& bins,
0758                                            EgHLTDQMCut<OffPho>* phoCut) {
0759   for (size_t trigNr = 0; trigNr < tightLooseTrigs.size(); trigNr++) {
0760     std::vector<std::string> splitString;
0761     boost::split(splitString, tightLooseTrigs[trigNr], boost::is_any_of(std::string(":")));
0762     if (splitString.size() != 2)
0763       continue;  //format incorrect
0764     const std::string& tightTrig = splitString[0];
0765     const std::string& looseTrig = splitString[1];
0766 
0767     //this step is necessary as we want to transfer ownership of phoCut to the addTrigLooseTrigHist func on the last iteration
0768     //but clone it before that
0769     //perhaps my object ownership rules need to be re-evalulated
0770     if (trigNr != tightLooseTrigs.size() - 2)
0771       addTightLooseTrigHist(phoMonElems, tightTrig, looseTrig, phoCut->clone(), "pho", bins);
0772     else
0773       addTightLooseTrigHist(phoMonElems, tightTrig, looseTrig, phoCut, "pho", bins);
0774   }
0775 }
0776 
0777 //there is nothing electron specific here, will template at some point
0778 void MonElemFuncs::addTightLooseTrigHist(std::vector<MonElemContainer<OffEle>*>& eleMonElems,
0779                                          const std::string& tightTrig,
0780                                          const std::string& looseTrig,
0781                                          EgHLTDQMCut<OffEle>* eleCut,
0782                                          const std::string& histId,
0783                                          const BinData& bins) {
0784   MonElemContainer<OffEle>* passMonElem = nullptr;
0785   passMonElem = new MonElemContainer<OffEle>(
0786       tightTrig + "_" + looseTrig + "_" + histId + "_passTrig",
0787       "",
0788       &(*(new EgMultiCut<OffEle>) << new EgObjTrigCut<OffEle>(trigCodes.getCode(tightTrig + ":" + looseTrig),
0789                                                               EgObjTrigCut<OffEle>::AND)
0790                                   << eleCut->clone()));
0791 
0792   MonElemContainer<OffEle>* failMonElem = nullptr;
0793   failMonElem =
0794       new MonElemContainer<OffEle>(tightTrig + "_" + looseTrig + "_" + histId + "_failTrig",
0795                                    "",
0796                                    &(*(new EgMultiCut<OffEle>) << new EgObjTrigCut<OffEle>(trigCodes.getCode(looseTrig),
0797                                                                                            EgObjTrigCut<OffEle>::AND,
0798                                                                                            trigCodes.getCode(tightTrig))
0799                                                                << eleCut));
0800 
0801   MonElemFuncs::initStdEleHists(passMonElem->monElems(), tightTrig + "_" + looseTrig, passMonElem->name(), bins);
0802   MonElemFuncs::initStdEleHists(failMonElem->monElems(), tightTrig + "_" + looseTrig, failMonElem->name(), bins);
0803   eleMonElems.push_back(passMonElem);
0804   eleMonElems.push_back(failMonElem);
0805 }
0806 
0807 //there is nothing photon specific here, will template at some point
0808 void MonElemFuncs::addTightLooseTrigHist(std::vector<MonElemContainer<OffPho>*>& phoMonElems,
0809                                          const std::string& tightTrig,
0810                                          const std::string& looseTrig,
0811                                          EgHLTDQMCut<OffPho>* phoCut,
0812                                          const std::string& histId,
0813                                          const BinData& bins) {
0814   MonElemContainer<OffPho>* passMonElem = nullptr;
0815   passMonElem = new MonElemContainer<OffPho>(
0816       tightTrig + "_" + looseTrig + "_" + histId + "_passTrig",
0817       "",
0818       &(*(new EgMultiCut<OffPho>) << new EgObjTrigCut<OffPho>(trigCodes.getCode(tightTrig + ":" + looseTrig),
0819                                                               EgObjTrigCut<OffPho>::AND)
0820                                   << phoCut->clone()));
0821 
0822   MonElemContainer<OffPho>* failMonElem = nullptr;
0823   failMonElem =
0824       new MonElemContainer<OffPho>(tightTrig + "_" + looseTrig + "_" + histId + "_failTrig",
0825                                    "",
0826                                    &(*(new EgMultiCut<OffPho>) << new EgObjTrigCut<OffPho>(trigCodes.getCode(looseTrig),
0827                                                                                            EgObjTrigCut<OffPho>::AND,
0828                                                                                            trigCodes.getCode(tightTrig))
0829                                                                << phoCut));
0830 
0831   MonElemFuncs::initStdPhoHists(passMonElem->monElems(), tightTrig + "_" + looseTrig, passMonElem->name(), bins);
0832   MonElemFuncs::initStdPhoHists(failMonElem->monElems(), tightTrig + "_" + looseTrig, failMonElem->name(), bins);
0833   phoMonElems.push_back(passMonElem);
0834   phoMonElems.push_back(failMonElem);
0835 }
0836 
0837 //we transfer ownership of eleCut to the monitor elements
0838 void MonElemFuncs::initTightLooseTrigHistsTrigCuts(std::vector<MonElemContainer<OffEle>*>& eleMonElems,
0839                                                    const std::vector<std::string>& tightLooseTrigs,
0840                                                    const BinData& bins) {
0841   for (auto const& tightLooseTrig : tightLooseTrigs) {
0842     std::vector<std::string> splitString;
0843     boost::split(splitString, tightLooseTrig, boost::is_any_of(std::string(":")));
0844     if (splitString.size() != 2)
0845       continue;  //format incorrect
0846     const std::string& tightTrig = splitString[0];
0847     const std::string& looseTrig = splitString[1];
0848     EgHLTDQMCut<OffEle>* eleCut =
0849         new EgHLTDQMUserVarCut<OffEle, TrigCodes::TrigBitSet>(&OffEle::trigCutsCutCode, trigCodes.getCode(tightTrig));
0850     addTightLooseTrigHist(eleMonElems, tightTrig, looseTrig, eleCut, "gsfEle_trigCuts", bins);
0851   }
0852 }
0853 
0854 //we transfer ownership of phoCut to the monitor elements
0855 void MonElemFuncs::initTightLooseTrigHistsTrigCuts(std::vector<MonElemContainer<OffPho>*>& phoMonElems,
0856                                                    const std::vector<std::string>& tightLooseTrigs,
0857                                                    const BinData& bins) {
0858   for (auto const& tightLooseTrig : tightLooseTrigs) {
0859     std::vector<std::string> splitString;
0860     boost::split(splitString, tightLooseTrig, boost::is_any_of(std::string(":")));
0861     if (splitString.size() != 2)
0862       continue;  //format incorrect
0863     const std::string& tightTrig = splitString[0];
0864     const std::string& looseTrig = splitString[1];
0865     EgHLTDQMCut<OffPho>* phoCut =
0866         new EgHLTDQMUserVarCut<OffPho, TrigCodes::TrigBitSet>(&OffPho::trigCutsCutCode, trigCodes.getCode(tightTrig));
0867     addTightLooseTrigHist(phoMonElems, tightTrig, looseTrig, phoCut, "pho_trigCuts", bins);
0868   }
0869 }
0870 
0871 //we transfer ownership of eleCut to the monitor elements
0872 void MonElemFuncs::initTightLooseDiObjTrigHistsTrigCuts(std::vector<MonElemContainer<OffEle>*>& eleMonElems,
0873                                                         const std::vector<std::string>& tightLooseTrigs,
0874                                                         const BinData& bins) {
0875   for (auto const& tightLooseTrig : tightLooseTrigs) {
0876     std::vector<std::string> splitString;
0877     boost::split(splitString, tightLooseTrig, boost::is_any_of(std::string(":")));
0878     if (splitString.size() != 2)
0879       continue;  //format incorrect
0880     const std::string& tightTrig = splitString[0];
0881     const std::string& looseTrig = splitString[1];
0882     EgHLTDQMCut<OffEle>* eleCut =
0883         new EgDiEleUserCut<TrigCodes::TrigBitSet>(&OffEle::trigCutsCutCode, trigCodes.getCode(tightTrig));
0884     addTightLooseTrigHist(eleMonElems, tightTrig, looseTrig, eleCut, "gsfEle_trigCuts", bins);
0885   }
0886 }
0887 
0888 //we transfer ownership of phoCut to the monitor elements
0889 void MonElemFuncs::initTightLooseDiObjTrigHistsTrigCuts(std::vector<MonElemContainer<OffPho>*>& phoMonElems,
0890                                                         const std::vector<std::string>& tightLooseTrigs,
0891                                                         const BinData& bins) {
0892   for (auto const& tightLooseTrig : tightLooseTrigs) {
0893     std::vector<std::string> splitString;
0894     boost::split(splitString, tightLooseTrig, boost::is_any_of(std::string(":")));
0895     if (splitString.size() != 2)
0896       continue;  //format incorrect
0897     const std::string& tightTrig = splitString[0];
0898     const std::string& looseTrig = splitString[1];
0899     EgHLTDQMCut<OffPho>* phoCut =
0900         new EgDiPhoUserCut<TrigCodes::TrigBitSet>(&OffPho::trigCutsCutCode, trigCodes.getCode(tightTrig));
0901     addTightLooseTrigHist(phoMonElems, tightTrig, looseTrig, phoCut, "pho_trigCuts", bins);
0902   }
0903 }
0904 
0905 //tag and probe trigger efficiencies
0906 //this is to measure the trigger efficiency with respect to a fully selected offline electron
0907 //using a tag and probe technique (note: this will be different to the trigger efficiency normally calculated)
0908 void MonElemFuncs::initTrigTagProbeHists(std::vector<MonElemContainer<OffEle>*>& eleMonElems,
0909                                          const std::vector<std::string>& filterNames,
0910                                          int cutMask,
0911                                          const BinData& bins) {
0912   for (const auto& trigName : filterNames) {
0913     //  float etCutValue = trigTools::getSecondEtThresFromName(trigName);
0914     float etCutValue = 0.;
0915     //std::cout<<"TrigName= "<<trigName<<"   etCutValue= "<<etCutValue<<std::endl;
0916     MonElemContainer<OffEle>* monElemCont = new MonElemContainer<OffEle>(
0917         "trigTagProbe",
0918         "Trigger Tag and Probe",
0919         new EgTrigTagProbeCut_New(trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),
0920                                   trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFiltesr"),
0921                                   cutMask,
0922                                   &OffEle::cutCode));
0923     //this is all that pass trigtagprobecut
0924     MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),
0925                                      trigName,
0926                                      trigName + "_" + monElemCont->name() + "_gsfEle_all",
0927                                      bins,
0928                                      new EgGreaterCut<OffEle, float>(etCutValue, &OffEle::etSC));
0929     //this is all that pass trigtagprobecut and the probe passes the test trigger
0930     MonElemFuncs::initStdEleCutHists(
0931         monElemCont->cutMonElems(),
0932         trigName,
0933         trigName + "_" + monElemCont->name() + "_gsfEle_pass",
0934         bins,
0935         &(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle, float>(etCutValue, &OffEle::etSC)
0936                                     << new EgObjTrigCut<OffEle>(trigCodes.getCode(trigName),
0937                                                                 EgObjTrigCut<OffEle>::AND)));
0938     //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is NOT a tag
0939     MonElemFuncs::initStdEleCutHists(
0940         monElemCont->cutMonElems(),
0941         trigName,
0942         trigName + "_" + monElemCont->name() + "_gsfEle_passNotTag",
0943         bins,
0944         &(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle, float>(etCutValue, &OffEle::etSC)
0945                                     << new EgObjTrigCut<OffEle>(
0946                                            trigCodes.getCode(trigName),
0947                                            EgObjTrigCut<OffEle>::AND,
0948                                            trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),
0949                                            EgObjTrigCut<OffEle>::AND)));
0950     //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is also a tag
0951     MonElemFuncs::initStdEleCutHists(
0952         monElemCont->cutMonElems(),
0953         trigName,
0954         trigName + "_" + monElemCont->name() + "_gsfEle_passTagTag",
0955         bins,
0956         &(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle, float>(etCutValue, &OffEle::etSC)
0957                                     << new EgObjTrigCut<OffEle>(trigCodes.getCode(trigName), EgObjTrigCut<OffEle>::AND)
0958                                     << new EgObjTrigCut<OffEle>(
0959                                            trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),
0960                                            EgObjTrigCut<OffEle>::AND)));
0961     //this is all that pass trigtagprobecut and the probe fails the test trigger
0962     MonElemFuncs::initStdEleCutHists(
0963         monElemCont->cutMonElems(),
0964         trigName,
0965         trigName + "_" + monElemCont->name() + "_gsfEle_fail",
0966         bins,
0967         &(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle, float>(etCutValue, &OffEle::etSC)
0968                                     << new EgObjTrigCut<OffEle>(
0969                                            trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),
0970                                            EgObjTrigCut<OffEle>::AND,
0971                                            trigCodes.getCode(trigName),
0972                                            EgObjTrigCut<OffEle>::AND)));
0973     /*
0974     monElemCont->monElems().push_back(new MonElemMgrEBEE<OffEle,float>(iBooker,trigName+"_"+monElemCont->name()+"_gsfEle_all_etUnCut",monElemCont->name()+"_gsfEle_all E_{T} (Uncut);E_{T} (GeV)",
0975                                        bins.et.nr,bins.et.min,bins.et.max,&OffEle::et));
0976     monElemCont->cutMonElems().push_back(new MonElemWithCutEBEE<OffEle,float>(iBooker,trigName+"_"+monElemCont->name()+"_gsfEle_pass_etUnCut",monElemCont->name()+"_gsfEle_pass E_{T} (Uncut);E_{T} (GeV)",
0977     bins.et.nr,bins.et.min,bins.et.max,&OffEle::et,new EgObjTrigCut<OffEle>(trigCodes.getCode(trigName),EgObjTrigCut<OffEle>::AND)));*/
0978     eleMonElems.push_back(monElemCont);
0979   }  //end filter names loop
0980 }
0981 
0982 //Only one at a time so I can set the folder
0983 void MonElemFuncs::initTrigTagProbeHist(std::vector<MonElemContainer<OffEle>*>& eleMonElems,
0984                                         const std::string& filterName,
0985                                         int cutMask,
0986                                         const BinData& bins) {
0987   const std::string& trigName(filterName);
0988   //float etCutValue = 1.1*trigTools::getSecondEtThresFromName(filterName);
0989   float etCutValue = 0.;
0990   //std::cout<<"TrigName= "<<trigName<<"   etCutValue= "<<etCutValue<<std::endl;
0991   MonElemContainer<OffEle>* monElemCont = new MonElemContainer<OffEle>(
0992       "trigTagProbe",
0993       "Trigger Tag and Probe",
0994       new EgTrigTagProbeCut_New(trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),
0995                                 trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),
0996                                 cutMask,
0997                                 &OffEle::cutCode));
0998   //this is all that pass trigtagprobecut
0999   MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),
1000                                    trigName,
1001                                    trigName + "_" + monElemCont->name() + "_gsfEle_all",
1002                                    bins,
1003                                    new EgGreaterCut<OffEle, float>(etCutValue, &OffEle::etSC));
1004   //this is all that pass trigtagprobecut and the probe passes the test trigger
1005   MonElemFuncs::initStdEleCutHists(
1006       monElemCont->cutMonElems(),
1007       trigName,
1008       trigName + "_" + monElemCont->name() + "_gsfEle_pass",
1009       bins,
1010       &(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle, float>(etCutValue, &OffEle::etSC)
1011                                   << new EgObjTrigCut<OffEle>(trigCodes.getCode(trigName), EgObjTrigCut<OffEle>::AND)));
1012   //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is NOT a tag
1013   MonElemFuncs::initStdEleCutHists(
1014       monElemCont->cutMonElems(),
1015       trigName,
1016       trigName + "_" + monElemCont->name() + "_gsfEle_passNotTag",
1017       bins,
1018       &(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle, float>(etCutValue, &OffEle::etSC)
1019                                   << new EgObjTrigCut<OffEle>(
1020                                          trigCodes.getCode(trigName),
1021                                          EgObjTrigCut<OffEle>::AND,
1022                                          trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),
1023                                          EgObjTrigCut<OffEle>::AND)));
1024   //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is also a tag
1025   MonElemFuncs::initStdEleCutHists(
1026       monElemCont->cutMonElems(),
1027       trigName,
1028       trigName + "_" + monElemCont->name() + "_gsfEle_passTagTag",
1029       bins,
1030       &(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle, float>(etCutValue, &OffEle::etSC)
1031                                   << new EgObjTrigCut<OffEle>(trigCodes.getCode(trigName), EgObjTrigCut<OffEle>::AND)
1032                                   << new EgObjTrigCut<OffEle>(
1033                                          trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),
1034                                          EgObjTrigCut<OffEle>::AND)));
1035   //this is all that pass trigtagprobecut and the probe fails the test trigger
1036   MonElemFuncs::initStdEleCutHists(
1037       monElemCont->cutMonElems(),
1038       trigName,
1039       trigName + "_" + monElemCont->name() + "_gsfEle_fail",
1040       bins,
1041       &(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle, float>(etCutValue, &OffEle::etSC)
1042                                   << new EgObjTrigCut<OffEle>(
1043                                          trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),
1044                                          EgObjTrigCut<OffEle>::AND,
1045                                          trigCodes.getCode(trigName),
1046                                          EgObjTrigCut<OffEle>::AND)));
1047   /*
1048     monElemCont->monElems().push_back(new MonElemMgrEBEE<OffEle,float>(iBooker,trigName+"_"+monElemCont->name()+"_gsfEle_all_etUnCut",monElemCont->name()+"_gsfEle_all E_{T} (Uncut);E_{T} (GeV)",
1049     bins.et.nr,bins.et.min,bins.et.max,&OffEle::et));
1050     monElemCont->cutMonElems().push_back(new MonElemWithCutEBEE<OffEle,float>(iBooker,trigName+"_"+monElemCont->name()+"_gsfEle_pass_etUnCut",monElemCont->name()+"_gsfEle_pass E_{T} (Uncut);E_{T} (GeV)",
1051     bins.et.nr,bins.et.min,bins.et.max,&OffEle::et,new EgObjTrigCut<OffEle>(trigCodes.getCode(trigName),EgObjTrigCut<OffEle>::AND)));*/
1052   eleMonElems.push_back(monElemCont);
1053 }
1054 
1055 void MonElemFuncs::initTrigTagProbeHist_2Leg(std::vector<MonElemContainer<OffEle>*>& eleMonElems,
1056                                              const std::string& filterName,
1057                                              int cutMask,
1058                                              const BinData& bins) {
1059   std::string trigNameLeg1 = filterName.substr(0, filterName.find("::"));
1060   std::string trigNameLeg2 = filterName.substr(filterName.find("::") + 2);
1061 
1062   float etCutValue = 0.;
1063   MonElemContainer<OffEle>* monElemCont = new MonElemContainer<OffEle>(
1064       "trigTagProbe",
1065       "Trigger Tag and Probe",
1066       new EgTrigTagProbeCut_New(trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),
1067                                 trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),
1068                                 cutMask,
1069                                 &OffEle::cutCode));
1070   //this is all that pass trigtagprobecut
1071   //MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigNameLeg2,trigNameLeg2+"_"+monElemCont->name()+"_gsfEle_allEt20",bins,new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC));
1072   //this is all that pass trigtagprobecut and the probe passes the first trigger
1073   //MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigNameLeg2,trigNameLeg2+"_"+monElemCont->name()+"_gsfEle_passEt20",bins,&(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC) << new EgObjTrigCut<OffEle>(trigCodes.getCode(trigNameLeg1),EgObjTrigCut<OffEle>::AND)));
1074   //this is all that pass trigtagprobecut and the probe passes the second trigger and fails the first trigger
1075   MonElemFuncs::initStdEleCutHists(
1076       monElemCont->cutMonElems(),
1077       trigNameLeg2,
1078       trigNameLeg2 + "_" + monElemCont->name() + "_gsfEle_passLeg2failLeg1",
1079       bins,
1080       &(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle, float>(etCutValue, &OffEle::etSC)
1081                                   << new EgObjTrigCut<OffEle>(trigCodes.getCode(trigNameLeg2),
1082                                                               EgObjTrigCut<OffEle>::AND,
1083                                                               trigCodes.getCode(trigNameLeg1),
1084                                                               EgObjTrigCut<OffEle>::AND)));
1085 }
1086 
1087 //Now same for photons
1088 void MonElemFuncs::initTrigTagProbeHists(std::vector<MonElemContainer<OffPho>*>& phoMonElems,
1089                                          const std::vector<std::string>& filterNames,
1090                                          int cutMask,
1091                                          const BinData& bins) {
1092   for (const auto& trigName : filterNames) {
1093     //float etCutValue = trigTools::getSecondEtThresFromName(trigName);
1094     float etCutValue = 0.;
1095     //std::cout<<"TrigName= "<<trigName<<"   etCutValue= "<<etCutValue<<std::endl;
1096     MonElemContainer<OffPho>* monElemCont = new MonElemContainer<OffPho>(
1097         "trigTagProbe",
1098         "Trigger Tag and Probe",
1099         new EgTrigTagProbeCut_NewPho(trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),
1100                                      trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),
1101                                      cutMask,
1102                                      &OffPho::cutCode));
1103     //this is all that pass trigtagprobecut
1104     MonElemFuncs::initStdPhoCutHists(monElemCont->cutMonElems(),
1105                                      trigName,
1106                                      trigName + "_" + monElemCont->name() + "_pho_all",
1107                                      bins,
1108                                      new EgGreaterCut<OffPho, float>(etCutValue, &OffPho::etSC));
1109     //this is all that pass trigtagprobecut and the probe passes the test trigger
1110     MonElemFuncs::initStdPhoCutHists(
1111         monElemCont->cutMonElems(),
1112         trigName,
1113         trigName + "_" + monElemCont->name() + "_pho_pass",
1114         bins,
1115         &(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho, float>(etCutValue, &OffPho::etSC)
1116                                     << new EgObjTrigCut<OffPho>(trigCodes.getCode(trigName),
1117                                                                 EgObjTrigCut<OffPho>::AND)));
1118     //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is NOT a tag
1119     MonElemFuncs::initStdPhoCutHists(
1120         monElemCont->cutMonElems(),
1121         trigName,
1122         trigName + "_" + monElemCont->name() + "_pho_passNotTag",
1123         bins,
1124         &(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho, float>(etCutValue, &OffPho::etSC)
1125                                     << new EgObjTrigCut<OffPho>(
1126                                            trigCodes.getCode(trigName),
1127                                            EgObjTrigCut<OffPho>::AND,
1128                                            trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),
1129                                            EgObjTrigCut<OffPho>::AND)));
1130     //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is also a tag
1131     MonElemFuncs::initStdPhoCutHists(
1132         monElemCont->cutMonElems(),
1133         trigName,
1134         trigName + "_" + monElemCont->name() + "_pho_passTagTag",
1135         bins,
1136         &(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho, float>(etCutValue, &OffPho::etSC)
1137                                     << new EgObjTrigCut<OffPho>(trigCodes.getCode(trigName), EgObjTrigCut<OffPho>::AND)
1138                                     << new EgObjTrigCut<OffPho>(
1139                                            trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),
1140                                            EgObjTrigCut<OffPho>::AND)));
1141     //this is all that pass trigtagprobecut and the probe fails the test trigger
1142     MonElemFuncs::initStdPhoCutHists(
1143         monElemCont->cutMonElems(),
1144         trigName,
1145         trigName + "_" + monElemCont->name() + "_pho_fail",
1146         bins,
1147         &(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho, float>(etCutValue, &OffPho::etSC)
1148                                     << new EgObjTrigCut<OffPho>(
1149                                            trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),
1150                                            EgObjTrigCut<OffPho>::AND,
1151                                            trigCodes.getCode(trigName),
1152                                            EgObjTrigCut<OffPho>::AND)));
1153     /*
1154     monElemCont->monElems().push_back(new MonElemMgrEBEE<OffPho,float>(iBooker,trigName+"_"+monElemCont->name()+"_pho_all_etUnCut",monElemCont->name()+"_gsfEle_all E_{T} (Uncut);E_{T} (GeV)",
1155                                        bins.et.nr,bins.et.min,bins.et.max,&OffPho::et));
1156     monElemCont->cutMonElems().push_back(new MonElemWithCutEBEE<OffPho,float>(iBooker,trigName+"_"+monElemCont->name()+"_pho_pass_etUnCut",monElemCont->name()+"_gsfEle_pass E_{T} (Uncut);E_{T} (GeV)",
1157     bins.et.nr,bins.et.min,bins.et.max,&OffPho::et,new EgObjTrigCut<OffPho>(trigCodes.getCode(trigName),EgObjTrigCut<OffPho>::AND)));*/
1158     phoMonElems.push_back(monElemCont);
1159   }  //end filter names loop
1160 }
1161 
1162 void MonElemFuncs::initTrigTagProbeHist(std::vector<MonElemContainer<OffPho>*>& phoMonElems,
1163                                         const std::string& filterName,
1164                                         int cutMask,
1165                                         const BinData& bins) {
1166   const std::string& trigName(filterName);
1167   //float etCutValue = 1.1*trigTools::getSecondEtThresFromName(trigName);
1168   float etCutValue = 0.;
1169   //std::cout<<"TrigName= "<<trigName<<"   etCutValue= "<<etCutValue<<std::endl;
1170   MonElemContainer<OffPho>* monElemCont = new MonElemContainer<OffPho>(
1171       "trigTagProbe",
1172       "Trigger Tag and Probe",
1173       new EgTrigTagProbeCut_NewPho(trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),
1174                                    trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),
1175                                    cutMask,
1176                                    &OffPho::cutCode));
1177   //this is all that pass trigtagprobecut
1178   MonElemFuncs::initStdPhoCutHists(monElemCont->cutMonElems(),
1179                                    trigName,
1180                                    trigName + "_" + monElemCont->name() + "_pho_all",
1181                                    bins,
1182                                    new EgGreaterCut<OffPho, float>(etCutValue, &OffPho::etSC));
1183   //this is all that pass trigtagprobecut and the probe passes the test trigger
1184   MonElemFuncs::initStdPhoCutHists(
1185       monElemCont->cutMonElems(),
1186       trigName,
1187       trigName + "_" + monElemCont->name() + "_pho_pass",
1188       bins,
1189       &(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho, float>(etCutValue, &OffPho::etSC)
1190                                   << new EgObjTrigCut<OffPho>(trigCodes.getCode(trigName), EgObjTrigCut<OffPho>::AND)));
1191   //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is NOT a tag
1192   MonElemFuncs::initStdPhoCutHists(
1193       monElemCont->cutMonElems(),
1194       trigName,
1195       trigName + "_" + monElemCont->name() + "_pho_passNotTag",
1196       bins,
1197       &(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho, float>(etCutValue, &OffPho::etSC)
1198                                   << new EgObjTrigCut<OffPho>(
1199                                          trigCodes.getCode(trigName),
1200                                          EgObjTrigCut<OffPho>::AND,
1201                                          trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),
1202                                          EgObjTrigCut<OffPho>::AND)));
1203   //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is also a tag
1204   MonElemFuncs::initStdPhoCutHists(
1205       monElemCont->cutMonElems(),
1206       trigName,
1207       trigName + "_" + monElemCont->name() + "_pho_passTagTag",
1208       bins,
1209       &(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho, float>(etCutValue, &OffPho::etSC)
1210                                   << new EgObjTrigCut<OffPho>(trigCodes.getCode(trigName), EgObjTrigCut<OffPho>::AND)
1211                                   << new EgObjTrigCut<OffPho>(
1212                                          trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),
1213                                          EgObjTrigCut<OffPho>::AND)));
1214   //this is all that pass trigtagprobecut and the probe fails the test trigger
1215   MonElemFuncs::initStdPhoCutHists(
1216       monElemCont->cutMonElems(),
1217       trigName,
1218       trigName + "_" + monElemCont->name() + "_pho_fail",
1219       bins,
1220       &(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho, float>(etCutValue, &OffPho::etSC)
1221                                   << new EgObjTrigCut<OffPho>(
1222                                          trigCodes.getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),
1223                                          EgObjTrigCut<OffPho>::AND,
1224                                          trigCodes.getCode(trigName),
1225                                          EgObjTrigCut<OffPho>::AND)));
1226   /*
1227     monElemCont->monElems().push_back(new MonElemMgrEBEE<OffPho,float>(iBooker,trigName+"_"+monElemCont->name()+"_pho_all_etUnCut",monElemCont->name()+"_gsfEle_all E_{T} (Uncut);E_{T} (GeV)",
1228                                        bins.et.nr,bins.et.min,bins.et.max,&OffPho::et));
1229     monElemCont->cutMonElems().push_back(new MonElemWithCutEBEE<OffPho,float>(iBooker,trigName+"_"+monElemCont->name()+"_pho_pass_etUnCut",monElemCont->name()+"_gsfEle_pass E_{T} (Uncut);E_{T} (GeV)",
1230     bins.et.nr,bins.et.min,bins.et.max,&OffPho::et,new EgObjTrigCut<OffPho>(trigCodes.getCode(trigName),EgObjTrigCut<OffPho>::AND)));*/
1231   phoMonElems.push_back(monElemCont);
1232 }