{ // ======================================================================== // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug) Int_t iVerbose = 1; // Input file (MC events) TString input="demo"; TString inFile = input; inFile.Append(".mc.root"); TString outFile = input; outFile.Append(".digi.root"); // TString inFile = "data/pions.mc.root"; //TString inFile = "data/etacphiphi.mc.root"; //TString inFile = "$PANDAMC/FAIRRoot/lambdas.mc.root"; // Output file //TString outFile = "$PANDAMC/FAIRRoot/lambdas.noDt.raw.root"; //TString outFile = "data/pions.raw.root"; //TString outFile = "data/test.raw.root"; // Parameter file TString parFile = input+".param.root"; // ---- Load libraries ------------------------------------------------- gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); basiclibs(); gSystem->Load("libGeoBase"); gSystem->Load("libParBase"); gSystem->Load("libBase"); gSystem->Load("libPndData"); gSystem->Load("libField"); gSystem->Load("libGen"); gSystem->Load("libPassive"); gSystem->Load("libtpc"); gSystem->Load("libgenfit"); // ------------------------------------------------------------------------ // --- Now choose concrete engines for the different tasks ------------- // ------------------------------------------------------------------------ // In general, the following parts need not be touched // ======================================================================== // ----- Timer -------------------------------------------------------- TStopwatch timer; timer.Start(); // ------------------------------------------------------------------------ // ----- Digitization run ------------------------------------------- FairRunAna *fRun= new FairRunAna(); fRun->SetInputFile(inFile); fRun->SetOutputFile(outFile); // ------------------------------------------------------------------------ // ----- Parameter database -------------------------------------------- FairRuntimeDb* rtdb = fRun->GetRuntimeDb(); FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE); parInput1->open(parFile.Data()); FairParAsciiFileIo* parInput2 = new FairParAsciiFileIo(); TString tpcDigiFile = gSystem->Getenv("VMCWORKDIR"); tpcDigiFile += "/tpc/tpc.TestChamber.par"; parInput2->open(tpcDigiFile.Data(),"in"); rtdb->setFirstInput(parInput2); rtdb->setSecondInput(parInput1); PndTpcDigiPar* par = (PndTpcDigiPar*) rtdb->getContainer("PndTpcDigiPar"); par->setInputVersion(fRun->GetRunId(),1); par->setChanged(kTRUE); rtdb->setOutput(parInput1); rtdb->saveOutput(); fRun->LoadGeometry(); // ------------------------------------------------------------------------ // GenfitTask *Genfit= new GenfitTask(); // fRun->AddTask(Genfit); // ----- PndTpc Event Mixer: Mixes background tracks to events ------------- // ----- Digi Sequence -------------------------------------------- PndTpcClusterizerTask* tpcClusterizer = new PndTpcClusterizerTask(); tpcClusterizer->SetPersistence(); fRun->AddTask(tpcClusterizer); PndTpcDriftTask* tpcDrifter = new PndTpcDriftTask(); tpcDrifter->SetPersistence(); //tpcDrifter->SetTransverseDiffuse(true); //tpcDrifter->SetLongitudinalDiffuse(true); tpcDrifter->SetDistort(false); fRun->AddTask(tpcDrifter); PndTpcGemTask* tpcGem = new PndTpcGemTask(); //tpcGem->SetGainFluctuations(); tpcGem->SetPersistence(); fRun->AddTask(tpcGem); PndTpcPadResponseTask* tpcPadResponse = new PndTpcPadResponseTask(); tpcPadResponse->SetPersistence(); fRun->AddTask(tpcPadResponse); //PndTpcEvtMixTask* evtmixer = new PndTpcEvtMixTask(); // evtmixer->SetBkgFileName("bkg2.raw.root"); // evtmixer->SetNBkgEvts(500); // evtmixer->SetEvtRate(1E7); //fRun->AddTask(evtmixer); PndTpcElectronicsTask* tpcElec = new PndTpcElectronicsTask(); tpcElec->SetSamplePersistence(); tpcElec->SetPersistence(); fRun->AddTask(tpcElec); PndTpcTestChamberOutputTask* out = new PndTpcTestChamberOutputTask(); out->SetOutfileName("dreggn2.root"); fRun->AddTask(out); // ----- Intialise and run -------------------------------------------- fRun->Init(); rtdb->print(); fRun->Run(0,0); // process all events from input file // ------------------------------------------------------------------------ out->writeToFile(); //tpcDrifter->WriteHistograms(); //tpcGem->WriteHistograms(); //tpcPadResponse->WriteHistograms(); // ----- Finish ------------------------------------------------------- //delete tpcSplitter; rtdb->saveOutput(); rtdb->print(); timer.Stop(); Double_t rtime = timer.RealTime(); Double_t ctime = timer.CpuTime(); cout << endl << endl; cout << "Macro finished succesfully." << endl; cout << "Output file is " << outFile << endl; cout << "Parameter file is " << parFile << endl; cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl; cout << endl; // ------------------------------------------------------------------------ }