//-------------------------------------------------------------------------- // File and Version Information: // $Id: APPLevel3FileOutputModule.hh, // v 1.12 1999/04/01 18:04:33 sexton Exp $ // // Description: // Class APPLevel3GenericOutputModule. This class derives from StreamsOutput // and adds functionality generic to Level3 and Level3 testing, independent // of event I/O method. // // This output module may be run in a stand-alone // mode to produce file output with Level3 result banks. // // Environment: // CDF Run II Level-3 Trigger // // Author List: // Kevin McFarland/Mike Carew Original Authors // // Copyright Information: // //------------------------------------------------------------------------ #ifndef APPLEVEL3GENERICOUTPUTMODULE_HH #define APPLEVEL3GENERICOUTPUTMODULE_HH //----------------------- // Experiment Headers -- //----------------------- #include "BaBar/Experiment.hh" //---------------------- // Base Class Headers -- //---------------------- #include "Framework/AppStreamsOutputModule.hh" //------------------------------------ // Collaborating Class Declarations -- //------------------------------------ #include "Framework/AbsParmGeneral.hh" #include "Framework/AbsParmList.hh" #include "Trybos/TRY_Record_Implementations.hh" #include "Edm/IoFilterLists.hh" #include #include "TriggerObjects/TL3D_StorableBank.hh" #ifndef TRY_DATAREP_CONVERTER_HH #include "Trybos/private/TRY_Datarep_Converter.hh" #endif #include "ErrorLogger/ELstatistics.h" #include "ErrorLogger/ELdestControl.h" #include "ErrorLogger/ELerrorList.h" #include "ErrorLogger/ErrorObj.h" class Level3Accountant; //------------------- // Online System Headers //------------------- extern "C" { // includes cs_l3_selection_mask_t #include "ConsumerInterface/l3_cs_pointer_space.h" } //------------------- // Typedefs //------------------- typedef std::pair errorStatus; // --------------------- // -- Class Interface -- // --------------------- class APPLevel3GenericOutputModule : public AppStreamsOutputModule { //-------------------- // Instance Members -- //-------------------- // input module must be a friend to read configuration information // from the GenericOutputModule friend class APPLevel3InputModule; friend class FileLevel3Interface; friend class Level3Accountant; public: // Constructors APPLevel3GenericOutputModule( const char* const theName = "Level3GenericOutput", const char* const theDescription = "Standard File Output Module", const int4 exeTag = -1 ) ; // Destructor virtual ~APPLevel3GenericOutputModule( ); // Operations: // add implementations of // beginRun/endRun/childOutputEvent methods to // keep event statistics and add to the event virtual AppResult beginRun( AbsEvent* anEvent ); virtual AppResult childBeginRun( AbsEvent* anEvent ); virtual AppResult endRun( AbsEvent* anEvent ); virtual AppResult childOutputEvent( AbsEvent* anEvent, const AppStopType& theDispatchStopType ); // for initialization of Root virtual AppResult beginJob( AbsEvent* anEvent ); // method to form required information for Level-3 results reporting void formLevel3RunEventResults( AbsEvent* anEvent ); void formLevel3RunBeginResults( AbsEvent* anEvent ); // method to form a replacement LRIH bank void createLevel3LRIH(int thePartition, AbsEvent* anEvent); // method to write into the L3_CS_POINTER_SPACE void fillLevel3CsPointerSpace( int4* spaceStart, int spaceLength, long theSenderIdentification, int thePartition, bool normalEvent, bool errorOccurred, bool passedTrigger, AbsEvent* anEvent ); // method to query current time long whatTime(int musecMult, long tOffset); // method to determine if a stream Passes // 2nd argument is used to force BORs to pass all streams // 3rd argument allows events with errors to pass to a stream bool streamPassCriteria(AppStream** theStream, bool passNoMatterWhat, bool errorStreamEvent); // Selectors const char * rcsId( ) const; errorStatus errorEvent(bool resetError=true); // information for filling TL3D int getExeNumber() const{ return TL3D_Identifier::undefinedIdentifier;}; int4 getHost() const{ return TL3D_Identifier::undefinedIdentifier;}; int4 getExeVersion() const{ return TL3D_Identifier::undefinedIdentifier;}; int4 getExeTag() const{ return _exeTag;}; int4 getTclTag() const{ return _tclTag.value();}; int4 getCalibTag() const{ return _calibTag.value();}; AbsParmGeneral _useErrorEventStream; protected: // member data for storing Level-3 results cs_l3_selection_mask_t _cslMask; // TRYBOS representation converters TRY_Datarep_Converter _senderConverter; // talk-to parameters (to be inherited and used in derived classes) AbsParmGeneral _dumpResultMasks; AbsParmGeneral _debug; AbsParmGeneral _noLevel3Accountant; AbsParmGeneral _noLevel3CpuMonitor; AbsParmGeneral _enableOldTL3 ; AbsParmGeneral _enableNewTL3 ; AbsParmGeneral _disableNewLRIH; AbsParmGeneral _passFailedEvents; AbsParmGeneral _passFailedSummary; AbsParmGeneral _zeroStreamMask; // keep track of whether or not BOR/EOR already sent bool _sentBeginRun; bool _sentEndRun; bool _initdone; // member data for filling TL3D information // (checked by the OnlineOutputModule against interface) AbsParmGeneral _tclTag; AbsParmGeneral _calibTag; int4 _exeTag; // modifier to drop/keep events in online drop/keep list (across all streams) void onlineDropKeep(AbsEvent* anEvent); // Data structure info used by derived classes virtual int headerWords() const =0; // Trigger data used by derived classes AbsParmList _L1TriggerNames; AbsParmList _L1TriggerBits; AbsParmList _L1TriggerIds; AbsParmList _L2TriggerNames; AbsParmList _L2TriggerBits; AbsParmList _L2TriggerIds; AbsParmList _L3PathNames; AbsParmList _L3PathBits; AbsParmList _L3PathIds; AbsParmList _L3PathDatasetNames; AbsParmList _L3PathDatasetIds; private: // member data to store Level-3 results Level3Accountant* _theLevel3Accountant; // member data for fake crossing triggers AbsParmGeneral _fakeCrossingTrigger; AbsParmGeneral _createRunSection; AbsParmGeneral _initialRunSection; AbsParmGeneral _crossingsPerRunSection; AbsParmGeneral _fakeRunNumber; AbsParmGeneral _fakeEventNumber; AbsParmGeneral _nodeEventOffset; AbsParmGeneral _maxNodeEventOffset; AbsParmGeneral _timeGranularity; AbsParmGeneral _crossingTriggerPeriod; AbsParmGeneral _useEvclBits; AbsParmGeneral _preferTFRDLevel1Bits; AbsParmGeneral _streamByName; long _nCrossingTrigger; long _nTrigger; long _lastEvent; long _realStartTime; long _runSectionOffset; // error logger tracking std::list _localErrorList; ELerrorList* _localElBuffer; ELdestControl* _localElControl; int _storedErrorCount; std::list _errorBuffer; // this is the list for the errorSummary // error stream AbsParmGeneral _errorStreamName; std::string _reducedErrorStream; // used by onlineDropKeep list to combine passing streams lists edm::ProcessList_t _combinedProcKeepList; edm::ClassDescList_t _combinedDropClasses; edm::ClassDescList_t _combinedKeepClasses; // internal utility routine void setStreamMask(const int nstream, const std::string theName); }; // This global fuction should go somewhere else (like in the edm package) but // I want to keep the patch list as small as possible for now...-LSK void mergeUnique( edm::ClassDescList_t* dest, const edm::ClassDescList_t* input); // And in order to avoid template functions... void mergeUnique( edm::ProcessList_t* dest, const edm::ProcessList_t* input); void intersectUnique( edm::ClassDescList_t* dest, const edm::ClassDescList_t* input); #endif