#include "TObjString.h"
#include "TSystem.h"
#include "TUrl.h"
#include "hades.h"
#include "hruntimedb.h"
#include "hdstsimulation.h"
#include "hdstutilities.h"
#include "hrootsource.h"
#include "htool.h"
#include "hrichevtfilter.h"
#include "hpidtrackfiller.h"
#include "hqamaker.h"
#include "hrktrackBF.h"
#include "hpidpdfmaker.h"
#include "htaskset.h"
#include "htoftaskset.h"
#include "htofinotaskset.h"
#include "hrichtaskset.h"
#include "hrichIPUtaskset.h"
#include "hmdctaskset.h"
#include "hshowertaskset.h"
#include "htriggertaskset.h"
#include "hsplinetaskset.h"
#include "hkicktaskset.h"
using namespace std;
ClassImp(HDstSimulation)
void HDstSimulation::setupInput()
{
HRootSource* source = NULL;
TObjArray* files = NULL;
TIterator* file = NULL;
TObjString* filename = NULL;
TObjArray* local_files = NULL;
TIterator* local_file = NULL;
TString directory;
files = dstCfg.inputUrl.Tokenize( " \t" );
file = files->MakeIterator();
file->Reset();
while ((filename = (TObjString*)file->Next()))
{
TUrl url( filename->GetString().Data(), kTRUE );
if (!source)
{
source = new HRootSource;
source->replaceHeaderVersion( 0, kTRUE );
source->setGlobalRefId( dstCfg.referenceRunId );
source->setDirectory(
const_cast<Text_t*>(gSystem->DirName( url.GetFile() )) );
directory = gSystem->DirName( url.GetFile() );
}
if (strcmp( url.GetProtocol(), "file" ) == 0)
{
local_files = HTool::glob( url.GetFile() );
if (!local_files)
{
Error( "setupInput", "Input file(s) do not exist!" );
terminate( 2 );
}
local_file = local_files->MakeIterator();
while ((filename = (TObjString*)local_file->Next()))
{
if (directory.CompareTo(
gSystem->DirName( filename->GetString().Data() ) ) != 0)
{
Error( "setupInput", "Only one input directory allowed!" );
terminate( 2 );
}
if (!source->addFile(
const_cast<Text_t*>(gSystem->BaseName(
filename->GetString().Data() )) ))
{
Error( "setupInput", Form( "Adding input file '%s' failed!",
filename->GetString().Data() ) );
terminate( 2 );
}
}
delete local_file;
delete local_files;
}
else
{
Error( "setupInput", "Input URL must refer to a local file!" );
terminate( 2 );
}
}
delete file;
gHades->setDataSource( source );
}
void HDstSimulation::setupTaskList()
{
HTofTaskSet* tof_task_set = new HTofTaskSet();
HTofinoTaskSet* tofino_task_set = new HTofinoTaskSet();
HRichTaskSet* rich_task_set = new HRichTaskSet();
HRichIPUTaskSet* rich_ipu_task_set = new HRichIPUTaskSet();
HMdcTaskSet* mdc_task_set = new HMdcTaskSet();
HShowerTaskSet* shower_task_set = new HShowerTaskSet();
HSplineTaskSet* spline_task_set = new HSplineTaskSet( "", "" );
HTriggerTaskSet* trigger_task_set = new HTriggerTaskSet();
HTask* tracking_tasks = spline_task_set->make(
"", "spline,reslowb,&old,tofclust,simulation,runge" );
HQAMaker* qa_report_task = new HQAMaker( "qa.maker", "qa.maker" );
qa_report_task->setOutputDir( const_cast<char*>(dstCfg.qaOutputDir.Data()));
qa_report_task->setSamplingRate( 1 );
qa_report_task->setIntervalSize( dstCfg.qaEventInterval );
HTaskSet* event_filter_task_set = NULL;
if (dstCfg.dstId.Contains( "URQMD", TString::kIgnoreCase ))
{
event_filter_task_set =
new HTaskSet( "EvtFilter", "List of Evt Filter Tasks" );
event_filter_task_set->connect(
new HRichEvtFilter("Tof+Tofino_Mult","Tof+Tofino_Mult","tofmult",18));
}
HPidPdfMaker* pdf_maker_task = NULL;
if (dstCfg.createControlNTuple)
pdf_maker_task = new HPidPdfMaker(
HDstUtilities::GetFileStem(
dstCfg.qaOutputDir.IsNull() ?
dstCfg.outputDir : dstCfg.qaOutputDir, dstCfg.inputUrl )
+ "_ntuple.root", kFALSE );
HTaskSet* tasks = gHades->getTaskSet( "simulation" );
tasks->add( tof_task_set->make( "simulation" ) );
tasks->add( tofino_task_set->make( "", "simulation" ) );
if (dstCfg.dstId.Contains( "URQMD", TString::kIgnoreCase ))
{
tasks->add( event_filter_task_set );
}
tasks->add( rich_task_set->make( "simulation", "noiseon" ));
tasks->add( rich_ipu_task_set->make( "simulation" ) );
tasks->add( mdc_task_set->make( "rtdb", "" ) );
tasks->add( shower_task_set->make( "", "simulation,leprecognition" ) );
tasks->add( trigger_task_set->make( "simulation" ) );
tasks->add( tracking_tasks );
tasks->add( new HPidTrackFiller( "makesimcategory,NOCHI2SEG0,NOCHI2SEG1"));
tasks->add( qa_report_task );
if (pdf_maker_task)
{
tasks->add( pdf_maker_task );
}
tasks->isTimed( kTRUE );
}
Last change: Sat May 22 12:54:58 2010
Last generated: 2010-05-22 12:54
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.