// FindTracks1.cc -- Physicst code in module A for test of step1 // implementation of ErrorLogger mechanism. // // The strange comments like // $$ 2:1 refer to the fact that this line // excercises something in section 2 (for example) of the semantics design. #ifndef ZMENVIRONMENT_H #include "ZMutility/ZMenvironment.h" #endif ZM_USING_NAMESPACE( zmel ) #include "frame1.h" #include "FindTracks1.h" #include "ZMutility/iostream" USING( std::cout ) USING( std::endl ) #include USING( std::string ) //============================================================================= // // PHYSICIST // //============================================================================= int FindTracks::event_counter_ = 0; FindTracks::FindTracks (const string & name) : Module( name ) // $$ 10:2 { } void FindTracks::operator()( Event & event ) { ++event_counter_; cout << "doing FindTracks step 1" << endl; event.data *= 2; errlog ( ELsuccess, "Did step 1") << endmsg; // $$ 2:1 cout << "doing FindTracks step 2" << endl; for (int i = 0; i < 5; ++i ) { errlog( ELinfo, "i =" ); // $$ 2:2 errlog << i; // $$ 2:3 event.data += i; errlog << " data = " << event.data; errlog << endmsg; // $$ 2:4 } errlog ( ELsuccess, "Did step 2") << endmsg; // $$ 2:1 } // FindTracks::FindTracks() int FindTracks::event_counter() { return event_counter_; }