CMS 3D CMS Logo

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