00001
00002
00003 #include "VisReco/VisEcal/interface/VisEcalRecoContent.h"
00004 #include "VisReco/VisEcal/interface/VisEcalUncalibratedRecHitTwig.h"
00005 #include "VisReco/VisEcal/interface/VisEcalRecHitTwig.h"
00006 #include "VisReco/VisEcal/interface/VisBasicClusterCollectionTwig.h"
00007 #include "VisReco/VisEcal/interface/VisSuperClusterCollectionTwig.h"
00008 #include "VisFramework/VisFrameworkBase/interface/VisExceptionService.h"
00009 #include "Iguana/Studio/interface/IgDocumentData.h"
00010 #include "Iguana/Framework/interface/IgTwig.h"
00011 #include "Iguana/Studio/interface/IgQtLock.h"
00012 #include <classlib/utils/Callback.h>
00013
00014
00015
00016
00017
00018
00019
00020
00021 IG_DEFINE_STATE_ELEMENT (VisEcalRecoContent, "Data/Reco/Ecal");
00022
00023
00024
00025
00026
00028 VisEcalRecoContent::VisEcalRecoContent (IgState *state)
00029 : VisContent (state, s_key, MAIN_THREAD,
00030 lat::CreateCallback (this, &VisEcalRecoContent::init))
00031 {
00032 }
00033
00036 void
00037 VisEcalRecoContent::init (void)
00038 {
00039 IgQtLock ();
00040
00041 IgTwig *rootTwig = IgDocumentData::get (state ())->root ();
00042 IgTwig *topTwig = 0;
00043 IgTwig *eventTwig = 0;
00044
00045 topTwig = rootTwig->lookup ("CMS Event and Detector");
00046 if (!topTwig) topTwig = new IgSimpleTwig (rootTwig, "CMS Event and Detector");
00047
00048 std::vector<std::string> twigs (3);
00049 twigs.push_back ("VisEcalUncalibratedRecHitTwig");
00050 twigs.push_back ("VisEcalRecHitTwig");
00051 twigs.push_back ("VisBasicClusterCollectionTwig");
00052 twigs.push_back ("VisSuperClusterCollectionTwig");
00053
00054 const edm::ParameterSet *pset = VisConfigurationService::pSet ();
00055 if (pset)
00056 {
00057 twigs = pset->getUntrackedParameter<std::vector<std::string> > ("VisEcalContent", twigs);
00058 }
00059
00060 VisExceptionService *exService = VisExceptionService::get (state ());
00061 if (! exService)
00062 {
00063 exService = new VisExceptionService (state ());
00064 }
00065
00066 IgTwig *ecalEventTwig = new IgSimpleTwig (topTwig, "ECAL Event");
00067
00068 if (std::find (twigs.begin (), twigs.end (), "VisEcalUncalibratedRecHitTwig") != twigs.end ())
00069 {
00070 VisEcalUncalibratedRecHitTwig *ucRecHits = new VisEcalUncalibratedRecHitTwig (state (), ecalEventTwig, "Uncalibrated Rec Hits");
00071 ucRecHits->onException (lat::CreateCallback (exService, &VisExceptionService::exceptionCallback));
00072 ucRecHits->onError (lat::CreateCallback (exService, &VisExceptionService::errorCallback));
00073 ucRecHits->onCmsException (lat::CreateCallback (exService, &VisExceptionService::cmsExceptionCallback));
00074 ucRecHits->onUnhandledException (lat::CreateCallback (exService, &VisExceptionService::unhandledExceptionCallback));
00075 }
00076
00077 if (std::find (twigs.begin (), twigs.end (), "VisEcalRecHitTwig") != twigs.end ())
00078 {
00079 VisEcalRecHitTwig *recHits = new VisEcalRecHitTwig (state (), ecalEventTwig, "Rec Hits");
00080 recHits->onException (lat::CreateCallback (exService, &VisExceptionService::exceptionCallback));
00081 recHits->onError (lat::CreateCallback (exService, &VisExceptionService::errorCallback));
00082 recHits->onCmsException (lat::CreateCallback (exService, &VisExceptionService::cmsExceptionCallback));
00083 recHits->onUnhandledException (lat::CreateCallback (exService, &VisExceptionService::unhandledExceptionCallback));
00084 }
00085 if (std::find (twigs.begin (), twigs.end (), "VisBasicClusterCollectionTwig") != twigs.end ())
00086 {
00087 VisBasicClusterCollectionTwig *bclustres = new VisBasicClusterCollectionTwig (state (), ecalEventTwig, "Basic Clusters");
00088 bclustres->onException (lat::CreateCallback (exService, &VisExceptionService::exceptionCallback));
00089 bclustres->onError (lat::CreateCallback (exService, &VisExceptionService::errorCallback));
00090 bclustres->onCmsException (lat::CreateCallback (exService, &VisExceptionService::cmsExceptionCallback));
00091 bclustres->onUnhandledException (lat::CreateCallback (exService, &VisExceptionService::unhandledExceptionCallback));
00092 }
00093 if (std::find (twigs.begin (), twigs.end (), "VisSuperClusterCollectionTwig") != twigs.end ())
00094 {
00095 VisSuperClusterCollectionTwig *sclustres = new VisSuperClusterCollectionTwig (state (), ecalEventTwig, "Super Clusters");
00096 sclustres->onException (lat::CreateCallback (exService, &VisExceptionService::exceptionCallback));
00097 sclustres->onError (lat::CreateCallback (exService, &VisExceptionService::errorCallback));
00098 sclustres->onCmsException (lat::CreateCallback (exService, &VisExceptionService::cmsExceptionCallback));
00099 sclustres->onUnhandledException (lat::CreateCallback (exService, &VisExceptionService::unhandledExceptionCallback));
00100 }
00101 }