CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
HltSusyExoPostProcessor Class Reference

#include <HltSusyExoPostProcessor.h>

Inheritance diagram for HltSusyExoPostProcessor:
DQMEDHarvester edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HltSusyExoPostProcessor (const edm::ParameterSet &pset)
 
 ~HltSusyExoPostProcessor () override
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Member Functions

MonitorElementbookEffMEProfileFromTH1 (TH1F *, std::string, DQMStore::IBooker &)
 

Private Attributes

std::vector< std::string > mc_dirs
 
std::vector< edm::ParameterSetmc_parametersets
 
bool mcFlag
 
std::vector< std::string > reco_dirs
 
std::vector< edm::ParameterSetreco_parametersets
 
std::string subDir_
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 9 of file HltSusyExoPostProcessor.h.

Constructor & Destructor Documentation

HltSusyExoPostProcessor::HltSusyExoPostProcessor ( const edm::ParameterSet pset)

Definition at line 19 of file HltSusyExoPostProcessor.cc.

References mps_fire::i, mc_dirs, mc_parametersets, reco_dirs, and reco_parametersets.

20  : subDir_(pset.getUntrackedParameter<std::string>("subDir", std::string("HLT/SusyExo"))),
21  mcFlag(pset.getUntrackedParameter<bool>("mc_flag", true)),
22  reco_parametersets(pset.getParameter<VParameterSet>("reco_parametersets")),
23  mc_parametersets(pset.getParameter<VParameterSet>("mc_parametersets")) {
24  for (unsigned int i = 0; i < reco_parametersets.size(); ++i) {
25  reco_dirs.push_back(reco_parametersets[i].getParameter<string>("name"));
26  }
27  for (unsigned int i = 0; i < mc_parametersets.size(); ++i) {
28  mc_dirs.push_back(mc_parametersets[i].getParameter<string>("name"));
29  }
30 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > mc_dirs
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
std::vector< edm::ParameterSet > mc_parametersets
std::vector< edm::ParameterSet > reco_parametersets
std::vector< std::string > reco_dirs
HltSusyExoPostProcessor::~HltSusyExoPostProcessor ( )
inlineoverride

Member Function Documentation

HltSusyExoPostProcessor::MonitorElement * HltSusyExoPostProcessor::bookEffMEProfileFromTH1 ( TH1F *  histo,
std::string  name,
DQMStore::IBooker iBooker_ 
)
private

Definition at line 617 of file HltSusyExoPostProcessor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::bookProfile(), DEFINE_FWK_MODULE, mps_fire::i, dqm::impl::MonitorElement::setBinLabel(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dqmEndJob(), and ~HltSusyExoPostProcessor().

619  {
620  MonitorElement *myEffME;
621  if (name == "Eff") {
622  myEffME = iBooker_.bookProfile((std::string)("Eff_" + ((std::string)histo->GetName())),
623  ((std::string)histo->GetTitle()),
624  histo->GetXaxis()->GetNbins(),
625  histo->GetXaxis()->GetXmin(),
626  histo->GetXaxis()->GetXmax(),
627  100,
628  0,
629  1,
630  "");
631  } else {
632  myEffME = iBooker_.bookProfile(name,
633  new TProfile(name.c_str(),
634  histo->GetTitle(),
635  histo->GetXaxis()->GetNbins(),
636  histo->GetXaxis()->GetXmin(),
637  histo->GetXaxis()->GetXmax()));
638  }
639  for (int i = 0; i < histo->GetXaxis()->GetNbins(); i++) {
640  myEffME->setBinLabel(i + 1, histo->GetXaxis()->GetBinLabel(i + 1), 1);
641  }
642  return myEffME;
643 }
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void HltSusyExoPostProcessor::dqmEndJob ( DQMStore::IBooker iBooker_,
DQMStore::IGetter iGetter_ 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 32 of file HltSusyExoPostProcessor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), bookEffMEProfileFromTH1(), dqm::dqmstoreimpl::DQMStore::IBooker::bookProfile(), dqm::dqmstoreimpl::DQMStore::IGetter::cd(), dqm::dqmstoreimpl::DQMStore::IGetter::dirExists(), relativeConstraints::error, dqmMemoryStats::float, dqm::dqmstoreimpl::DQMStore::IGetter::get(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getNbinsX(), dqm::legacy::MonitorElement::getTH1F(), dqm::legacy::MonitorElement::getTProfile(), mps_fire::i, dqmiolumiharvest::j, LogDebug, mc_dirs, mcFlag, dqm::dqmstoreimpl::DQMStore::IBooker::pwd(), reco_dirs, dqm::impl::MonitorElement::setBinContent(), dqm::impl::MonitorElement::setBinEntries(), dqm::impl::MonitorElement::setBinError(), dqm::impl::MonitorElement::setBinLabel(), dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), dqm::dqmstoreimpl::DQMStore::IGetter::setCurrentFolder(), dqm::impl::MonitorElement::setTitle(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, and subDir_.

Referenced by ~HltSusyExoPostProcessor().

32  {
33  LogDebug("HltSusyExoPostProcessor") << "Start dqmEndJob";
34 
35  // go to the directory to be processed
36  if (iGetter_.dirExists(subDir_))
37  iGetter_.cd(subDir_);
38  else {
39  edm::LogWarning("HltSusyExoPostProcessor") << "cannot find directory: " << subDir_ << " , skipping";
40  return;
41  }
42 
43  LogDebug("HltSusyExoPostProcessor") << "DQMStore cd";
44 
45  // --- set the names in the dbe folders ---
46  std::string triggerBitsDir = "/TriggerBits";
47  std::string recoSelBitsDir = "/RecoSelection";
48  std::string mcSelBitsDir = "/McSelection";
49  std::string byEventDir = "/By_Event";
50  std::string byMuonDir = "/By_Muon";
51 
52  // get the number of bins of the MonitorElements (valid for all the
53  // MonitorElements, independently of selection on the final state) we take the
54  // number of bins from the MonitorElements of the source, and we subtract one
55  // because the last bin was reserved for the Total number of events
56  int nL1bins = (iGetter_.get(iBooker_.pwd() + triggerBitsDir + "/L1Bits")->getNbinsX());
57  int nHltbins = (iGetter_.get(iBooker_.pwd() + triggerBitsDir + "/HltBits")->getNbinsX());
58 
59  std::vector<int> L1placement;
60  for (int i = 0; i < nL1bins - 1 * mcFlag; ++i)
61  L1placement.push_back(6);
62  std::vector<int> Hltplacement;
63  for (int i = 0; i < nHltbins - 1 * mcFlag; ++i)
64  Hltplacement.push_back(7);
65  int L1bins[7];
66  for (unsigned int i = 0; i < sizeof(L1bins) / sizeof(L1bins[0]); ++i)
67  L1bins[i] = 0;
68  int Hltbins[8];
69  for (unsigned int i = 0; i < sizeof(Hltbins) / sizeof(Hltbins[0]); ++i)
70  Hltbins[i] = 0;
71  string L1search[8] = {"Mu", "EG", "Jet", "ET", "TauJet", "X", ""};
72  string L1search3 = "HTT", L1search6 = "Bias";
73  string Hltsearch[8] = {"Mu", "Ele", "Jet", "Photon", "MET", "Tau", "X", ""};
74  string Hltsearch4 = "HT", Hltsearch5 = "BTag", Hltsearch6_1 = "EG", Hltsearch6_2 = "ET", Hltsearch7_1 = "Bias",
75  Hltsearch7_2 = "AlCa";
76 
77  LogDebug("HltSusyExoPostProcessor") << "number of L1 bins = " << nL1bins << " number of HLT bins = " << nHltbins;
78  double value = 0;
79  double error = 0;
80 
81  // Calculate the efficiencies for histos without any selection
82  iGetter_.setCurrentFolder(subDir_ + triggerBitsDir);
83  TH1F *hL1Paths = iGetter_.get(subDir_ + triggerBitsDir + "/L1Paths")->getTH1F();
84  MonitorElement *hL1EffBeforeCuts = bookEffMEProfileFromTH1(hL1Paths, "Eff", iBooker_);
85  TH1F *hHltPaths = iGetter_.get(subDir_ + triggerBitsDir + "/HltPaths")->getTH1F();
86  MonitorElement *hHltEffBeforeCuts = bookEffMEProfileFromTH1(hHltPaths, "Eff", iBooker_);
87 
88  LogDebug("HltSusyExoPostProcessor") << "MonitorElements booked";
89 
90  // get the total number of events
91  float nTotalBeforeCuts = -1;
92  int reference_bin = -1;
93  if (mcFlag) {
94  nTotalBeforeCuts = iGetter_.get(subDir_ + triggerBitsDir + "/L1Bits")->getBinContent(nL1bins);
95  reference_bin = nL1bins;
96  } else {
97  for (int i = 0; i < nHltbins; ++i) {
98  string triggername = ((TProfile *)hHltEffBeforeCuts->getTProfile())->GetXaxis()->GetBinLabel(i + 1);
99  string eff_search = "HLT_ZeroBias";
100  if (triggername.find(eff_search) != string::npos && triggername.size() == eff_search.size()) {
101  nTotalBeforeCuts = ((TProfile *)hHltEffBeforeCuts->getTProfile())->GetBinContent(i + 1);
102  reference_bin = i + 1;
103  break;
104  }
105  }
106  if (nTotalBeforeCuts == -1) {
107  nTotalBeforeCuts = iGetter_.get(subDir_ + triggerBitsDir + "/L1Bits")->getBinContent(nL1bins);
108  reference_bin = nHltbins;
109  }
110  }
111  LogDebug("HltSusyExoPostProcessor") << "Total number of events = " << nTotalBeforeCuts;
112 
113  // fill the eff histo
114  for (int i = 0; i < nL1bins - 1 * mcFlag; i++) {
115  value =
116  (double)iGetter_.get(subDir_ + triggerBitsDir + "/L1Paths")->getBinContent(i + 1) / (double)nTotalBeforeCuts;
117  error = sqrt(value * (1 - value) / (double)nTotalBeforeCuts);
118  hL1EffBeforeCuts->setBinContent(i + 1, value);
119  hL1EffBeforeCuts->setBinEntries(i + 1, 1);
120  hL1EffBeforeCuts->setBinError(i + 1, error);
121  // if(i!=nL1bins)
122  // {
123  string triggername = ((TProfile *)hL1EffBeforeCuts->getTProfile())->GetXaxis()->GetBinLabel(i + 1);
124  if (triggername.find(L1search6) == string::npos) {
125  for (unsigned int j = 0; j < sizeof(L1search) / sizeof(L1search[0]) - 2; ++j) {
126  if (triggername.find(L1search[j]) != string::npos || (j == 3 && triggername.find(L1search3) != string::npos)) {
127  if (L1placement[i] == 6)
128  L1placement[i] = j;
129  else if (L1placement[i] == 2 && j == 4)
130  L1placement[i] = 4;
131  else
132  L1placement[i] = 5;
133  } else if (triggername.empty() || triggername.find("Total") != string::npos)
134  L1placement[i] = -1;
135  }
136  }
137  }
138 
139  for (unsigned int i = 0; i < L1placement.size(); ++i)
140  if (L1placement[i] != -1)
141  ++L1bins[L1placement[i]];
142 
143  for (int i = 0; i < nHltbins - 1 * mcFlag; i++) {
144  value =
145  (double)iGetter_.get(subDir_ + triggerBitsDir + "/HltPaths")->getBinContent(i + 1) / (double)nTotalBeforeCuts;
146  error = sqrt(value * (1 - value) / (double)nTotalBeforeCuts);
147  hHltEffBeforeCuts->setBinContent(i + 1, value);
148  hHltEffBeforeCuts->setBinEntries(i + 1, 1);
149  hHltEffBeforeCuts->setBinError(i + 1, error);
150  // if(i!=nHltbins)
151  // {
152  string triggername = ((TProfile *)hHltEffBeforeCuts->getTProfile())->GetXaxis()->GetBinLabel(i + 1);
153  if (triggername.find(Hltsearch7_1) == string::npos && triggername.find(Hltsearch7_2) == string::npos) {
154  for (unsigned int j = 0; j < sizeof(Hltsearch) / sizeof(Hltsearch[0]) - 2; ++j) {
155  if (triggername.find(Hltsearch[j]) != string::npos ||
156  (j == 4 && triggername.find(Hltsearch4) != string::npos) ||
157  (j == 5 && triggername.find(Hltsearch5) != string::npos)) {
158  if (Hltplacement[i] == 7)
159  Hltplacement[i] = j;
160  else if (triggername.find(Hltsearch5) != string::npos)
161  Hltplacement[i] = 5;
162  else
163  Hltplacement[i] = 6;
164  } else if (triggername.empty() || triggername.find("Total") != string::npos)
165  Hltplacement[i] = -1;
166  }
167  if (Hltplacement[i] >= 0 && Hltplacement[i] <= 5 &&
168  (triggername.find(Hltsearch6_1) != string::npos ||
169  (triggername.find(Hltsearch6_2) != string::npos && Hltplacement[i] != 4)))
170  Hltplacement[i] = 6;
171  }
172  }
173 
174  for (unsigned int i = 0; i < Hltplacement.size(); ++i)
175  if (Hltplacement[i] != -1)
176  ++Hltbins[Hltplacement[i]];
177 
178  LogDebug("HltSusyExoPostProcessor") << "MonitorElements filled";
179 
180  // Create the sorted histograms
181  iBooker_.setCurrentFolder(subDir_ + triggerBitsDir);
182  MonitorElement *hL1EffSorted[7] = {
183  iBooker_.bookProfile("L1_Mu", new TProfile("L1_Mu", "Efficiencies of L1 Muon Triggers", L1bins[0], 0, L1bins[0])),
184  iBooker_.bookProfile("L1_EG", new TProfile("L1_EG", "Efficiencies of L1 EG Triggers", L1bins[1], 0, L1bins[1])),
185  iBooker_.bookProfile("L1_Jet",
186  new TProfile("L1_Jet", "Efficiencies of L1 Jet Triggers", L1bins[2], 0, L1bins[2])),
187  iBooker_.bookProfile(
188  "L1_ETM_ETT_HTT",
189  new TProfile("L1_ETM_ETT_HTT", "Efficiencies of L1 ETM, ETT, and HTT Triggers", L1bins[3], 0, L1bins[3])),
190  iBooker_.bookProfile("L1_TauJet",
191  new TProfile("L1_TauJet", "Efficiencies of L1 TauJet Triggers", L1bins[4], 0, L1bins[4])),
192  iBooker_.bookProfile("L1_XTrigger",
193  new TProfile("L1_XTrigger", "Efficiencies of L1 Cross Triggers", L1bins[5], 0, L1bins[5])),
194  iBooker_.bookProfile(
195  "L1_Overflow", new TProfile("L1_Overflow", "Efficiencies of L1 Unsorted Triggers", L1bins[6], 0, L1bins[6]))};
196 
197  MonitorElement *hHltEffSorted[8] = {
198  iBooker_.bookProfile("Hlt_Mu",
199  new TProfile("Hlt_Mu", "Efficiencies of HL Muon Triggers", Hltbins[0], 0, Hltbins[0])),
200  iBooker_.bookProfile("Hlt_Ele",
201  new TProfile("Hlt_Ele", "Efficiencies of HL Electron Triggers", Hltbins[1], 0, Hltbins[1])),
202  iBooker_.bookProfile("Hlt_Jet",
203  new TProfile("Hlt_Jet", "Efficiencies of HL Jet Triggers", Hltbins[2], 0, Hltbins[2], "s")),
204  iBooker_.bookProfile("Hlt_Photon",
205  new TProfile("Hlt_Photon", "Efficiencies of HL Photon Triggers", Hltbins[3], 0, Hltbins[3])),
206  iBooker_.bookProfile(
207  "Hlt_MET_HT",
208  new TProfile("Hlt_MET_HT", "Efficiencies of HL MET and HT Triggers", Hltbins[4], 0, Hltbins[4])),
209  iBooker_.bookProfile(
210  "Hlt_Tau_BTag",
211  new TProfile("Hlt_Tau_Btag", "Efficiencies of HL Tau and BTag Triggers", Hltbins[5], 0, Hltbins[5])),
212  iBooker_.bookProfile(
213  "Hlt_XTrigger", new TProfile("Hlt_XTrigger", "Efficiencies of HL Cross Triggers", Hltbins[6], 0, Hltbins[6])),
214  iBooker_.bookProfile(
215  "Hlt_Overflow",
216  new TProfile("Hlt_Overflow", "Efficiencies of HL Unsorted Triggers", Hltbins[7], 0, Hltbins[7]))};
217 
218  int L1bincounter[8];
219  for (unsigned int i = 0; i < sizeof(L1bincounter) / sizeof(L1bincounter[0]); ++i)
220  L1bincounter[i] = 0;
221  int Hltbincounter[8];
222  for (unsigned int i = 0; i < sizeof(Hltbincounter) / sizeof(Hltbincounter[0]); ++i)
223  Hltbincounter[i] = 0;
224  TProfile *hL1_ = (TProfile *)hL1EffBeforeCuts->getTProfile();
225  TProfile *hHlt_ = (TProfile *)hHltEffBeforeCuts->getTProfile();
226  // for(int i = 0; i<hHlt_->GetXaxis()->GetNbins(); i++) cout <<
227  // "hHLT_->GetBinError(" << i << ") = " << hHlt_->GetBinError(i+1) << endl;
228  for (unsigned int i = 0; i < L1placement.size(); ++i) {
229  if (L1placement[i] != -1) {
230  hL1EffSorted[L1placement[i]]->setBinLabel(L1bincounter[L1placement[i]] + 1, hL1_->GetXaxis()->GetBinLabel(i + 1));
231  hL1EffSorted[L1placement[i]]->setBinContent(L1bincounter[L1placement[i]] + 1, hL1_->GetBinContent(i + 1));
232  hL1EffSorted[L1placement[i]]->setBinEntries(L1bincounter[L1placement[i]] + 1, 1);
233  hL1EffSorted[L1placement[i]]->setBinError(L1bincounter[L1placement[i]] + 1, hL1_->GetBinError(i + 1));
234  ++L1bincounter[L1placement[i]];
235  }
236  }
237  for (unsigned int i = 0; i < Hltplacement.size(); ++i) {
238  if (Hltplacement[i] != -1) {
239  hHltEffSorted[Hltplacement[i]]->setBinLabel(Hltbincounter[Hltplacement[i]] + 1,
240  hHlt_->GetXaxis()->GetBinLabel(i + 1));
241  hHltEffSorted[Hltplacement[i]]->setBinContent(Hltbincounter[Hltplacement[i]] + 1, hHlt_->GetBinContent(i + 1));
242  hHltEffSorted[Hltplacement[i]]->setBinEntries(Hltbincounter[Hltplacement[i]] + 1, 1);
243  hHltEffSorted[Hltplacement[i]]->setBinError(Hltbincounter[Hltplacement[i]] + 1, hHlt_->GetBinError(i + 1));
244  ++Hltbincounter[Hltplacement[i]];
245  }
246  }
247 
248  for (unsigned int i = 0; i < mc_dirs.size(); ++i) {
249  // Calculate the efficiencies for histos after MC selection
250  iGetter_.setCurrentFolder(subDir_ + mcSelBitsDir + "/" + mc_dirs[i]);
251  // book the MonitorElements for the efficiencies
252  char set_name_L1[256], set_name_Hlt[256];
253  sprintf(set_name_L1, "L1Eff_%s", mc_dirs[i].c_str());
254  sprintf(set_name_Hlt, "HltEff_%s", mc_dirs[i].c_str());
255  MonitorElement *hL1EffAfterMcCuts = bookEffMEProfileFromTH1(
256  iGetter_.get(subDir_ + mcSelBitsDir + "/" + mc_dirs[i] + "/L1Paths_" + mc_dirs[i])->getTH1F(),
257  (std::string)set_name_L1,
258  iBooker_);
259  hL1EffAfterMcCuts->setTitle("L1 Efficiencies for " + mc_dirs[i] + " selection");
260  MonitorElement *hHltEffAfterMcCuts = bookEffMEProfileFromTH1(
261  iGetter_.get(subDir_ + mcSelBitsDir + "/" + mc_dirs[i] + "/HltPaths_" + mc_dirs[i])->getTH1F(),
262  (std::string)set_name_Hlt,
263  iBooker_);
264  hHltEffAfterMcCuts->setTitle("HLT Efficiencies for " + mc_dirs[i] + " selection");
265 
266  LogDebug("HltSusyExoPostProcessor") << "MonitorElements for " << mc_dirs[i] << " selection booked";
267 
268  // get the total number of events
269  float nTotalAfterMcCuts;
270  if (mcFlag)
271  nTotalAfterMcCuts =
272  iGetter_.get(subDir_ + mcSelBitsDir + "/" + mc_dirs[i] + "/L1Bits_" + mc_dirs[i])->getBinContent(nL1bins);
273  else
274  nTotalAfterMcCuts = iGetter_.get(subDir_ + mcSelBitsDir + "/" + mc_dirs[i] + "/HltBits_" + mc_dirs[i])
275  ->getBinContent(reference_bin);
276 
277  LogDebug("HltSusyExoPostProcessor") << "Total number of events = " << nTotalAfterMcCuts;
278 
279  MonitorElement *hL1EffSorted_mc[7];
280  MonitorElement *hHltEffSorted_mc[8];
281  char buffer1[256], buffer2[256];
282  string L1_nametags[7] = {"Mu", "EG", "Jet", "ETM_ETT_HTT", "TauJet", "XTrigger", "Overflow"};
283  string L1_titletags[7] = {"Muon", "EG", "Jet", "ETM, ETT, and HTT", "TauJet", "Cross", "Unsorted"};
284  string Hlt_nametags[8] = {"Mu", "Ele", "Jet", "Photon", "MET_HT", "Tau_BTag", "XTrigger", "Overflow"};
285  string Hlt_titletags[8] = {"Muon", "Electron", "Jet", "Photon", "MET and HT", "Tau and BTag", "Cross", "Unsorted"};
286  for (unsigned int j = 0; j < sizeof(hL1EffSorted_mc) / sizeof(hL1EffSorted_mc[0]); ++j) {
287  sprintf(buffer1, "L1_%s_%s", mc_dirs[i].c_str(), L1_nametags[j].c_str());
288  sprintf(buffer2, "Efficiencies of L1 %s Triggers for %s Selection", L1_titletags[j].c_str(), mc_dirs[i].c_str());
289  hL1EffSorted_mc[j] = iBooker_.bookProfile(buffer1, new TProfile(buffer1, buffer2, L1bins[j], 0, L1bins[j]));
290  }
291  for (unsigned int j = 0; j < sizeof(hHltEffSorted_mc) / sizeof(hHltEffSorted_mc[0]); ++j) {
292  sprintf(buffer1, "Hlt_%s_%s", mc_dirs[i].c_str(), Hlt_nametags[j].c_str());
293  sprintf(buffer2, "Efficiencies of HL %s Triggers for %s Selection", Hlt_titletags[j].c_str(), mc_dirs[i].c_str());
294  hHltEffSorted_mc[j] = iBooker_.bookProfile(buffer1, new TProfile(buffer1, buffer2, Hltbins[j], 0, Hltbins[j]));
295  }
296 
297  // fill the eff histo
298  int L1bincounter_mc[8];
299  for (unsigned int j = 0; j < sizeof(L1bincounter_mc) / sizeof(L1bincounter_mc[0]); ++j)
300  L1bincounter_mc[j] = 0;
301  int Hltbincounter_mc[8];
302  for (unsigned int j = 0; j < sizeof(Hltbincounter_mc) / sizeof(Hltbincounter_mc[0]); ++j)
303  Hltbincounter_mc[j] = 0;
304  TProfile *hL1_mc = (TProfile *)hL1EffAfterMcCuts->getTProfile();
305  TProfile *hHlt_mc = (TProfile *)hHltEffAfterMcCuts->getTProfile();
306  for (unsigned int j = 0; j < L1placement.size(); j++) {
307  value = nTotalAfterMcCuts
308  ? (float)iGetter_.get(subDir_ + mcSelBitsDir + "/" + mc_dirs[i] + "/L1Paths_" + mc_dirs[i])
309  ->getBinContent(j + 1) /
310  nTotalAfterMcCuts
311  : 0;
312  error = nTotalAfterMcCuts ? sqrt(value * (1 - value) / nTotalAfterMcCuts) : 0;
313  hL1EffAfterMcCuts->setBinContent(j + 1, value);
314  hL1EffAfterMcCuts->setBinEntries(j + 1, 1);
315  hL1EffAfterMcCuts->setBinError(j + 1, error);
316  if (L1placement[j] != -1) {
317  hL1EffSorted_mc[L1placement[j]]->setBinLabel(L1bincounter_mc[L1placement[j]] + 1,
318  hL1_mc->GetXaxis()->GetBinLabel(j + 1));
319  hL1EffSorted_mc[L1placement[j]]->setBinContent(L1bincounter_mc[L1placement[j]] + 1,
320  hL1_mc->GetBinContent(j + 1));
321  hL1EffSorted_mc[L1placement[j]]->setBinEntries(L1bincounter_mc[L1placement[j]] + 1, 1);
322  hL1EffSorted_mc[L1placement[j]]->setBinError(L1bincounter_mc[L1placement[j]] + 1, hL1_mc->GetBinError(j + 1));
323  ++L1bincounter_mc[L1placement[j]];
324  }
325  }
326  if (nL1bins != int(L1placement.size())) {
327  value = nTotalAfterMcCuts
328  ? (float)iGetter_.get(subDir_ + mcSelBitsDir + "/" + mc_dirs[i] + "/L1Paths_" + mc_dirs[i])
329  ->getBinContent(nL1bins) /
330  nTotalAfterMcCuts
331  : 0;
332  error = nTotalAfterMcCuts ? sqrt(value * (1 - value) / nTotalAfterMcCuts) : 0;
333  hL1EffAfterMcCuts->setBinContent(nL1bins, value);
334  hL1EffAfterMcCuts->setBinEntries(nL1bins, 1);
335  hL1EffAfterMcCuts->setBinError(nL1bins, error);
336  }
337  for (unsigned int j = 0; j < Hltplacement.size(); j++) {
338  value = nTotalAfterMcCuts
339  ? (float)iGetter_.get(subDir_ + mcSelBitsDir + "/" + mc_dirs[i] + "/HltPaths_" + mc_dirs[i])
340  ->getBinContent(j + 1) /
341  nTotalAfterMcCuts
342  : 0;
343  error = nTotalAfterMcCuts ? sqrt(value * (1 - value) / nTotalAfterMcCuts) : 0;
344  hHltEffAfterMcCuts->setBinContent(j + 1, value);
345  hHltEffAfterMcCuts->setBinEntries(j + 1, 1);
346  hHltEffAfterMcCuts->setBinError(j + 1, error);
347  if (Hltplacement[j] != -1) {
348  hHltEffSorted_mc[Hltplacement[j]]->setBinLabel(Hltbincounter_mc[Hltplacement[j]] + 1,
349  hHlt_mc->GetXaxis()->GetBinLabel(j + 1));
350  hHltEffSorted_mc[Hltplacement[j]]->setBinContent(Hltbincounter_mc[Hltplacement[j]] + 1,
351  hHlt_mc->GetBinContent(j + 1));
352  hHltEffSorted_mc[Hltplacement[j]]->setBinEntries(Hltbincounter_mc[Hltplacement[j]] + 1, 1);
353  hHltEffSorted_mc[Hltplacement[j]]->setBinError(Hltbincounter_mc[Hltplacement[j]] + 1,
354  hHlt_mc->GetBinError(j + 1));
355  ++Hltbincounter_mc[Hltplacement[j]];
356  }
357  }
358  if (nHltbins != int(Hltplacement.size())) {
359  value = nTotalAfterMcCuts
360  ? (float)iGetter_.get(subDir_ + mcSelBitsDir + "/" + mc_dirs[i] + "/HltPaths_" + mc_dirs[i])
361  ->getBinContent(nHltbins) /
362  nTotalAfterMcCuts
363  : 0;
364  error = nTotalAfterMcCuts ? sqrt(value * (1 - value) / nTotalAfterMcCuts) : 0;
365  hHltEffAfterMcCuts->setBinContent(nHltbins, value);
366  hHltEffAfterMcCuts->setBinEntries(nHltbins, 1);
367  hHltEffAfterMcCuts->setBinError(nHltbins, error);
368  }
369  LogDebug("HltSusyExoPostProcessor") << "MonitorElements filled for " << mc_dirs[i] << " selection";
370  }
371 
372  for (unsigned int i = 0; i < reco_dirs.size(); ++i) {
373  // Calculate the efficiencies for histos after RECO selection
374  iGetter_.setCurrentFolder(subDir_ + recoSelBitsDir + "/" + reco_dirs[i]);
375  // book the MonitorElements for the efficiencies
376  char set_name_L1[256], set_name_Hlt[256];
377  sprintf(set_name_L1, "L1Eff_%s", reco_dirs[i].c_str());
378  sprintf(set_name_Hlt, "HltEff_%s", reco_dirs[i].c_str());
379  MonitorElement *hL1EffAfterRecoCuts = bookEffMEProfileFromTH1(
380  iGetter_.get(subDir_ + recoSelBitsDir + "/" + reco_dirs[i] + "/L1Paths_" + reco_dirs[i])->getTH1F(),
381  (std::string)set_name_L1,
382  iBooker_);
383  hL1EffAfterRecoCuts->setTitle("L1 Efficiencies for " + reco_dirs[i] + " selection");
384  MonitorElement *hHltEffAfterRecoCuts = bookEffMEProfileFromTH1(
385  iGetter_.get(subDir_ + recoSelBitsDir + "/" + reco_dirs[i] + "/HltPaths_" + reco_dirs[i])->getTH1F(),
386  (std::string)set_name_Hlt,
387  iBooker_);
388  hHltEffAfterRecoCuts->setTitle("HLT Efficiencies for " + reco_dirs[i] + " selection");
389 
390  LogDebug("HltSusyExoPostProcessor") << "MonitorElements for " << reco_dirs[i] << " selection booked";
391 
392  // get the total number of events
393  float nTotalAfterRecoCuts;
394  if (mcFlag)
395  nTotalAfterRecoCuts = iGetter_.get(subDir_ + recoSelBitsDir + "/" + reco_dirs[i] + "/L1Bits_" + reco_dirs[i])
396  ->getBinContent(nL1bins);
397  else
398  nTotalAfterRecoCuts = iGetter_.get(subDir_ + recoSelBitsDir + "/" + reco_dirs[i] + "/HltBits_" + reco_dirs[i])
399  ->getBinContent(reference_bin);
400 
401  LogDebug("HltSusyExoPostProcessor") << "Total number of events = " << nTotalAfterRecoCuts;
402 
403  MonitorElement *hL1EffSorted_reco[7];
404  MonitorElement *hHltEffSorted_reco[8];
405  char buffer1[256], buffer2[256];
406  string L1_nametags[7] = {"Mu", "EG", "Jet", "ETM_ETT_HTT", "TauJet", "XTrigger", "Overflow"};
407  string L1_titletags[7] = {"Muon", "EG", "Jet", "ETM, ETT, and HTT", "TauJet", "Cross", "Unsorted"};
408  string Hlt_nametags[8] = {"Mu", "Ele", "Jet", "Photon", "MET_HT", "Tau_BTag", "XTrigger", "Overflow"};
409  string Hlt_titletags[8] = {"Muon", "Electron", "Jet", "Photon", "MET and HT", "Tau and BTag", "Cross", "Unsorted"};
410  for (unsigned int j = 0; j < sizeof(hL1EffSorted_reco) / sizeof(hL1EffSorted_reco[0]); ++j) {
411  sprintf(buffer1, "L1_%s_%s", reco_dirs[i].c_str(), L1_nametags[j].c_str());
412  sprintf(
413  buffer2, "Efficiencies of L1 %s Triggers for %s Selection", L1_titletags[j].c_str(), reco_dirs[i].c_str());
414  hL1EffSorted_reco[j] = iBooker_.bookProfile(buffer1, new TProfile(buffer1, buffer2, L1bins[j], 0, L1bins[j]));
415  }
416  for (unsigned int j = 0; j < sizeof(hHltEffSorted_reco) / sizeof(hHltEffSorted_reco[0]); ++j) {
417  sprintf(buffer1, "Hlt_%s_%s", reco_dirs[i].c_str(), Hlt_nametags[j].c_str());
418  sprintf(
419  buffer2, "Efficiencies of HL %s Triggers for %s Selection", Hlt_titletags[j].c_str(), reco_dirs[i].c_str());
420  hHltEffSorted_reco[j] = iBooker_.bookProfile(buffer1, new TProfile(buffer1, buffer2, Hltbins[j], 0, Hltbins[j]));
421  }
422 
423  // fill the eff histo
424  int L1bincounter_reco[8];
425  for (unsigned int j = 0; j < sizeof(L1bincounter_reco) / sizeof(L1bincounter_reco[0]); ++j)
426  L1bincounter_reco[j] = 0;
427  int Hltbincounter_reco[8];
428  for (unsigned int j = 0; j < sizeof(Hltbincounter_reco) / sizeof(Hltbincounter_reco[0]); ++j)
429  Hltbincounter_reco[j] = 0;
430  TProfile *hL1_reco = (TProfile *)hL1EffAfterRecoCuts->getTProfile();
431  TProfile *hHlt_reco = (TProfile *)hHltEffAfterRecoCuts->getTProfile();
432  for (unsigned int j = 0; j < L1placement.size(); j++) {
433  value = nTotalAfterRecoCuts
434  ? (float)iGetter_.get(subDir_ + recoSelBitsDir + "/" + reco_dirs[i] + "/L1Paths_" + reco_dirs[i])
435  ->getBinContent(j + 1) /
436  nTotalAfterRecoCuts
437  : 0;
438  error = nTotalAfterRecoCuts ? sqrt(value * (1 - value) / nTotalAfterRecoCuts) : 0;
439  hL1EffAfterRecoCuts->setBinContent(j + 1, value);
440  hL1EffAfterRecoCuts->setBinEntries(j + 1, 1);
441  hL1EffAfterRecoCuts->setBinError(j + 1, error);
442  if (L1placement[j] != -1) {
443  hL1EffSorted_reco[L1placement[j]]->setBinLabel(L1bincounter_reco[L1placement[j]] + 1,
444  hL1_reco->GetXaxis()->GetBinLabel(j + 1));
445  hL1EffSorted_reco[L1placement[j]]->setBinContent(L1bincounter_reco[L1placement[j]] + 1,
446  hL1_reco->GetBinContent(j + 1));
447  hL1EffSorted_reco[L1placement[j]]->setBinEntries(L1bincounter_reco[L1placement[j]] + 1, 1);
448  hL1EffSorted_reco[L1placement[j]]->setBinError(L1bincounter_reco[L1placement[j]] + 1,
449  hL1_reco->GetBinError(j + 1));
450  ++L1bincounter_reco[L1placement[j]];
451  }
452  }
453  if (nL1bins != int(L1placement.size())) {
454  value = nTotalAfterRecoCuts
455  ? (float)iGetter_.get(subDir_ + recoSelBitsDir + "/" + reco_dirs[i] + "/L1Paths_" + reco_dirs[i])
456  ->getBinContent(nL1bins) /
457  nTotalAfterRecoCuts
458  : 0;
459  error = nTotalAfterRecoCuts ? sqrt(value * (1 - value) / nTotalAfterRecoCuts) : 0;
460  hL1EffAfterRecoCuts->setBinContent(nL1bins, value);
461  hL1EffAfterRecoCuts->setBinEntries(nL1bins, 1);
462  hL1EffAfterRecoCuts->setBinError(nL1bins, error);
463  }
464  for (unsigned int j = 0; j < Hltplacement.size(); j++) {
465  value = nTotalAfterRecoCuts
466  ? (float)iGetter_.get(subDir_ + recoSelBitsDir + "/" + reco_dirs[i] + "/HltPaths_" + reco_dirs[i])
467  ->getBinContent(j + 1) /
468  nTotalAfterRecoCuts
469  : 0;
470  error = nTotalAfterRecoCuts ? sqrt(value * (1 - value) / nTotalAfterRecoCuts) : 0;
471  hHltEffAfterRecoCuts->setBinContent(j + 1, value);
472  hHltEffAfterRecoCuts->setBinEntries(j + 1, 1);
473  hHltEffAfterRecoCuts->setBinError(j + 1, error);
474  if (Hltplacement[j] != -1) {
475  hHltEffSorted_reco[Hltplacement[j]]->setBinLabel(Hltbincounter_reco[Hltplacement[j]] + 1,
476  hHlt_reco->GetXaxis()->GetBinLabel(j + 1));
477  hHltEffSorted_reco[Hltplacement[j]]->setBinContent(Hltbincounter_reco[Hltplacement[j]] + 1,
478  hHlt_reco->GetBinContent(j + 1));
479  hHltEffSorted_reco[Hltplacement[j]]->setBinEntries(Hltbincounter_reco[Hltplacement[j]] + 1, 1);
480  hHltEffSorted_reco[Hltplacement[j]]->setBinError(Hltbincounter_reco[Hltplacement[j]] + 1,
481  hHlt_reco->GetBinError(j + 1));
482  ++Hltbincounter_reco[Hltplacement[j]];
483  }
484  }
485  if (nHltbins != int(Hltplacement.size())) {
486  value = nTotalAfterRecoCuts
487  ? (float)iGetter_.get(subDir_ + recoSelBitsDir + "/" + reco_dirs[i] + "/HltPaths_" + reco_dirs[i])
488  ->getBinContent(nHltbins) /
489  nTotalAfterRecoCuts
490  : 0;
491  error = nTotalAfterRecoCuts ? sqrt(value * (1 - value) / nTotalAfterRecoCuts) : 0;
492  hHltEffAfterRecoCuts->setBinContent(nHltbins, value);
493  hHltEffAfterRecoCuts->setBinEntries(nHltbins, 1);
494  hHltEffAfterRecoCuts->setBinError(nHltbins, error);
495  }
496  LogDebug("HltSusyExoPostProcessor") << "MonitorElements filled";
497  }
498 
499  int pt_bins = 100, eta_bins = 100;
500  double pt_floor = 0., pt_ceiling = 200., eta_floor = -3.5, eta_ceiling = 3.5;
501  iBooker_.setCurrentFolder(subDir_ + byEventDir);
502  MonitorElement *hPt_1_ByEvent = iBooker_.book1D(
503  "Pt_1_ByEvent", "Turn on as a Function of P_{t}, |Eta|<1.2, By Event", pt_bins, pt_floor, pt_ceiling);
504  MonitorElement *hEta_1_ByEvent = iBooker_.book1D(
505  "Eta_1_ByEvent", "Efficiency as a Function of Eta, P_{t}>0, By Event", eta_bins, eta_floor, eta_ceiling);
506  MonitorElement *hPt_2_ByEvent = iBooker_.book1D(
507  "Pt_2_ByEvent", "Turn on as a Function of P_{t}, 1.2<|Eta|<2.1, By Event", pt_bins, pt_floor, pt_ceiling);
508  MonitorElement *hEta_2_ByEvent = iBooker_.book1D(
509  "Eta_2_ByEvent", "Efficiency as a Function of Eta, P_{t}>10, By Event", eta_bins, eta_floor, eta_ceiling);
510  MonitorElement *hPt_3_ByEvent = iBooker_.book1D(
511  "Pt_3_ByEvent", "Turn on as a Function of P_{t}, |Eta|>2.1, By Event", pt_bins, pt_floor, pt_ceiling);
512  MonitorElement *hEta_3_ByEvent = iBooker_.book1D(
513  "Eta_3_ByEvent", "Efficiency as a Function of Eta, P_{t}>20, By Event", eta_bins, eta_floor, eta_ceiling);
514  iBooker_.setCurrentFolder(subDir_ + byMuonDir);
515  MonitorElement *hPt_1_ByMuon = iBooker_.book1D(
516  "Pt_1_ByMuon", "Turn on as a Function of P_{t}, |Eta|<1.2, By Muon", pt_bins, pt_floor, pt_ceiling);
517  MonitorElement *hEta_1_ByMuon = iBooker_.book1D(
518  "Eta_1_ByMuon", "Efficiency as a Function of Eta, P_{t}>0, By Muon", eta_bins, eta_floor, eta_ceiling);
519  MonitorElement *hPt_2_ByMuon = iBooker_.book1D(
520  "Pt_2_ByMuon", "Turn on as a Function of P_{t}, 1.2<|Eta|<2.1, By Muon", pt_bins, pt_floor, pt_ceiling);
521  MonitorElement *hEta_2_ByMuon = iBooker_.book1D(
522  "Eta_2_ByMuon", "Efficiency as a Function of Eta, P_{t}>10, By Muon", eta_bins, eta_floor, eta_ceiling);
523  MonitorElement *hPt_3_ByMuon = iBooker_.book1D(
524  "Pt_3_ByMuon", "Turn on as a Function of P_{t}, |Eta|>2.1, By Muon", pt_bins, pt_floor, pt_ceiling);
525  MonitorElement *hEta_3_ByMuon = iBooker_.book1D(
526  "Eta_3_ByMuon", "Efficiency as a Function of Eta, P_{t}>20, By Muon", eta_bins, eta_floor, eta_ceiling);
527 
528  for (int i = 1; i <= hPt_1_ByEvent->getNbinsX(); ++i) {
529  double n1 = (double)iGetter_.get(subDir_ + byEventDir + "/LeadAssocRecoMuonPt_1_ByEvent")->getBinContent(i);
530  double n2 = (double)iGetter_.get(subDir_ + byEventDir + "/LeadRecoMuonPt_1_ByEvent")->getBinContent(i);
531  double value = (n2 != 0 ? n1 / n2 : 0);
532  double error = (n2 != 0 ? sqrt(value * (1 - value) / n2) : 0);
533  hPt_1_ByEvent->setBinContent(i, value);
534  hPt_1_ByEvent->setBinError(i, error);
535 
536  n1 = (double)iGetter_.get(subDir_ + byEventDir + "/LeadAssocRecoMuonPt_2_ByEvent")->getBinContent(i);
537  n2 = (double)iGetter_.get(subDir_ + byEventDir + "/LeadRecoMuonPt_2_ByEvent")->getBinContent(i);
538  value = (n2 != 0 ? n1 / n2 : 0);
539  error = (n2 != 0 ? sqrt(value * (1 - value) / n2) : 0);
540  hPt_2_ByEvent->setBinContent(i, value);
541  hPt_2_ByEvent->setBinError(i, error);
542 
543  n1 = (double)iGetter_.get(subDir_ + byEventDir + "/LeadAssocRecoMuonPt_3_ByEvent")->getBinContent(i);
544  n2 = (double)iGetter_.get(subDir_ + byEventDir + "/LeadRecoMuonPt_3_ByEvent")->getBinContent(i);
545  value = (n2 != 0 ? n1 / n2 : 0);
546  error = (n2 != 0 ? sqrt(value * (1 - value) / n2) : 0);
547  hPt_3_ByEvent->setBinContent(i, value);
548  hPt_3_ByEvent->setBinError(i, error);
549 
550  n1 = (double)iGetter_.get(subDir_ + byMuonDir + "/AssocRecoMuonPt_1_ByMuon")->getBinContent(i);
551  n2 = (double)iGetter_.get(subDir_ + byMuonDir + "/RecoMuonPt_1_ByMuon")->getBinContent(i);
552  value = (n2 != 0 ? n1 / n2 : 0);
553  error = (n2 != 0 ? sqrt(value * (1 - value) / n2) : 0);
554  hPt_1_ByMuon->setBinContent(i, value);
555  hPt_1_ByMuon->setBinError(i, error);
556 
557  n1 = (double)iGetter_.get(subDir_ + byMuonDir + "/AssocRecoMuonPt_2_ByMuon")->getBinContent(i);
558  n2 = (double)iGetter_.get(subDir_ + byMuonDir + "/RecoMuonPt_2_ByMuon")->getBinContent(i);
559  value = (n2 != 0 ? n1 / n2 : 0);
560  error = (n2 != 0 ? sqrt(value * (1 - value) / n2) : 0);
561  hPt_2_ByMuon->setBinContent(i, value);
562  hPt_2_ByMuon->setBinError(i, error);
563 
564  n1 = (double)iGetter_.get(subDir_ + byMuonDir + "/AssocRecoMuonPt_3_ByMuon")->getBinContent(i);
565  n2 = (double)iGetter_.get(subDir_ + byMuonDir + "/RecoMuonPt_3_ByMuon")->getBinContent(i);
566  value = (n2 != 0 ? n1 / n2 : 0);
567  error = (n2 != 0 ? sqrt(value * (1 - value) / n2) : 0);
568  hPt_3_ByMuon->setBinContent(i, value);
569  hPt_3_ByMuon->setBinError(i, error);
570  }
571 
572  for (int i = 1; i <= hEta_1_ByEvent->getNbinsX(); ++i) {
573  double n1 = (double)iGetter_.get(subDir_ + byEventDir + "/LeadAssocRecoMuonEta_1_ByEvent")->getBinContent(i);
574  double n2 = (double)iGetter_.get(subDir_ + byEventDir + "/LeadRecoMuonEta_1_ByEvent")->getBinContent(i);
575  double value = (n2 != 0 ? n1 / n2 : 0);
576  double error = (n2 != 0 ? sqrt(value * (1 - value) / n2) : 0);
577  hEta_1_ByEvent->setBinContent(i, value);
578  hEta_1_ByEvent->setBinError(i, error);
579 
580  n1 = (double)iGetter_.get(subDir_ + byEventDir + "/LeadAssocRecoMuonEta_2_ByEvent")->getBinContent(i);
581  n2 = (double)iGetter_.get(subDir_ + byEventDir + "/LeadRecoMuonEta_2_ByEvent")->getBinContent(i);
582  value = (n2 != 0 ? n1 / n2 : 0);
583  error = (n2 != 0 ? sqrt(value * (1 - value) / n2) : 0);
584  hEta_2_ByEvent->setBinContent(i, value);
585  hEta_2_ByEvent->setBinError(i, error);
586 
587  n1 = (double)iGetter_.get(subDir_ + byEventDir + "/LeadAssocRecoMuonEta_3_ByEvent")->getBinContent(i);
588  n2 = (double)iGetter_.get(subDir_ + byEventDir + "/LeadRecoMuonEta_3_ByEvent")->getBinContent(i);
589  value = (n2 != 0 ? n1 / n2 : 0);
590  error = (n2 != 0 ? sqrt(value * (1 - value) / n2) : 0);
591  hEta_3_ByEvent->setBinContent(i, value);
592  hEta_3_ByEvent->setBinError(i, error);
593 
594  n1 = (double)iGetter_.get(subDir_ + byMuonDir + "/AssocRecoMuonEta_1_ByMuon")->getBinContent(i);
595  n2 = (double)iGetter_.get(subDir_ + byMuonDir + "/RecoMuonEta_1_ByMuon")->getBinContent(i);
596  value = (n2 != 0 ? n1 / n2 : 0);
597  error = (n2 != 0 ? sqrt(value * (1 - value) / n2) : 0);
598  hEta_1_ByMuon->setBinContent(i, value);
599  hEta_1_ByMuon->setBinError(i, error);
600 
601  n1 = (double)iGetter_.get(subDir_ + byMuonDir + "/AssocRecoMuonEta_2_ByMuon")->getBinContent(i);
602  n2 = (double)iGetter_.get(subDir_ + byMuonDir + "/RecoMuonEta_2_ByMuon")->getBinContent(i);
603  value = (n2 != 0 ? n1 / n2 : 0);
604  error = (n2 != 0 ? sqrt(value * (1 - value) / n2) : 0);
605  hEta_2_ByMuon->setBinContent(i, value);
606  hEta_2_ByMuon->setBinError(i, error);
607 
608  n1 = (double)iGetter_.get(subDir_ + byMuonDir + "/AssocRecoMuonEta_3_ByMuon")->getBinContent(i);
609  n2 = (double)iGetter_.get(subDir_ + byMuonDir + "/RecoMuonEta_3_ByMuon")->getBinContent(i);
610  value = (n2 != 0 ? n1 / n2 : 0);
611  error = (n2 != 0 ? sqrt(value * (1 - value) / n2) : 0);
612  hEta_3_ByMuon->setBinContent(i, value);
613  hEta_3_ByMuon->setBinError(i, error);
614  }
615 }
#define LogDebug(id)
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
std::vector< std::string > mc_dirs
virtual int getNbinsX() const
get # of bins in X-axis
T sqrt(T t)
Definition: SSEVec.h:19
Definition: value.py:1
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
virtual double getBinContent(int binx) const
get content of bin (1-D)
virtual void setBinEntries(int bin, double nentries)
set # of bin entries (to be used for profiles)
std::vector< std::string > reco_dirs
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual TProfile * getTProfile() const
virtual void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * bookEffMEProfileFromTH1(TH1F *, std::string, DQMStore::IBooker &)

Member Data Documentation

std::vector<std::string> HltSusyExoPostProcessor::mc_dirs
private

Definition at line 24 of file HltSusyExoPostProcessor.h.

Referenced by dqmEndJob(), and HltSusyExoPostProcessor().

std::vector<edm::ParameterSet> HltSusyExoPostProcessor::mc_parametersets
private

Definition at line 22 of file HltSusyExoPostProcessor.h.

Referenced by HltSusyExoPostProcessor().

bool HltSusyExoPostProcessor::mcFlag
private

Definition at line 20 of file HltSusyExoPostProcessor.h.

Referenced by dqmEndJob().

std::vector<std::string> HltSusyExoPostProcessor::reco_dirs
private

Definition at line 23 of file HltSusyExoPostProcessor.h.

Referenced by dqmEndJob(), and HltSusyExoPostProcessor().

std::vector<edm::ParameterSet> HltSusyExoPostProcessor::reco_parametersets
private

Definition at line 21 of file HltSusyExoPostProcessor.h.

Referenced by HltSusyExoPostProcessor().

std::string HltSusyExoPostProcessor::subDir_
private

Definition at line 19 of file HltSusyExoPostProcessor.h.

Referenced by dqmEndJob().