//======================================================================= // Level3ModuleDump.cc // Author: YeonSei Chung //======================================================================= //------------------ // include files //------------------ #include "Level3Mods/Level3ModuleDump.hh" #include "Level3Objects/Level3ModuleMap.hh" #include "Level3Objects/Level3ModuleResults.hh" #include "Level3Objects/Level3ModuleSummary.hh" #include "Framework/APPModule.hh" #include "AbsEnv/AbsEnv.hh" #include "Edm/ConstHandle.hh" #include "Edm/EventRecord.hh" #include "Edm/GenericConstHandle.hh" #include "Edm/Handle.hh" #include #include #include #include #include #include "TROOT.h" using std::ostream; using std::setw; using std::setprecision; using std::cout; using std::endl; using std::set; //************************************************************************** //--------------- // Constructor //--------------- Level3ModuleDump::Level3ModuleDump( const char* const theName, const char* const theDescription ) : AppModule(theName, theDescription) { // Say Hello. std::cerr << "HELLO from Module Level3ModuleDump" << std::endl; } //------------- // Destructor //------------- Level3ModuleDump::~Level3ModuleDump() { } //************************************************************************** //=================================== // Job-related member functions //=================================== AppResult Level3ModuleDump::beginRun( AbsEvent* anEvent ) { std::cout << "Begin Run Method from Level3ModuleDump" << std::endl; //------------------------------------------------------------- // List objects in this event //------------------------------------------------------------- for (EventRecord::ConstIterator iter = anEvent->begin(); iter.is_valid(); ++iter) { ConstHandle handle(iter); std::string class_name = handle->class_name() ; Id object_id = handle->object_id() ; size_t nbytes_input = handle->nbytes_last_streamed_in() ; std::string process_name = handle->process_name() ; std::string description = handle->description() ; std::cout << std::setw( 6) << nbytes_input << " " << std::setw(24) << class_name << "(" << std::setw( 8) << object_id << std::endl; } EventRecord::ConstIterator iter_map(anEvent, StorableObject::SelectByClassName("Level3ModuleMap")); if (iter_map.is_valid()) { std::cout << "Level3ModuleMap is found " << iter_map->class_name() < map_handle(iter_map); map_handle->print(std::cout); L3Index np=map_handle->nPaths(); L3Index ns=map_handle->nStreams(); L3Index nm=map_handle->nModules(); std::cout << "this must show something "<nPaths(); ip++ ) { std::cout<<"index, this is pathId "<pathId(ip) << std::endl; std::cout<<"this is pathName "<pathName(map_handle->pathId(ip))< path = map_handle->pathIds(); std::vector pathname = map_handle->pathNames(); for ( int i=0; i trigBit; trigBit = map_handle->triggerBitsMatchingPattern("Path*",3); for (int i=0; itriggerBitsMatchingPattern("*1*",3); for (int i=0; ibegin(); iter.is_valid(); ++iter) { ConstHandle handle(iter); std::string class_name = handle->class_name() ; Id object_id = handle->object_id() ; size_t nbytes_input = handle->nbytes_last_streamed_in() ; std::string process_name = handle->process_name() ; std::string description = handle->description() ; std::cout << std::setw( 6) << nbytes_input << " " << std::setw(24) << class_name << "(" << std::setw( 8) << object_id << std::endl; } EventRecord::ConstIterator iter_map(anEvent, StorableObject::SelectByClassName("Level3ModuleMap")); if (iter_map.is_valid()) { std::cout << "Level3ModuleMap is found " << iter_map->class_name() < map_handle(iter_map); map_handle->print(std::cout); } else { std::cout << "Could not find Level3ModuleMap " << std::endl; } EventRecord::ConstIterator iter_result(anEvent, StorableObject::SelectByClassName("Level3ModuleResults")); if (iter_result.is_valid()) { std::cout << "Level3ModuleResults is found " << iter_result->class_name() << std::endl; ConstHandle result_handle(iter_result); result_handle->print(std::cout); } else { std::cout << "Could not find Level3ModuleResults " << std::endl; } EventRecord::ConstIterator iter_sum(anEvent, StorableObject::SelectByClassName("Level3ModuleSummary")); if (iter_sum.is_valid()) { std::cout << "Level3ModuleSummary is found " << iter_sum->class_name() << std::endl; ConstHandle sum_handle(iter_sum); sum_handle->print(std::cout); } else { std::cout << "Could not find Level3ModuleSummary " << std::endl; } return AppResult::OK; } // end event AppResult Level3ModuleDump::endRun(AbsEvent* anEvent) { std::cout << "*** Level3ModuleDump::endRunJob *** " << std::endl; return AppResult::OK; } // end endRun