/*************************************************************************** * Author : Tiago Perez * * II Physikalisches Institut * * Universitaet Giessen * * * * Title : fillHyContExp.cc * * Project: HYDRA Event Hypothesys (HADES) * * Description: * * * * Modified : * * 2005.02.11 T. Perez Created * * * * * ***************************************************************************/ #include "fillPidHypContExp.h" #include "hhypreconstructor.h" using namespace std; Int_t fillPidNtupleExp(TString inFile, Int_t nEvents=0, Int_t startEvt=0) { // real or simulation Char_t *context="real"; // parameter files TString paramFile1="/home/jacek/hydra/dev/params/pidparams_exp.root"; TString paramFile2="/home/jacek/hydra/dev/params/pidparams_exp.root"; // input and output data files TString inDir = "/d/c2/hadeshyp/output/"; TString outDir = "/d/c2/jacek/jan04/postdst/"; TString inputFile=inFile+".root"; TString outFile=outDir+inFile+"_hyp.root"; TString pidNtFile=outDir+inFile+"_pid_ntup.root"; TString hypNtFile=outDir+inFile+"_hyp_ntup.root"; //TFile * hfile = new TFile(hypNtFile,"RECREATE","Demo ROOT file with hyp ntupla"); TStopwatch timer; Int_t evN=0; // set gHades if(gHades == NULL) new Hades; gHades->setTreeBufferSize(8000); cout<< " Setting configuration..." << endl; //Create hades if (!gHades) new Hades; gHades->setTreeBufferSize(8000); HPidPerformaceTestExp *pidNtFiller = new HPidPerformaceTestExp(pidNtFile.Data()); //Set batch (needed for TCanvas's) gROOT->SetBatch(); //Add input files HRootSource *source=new HRootSource(kFALSE); source->setDirectory((Text_t*)inDir.Data()); source->addFile((Text_t*)inputFile.Data()); gHades->setDataSource(source); //source->setGlobalRefId(nRunId); //parameter files HRuntimeDb* rtdb=gHades->getRuntimeDb(); HParRootFileIo *input1=new HParRootFileIo; input1->open((Text_t*)paramFile1.Data(),"READ"); HParRootFileIo *input2=new HParRootFileIo; input2->open((Text_t*)paramFile2.Data(),"READ"); rtdb->setSecondInput(input2); //------------------------ Add PID Tasks ----------------------------- gHades->getTaskSet(context)->add(pidNtFiller); gHades->getTaskSet(context)->print(); //------------------------ Initialization ---------------------------- cout<<"gHades->init()\n"; gHades->makeCounter(1000); if(!gHades->init()) cerr<<"Error\n"; //Set output //gHades->setOutputFile((Text_t*)outFile.Data(),"RECREATE","Test",2); //gHades->makeTree(); //-------------------------------------------------------------------- cout<<"Processing events...\n"; timer.Reset(); timer.Start(); if (nEvents<1) { evN=gHades->eventLoop(); } else { evN=gHades->eventLoop(nEvents,startEvt); } gHades->getTaskSet(context)->printTimer(); printf("rtdb deleted\n"); /* gHades->getRuntimeDb()->removeContainer("PidTrackFillerPar"); gHades->getRuntimeDb()->removeContainer("PidReconstructorPar"); gHades->getRuntimeDb()->removeContainer("PidAlgMomVsBetaPar"); */ delete gHades; timer.Stop(); cout<<"------------------------------------------------------\n"; cout<<"Events processed: "<