Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype for reader-driver ability to skim MC input from files #13516

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

shahor02
Copy link
Collaborator

No description provided.

@shahor02 shahor02 requested a review from a team as a code owner September 16, 2024 13:07
Copy link
Contributor

REQUEST FOR PRODUCTION RELEASES:
To request your PR to be included in production software, please add the corresponding labels called "async-" to your PR. Add the labels directly (if you have the permissions) or add a comment of the form (note that labels are separated by a ",")

+async-label <label1>, <label2>, !<label3> ...

This will add <label1> and <label2> and removes <label3>.

The following labels are available
async-2023-pbpb-apass3
async-2023-pbpb-apass4
async-2023-pp-apass4
async-2024-pp-apass1
async-2022-pp-apass7
async-2024-pp-cpass0

@alibuild
Copy link
Collaborator

Error while checking build/O2/fullCI for 5fde5ce at 2024-09-17 00:27:

## sw/BUILD/O2-latest/log
c++: error: unrecognized command-line option '--rtlib=compiler-rt'
c++: error: unrecognized command-line option '--rtlib=compiler-rt'
input_line_9:666:19: error: cannot initialize a member subobject of type 'uint64_t' with an rvalue of type 'int'
input_line_9:677:33: error: use of undeclared identifier 'v'
Error: /sw/slc8_x86-64/ROOT/v6-32-02-alice1-14/bin/rootcling: compilation failure (/sw/BUILD/5cd25df61fd828b752aba0148a6641b2d8601c8d/O2/DataFormats/common/G__O2CommonDataFormatf158a36938_dictUmbrella.h)
ninja: build stopped: subcommand failed.

Full log here.

@shahor02
Copy link
Collaborator Author

@sawenzel
Here is the prototype for MC skimming. At the moment I've adapted only ITS/MFT digit reader.
To test it: for any existing anchored MC with digits preserved:

  1. generate a file with IRFrames (pares of InteractionRecord objects to select).
    I've added a sample macro https://github.com/AliceO2Group/AliceO2/blob/83bcdf531467a213cf2890bafe287c7335b4edf2/macro/CreateSampleIRFrames.C which takes as arguments the offset wrt TF to start (e.g. if we want to skip 1st orbit), the frame duration and the gap to the next frame (all in BC). It will generate a file irframes.root.
  2. to run any workflow that fetches data from root file readers one should precede it with
    o2-reader-driver-workflow passing the options as below:
DIGINP="--hbfutils-config o2simdigitizerworkflow_configuration.ini,irframes.root,upstream"
# throttling is optional but useful
TFTHROTTLE="--timeframes-rate-limit 2 --timeframes-rate-limit-ipcid 1 "

o2-reader-driver-workflow $DIGINP $TFTHROTTLE | o2-its-reco-workflow  $DIGINP $TFTHROTTLE --trackerCA 

This will force the ITS reader created by the its-reco to extract from the single digitized TF only ROFs corresponding to each of the defined IRFrames and send them as separate TFs. If there are multiple IRFrames selected for a given TF, in the DPL header they will have the same tfCounter and firstTFOrbit but incremented timeslices.

At the moment I could not find a proper solution for the following:
to know how much data the reader should fetch, it has to read some CCDB objects.
But I cannot simply add a ccdbParamSpec since it will work in the old standalone reader mode (upstream CCDB fetcher will not have timing input).
In principle, one can add a dedicated option to the reader spec to request such a ccdbspec but at the moment I am reading the needed object via CCDBManager:

auto& ccdb = o2::ccdb::BasicCCDBManager::instance();
auto rlim = ccdb.getRunDuration(tinfo.runNumber);
long ts = (rlim.first + rlim.second) / 2;
if (mOrigin == o2::header::gDataOriginITS) {
ccdb.getForTimeStamp<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>>("ITS/Config/AlpideParam", ts);
const auto& alpideParam = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance();
mROFBiasInBC = alpideParam.roFrameBiasInBC;
mROFLengthInBC = alpideParam.roFrameLengthInBC;
mNRUs = o2::itsmft::ChipMappingITS::getNRUs();
} else {
ccdb.getForTimeStamp<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::MFT>>("MFT/Config/AlpideParam", ts);
const auto& alpideParam = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::MFT>::Instance();
mROFBiasInBC = alpideParam.roFrameBiasInBC;
mROFLengthInBC = alpideParam.roFrameLengthInBC;
mNRUs = o2::itsmft::ChipMappingMFT::getNRUs();
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants