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/TECFlagTxt.h" 00011 #include "CalibTracker/SiStripRunSummary/interface/TIBFlagTxt.h" 00012 #include "CalibTracker/SiStripRunSummary/interface/TIDFlagTxt.h" 00013 #include "CalibTracker/SiStripRunSummary/interface/TOBFlagTxt.h" 00014 00015 #include "CalibTracker/SiStripRunSummary/interface/DCSFlagTxt.h" 00016 #include "CalibTracker/SiStripRunSummary/interface/DCSFlagXML.h" 00017 00018 // --[ DCS FLAG TXT ]---------------------------------------------------------- 00019 // --[ PUBLIC ]-- 00020 DCSFlagTxt::DCSFlagTxt( const DCSFlagXML *poDCS_FLAGXML) 00021 : FlagTxt( *( dynamic_cast<const FlagXML *>( poDCS_FLAGXML) ) ) {} 00022 00023 // --[ PROTECTED ]-- 00024 Clonable *DCSFlagTxt::cloneXML() const { 00025 return new DCSFlagXML( this); 00026 } 00027 00028 ClassIDBase::ID DCSFlagTxt::getID() const { 00029 return ClassID<DCSFlagTxt>::get(); 00030 } 00031 00032 int DCSFlagTxt::isChildValid( const FlagTxt *poCHILD_CANDIDATE) const { 00033 return dynamic_cast<const TECFlagTxt *>( poCHILD_CANDIDATE) || 00034 dynamic_cast<const TIBFlagTxt *>( poCHILD_CANDIDATE) || 00035 dynamic_cast<const TIDFlagTxt *>( poCHILD_CANDIDATE) || 00036 dynamic_cast<const TOBFlagTxt *>( poCHILD_CANDIDATE) ? 00037 1 : 00038 0; 00039 } 00040 00041 // --[ HELPER FUNCTIONS ]------------------------------------------------------ 00042 std::ostream & 00043 operator <<( std::ostream &roOut, const DCSFlagTxt &roFLAG) { 00044 00045 // Print DCS info: use Flag operator << 00046 roOut << dynamic_cast<const Flag &>( roFLAG); 00047 00048 // Try TEC Child 00049 if( TECFlagTxt *poTECFlagTxt = 00050 dynamic_cast<TECFlagTxt *>( roFLAG.getChild<TECFlagTxt>()) ) { 00051 00052 roOut << std::endl << *poTECFlagTxt; 00053 } 00054 00055 // Try TIB Child 00056 if( TIBFlagTxt *poTIBFlagTxt = 00057 dynamic_cast<TIBFlagTxt *>( roFLAG.getChild<TIBFlagTxt>()) ) { 00058 00059 roOut << std::endl << *poTIBFlagTxt; 00060 } 00061 00062 // Try TID Child 00063 if( TIDFlagTxt *poTIDFlagTxt = 00064 dynamic_cast<TIDFlagTxt *>( roFLAG.getChild<TIDFlagTxt>()) ) { 00065 00066 roOut << std::endl << *poTIDFlagTxt; 00067 } 00068 00069 // Try TOB Child 00070 if( TOBFlagTxt *poTOBFlagTxt = 00071 dynamic_cast<TOBFlagTxt *>( roFLAG.getChild<TOBFlagTxt>()) ) { 00072 00073 roOut << std::endl << *poTOBFlagTxt; 00074 } 00075 00076 return roOut; 00077 }