HiggsAnalysis-KITHiggsToTauTau
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
MuMuTriggerScaleFactorProducer.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "Artus/Core/interface/ProducerBase.h"
5 #include "HiggsAnalysis/KITHiggsToTauTau/interface/HttTypes.h"
6 #include "RooWorkspace.h"
7 #include "RooFunctor.h"
8 #include "TSystem.h"
9 
17 class MuMuTriggerScaleFactorProducer: public ProducerBase<HttTypes> {
18 public:
19 
20  std::string GetProducerId() const;
21 
22  virtual void Init(setting_type const& settings, metadata_type& metadata) override
23  {
24  ProducerBase<HttTypes>::Init(settings, metadata);
25  TDirectory *savedir(gDirectory);
26  TFile *savefile(gFile);
27  TFile f(settings.GetRooWorkspace().c_str());
28  gSystem->AddIncludePath("-I$ROOFITSYS/include");
29  m_workspace = (RooWorkspace*)f.Get("w");
30  f.Close();
31  gDirectory = savedir;
32  gFile = savefile;
33  m_functorMu = m_workspace->function("m_trgIsoMu22orTkIsoMu22_desy_data")->functor(m_workspace->argSet("m_pt,m_eta"));
34  }
35 
36  virtual void Produce(event_type const& event, product_type & product,
37  setting_type const& settings, metadata_type const& metadata) const override;
38 private:
39  RooWorkspace *m_workspace;
40  RooFunctor* m_functorMu;
41 
42 
43 };
MuMuTriggerScaleFactorProducer Config tags:
Definition: MuMuTriggerScaleFactorProducer.h:17
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: MuMuTriggerScaleFactorProducer.h:22
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: MuMuTriggerScaleFactorProducer.cc:11
std::string GetProducerId() const
Definition: MuMuTriggerScaleFactorProducer.cc:6
tuple f
Definition: convertEfficienciesToArtusRootInput.py:62