Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Detectors/FIT/FDD/reconstruction/src/test-raw2digit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int main()

std::cout << "\nTOTAL EVENTS: " << vecTotalEvents.size() << std::endl;
std::cout << "Simulation completed!" << std::endl;
gSystem->Exec("$O2_ROOT/bin/o2-fdd-digit2raw --file-per-link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\"");
gSystem->Exec("$O2_ROOT/bin/o2-fdd-digit2raw --file-for link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\"");
gSystem->Exec("$O2_ROOT/bin/o2-raw-file-reader-workflow -b --input-conf FDDraw.cfg --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\"|$O2_ROOT/bin/o2-fdd-flp-dpl-workflow -b");
TFile flIn2("o2_fdddigits.root");
std::unique_ptr<TTree> treeInput2((TTree*)flIn2.Get("o2sim"));
Expand Down
15 changes: 9 additions & 6 deletions Detectors/FIT/FDD/simulation/src/digit2raw.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace bpo = boost::program_options;

void digit2raw(const std::string& inpName, const std::string& outDir, int verbosity, bool filePerLink, uint32_t rdhV = 4, bool noEmptyHBF = false,
void digit2raw(const std::string& inpName, const std::string& outDir, int verbosity, const std::string& fileFor, uint32_t rdhV, bool noEmptyHBF, const std::string& flpName,
int superPageSizeInB = 1024 * 1024);

int main(int argc, char** argv)
Expand All @@ -48,7 +48,8 @@ int main(int argc, char** argv)
add_option("verbosity,v", bpo::value<int>()->default_value(0), "verbosity level");
// add_option("input-file,i", bpo::value<std::string>()->default_value(o2::base::NameConf::getDigitsFileName(o2::detectors::DetID::FDD)),"input FDD digits file"); // why not used?
add_option("input-file,i", bpo::value<std::string>()->default_value("fdddigits.root"), "input FDD digits file");
add_option("file-per-link,l", bpo::value<bool>()->default_value(false)->implicit_value(true), "create output file per CRU (default: per layer)");
add_option("flp-name", bpo::value<std::string>()->default_value("alio2-cr1-flp180-fdd"), "single file per: all,flp,cru,link"); //temporary, beacause FIT deployed only on one node
add_option("file-for,f", bpo::value<std::string>()->default_value("all"), "single file per: all,flp,cru,link");
add_option("output-dir,o", bpo::value<std::string>()->default_value("./"), "output directory for raw data");
uint32_t defRDH = o2::raw::RDHUtils::getVersion<o2::header::RAWDataHeader>();
add_option("rdh-version,r", bpo::value<uint32_t>()->default_value(defRDH), "RDH version to use");
Expand Down Expand Up @@ -83,21 +84,23 @@ int main(int argc, char** argv)
digit2raw(vm["input-file"].as<std::string>(),
vm["output-dir"].as<std::string>(),
vm["verbosity"].as<int>(),
vm["file-per-link"].as<bool>(),
vm["file-for"].as<std::string>(),
vm["rdh-version"].as<uint32_t>(),
vm["no-empty-hbf"].as<bool>());
vm["no-empty-hbf"].as<bool>(),
vm["flp-name"].as<std::string>());

o2::raw::HBFUtils::Instance().print();

return 0;
}

void digit2raw(const std::string& inpName, const std::string& outDir, int verbosity, bool filePerLink, uint32_t rdhV, bool noEmptyHBF, int superPageSizeInB)
void digit2raw(const std::string& inpName, const std::string& outDir, int verbosity, const std::string& fileFor, uint32_t rdhV, bool noEmptyHBF, const std::string& flpName, int superPageSizeInB)
{
TStopwatch swTot;
swTot.Start();
o2::fdd::RawWriterFDD m2r;
m2r.setFilePerLink(filePerLink);
m2r.setFileFor(fileFor);
m2r.setFlpName(flpName);
m2r.setVerbosity(verbosity);
auto& wr = m2r.getWriter();
std::string inputGRP = o2::base::NameConf::getGRPFileName();
Expand Down
2 changes: 1 addition & 1 deletion Detectors/FIT/FT0/reconstruction/src/test-raw2digit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int main()

std::cout << "\nTOTAL EVENTS: " << vecTotalEvents.size() << std::endl;
std::cout << "Simulation completed!" << std::endl;
gSystem->Exec("$O2_ROOT/bin/o2-ft0-digi2raw --file-per-link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\"");
gSystem->Exec("$O2_ROOT/bin/o2-ft0-digi2raw --file-for link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\"");
gSystem->Exec("$O2_ROOT/bin/o2-raw-file-reader-workflow -b --input-conf FT0raw.cfg --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\"|$O2_ROOT/bin/o2-ft0-flp-dpl-workflow -b");
TFile flIn2("o2_ft0digits.root");
std::unique_ptr<TTree> treeInput2((TTree*)flIn2.Get("o2sim"));
Expand Down
15 changes: 9 additions & 6 deletions Detectors/FIT/FT0/simulation/src/digit2raw.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace bpo = boost::program_options;

void digit2raw(const std::string& inpName, const std::string& outDir, int verbosity, bool filePerLink, uint32_t rdhV = 4, bool noEmptyHBF = false,
void digit2raw(const std::string& inpName, const std::string& outDir, int verbosity, const std::string& fileFor, uint32_t rdhV, bool noEmptyHBF, const std::string& flpName,
int superPageSizeInB = 1024 * 1024);

int main(int argc, char** argv)
Expand All @@ -48,7 +48,8 @@ int main(int argc, char** argv)
add_option("verbosity,v", bpo::value<int>()->default_value(0), "verbosity level");
// add_option("input-file,i", bpo::value<std::string>()->default_value(o2::base::NameConf::getDigitsFileName(o2::detectors::DetID::FT0)),"input FT0 digits file"); // why not used?
add_option("input-file,i", bpo::value<std::string>()->default_value("ft0digits.root"), "input FT0 digits file");
add_option("file-per-link,l", bpo::value<bool>()->default_value(false)->implicit_value(true), "create output file per CRU (default: per layer)");
add_option("flp-name", bpo::value<std::string>()->default_value("alio2-cr1-flp180"), "single file per: all,flp,cru,link");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the comment for this option seems to be wrong, I guess copy&paste error.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, sorry, i can change it in next PR(in few hours)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I meant after merging this one :) It will be not in few hours

add_option("file-for,f", bpo::value<std::string>()->default_value("all"), "single file per: all,flp,cru,link");
add_option("output-dir,o", bpo::value<std::string>()->default_value("./"), "output directory for raw data");
uint32_t defRDH = o2::raw::RDHUtils::getVersion<o2::header::RAWDataHeader>();
add_option("rdh-version,r", bpo::value<uint32_t>()->default_value(defRDH), "RDH version to use");
Expand Down Expand Up @@ -83,21 +84,23 @@ int main(int argc, char** argv)
digit2raw(vm["input-file"].as<std::string>(),
vm["output-dir"].as<std::string>(),
vm["verbosity"].as<int>(),
vm["file-per-link"].as<bool>(),
vm["file-for"].as<std::string>(),
vm["rdh-version"].as<uint32_t>(),
vm["no-empty-hbf"].as<bool>());
vm["no-empty-hbf"].as<bool>(),
vm["flp-name"].as<std::string>());

o2::raw::HBFUtils::Instance().print();

return 0;
}

void digit2raw(const std::string& inpName, const std::string& outDir, int verbosity, bool filePerLink, uint32_t rdhV, bool noEmptyHBF, int superPageSizeInB)
void digit2raw(const std::string& inpName, const std::string& outDir, int verbosity, const std::string& fileFor, uint32_t rdhV, bool noEmptyHBF, const std::string& flpName, int superPageSizeInB)
{
TStopwatch swTot;
swTot.Start();
o2::ft0::RawWriterFT0 m2r;
m2r.setFilePerLink(filePerLink);
m2r.setFileFor(fileFor);
m2r.setFlpName(flpName);
m2r.setVerbosity(verbosity);
auto& wr = m2r.getWriter();
std::string inputGRP = o2::base::NameConf::getGRPFileName();
Expand Down
2 changes: 1 addition & 1 deletion Detectors/FIT/FV0/reconstruction/src/test-raw2digit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int main()

std::cout << "\nTOTAL EVENTS: " << vecTotalEvents.size() << std::endl;
std::cout << "Simulation completed!" << std::endl;
gSystem->Exec("$O2_ROOT/bin/o2-fv0-digi2raw -v 1 --file-per-link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\"");
gSystem->Exec("$O2_ROOT/bin/o2-fv0-digi2raw --file-for link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\"");
gSystem->Exec("$O2_ROOT/bin/o2-raw-file-reader-workflow -b --input-conf FV0raw.cfg --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\"|$O2_ROOT/bin/o2-fv0-flp-dpl-workflow -b");
TFile flIn2("o2_fv0digits.root");
std::unique_ptr<TTree> treeInput2((TTree*)flIn2.Get("o2sim"));
Expand Down
15 changes: 9 additions & 6 deletions Detectors/FIT/FV0/simulation/src/digit2raw.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace bpo = boost::program_options;

void digit2raw(const std::string& inpName, const std::string& outDir, int verbosity, bool filePerLink, uint32_t rdhV = 4, bool noEmptyHBF = false,
void digit2raw(const std::string& inpName, const std::string& outDir, int verbosity, const std::string& fileFor, uint32_t rdhV, bool noEmptyHBF, const std::string& flpName,
int superPageSizeInB = 1024 * 1024);

int main(int argc, char** argv)
Expand All @@ -48,7 +48,8 @@ int main(int argc, char** argv)
add_option("verbosity,v", bpo::value<int>()->default_value(0), "verbosity level");
// add_option("input-file,i", bpo::value<std::string>()->default_value(o2::base::NameConf::getDigitsFileName(o2::detectors::DetID::FV0)),"input FV0 digits file"); // why not used?
add_option("input-file,i", bpo::value<std::string>()->default_value("fv0digits.root"), "input FV0 digits file");
add_option("file-per-link,l", bpo::value<bool>()->default_value(false)->implicit_value(true), "create output file per CRU (default: per layer)");
add_option("flp-name", bpo::value<std::string>()->default_value("alio2-cr1-flp180-fv0"), "single file per: all,flp,cru,link"); //temporary, beacause FIT deployed only on one node
add_option("file-for,f", bpo::value<std::string>()->default_value("all"), "single file per: all,flp,cru,link");
add_option("output-dir,o", bpo::value<std::string>()->default_value("./"), "output directory for raw data");
uint32_t defRDH = o2::raw::RDHUtils::getVersion<o2::header::RAWDataHeader>();
add_option("rdh-version,r", bpo::value<uint32_t>()->default_value(defRDH), "RDH version to use");
Expand Down Expand Up @@ -83,21 +84,23 @@ int main(int argc, char** argv)
digit2raw(vm["input-file"].as<std::string>(),
vm["output-dir"].as<std::string>(),
vm["verbosity"].as<int>(),
vm["file-per-link"].as<bool>(),
vm["file-for"].as<std::string>(),
vm["rdh-version"].as<uint32_t>(),
vm["no-empty-hbf"].as<bool>());
vm["no-empty-hbf"].as<bool>(),
vm["flp-name"].as<std::string>());

o2::raw::HBFUtils::Instance().print();

return 0;
}

void digit2raw(const std::string& inpName, const std::string& outDir, int verbosity, bool filePerLink, uint32_t rdhV, bool noEmptyHBF, int superPageSizeInB)
void digit2raw(const std::string& inpName, const std::string& outDir, int verbosity, const std::string& fileFor, uint32_t rdhV, bool noEmptyHBF, const std::string& flpName, int superPageSizeInB)
{
TStopwatch swTot;
swTot.Start();
o2::fv0::RawWriterFV0 m2r;
m2r.setFilePerLink(filePerLink);
m2r.setFileFor(fileFor);
m2r.setFlpName(flpName);
m2r.setVerbosity(verbosity);
auto& wr = m2r.getWriter();
std::string inputGRP = o2::base::NameConf::getGRPFileName();
Expand Down
25 changes: 20 additions & 5 deletions Detectors/FIT/raw/include/FITRaw/RawWriterFIT.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "DetectorsRaw/RawFileWriter.h"
#include "CommonUtils/StringUtils.h"
#include <gsl/span>
#include <fmt/format.h>

namespace o2
{
Expand All @@ -47,7 +48,8 @@ class RawWriterFIT
RawWriterFIT() = default;
~RawWriterFIT() = default;
o2::raw::RawFileWriter& getWriter() { return mWriter; }
void setFilePerLink(bool makeFilePerLink) { mOutputPerLink = makeFilePerLink; }
void setFileFor(const std::string& fileFor) { mFileFor = fileFor; }
void setFlpName(const std::string& flpName) { mFlpName = flpName; }
bool getFilePerLink() const { return mOutputPerLink; }
void setVerbosity(int verbosityLevel) { mVerbosity = verbosityLevel; }
int getVerbosity() const { return mVerbosity; }
Expand All @@ -66,11 +68,22 @@ class RawWriterFIT
mMapTopo2FEEmetadata.clear();
mMapTopo2FEEmetadata = LookupTable_t::Instance().template makeMapFEEmetadata<o2::header::RAWDataHeader, RDHUtils>();
//Preparing filenames
std::string detNameLowCase = LookupTable_t::sDetectorName;
std::for_each(detNameLowCase.begin(), detNameLowCase.end(), [](char& c) { c = ::tolower(c); });
std::string detName = LookupTable_t::sDetectorName;
auto makeFilename = [&](const o2::header::RAWDataHeader& rdh) -> std::string {
std::string maskName = detNameLowCase + "_link";
std::string outputFilename = mOutputPerLink ? o2::utils::Str::concat_string(outputDir, maskName, std::to_string(RDHUtils::getFEEID(rdh)), ".raw") : o2::utils::Str::concat_string(outputDir, detNameLowCase + ".raw");
std::string maskName{};
if (mFileFor != "all") { // single file for all links
maskName += fmt::format("_{}", mFlpName);
if (mFileFor != "flp") {
maskName += fmt::format("_cru{}_{}", RDHUtils::getCRUID(rdh), RDHUtils::getEndPointID(rdh));
if (mFileFor != "cru") {
maskName += fmt::format("_lnk{}_feeid{}", RDHUtils::getLinkID(rdh), RDHUtils::getFEEID(rdh));
if (mFileFor != "link") {
throw std::runtime_error("invalid option provided for file grouping");
}
}
}
}
std::string outputFilename = o2::utils::Str::concat_string(outputDir, detName, maskName, ".raw");
return outputFilename;
};
//Registering links
Expand Down Expand Up @@ -125,6 +138,8 @@ class RawWriterFIT
}

o2::raw::RawFileWriter mWriter{LookupTable_t::sDetectorName};
std::string mFlpName{};
std::string mFileFor{};
std::map<Topo_t, o2::header::RAWDataHeader> mMapTopo2FEEmetadata;
//const o2::raw::HBFUtils& mSampler = o2::raw::HBFUtils::Instance();
bool mOutputPerLink = false;
Expand Down
6 changes: 3 additions & 3 deletions prodtests/full-system-test/create_full_system_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def RAWTask(name, command):

ITSRAW=RAWTask('itsraw', 'o2-its-digi2raw --file-for link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\" -o raw/ITS')
MFTRAW=RAWTask('mftraw', 'o2-mft-digi2raw --file-for link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\" -o raw/MFT')
FT0RAW=RAWTask('ft0raw', 'o2-ft0-digi2raw --file-per-link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\" -o raw/FT0')
FV0RAW=RAWTask('fv0raw', 'o2-fv0-digi2raw --file-per-link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\" -o raw/FV0')
FDDRAW=RAWTask('fddraw', 'o2-fdd-digit2raw --file-per-link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\" -o raw/FDD')
FT0RAW=RAWTask('ft0raw', 'o2-ft0-digi2raw --file-for link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\" -o raw/FT0')
FV0RAW=RAWTask('fv0raw', 'o2-fv0-digi2raw --file-for link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\" -o raw/FV0')
FDDRAW=RAWTask('fddraw', 'o2-fdd-digit2raw --file-for link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\" -o raw/FDD')
TPCRAW=RAWTask('tpcraw', 'o2-tpc-digits-to-rawzs --file-for link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\" -i tpcdigits.root -o raw/TPC')
TOFRAW=RAWTask('tofraw', 'o2-tof-reco-workflow ${GLOBALDPLOPT} --tof-raw-file-for link --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\" --output-type raw --tof-raw-outdir raw/TOF')
TOFRAW=RAWTask('midraw', 'o2-mid-digits-to-raw-workflow ${GLOBALDPLOPT} --mid-raw-outdir raw/MID --mid-raw-perlink --configKeyValues \"HBFUtils.nHBFPerTF=128;HBFUtils.orbitFirst=0\"')
Expand Down
12 changes: 6 additions & 6 deletions prodtests/full_system_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ HOST=`hostname`
TAG="conf=${CONFIG},host=${HOST}${ALIDISTCOMMIT:+,alidist=$ALIDISTCOMMIT}${O2COMMIT:+,o2=$O2COMMIT}"
echo "versions,${TAG} alidist=\"${ALIDISTCOMMIT}\",O2=\"${O2COMMIT}\" " > ${METRICFILE}

GLOBALDPLOPT="-b" # --monitoring-backend no-op:// is currently removed due to https://alice.its.cern.ch/jira/browse/O2-1887
GLOBALDPLOPT="-b" # --monitoring-backend no-op:// is currently removed due to https://alice.its.cern.ch/jira/browse/O2-1887

HBFUTILPARAMS="HBFUtils.nHBFPerTF=${NHBPERTF};HBFUtils.orbitFirst=${RUNFIRSTORBIT};HBFUtils.orbitFirstSampled=${FIRSTSAMPLEDORBIT}"
[ "0$ALLOW_MULTIPLE_TF" != "01" ] && HBFUTILPARAMS+=";HBFUtils.maxNOrbits=${NHBPERTF};"
Expand Down Expand Up @@ -105,9 +105,9 @@ fi
mkdir -p raw
taskwrapper itsraw.log o2-its-digi2raw --file-for cru -o raw/ITS
taskwrapper mftraw.log o2-mft-digi2raw --file-for link -o raw/MFT
taskwrapper ft0raw.log o2-ft0-digi2raw --file-per-link -o raw/FT0
taskwrapper fv0raw.log o2-fv0-digi2raw --file-per-link -o raw/FV0
taskwrapper fddraw.log o2-fdd-digit2raw --file-per-link -o raw/FDD
taskwrapper ft0raw.log o2-ft0-digi2raw --file-for link -o raw/FT0
taskwrapper fv0raw.log o2-fv0-digi2raw --file-for link -o raw/FV0
taskwrapper fddraw.log o2-fdd-digit2raw --file-for link -o raw/FDD
taskwrapper tpcraw.log o2-tpc-digits-to-rawzs --file-for cru -i tpcdigits.root -o raw/TPC
taskwrapper tofraw.log o2-tof-reco-workflow ${GLOBALDPLOPT} --tof-raw-file-for link --output-type raw --tof-raw-outdir raw/TOF
taskwrapper midraw.log o2-mid-digits-to-raw-workflow ${GLOBALDPLOPT} --mid-raw-outdir raw/MID --mid-raw-perlink
Expand Down Expand Up @@ -188,8 +188,8 @@ for STAGE in $STAGES; do
echo "gpurecotime_${STAGE},${TAG} value=${gpurecotime}" >> ${METRICFILE}

# memory
maxmem=`awk '/PROCESS MAX MEM/{print $5}' ${logfile}` # in MB
avgmem=`awk '/PROCESS AVG MEM/{print $5}' ${logfile}` # in MB
maxmem=`awk '/PROCESS MAX MEM/{print $5}' ${logfile}` # in MB
avgmem=`awk '/PROCESS AVG MEM/{print $5}' ${logfile}` # in MB
echo "maxmem_${STAGE},${TAG} value=${maxmem}" >> ${METRICFILE}
echo "avgmem_${STAGE},${TAG} value=${avgmem}" >> ${METRICFILE}

Expand Down