CMS 3D CMS Logo

DQMFlagXML.cc

Go to the documentation of this file.
00001 // Author : Samvel Khalatian (samvel at fnal dot gov)
00002 // Created: 07/15/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/TECFlagXML.h"
00011 #include "CalibTracker/SiStripRunSummary/interface/TIBFlagXML.h"
00012 #include "CalibTracker/SiStripRunSummary/interface/TIDFlagXML.h"
00013 #include "CalibTracker/SiStripRunSummary/interface/TOBFlagXML.h"
00014 
00015 #include "CalibTracker/SiStripRunSummary/interface/DQMFlagXML.h"
00016 #include "CalibTracker/SiStripRunSummary/interface/DQMFlagTxt.h"
00017 
00018 // --[ DQM FLAG XML ]----------------------------------------------------------
00019 //                                                  --[ PUBLIC ]--
00020 DQMFlagXML::DQMFlagXML( const DQMFlagTxt *poDQM_FLAGTXT)
00021   : FlagXML( *( dynamic_cast<const FlagTxt *>( poDQM_FLAGTXT) ) ) {}
00022 
00023 //                                                  --[ PROTECTED ]--
00024 Clonable *DQMFlagXML::cloneTxt() const {
00025   return new DQMFlagTxt( this);
00026 }
00027 
00028 ClassIDBase::ID DQMFlagXML::getID() const {
00029   return ClassID<DQMFlagXML>::get();
00030 }
00031 
00032 int DQMFlagXML::isChildValid( const FlagXML *poCHILD_CANDIDATE) const {
00033   return dynamic_cast<const TECFlagXML *>( poCHILD_CANDIDATE) ||
00034          dynamic_cast<const TIBFlagXML *>( poCHILD_CANDIDATE) ||
00035          dynamic_cast<const TIDFlagXML *>( poCHILD_CANDIDATE) ||
00036          dynamic_cast<const TOBFlagXML *>( poCHILD_CANDIDATE) ?
00037          1 :
00038          0;
00039 }
00040 
00041 // --[ HELPER FUNCTIONS ]------------------------------------------------------
00042 std::ostream &
00043   operator <<( std::ostream &roOut, const DQMFlagXML &roFLAG) {
00044 
00045   // Print DQM info: use Flag operator <<
00046   roOut << dynamic_cast<const Flag &>( roFLAG);
00047 
00048   // Try TEC Child
00049   if( TECFlagXML *poTECFlagXML = dynamic_cast<TECFlagXML *>( roFLAG.getChild<TECFlagXML>())) {
00050     roOut << std::endl << *poTECFlagXML;
00051   }
00052         
00053   // Try TIB Child
00054   if( TIBFlagXML *poTIBFlagXML = dynamic_cast<TIBFlagXML *>( roFLAG.getChild<TIBFlagXML>())) {
00055     roOut << std::endl << *poTIBFlagXML;
00056   }
00057 
00058   // Try TID Child
00059   if( TIDFlagXML *poTIDFlagXML = dynamic_cast<TIDFlagXML *>( roFLAG.getChild<TIDFlagXML>())) {
00060     roOut << std::endl << *poTIDFlagXML;
00061   }
00062 
00063   // Try TOB Child
00064   if( TOBFlagXML *poTOBFlagXML = dynamic_cast<TOBFlagXML *>( roFLAG.getChild<TOBFlagXML>())) {
00065     roOut << std::endl << *poTOBFlagXML;
00066   }
00067 
00068   return roOut;
00069 }

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