00001 // Author : Samvel Khalatian (samvel at fnal dot gov) 00002 // Created: 07/27/07 00003 // License: GPL 00004 00005 #include <ostream> 00006 00007 #include "CalibTracker/SiStripRunSummary/interface/ClassID.h" 00008 00009 // Include all subflags that current one may have 00010 #include "CalibTracker/SiStripRunSummary/interface/DAQFlagXML.h" 00011 #include "CalibTracker/SiStripRunSummary/interface/DCSFlagXML.h" 00012 #include "CalibTracker/SiStripRunSummary/interface/DQMFlagXML.h" 00013 #include "CalibTracker/SiStripRunSummary/interface/TriggerFlagXML.h" 00014 00015 #include "CalibTracker/SiStripRunSummary/interface/GlobalFlagXML.h" 00016 #include "CalibTracker/SiStripRunSummary/interface/GlobalFlagTxt.h" 00017 00018 // --[ GLOBAL FLAG XML ]------------------------------------------------------- 00019 // --[ PUBLIC ]-- 00020 GlobalFlagXML::GlobalFlagXML( const GlobalFlagTxt *poGLOBAL_FLAGTXT) 00021 : FlagXML( *( dynamic_cast<const FlagTxt *>( poGLOBAL_FLAGTXT) ) ) {} 00022 00023 // --[ PROTECTED ]-- 00024 Clonable *GlobalFlagXML::cloneTxt() const { 00025 return new GlobalFlagTxt( this); 00026 } 00027 00028 ClassIDBase::ID GlobalFlagXML::getID() const { 00029 return ClassID<GlobalFlagXML>::get(); 00030 } 00031 00032 int GlobalFlagXML::isChildValid( const FlagXML *poCHILD_CANDIDATE) const { 00033 return dynamic_cast<const DAQFlagXML *>( poCHILD_CANDIDATE) || 00034 dynamic_cast<const DCSFlagXML *>( poCHILD_CANDIDATE) || 00035 dynamic_cast<const DQMFlagXML *>( poCHILD_CANDIDATE) || 00036 dynamic_cast<const TriggerFlagXML *>( poCHILD_CANDIDATE) ? 00037 1 : 00038 0; 00039 } 00040 00041 // --[ HELPER FUNCTIONS ]------------------------------------------------------ 00042 std::ostream & 00043 operator <<( std::ostream &roOut, const GlobalFlagXML &roFLAG) { 00044 00045 // Print Global info: use Flag operator << 00046 roOut << dynamic_cast<const Flag &>( roFLAG); 00047 00048 // Try DAQ Child 00049 if( DAQFlagXML *poDAQFlagXML = 00050 dynamic_cast<DAQFlagXML *>( roFLAG.getChild<DAQFlagXML>()) ) { 00051 00052 roOut << std::endl << *poDAQFlagXML; 00053 } 00054 00055 // Try DCS Child 00056 if( DCSFlagXML *poDCSFlagXML = 00057 dynamic_cast<DCSFlagXML *>( roFLAG.getChild<DCSFlagXML>()) ) { 00058 00059 roOut << std::endl << *poDCSFlagXML; 00060 } 00061 00062 // Try DQM Child 00063 if( DQMFlagXML *poDQMFlagXML = 00064 dynamic_cast<DQMFlagXML *>( roFLAG.getChild<DQMFlagXML>()) ) { 00065 00066 roOut << std::endl << *poDQMFlagXML; 00067 } 00068 00069 // Try Trigger Child 00070 if( TriggerFlagXML *poTriggerFlagXML = 00071 dynamic_cast<TriggerFlagXML *>( roFLAG.getChild<TriggerFlagXML>()) ) { 00072 00073 roOut << std::endl << *poTriggerFlagXML; 00074 } 00075 00076 return roOut; 00077 }