CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/DQMOffline/Trigger/src/EgHLTMonElemFuncs.cc

Go to the documentation of this file.
00001 #include "DQMOffline/Trigger/interface/EgHLTMonElemFuncs.h"
00002 
00003 #include "DQMOffline/Trigger/interface/EgHLTMonElemMgrEBEE.h"
00004 #include "DQMOffline/Trigger/interface/EgHLTEgCutCodes.h"
00005 #include "DQMOffline/Trigger/interface/EgHLTDQMCut.h"
00006 #include "DQMOffline/Trigger/interface/EgHLTCutMasks.h"
00007 
00008 
00009 using namespace egHLT;
00010 
00011 void MonElemFuncs::initStdEleHists(std::vector<MonElemManagerBase<OffEle>*>& histVec,const std::string& filterName,const std::string& baseName,const BinData& bins)
00012 {
00013   addStdHist<OffEle,float>(histVec,baseName+"_et",baseName+" E_{T};E_{T} (GeV)",bins.et,&OffEle::et); 
00014   addStdHist<OffEle,float>(histVec,baseName+"_etHigh",baseName+" E_{T};E_{T} (GeV)",bins.etHigh,&OffEle::et); 
00015   addStdHist<OffEle,float>(histVec,baseName+"_etSC",baseName+" E^{SC}_{T};E^{SC}_{T} (GeV)",bins.et,&OffEle::etSC);
00016   addStdHist<OffEle,float>(histVec,baseName+"_eta",baseName+" #eta;#eta",bins.eta,&OffEle::detEta);             
00017   addStdHist<OffEle,float>(histVec,baseName+"_phi",baseName+" #phi;#phi (rad)",bins.phi,&OffEle::phi);
00018   // addStdHist<OffEle,int>(histVec,baseName+"_charge",baseName+" Charge; charge",bins.charge,&OffEle::charge);
00019   
00020   addStdHist<OffEle,float>(histVec,baseName+"_hOverE",baseName+" H/E; H/E",bins.hOverE,&OffEle::hOverE);
00021   //----Morse
00022   addStdHist<OffEle,float>(histVec,baseName+"_maxr9",baseName+" MAXR9 ; MAXR9",bins.maxr9,&OffEle::r9);
00023   //-------
00024   addStdHist<OffEle,float>(histVec,baseName+"_dPhiIn",baseName+" #Delta #phi_{in}; #Delta #phi_{in}",bins.dPhiIn,&OffEle::dPhiIn);
00025   addStdHist<OffEle,float>(histVec,baseName+"_dEtaIn",baseName+" #Delta #eta_{in}; #Delta #eta_{in}",bins.dEtaIn,&OffEle::dEtaIn);
00026   addStdHist<OffEle,float>(histVec,baseName+"_sigmaIEtaIEta",baseName+"#sigma_{i#etai#eta}; #sigma_{i#etai#eta}",bins.sigEtaEta,&OffEle::sigmaIEtaIEta);  
00027   addStdHist<OffEle,float>(histVec,baseName+"_epIn",baseName+"E/p_{in}; E/p_{in}",bins.eOverP,&OffEle::epIn);
00028   addStdHist<OffEle,float>(histVec,baseName+"_epOut",baseName+"E/p_{out}; E/p_{out}",bins.eOverP,&OffEle::epOut); 
00029   addStdHist<OffEle,float>(histVec,baseName+"_invEInvP",baseName+"1/E -1/p; 1/E - 1/p",bins.invEInvP,&OffEle::invEInvP);
00030 
00031   addStdHist<OffEle,float>(histVec,baseName+"_e2x5Over5x5",baseName+"E^{2x5}/E^{5x5}; E^{2x5}/E^{5x5}",bins.e2x5,&OffEle::e2x5MaxOver5x5);
00032   addStdHist<OffEle,float>(histVec,baseName+"_e1x5Over5x5",baseName+"E^{1x5}/E^{5x5}; E^{1x5}/E^{5x5}",bins.e1x5,&OffEle::e1x5Over5x5);
00033   // addStdHist<OffEle,float>(histVec,baseName+"_isolEM",baseName+"Isol EM; Isol EM (GeV)",bins.isolEm,&OffEle::isolEm); 
00034   //addStdHist<OffEle,float>(histVec,baseName+"_isolHad",baseName+"Isol Had; Isol Had (GeV)",bins.isolHad,&OffEle::isolHad);
00035   //addStdHist<OffEle,float>(histVec,baseName+"_isolPtTrks",baseName+"Isol Pt Trks; Isol Pt Tracks (GeV/c)",bins.isolPtTrks,&OffEle::isolPtTrks); 
00036   addStdHist<OffEle,float>(histVec,baseName+"_hltIsolTrksEle",baseName+"HLT Ele Isol Trks; HLT Ele Iso Tracks (GeV/c)",bins.isolPtTrks,&OffEle::hltIsolTrksEle);  
00037   //addStdHist<OffEle,float>(histVec,baseName+"_hltIsolTrksPho",baseName+"HLT Pho Isol Trks; HLT Pho Iso Tracks (GeV/c)",bins.isolPtTrks,&OffEle::hltIsolTrksPho); 
00038   addStdHist<OffEle,float>(histVec,baseName+"_hltIsolHad",baseName+"HLT Isol Had; HLT Isol Had (GeV)",bins.isolHad,&OffEle::hltIsolHad);
00039   addStdHist<OffEle,float>(histVec,baseName+"_hltIsolEm",baseName+"HLT Isol Em; HLT Isol Em (GeV)",bins.isolEm,&OffEle::hltIsolEm);
00040   
00041   histVec.push_back(new MonElemManager2D<OffEle,float,float>(baseName+"_etaVsPhi",
00042                                                              baseName+" #eta vs #phi;#eta;#phi (rad)",
00043                                                              bins.etaVsPhi.nrX,bins.etaVsPhi.xMin,bins.etaVsPhi.xMax,
00044                                                              bins.etaVsPhi.nrY,bins.etaVsPhi.yMin,bins.etaVsPhi.yMax,
00045                                                              &OffEle::detEta,&OffEle::phi));
00046  
00047 }
00048 
00049 void MonElemFuncs::initStdPhoHists(std::vector<MonElemManagerBase<OffPho>*>& histVec,const std::string& filterName,const std::string& baseName,const BinData& bins)
00050 {
00051   addStdHist<OffPho,float>(histVec,baseName+"_et",baseName+" E_{T};E_{T} (GeV)",bins.et,&OffPho::et); 
00052   addStdHist<OffPho,float>(histVec,baseName+"_etHigh",baseName+" E_{T};E_{T} (GeV)",bins.etHigh,&OffPho::et);
00053   addStdHist<OffPho,float>(histVec,baseName+"_etSC",baseName+" E^{SC}_{T};E^{SC}_{T} (GeV)",bins.et,&OffPho::etSC);
00054   addStdHist<OffPho,float>(histVec,baseName+"_eta",baseName+" #eta;#eta",bins.eta,&OffPho::detEta);             
00055   addStdHist<OffPho,float>(histVec,baseName+"_phi",baseName+" #phi;#phi (rad)",bins.phi,&OffPho::phi);
00056   
00057   addStdHist<OffPho,float>(histVec,baseName+"_hOverE",baseName+" H/E; H/E",bins.hOverE,&OffPho::hOverE);
00058   //----Morse
00059   //addStdHist<OffPho,float>(histVec,baseName+"_r9",baseName+" R9 ; R9",bins.r9,&OffPho::r9);
00060   //addStdHist<OffPho,float>(histVec,baseName+"_minr9",baseName+" MINR9 ; MINR9",bins.minr9,&OffPho::r9);
00061   addStdHist<OffPho,float>(histVec,baseName+"_maxr9",baseName+" MAXR9 ; MAXR9",bins.maxr9,&OffPho::r9);
00062   //-------
00063   addStdHist<OffPho,float>(histVec,baseName+"_sigmaIEtaIEta",baseName+"#sigma_{i#etai#eta}; #sigma_{i#etai#eta}",bins.sigEtaEta,&OffPho::sigmaIEtaIEta);  
00064   addStdHist<OffPho,float>(histVec,baseName+"_e2x5Over5x5",baseName+"E^{2x5}/E^{5x5}; E^{2x5}/E^{5x5}",bins.e2x5,&OffPho::e2x5MaxOver5x5);
00065   addStdHist<OffPho,float>(histVec,baseName+"_e1x5Over5x5",baseName+"E^{1x5}/E^{5x5}; E^{1x5}/E^{5x5}",bins.e1x5,&OffPho::e1x5Over5x5);
00066   addStdHist<OffPho,float>(histVec,baseName+"_isolEM",baseName+"Isol EM; Isol EM (GeV)",bins.isolEm,&OffPho::isolEm); 
00067   addStdHist<OffPho,float>(histVec,baseName+"_isolHad",baseName+"Isol Had; Isol Had (GeV)",bins.isolHad,&OffPho::isolHad);
00068   addStdHist<OffPho,float>(histVec,baseName+"_isolPtTrks",baseName+"Isol Pt Trks; Isol Pt Tracks (GeV/c)",bins.isolPtTrks,&OffPho::isolPtTrks);  
00069   addStdHist<OffPho,int>(histVec,baseName+"_isolNrTrks",baseName+"Isol Nr Trks; Isol Nr Tracks",bins.isolNrTrks,&OffPho::isolNrTrks); 
00070   // addStdHist<OffPho,float>(histVec,baseName+"_hltIsolTrks",baseName+"HLT Isol Trks; HLT Iso Tracks (GeV/c)",bins.isolPtTrks,&OffPho::hltIsolTrks); 
00071   //addStdHist<OffPho,float>(histVec,baseName+"_hltIsolHad",baseName+"HLT Isol Had; HLT Isol Had (GeV)",bins.isolPtTrks,&OffPho::hltIsolHad);
00072   
00073   histVec.push_back(new MonElemManager2D<OffPho,float,float>(baseName+"_etaVsPhi",
00074                                                              baseName+" #eta vs #phi;#eta;#phi (rad)",
00075                                                              bins.etaVsPhi.nrX,bins.etaVsPhi.xMin,bins.etaVsPhi.xMax,
00076                                                              bins.etaVsPhi.nrY,bins.etaVsPhi.yMin,bins.etaVsPhi.yMax,
00077                                                              &OffPho::detEta,&OffPho::phi));
00078 }
00079  
00080 void MonElemFuncs::initStdEffHists(std::vector<MonElemWithCutBase<OffEle>*>& histVec,const std::string& filterName,const std::string& baseName,const BinData::Data1D& bins,float (OffEle::*vsVarFunc)()const,const CutMasks& masks)
00081 {
00082   initStdEffHists(histVec,filterName,baseName,bins.nr,bins.min,bins.max,vsVarFunc,masks);
00083 }
00084   
00085 void MonElemFuncs::initStdEffHists(std::vector<MonElemWithCutBase<OffPho>*>& histVec,const std::string& filterName,const std::string& baseName,const BinData::Data1D& bins,float (OffPho::*vsVarFunc)()const,const CutMasks& masks)
00086 {
00087   initStdEffHists(histVec,filterName,baseName,bins.nr,bins.min,bins.max,vsVarFunc,masks);
00088 }
00089 
00090 void MonElemFuncs::initStdEffHists(std::vector<MonElemWithCutBase<OffEle>*>& histVec,const std::string& filterName,const std::string& baseName,int nrBins,double xMin,double xMax,float (OffEle::*vsVarFunc)()const,const CutMasks& masks)
00091 {
00092   //some convience typedefs, I hate typedefs but atleast here where they are defined is obvious
00093   typedef EgHLTDQMVarCut<OffEle> VarCut;
00094   typedef MonElemWithCutEBEE<OffEle,float> MonElemFloat;
00095   int stdCutCode = masks.stdEle;
00096 
00097   //first do the zero and all cuts histograms
00098   histVec.push_back(new MonElemFloat(baseName+"_noCuts",baseName+" NoCuts",nrBins,xMin,xMax,vsVarFunc));
00099   histVec.push_back(new MonElemFloat(baseName+"_allCuts",baseName+" All Cuts",nrBins,xMin,xMax,vsVarFunc,
00100                                      new VarCut(stdCutCode,&OffEle::cutCode))); 
00101                        
00102   //now for the n-1
00103   histVec.push_back(new MonElemFloat(baseName+"_n1_dEtaIn",baseName+" N1 #Delta#eta_{in}",nrBins,xMin,xMax,vsVarFunc,
00104                                      new VarCut(~EgCutCodes::DETAIN&stdCutCode,&OffEle::cutCode)));
00105   histVec.push_back(new MonElemFloat(baseName+"_n1_dPhiIn",baseName+" N1 #Delta#phi_{in}",nrBins,xMin,xMax,vsVarFunc,
00106                                      new VarCut(~EgCutCodes::DPHIIN&stdCutCode,&OffEle::cutCode)));
00107   histVec.push_back(new MonElemFloat(baseName+"_n1_sigmaIEtaIEta",baseName+" N1 #sigma_{i#etai#eta}",nrBins,xMin,xMax,vsVarFunc,
00108                                      new VarCut(~EgCutCodes::SIGMAIETAIETA&stdCutCode,&OffEle::cutCode)));
00109   histVec.push_back(new MonElemFloat(baseName+"_n1_hOverE",baseName+" N1 H/E",nrBins,xMin,xMax,vsVarFunc,
00110                                      new VarCut(~EgCutCodes::HADEM&stdCutCode,&OffEle::cutCode)));
00111   /* histVec.push_back(new MonElemFloat(baseName+"_n1_isolEm",baseName+" N1 Isol Em",nrBins,xMin,xMax,vsVarFunc,
00112      new VarCut(~EgCutCodes::ISOLEM&stdCutCode,&OffEle::cutCode)));
00113      histVec.push_back(new MonElemFloat(baseName+"_n1_isolHad",baseName+" N1 Isol Had",nrBins,xMin,xMax,vsVarFunc,
00114      new VarCut(~EgCutCodes::ISOLHAD&stdCutCode,&OffEle::cutCode)));
00115      histVec.push_back(new MonElemFloat(baseName+"_n1_isolPtTrks",baseName+" N1 Isol Tracks",nrBins,xMin,xMax,vsVarFunc,
00116      new VarCut(~EgCutCodes::ISOLPTTRKS&stdCutCode,&OffEle::cutCode)));*/
00117   histVec.push_back(new MonElemFloat(baseName+"_n1_hltIsolEm",baseName+" N1 HLT Isol Em",nrBins,xMin,xMax,vsVarFunc,
00118                                      new VarCut(~EgCutCodes::HLTISOLEM&stdCutCode,&OffEle::cutCode)));
00119   histVec.push_back(new MonElemFloat(baseName+"_n1_hltIsolHad",baseName+" N1 HLT Isol Had",nrBins,xMin,xMax,vsVarFunc,
00120                                      new VarCut(~EgCutCodes::HLTISOLHAD&stdCutCode,&OffEle::cutCode)));
00121   histVec.push_back(new MonElemFloat(baseName+"_n1_hltIsolTrksEle",baseName+" N1 HLT Isol Tracks Ele ",nrBins,xMin,xMax,vsVarFunc,
00122                                      new VarCut(~EgCutCodes::HLTISOLTRKSELE&stdCutCode,&OffEle::cutCode)));
00123   histVec.push_back(new MonElemFloat(baseName+"_single_dEtaIn",baseName+" Single #Delta#eta_{in}",nrBins,xMin,xMax,vsVarFunc,
00124                                      new VarCut(EgCutCodes::DETAIN,&OffEle::cutCode)));
00125   histVec.push_back(new MonElemFloat(baseName+"_single_dPhiIn",baseName+" Single #Delta#phi_{in}",nrBins,xMin,xMax,vsVarFunc,
00126                                      new VarCut(EgCutCodes::DPHIIN,&OffEle::cutCode)));
00127   histVec.push_back(new MonElemFloat(baseName+"_single_sigmaIEtaIEta",baseName+" Single #sigma_{i#etai#eta}",nrBins,xMin,xMax,vsVarFunc,
00128                                      new VarCut(EgCutCodes::SIGMAIETAIETA,&OffEle::cutCode)));
00129   histVec.push_back(new MonElemFloat(baseName+"_single_hOverE",baseName+" Single H/E",nrBins,xMin,xMax,vsVarFunc,
00130                                      new VarCut(EgCutCodes::HADEM,&OffEle::cutCode)));
00131   /* histVec.push_back(new MonElemFloat(baseName+"_single_isolEm",baseName+" Single Isol Em",nrBins,xMin,xMax,vsVarFunc,
00132      new VarCut(EgCutCodes::ISOLEM,&OffEle::cutCode)));
00133      histVec.push_back(new MonElemFloat(baseName+"_single_isolHad",baseName+" Single Isol Had",nrBins,xMin,xMax,vsVarFunc,
00134      new VarCut(EgCutCodes::ISOLHAD,&OffEle::cutCode)));
00135      histVec.push_back(new MonElemFloat(baseName+"_single_isolPtTrks",baseName+" Single Isol Tracks",nrBins,xMin,xMax,vsVarFunc,
00136      new VarCut(EgCutCodes::ISOLPTTRKS,&OffEle::cutCode)));*/
00137   histVec.push_back(new MonElemFloat(baseName+"_single_hltIsolEm",baseName+" Single HLT Isol Em",nrBins,xMin,xMax,vsVarFunc,
00138                                      new VarCut(EgCutCodes::HLTISOLEM,&OffEle::cutCode)));
00139   histVec.push_back(new MonElemFloat(baseName+"_single_hltIsolHad",baseName+" Single HLT Isol Had",nrBins,xMin,xMax,vsVarFunc,
00140                                      new VarCut(EgCutCodes::HLTISOLHAD,&OffEle::cutCode)));
00141   histVec.push_back(new MonElemFloat(baseName+"_single_hltIsolTrksEle",baseName+" Single HLT Isol Tracks Ele ",nrBins,xMin,xMax,vsVarFunc,
00142                                      new VarCut(EgCutCodes::HLTISOLTRKSELE,&OffEle::cutCode))); 
00143   /*histVec.push_back(new MonElemFloat(baseName+"_single_hltIsolTrksPho",baseName+" Single HLT Isol Tracks Pho ",nrBins,xMin,xMax,vsVarFunc,
00144     new VarCut(EgCutCodes::HLTISOLTRKSPHO,&OffEle::cutCode)));*/
00145   
00146 }
00147 
00148 void MonElemFuncs::initStdEffHists(std::vector<MonElemWithCutBase<OffPho>*>& histVec,const std::string& filterName,const std::string& baseName,int nrBins,double xMin,double xMax,float (OffPho::*vsVarFunc)()const,const CutMasks& masks)
00149 {
00150   //some convenience typedefs, I hate typedefs but atleast here where they are defined is obvious
00151   typedef EgHLTDQMVarCut<OffPho> VarCut;
00152   typedef MonElemWithCutEBEE<OffPho,float> MonElemFloat;
00153   int stdCutCode = masks.stdPho;
00154 
00155   histVec.push_back(new MonElemFloat(baseName+"_noCuts",baseName+" NoCuts",nrBins,xMin,xMax,vsVarFunc));
00156   histVec.push_back(new MonElemFloat(baseName+"_allCuts",baseName+" All Cuts",nrBins,xMin,xMax,vsVarFunc,
00157                                      new VarCut(stdCutCode,&OffPho::cutCode))); 
00158 
00159   
00160   histVec.push_back(new MonElemFloat(baseName+"_n1_sigmaIEtaIEta",baseName+" N1 #sigma_{i#etai#eta}",nrBins,xMin,xMax,vsVarFunc,
00161                                      new VarCut(~EgCutCodes::SIGMAIETAIETA&stdCutCode,&OffPho::cutCode)));
00162   //-----Morse------
00163   histVec.push_back(new MonElemFloat(baseName+"_n1_hOverE",baseName+" N1 H/E",nrBins,xMin,xMax,vsVarFunc,
00164                                      new VarCut(~EgCutCodes::HADEM&stdCutCode,&OffPho::cutCode)));//---BUG FIX!!--
00165   /*histVec.push_back(new MonElemFloat(baseName+"_n1_minr9",baseName+" N1 MINR9",nrBins,xMin,xMax,vsVarFunc,
00166     new VarCut(~EgCutCodes::MINR9&stdCutCode,&OffPho::cutCode)));
00167     histVec.push_back(new MonElemFloat(baseName+"_n1_maxr9",baseName+" N1 MAXR9",nrBins,xMin,xMax,vsVarFunc,
00168     new VarCut(~EgCutCodes::MAXR9&stdCutCode,&OffPho::cutCode)));*/
00169   //----------------
00170   histVec.push_back(new MonElemFloat(baseName+"_n1_isolEm",baseName+" N1 Isol Em",nrBins,xMin,xMax,vsVarFunc,
00171                                      new VarCut(~EgCutCodes::ISOLEM&stdCutCode,&OffPho::cutCode)));
00172   histVec.push_back(new MonElemFloat(baseName+"_n1_isolHad",baseName+" N1 Isol Had",nrBins,xMin,xMax,vsVarFunc,
00173                                      new VarCut(~EgCutCodes::ISOLHAD&stdCutCode,&OffPho::cutCode)));
00174   histVec.push_back(new MonElemFloat(baseName+"_n1_isolPtTrks",baseName+" N1 Pt Isol Tracks",nrBins,xMin,xMax,vsVarFunc,
00175                                      new VarCut(~EgCutCodes::ISOLPTTRKS&stdCutCode,&OffPho::cutCode))); 
00176   histVec.push_back(new MonElemFloat(baseName+"_n1_isolNrTrks",baseName+" N1 Nr Isol Tracks",nrBins,xMin,xMax,vsVarFunc,
00177                                      new VarCut(~EgCutCodes::ISOLNRTRKS&stdCutCode,&OffPho::cutCode)));
00178 
00179   histVec.push_back(new MonElemFloat(baseName+"_single_hOverE",baseName+" Single H/E",nrBins,xMin,xMax,vsVarFunc,
00180                                      new VarCut(EgCutCodes::HADEM,&OffPho::cutCode)));
00181   histVec.push_back(new MonElemFloat(baseName+"_single_sigmaIEtaIEta",baseName+" Single #sigma_{i#etai#eta}",nrBins,xMin,xMax,vsVarFunc,
00182                                      new VarCut(EgCutCodes::SIGMAIETAIETA,&OffPho::cutCode)));
00183   histVec.push_back(new MonElemFloat(baseName+"_single_isolEm",baseName+" Single Isol Em",nrBins,xMin,xMax,vsVarFunc,
00184                                      new VarCut(~EgCutCodes::ISOLEM,&OffPho::cutCode)));
00185   histVec.push_back(new MonElemFloat(baseName+"_single_isolHad",baseName+" Single Isol Had",nrBins,xMin,xMax,vsVarFunc,
00186                                      new VarCut(~EgCutCodes::ISOLHAD,&OffPho::cutCode)));
00187   histVec.push_back(new MonElemFloat(baseName+"_single_isolPtTrks",baseName+" Single Pt Isol Tracks",nrBins,xMin,xMax,vsVarFunc,
00188                                      new VarCut(~EgCutCodes::ISOLPTTRKS,&OffPho::cutCode))); 
00189   /*histVec.push_back(new MonElemFloat(baseName+"_single_hltIsolHad",baseName+" Single HLT Isol Had",nrBins,xMin,xMax,vsVarFunc,
00190     new VarCut(EgCutCodes::HLTISOLHAD,&OffPho::cutCode)));
00191     histVec.push_back(new MonElemFloat(baseName+"_single_hltIsolTrksPho",baseName+" Single HLT Isol Tracks Pho ",nrBins,xMin,xMax,vsVarFunc,
00192     new VarCut(EgCutCodes::HLTISOLTRKSPHO,&OffPho::cutCode)));*/
00193 
00194   
00195 }
00196 
00197 
00198 //we own the passed in cut, so we give it to the first mon element and then clone it after that
00199 //only currently used for trigger tag and probe
00200 void MonElemFuncs::initStdEleCutHists(std::vector<MonElemWithCutBase<OffEle>*>& histVec,const std::string& filterName,const std::string& baseName,const BinData& bins,EgHLTDQMCut<OffEle>* cut)
00201 {
00202   histVec.push_back(new MonElemWithCutEBEE<OffEle,float>(baseName+"_et",
00203                                                          baseName+" E_{T};E_{T} (GeV)",
00204                                                          bins.et.nr,bins.et.min,bins.et.max,&OffEle::et,cut));
00205   histVec.push_back(new MonElemWithCutEBEE<OffEle,float>(baseName+"_eta",
00206                                                          baseName+" #eta;#eta",
00207                                                          bins.eta.nr,bins.eta.min,bins.eta.max,
00208                                                          &OffEle::detEta,cut ? cut->clone(): NULL));            
00209   histVec.push_back(new MonElemWithCutEBEE<OffEle,float>(baseName+"_phi",
00210                                                          baseName+" #phi;#phi (rad)",
00211                                                          bins.phi.nr,bins.phi.min,bins.phi.max,
00212                                                          &OffEle::phi,cut ? cut->clone():NULL));                
00213   histVec.push_back(new MonElemWithCutEBEE<OffEle,int>(baseName+"_nVertex",
00214                                                          baseName+" nVertex;nVertex",
00215                                                          bins.nVertex.nr,bins.nVertex.min,bins.nVertex.max,
00216                                                          &OffEle::NVertex,cut ? cut->clone():NULL));
00217   /*  histVec.push_back(new MonElemWithCutEBEE<OffEle,int>(baseName+"_charge",
00218                                                        baseName+" Charge; charge",
00219                                                        bins.charge.nr,bins.charge.min,bins.charge.max,
00220                                                        &OffEle::charge,cut ? cut->clone():NULL)); */
00221 }
00222 
00223 
00224 void MonElemFuncs::initStdPhoCutHists(std::vector<MonElemWithCutBase<OffPho>*>& histVec,const std::string& filterName,const std::string& baseName,const BinData& bins,EgHLTDQMCut<OffPho>* cut)
00225 {
00226   histVec.push_back(new MonElemWithCutEBEE<OffPho,float>(baseName+"_et",
00227                                                          baseName+" E_{T};E_{T} (GeV)",
00228                                                          bins.et.nr,bins.et.min,bins.et.max,&OffPho::et,cut));
00229   histVec.push_back(new MonElemWithCutEBEE<OffPho,float>(baseName+"_eta",
00230                                                          baseName+" #eta;#eta",
00231                                                          bins.eta.nr,bins.eta.min,bins.eta.max,
00232                                                          &OffPho::detEta,cut ? cut->clone(): NULL));            
00233   histVec.push_back(new MonElemWithCutEBEE<OffPho,float>(baseName+"_phi",
00234                                                          baseName+" #phi;#phi (rad)",
00235                                                          bins.phi.nr,bins.phi.min,bins.phi.max,
00236                                                          &OffPho::phi,cut ? cut->clone():NULL));
00237   /* histVec.push_back(new MonElemWithCutEBEE<OffPho,int>(baseName+"_charge",
00238                                                        baseName+" Charge; charge",
00239                                                        bins.charge.nr,bins.charge.min,bins.charge.max,
00240                                                        &OffPho::charge,cut ? cut->clone():NULL)); */
00241 }
00242 
00243 //we transfer ownership of eleCut to addTrigLooseTrigHist which transfers it to the eleMonElems
00244 void MonElemFuncs::initTightLooseTrigHists(std::vector<MonElemContainer<OffEle>*>& eleMonElems,const std::vector<std::string>& tightLooseTrigs,const BinData& bins,EgHLTDQMCut<OffEle>* eleCut)
00245 {
00246   for(size_t trigNr=0;trigNr<tightLooseTrigs.size();trigNr++){
00247     std::vector<std::string> splitString;
00248     boost::split(splitString,tightLooseTrigs[trigNr],boost::is_any_of(std::string(":")));
00249     if(splitString.size()!=2) continue; //format incorrect
00250     const std::string& tightTrig = splitString[0];
00251     const std::string& looseTrig = splitString[1];
00252     //this step is necessary as we want to transfer ownership of eleCut to the addTrigLooseTrigHist func on the last iteration
00253     //but clone it before that
00254     //perhaps my object ownership rules need to be re-evalulated
00255     if(trigNr!=tightLooseTrigs.size()-2) addTightLooseTrigHist(eleMonElems,tightTrig,looseTrig,eleCut->clone(),"gsfEle",bins);
00256     else addTightLooseTrigHist(eleMonElems,tightTrig,looseTrig,eleCut,"gsfEle",bins);
00257   }
00258 } 
00259 
00260 
00261 void MonElemFuncs::initTightLooseTrigHists(std::vector<MonElemContainer<OffPho>*>& phoMonElems,const std::vector<std::string>& tightLooseTrigs,const BinData& bins,EgHLTDQMCut<OffPho>* phoCut)
00262 {
00263   for(size_t trigNr=0;trigNr<tightLooseTrigs.size();trigNr++){
00264     std::vector<std::string> splitString;
00265     boost::split(splitString,tightLooseTrigs[trigNr],boost::is_any_of(std::string(":")));
00266     if(splitString.size()!=2) continue; //format incorrect
00267     const std::string& tightTrig = splitString[0];
00268     const std::string& looseTrig = splitString[1];
00269 
00270     //this step is necessary as we want to transfer ownership of phoCut to the addTrigLooseTrigHist func on the last iteration
00271     //but clone it before that
00272     //perhaps my object ownership rules need to be re-evalulated
00273     if(trigNr!=tightLooseTrigs.size()-2) addTightLooseTrigHist(phoMonElems,tightTrig,looseTrig,phoCut->clone(),"pho",bins);
00274     else addTightLooseTrigHist(phoMonElems,tightTrig,looseTrig,phoCut,"pho",bins);
00275   }
00276 }
00277 
00278 
00279 
00280    
00281 //there is nothing electron specific here, will template at some point
00282 void MonElemFuncs::addTightLooseTrigHist(std::vector<MonElemContainer<OffEle>*>& eleMonElems,
00283                                          const std::string& tightTrig,const std::string& looseTrig,
00284                                          EgHLTDQMCut<OffEle>* eleCut,
00285                                          const std::string& histId,const BinData& bins)
00286 {
00287   MonElemContainer<OffEle>* passMonElem = NULL;
00288   passMonElem = new MonElemContainer<OffEle>(tightTrig+"_"+looseTrig+"_"+histId+"_passTrig","",
00289                                              &(*(new EgMultiCut<OffEle>) << 
00290                                                new EgObjTrigCut<OffEle>(TrigCodes::getCode(tightTrig+":"+looseTrig),EgObjTrigCut<OffEle>::AND)  <<
00291                                                eleCut->clone()));
00292   
00293   
00294   MonElemContainer<OffEle>* failMonElem = NULL;
00295   failMonElem = new MonElemContainer<OffEle>(tightTrig+"_"+looseTrig+"_"+histId+"_failTrig","",
00296                                              &(*(new EgMultiCut<OffEle>) << 
00297                                                new EgObjTrigCut<OffEle>(TrigCodes::getCode(looseTrig),EgObjTrigCut<OffEle>::AND,TrigCodes::getCode(tightTrig))  << 
00298                                                eleCut));
00299   
00300   MonElemFuncs::initStdEleHists(passMonElem->monElems(),tightTrig+"_"+looseTrig,passMonElem->name(),bins);
00301   MonElemFuncs::initStdEleHists(failMonElem->monElems(),tightTrig+"_"+looseTrig,failMonElem->name(),bins);
00302   eleMonElems.push_back(passMonElem);
00303   eleMonElems.push_back(failMonElem);
00304 }
00305 
00306  
00307 //there is nothing photon specific here, will template at some point
00308 void MonElemFuncs::addTightLooseTrigHist(std::vector<MonElemContainer<OffPho>*>& phoMonElems,
00309                                          const std::string& tightTrig,const std::string& looseTrig,
00310                                          EgHLTDQMCut<OffPho>* phoCut,
00311                                          const std::string& histId,const BinData& bins)
00312 {
00313   MonElemContainer<OffPho>* passMonElem = NULL;
00314   passMonElem = new MonElemContainer<OffPho>(tightTrig+"_"+looseTrig+"_"+histId+"_passTrig","",
00315                                              &(*(new EgMultiCut<OffPho>) << 
00316                                                new EgObjTrigCut<OffPho>(TrigCodes::getCode(tightTrig+":"+looseTrig),EgObjTrigCut<OffPho>::AND)  <<
00317                                                phoCut->clone()));
00318   
00319   
00320   MonElemContainer<OffPho>* failMonElem = NULL;
00321   failMonElem = new MonElemContainer<OffPho>(tightTrig+"_"+looseTrig+"_"+histId+"_failTrig","",
00322                                              &(*(new EgMultiCut<OffPho>) << 
00323                                                new EgObjTrigCut<OffPho>(TrigCodes::getCode(looseTrig),EgObjTrigCut<OffPho>::AND,TrigCodes::getCode(tightTrig))  << 
00324                                                phoCut));
00325   
00326   MonElemFuncs::initStdPhoHists(passMonElem->monElems(),tightTrig+"_"+looseTrig,passMonElem->name(),bins);
00327   MonElemFuncs::initStdPhoHists(failMonElem->monElems(),tightTrig+"_"+looseTrig,failMonElem->name(),bins);
00328   phoMonElems.push_back(passMonElem);
00329   phoMonElems.push_back(failMonElem);
00330 }
00331 
00332 
00333 
00334 //we transfer ownership of eleCut to the monitor elements
00335 void MonElemFuncs::initTightLooseTrigHistsTrigCuts(std::vector<MonElemContainer<OffEle>*>& eleMonElems,const std::vector<std::string>& tightLooseTrigs,const BinData& bins)
00336 {
00337   for(size_t trigNr=0;trigNr<tightLooseTrigs.size();trigNr++){
00338     std::vector<std::string> splitString;
00339     boost::split(splitString,tightLooseTrigs[trigNr],boost::is_any_of(std::string(":")));
00340     if(splitString.size()!=2) continue; //format incorrect
00341     const std::string& tightTrig = splitString[0];
00342     const std::string& looseTrig = splitString[1];
00343     EgHLTDQMCut<OffEle>* eleCut = new EgHLTDQMUserVarCut<OffEle,TrigCodes::TrigBitSet>(&OffEle::trigCutsCutCode,TrigCodes::getCode(tightTrig));
00344     addTightLooseTrigHist(eleMonElems,tightTrig,looseTrig,eleCut,"gsfEle_trigCuts",bins);
00345   }
00346 } 
00347 
00348 //we transfer ownership of phoCut to the monitor elements
00349 void MonElemFuncs::initTightLooseTrigHistsTrigCuts(std::vector<MonElemContainer<OffPho>*>& phoMonElems,const std::vector<std::string>& tightLooseTrigs,const BinData& bins)
00350 {
00351   for(size_t trigNr=0;trigNr<tightLooseTrigs.size();trigNr++){
00352     std::vector<std::string> splitString;
00353     boost::split(splitString,tightLooseTrigs[trigNr],boost::is_any_of(std::string(":")));
00354     if(splitString.size()!=2) continue; //format incorrect
00355     const std::string& tightTrig = splitString[0];
00356     const std::string& looseTrig = splitString[1];
00357     EgHLTDQMCut<OffPho>* phoCut = new EgHLTDQMUserVarCut<OffPho,TrigCodes::TrigBitSet>(&OffPho::trigCutsCutCode,TrigCodes::getCode(tightTrig));
00358     addTightLooseTrigHist(phoMonElems,tightTrig,looseTrig,phoCut,"pho_trigCuts",bins);
00359   }
00360 } 
00361 
00362 
00363 //we transfer ownership of eleCut to the monitor elements
00364 void MonElemFuncs::initTightLooseDiObjTrigHistsTrigCuts(std::vector<MonElemContainer<OffEle>*>& eleMonElems,const std::vector<std::string>& tightLooseTrigs,const BinData& bins)
00365 {
00366   for(size_t trigNr=0;trigNr<tightLooseTrigs.size();trigNr++){
00367     std::vector<std::string> splitString;
00368     boost::split(splitString,tightLooseTrigs[trigNr],boost::is_any_of(std::string(":")));
00369     if(splitString.size()!=2) continue; //format incorrect
00370     const std::string& tightTrig = splitString[0];
00371     const std::string& looseTrig = splitString[1];
00372     EgHLTDQMCut<OffEle>* eleCut = new EgDiEleUserCut<TrigCodes::TrigBitSet>(&OffEle::trigCutsCutCode,TrigCodes::getCode(tightTrig));
00373     addTightLooseTrigHist(eleMonElems,tightTrig,looseTrig,eleCut,"gsfEle_trigCuts",bins);
00374   }
00375 } 
00376 
00377 
00378 //we transfer ownership of phoCut to the monitor elements
00379 void MonElemFuncs::initTightLooseDiObjTrigHistsTrigCuts(std::vector<MonElemContainer<OffPho>*>& phoMonElems,const std::vector<std::string>& tightLooseTrigs,const BinData& bins)
00380 {
00381   for(size_t trigNr=0;trigNr<tightLooseTrigs.size();trigNr++){
00382     std::vector<std::string> splitString;
00383     boost::split(splitString,tightLooseTrigs[trigNr],boost::is_any_of(std::string(":")));
00384     if(splitString.size()!=2) continue; //format incorrect
00385     const std::string& tightTrig = splitString[0];
00386     const std::string& looseTrig = splitString[1];
00387     EgHLTDQMCut<OffPho>* phoCut = new EgDiPhoUserCut<TrigCodes::TrigBitSet>(&OffPho::trigCutsCutCode,TrigCodes::getCode(tightTrig));
00388     addTightLooseTrigHist(phoMonElems,tightTrig,looseTrig,phoCut,"pho_trigCuts",bins);
00389   }
00390 }
00391 
00392 
00393 
00394 //tag and probe trigger efficiencies
00395 //this is to measure the trigger efficiency with respect to a fully selected offline electron
00396 //using a tag and probe technique (note: this will be different to the trigger efficiency normally calculated) 
00397 void MonElemFuncs::initTrigTagProbeHists(std::vector<MonElemContainer<OffEle>*>& eleMonElems,const std::vector<std::string> filterNames,int cutMask,const BinData& bins)
00398 {
00399   for(size_t filterNr=0;filterNr<filterNames.size();filterNr++){ 
00400     
00401     std::string trigName(filterNames[filterNr]);
00402     //  float etCutValue = trigTools::getSecondEtThresFromName(trigName);
00403     float etCutValue = 0.;
00404     //std::cout<<"TrigName= "<<trigName<<"   etCutValue= "<<etCutValue<<std::endl;
00405     MonElemContainer<OffEle>* monElemCont = new MonElemContainer<OffEle>("trigTagProbe","Trigger Tag and Probe",new EgTrigTagProbeCut_New(TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFiltesr"),cutMask,&OffEle::cutCode));
00406     //this is all that pass trigtagprobecut
00407     MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_gsfEle_all",bins,new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC));
00408     //this is all that pass trigtagprobecut and the probe passes the test trigger
00409     MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_gsfEle_pass",bins,&(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC) << new EgObjTrigCut<OffEle>(TrigCodes::getCode(trigName),EgObjTrigCut<OffEle>::AND)));
00410     //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is NOT a tag
00411     MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_gsfEle_passNotTag",bins,&(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC) << new EgObjTrigCut<OffEle>(TrigCodes::getCode(trigName),EgObjTrigCut<OffEle>::AND,TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),EgObjTrigCut<OffEle>::AND)));
00412     //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is also a tag
00413     MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_gsfEle_passTagTag",bins,&(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC) << new EgObjTrigCut<OffEle>(TrigCodes::getCode(trigName),EgObjTrigCut<OffEle>::AND) <<  new EgObjTrigCut<OffEle>(TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),EgObjTrigCut<OffEle>::AND) ));
00414     //this is all that pass trigtagprobecut and the probe fails the test trigger
00415     MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_gsfEle_fail",bins,&(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC) << new EgObjTrigCut<OffEle>(TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),EgObjTrigCut<OffEle>::AND,TrigCodes::getCode(trigName),EgObjTrigCut<OffEle>::AND)));
00416     /*
00417     monElemCont->monElems().push_back(new MonElemMgrEBEE<OffEle,float>(trigName+"_"+monElemCont->name()+"_gsfEle_all_etUnCut",monElemCont->name()+"_gsfEle_all E_{T} (Uncut);E_{T} (GeV)",
00418                                                                        bins.et.nr,bins.et.min,bins.et.max,&OffEle::et));
00419     monElemCont->cutMonElems().push_back(new MonElemWithCutEBEE<OffEle,float>(trigName+"_"+monElemCont->name()+"_gsfEle_pass_etUnCut",monElemCont->name()+"_gsfEle_pass E_{T} (Uncut);E_{T} (GeV)",
00420     bins.et.nr,bins.et.min,bins.et.max,&OffEle::et,new EgObjTrigCut<OffEle>(TrigCodes::getCode(trigName),EgObjTrigCut<OffEle>::AND)));*/
00421     eleMonElems.push_back(monElemCont);
00422   } //end filter names loop
00423    
00424 }
00425 
00426 //Only one at a time so I can set the folder
00427 void MonElemFuncs::initTrigTagProbeHist(std::vector<MonElemContainer<OffEle>*>& eleMonElems,const std::string filterName,int cutMask,const BinData& bins)
00428 {   
00429   std::string trigName(filterName);
00430   //float etCutValue = 1.1*trigTools::getSecondEtThresFromName(filterName);
00431   float etCutValue = 0.;
00432   //std::cout<<"TrigName= "<<trigName<<"   etCutValue= "<<etCutValue<<std::endl;
00433   MonElemContainer<OffEle>* monElemCont = new MonElemContainer<OffEle>("trigTagProbe","Trigger Tag and Probe",new EgTrigTagProbeCut_New(TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),cutMask,&OffEle::cutCode));
00434   //this is all that pass trigtagprobecut
00435   MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_gsfEle_all",bins,new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC));
00436   //this is all that pass trigtagprobecut and the probe passes the test trigger
00437   MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_gsfEle_pass",bins,&(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC) << new EgObjTrigCut<OffEle>(TrigCodes::getCode(trigName),EgObjTrigCut<OffEle>::AND)));
00438   //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is NOT a tag
00439   MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_gsfEle_passNotTag",bins,&(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC) << new EgObjTrigCut<OffEle>(TrigCodes::getCode(trigName),EgObjTrigCut<OffEle>::AND,TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),EgObjTrigCut<OffEle>::AND)));
00440   //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is also a tag
00441   MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_gsfEle_passTagTag",bins,&(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC) << new EgObjTrigCut<OffEle>(TrigCodes::getCode(trigName),EgObjTrigCut<OffEle>::AND) <<  new EgObjTrigCut<OffEle>(TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),EgObjTrigCut<OffEle>::AND) ));
00442   //this is all that pass trigtagprobecut and the probe fails the test trigger
00443   MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_gsfEle_fail",bins,&(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC) << new EgObjTrigCut<OffEle>(TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),EgObjTrigCut<OffEle>::AND,TrigCodes::getCode(trigName),EgObjTrigCut<OffEle>::AND)));
00444   /*
00445     monElemCont->monElems().push_back(new MonElemMgrEBEE<OffEle,float>(trigName+"_"+monElemCont->name()+"_gsfEle_all_etUnCut",monElemCont->name()+"_gsfEle_all E_{T} (Uncut);E_{T} (GeV)",
00446     bins.et.nr,bins.et.min,bins.et.max,&OffEle::et));
00447     monElemCont->cutMonElems().push_back(new MonElemWithCutEBEE<OffEle,float>(trigName+"_"+monElemCont->name()+"_gsfEle_pass_etUnCut",monElemCont->name()+"_gsfEle_pass E_{T} (Uncut);E_{T} (GeV)",
00448     bins.et.nr,bins.et.min,bins.et.max,&OffEle::et,new EgObjTrigCut<OffEle>(TrigCodes::getCode(trigName),EgObjTrigCut<OffEle>::AND)));*/
00449   eleMonElems.push_back(monElemCont);
00450 }
00451 
00452 
00453 void MonElemFuncs::initTrigTagProbeHist_2Leg(std::vector<MonElemContainer<OffEle>*>& eleMonElems,const std::string filterName,int cutMask,const BinData& bins)
00454 {  
00455  
00456   std::string trigNameLeg1 = filterName.substr(0,filterName.find("::")); 
00457   std::string trigNameLeg2 = filterName.substr(filterName.find("::")+2);
00458 
00459   float etCutValue = 0.;
00460   MonElemContainer<OffEle>* monElemCont = new MonElemContainer<OffEle>("trigTagProbe","Trigger Tag and Probe",new EgTrigTagProbeCut_New(TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),cutMask,&OffEle::cutCode));
00461   //this is all that pass trigtagprobecut
00462   //MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigNameLeg2,trigNameLeg2+"_"+monElemCont->name()+"_gsfEle_allEt20",bins,new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC));
00463   //this is all that pass trigtagprobecut and the probe passes the first trigger
00464   //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)));
00465   //this is all that pass trigtagprobecut and the probe passes the second trigger and fails the first trigger
00466   MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigNameLeg2,trigNameLeg2+"_"+monElemCont->name()+"_gsfEle_passLeg2failLeg1",bins,&(*(new EgMultiCut<OffEle>) << new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC) << new EgObjTrigCut<OffEle>(TrigCodes::getCode(trigNameLeg2),EgObjTrigCut<OffEle>::AND,TrigCodes::getCode(trigNameLeg1),EgObjTrigCut<OffEle>::AND)));
00467 
00468 }
00469 
00470 
00471 //Now same for photons
00472 void MonElemFuncs::initTrigTagProbeHists(std::vector<MonElemContainer<OffPho>*>& phoMonElems,const std::vector<std::string> filterNames,int cutMask,const BinData& bins)
00473 {
00474   for(size_t filterNr=0;filterNr<filterNames.size();filterNr++){ 
00475     
00476     std::string trigName(filterNames[filterNr]);
00477     //float etCutValue = trigTools::getSecondEtThresFromName(trigName);
00478     float etCutValue = 0.;
00479     //std::cout<<"TrigName= "<<trigName<<"   etCutValue= "<<etCutValue<<std::endl;
00480     MonElemContainer<OffPho>* monElemCont = new MonElemContainer<OffPho>("trigTagProbe","Trigger Tag and Probe",new EgTrigTagProbeCut_NewPho(TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),cutMask,&OffPho::cutCode));
00481     //this is all that pass trigtagprobecut
00482     MonElemFuncs::initStdPhoCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_pho_all",bins,new EgGreaterCut<OffPho,float>(etCutValue,&OffPho::etSC));
00483     //this is all that pass trigtagprobecut and the probe passes the test trigger
00484     MonElemFuncs::initStdPhoCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_pho_pass",bins,&(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho,float>(etCutValue,&OffPho::etSC) << new EgObjTrigCut<OffPho>(TrigCodes::getCode(trigName),EgObjTrigCut<OffPho>::AND)));
00485     //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is NOT a tag
00486     MonElemFuncs::initStdPhoCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_pho_passNotTag",bins,&(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho,float>(etCutValue,&OffPho::etSC) << new EgObjTrigCut<OffPho>(TrigCodes::getCode(trigName),EgObjTrigCut<OffPho>::AND,TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),EgObjTrigCut<OffPho>::AND)));
00487     //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is also a tag
00488     MonElemFuncs::initStdPhoCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_pho_passTagTag",bins,&(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho,float>(etCutValue,&OffPho::etSC) << new EgObjTrigCut<OffPho>(TrigCodes::getCode(trigName),EgObjTrigCut<OffPho>::AND) <<  new EgObjTrigCut<OffPho>(TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),EgObjTrigCut<OffPho>::AND) ));
00489     //this is all that pass trigtagprobecut and the probe fails the test trigger
00490     MonElemFuncs::initStdPhoCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_pho_fail",bins,&(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho,float>(etCutValue,&OffPho::etSC) << new EgObjTrigCut<OffPho>(TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),EgObjTrigCut<OffPho>::AND,TrigCodes::getCode(trigName),EgObjTrigCut<OffPho>::AND)));
00491     /*
00492     monElemCont->monElems().push_back(new MonElemMgrEBEE<OffPho,float>(trigName+"_"+monElemCont->name()+"_pho_all_etUnCut",monElemCont->name()+"_gsfEle_all E_{T} (Uncut);E_{T} (GeV)",
00493                                                                        bins.et.nr,bins.et.min,bins.et.max,&OffPho::et));
00494     monElemCont->cutMonElems().push_back(new MonElemWithCutEBEE<OffPho,float>(trigName+"_"+monElemCont->name()+"_pho_pass_etUnCut",monElemCont->name()+"_gsfEle_pass E_{T} (Uncut);E_{T} (GeV)",
00495     bins.et.nr,bins.et.min,bins.et.max,&OffPho::et,new EgObjTrigCut<OffPho>(TrigCodes::getCode(trigName),EgObjTrigCut<OffPho>::AND)));*/
00496     phoMonElems.push_back(monElemCont);
00497   } //end filter names loop
00498    
00499 }
00500 
00501 void MonElemFuncs::initTrigTagProbeHist(std::vector<MonElemContainer<OffPho>*>& phoMonElems,const std::string filterName,int cutMask,const BinData& bins)
00502 {
00503     std::string trigName(filterName);
00504     //float etCutValue = 1.1*trigTools::getSecondEtThresFromName(trigName);
00505     float etCutValue = 0.;
00506     //std::cout<<"TrigName= "<<trigName<<"   etCutValue= "<<etCutValue<<std::endl;
00507     MonElemContainer<OffPho>* monElemCont = new MonElemContainer<OffPho>("trigTagProbe","Trigger Tag and Probe",new EgTrigTagProbeCut_NewPho(TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),cutMask,&OffPho::cutCode));
00508     //this is all that pass trigtagprobecut
00509     MonElemFuncs::initStdPhoCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_pho_all",bins,new EgGreaterCut<OffPho,float>(etCutValue,&OffPho::etSC));
00510     //this is all that pass trigtagprobecut and the probe passes the test trigger
00511     MonElemFuncs::initStdPhoCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_pho_pass",bins,&(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho,float>(etCutValue,&OffPho::etSC) << new EgObjTrigCut<OffPho>(TrigCodes::getCode(trigName),EgObjTrigCut<OffPho>::AND)));
00512     //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is NOT a tag
00513     MonElemFuncs::initStdPhoCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_pho_passNotTag",bins,&(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho,float>(etCutValue,&OffPho::etSC) << new EgObjTrigCut<OffPho>(TrigCodes::getCode(trigName),EgObjTrigCut<OffPho>::AND,TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),EgObjTrigCut<OffPho>::AND)));
00514     //this is all that pass trigtagprobecut and the probe passes the test trigger and the probe is also a tag
00515     MonElemFuncs::initStdPhoCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_pho_passTagTag",bins,&(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho,float>(etCutValue,&OffPho::etSC) << new EgObjTrigCut<OffPho>(TrigCodes::getCode(trigName),EgObjTrigCut<OffPho>::AND) <<  new EgObjTrigCut<OffPho>(TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsolFilter"),EgObjTrigCut<OffPho>::AND) ));
00516     //this is all that pass trigtagprobecut and the probe fails the test trigger
00517     MonElemFuncs::initStdPhoCutHists(monElemCont->cutMonElems(),trigName,trigName+"_"+monElemCont->name()+"_pho_fail",bins,&(*(new EgMultiCut<OffPho>) << new EgGreaterCut<OffPho,float>(etCutValue,&OffPho::etSC) << new EgObjTrigCut<OffPho>(TrigCodes::getCode("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17HEDoubleFilter"),EgObjTrigCut<OffPho>::AND,TrigCodes::getCode(trigName),EgObjTrigCut<OffPho>::AND)));
00518     /*
00519     monElemCont->monElems().push_back(new MonElemMgrEBEE<OffPho,float>(trigName+"_"+monElemCont->name()+"_pho_all_etUnCut",monElemCont->name()+"_gsfEle_all E_{T} (Uncut);E_{T} (GeV)",
00520                                                                        bins.et.nr,bins.et.min,bins.et.max,&OffPho::et));
00521     monElemCont->cutMonElems().push_back(new MonElemWithCutEBEE<OffPho,float>(trigName+"_"+monElemCont->name()+"_pho_pass_etUnCut",monElemCont->name()+"_gsfEle_pass E_{T} (Uncut);E_{T} (GeV)",
00522     bins.et.nr,bins.et.min,bins.et.max,&OffPho::et,new EgObjTrigCut<OffPho>(TrigCodes::getCode(trigName),EgObjTrigCut<OffPho>::AND)));*/
00523     phoMonElems.push_back(monElemCont);
00524 }
00525 
00526 
00527 
00528