diff --git a/macro/mvd/qa/CMakeLists.txt b/macro/mvd/qa/CMakeLists.txt index 6e8da83d242834525dfa0abd25ac50c1c442cde8..cbecc2c9dfbbd6a860e6fa0507f13d2613c82aee 100644 --- a/macro/mvd/qa/CMakeLists.txt +++ b/macro/mvd/qa/CMakeLists.txt @@ -44,8 +44,26 @@ SET_TESTS_PROPERTIES(mvd_qa4_reco PROPERTIES TIMEOUT "300" PASS_REGULAR_EXPRESSION "Test Passed;All ok" FIXTURES_REQUIRED fixture_mvd_qa4_reco + FIXTURES_SETUP fixture_mvd_qa3_digitize_event ) +GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/mvd/qa/mvd_qa3_digitize_event.C) +add_test(mvd_qa3_digitize_event ${CBMROOT_BINARY_DIR}/macro/mvd/qa/mvd_qa3_digitize_event.sh) +SET_TESTS_PROPERTIES(mvd_qa3_digitize_event PROPERTIES + TIMEOUT "300" + PASS_REGULAR_EXPRESSION "Test Passed;All ok" + FIXTURES_REQUIRED fixture_mvd_qa3_digitize_event + FIXTURES_SETUP fixture_mvd_qa4_reco_event +) + +#GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/mvd/qa/mvd_qa4_reco_event.C) +#add_test(mvd_qa4_reco_event ${CBMROOT_BINARY_DIR}/macro/mvd/qa/mvd_qa4_reco_event.sh) +#SET_TESTS_PROPERTIES(mvd_qa4_reco_event PROPERTIES +# TIMEOUT "300" +# PASS_REGULAR_EXPRESSION "Test Passed;All ok" +# FIXTURES_REQUIRED fixture_mvd_qa4_reco_event +#) + Install(FILES mvd_qa1_transUrqmd.C mvd_qa2_transDelta.C mvd_qa3_digitize.C mvd_qa4_reco.C DESTINATION share/cbmroot/macro/mvd ) diff --git a/macro/mvd/qa/mvd_qa3_digitize_event.C b/macro/mvd/qa/mvd_qa3_digitize_event.C new file mode 100644 index 0000000000000000000000000000000000000000..4d1db4343b3f61da9d58046958e52ca827016470 --- /dev/null +++ b/macro/mvd/qa/mvd_qa3_digitize_event.C @@ -0,0 +1,113 @@ +/* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Florian Uhlig [committer], Volker Friese */ + +// -------------------------------------------------------------------------- +// +// Macro for local MVD reconstruction from MC data +// +// Tasks: CbmMvdHitProducer +// +// +// V. Friese 06/02/2007 +// +// -------------------------------------------------------------------------- +void mvd_qa3_digitize_event(const char* setup = "sis100_electron") +{ + + // ======================================================================== + // Adjust this part according to your requirements + + TString inDir = gSystem->Getenv("VMCWORKDIR"); + + TString outDir = "data/"; + // Input file (MC events) + TString inFile = outDir + "mvd.mcQA.root"; + + // Parameter file name + TString parFile = outDir + "params.root"; + + // Output file + TString outFile = outDir + "mvd.ev.rawQA.root"; + + // Background file (MC events, for pile-up) + TString bgFile = inFile; + + // Delta file (Au Ions) + TString deltaFile = outDir + "mvd.mcDelta.root"; + + // Number of events to process + Int_t nEvents = 5; + + // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug) + Int_t iVerbose = 3; + + FairLogger* logger = FairLogger::GetLogger(); + logger->SetLogScreenLevel("INFO"); + logger->SetLogVerbosityLevel("LOW"); + + TString setupFile = inDir + "/geometry/setup/setup_" + setup + ".C"; + TString setupFunct = "setup_"; + setupFunct = setupFunct + setup + "()"; + + gROOT->LoadMacro(setupFile); + gInterpreter->ProcessLine(setupFunct); + + // In general, the following parts need not be touched + // ======================================================================== + + + // ---- Debug option ------------------------------------------------- + gDebug = 0; + // ------------------------------------------------------------------------ + + + // ----- Timer -------------------------------------------------------- + TStopwatch timer; + timer.Start(); + // ------------------------------------------------------------------------ + + + // ------- MVD Digitiser ---------------------------------------------- + CbmMvdDigitizer* digi = new CbmMvdDigitizer("MVDDigitiser", 0, iVerbose); + std::cout << "Adding Task: CbmMvdDigitiser... " << std::endl; + // digi->ShowDebugHistograms(); + + // ----- Digitization run --------------------------------------------- + CbmDigitization run; + + + run.SetOutputFile(outFile, kTRUE); + run.SetParameterRootFile(parFile); + run.SetMode(cbm::sim::Mode::EventByEvent); + cbm::sim::TimeDist timeDist = cbm::sim::TimeDist::Uniform; + run.SetDigitizer(ECbmModuleId::kMvd, digi); + + run.AddInput(0, inFile, timeDist, -1); + + run.Run(nEvents); + // ------------------------------------------------------------------------ + + + // ----- Finish ---------------------------------------------------------- + timer.Stop(); + Double_t rtime = timer.RealTime(); + Double_t ctime = timer.CpuTime(); + std::cout << std::endl << std::endl; + std::cout << "Macro finished successfully." << std::endl; + std::cout << "Output file is " << outFile << std::endl; + std::cout << "Parameter file is " << parFile << std::endl; + std::cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << std::endl; + std::cout << std::endl; + // --------------------------------------------------------------------------- + + std::cout << " Test passed" << std::endl; + std::cout << " All ok " << std::endl; + //digi->Finish(); + + /*digi->CollectHistograms(); + TObjArray* digiHisto=digi->GetHistograms(); + std::cout << "Received HistoArray with Address " << digiHisto << std::endl; + std::cout << "The number of entries is " << digiHisto->GetEntriesFast() << std::endl; + ((TH1*)digiHisto->At(0))->Draw();*/ +}