HiggsAnalysis-KITHiggsToTauTau
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
RooWorkspaceWeightProducer.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 //#include "Artus/KappaAnalysis/interface/KappaProducerBase.h"
5 #include "Artus/Core/interface/ProducerBase.h"
6 #include "RooWorkspace.h"
7 #include "RooFunctor.h"
8 #include "TSystem.h"
9 #include <boost/algorithm/string/split.hpp>
10 #include <boost/algorithm/string.hpp>
11 #include "HiggsAnalysis/KITHiggsToTauTau/interface/HttTypes.h"
12 
20 class RooWorkspaceWeightProducer: public ProducerBase<HttTypes> {
21 public:
22 
24  RooWorkspaceWeightProducer(bool (setting_type::*GetSaveRooWorkspaceTriggerWeightAsOptionalOnly)(void) const,
25  std::string (setting_type::*GetRooWorkspace)(void) const,
26  std::vector<std::string>& (setting_type::*GetRooWorkspaceWeightNames)(void) const,
27  std::vector<std::string>& (setting_type::*GetRooWorkspaceObjectNames)(void) const,
28  std::vector<std::string>& (setting_type::*GetRooWorkspaceObjectArguments)(void) const);
29 
30  virtual std::string GetProducerId() const override {
31  return "RooWorkspaceWeightProducer";
32  }
33 
34  virtual void Init(setting_type const& settings, metadata_type& metadata) override;
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  bool (setting_type::*GetSaveRooWorkspaceTriggerWeightAsOptionalOnly)(void) const;
40  std::string (setting_type::*GetRooWorkspace)(void) const;
41  std::vector<std::string>& (setting_type::*GetRooWorkspaceWeightNames)(void) const;
42  std::vector<std::string>& (setting_type::*GetRooWorkspaceObjectNames)(void) const;
43  std::vector<std::string>& (setting_type::*GetRooWorkspaceObjectArguments)(void) const;
44 
45 protected:
47  std::map<int,std::vector<std::string>> m_weightNames;
48  std::map<int,std::vector<std::string>> m_functorArgs;
49  std::map<int,std::vector<RooFunctor*>> m_functors;
50  RooWorkspace *m_workspace;
51 
52 };
53 
55 public:
57 
58  virtual std::string GetProducerId() const override {
59  return "EETriggerWeightProducer";
60  }
61 
62  virtual void Produce(event_type const& event, product_type & product,
63  setting_type const& settings, metadata_type const& metadata) const override;
64 };
65 
67 public:
69 
70  virtual std::string GetProducerId() const override {
71  return "MuMuTriggerWeightProducer";
72  }
73 
74  virtual void Produce(event_type const& event, product_type & product,
75  setting_type const& settings, metadata_type const& metadata) const override;
76 };
77 
79 public:
81 
82  virtual std::string GetProducerId() const override {
83  return "TauTauTriggerWeightProducer";
84  }
85 
86  virtual void Produce(event_type const& event, product_type & product,
87  setting_type const& settings, metadata_type const& metadata) const override;
88 };
89 
91 public:
93 
94  virtual std::string GetProducerId() const override {
95  return "MuTauTriggerWeightProducer";
96  }
97 
98  virtual void Produce(event_type const& event, product_type & product,
99  setting_type const& settings, metadata_type const& metadata) const override;
100 };
MuMuTriggerWeightProducer()
Definition: RooWorkspaceWeightProducer.cc:182
RooWorkspaceWeightProducer Config tags:
Definition: RooWorkspaceWeightProducer.h:20
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: RooWorkspaceWeightProducer.cc:240
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: RooWorkspaceWeightProducer.cc:191
TauTauTriggerWeightProducer()
Definition: RooWorkspaceWeightProducer.cc:231
bool m_saveTriggerWeightAsOptionalOnly
Definition: RooWorkspaceWeightProducer.h:46
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: RooWorkspaceWeightProducer.cc:141
virtual std::string GetProducerId() const override
Definition: RooWorkspaceWeightProducer.h:82
std::map< int, std::vector< std::string > > m_functorArgs
Definition: RooWorkspaceWeightProducer.h:48
RooWorkspaceWeightProducer()
Definition: RooWorkspaceWeightProducer.cc:23
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: RooWorkspaceWeightProducer.cc:64
std::map< int, std::vector< RooFunctor * > > m_functors
Definition: RooWorkspaceWeightProducer.h:49
Definition: RooWorkspaceWeightProducer.h:78
EETriggerWeightProducer()
Definition: RooWorkspaceWeightProducer.cc:132
Definition: RooWorkspaceWeightProducer.h:54
Definition: RooWorkspaceWeightProducer.h:90
MuTauTriggerWeightProducer()
Definition: RooWorkspaceWeightProducer.cc:311
Definition: RooWorkspaceWeightProducer.h:66
RooWorkspace * m_workspace
Definition: RooWorkspaceWeightProducer.h:50
virtual std::string GetProducerId() const override
Definition: RooWorkspaceWeightProducer.h:94
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: RooWorkspaceWeightProducer.cc:32
virtual std::string GetProducerId() const override
Definition: RooWorkspaceWeightProducer.h:70
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: RooWorkspaceWeightProducer.cc:320
virtual std::string GetProducerId() const override
Definition: RooWorkspaceWeightProducer.h:30
virtual std::string GetProducerId() const override
Definition: RooWorkspaceWeightProducer.h:58
std::map< int, std::vector< std::string > > m_weightNames
Definition: RooWorkspaceWeightProducer.h:47