CMS 3D CMS Logo

Tracer.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     Services
00004 // Class  :     Tracer
00005 // 
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Original Author:  Chris Jones
00010 //         Created:  Thu Sep  8 14:17:58 EDT 2005
00011 // $Id: Tracer.cc,v 1.15 2008/10/20 19:38:22 wmtan Exp $
00012 //
00013 
00014 // system include files
00015 #include <iostream>
00016 
00017 // user include files
00018 #include "FWCore/Services/src/Tracer.h"
00019 
00020 #include "DataFormats/Provenance/interface/ModuleDescription.h"
00021 #include "DataFormats/Provenance/interface/EventID.h"
00022 #include "DataFormats/Provenance/interface/Timestamp.h"
00023 #include "DataFormats/Provenance/interface/LuminosityBlockID.h"
00024 #include "DataFormats/Provenance/interface/RunID.h"
00025 
00026 using namespace edm::service;
00027 //
00028 // constants, enums and typedefs
00029 //
00030 
00031 //
00032 // static data member definitions
00033 //
00034 
00035 //
00036 // constructors and destructor
00037 //
00038 Tracer::Tracer(ParameterSet const& iPS, ActivityRegistry&iRegistry) :
00039   indention_(iPS.getUntrackedParameter<std::string>("indention","++")),
00040   depth_(0)
00041 {
00042    iRegistry.watchPostBeginJob(this, &Tracer::postBeginJob);
00043    iRegistry.watchPostEndJob(this, &Tracer::postEndJob);
00044 
00045    iRegistry.watchPreModule(this, &Tracer::preModuleEvent);
00046    iRegistry.watchPostModule(this, &Tracer::postModuleEvent);
00047    
00048    iRegistry.watchPreSourceConstruction(this, &Tracer::preSourceConstruction);
00049    iRegistry.watchPostSourceConstruction(this, &Tracer::postSourceConstruction);
00050 
00051    iRegistry.watchPreModuleConstruction(this, &Tracer::preModuleConstruction);
00052    iRegistry.watchPostModuleConstruction(this, &Tracer::postModuleConstruction);
00053 
00054    iRegistry.watchPreModuleBeginJob(this, &Tracer::preModuleBeginJob);
00055    iRegistry.watchPostModuleBeginJob(this, &Tracer::postModuleBeginJob);
00056 
00057    iRegistry.watchPreModuleEndJob(this, &Tracer::preModuleEndJob);
00058    iRegistry.watchPostModuleEndJob(this, &Tracer::postModuleEndJob);
00059 
00060    iRegistry.watchPreModuleBeginRun(this, &Tracer::preModuleBeginRun);
00061    iRegistry.watchPostModuleBeginRun(this, &Tracer::postModuleBeginRun);
00062 
00063    iRegistry.watchPreModuleEndRun(this, &Tracer::preModuleEndRun);
00064    iRegistry.watchPostModuleEndRun(this, &Tracer::postModuleEndRun);
00065 
00066    iRegistry.watchPreModuleBeginLumi(this, &Tracer::preModuleBeginLumi);
00067    iRegistry.watchPostModuleBeginLumi(this, &Tracer::postModuleBeginLumi);
00068 
00069    iRegistry.watchPreModuleEndLumi(this, &Tracer::preModuleEndLumi);
00070    iRegistry.watchPostModuleEndLumi(this, &Tracer::postModuleEndLumi);
00071 
00072    iRegistry.watchPreProcessPath(this, &Tracer::prePathEvent);
00073    iRegistry.watchPostProcessPath(this, &Tracer::postPathEvent);
00074 
00075    iRegistry.watchPrePathBeginRun(this, &Tracer::prePathBeginRun);
00076    iRegistry.watchPostPathBeginRun(this, &Tracer::postPathBeginRun);
00077 
00078    iRegistry.watchPrePathEndRun(this, &Tracer::prePathEndRun);
00079    iRegistry.watchPostPathEndRun(this, &Tracer::postPathEndRun);
00080 
00081    iRegistry.watchPrePathBeginLumi(this, &Tracer::prePathBeginLumi);
00082    iRegistry.watchPostPathBeginLumi(this, &Tracer::postPathBeginLumi);
00083 
00084    iRegistry.watchPrePathEndLumi(this, &Tracer::prePathEndLumi);
00085    iRegistry.watchPostPathEndLumi(this, &Tracer::postPathEndLumi);
00086 
00087    iRegistry.watchPreProcessEvent(this, &Tracer::preEvent);
00088    iRegistry.watchPostProcessEvent(this, &Tracer::postEvent);
00089 
00090    iRegistry.watchPreBeginRun(this, &Tracer::preBeginRun);
00091    iRegistry.watchPostBeginRun(this, &Tracer::postBeginRun);
00092 
00093    iRegistry.watchPreEndRun(this, &Tracer::preEndRun);
00094    iRegistry.watchPostEndRun(this, &Tracer::postEndRun);
00095 
00096    iRegistry.watchPreBeginLumi(this, &Tracer::preBeginLumi);
00097    iRegistry.watchPostBeginLumi(this, &Tracer::postBeginLumi);
00098 
00099    iRegistry.watchPreEndLumi(this, &Tracer::preEndLumi);
00100    iRegistry.watchPostEndLumi(this, &Tracer::postEndLumi);
00101 
00102    iRegistry.watchPreSource(this, &Tracer::preSourceEvent);
00103    iRegistry.watchPostSource(this, &Tracer::postSourceEvent);
00104 
00105    iRegistry.watchPreOpenFile(this, &Tracer::preOpenFile);
00106    iRegistry.watchPostOpenFile(this, &Tracer::postOpenFile);
00107 
00108    iRegistry.watchPreCloseFile(this, &Tracer::preCloseFile);
00109    iRegistry.watchPostCloseFile(this, &Tracer::postCloseFile);
00110 
00111    iRegistry.watchPreSourceRun(this, &Tracer::preSourceRun);
00112    iRegistry.watchPostSourceRun(this, &Tracer::postSourceRun);
00113 
00114    iRegistry.watchPreSourceLumi(this, &Tracer::preSourceLumi);
00115    iRegistry.watchPostSourceLumi(this, &Tracer::postSourceLumi);
00116 
00117 }
00118 
00119 // Tracer::Tracer(Tracer const& rhs)
00120 // {
00121 //    // do actual copying here;
00122 // }
00123 
00124 //Tracer::~Tracer()
00125 //{
00126 //}
00127 
00128 //
00129 // assignment operators
00130 //
00131 // Tracer const& Tracer::operator=(Tracer const& rhs)
00132 // {
00133 //   //An exception safe implementation is
00134 //   Tracer temp(rhs);
00135 //   swap(rhs);
00136 //
00137 //   return *this;
00138 // }
00139 
00140 //
00141 // member functions
00142 //
00143 void 
00144 Tracer::postBeginJob() {
00145    std::cout <<indention_<<" Job started"<<std::endl;
00146 }
00147 void 
00148 Tracer::postEndJob() {
00149    std::cout <<indention_<<" Job ended"<<std::endl;
00150 }
00151 
00152 void
00153 Tracer::preSourceEvent() {
00154   std::cout <<indention_<<indention_<<"source event"<<std::endl;
00155 }
00156 void
00157 Tracer::postSourceEvent () {
00158   std::cout <<indention_<<indention_<<"finished: source event"<<std::endl;
00159 }
00160 
00161 void
00162 Tracer::preSourceLumi() {
00163   std::cout <<indention_<<indention_<<"source lumi"<<std::endl;
00164 }
00165 void
00166 Tracer::postSourceLumi () {
00167   std::cout <<indention_<<indention_<<"finished: source lumi"<<std::endl;
00168 }
00169 
00170 void
00171 Tracer::preSourceRun() {
00172   std::cout <<indention_<<indention_<<"source run"<<std::endl;
00173 }
00174 void
00175 Tracer::postSourceRun () {
00176   std::cout <<indention_<<indention_<<"finished: source run"<<std::endl;
00177 }
00178 
00179 void
00180 Tracer::preOpenFile() {
00181   std::cout <<indention_<<indention_<<"open input file"<<std::endl;
00182 }
00183 void
00184 Tracer::postOpenFile () {
00185   std::cout <<indention_<<indention_<<"finished: open input file"<<std::endl;
00186 }
00187 
00188 void
00189 Tracer::preCloseFile() {
00190   std::cout <<indention_<<indention_<<"close input file"<<std::endl;
00191 }
00192 void
00193 Tracer::postCloseFile () {
00194   std::cout <<indention_<<indention_<<"finished: close input file"<<std::endl;
00195 }
00196 
00197 void 
00198 Tracer::preEvent(EventID const& iID, Timestamp const& iTime) {
00199    depth_=0;
00200    std::cout <<indention_<<indention_<<" processing event:"<< iID<<" time:"<<iTime.value()<< std::endl;
00201 }
00202 void 
00203 Tracer::postEvent(Event const&, EventSetup const&) {
00204    std::cout <<indention_<<indention_<<" finished event:"<<std::endl;
00205 }
00206 
00207 void 
00208 Tracer::prePathEvent(std::string const& iName) {
00209   std::cout <<indention_<<indention_<<indention_<<" processing path for event:"<<iName<<std::endl;
00210 }
00211 void 
00212 Tracer::postPathEvent(std::string const& iName, HLTPathStatus const&) {
00213   std::cout <<indention_<<indention_<<indention_<<" finished path for event:"<<std::endl;
00214 }
00215 
00216 void 
00217 Tracer::preModuleEvent(ModuleDescription const& iDescription) {
00218    ++depth_;
00219    std::cout <<indention_<<indention_<<indention_;
00220    for(unsigned int depth = 0; depth !=depth_; ++depth) {
00221       std::cout<<indention_;
00222    }
00223    std::cout<<" module for event:" <<iDescription.moduleLabel_<<std::endl;
00224 }
00225 void 
00226 Tracer::postModuleEvent(ModuleDescription const& iDescription) {
00227    --depth_;
00228    std::cout <<indention_<<indention_<<indention_<<indention_;
00229    for(unsigned int depth = 0; depth !=depth_; ++depth) {
00230       std::cout<<indention_;
00231    }
00232    
00233    std::cout<<" finished for event:"<<iDescription.moduleLabel_<<std::endl;
00234 }
00235 
00236 void 
00237 Tracer::preBeginRun(RunID const& iID, Timestamp const& iTime) {
00238    depth_=0;
00239    std::cout <<indention_<<indention_<<" processing begin run:"<< iID<<" time:"<<iTime.value()<< std::endl;
00240 }
00241 void 
00242 Tracer::postBeginRun(Run const&, EventSetup const&) {
00243    std::cout <<indention_<<indention_<<" finished begin run:"<<std::endl;
00244 }
00245 
00246 void 
00247 Tracer::prePathBeginRun(std::string const& iName) {
00248   std::cout <<indention_<<indention_<<indention_<<" processing path for begin run:"<<iName<<std::endl;
00249 }
00250 void 
00251 Tracer::postPathBeginRun(std::string const& iName, HLTPathStatus const&) {
00252   std::cout <<indention_<<indention_<<indention_<<" finished path for begin run:"<<std::endl;
00253 }
00254 
00255 void 
00256 Tracer::preModuleBeginRun(ModuleDescription const& iDescription) {
00257    ++depth_;
00258    std::cout <<indention_<<indention_<<indention_;
00259    for(unsigned int depth = 0; depth !=depth_; ++depth) {
00260       std::cout<<indention_;
00261    }
00262    std::cout<<" module for begin run:" <<iDescription.moduleLabel_<<std::endl;
00263 }
00264 void 
00265 Tracer::postModuleBeginRun(ModuleDescription const& iDescription) {
00266    --depth_;
00267    std::cout <<indention_<<indention_<<indention_<<indention_;
00268    for(unsigned int depth = 0; depth !=depth_; ++depth) {
00269       std::cout<<indention_;
00270    }
00271    
00272    std::cout<<" finished for begin run:"<<iDescription.moduleLabel_<<std::endl;
00273 }
00274 
00275 void 
00276 Tracer::preEndRun(RunID const& iID, Timestamp const& iTime) {
00277    depth_=0;
00278    std::cout <<indention_<<indention_<<" processing end run:"<< iID<<" time:"<<iTime.value()<< std::endl;
00279 }
00280 void 
00281 Tracer::postEndRun(Run const&, EventSetup const&) {
00282    std::cout <<indention_<<indention_<<" finished end run:"<<std::endl;
00283 }
00284 
00285 void 
00286 Tracer::prePathEndRun(std::string const& iName) {
00287   std::cout <<indention_<<indention_<<indention_<<" processing path for end run:"<<iName<<std::endl;
00288 }
00289 void 
00290 Tracer::postPathEndRun(std::string const& iName, HLTPathStatus const&) {
00291   std::cout <<indention_<<indention_<<indention_<<" finished path for end run:"<<std::endl;
00292 }
00293 
00294 void 
00295 Tracer::preModuleEndRun(ModuleDescription const& iDescription) {
00296    ++depth_;
00297    std::cout <<indention_<<indention_<<indention_;
00298    for(unsigned int depth = 0; depth !=depth_; ++depth) {
00299       std::cout<<indention_;
00300    }
00301    std::cout<<" module for end run:" <<iDescription.moduleLabel_<<std::endl;
00302 }
00303 void 
00304 Tracer::postModuleEndRun(ModuleDescription const& iDescription) {
00305    --depth_;
00306    std::cout <<indention_<<indention_<<indention_<<indention_;
00307    for(unsigned int depth = 0; depth !=depth_; ++depth) {
00308       std::cout<<indention_;
00309    }
00310    
00311    std::cout<<" finished for end run:"<<iDescription.moduleLabel_<<std::endl;
00312 }
00313 
00314 void 
00315 Tracer::preBeginLumi(LuminosityBlockID const& iID, Timestamp const& iTime) {
00316    depth_=0;
00317    std::cout <<indention_<<indention_<<" processing begin lumi:"<< iID<<" time:"<<iTime.value()<< std::endl;
00318 }
00319 void 
00320 Tracer::postBeginLumi(LuminosityBlock const&, EventSetup const&) {
00321    std::cout <<indention_<<indention_<<" finished begin lumi:"<<std::endl;
00322 }
00323 
00324 void 
00325 Tracer::prePathBeginLumi(std::string const& iName) {
00326   std::cout <<indention_<<indention_<<indention_<<" processing path for begin lumi:"<<iName<<std::endl;
00327 }
00328 void 
00329 Tracer::postPathBeginLumi(std::string const& iName, HLTPathStatus const&) {
00330   std::cout <<indention_<<indention_<<indention_<<" finished path for begin lumi:"<<std::endl;
00331 }
00332 
00333 void 
00334 Tracer::preModuleBeginLumi(ModuleDescription const& iDescription) {
00335    ++depth_;
00336    std::cout <<indention_<<indention_<<indention_;
00337    for(unsigned int depth = 0; depth !=depth_; ++depth) {
00338       std::cout<<indention_;
00339    }
00340    std::cout<<" module for begin lumi:" <<iDescription.moduleLabel_<<std::endl;
00341 }
00342 void 
00343 Tracer::postModuleBeginLumi(ModuleDescription const& iDescription) {
00344    --depth_;
00345    std::cout <<indention_<<indention_<<indention_<<indention_;
00346    for(unsigned int depth = 0; depth !=depth_; ++depth) {
00347       std::cout<<indention_;
00348    }
00349    
00350    std::cout<<" finished for begin lumi:"<<iDescription.moduleLabel_<<std::endl;
00351 }
00352 
00353 void 
00354 Tracer::preEndLumi(LuminosityBlockID const& iID, Timestamp const& iTime) {
00355    depth_=0;
00356    std::cout <<indention_<<indention_<<" processing end lumi:"<< iID<<" time:"<<iTime.value()<< std::endl;
00357 }
00358 void 
00359 Tracer::postEndLumi(LuminosityBlock const&, EventSetup const&) {
00360    std::cout <<indention_<<indention_<<" finished end lumi:"<<std::endl;
00361 }
00362 
00363 void 
00364 Tracer::prePathEndLumi(std::string const& iName) {
00365   std::cout <<indention_<<indention_<<indention_<<" processing path for end lumi:"<<iName<<std::endl;
00366 }
00367 
00368 void 
00369 Tracer::postPathEndLumi(std::string const& iName, HLTPathStatus const&) {
00370   std::cout <<indention_<<indention_<<indention_<<" finished path for end lumi:"<<std::endl;
00371 }
00372 
00373 void 
00374 Tracer::preModuleEndLumi(ModuleDescription const& iDescription) {
00375    ++depth_;
00376    std::cout <<indention_<<indention_<<indention_;
00377    for(unsigned int depth = 0; depth !=depth_; ++depth) {
00378       std::cout<<indention_;
00379    }
00380    std::cout<<" module for end lumi:" <<iDescription.moduleLabel_<<std::endl;
00381 }
00382 
00383 void 
00384 Tracer::postModuleEndLumi(ModuleDescription const& iDescription) {
00385    --depth_;
00386    std::cout <<indention_<<indention_<<indention_<<indention_;
00387    for(unsigned int depth = 0; depth !=depth_; ++depth) {
00388       std::cout<<indention_;
00389    }
00390    
00391    std::cout<<" finished for end lumi:"<<iDescription.moduleLabel_<<std::endl;
00392 }
00393 
00394 void 
00395 Tracer::preSourceConstruction(ModuleDescription const& iDescription) {
00396   std::cout <<indention_;
00397   std::cout<<" constructing source:" <<iDescription.moduleName_<<std::endl;
00398 }
00399 
00400 void 
00401 Tracer::postSourceConstruction(ModuleDescription const& iDescription) {
00402   std::cout <<indention_;
00403   std::cout<<" construction finished:"<<iDescription.moduleName_<<std::endl;
00404 }
00405 
00406 void 
00407 Tracer::preModuleConstruction(ModuleDescription const& iDescription) {
00408   std::cout <<indention_;
00409   std::cout<<" constructing module:" <<iDescription.moduleLabel_<<std::endl;
00410 }
00411 
00412 void 
00413 Tracer::postModuleConstruction(ModuleDescription const& iDescription) {
00414   std::cout <<indention_;
00415   std::cout<<" construction finished:"<<iDescription.moduleLabel_<<std::endl;
00416 }
00417 
00418 void 
00419 Tracer::preModuleBeginJob(ModuleDescription const& iDescription) {
00420   std::cout <<indention_;
00421   std::cout<<" beginJob module:" <<iDescription.moduleLabel_<<std::endl;
00422 }
00423 
00424 void 
00425 Tracer::postModuleBeginJob(ModuleDescription const& iDescription) {
00426   std::cout <<indention_;
00427   std::cout<<" beginJob finished:"<<iDescription.moduleLabel_<<std::endl;
00428 }
00429 
00430 void 
00431 Tracer::preModuleEndJob(ModuleDescription const& iDescription) {
00432   std::cout <<indention_;
00433   std::cout<<" endJob module:" <<iDescription.moduleLabel_<<std::endl;
00434 }
00435 
00436 void 
00437 Tracer::postModuleEndJob(ModuleDescription const& iDescription) {
00438   std::cout <<indention_;
00439   std::cout<<" endJob finished:"<<iDescription.moduleLabel_<<std::endl;
00440 }
00441 
00442 //
00443 // const member functions
00444 //
00445 
00446 //
00447 // static member functions
00448 //
00449 

Generated on Tue Jun 9 17:36:40 2009 for CMSSW by  doxygen 1.5.4