CMS 3D CMS Logo

TestServiceOne.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Integration
4 // Class : TestServiceOne
5 //
6 // Implementation:
7 // Service initially intended for testing behavior after exceptions.
8 // ExceptionThrowingProducer uses this and is in the same test plugin
9 // library and could be used to access the service if it was ever useful
10 // for debugging issues related to begin/end transitions.
11 //
12 // Original Author: W. David Dagenhart
13 // Created: 13 March 2024
14 
16 
21 
22 namespace edmtest {
23 
25  : verbose_(iPS.getUntrackedParameter<bool>("verbose")) {
28 
33 
38 
43  }
44 
47  desc.addUntracked<bool>("verbose", false)->setComment("Prints LogAbsolute messages if true");
48  descriptions.add("TestServiceOne", desc);
49  }
50 
52  if (verbose_) {
53  edm::LogAbsolute("TestServiceOne") << "test message from TestServiceOne::preBeginProcessBlock";
54  }
55  }
56 
58  if (verbose_) {
59  edm::LogAbsolute("TestServiceOne") << "test message from TestServiceOne::preEndProcessBlock";
60  }
61  }
62 
64  if (verbose_) {
65  edm::LogAbsolute("TestServiceOne") << "test message from TestServiceOne::preGlobalBeginRun";
66  }
67  }
68 
70  if (verbose_) {
71  edm::LogAbsolute("TestServiceOne") << "test message from TestServiceOne::preGlobalEndRun";
72  }
73  }
74 
76  if (verbose_) {
77  edm::LogAbsolute("TestServiceOne") << "test message from TestServiceOne::preGlobalBeginLumi";
78  }
79  }
80 
82  if (verbose_) {
83  edm::LogAbsolute("TestServiceOne") << "test message from TestServiceOne::preGlobalEndLumi";
84  }
85  }
86 
89  if (verbose_) {
90  edm::LogAbsolute("TestServiceOne") << "test message from TestServiceOne::preStreamBeginLumi";
91  }
92  }
93 
96  if (verbose_) {
97  edm::LogAbsolute("TestServiceOne") << "test message from TestServiceOne::postStreamBeginLumi";
98  }
99  }
100 
103  if (verbose_) {
104  edm::LogAbsolute("TestServiceOne") << "test message from TestServiceOne::preStreamEndLumi";
105  }
106  }
107 
110  if (verbose_) {
111  edm::LogAbsolute("TestServiceOne") << "test message from TestServiceOne::postStreamEndLumi";
112  }
113  }
114 
117  if (verbose_) {
118  edm::LogAbsolute("TestServiceOne") << "test message from TestServiceOne::preModuleStreamBeginLumi";
119  }
120  }
121 
124  if (verbose_) {
125  edm::LogAbsolute("TestServiceOne") << "test message from TestServiceOne::postModuleStreamBeginLumi";
126  }
127  }
128 
131  if (verbose_) {
132  edm::LogAbsolute("TestServiceOne") << "test message from TestServiceOne::preModuleStreamEndLumi";
133  }
134  }
135 
138  if (verbose_) {
139  edm::LogAbsolute("TestServiceOne") << "test message from TestServiceOne::postModuleStreamEndLumi";
140  }
141  }
142 
143  unsigned int TestServiceOne::nPreStreamBeginLumi() const { return nPreStreamBeginLumi_.load(); }
144  unsigned int TestServiceOne::nPostStreamBeginLumi() const { return nPostStreamBeginLumi_.load(); }
145  unsigned int TestServiceOne::nPreStreamEndLumi() const { return nPreStreamEndLumi_.load(); }
146  unsigned int TestServiceOne::nPostStreamEndLumi() const { return nPostStreamEndLumi_.load(); }
147 
152 } // namespace edmtest
153 
unsigned int nPreStreamEndLumi() const
std::atomic< unsigned int > nPostStreamEndLumi_
unsigned int nPreStreamBeginLumi() const
void postStreamBeginLumi(edm::StreamContext const &)
void preGlobalEndLumi(edm::GlobalContext const &)
void preModuleStreamBeginLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
void watchPreGlobalEndLumi(PreGlobalEndLumi::slot_type const &iSlot)
void preGlobalBeginRun(edm::GlobalContext const &)
unsigned int nPostModuleStreamEndLumi() const
void watchPostStreamEndLumi(PostStreamEndLumi::slot_type const &iSlot)
void watchPreGlobalBeginLumi(PreGlobalBeginLumi::slot_type const &iSlot)
void watchPostModuleStreamEndLumi(PostModuleStreamEndLumi::slot_type const &iSlot)
std::atomic< unsigned int > nPostStreamBeginLumi_
void preGlobalEndRun(edm::GlobalContext const &)
void watchPreBeginProcessBlock(PreBeginProcessBlock::slot_type const &iSlot)
void watchPreEndProcessBlock(PreEndProcessBlock::slot_type const &iSlot)
void watchPreStreamEndLumi(PreStreamEndLumi::slot_type const &iSlot)
void preEndProcessBlock(edm::GlobalContext const &)
void preStreamBeginLumi(edm::StreamContext const &)
unsigned int nPostModuleStreamBeginLumi() const
void watchPreGlobalEndRun(PreGlobalEndRun::slot_type const &iSlot)
unsigned int nPreModuleStreamBeginLumi() const
TestServiceOne(const edm::ParameterSet &, edm::ActivityRegistry &)
void watchPostStreamBeginLumi(PostStreamBeginLumi::slot_type const &iSlot)
unsigned int nPostStreamBeginLumi() const
void postStreamEndLumi(edm::StreamContext const &)
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
void watchPreModuleStreamBeginLumi(PreModuleStreamBeginLumi::slot_type const &iSlot)
void preStreamEndLumi(edm::StreamContext const &)
#define DEFINE_FWK_SERVICE(type)
Definition: ServiceMaker.h:97
std::atomic< unsigned int > nPostModuleStreamBeginLumi_
void watchPostModuleStreamBeginLumi(PostModuleStreamBeginLumi::slot_type const &iSlot)
void postModuleStreamEndLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
void watchPreModuleStreamEndLumi(PreModuleStreamEndLumi::slot_type const &iSlot)
void watchPreStreamBeginLumi(PreStreamBeginLumi::slot_type const &iSlot)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::atomic< unsigned int > nPreStreamEndLumi_
std::atomic< unsigned int > nPreModuleStreamBeginLumi_
unsigned int nPreModuleStreamEndLumi() const
std::atomic< unsigned int > nPostModuleStreamEndLumi_
std::atomic< unsigned int > nPreModuleStreamEndLumi_
Log< level::System, true > LogAbsolute
void postModuleStreamBeginLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::atomic< unsigned int > nPreStreamBeginLumi_
void preGlobalBeginLumi(edm::GlobalContext const &)
void preBeginProcessBlock(edm::GlobalContext const &)
static void fillDescriptions(edm::ConfigurationDescriptions &)
void preModuleStreamEndLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
unsigned int nPostStreamEndLumi() const