// -*- C++/l -*- // // Description: ISOFFVTask object for the FGD cosmic trigger checker // // Author: Nicholas Hastings // Created: Friday 26 October 13:45:53 JST 2012 // #include "TFile.h" #include "TTree.h" #include "IFGDTriggerCheckTask.hxx" IFGDTriggerCheckTask::IFGDTriggerCheckTask( std::string fileName ) : fFileName(fileName), fFile(0) { } IFGDTriggerCheckTask::~IFGDTriggerCheckTask() { } int IFGDTriggerCheckTask::Initialize(void) { fFile = new TFile( fFileName.c_str(), "RECREATE" ); IFGDTriggerCheck::Initialize(); return 0; } int IFGDTriggerCheckTask::Process( COMET::ICOMETEvent& event ) { return IFGDTriggerCheck::Process( event ); } void IFGDTriggerCheckTask::SetFileName( const std::string& fileName ) { fFileName = fileName; } bool IFGDTriggerCheckTask::SetOption( std::string option, std::string value ) { if ( option == "fgd-tc-root-file" ) { SetFileName( value ); return true; } return false; } int IFGDTriggerCheckTask::Finalize( void ) { COMETVerbose("IFGDTriggerCheckTask::Finalize(void)"); TTree* t = GetTree(); fFile->WriteTObject( t ); fFile->Close(); return 0; }; // Local Variables: // c-basic-offset: 8 // c-file-offsets: ((access-label . -2)(inclass . 4)(innamespace . 2)) // End: