HiggsAnalysis-KITHiggsToTauTau
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
TauTauTriggerScaleFactorProducer.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 TauTauTriggerScaleFactorProducer: 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_functorTau1 = m_workspace->function("t_trgTightIso_data")->functor(m_workspace->argSet("t_pt"));
34  m_functorTau1ss = m_workspace->function("t_trgTightIsoSS_data")->functor(m_workspace->argSet("t_pt"));
35  }
36 
37  virtual void Produce(event_type const& event, product_type & product,
38  setting_type const& settings, metadata_type const& metadata) const override;
39 private:
40  RooWorkspace *m_workspace;
41  RooFunctor* m_functorTau1;
42  RooFunctor* m_functorTau1ss;
43 
44 
45 };
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: TauTauTriggerScaleFactorProducer.cc:11
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: TauTauTriggerScaleFactorProducer.h:22
tuple f
Definition: convertEfficienciesToArtusRootInput.py:62
std::string GetProducerId() const
Definition: TauTauTriggerScaleFactorProducer.cc:6
TauTauTriggerScaleFactorProducer Config tags:
Definition: TauTauTriggerScaleFactorProducer.h:17