CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EgHLTMonElemFuncs.cc
Go to the documentation of this file.
2 
7 
8 
9 using namespace egHLT;
10 
11 void MonElemFuncs::initStdEleHists(std::vector<MonElemManagerBase<OffEle>*>& histVec,const std::string& baseName,const BinData& bins)
12 {
13  addStdHist<OffEle,float>(histVec,baseName+"_et",baseName+" E_{T};E_{T} (GeV)",bins.et,&OffEle::et);
14  addStdHist<OffEle,float>(histVec,baseName+"_etHigh",baseName+" E_{T};E_{T} (GeV)",bins.etHigh,&OffEle::et);
15  addStdHist<OffEle,float>(histVec,baseName+"_etSC",baseName+" E^{SC}_{T};E^{SC}_{T} (GeV)",bins.et,&OffEle::etSC);
16  addStdHist<OffEle,float>(histVec,baseName+"_eta",baseName+" #eta;#eta",bins.eta,&OffEle::detEta);
17  addStdHist<OffEle,float>(histVec,baseName+"_phi",baseName+" #phi;#phi (rad)",bins.phi,&OffEle::phi);
18  addStdHist<OffEle,int>(histVec,baseName+"_charge",baseName+" Charge; charge",bins.charge,&OffEle::charge);
19 
20  addStdHist<OffEle,float>(histVec,baseName+"_hOverE",baseName+" H/E; H/E",bins.hOverE,&OffEle::hOverE);
21  addStdHist<OffEle,float>(histVec,baseName+"_dPhiIn",baseName+" #Delta #phi_{in}; #Delta #phi_{in}",bins.dPhiIn,&OffEle::dPhiIn);
22  addStdHist<OffEle,float>(histVec,baseName+"_dEtaIn",baseName+" #Delta #eta_{in}; #Delta #eta_{in}",bins.dEtaIn,&OffEle::dEtaIn);
23  addStdHist<OffEle,float>(histVec,baseName+"_sigmaIEtaIEta",baseName+"#sigma_{i#etai#eta}; #sigma_{i#etai#eta}",bins.sigEtaEta,&OffEle::sigmaIEtaIEta);
24  addStdHist<OffEle,float>(histVec,baseName+"_epIn",baseName+"E/p_{in}; E/p_{in}",bins.eOverP,&OffEle::epIn);
25  addStdHist<OffEle,float>(histVec,baseName+"_epOut",baseName+"E/p_{out}; E/p_{out}",bins.eOverP,&OffEle::epIn);
26  addStdHist<OffEle,float>(histVec,baseName+"_invEInvP",baseName+"1/E -1/p; 1/E - 1/p",bins.invEInvP,&OffEle::invEInvP);
27 
28  addStdHist<OffEle,float>(histVec,baseName+"_e2x5Over5x5",baseName+"E^{2x5}/E^{5x5}; E^{2x5}/E^{5x5}",bins.e2x5,&OffEle::e2x5MaxOver5x5);
29  addStdHist<OffEle,float>(histVec,baseName+"_e1x5Over5x5",baseName+"E^{1x5}/E^{5x5}; E^{1x5}/E^{5x5}",bins.e1x5,&OffEle::e1x5Over5x5);
30  addStdHist<OffEle,float>(histVec,baseName+"_isolEM",baseName+"Isol EM; Isol EM (GeV)",bins.isolEm,&OffEle::isolEm);
31  addStdHist<OffEle,float>(histVec,baseName+"_isolHad",baseName+"Isol Had; Isol Had (GeV)",bins.isolHad,&OffEle::isolHad);
32  addStdHist<OffEle,float>(histVec,baseName+"_isolPtTrks",baseName+"Isol Pt Trks; Isol Pt Tracks (GeV/c)",bins.isolPtTrks,&OffEle::isolPtTrks);
33  addStdHist<OffEle,float>(histVec,baseName+"_hltIsolTrksEle",baseName+"HLT Ele Isol Trks; HLT Ele Iso Tracks (GeV/c)",bins.isolPtTrks,&OffEle::hltIsolTrksEle);
34  addStdHist<OffEle,float>(histVec,baseName+"_hltIsolTrksPho",baseName+"HLT Pho Isol Trks; HLT Pho Iso Tracks (GeV/c)",bins.isolPtTrks,&OffEle::hltIsolTrksPho);
35  addStdHist<OffEle,float>(histVec,baseName+"_hltIsolHad",baseName+"HLT Isol Had; HLT Isol Had (GeV)",bins.isolHad,&OffEle::hltIsolHad);
36 
37  histVec.push_back(new MonElemManager2D<OffEle,float,float>(baseName+"_etaVsPhi",
38  baseName+" #eta vs #phi;#eta;#phi (rad)",
39  bins.etaVsPhi.nrX,bins.etaVsPhi.xMin,bins.etaVsPhi.xMax,
40  bins.etaVsPhi.nrY,bins.etaVsPhi.yMin,bins.etaVsPhi.yMax,
42 
43 }
44 
45 void MonElemFuncs::initStdPhoHists(std::vector<MonElemManagerBase<OffPho>*>& histVec,const std::string& baseName,const BinData& bins)
46 {
47  addStdHist<OffPho,float>(histVec,baseName+"_et",baseName+" E_{T};E_{T} (GeV)",bins.et,&OffPho::et);
48  addStdHist<OffPho,float>(histVec,baseName+"_etHigh",baseName+" E_{T};E_{T} (GeV)",bins.etHigh,&OffPho::et);
49  addStdHist<OffPho,float>(histVec,baseName+"_etSC",baseName+" E^{SC}_{T};E^{SC}_{T} (GeV)",bins.et,&OffPho::etSC);
50  addStdHist<OffPho,float>(histVec,baseName+"_eta",baseName+" #eta;#eta",bins.eta,&OffPho::detEta);
51  addStdHist<OffPho,float>(histVec,baseName+"_phi",baseName+" #phi;#phi (rad)",bins.phi,&OffPho::phi);
52 
53  addStdHist<OffPho,float>(histVec,baseName+"_hOverE",baseName+" H/E; H/E",bins.hOverE,&OffPho::hOverE);
54  addStdHist<OffPho,float>(histVec,baseName+"_r9",baseName+" R9 ; R9",bins.r9,&OffPho::r9);
55  addStdHist<OffPho,float>(histVec,baseName+"_sigmaIEtaIEta",baseName+"#sigma_{i#etai#eta}; #sigma_{i#etai#eta}",bins.sigEtaEta,&OffPho::sigmaIEtaIEta);
56  addStdHist<OffPho,float>(histVec,baseName+"_e2x5Over5x5",baseName+"E^{2x5}/E^{5x5}; E^{2x5}/E^{5x5}",bins.e2x5,&OffPho::e2x5MaxOver5x5);
57  addStdHist<OffPho,float>(histVec,baseName+"_e1x5Over5x5",baseName+"E^{1x5}/E^{5x5}; E^{1x5}/E^{5x5}",bins.e1x5,&OffPho::e1x5Over5x5);
58  addStdHist<OffPho,float>(histVec,baseName+"_isolEM",baseName+"Isol EM; Isol EM (GeV)",bins.isolEm,&OffPho::isolEm);
59  addStdHist<OffPho,float>(histVec,baseName+"_isolHad",baseName+"Isol Had; Isol Had (GeV)",bins.isolHad,&OffPho::isolHad);
60  addStdHist<OffPho,float>(histVec,baseName+"_isolPtTrks",baseName+"Isol Pt Trks; Isol Pt Tracks (GeV/c)",bins.isolPtTrks,&OffPho::isolPtTrks);
61  addStdHist<OffPho,int>(histVec,baseName+"_isolNrTrks",baseName+"Isol Nr Trks; Isol Nr Tracks",bins.isolNrTrks,&OffPho::isolNrTrks);
62  addStdHist<OffPho,float>(histVec,baseName+"_hltIsolTrks",baseName+"HLT Isol Trks; HLT Iso Tracks (GeV/c)",bins.isolPtTrks,&OffPho::hltIsolTrks);
63  addStdHist<OffPho,float>(histVec,baseName+"_hltIsolHad",baseName+"HLT Isol Had; HLT Isol Had (GeV)",bins.isolPtTrks,&OffPho::hltIsolHad);
64 
65  histVec.push_back(new MonElemManager2D<OffPho,float,float>(baseName+"_etaVsPhi",
66  baseName+" #eta vs #phi;#eta;#phi (rad)",
67  bins.etaVsPhi.nrX,bins.etaVsPhi.xMin,bins.etaVsPhi.xMax,
68  bins.etaVsPhi.nrY,bins.etaVsPhi.yMin,bins.etaVsPhi.yMax,
70 }
71 
72 void MonElemFuncs::initStdEffHists(std::vector<MonElemWithCutBase<OffEle>*>& histVec,const std::string& baseName,const BinData::Data1D& bins,float (OffEle::*vsVarFunc)()const,const CutMasks& masks)
73 {
74  initStdEffHists(histVec,baseName,bins.nr,bins.min,bins.max,vsVarFunc,masks);
75 }
76 
77 void MonElemFuncs::initStdEffHists(std::vector<MonElemWithCutBase<OffPho>*>& histVec,const std::string& baseName,const BinData::Data1D& bins,float (OffPho::*vsVarFunc)()const,const CutMasks& masks)
78 {
79  initStdEffHists(histVec,baseName,bins.nr,bins.min,bins.max,vsVarFunc,masks);
80 }
81 
82 void MonElemFuncs::initStdEffHists(std::vector<MonElemWithCutBase<OffEle>*>& histVec,const std::string& baseName,int nrBins,double xMin,double xMax,float (OffEle::*vsVarFunc)()const,const CutMasks& masks)
83 {
84  //some convience typedefs, I hate typedefs but atleast here where they are defined is obvious
85  typedef EgHLTDQMVarCut<OffEle> VarCut;
86  typedef MonElemWithCutEBEE<OffEle,float> MonElemFloat;
87  int stdCutCode = masks.stdEle;
88 
89  //first do the zero and all cuts histograms
90  histVec.push_back(new MonElemFloat(baseName+"_noCuts",baseName+" NoCuts",nrBins,xMin,xMax,vsVarFunc));
91  histVec.push_back(new MonElemFloat(baseName+"_allCuts",baseName+" All Cuts",nrBins,xMin,xMax,vsVarFunc,
92  new VarCut(stdCutCode,&OffEle::cutCode)));
93 
94  //now for the n-1
95  histVec.push_back(new MonElemFloat(baseName+"_n1_dEtaIn",baseName+" N1 #Delta#eta_{in}",nrBins,xMin,xMax,vsVarFunc,
96  new VarCut(~EgCutCodes::DETAIN&stdCutCode,&OffEle::cutCode)));
97  histVec.push_back(new MonElemFloat(baseName+"_n1_dPhiIn",baseName+" N1 #Delta#phi_{in}",nrBins,xMin,xMax,vsVarFunc,
98  new VarCut(~EgCutCodes::DPHIIN&stdCutCode,&OffEle::cutCode)));
99  histVec.push_back(new MonElemFloat(baseName+"_n1_sigmaIEtaIEta",baseName+" N1 #sigma_{#ieta#ieta}",nrBins,xMin,xMax,vsVarFunc,
100  new VarCut(~EgCutCodes::SIGMAIETAIETA&stdCutCode,&OffEle::cutCode)));
101  histVec.push_back(new MonElemFloat(baseName+"_n1_hOverE",baseName+" N1 H/E",nrBins,xMin,xMax,vsVarFunc,
102  new VarCut(~EgCutCodes::HADEM &stdCutCode,&OffEle::cutCode)));
103 
104  histVec.push_back(new MonElemFloat(baseName+"_n1_isolEm",baseName+" N1 Isol Em",nrBins,xMin,xMax,vsVarFunc,
105  new VarCut(~EgCutCodes::ISOLEM&stdCutCode,&OffEle::cutCode)));
106  histVec.push_back(new MonElemFloat(baseName+"_n1_isolHad",baseName+" N1 Isol Had",nrBins,xMin,xMax,vsVarFunc,
107  new VarCut(~EgCutCodes::ISOLHAD&stdCutCode,&OffEle::cutCode)));
108  histVec.push_back(new MonElemFloat(baseName+"_n1_isolPtTrks",baseName+" N1 Isol Tracks",nrBins,xMin,xMax,vsVarFunc,
109  new VarCut(~EgCutCodes::ISOLPTTRKS&stdCutCode,&OffEle::cutCode)));
110  histVec.push_back(new MonElemFloat(baseName+"_n1_hltIsolHad",baseName+" N1 HLT Isol Had",nrBins,xMin,xMax,vsVarFunc,
111  new VarCut(~EgCutCodes::HLTISOLHAD&stdCutCode,&OffEle::cutCode)));
112  histVec.push_back(new MonElemFloat(baseName+"_n1_hltIsolTrksEle",baseName+" N1 HLT Isol Tracks Ele ",nrBins,xMin,xMax,vsVarFunc,
113  new VarCut(~EgCutCodes::HLTISOLTRKSELE&stdCutCode,&OffEle::cutCode)));
114 
115 
116  histVec.push_back(new MonElemFloat(baseName+"_single_dEtaIn",baseName+" Single #Delta#eta_{in}",nrBins,xMin,xMax,vsVarFunc,
117  new VarCut(EgCutCodes::DETAIN,&OffEle::cutCode)));
118  histVec.push_back(new MonElemFloat(baseName+"_single_dPhiIn",baseName+" Single #Delta#phi_{in}",nrBins,xMin,xMax,vsVarFunc,
119  new VarCut(EgCutCodes::DPHIIN,&OffEle::cutCode)));
120  histVec.push_back(new MonElemFloat(baseName+"_single_sigmaIEtaIEta",baseName+" Single #sigma_{#ieta#ieta}",nrBins,xMin,xMax,vsVarFunc,
122  histVec.push_back(new MonElemFloat(baseName+"_single_hOverE",baseName+" Single H/E",nrBins,xMin,xMax,vsVarFunc,
123  new VarCut(EgCutCodes::HADEM,&OffEle::cutCode)));
124 
125 
126  histVec.push_back(new MonElemFloat(baseName+"_single_isolEm",baseName+" Single Isol Em",nrBins,xMin,xMax,vsVarFunc,
127  new VarCut(EgCutCodes::ISOLEM,&OffEle::cutCode)));
128  histVec.push_back(new MonElemFloat(baseName+"_single_isolHad",baseName+" Single Isol Had",nrBins,xMin,xMax,vsVarFunc,
129  new VarCut(EgCutCodes::ISOLHAD,&OffEle::cutCode)));
130  histVec.push_back(new MonElemFloat(baseName+"_single_isolPtTrks",baseName+" Single Isol Tracks",nrBins,xMin,xMax,vsVarFunc,
132 
133  histVec.push_back(new MonElemFloat(baseName+"_single_hltIsolHad",baseName+" Single HLT Isol Had",nrBins,xMin,xMax,vsVarFunc,
135  histVec.push_back(new MonElemFloat(baseName+"_single_hltIsolTrksEle",baseName+" Single HLT Isol Tracks Ele ",nrBins,xMin,xMax,vsVarFunc,
137  histVec.push_back(new MonElemFloat(baseName+"_single_hltIsolTrksPho",baseName+" Single HLT Isol Tracks Pho ",nrBins,xMin,xMax,vsVarFunc,
139 
140 }
141 
142 void MonElemFuncs::initStdEffHists(std::vector<MonElemWithCutBase<OffPho>*>& histVec,const std::string& baseName,int nrBins,double xMin,double xMax,float (OffPho::*vsVarFunc)()const,const CutMasks& masks)
143 {
144  //some convience typedefs, I hate typedefs but atleast here where they are defined is obvious
145  typedef EgHLTDQMVarCut<OffPho> VarCut;
146  typedef MonElemWithCutEBEE<OffPho,float> MonElemFloat;
147  int stdCutCode = masks.stdPho;
148 
149  histVec.push_back(new MonElemFloat(baseName+"_noCuts",baseName+" NoCuts",nrBins,xMin,xMax,vsVarFunc));
150  histVec.push_back(new MonElemFloat(baseName+"_allCuts",baseName+" All Cuts",nrBins,xMin,xMax,vsVarFunc,
151  new VarCut(stdCutCode,&OffPho::cutCode)));
152 
153 
154  histVec.push_back(new MonElemFloat(baseName+"_n1_sigmaIEtaIEta",baseName+" N1 #sigma_{#ieta#ieta}",nrBins,xMin,xMax,vsVarFunc,
155  new VarCut(~EgCutCodes::SIGMAIETAIETA&stdCutCode,&OffPho::cutCode)));
156  histVec.push_back(new MonElemFloat(baseName+"_n1_hOverE",baseName+" N1 H/E",nrBins,xMin,xMax,vsVarFunc,
157  new VarCut(~EgCutCodes::R9&stdCutCode,&OffPho::cutCode)));
158  histVec.push_back(new MonElemFloat(baseName+"_n1_r9",baseName+" N1 R9",nrBins,xMin,xMax,vsVarFunc,
159  new VarCut(~EgCutCodes::HADEM &stdCutCode,&OffPho::cutCode)));
160  histVec.push_back(new MonElemFloat(baseName+"_n1_isolEm",baseName+" N1 Isol Em",nrBins,xMin,xMax,vsVarFunc,
161  new VarCut(~EgCutCodes::ISOLEM&stdCutCode,&OffPho::cutCode)));
162  histVec.push_back(new MonElemFloat(baseName+"_n1_isolHad",baseName+" N1 Isol Had",nrBins,xMin,xMax,vsVarFunc,
163  new VarCut(~EgCutCodes::ISOLHAD&stdCutCode,&OffPho::cutCode)));
164  histVec.push_back(new MonElemFloat(baseName+"_n1_isolPtTrks",baseName+" N1 Pt Isol Tracks",nrBins,xMin,xMax,vsVarFunc,
165  new VarCut(~EgCutCodes::ISOLPTTRKS&stdCutCode,&OffPho::cutCode)));
166  histVec.push_back(new MonElemFloat(baseName+"_n1_isolNrTrks",baseName+" N1 Nr Isol Tracks",nrBins,xMin,xMax,vsVarFunc,
167  new VarCut(~EgCutCodes::ISOLNRTRKS&stdCutCode,&OffPho::cutCode)));
168 
169  histVec.push_back(new MonElemFloat(baseName+"_single_sigmaIEtaIEta",baseName+" Single #sigma_{#ieta#ieta}",nrBins,xMin,xMax,vsVarFunc,
171  histVec.push_back(new MonElemFloat(baseName+"_single_hltIsolHad",baseName+" N1 HLT Isol Had",nrBins,xMin,xMax,vsVarFunc,
173  histVec.push_back(new MonElemFloat(baseName+"_single_hltIsolTrksPho",baseName+" N1 HLT Isol Tracks Pho ",nrBins,xMin,xMax,vsVarFunc,
175 
176 
177 }
178 
179 
180 //we own the passed in cut, so we give it to the first mon element and then clone it after that
181 //only currently used for trigger tag and probe
182 void MonElemFuncs::initStdEleCutHists(std::vector<MonElemWithCutBase<OffEle>*>& histVec,const std::string& baseName,const BinData& bins,EgHLTDQMCut<OffEle>* cut)
183 {
184  histVec.push_back(new MonElemWithCutEBEE<OffEle,float>(baseName+"_et",
185  baseName+" E_{T};E_{T} (GeV)",
186  bins.et.nr,bins.et.min,bins.et.max,&OffEle::et,cut));
187  histVec.push_back(new MonElemWithCutEBEE<OffEle,float>(baseName+"_eta",
188  baseName+" #eta;#eta",
189  bins.eta.nr,bins.eta.min,bins.eta.max,
190  &OffEle::detEta,cut ? cut->clone(): NULL));
191  histVec.push_back(new MonElemWithCutEBEE<OffEle,float>(baseName+"_phi",
192  baseName+" #phi;#phi (rad)",
193  bins.phi.nr,bins.phi.min,bins.phi.max,
194  &OffEle::phi,cut ? cut->clone():NULL));
195  histVec.push_back(new MonElemWithCutEBEE<OffEle,int>(baseName+"_charge",
196  baseName+" Charge; charge",
197  bins.charge.nr,bins.charge.min,bins.charge.max,
198  &OffEle::charge,cut ? cut->clone():NULL));
199 }
200 
201 
202 
203 //we transfer ownership of eleCut to addTrigLooseTrigHist which transfers it to the eleMonElems
204 void MonElemFuncs::initTightLooseTrigHists(std::vector<MonElemContainer<OffEle>*>& eleMonElems,const std::vector<std::string>& tightLooseTrigs,const BinData& bins,EgHLTDQMCut<OffEle>* eleCut)
205 {
206  for(size_t trigNr=0;trigNr<tightLooseTrigs.size();trigNr++){
207  std::vector<std::string> splitString;
208  boost::split(splitString,tightLooseTrigs[trigNr],boost::is_any_of(std::string(":")));
209  if(splitString.size()!=2) continue; //format incorrect
210  const std::string& tightTrig = splitString[0];
211  const std::string& looseTrig = splitString[1];
212  //this step is necessary as we want to transfer ownership of eleCut to the addTrigLooseTrigHist func on the last iteration
213  //but clone it before that
214  //perhaps my object ownership rules need to be re-evalulated
215  if(trigNr!=tightLooseTrigs.size()-2) addTightLooseTrigHist(eleMonElems,tightTrig,looseTrig,eleCut->clone(),"gsfEle",bins);
216  else addTightLooseTrigHist(eleMonElems,tightTrig,looseTrig,eleCut,"gsfEle",bins);
217  }
218 }
219 
220 
221 void MonElemFuncs::initTightLooseTrigHists(std::vector<MonElemContainer<OffPho>*>& phoMonElems,const std::vector<std::string>& tightLooseTrigs,const BinData& bins,EgHLTDQMCut<OffPho>* phoCut)
222 {
223  for(size_t trigNr=0;trigNr<tightLooseTrigs.size();trigNr++){
224  std::vector<std::string> splitString;
225  boost::split(splitString,tightLooseTrigs[trigNr],boost::is_any_of(std::string(":")));
226  if(splitString.size()!=2) continue; //format incorrect
227  const std::string& tightTrig = splitString[0];
228  const std::string& looseTrig = splitString[1];
229 
230  //this step is necessary as we want to transfer ownership of phoCut to the addTrigLooseTrigHist func on the last iteration
231  //but clone it before that
232  //perhaps my object ownership rules need to be re-evalulated
233  if(trigNr!=tightLooseTrigs.size()-2) addTightLooseTrigHist(phoMonElems,tightTrig,looseTrig,phoCut->clone(),"pho",bins);
234  else addTightLooseTrigHist(phoMonElems,tightTrig,looseTrig,phoCut,"pho",bins);
235  }
236 }
237 
238 
239 
240 
241 //there is nothing electron specific here, will template at some point
243  const std::string& tightTrig,const std::string& looseTrig,
244  EgHLTDQMCut<OffEle>* eleCut,
245  const std::string& histId,const BinData& bins)
246 {
247  MonElemContainer<OffEle>* passMonElem = NULL;
248  passMonElem = new MonElemContainer<OffEle>(tightTrig+"_"+looseTrig+"_"+histId+"_passTrig","",
249  &(*(new EgMultiCut<OffEle>) <<
250  new EgObjTrigCut<OffEle>(TrigCodes::getCode(tightTrig+":"+looseTrig),EgObjTrigCut<OffEle>::AND) <<
251  eleCut->clone()));
252 
253 
254  MonElemContainer<OffEle>* failMonElem = NULL;
255  failMonElem = new MonElemContainer<OffEle>(tightTrig+"_"+looseTrig+"_"+histId+"_failTrig","",
256  &(*(new EgMultiCut<OffEle>) <<
258  eleCut));
259 
260  MonElemFuncs::initStdEleHists(passMonElem->monElems(),passMonElem->name(),bins);
261  MonElemFuncs::initStdEleHists(failMonElem->monElems(),failMonElem->name(),bins);
262  eleMonElems.push_back(passMonElem);
263  eleMonElems.push_back(failMonElem);
264 }
265 
266 
267 //there is nothing photon specific here, will template at some point
269  const std::string& tightTrig,const std::string& looseTrig,
270  EgHLTDQMCut<OffPho>* phoCut,
271  const std::string& histId,const BinData& bins)
272 {
273  MonElemContainer<OffPho>* passMonElem = NULL;
274  passMonElem = new MonElemContainer<OffPho>(tightTrig+"_"+looseTrig+"_"+histId+"_passTrig","",
275  &(*(new EgMultiCut<OffPho>) <<
276  new EgObjTrigCut<OffPho>(TrigCodes::getCode(tightTrig+":"+looseTrig),EgObjTrigCut<OffPho>::AND) <<
277  phoCut->clone()));
278 
279 
280  MonElemContainer<OffPho>* failMonElem = NULL;
281  failMonElem = new MonElemContainer<OffPho>(tightTrig+"_"+looseTrig+"_"+histId+"_failTrig","",
282  &(*(new EgMultiCut<OffPho>) <<
284  phoCut));
285 
286  MonElemFuncs::initStdPhoHists(passMonElem->monElems(),passMonElem->name(),bins);
287  MonElemFuncs::initStdPhoHists(failMonElem->monElems(),failMonElem->name(),bins);
288  phoMonElems.push_back(passMonElem);
289  phoMonElems.push_back(failMonElem);
290 }
291 
292 
293 
294 //we transfer ownership of eleCut to the monitor elements
295 void MonElemFuncs::initTightLooseTrigHistsTrigCuts(std::vector<MonElemContainer<OffEle>*>& eleMonElems,const std::vector<std::string>& tightLooseTrigs,const BinData& bins)
296 {
297  for(size_t trigNr=0;trigNr<tightLooseTrigs.size();trigNr++){
298  std::vector<std::string> splitString;
299  boost::split(splitString,tightLooseTrigs[trigNr],boost::is_any_of(std::string(":")));
300  if(splitString.size()!=2) continue; //format incorrect
301  const std::string& tightTrig = splitString[0];
302  const std::string& looseTrig = splitString[1];
304  addTightLooseTrigHist(eleMonElems,tightTrig,looseTrig,eleCut,"gsfEle_trigCuts",bins);
305  }
306 }
307 
308 //we transfer ownership of phoCut to the monitor elements
309 void MonElemFuncs::initTightLooseTrigHistsTrigCuts(std::vector<MonElemContainer<OffPho>*>& phoMonElems,const std::vector<std::string>& tightLooseTrigs,const BinData& bins)
310 {
311  for(size_t trigNr=0;trigNr<tightLooseTrigs.size();trigNr++){
312  std::vector<std::string> splitString;
313  boost::split(splitString,tightLooseTrigs[trigNr],boost::is_any_of(std::string(":")));
314  if(splitString.size()!=2) continue; //format incorrect
315  const std::string& tightTrig = splitString[0];
316  const std::string& looseTrig = splitString[1];
318  addTightLooseTrigHist(phoMonElems,tightTrig,looseTrig,phoCut,"pho_trigCuts",bins);
319  }
320 }
321 
322 
323 //we transfer ownership of eleCut to the monitor elements
324 void MonElemFuncs::initTightLooseDiObjTrigHistsTrigCuts(std::vector<MonElemContainer<OffEle>*>& eleMonElems,const std::vector<std::string>& tightLooseTrigs,const BinData& bins)
325 {
326  for(size_t trigNr=0;trigNr<tightLooseTrigs.size();trigNr++){
327  std::vector<std::string> splitString;
328  boost::split(splitString,tightLooseTrigs[trigNr],boost::is_any_of(std::string(":")));
329  if(splitString.size()!=2) continue; //format incorrect
330  const std::string& tightTrig = splitString[0];
331  const std::string& looseTrig = splitString[1];
333  addTightLooseTrigHist(eleMonElems,tightTrig,looseTrig,eleCut,"gsfEle_trigCuts",bins);
334  }
335 }
336 
337 
338 //we transfer ownership of phoCut to the monitor elements
339 void MonElemFuncs::initTightLooseDiObjTrigHistsTrigCuts(std::vector<MonElemContainer<OffPho>*>& phoMonElems,const std::vector<std::string>& tightLooseTrigs,const BinData& bins)
340 {
341  for(size_t trigNr=0;trigNr<tightLooseTrigs.size();trigNr++){
342  std::vector<std::string> splitString;
343  boost::split(splitString,tightLooseTrigs[trigNr],boost::is_any_of(std::string(":")));
344  if(splitString.size()!=2) continue; //format incorrect
345  const std::string& tightTrig = splitString[0];
346  const std::string& looseTrig = splitString[1];
348  addTightLooseTrigHist(phoMonElems,tightTrig,looseTrig,phoCut,"pho_trigCuts",bins);
349  }
350 }
351 
352 
353 
354 //tag and probe trigger efficiencies
355 //this is to do measure the trigger efficiency with respect to a fully selected offline electron
356 //using a tag and probe technique (note: this will be different to the trigger efficiency normally calculated)
357 void MonElemFuncs::initTrigTagProbeHists(std::vector<MonElemContainer<OffEle>*>& eleMonElems,const std::vector<std::string> filterNames,int cutMask,const BinData& bins)
358 {
359  for(size_t filterNr=0;filterNr<filterNames.size();filterNr++){
360 
361  std::string trigName(filterNames[filterNr]);
362  float etCutValue = trigTools::getEtThresFromName(trigName);
363  MonElemContainer<OffEle>* monElemCont = new MonElemContainer<OffEle>("trigTagProbe","Trigger Tag and Probe",new EgTrigTagProbeCut(TrigCodes::getCode(trigName),cutMask,&OffEle::cutCode));
364  MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),trigName+"_"+monElemCont->name()+"_gsfEle_all",bins,new EgGreaterCut<OffEle,float>(etCutValue,&OffEle::etSC));
365  MonElemFuncs::initStdEleCutHists(monElemCont->cutMonElems(),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)));
366 
367  monElemCont->monElems().push_back(new MonElemMgrEBEE<OffEle,float>(trigName+"_"+monElemCont->name()+"_gsfEle_all_etUnCut",monElemCont->name()+"_gsfEle_all E_{T} (Uncut);E_{T} (GeV)",
368  bins.et.nr,bins.et.min,bins.et.max,&OffEle::et));
369  monElemCont->cutMonElems().push_back(new MonElemWithCutEBEE<OffEle,float>(trigName+"_"+monElemCont->name()+"_gsfEle_pass_etUnCut",monElemCont->name()+"_gsfEle_pass E_{T} (Uncut);E_{T} (GeV)",
371  eleMonElems.push_back(monElemCont);
372  } //end filter names loop
373 
374 }
375 
376 
float hltIsolTrks() const
Definition: EgHLTOffPho.h:125
float e1x5Over5x5() const
Definition: EgHLTOffPho.h:116
float e2x5MaxOver5x5() const
Definition: EgHLTOffEle.h:144
float detEta() const
Definition: EgHLTOffEle.h:112
static TrigBitSet getCode(const std::string &descript)
void initStdEleHists(std::vector< MonElemManagerBase< OffEle > * > &histVec, const std::string &baseName, const BinData &bins)
Data1D isolNrTrks
Definition: EgHLTBinData.h:50
float epIn() const
Definition: EgHLTOffEle.h:135
float et() const
Definition: EgHLTOffPho.h:91
float isolHad() const
Definition: EgHLTOffPho.h:121
const std::string & name() const
float isolPtTrks() const
Definition: EgHLTOffPho.h:123
void initTightLooseTrigHists(std::vector< MonElemContainer< OffEle > * > &eleMonElems, const std::vector< std::string > &tightLooseTrigs, const BinData &bins, EgHLTDQMCut< OffEle > *eleCut)
float invEInvP() const
Definition: EgHLTOffEle.h:150
#define NULL
Definition: scimark2.h:8
float et() const
Definition: EgHLTOffEle.h:104
void initTightLooseDiObjTrigHistsTrigCuts(std::vector< MonElemContainer< OffEle > * > &eleMonElems, const std::vector< std::string > &tightLooseTrigs, const BinData &bins)
float dPhiIn() const
Definition: EgHLTOffEle.h:132
int trigCutsCutCode(const TrigCodes::TrigBitSet &trigger) const
Definition: EgHLTOffPho.cc:14
std::vector< std::string > splitString(const std::string &fLine)
void initStdEleCutHists(std::vector< MonElemWithCutBase< OffEle > * > &histVec, const std::string &baseName, const BinData &bins, EgHLTDQMCut< OffEle > *cut=NULL)
Data1D isolPtTrks
Definition: EgHLTBinData.h:49
int charge() const
Definition: EgHLTOffEle.h:122
float detEta() const
Definition: EgHLTOffPho.h:98
float isolEm() const
Definition: EgHLTOffEle.h:154
float hOverE() const
Definition: EgHLTOffPho.h:106
float dEtaIn() const
Definition: EgHLTOffEle.h:131
float phi() const
Definition: EgHLTOffEle.h:108
float r9() const
Definition: EgHLTOffPho.h:117
void initTrigTagProbeHists(std::vector< MonElemContainer< OffEle > * > &eleMonElems, const std::vector< std::string > filterNames, int cutMask, const BinData &bins)
float sigmaIEtaIEta() const
Definition: EgHLTOffEle.h:141
float getEtThresFromName(const std::string &trigName)
virtual EgHLTDQMCut< T > * clone() const =0
float e2x5MaxOver5x5() const
Definition: EgHLTOffPho.h:115
float hltIsolHad() const
Definition: EgHLTOffPho.h:124
float hltIsolHad() const
Definition: EgHLTOffEle.h:162
tuple cut
Definition: align_tpl.py:88
int cutCode() const
Definition: EgHLTOffEle.h:191
float etSC() const
Definition: EgHLTOffPho.h:96
float sigmaIEtaIEta() const
Definition: EgHLTOffPho.h:112
float hltIsolTrksPho() const
Definition: EgHLTOffEle.h:161
float etSC() const
Definition: EgHLTOffEle.h:109
float isolPtTrks() const
Definition: EgHLTOffEle.h:158
Data1D sigEtaEta
Definition: EgHLTBinData.h:43
float hltIsolTrksEle() const
Definition: EgHLTOffEle.h:160
float phi() const
Definition: EgHLTOffPho.h:95
int trigCutsCutCode(const TrigCodes::TrigBitSet &trigger) const
Definition: EgHLTOffEle.cc:18
std::vector< MonElemManagerBase< T > * > & monElems()
int isolNrTrks() const
Definition: EgHLTOffPho.h:122
void addTightLooseTrigHist(std::vector< MonElemContainer< OffEle > * > &eleMonElems, const std::string &tightTrig, const std::string &looseTrig, EgHLTDQMCut< OffEle > *eleCut, const std::string &histId, const BinData &bins)
void initStdPhoHists(std::vector< MonElemManagerBase< OffPho > * > &histVec, const std::string &baseName, const BinData &bins)
void initStdEffHists(std::vector< MonElemWithCutBase< OffEle > * > &histVec, const std::string &baseName, int nrBins, double xMin, double xMax, float(OffEle::*vsVarFunc)() const, const CutMasks &masks)
int cutCode() const
Definition: EgHLTOffPho.h:129
float e1x5Over5x5() const
Definition: EgHLTOffEle.h:145
float hOverE() const
Definition: EgHLTOffEle.h:130
float isolHad() const
Definition: EgHLTOffEle.h:155
double split
Definition: MVATrainer.cc:139
float isolEm() const
Definition: EgHLTOffPho.h:120
void initTightLooseTrigHistsTrigCuts(std::vector< MonElemContainer< OffEle > * > &eleMonElems, const std::vector< std::string > &tightLooseTrigs, const BinData &bins)
std::vector< MonElemWithCutBase< T > * > & cutMonElems()
static const uint32_t masks[]
Definition: CaloRecHit.cc:14