Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-07-28 22:48:27

0001 // -*- C++ -*-
0002 //
0003 // Package:     FWCore/Integration
0004 // Class  :     TestServiceOne
0005 //
0006 // Implementation:
0007 //     Service initially intended for testing behavior after exceptions.
0008 //     ExceptionThrowingProducer uses this and is in the same test plugin
0009 //     library and could be used to access the service if it was ever useful
0010 //     for debugging issues related to begin/end transitions.
0011 //
0012 // Original Author:  W. David Dagenhart
0013 //         Created:  13 March 2024
0014 
0015 #include "FWCore/Integration/plugins/TestServiceOne.h"
0016 
0017 #include "DataFormats/Provenance/interface/ModuleDescription.h"
0018 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0019 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0020 #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
0021 #include "FWCore/ServiceRegistry/interface/GlobalContext.h"
0022 #include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h"
0023 #include "FWCore/ServiceRegistry/interface/ServiceMaker.h"
0024 #include "FWCore/ServiceRegistry/interface/StreamContext.h"
0025 #include "FWCore/Utilities/interface/TimeOfDay.h"
0026 
0027 #include <ostream>
0028 
0029 using edm::GlobalContext;
0030 using edm::ModuleCallingContext;
0031 using edm::StreamContext;
0032 
0033 namespace {
0034 
0035   class TimeStamper {
0036   public:
0037     TimeStamper(bool enable) : enabled_(enable) {}
0038 
0039     friend std::ostream& operator<<(std::ostream& out, TimeStamper const& timestamp) {
0040       if (timestamp.enabled_)
0041         out << std::setprecision(2) << edm::TimeOfDay() << "  ";
0042       return out;
0043     }
0044 
0045   private:
0046     bool enabled_;
0047   };
0048 
0049   const char* globalIndent = "    ";
0050   const char* globalModuleIndent = "        ";
0051   const char* streamIndent = "            ";
0052   const char* streamModuleIndent = "                ";
0053 }  // namespace
0054 
0055 namespace edmtest {
0056 
0057   TestServiceOne::TestServiceOne(edm::ParameterSet const& iPS, edm::ActivityRegistry& iRegistry)
0058       : verbose_(iPS.getUntrackedParameter<bool>("verbose")),
0059         printTimestamps_(iPS.getUntrackedParameter<bool>("printTimestamps")) {
0060     iRegistry.watchPreBeginJob(this, &TestServiceOne::preBeginJob);
0061     iRegistry.watchPostBeginJob(this, &TestServiceOne::postBeginJob);
0062     iRegistry.watchPreEndJob(this, &TestServiceOne::preEndJob);
0063     iRegistry.watchPostEndJob(this, &TestServiceOne::postEndJob);
0064 
0065     iRegistry.watchPreModuleBeginJob(this, &TestServiceOne::preModuleBeginJob);
0066     iRegistry.watchPostModuleBeginJob(this, &TestServiceOne::postModuleBeginJob);
0067     iRegistry.watchPreModuleEndJob(this, &TestServiceOne::preModuleEndJob);
0068     iRegistry.watchPostModuleEndJob(this, &TestServiceOne::postModuleEndJob);
0069 
0070     iRegistry.watchPreBeginStream(this, &TestServiceOne::preBeginStream);
0071     iRegistry.watchPostBeginStream(this, &TestServiceOne::postBeginStream);
0072     iRegistry.watchPreEndStream(this, &TestServiceOne::preEndStream);
0073     iRegistry.watchPostEndStream(this, &TestServiceOne::postEndStream);
0074 
0075     iRegistry.watchPreModuleBeginStream(this, &TestServiceOne::preModuleBeginStream);
0076     iRegistry.watchPostModuleBeginStream(this, &TestServiceOne::postModuleBeginStream);
0077     iRegistry.watchPreModuleEndStream(this, &TestServiceOne::preModuleEndStream);
0078     iRegistry.watchPostModuleEndStream(this, &TestServiceOne::postModuleEndStream);
0079 
0080     iRegistry.watchPreBeginProcessBlock(this, &TestServiceOne::preBeginProcessBlock);
0081     iRegistry.watchPostBeginProcessBlock(this, &TestServiceOne::postBeginProcessBlock);
0082     iRegistry.watchPreEndProcessBlock(this, &TestServiceOne::preEndProcessBlock);
0083     iRegistry.watchPostEndProcessBlock(this, &TestServiceOne::postEndProcessBlock);
0084 
0085     iRegistry.watchPreModuleBeginProcessBlock(this, &TestServiceOne::preModuleBeginProcessBlock);
0086     iRegistry.watchPostModuleBeginProcessBlock(this, &TestServiceOne::postModuleBeginProcessBlock);
0087     iRegistry.watchPreModuleEndProcessBlock(this, &TestServiceOne::preModuleEndProcessBlock);
0088     iRegistry.watchPostModuleEndProcessBlock(this, &TestServiceOne::postModuleEndProcessBlock);
0089 
0090     iRegistry.watchPreStreamBeginLumi(this, &TestServiceOne::preStreamBeginLumi);
0091     iRegistry.watchPostStreamBeginLumi(this, &TestServiceOne::postStreamBeginLumi);
0092     iRegistry.watchPreStreamEndLumi(this, &TestServiceOne::preStreamEndLumi);
0093     iRegistry.watchPostStreamEndLumi(this, &TestServiceOne::postStreamEndLumi);
0094 
0095     iRegistry.watchPreModuleStreamBeginLumi(this, &TestServiceOne::preModuleStreamBeginLumi);
0096     iRegistry.watchPostModuleStreamBeginLumi(this, &TestServiceOne::postModuleStreamBeginLumi);
0097     iRegistry.watchPreModuleStreamEndLumi(this, &TestServiceOne::preModuleStreamEndLumi);
0098     iRegistry.watchPostModuleStreamEndLumi(this, &TestServiceOne::postModuleStreamEndLumi);
0099 
0100     iRegistry.watchPreGlobalBeginLumi(this, &TestServiceOne::preGlobalBeginLumi);
0101     iRegistry.watchPostGlobalBeginLumi(this, &TestServiceOne::postGlobalBeginLumi);
0102     iRegistry.watchPreGlobalEndLumi(this, &TestServiceOne::preGlobalEndLumi);
0103     iRegistry.watchPostGlobalEndLumi(this, &TestServiceOne::postGlobalEndLumi);
0104 
0105     iRegistry.watchPreModuleGlobalBeginLumi(this, &TestServiceOne::preModuleGlobalBeginLumi);
0106     iRegistry.watchPostModuleGlobalBeginLumi(this, &TestServiceOne::postModuleGlobalBeginLumi);
0107     iRegistry.watchPreModuleGlobalEndLumi(this, &TestServiceOne::preModuleGlobalEndLumi);
0108     iRegistry.watchPostModuleGlobalEndLumi(this, &TestServiceOne::postModuleGlobalEndLumi);
0109 
0110     iRegistry.watchPreGlobalWriteLumi(this, &TestServiceOne::preGlobalWriteLumi);
0111     iRegistry.watchPostGlobalWriteLumi(this, &TestServiceOne::postGlobalWriteLumi);
0112 
0113     iRegistry.watchPreStreamBeginRun(this, &TestServiceOne::preStreamBeginRun);
0114     iRegistry.watchPostStreamBeginRun(this, &TestServiceOne::postStreamBeginRun);
0115     iRegistry.watchPreStreamEndRun(this, &TestServiceOne::preStreamEndRun);
0116     iRegistry.watchPostStreamEndRun(this, &TestServiceOne::postStreamEndRun);
0117 
0118     iRegistry.watchPreModuleStreamBeginRun(this, &TestServiceOne::preModuleStreamBeginRun);
0119     iRegistry.watchPostModuleStreamBeginRun(this, &TestServiceOne::postModuleStreamBeginRun);
0120     iRegistry.watchPreModuleStreamEndRun(this, &TestServiceOne::preModuleStreamEndRun);
0121     iRegistry.watchPostModuleStreamEndRun(this, &TestServiceOne::postModuleStreamEndRun);
0122 
0123     iRegistry.watchPreGlobalBeginRun(this, &TestServiceOne::preGlobalBeginRun);
0124     iRegistry.watchPostGlobalBeginRun(this, &TestServiceOne::postGlobalBeginRun);
0125     iRegistry.watchPreGlobalEndRun(this, &TestServiceOne::preGlobalEndRun);
0126     iRegistry.watchPostGlobalEndRun(this, &TestServiceOne::postGlobalEndRun);
0127 
0128     iRegistry.watchPreModuleGlobalBeginRun(this, &TestServiceOne::preModuleGlobalBeginRun);
0129     iRegistry.watchPostModuleGlobalBeginRun(this, &TestServiceOne::postModuleGlobalBeginRun);
0130     iRegistry.watchPreModuleGlobalEndRun(this, &TestServiceOne::preModuleGlobalEndRun);
0131     iRegistry.watchPostModuleGlobalEndRun(this, &TestServiceOne::postModuleGlobalEndRun);
0132 
0133     iRegistry.watchPreGlobalWriteRun(this, &TestServiceOne::preGlobalWriteRun);
0134     iRegistry.watchPostGlobalWriteRun(this, &TestServiceOne::postGlobalWriteRun);
0135   }
0136 
0137   void TestServiceOne::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0138     edm::ParameterSetDescription desc;
0139     desc.addUntracked<bool>("verbose", false)->setComment("Prints LogAbsolute messages for every transition");
0140     desc.addUntracked<bool>("printTimestamps", false)
0141         ->setComment("Include a time stamp in message printed for every transition");
0142     descriptions.add("TestServiceOne", desc);
0143   }
0144 
0145   void TestServiceOne::preBeginJob(edm::PathsAndConsumesOfModulesBase const&, edm::ProcessContext const&) {
0146     ++nPreBeginJob_;
0147     if (verbose_) {
0148       edm::LogAbsolute out("TestServiceOne");
0149       out << globalIndent << "TestServiceOne::preBeginJob " << TimeStamper(printTimestamps_);
0150     }
0151   }
0152 
0153   void TestServiceOne::postBeginJob() {
0154     ++nPostBeginJob_;
0155     if (verbose_) {
0156       edm::LogAbsolute out("TestServiceOne");
0157       out << globalIndent << "TestServiceOne::postBeginJob " << TimeStamper(printTimestamps_);
0158     }
0159   }
0160 
0161   void TestServiceOne::preEndJob() {
0162     ++nPreEndJob_;
0163     if (verbose_) {
0164       edm::LogAbsolute out("TestServiceOne");
0165       out << globalIndent << "TestServiceOne::preEndJob " << TimeStamper(printTimestamps_);
0166     }
0167   }
0168 
0169   void TestServiceOne::postEndJob() {
0170     ++nPostEndJob_;
0171     if (verbose_) {
0172       edm::LogAbsolute out("TestServiceOne");
0173       out << globalIndent << "TestServiceOne::postEndJob " << TimeStamper(printTimestamps_);
0174     }
0175   }
0176 
0177   void TestServiceOne::preModuleBeginJob(edm::ModuleDescription const& desc) {
0178     ++nPreModuleBeginJob_;
0179     if (verbose_) {
0180       edm::LogAbsolute out("TestServiceOne");
0181       out << globalModuleIndent << "TestServiceOne::preModuleBeginJob " << TimeStamper(printTimestamps_)
0182           << " label = " << desc.moduleLabel();
0183     }
0184   }
0185 
0186   void TestServiceOne::postModuleBeginJob(edm::ModuleDescription const& desc) {
0187     ++nPostModuleBeginJob_;
0188     if (verbose_) {
0189       edm::LogAbsolute out("TestServiceOne");
0190       out << globalModuleIndent << "TestServiceOne::postModuleBeginJob " << TimeStamper(printTimestamps_)
0191           << " label = " << desc.moduleLabel();
0192     }
0193   }
0194 
0195   void TestServiceOne::preModuleEndJob(edm::ModuleDescription const& desc) {
0196     ++nPreModuleEndJob_;
0197     if (verbose_) {
0198       edm::LogAbsolute out("TestServiceOne");
0199       out << globalModuleIndent << "TestServiceOne::preModuleEndJob " << TimeStamper(printTimestamps_)
0200           << " label = " << desc.moduleLabel();
0201     }
0202   }
0203 
0204   void TestServiceOne::postModuleEndJob(edm::ModuleDescription const& desc) {
0205     ++nPostModuleEndJob_;
0206     if (verbose_) {
0207       edm::LogAbsolute out("TestServiceOne");
0208       out << globalModuleIndent << "TestServiceOne::postModuleEndJob " << TimeStamper(printTimestamps_)
0209           << " label = " << desc.moduleLabel();
0210     }
0211   }
0212 
0213   void TestServiceOne::preBeginStream(edm::StreamContext const& sc) {
0214     ++nPreBeginStream_;
0215     if (verbose_) {
0216       edm::LogAbsolute out("TestServiceOne");
0217       out << streamIndent << "TestServiceOne::preBeginStream " << TimeStamper(printTimestamps_)
0218           << " stream = " << sc.streamID();
0219     }
0220   }
0221 
0222   void TestServiceOne::postBeginStream(edm::StreamContext const& sc) {
0223     ++nPostBeginStream_;
0224     if (verbose_) {
0225       edm::LogAbsolute out("TestServiceOne");
0226       out << streamIndent << "TestServiceOne::postBeginStream " << TimeStamper(printTimestamps_)
0227           << " stream = " << sc.streamID();
0228     }
0229   }
0230 
0231   void TestServiceOne::preEndStream(edm::StreamContext const& sc) {
0232     ++nPreEndStream_;
0233     if (verbose_) {
0234       edm::LogAbsolute out("TestServiceOne");
0235       out << streamIndent << "TestServiceOne::preEndStream " << TimeStamper(printTimestamps_)
0236           << " stream = " << sc.streamID();
0237     }
0238   }
0239 
0240   void TestServiceOne::postEndStream(edm::StreamContext const& sc) {
0241     ++nPostEndStream_;
0242     if (verbose_) {
0243       edm::LogAbsolute out("TestServiceOne");
0244       out << streamIndent << "TestServiceOne::postEndStream " << TimeStamper(printTimestamps_)
0245           << " stream = " << sc.streamID();
0246     }
0247   }
0248 
0249   void TestServiceOne::preModuleBeginStream(edm::StreamContext const& sc, edm::ModuleCallingContext const& mcc) {
0250     ++nPreModuleBeginStream_;
0251     if (verbose_) {
0252       edm::LogAbsolute out("TestServiceOne");
0253       out << streamModuleIndent << "TestServiceOne::preModuleBeginStream " << TimeStamper(printTimestamps_)
0254           << " stream = " << sc.streamID() << " label = " << mcc.moduleDescription()->moduleLabel();
0255     }
0256   }
0257 
0258   void TestServiceOne::postModuleBeginStream(edm::StreamContext const& sc, edm::ModuleCallingContext const& mcc) {
0259     ++nPostModuleBeginStream_;
0260     if (verbose_) {
0261       edm::LogAbsolute out("TestServiceOne");
0262       out << streamModuleIndent << "TestServiceOne::postModuleBeginStream " << TimeStamper(printTimestamps_)
0263           << " stream = " << sc.streamID() << " label = " << mcc.moduleDescription()->moduleLabel();
0264     }
0265   }
0266 
0267   void TestServiceOne::preModuleEndStream(edm::StreamContext const& sc, edm::ModuleCallingContext const& mcc) {
0268     ++nPreModuleEndStream_;
0269     if (verbose_) {
0270       edm::LogAbsolute out("TestServiceOne");
0271       out << streamModuleIndent << "TestServiceOne::preModuleEndStream " << TimeStamper(printTimestamps_)
0272           << " stream = " << sc.streamID() << " label = " << mcc.moduleDescription()->moduleLabel();
0273     }
0274   }
0275 
0276   void TestServiceOne::postModuleEndStream(edm::StreamContext const& sc, edm::ModuleCallingContext const& mcc) {
0277     ++nPostModuleEndStream_;
0278     if (verbose_) {
0279       edm::LogAbsolute out("TestServiceOne");
0280       out << streamModuleIndent << "TestServiceOne::postModuleEndStream " << TimeStamper(printTimestamps_)
0281           << " stream = " << sc.streamID() << " label = " << mcc.moduleDescription()->moduleLabel();
0282     }
0283   }
0284 
0285   void TestServiceOne::preBeginProcessBlock(edm::GlobalContext const&) {
0286     ++nPreBeginProcessBlock_;
0287     if (verbose_) {
0288       edm::LogAbsolute out("TestServiceOne");
0289       out << globalIndent << "TestServiceOne::preBeginProcessBlock " << TimeStamper(printTimestamps_);
0290     }
0291   }
0292 
0293   void TestServiceOne::postBeginProcessBlock(edm::GlobalContext const&) {
0294     ++nPostBeginProcessBlock_;
0295     if (verbose_) {
0296       edm::LogAbsolute out("TestServiceOne");
0297       out << globalIndent << "TestServiceOne::postBeginProcessBlock " << TimeStamper(printTimestamps_);
0298     }
0299   }
0300 
0301   void TestServiceOne::preEndProcessBlock(edm::GlobalContext const&) {
0302     ++nPreEndProcessBlock_;
0303     if (verbose_) {
0304       edm::LogAbsolute out("TestServiceOne");
0305       out << globalIndent << "TestServiceOne::preEndProcessBlock " << TimeStamper(printTimestamps_);
0306     }
0307   }
0308 
0309   void TestServiceOne::postEndProcessBlock(edm::GlobalContext const&) {
0310     ++nPostEndProcessBlock_;
0311     if (verbose_) {
0312       edm::LogAbsolute out("TestServiceOne");
0313       out << globalIndent << "TestServiceOne::postEndProcessBlock " << TimeStamper(printTimestamps_);
0314     }
0315   }
0316 
0317   void TestServiceOne::preModuleBeginProcessBlock(edm::GlobalContext const&, edm::ModuleCallingContext const& mcc) {
0318     ++nPreModuleBeginProcessBlock_;
0319     if (verbose_) {
0320       edm::LogAbsolute out("TestServiceOne");
0321       out << globalModuleIndent << "TestServiceOne::preModuleBeginProcessBlock " << TimeStamper(printTimestamps_)
0322           << " label = " << mcc.moduleDescription()->moduleLabel();
0323     }
0324   }
0325 
0326   void TestServiceOne::postModuleBeginProcessBlock(edm::GlobalContext const&, edm::ModuleCallingContext const& mcc) {
0327     ++nPostModuleBeginProcessBlock_;
0328     if (verbose_) {
0329       edm::LogAbsolute out("TestServiceOne");
0330       out << globalModuleIndent << "TestServiceOne::postModuleBeginProcessBlock " << TimeStamper(printTimestamps_)
0331           << " label = " << mcc.moduleDescription()->moduleLabel();
0332     }
0333   }
0334 
0335   void TestServiceOne::preModuleEndProcessBlock(edm::GlobalContext const&, edm::ModuleCallingContext const& mcc) {
0336     ++nPreModuleEndProcessBlock_;
0337     if (verbose_) {
0338       edm::LogAbsolute out("TestServiceOne");
0339       out << globalModuleIndent << "TestServiceOne::preModuleEndProcessBlock " << TimeStamper(printTimestamps_)
0340           << " label = " << mcc.moduleDescription()->moduleLabel();
0341     }
0342   }
0343 
0344   void TestServiceOne::postModuleEndProcessBlock(edm::GlobalContext const&, edm::ModuleCallingContext const& mcc) {
0345     ++nPostModuleEndProcessBlock_;
0346     if (verbose_) {
0347       edm::LogAbsolute out("TestServiceOne");
0348       out << globalModuleIndent << "TestServiceOne::postModuleEndProcessBlock " << TimeStamper(printTimestamps_)
0349           << " label = " << mcc.moduleDescription()->moduleLabel();
0350     }
0351   }
0352 
0353   void TestServiceOne::preStreamBeginLumi(StreamContext const& sc) {
0354     ++nPreStreamBeginLumi_;
0355     if (verbose_) {
0356       edm::LogAbsolute out("TestServiceOne");
0357       out << streamIndent << "TestServiceOne::preStreamBeginLumi " << TimeStamper(printTimestamps_)
0358           << " stream = " << sc.streamID() << " run = " << sc.eventID().run()
0359           << " lumi = " << sc.eventID().luminosityBlock();
0360     }
0361   }
0362 
0363   void TestServiceOne::postStreamBeginLumi(StreamContext const& sc) {
0364     ++nPostStreamBeginLumi_;
0365     if (verbose_) {
0366       edm::LogAbsolute out("TestServiceOne");
0367       out << streamIndent << "TestServiceOne::postStreamBeginLumi " << TimeStamper(printTimestamps_)
0368           << " stream = " << sc.streamID() << " run = " << sc.eventID().run()
0369           << " lumi = " << sc.eventID().luminosityBlock();
0370     }
0371   }
0372 
0373   void TestServiceOne::preStreamEndLumi(StreamContext const& sc) {
0374     ++nPreStreamEndLumi_;
0375     if (verbose_) {
0376       edm::LogAbsolute out("TestServiceOne");
0377       out << streamIndent << "TestServiceOne::preStreamEndLumi " << TimeStamper(printTimestamps_)
0378           << " stream = " << sc.streamID() << " run = " << sc.eventID().run()
0379           << " lumi = " << sc.eventID().luminosityBlock();
0380     }
0381   }
0382 
0383   void TestServiceOne::postStreamEndLumi(StreamContext const& sc) {
0384     ++nPostStreamEndLumi_;
0385     if (verbose_) {
0386       edm::LogAbsolute out("TestServiceOne");
0387       out << streamIndent << "TestServiceOne::postStreamEndLumi " << TimeStamper(printTimestamps_)
0388           << " stream = " << sc.streamID() << " run = " << sc.eventID().run()
0389           << " lumi = " << sc.eventID().luminosityBlock();
0390     }
0391   }
0392 
0393   void TestServiceOne::preModuleStreamBeginLumi(StreamContext const& sc, ModuleCallingContext const& mcc) {
0394     ++nPreModuleStreamBeginLumi_;
0395     if (verbose_) {
0396       edm::LogAbsolute out("TestServiceOne");
0397       out << streamModuleIndent << "TestServiceOne::preModuleStreamBeginLumi " << TimeStamper(printTimestamps_)
0398           << " stream = " << sc.streamID() << " label = " << mcc.moduleDescription()->moduleLabel()
0399           << " run = " << sc.eventID().run() << " lumi = " << sc.eventID().luminosityBlock();
0400     }
0401   }
0402 
0403   void TestServiceOne::postModuleStreamBeginLumi(StreamContext const& sc, ModuleCallingContext const& mcc) {
0404     ++nPostModuleStreamBeginLumi_;
0405     if (verbose_) {
0406       edm::LogAbsolute out("TestServiceOne");
0407       out << streamModuleIndent << "TestServiceOne::postModuleStreamBeginLumi " << TimeStamper(printTimestamps_)
0408           << " stream = " << sc.streamID() << " label = " << mcc.moduleDescription()->moduleLabel()
0409           << " run = " << sc.eventID().run() << " lumi = " << sc.eventID().luminosityBlock();
0410     }
0411   }
0412 
0413   void TestServiceOne::preModuleStreamEndLumi(StreamContext const& sc, ModuleCallingContext const& mcc) {
0414     ++nPreModuleStreamEndLumi_;
0415     if (verbose_) {
0416       edm::LogAbsolute out("TestServiceOne");
0417       out << streamModuleIndent << "TestServiceOne::preModuleStreamEndLumi " << TimeStamper(printTimestamps_)
0418           << " stream = " << sc.streamID() << " label = " << mcc.moduleDescription()->moduleLabel()
0419           << " run = " << sc.eventID().run() << " lumi = " << sc.eventID().luminosityBlock();
0420     }
0421   }
0422 
0423   void TestServiceOne::postModuleStreamEndLumi(StreamContext const& sc, ModuleCallingContext const& mcc) {
0424     ++nPostModuleStreamEndLumi_;
0425     if (verbose_) {
0426       edm::LogAbsolute out("TestServiceOne");
0427       out << streamModuleIndent << "TestServiceOne::postModuleStreamEndLumi " << TimeStamper(printTimestamps_)
0428           << " stream = " << sc.streamID() << " label = " << mcc.moduleDescription()->moduleLabel()
0429           << " run = " << sc.eventID().run() << " lumi = " << sc.eventID().luminosityBlock();
0430     }
0431   }
0432 
0433   void TestServiceOne::preGlobalBeginLumi(GlobalContext const& gc) {
0434     ++nPreGlobalBeginLumi_;
0435     if (verbose_) {
0436       edm::LogAbsolute out("TestServiceOne");
0437       out << globalIndent << "TestServiceOne::preGlobalBeginLumi " << TimeStamper(printTimestamps_)
0438           << " run = " << gc.luminosityBlockID().run() << " lumi = " << gc.luminosityBlockID().luminosityBlock();
0439     }
0440   }
0441 
0442   void TestServiceOne::postGlobalBeginLumi(GlobalContext const& gc) {
0443     ++nPostGlobalBeginLumi_;
0444     if (verbose_) {
0445       edm::LogAbsolute out("TestServiceOne");
0446       out << globalIndent << "TestServiceOne::postGlobalBeginLumi " << TimeStamper(printTimestamps_)
0447           << " run = " << gc.luminosityBlockID().run() << " lumi = " << gc.luminosityBlockID().luminosityBlock();
0448     }
0449   }
0450 
0451   void TestServiceOne::preGlobalEndLumi(GlobalContext const& gc) {
0452     ++nPreGlobalEndLumi_;
0453     if (verbose_) {
0454       edm::LogAbsolute out("TestServiceOne");
0455       out << globalIndent << "TestServiceOne::preGlobalEndLumi " << TimeStamper(printTimestamps_)
0456           << " run = " << gc.luminosityBlockID().run() << " lumi = " << gc.luminosityBlockID().luminosityBlock();
0457     }
0458   }
0459 
0460   void TestServiceOne::postGlobalEndLumi(GlobalContext const& gc) {
0461     ++nPostGlobalEndLumi_;
0462     if (verbose_) {
0463       edm::LogAbsolute out("TestServiceOne");
0464       out << globalIndent << "TestServiceOne::postGlobalEndLumi " << TimeStamper(printTimestamps_)
0465           << " run = " << gc.luminosityBlockID().run() << " lumi = " << gc.luminosityBlockID().luminosityBlock();
0466     }
0467   }
0468 
0469   void TestServiceOne::preModuleGlobalBeginLumi(GlobalContext const& gc, ModuleCallingContext const& mcc) {
0470     ++nPreModuleGlobalBeginLumi_;
0471     if (verbose_) {
0472       edm::LogAbsolute out("TestServiceOne");
0473       out << globalModuleIndent << "TestServiceOne::preModuleGlobalBeginLumi " << TimeStamper(printTimestamps_)
0474           << " label = " << mcc.moduleDescription()->moduleLabel() << " run = " << gc.luminosityBlockID().run()
0475           << " lumi = " << gc.luminosityBlockID().luminosityBlock();
0476     }
0477   }
0478 
0479   void TestServiceOne::postModuleGlobalBeginLumi(GlobalContext const& gc, ModuleCallingContext const& mcc) {
0480     ++nPostModuleGlobalBeginLumi_;
0481     if (verbose_) {
0482       edm::LogAbsolute out("TestServiceOne");
0483       out << globalModuleIndent << "TestServiceOne::postModuleGlobalBeginLumi " << TimeStamper(printTimestamps_)
0484           << " label = " << mcc.moduleDescription()->moduleLabel() << " run = " << gc.luminosityBlockID().run()
0485           << " lumi = " << gc.luminosityBlockID().luminosityBlock();
0486     }
0487   }
0488 
0489   void TestServiceOne::preModuleGlobalEndLumi(GlobalContext const& gc, ModuleCallingContext const& mcc) {
0490     ++nPreModuleGlobalEndLumi_;
0491     if (verbose_) {
0492       edm::LogAbsolute out("TestServiceOne");
0493       out << globalModuleIndent << "TestServiceOne::preModuleGlobalEndLumi " << TimeStamper(printTimestamps_)
0494           << " label = " << mcc.moduleDescription()->moduleLabel() << " run = " << gc.luminosityBlockID().run()
0495           << " lumi = " << gc.luminosityBlockID().luminosityBlock();
0496     }
0497   }
0498 
0499   void TestServiceOne::postModuleGlobalEndLumi(GlobalContext const& gc, ModuleCallingContext const& mcc) {
0500     ++nPostModuleGlobalEndLumi_;
0501     if (verbose_) {
0502       edm::LogAbsolute out("TestServiceOne");
0503       out << globalModuleIndent << "TestServiceOne::postModuleGlobalEndLumi " << TimeStamper(printTimestamps_)
0504           << " label = " << mcc.moduleDescription()->moduleLabel() << " run = " << gc.luminosityBlockID().run()
0505           << " lumi = " << gc.luminosityBlockID().luminosityBlock();
0506     }
0507   }
0508 
0509   void TestServiceOne::preGlobalWriteLumi(GlobalContext const& gc) {
0510     ++nPreGlobalWriteLumi_;
0511     if (verbose_) {
0512       edm::LogAbsolute out("TestServiceOne");
0513       out << globalIndent << "TestServiceOne::preGlobalWriteLumi " << TimeStamper(printTimestamps_)
0514           << " run = " << gc.luminosityBlockID().run() << " lumi = " << gc.luminosityBlockID().luminosityBlock();
0515     }
0516   }
0517 
0518   void TestServiceOne::postGlobalWriteLumi(GlobalContext const& gc) {
0519     ++nPostGlobalWriteLumi_;
0520     if (verbose_) {
0521       edm::LogAbsolute out("TestServiceOne");
0522       out << globalIndent << "TestServiceOne::postGlobalWriteLumi " << TimeStamper(printTimestamps_)
0523           << " run = " << gc.luminosityBlockID().run() << " lumi = " << gc.luminosityBlockID().luminosityBlock();
0524     }
0525   }
0526 
0527   void TestServiceOne::preStreamBeginRun(StreamContext const& sc) {
0528     ++nPreStreamBeginRun_;
0529     if (verbose_) {
0530       edm::LogAbsolute out("TestServiceOne");
0531       out << streamIndent << "TestServiceOne::preStreamBeginRun " << TimeStamper(printTimestamps_)
0532           << " stream = " << sc.streamID() << " run = " << sc.eventID().run();
0533     }
0534   }
0535 
0536   void TestServiceOne::postStreamBeginRun(StreamContext const& sc) {
0537     ++nPostStreamBeginRun_;
0538     if (verbose_) {
0539       edm::LogAbsolute out("TestServiceOne");
0540       out << streamIndent << "TestServiceOne::postStreamBeginRun " << TimeStamper(printTimestamps_)
0541           << " stream = " << sc.streamID() << " run = " << sc.eventID().run();
0542     }
0543   }
0544 
0545   void TestServiceOne::preStreamEndRun(StreamContext const& sc) {
0546     ++nPreStreamEndRun_;
0547     if (verbose_) {
0548       edm::LogAbsolute out("TestServiceOne");
0549       out << streamIndent << "TestServiceOne::preStreamEndRun " << TimeStamper(printTimestamps_)
0550           << " stream = " << sc.streamID() << " run = " << sc.eventID().run();
0551     }
0552   }
0553 
0554   void TestServiceOne::postStreamEndRun(StreamContext const& sc) {
0555     ++nPostStreamEndRun_;
0556     if (verbose_) {
0557       edm::LogAbsolute out("TestServiceOne");
0558       out << streamIndent << "TestServiceOne::postStreamEndRun " << TimeStamper(printTimestamps_)
0559           << " stream = " << sc.streamID() << " run = " << sc.eventID().run();
0560     }
0561   }
0562 
0563   void TestServiceOne::preModuleStreamBeginRun(StreamContext const& sc, ModuleCallingContext const& mcc) {
0564     ++nPreModuleStreamBeginRun_;
0565     if (verbose_) {
0566       edm::LogAbsolute out("TestServiceOne");
0567       out << streamModuleIndent << "TestServiceOne::preModuleStreamBeginRun " << TimeStamper(printTimestamps_)
0568           << " stream = " << sc.streamID() << " label = " << mcc.moduleDescription()->moduleLabel()
0569           << " run = " << sc.eventID().run();
0570     }
0571   }
0572 
0573   void TestServiceOne::postModuleStreamBeginRun(StreamContext const& sc, ModuleCallingContext const& mcc) {
0574     ++nPostModuleStreamBeginRun_;
0575     if (verbose_) {
0576       edm::LogAbsolute out("TestServiceOne");
0577       out << streamModuleIndent << "TestServiceOne::postModuleStreamBeginRun " << TimeStamper(printTimestamps_)
0578           << " stream = " << sc.streamID() << " label = " << mcc.moduleDescription()->moduleLabel()
0579           << " run = " << sc.eventID().run();
0580     }
0581   }
0582 
0583   void TestServiceOne::preModuleStreamEndRun(StreamContext const& sc, ModuleCallingContext const& mcc) {
0584     ++nPreModuleStreamEndRun_;
0585     if (verbose_) {
0586       edm::LogAbsolute out("TestServiceOne");
0587       out << streamModuleIndent << "TestServiceOne::preModuleStreamEndRun " << TimeStamper(printTimestamps_)
0588           << " stream = " << sc.streamID() << " label = " << mcc.moduleDescription()->moduleLabel()
0589           << " run = " << sc.eventID().run();
0590     }
0591   }
0592 
0593   void TestServiceOne::postModuleStreamEndRun(StreamContext const& sc, ModuleCallingContext const& mcc) {
0594     ++nPostModuleStreamEndRun_;
0595     if (verbose_) {
0596       edm::LogAbsolute out("TestServiceOne");
0597       out << streamModuleIndent << "TestServiceOne::postModuleStreamEndRun " << TimeStamper(printTimestamps_)
0598           << " stream = " << sc.streamID() << " label = " << mcc.moduleDescription()->moduleLabel()
0599           << " run = " << sc.eventID().run();
0600     }
0601   }
0602 
0603   void TestServiceOne::preGlobalBeginRun(GlobalContext const& gc) {
0604     ++nPreGlobalBeginRun_;
0605     if (verbose_) {
0606       edm::LogAbsolute out("TestServiceOne");
0607       out << globalIndent << "TestServiceOne::preGlobalBeginRun " << TimeStamper(printTimestamps_)
0608           << " run = " << gc.luminosityBlockID().run();
0609     }
0610   }
0611 
0612   void TestServiceOne::postGlobalBeginRun(GlobalContext const& gc) {
0613     ++nPostGlobalBeginRun_;
0614     if (verbose_) {
0615       edm::LogAbsolute out("TestServiceOne");
0616       out << globalIndent << "TestServiceOne::postGlobalBeginRun " << TimeStamper(printTimestamps_)
0617           << " run = " << gc.luminosityBlockID().run();
0618     }
0619   }
0620 
0621   void TestServiceOne::preGlobalEndRun(GlobalContext const& gc) {
0622     ++nPreGlobalEndRun_;
0623     if (verbose_) {
0624       edm::LogAbsolute out("TestServiceOne");
0625       out << globalIndent << "TestServiceOne::preGlobalEndRun " << TimeStamper(printTimestamps_)
0626           << " run = " << gc.luminosityBlockID().run();
0627     }
0628   }
0629 
0630   void TestServiceOne::postGlobalEndRun(GlobalContext const& gc) {
0631     ++nPostGlobalEndRun_;
0632     if (verbose_) {
0633       edm::LogAbsolute out("TestServiceOne");
0634       out << globalIndent << "TestServiceOne::postGlobalEndRun " << TimeStamper(printTimestamps_)
0635           << " run = " << gc.luminosityBlockID().run();
0636     }
0637   }
0638 
0639   void TestServiceOne::preModuleGlobalBeginRun(GlobalContext const& gc, ModuleCallingContext const& mcc) {
0640     ++nPreModuleGlobalBeginRun_;
0641     if (verbose_) {
0642       edm::LogAbsolute out("TestServiceOne");
0643       out << globalModuleIndent << "TestServiceOne::preModuleGlobalBeginRun " << TimeStamper(printTimestamps_)
0644           << " label = " << mcc.moduleDescription()->moduleLabel() << " run = " << gc.luminosityBlockID().run();
0645     }
0646   }
0647 
0648   void TestServiceOne::postModuleGlobalBeginRun(GlobalContext const& gc, ModuleCallingContext const& mcc) {
0649     ++nPostModuleGlobalBeginRun_;
0650     if (verbose_) {
0651       edm::LogAbsolute out("TestServiceOne");
0652       out << globalModuleIndent << "TestServiceOne::postModuleGlobalBeginRun " << TimeStamper(printTimestamps_)
0653           << " label = " << mcc.moduleDescription()->moduleLabel() << " run = " << gc.luminosityBlockID().run();
0654     }
0655   }
0656 
0657   void TestServiceOne::preModuleGlobalEndRun(GlobalContext const& gc, ModuleCallingContext const& mcc) {
0658     ++nPreModuleGlobalEndRun_;
0659     if (verbose_) {
0660       edm::LogAbsolute out("TestServiceOne");
0661       out << globalModuleIndent << "TestServiceOne::preModuleGlobalEndRun " << TimeStamper(printTimestamps_)
0662           << " label = " << mcc.moduleDescription()->moduleLabel() << " run = " << gc.luminosityBlockID().run();
0663     }
0664   }
0665 
0666   void TestServiceOne::postModuleGlobalEndRun(GlobalContext const& gc, ModuleCallingContext const& mcc) {
0667     ++nPostModuleGlobalEndRun_;
0668     if (verbose_) {
0669       edm::LogAbsolute out("TestServiceOne");
0670       out << globalModuleIndent << "TestServiceOne::postModuleGlobalEndRun " << TimeStamper(printTimestamps_)
0671           << " label = " << mcc.moduleDescription()->moduleLabel() << " run = " << gc.luminosityBlockID().run();
0672     }
0673   }
0674 
0675   void TestServiceOne::preGlobalWriteRun(GlobalContext const& gc) {
0676     ++nPreGlobalWriteRun_;
0677     if (verbose_) {
0678       edm::LogAbsolute out("TestServiceOne");
0679       out << globalIndent << "TestServiceOne::preGlobalWriteRun " << TimeStamper(printTimestamps_)
0680           << " run = " << gc.luminosityBlockID().run();
0681     }
0682   }
0683 
0684   void TestServiceOne::postGlobalWriteRun(GlobalContext const& gc) {
0685     ++nPostGlobalWriteRun_;
0686     if (verbose_) {
0687       edm::LogAbsolute out("TestServiceOne");
0688       out << globalIndent << "TestServiceOne::postGlobalWriteRun " << TimeStamper(printTimestamps_)
0689           << " run = " << gc.luminosityBlockID().run();
0690     }
0691   }
0692 
0693   unsigned int TestServiceOne::nPreBeginJob() const { return nPreBeginJob_.load(); }
0694   unsigned int TestServiceOne::nPostBeginJob() const { return nPostBeginJob_.load(); }
0695   unsigned int TestServiceOne::nPreEndJob() const { return nPreEndJob_.load(); }
0696   unsigned int TestServiceOne::nPostEndJob() const { return nPostEndJob_.load(); }
0697 
0698   unsigned int TestServiceOne::nPreModuleBeginJob() const { return nPreModuleBeginJob_.load(); }
0699   unsigned int TestServiceOne::nPostModuleBeginJob() const { return nPostModuleBeginJob_.load(); }
0700   unsigned int TestServiceOne::nPreModuleEndJob() const { return nPreModuleEndJob_.load(); }
0701   unsigned int TestServiceOne::nPostModuleEndJob() const { return nPostModuleEndJob_.load(); }
0702 
0703   unsigned int TestServiceOne::nPreBeginStream() const { return nPreBeginStream_.load(); }
0704   unsigned int TestServiceOne::nPostBeginStream() const { return nPostBeginStream_.load(); }
0705   unsigned int TestServiceOne::nPreEndStream() const { return nPreEndStream_.load(); }
0706   unsigned int TestServiceOne::nPostEndStream() const { return nPostEndStream_.load(); }
0707 
0708   unsigned int TestServiceOne::nPreModuleBeginStream() const { return nPreModuleBeginStream_.load(); }
0709   unsigned int TestServiceOne::nPostModuleBeginStream() const { return nPostModuleBeginStream_.load(); }
0710   unsigned int TestServiceOne::nPreModuleEndStream() const { return nPreModuleEndStream_.load(); }
0711   unsigned int TestServiceOne::nPostModuleEndStream() const { return nPostModuleEndStream_.load(); }
0712 
0713   unsigned int TestServiceOne::nPreBeginProcessBlock() const { return nPreBeginProcessBlock_.load(); }
0714   unsigned int TestServiceOne::nPostBeginProcessBlock() const { return nPostBeginProcessBlock_.load(); }
0715   unsigned int TestServiceOne::nPreEndProcessBlock() const { return nPreEndProcessBlock_.load(); }
0716   unsigned int TestServiceOne::nPostEndProcessBlock() const { return nPostEndProcessBlock_.load(); }
0717 
0718   unsigned int TestServiceOne::nPreModuleBeginProcessBlock() const { return nPreModuleBeginProcessBlock_.load(); }
0719   unsigned int TestServiceOne::nPostModuleBeginProcessBlock() const { return nPostModuleBeginProcessBlock_.load(); }
0720   unsigned int TestServiceOne::nPreModuleEndProcessBlock() const { return nPreModuleEndProcessBlock_.load(); }
0721   unsigned int TestServiceOne::nPostModuleEndProcessBlock() const { return nPostModuleEndProcessBlock_.load(); }
0722 
0723   unsigned int TestServiceOne::nPreStreamBeginLumi() const { return nPreStreamBeginLumi_.load(); }
0724   unsigned int TestServiceOne::nPostStreamBeginLumi() const { return nPostStreamBeginLumi_.load(); }
0725   unsigned int TestServiceOne::nPreStreamEndLumi() const { return nPreStreamEndLumi_.load(); }
0726   unsigned int TestServiceOne::nPostStreamEndLumi() const { return nPostStreamEndLumi_.load(); }
0727 
0728   unsigned int TestServiceOne::nPreModuleStreamBeginLumi() const { return nPreModuleStreamBeginLumi_.load(); }
0729   unsigned int TestServiceOne::nPostModuleStreamBeginLumi() const { return nPostModuleStreamBeginLumi_.load(); }
0730   unsigned int TestServiceOne::nPreModuleStreamEndLumi() const { return nPreModuleStreamEndLumi_.load(); }
0731   unsigned int TestServiceOne::nPostModuleStreamEndLumi() const { return nPostModuleStreamEndLumi_.load(); }
0732 
0733   unsigned int TestServiceOne::nPreGlobalBeginLumi() const { return nPreGlobalBeginLumi_.load(); }
0734   unsigned int TestServiceOne::nPostGlobalBeginLumi() const { return nPostGlobalBeginLumi_.load(); }
0735   unsigned int TestServiceOne::nPreGlobalEndLumi() const { return nPreGlobalEndLumi_.load(); }
0736   unsigned int TestServiceOne::nPostGlobalEndLumi() const { return nPostGlobalEndLumi_.load(); }
0737 
0738   unsigned int TestServiceOne::nPreModuleGlobalBeginLumi() const { return nPreModuleGlobalBeginLumi_.load(); }
0739   unsigned int TestServiceOne::nPostModuleGlobalBeginLumi() const { return nPostModuleGlobalBeginLumi_.load(); }
0740   unsigned int TestServiceOne::nPreModuleGlobalEndLumi() const { return nPreModuleGlobalEndLumi_.load(); }
0741   unsigned int TestServiceOne::nPostModuleGlobalEndLumi() const { return nPostModuleGlobalEndLumi_.load(); }
0742 
0743   unsigned int TestServiceOne::nPreGlobalWriteLumi() const { return nPreGlobalWriteLumi_.load(); }
0744   unsigned int TestServiceOne::nPostGlobalWriteLumi() const { return nPostGlobalWriteLumi_.load(); }
0745 
0746   unsigned int TestServiceOne::nPreStreamBeginRun() const { return nPreStreamBeginRun_.load(); }
0747   unsigned int TestServiceOne::nPostStreamBeginRun() const { return nPostStreamBeginRun_.load(); }
0748   unsigned int TestServiceOne::nPreStreamEndRun() const { return nPreStreamEndRun_.load(); }
0749   unsigned int TestServiceOne::nPostStreamEndRun() const { return nPostStreamEndRun_.load(); }
0750 
0751   unsigned int TestServiceOne::nPreModuleStreamBeginRun() const { return nPreModuleStreamBeginRun_.load(); }
0752   unsigned int TestServiceOne::nPostModuleStreamBeginRun() const { return nPostModuleStreamBeginRun_.load(); }
0753   unsigned int TestServiceOne::nPreModuleStreamEndRun() const { return nPreModuleStreamEndRun_.load(); }
0754   unsigned int TestServiceOne::nPostModuleStreamEndRun() const { return nPostModuleStreamEndRun_.load(); }
0755 
0756   unsigned int TestServiceOne::nPreGlobalBeginRun() const { return nPreGlobalBeginRun_.load(); }
0757   unsigned int TestServiceOne::nPostGlobalBeginRun() const { return nPostGlobalBeginRun_.load(); }
0758   unsigned int TestServiceOne::nPreGlobalEndRun() const { return nPreGlobalEndRun_.load(); }
0759   unsigned int TestServiceOne::nPostGlobalEndRun() const { return nPostGlobalEndRun_.load(); }
0760 
0761   unsigned int TestServiceOne::nPreModuleGlobalBeginRun() const { return nPreModuleGlobalBeginRun_.load(); }
0762   unsigned int TestServiceOne::nPostModuleGlobalBeginRun() const { return nPostModuleGlobalBeginRun_.load(); }
0763   unsigned int TestServiceOne::nPreModuleGlobalEndRun() const { return nPreModuleGlobalEndRun_.load(); }
0764   unsigned int TestServiceOne::nPostModuleGlobalEndRun() const { return nPostModuleGlobalEndRun_.load(); }
0765 
0766   unsigned int TestServiceOne::nPreGlobalWriteRun() const { return nPreGlobalWriteRun_.load(); }
0767   unsigned int TestServiceOne::nPostGlobalWriteRun() const { return nPostGlobalWriteRun_.load(); }
0768 }  // namespace edmtest
0769 
0770 using edmtest::TestServiceOne;
0771 DEFINE_FWK_SERVICE(TestServiceOne);