CMS 3D CMS Logo

GlobalFlagTxt.cc

Go to the documentation of this file.
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/DAQFlagTxt.h"
00011 #include "CalibTracker/SiStripRunSummary/interface/DCSFlagTxt.h"
00012 #include "CalibTracker/SiStripRunSummary/interface/DQMFlagTxt.h"
00013 #include "CalibTracker/SiStripRunSummary/interface/TriggerFlagTxt.h"
00014 
00015 #include "CalibTracker/SiStripRunSummary/interface/GlobalFlagTxt.h"
00016 #include "CalibTracker/SiStripRunSummary/interface/GlobalFlagXML.h"
00017 
00018 // --[ GLOBAL FLAG TXT ]-------------------------------------------------------
00019 //                                                  --[ PUBLIC ]--
00020 GlobalFlagTxt::GlobalFlagTxt( const GlobalFlagXML *poGLOBAL_FLAGXML)
00021   : FlagTxt( *( dynamic_cast<const FlagXML *>( poGLOBAL_FLAGXML) ) ) {}
00022 
00023 //                                                  --[ PROTECTED ]--
00024 Clonable *GlobalFlagTxt::cloneXML() const {
00025   return new GlobalFlagXML( this);
00026 }
00027 
00028 ClassIDBase::ID GlobalFlagTxt::getID() const {
00029   return ClassID<GlobalFlagTxt>::get();
00030 }
00031 
00032 int GlobalFlagTxt::isChildValid( const FlagTxt *poCHILD_CANDIDATE) const {
00033   return dynamic_cast<const DAQFlagTxt     *>( poCHILD_CANDIDATE) ||
00034          dynamic_cast<const DCSFlagTxt     *>( poCHILD_CANDIDATE) ||
00035          dynamic_cast<const DQMFlagTxt     *>( poCHILD_CANDIDATE) ||
00036          dynamic_cast<const TriggerFlagTxt *>( poCHILD_CANDIDATE) ?
00037          1 :
00038          0;
00039 }
00040 
00041 // --[ HELPER FUNCTIONS ]------------------------------------------------------
00042 std::ostream &
00043   operator <<( std::ostream &roOut, const GlobalFlagTxt &roFLAG) {
00044 
00045   // Print Global info: use Flag operator <<
00046   roOut << dynamic_cast<const Flag &>( roFLAG);
00047 
00048   // Try DAQ Child
00049   if( DAQFlagTxt *poDAQFlagTxt = 
00050         dynamic_cast<DAQFlagTxt *>( roFLAG.getChild<DAQFlagTxt>()) ) {
00051 
00052     roOut << std::endl << *poDAQFlagTxt;
00053   }
00054 
00055   // Try DCS Child
00056   if( DCSFlagTxt *poDCSFlagTxt = 
00057         dynamic_cast<DCSFlagTxt *>( roFLAG.getChild<DCSFlagTxt>()) ) {
00058 
00059     roOut << std::endl << *poDCSFlagTxt;
00060   }
00061 
00062   // Try DQM Child
00063   if( DQMFlagTxt *poDQMFlagTxt = 
00064         dynamic_cast<DQMFlagTxt *>( roFLAG.getChild<DQMFlagTxt>()) ) {
00065 
00066     roOut << std::endl << *poDQMFlagTxt;
00067   }
00068 
00069   // Try Trigger Child
00070   if( TriggerFlagTxt *poTriggerFlagTxt = 
00071         dynamic_cast<TriggerFlagTxt *>( roFLAG.getChild<TriggerFlagTxt>()) ) {
00072 
00073     roOut << std::endl << *poTriggerFlagTxt;
00074   }
00075 
00076   return roOut;
00077 }

Generated on Tue Jun 9 17:25:53 2009 for CMSSW by  doxygen 1.5.4