#ifndef APPStored_HH #define APPStored_HH //************************************************************************** // File: APPStored.hh //------------------------------------------------------------------------- // Author: Mike Carew // Date: 6/8/99 // //************************************************************************* //------------ // Headers -- //------------- #include "Framework/APPPath.hh" #include "Framework/APPModule.hh" #include "Framework/AppStream.hh" #include "Framework/AppAction.hh" #include #ifdef USE_CDFEDM2 #include "Edm/Handle.hh" #include "Edm/Id.hh" #include "TriggerObjects/TL3D_StorableBank.hh" #else #include "Banks/TL3D_Bank.hh" #endif // ------------------------ // -- Class Declarations -- // ------------------------ // This is the ModNode class. This class describes everything about a // module. An instance of this class exists for every modules in every path. // This class stores the following information about a modules. One, // enum for its type. Two, a char* for its name. This really should be // a std::string. Three, three booleans for the exe/pass/queried info. Four, // a float for its CPU time. class ModNode { public: // Constructor ModNode(); // Destructor ~ModNode(); enum MaskType { filter = 100, input = 200, output = 300, module = 400, none = 500 }; MaskType type; char* name; bool executed; bool query; bool passed; float cpuTime; void print(); }; // This is the PathNode class. An instance of this class // will exist for every path in the event. This class contains the // following information about a Path. One, the name as a char*. // This should really be changed to a std::string. Two, a pointer to a list // of pointers to ModNodes. This is basically a list of all the modules // In that Path. By iterating over mods, one can get all the information // about the modules in path. Third, an integer containing the number of // times PathNode was executed. class PathNode { public: // Constructor PathNode(); // Destructor ~PathNode(); // Function members void print(); // Static members // The Name of the Path char* name; // A List of modules in the Path // This list is stored as a list of ModNodes // Information about each modules can be obtained via the ModNode class APPList* mods; // Number of times it was executed int nExec; }; // This class if StreamPathNode. A instance of this class exists for // each path in a stream. This class only contains two pieces of information // about a path in a stream. One, its name stored as a char* and two, // a bool for if it passed. class StreamPathNode { public: StreamPathNode( ); ~StreamPathNode( ); void print( ); bool passed; char* name; }; // This class is the StreamNode class. An instance of this class exists // For every stream in the event. This class contains the following // information about a stream. One, the name as a char*. Two, a pointer // to a List of StreamPathNode. Each of these nodes contains information // about each path in the StreamNode. By looping over all StreamPathNodes // one can learn about all the paths in a given stream class StreamNode { public: StreamNode( ); ~StreamNode( ); char* name; int nExec; APPList* paths; }; // The main storage class class APPStored { public: // Constructors APPStored(); // Destructor ~APPStored(); //****************************************** // Function members //******************************************* // Printing members void print(); void printStreams( ); void printPassedInfo( ); void summary( ); // Memebers to fill the class void fillNames( APPList* paths ); void fillExecuted( APPList* paths ); void fillStreamNames( APPList* streams ); void fillStreamPassed( APPList* streams ); void fillPassedStats( ); // Member to clear the class void clearExecInfo( ); // Members to make bitMasks std::string makeBitMask( ); std::string makeStreamBitMask( ); std::string makeExecInfo( ); bool* makeExecBoolInfo( ); bool* makeQueryBoolInfo( ); bool* makePassedBoolInfo( ); bool* makeExecStreamInfo( ); int* makePathPointers( ); float* makeTimingInfo( ); // Members to decode and store bitMask info void decodeBitMask( std::string bitMask ); void decodeStreamBitMask( std::string bitMask ); void decodeExecInfo( std::string bitMask ); void decodeQueryInfo( std::string bitMask ); void decodePassedInfo( std::string bitMask ); void decodeExecStreamInfo( std::string bitMask ); void decodeTimingInfo( float *timingInfo ); // Members to tell how big the class is int bankSize( ); int execBankSize( ); int nMods( ); int nPaths( ); int nStreams( ); int nEvents( ); // Members to find out the index or name of a module int moduleIndex( std::string moduleName, std::string pathName ); int moduleIndex( int nPath, int nModInPath ); int pathIndex( std::string pathName ); std::string pathName( int index ); std::string streamName( int index ); // Members to get passed info bool moduleQueried( std::string moduleName, std::string pathName ); bool modulePassed( std::string moduleName, std::string pathName ); bool moduleExecuted(std::string moduleName, std::string pathName ); // Members to read and write banks #ifndef USE_CDFEDM2 void #else Id #endif writeTL3B( AppFramework *framework, APPList* streams, AbsEvent* anEvent ); #ifndef USE_CDFEDM2 TL3D_Bank* #else Handle #endif writeTL3D( AppFramework *framework, APPList* streams); #ifndef USE_CDFEDM2 void #else Id #endif writeTL3T( AppFramework * framework, AbsEvent* anEvent ); void readTL3B ( AbsEvent* anEvent ); void readTL3D ( AbsEvent* anEvent ); void readTL3T ( AbsEvent* anEvent ); // Members to print to files and store info void writeFile( ); void writePassedFile( ); void storeExecInfo( ); void storeTime( ); void writeTime( AppFramework *framwork ); void writeTimeFile( AppFramework *framework ); private: //************************** // Data members //************************** // This structure is a list of PathNodes. Each path node // corresponds to a path in the event. By looping through // This list one can see all the paths of the event. // More correctly, This is a pointer to a list of pointer // to path Nodes APPList* pathList; // This structure is a list of StreamNode. Each stream node // corresponds to a stream in the event. If one loops over // This list, it is possible to access information about each // stream. APPList* streamList; // This structure is a list of pointers to booleans containing // information about if each MODULE in the path list passed APPList* passedStats; // The number of Modules int _nMods; // The number of Paths int _nPaths; // The number of Streams int _nStreams; // The number of Events int _nEvents; // An array of ints contains passed info int* passed; // A temporary boolean array bool* passedThisEvent; // An array of ints containing stream passed info int* streamPassed; // A 2-dimensional array conatining the path matrix int** pathMatrix; // An array of floats contained the modules cpuTime float* cpuTime; }; #endif