#include <ThingsTSelector.h>
Public Member Functions | |
void | begin (TList *&) |
void | postProcessing (TList &) |
void | preProcessing (const TList *, TList &) |
void | process (const edm::Event &) |
void | terminate (TList &) |
ThingsTSelector () | |
Private Member Functions | |
ThingsTSelector | operator= (ThingsTSelector const &) |
ThingsTSelector (ThingsTSelector const &) | |
Private Attributes | |
TH1F * | h_a |
histograms | |
TH1F * | h_refA |
Definition at line 16 of file ThingsTSelector.h.
tfwliteselectortest::ThingsTSelector::ThingsTSelector | ( | ) | [inline] |
Definition at line 18 of file ThingsTSelector.h.
tfwliteselectortest::ThingsTSelector::ThingsTSelector | ( | ThingsTSelector const & | ) | [private] |
void ThingsTSelector::begin | ( | TList *& | in | ) | [virtual] |
Called each time the 'client' begins processing (remote 'slaves' do not see this message)
in | an assignable pointer to a list of objects you want passed to 'preProcessing'. This list is used to communicate with remote slaves. NOTE: you are responsible for deleting this TList and its content once you are done with it. |
Implements TFWLiteSelectorBasic.
Definition at line 14 of file ThingsTSelector.cc.
{ }
ThingsTSelector tfwliteselectortest::ThingsTSelector::operator= | ( | ThingsTSelector const & | ) | [private] |
void ThingsTSelector::postProcessing | ( | TList & | out | ) | [virtual] |
Called each time the 'slave' has seen all the events
out | the list of objects that will be sent to 'terminate'. You can Add() additional objects to 'out' at this point as well. |
Implements TFWLiteSelectorBasic.
Definition at line 76 of file ThingsTSelector.cc.
{ }
void ThingsTSelector::preProcessing | ( | const TList * | in, |
TList & | out | ||
) | [virtual] |
Called each time the 'slave' is about to start processing
in | a pointer to the list of objects created in 'begin()'. The pointer can be 0 |
out | a list of objects that are the result of processing (e.g. histograms). You should call 'Add()' for each object you want sent to the 'terminate' method. |
Implements TFWLiteSelectorBasic.
Definition at line 18 of file ThingsTSelector.cc.
void ThingsTSelector::process | ( | const edm::Event & | event | ) | [virtual] |
Call each time the 'slave' gets a new Event
event | a standard edm::Event which works just like it does in cmsRun |
Implements TFWLiteSelectorBasic.
Definition at line 36 of file ThingsTSelector.cc.
References gather_cfg::cout, exception, edm::Event::getByLabel(), h_a, h_refA, i, cms::Exception::what(), and x.
{ std::cout << "processing event " << std::endl; // chain->GetEntry( entry ); using namespace edmtest; edm::Handle<OtherThingCollection> hOThings; try { iEvent.getByLabel("OtherThing", "testUserTag", hOThings); std::cout << ">> other things found:" << hOThings->size() << std::endl; for ( size_t i = 0; i < hOThings->size(); ++i ) { const OtherThing & thing = (*hOThings)[ i ]; h_refA ->Fill( thing.ref->a ); std::cout << ">> ref->a: " << thing.ref->a << std::endl; } edm::Handle<ThingCollection> hThings; iEvent.getByLabel("Thing",hThings); const ThingCollection& things = *hThings; std::cout << ">> things found:" << things.size() << std::endl; for ( size_t i = 0; i < things.size(); ++i ) { const Thing & thing = things[ i ]; h_a ->Fill( thing.a ); std::cout << ">> a: " << thing.a << std::endl; } } catch (cms::Exception& x) { std::cout << std::endl << "Failed with cms::Exception: " << std::endl; std::cout << x.what() << std::endl; abort(); } catch (std::exception& x) { std::cout << std::endl << "Failed with std::exception" << std::endl; std::cout << x.what() << std::endl; abort(); } catch (...) { std::cout << std::endl << "Failed with unknown exception" << std::endl; abort(); } }
void ThingsTSelector::terminate | ( | TList & | out | ) | [virtual] |
Called each time the 'client' has finished processing.
out | contains the accumulated output of all slaves. |
Implements TFWLiteSelectorBasic.
Definition at line 80 of file ThingsTSelector.cc.
References MultipleCompare::canvas, gather_cfg::cout, estimatePileup::hist, kA, and kRefA.
{ std::cout << "terminate" << std::endl; TCanvas * canvas = new TCanvas( ); { TObject* hist = out.FindObject(kA); if(0 != hist) { hist->Draw(); canvas->SaveAs( "a.jpg" ); } else { std::cout <<"no '"<<kA<<"' histogram"<< std::endl; } } { TObject* hist = out.FindObject(kRefA); if(0 != hist) { hist->Draw(); canvas->SaveAs( "refA.jpg" ); } else { std::cout <<"no '"<<kRefA<<"' histogram"<< std::endl; } } delete canvas; }
TH1F* tfwliteselectortest::ThingsTSelector::h_a [private] |
histograms
Definition at line 27 of file ThingsTSelector.h.
Referenced by preProcessing(), and process().
TH1F * tfwliteselectortest::ThingsTSelector::h_refA [private] |
Definition at line 27 of file ThingsTSelector.h.
Referenced by preProcessing(), and process().