-
Notifications
You must be signed in to change notification settings - Fork 443
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
IDCs: Add option to write IDCDelta to calibration file #10260
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @matthias-kleiner
Some fixes are needed, see below.
TFile fCalibData(fmt::format("IDCDelta_side{}_cal_data_{}.root", sideStr, ccdbInfoIDCDelta.getStartValidityTimestamp()).data(), "RECREATE"); | ||
fCalibData.WriteObject(imageIDCDelta.get(), "ccdb_object"); | ||
fCalibData.Close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The imageIDCDelta is already a TFile (memory based), one cannot write it to the TFile, instead one should write it as a binary data:
if (mDumpIDCDeltaCalibData && mCalibFileDir != "/dev/null") {
std::string calibFName = fmt::format("{}IDCDelta_side{}_cal_data_{}.root", mCalibFileDir, sideStr, ccdbInfoIDCDelta.getStartValidityTimestamp());
try {
std::ofstream calFile (calibFName, ios::out | ios::binary);
calFile.write(imageIDCDelta->data(), imageIDCDelta->size());
calFile.close();
} catch (std::exception const& e) {
LOG(error) << "Failed to store IDC calibration data file " << calibFName << ", reason: " << e.what();
}
TFile fCalibMetaData(fmt::format("IDCDelta_side{}_cal_metadata_{}.root", sideStr, ccdbInfoIDCDelta.getStartValidityTimestamp()).data(), "RECREATE"); | ||
fCalibMetaData.WriteObject(&ccdbInfoIDCDelta, "ccdb_object"); | ||
fCalibMetaData.Close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MetaData is a text file, should be created as
if (mMetaFileDir != "/dev/null") {
o2::dataformats::FileMetaData calMetaData;
calMetaData.fillFileData(calibFName);
calMetaData.setDataTakingContext(mDataTakingContext);
calMetaData.type = "calib;
calMetaData.priority = "low";
auto metaFileNameTmp = fmt::format("{}{}.tmp", mMetaFileDir, calibFName);
auto metaFileName = fmt::format("{}{}.done", mMetaFileDir, calibFName);
try {
std::ofstream metaFileOut(metaFileNameTmp);
metaFileOut << ctfMetaData;
metaFileOut.close();
std::filesystem::rename(metaFileNameTmp, metaFileName);
} catch (std::exception const& e) {
LOG(error) << "Failed to store CTF meta data file " << metaFileName << ", reason: " << e.what();
}
}
One would need to add the following:
- fetching mDataTakingContext: add at
bool mEnableWritingPadStatusMap{false}; ///< do not store the pad status map in the CCDB
o2::framework::DataTakingContext mDataTakingContext{};
and at
mTFFirst = currTF; |
mDataTakingContext = pc.services().get<DataTakingContext>();
- passing output directories for calib data and metafile:
add atunsigned int mProcessedCRUs{}; ///< number of processed CRUs to keep track of when the writing to CCDB etc. will be done
std::string mMetaFileDir{};
std::string mCalibFileDir{};
add at
{"add-offset-for-CCDB-timestamp", VariantType::Bool, false, {"Add an offset of 1 hour for the validity range of the CCDB objects"}}, |
{"output-dir", VariantType::String, "none", {"calibration files output directory, must exist"}},
{"meta-output-dir", VariantType::String, "/dev/null", {"calibration metadata output directory, must exist (if not /dev/null)"}},
and at
mDisableIDCDelta = ic.options().get<bool>("disable-IDCDelta"); |
mCalibFileDir = ic.options().get<std::string>("output-dir");
if (mCalibFileDir != "/dev/null") {
mCalibFileDir = o2::utils::Str::rectifyDirectory(mCalibFileDir);
}
mMetaFileDir = ic.options().get<std::string>("meta-output-dir");
if (mMetaFileDir != "/dev/null") {
mMetaFileDir = o2::utils::Str::rectifyDirectory(mMetaFileDir);
}
Hi @shahor02
So I assume it is working. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks fine.
In the real workflow on the EPN these files will go to dedicated directories.
@ole, where do you set the directories for residual files? I don't see --output-dir
and --meta-output-dir
set there.
* [FOCAL] Add stand-alone decoder of pad data (AliceO2Group#10211) * Tpc idc aggregator (AliceO2Group#10233) * increase factorize lanes to 10 * Increase number of Buffer to 100 * DPL Analysis: add possibility to set maximum size of output files (AliceO2Group#10232) * DPL: improve services to support multiple DP running on the same device * DPL: complain when using the wrong context * DPL: fix globalStream and streamSalt() * DPL: Move to use serviceregistryref rather than context * DPL: Make TimingInfo and DataAllocator stream services * DPL: do not allow copies of DataProcessorContext * DPL: Use stream ServiceRegistryRef in DataProcessingDevice::doRun * MCTruthContainer: possibility to register index without a label This should be useful when a object (digit) has no associated label. https://alice.its.cern.ch/jira/browse/O2-3352 * GPU: Add experimental V5 TPC ZS with entropy-reduced DLBZS * Process both dead and noise channels for MID * Allow to set different thresholds for MID dead and noisy channels * Fix MFT-MCH-MID labeling for Event Display * TPC: Remove all A/C-splitted versions, and non-FLP versions of the TPC IDC workflows * TPC Clusterizer: Fix comparison between packed and unpacked charge in noisy pad filter. * EMCAL: drop need for own InfoLogger * EMCAL & QC: do not require InfoLoggerContext * Do not cache DataProcessingContext & TimingInfo Spotted by some syntetic run. The copy was taking 10% of the CPU utilization. * DPL: use consumeWhenAny inside defineByName * DPL: do not load infologger by default unless running under control * TimeSlot calib allow multiple inputs for process() And per default make the container type the same as the input type. Useful in case the object send to the aggregator is in itself already a container as for example a histogram. * TRD calib simplify aggregators for which input and container types are identical * Add CTP lumi information to TPC SCD calib * added features for more flexibility + new run types * Save run type for Event Display, show file modification date in Event Display * change fatal to warning, add possibility to dump bad data * Revert "GPU: Workaround for reoccuring HIP problem parsing host-code during device compilation" This reverts commit 73c10d5. * Fix compilation issue with LOG(): workaround * DPL: Forward FMQ io-threads option * Digitizerworkflow: Make sure CCDB 'condition-not-after' is always available small (temp) step for https://alice.its.cern.ch/jira/browse/O2-3317 * Calib workflow: TPC IDC aggregator proxy can now use 2 io-threads, to help with the performance problem receiving many messages * Update COOKBOOK.md * Residual aggregator output dir specified automatically (AliceO2Group#10245) * add helper to get nominal field (AliceO2Group#10256) * Add aod-writer options resdir and maxfilesize as command line options * IDCs: Add option to write IDCDelta to calibration file (AliceO2Group#10260) * IDCs: Add option to write IDCDelta to calibration file * IDCs: fix creation of calib file * IDCs: Fix start range of for loop for C-Side * Rename nThreads option for TPC encoder (AliceO2Group#10263) * Fast TOF local coordinate extraction * Do not read TPC tracks and/or clusters unless explicitly asked * Optionally accept ITS-TPC AB tracks * Temporary use simplified version of propagateToAlphaX * Add extra track types to RecoContainer::getTrackParamOut * Extend storing of XRho in TrackLTIntegral to all propagation methods * multiple fixes for alignment * only 1st millepeded pipeline writes control files * Protect macro compilation by a semaphore * IDCs: Disable offset for validity range when storing IDCs in the CCDB (AliceO2Group#10249) - GainMap using tracks: Store also the RMS map in the CCDB * Don't truncate float calorimeter energies to int in EventDisplay * ZDC - Better error reporting during data taking (AliceO2Group#10262) * Correct cabling for modules 6 and 7 (ZPC towers) * Improving warning and error messages * Improved formatting * Improved formatting * TRD: TRDTrackWriterSpec: Fix input labels for tree branches (AliceO2Group#10266) Trivial fix. Signed-off-by: Felix Schlepper <[email protected]> Signed-off-by: Felix Schlepper <[email protected]> * Adjust Fairlogger-->InfoLogger Severity-->Level mapping * Fix: TRD CTF decoder --correct-trd-trigger-offset had no effect * optinally apply alignment in the BarrelAlignmentSpec * Make tolerance for creation-time fallback in CCDB query timestamp configurable If the timestamp extracted from the TF orbit (as it may happen for calibration runs) differs from the TF creation time by more than --condition-time-tolerance (in ms) then the creation time is used for CCDB query. Negative tolerance will impose using TF creation time. * TRD add pretrigger phase to digits (AliceO2Group#10243) * Move MC stack to DetectorsBase This is a restructuring commit to reduce library coupling and to avoid cycling dependencies for future developments: a) The VMC stack implementation belongs more logically to Detectors/Base as an implementation of a Virtual Monte Carlo functionality and less as a fundamental O2 simulation data layout b) remove some uneccessary includes * Calib workflow: Remove deprecated mode where SACs were router via EPNs * Calib workflow: indicate whether output proxies are for sporadic or for timeframe data in get_proxy_connection * DPL: Add option to not drop old timeSlices based on oldestPossible via env variable * MCH: remove deIdsForAllMCH from elecmap lib (moved to MCHConstants lib) * DPL: exception on fatal Not sure what happened to it... * Fixes in ITS T2L matrix + debug output * Collision context generalizations and use in transport sim Collision context improvements: a) able to generate more than one timeframe at a time b) timeframe indicexing within collision context We can now also pass the collision context to the transport simulation. This brings the following advantages: a) simulate the right number of events b) ability to pregenerate all events for all timeframes (less overheads) c) improved vertex matching for embedding (in future) d) support for more generic event sequences (beyond simple signal-background embedding with background reuse) * TRD update digit comments * TRD tracking add default error for B=0 * TRD raw reader skips links with corrupt digit HC headers * TRD tracker reset cov for inwards refit * TRD: Add getPadCol() to tracklets * Bugfix for TRD TrackTriggerRecord * TRD tracking: open search road * Protections added in DCS DPs processing (AliceO2Group#10215) * Protections added in DCS DPs processing * Fixing white space * minors * DPL: fix warning * DPL: add helper to wrap algorithms * TRD: Tracker: Add padrow crossing information (AliceO2Group#10229) * TRD: Tracker: Add padrow crossing information This patch adds to the GPUTRDTrack one new members: 1. mIsPadrowCrossing: unsigned char -> bits 0 to 5 indicate if in a layer the track crossed a padrow. Rational: Charge information is lost in these tracklets and one should possibly even discard those Tracks for gain calibration and PID. Additionally, this was added to TrackQC. Signed-off-by: Felix Schlepper <[email protected]> * TRD: Tracker: Indicate that there was neighboring tracklet This helps later to identify whether z-row merging should be done to recover the full charge information. Signed-off-by: Felix Schlepper <[email protected]> * TRD: Tracker: Indicate if a padrow crossing was found This removes a previous bug, where when a padrow crossing was found the check for neighboring tracklets was skipped. Additionally, the 7th bit is used to indicate whether or not a padrow in a track was found. Signed-off-by: Felix Schlepper <[email protected]> Signed-off-by: Felix Schlepper <[email protected]> * Fix mask of MFTMCHMID GlobalTrackID::MFTMCHMID was inserted between TPCTRDTOF and ITSTPCTRDTOF while the related masks were defined in the TPCTRDTOF, ITSTPCTRDTOF, MFTMCHMID order. Fortunately, the masks are not stored in the persistent data so we can simply swap them (and MFTMCHMID is not used though we should keep it at its current position for backward compatibility) * Add test workflow for analysis * small fix for collision context tool didn't work for arbitrary timeframe id (offsets) * Fix TPC_WORKFLOW_FILTER_DIGITS_OUTSIDE_OF_TF * Use LOG(alarm) instead of std::cerr * Calib workflow: fix error messages * If MFTMCH and MCHMID are enabled, enable MFTMCHMID as well in EventDisplay * TRD: calibration: vDrift and ExB (AliceO2Group#10053) * TRD: CalibratorVdExB: Reuse previous fit result This allows without interacting with the ccdb reusing the previous fit result. In the next patch I will a mechanism to skip updates for chambers which have too few entries in a slot. Signed-off-by: Felix Schlepper <[email protected]> * TRD: CalibratorVdExB: Require minimum amount of entries in profile refit This patch allows to specify an addition value via `--min-entries-chamber` which set an requirement on the minimum amount of entries required for refitting an updating the previous values. Due to name clash, I renamed `--min-entries` to `--min-entries-total` clarifying the distinction. The next patch will finally allow pulling the initial fit values from the ccdb e.g. the previous time the calibrator ran. Signed-off-by: Felix Schlepper <[email protected]> * TRD: CalibratorVdExB: Query if fit values from previous Run can be used. If there was a run within the last ~hour, we can reuse the ccdb object since object is still valid for the current time period. Else we start from scratch. Signed-off-by: Felix Schlepper <[email protected]> * TRD: CalibratorVdExB: Made anodeplane a constant Signed-off-by: Felix Schlepper <[email protected]> * TRD: CalibratorVdExB: Clang-format on all touched files This is just a minor patch on all files the previous patches touched. Mostly comment alignment which IMHO are nicer. Also some minor touch-ups on comments to allow doxygen to pickup as proper documentation. Signed-off-by: Felix Schlepper <[email protected]> Signed-off-by: Felix Schlepper <[email protected]> * TRD: CalibratorVdExB: Reuse Fitter This avoids instantiating a similar object all the time. Now it is done once during the init and then just reused. Hopefully, this provides a small performance boost. Signed-off-by: Felix Schlepper <[email protected]> * TRD: CalibratorVdExB: Avoid divide by zero In the TrackletTransformer we query multiple times for the vDrift value to divide by it. The fit can now not be zero, minimum 0.01. I promoted the default value to a constant. Signed-off-by: Felix Schlepper <[email protected]> * TRD: CalibratorVdExB: Take Distance of Anode from Geometry As suggested by @martenole this value can be taken from Geometry of the detector. Signed-off-by: Felix Schlepper <[email protected]> * TRD: CalibratorVdExB: Better message and check for retrieving object Signed-off-by: Felix Schlepper <[email protected]> * TRD: CalibratorVdExB: Use default constants Signed-off-by: Felix Schlepper <[email protected]> * TRD: CalibratorVdExB: Added configurable parameters for VDrift&ExB This patch allows configurable parameters to be added for QC. Included are two configurables for vdriftExB calibration. Signed-off-by: Felix Schlepper <[email protected]> Signed-off-by: Felix Schlepper <[email protected]> * TRD: CalibratorVdExB: Moved arguments to config helper This proposed patch moves the cli arguments to the confighelper and updates the README. Signed-off-by: Felix Schlepper <[email protected]> Signed-off-by: Felix Schlepper <[email protected]> Signed-off-by: Felix Schlepper <[email protected]> * optionally throttle CCDB logs to infologger Option --throttling-delay <N=300000> makes sure that at most 1 important (propagated to infologger) message is logged for the uploads to given CCDB path in last N ms. * Demote ccdb query announce and /Returning cached entry/ logging to debug * IDC deltas always on * update SCALETRACKS_TPC_TIMEGAIN * [FOCAL-9] Write decoded ASIC header to tree Instead of writing header word write header information (header, BC, counters, trailer) separately. * CollisionContext: Option to ensure that a timeframe has at least one collision * TRD: QC: Add global track id to TrackQC (AliceO2Group#10300) This patch allows for offline extraction of additional TOF PID. And will allow a cleaner cuts for the TRD PID model building. Signed-off-by: Felix Schlepper <[email protected]> Signed-off-by: Felix Schlepper <[email protected]> * DPL: rate limiting * Optionally truncate TPC digits that fall beyond orbit limit Default does not change. But O2DPG MC workflows can influence this via DigiParams. https://alice.its.cern.ch/jira/browse/O2-3382 * Fix: SYNTHETIC and NOISE run types were swapped * Fit the full candidate with KF (AliceO2Group#10271) * Fit the full candidate with KF * Fix chirality after up/down swap * Avoid using curvature with B=0 * CM Pad-by-Pad option, load pad variations from CCDB, CM corrected digits * GPU: Fix initialiation of GPU magnetic field if 0-field should be used but magnet current is not exactly 0 * DPL: fix warnings in ASoA.h * TPC: Add debug option to dump CompressedClusters struct to stdout * TPC Track Model Decoding: Better cuts to distinguish underflow / overflow * Make some functions static, fix a typo * TPC: CTF Skimming should use correct solenoidBz and nHbfPerTf * TPC CTF Skimming: Fix possible overflow in BC range check * DPL: avoid copying the TaskName too often * DPL: fix warnings in histogram registry * HistogramRegistry: avoid unneded copies and allocations * HistogramRegistry: avoid dance back and forward with types We know at build time that a TH1F is a TH1, no need to ask ROOT at runtime about it. * [FT0] Quick fix of errors in SYNTHETIC runs (set DataIsValid flag in sim) * DPL: fix typo in documentation * Fix printout in TPCVDriftTglCalibSpec * Fix SVertexer: vector element ref. used after vector expansion * Add countsFV0 to LumiInfo as backup for nominal FT0 lumi * Dummy driver device with no input and dummy output Sometimes we need a workflow to execute some number of loops with the timing info injected according to some policy, e.g. to fetch certain ccdb objects via DPL fetcher. In this case this device can be added as an upstream one in the workflow equiped with the HBFUtilsInitializer stuff which allow to steer timing info via dynamically added --hbfutils-config option For the real example of usage see barrel-aligment-workflow.cxx: it allows to use it as a simple executable w/o real input TF data but with the proper timing. * Barrel alignment fixes * FST: Give proper error message when rawAll.cfg missing * FST: Option to enable / disable QED part * GPU Workflow: fix configKeyValue to override solenoidBz * Reduce some debug verbosity * GPU: Display of magnetic field should create field from GRP if not already loaded * GPU: Standalone visualization can run without data * TPC CTF Skimming: Implement eta-cut on unassigned clusters * TPC: Do not check triggered mode setting if TPC is not read out * CPV: add dpl ccdb fitcher to digitizer * [ITS, ITS3] Add first version of ITS3 descriptor in ITS geometry (AliceO2Group#10289) * Apply naming conventions * Add first version of DTS3 descriptr in ITS geometry * Remove leftover comment * Fix format * Fix whitespace * Attempt to fix circular dependencies * Fix whitespaces * Fix CI * Fix format * Fix CI * Implement Matteo's comment * Allow to set the MID HV from CCDB * TRD: Simplify link stats (AliceO2Group#10315) * Make sure detector CTF header default constructor is called * TRD fix digit phase comments (AliceO2Group#10331) * ctpdev: scalers reply (AliceO2Group#10317) * dev: counters reply * clang * DPL: set TimingInfo field accordingly on new Run * Remove stray GlobalFwdTrackReaderSpec file * Make the track color configurable in EventDisplay * TPC Track Model Compression: Store Bz field and max time bin with data * first version of DCS config proxy * Second version of TPC DCS Config proxy * L1phase calib summary histo added; warning fixes * [FWDMatcher] Protection for invalid BC diff * ITS DCS parser: add always run number to metadata (AliceO2Group#10320) * ITS DCS parser: add always run number to metadata * clang * [FOCAL-9] Port mapping for pads from QC Mapping pad channel to position on pad layer * fix in TOF matching (time) to account for integrated times * Optionally apply BC shift to triggered detectors in CTF decoding The TriggerOffsetsParam configurableParam got array of custom corrections per detector (0 by default) which can be applied to triggered detectors IR as an ADDITIVE correction during CTF decoding. Note that this convention is opposite to that for the LM_L0 convention which is subtracted from the encoded IR (at the moment only for the TRD if an option --correct-trd-trigger-offset was provided to the ctf-reader). Therefore, for the TRD, if this option is ON, the effect of the correction is ir_corrected = ir_decoded - TriggerOffsetsParam::LM_L0 + TriggerOffsetsParam::customOffset[TRD]; while for other EMC,PHS,CPV and HMP (and TRD in absence of --correct-trd-trigger-offset) it is simply ir_corrected = ir_decoded + TriggerOffsetsParam::customOffset[<det>]; In case the correction moves the IR before the TF 1st orbit, the trigger is discarded. Extra: ZDC in pbpb2022 was reseting the orbit internally to 1 at the SOR: implemented the shift also for it. * [EMCAL-841] Fix switched energy and time in cell calibration - Calibrated time and calibrated energy were switched which results in wrong values energy and time in the AO2D file * TRD: QC: Enable output for full configuration (AliceO2Group#10307) This patch allows outputting the full vdrift exb calibration to a file. Additionally, it adds a previously missed function call to update the configKeyValues from cli args. Signed-off-by: Felix Schlepper <[email protected]> * FST: Fix problem with NUMA pinning in 4-gpu workflow * FST: OPTIMIZED_PARALLEL_ASYNC should only be set externally * Fix TPC Entropy encoder with dictionary from CCDB tree object * o2-sim: fail hard upon errors during loading cuts from JSON * Add track size enlargement for EventDisplay screenshots * Special treatment for shifts of ZDC triggers at BC=0,3563 These special triggers can be shifted only orbit-wise but the BC must remain unchanged * Fix TPC CTF IO test Compare data-members explicitly to avoid padding problems in blockwise comparison * Update RuntimeError.cxx * Fix swapped pitch and yaw angles in the AlignParam * When root-outputs are requested, write also TRD tracklets/digits * Introduce optional ITS ROF delay in nBC in the AlpideParam * Account for possible ITS ROF delay in ITS-TPC matching * account for eventual ITS/MFT ROF bias in vertexing/matching * Introduce optional global time bias for ITS-TPC refitted time * Update MCTrack ClassDef * Make HepMC and native status available for MC gen * HepMC and Gen status codes handled/entangled via Union as one single integer * some common functionality to en-/decode * encoding fully implemented for Pythia8, O2Kine and HepMC generators * be backwards-compatible wrt to HepMC status code * O2Kine generator now sets the status code correctly * use ParticleStatus::kToBeDone for TParticle in generators at Generator::importParticles to indicate whether to-be-done or not * Add first template of param container * Update param contaniner * Add executable * finalizing tof params object Signed-off-by: Felix Schlepper <[email protected]> Signed-off-by: Felix Schlepper <[email protected]> Co-authored-by: Markus Fasel <[email protected]> Co-authored-by: rmunzer <[email protected]> Co-authored-by: Giulio Eulisse <[email protected]> Co-authored-by: Sandro Wenzel <[email protected]> Co-authored-by: David Rohr <[email protected]> Co-authored-by: dstocco <[email protected]> Co-authored-by: nowakowp <[email protected]> Co-authored-by: Felix Weiglhofer <[email protected]> Co-authored-by: Ole Schmidt <[email protected]> Co-authored-by: iravasen <[email protected]> Co-authored-by: wiechula <[email protected]> Co-authored-by: Matteo Concas <[email protected]> Co-authored-by: Jan Fiete <[email protected]> Co-authored-by: Paul <[email protected]> Co-authored-by: Matthias Kleiner <[email protected]> Co-authored-by: shahoian <[email protected]> Co-authored-by: cortesep <[email protected]> Co-authored-by: Felix Schlepper <[email protected]> Co-authored-by: Sean <[email protected]> Co-authored-by: Laurent Aphecetche <[email protected]> Co-authored-by: gvolpe79 <[email protected]> Co-authored-by: Chiara Zampolli <[email protected]> Co-authored-by: Maximiliano Puccio <[email protected]> Co-authored-by: Maciej Slupecki <[email protected]> Co-authored-by: sevdokim <[email protected]> Co-authored-by: Fabrizio <[email protected]> Co-authored-by: Roman Lietava <[email protected]> Co-authored-by: Rafael Pezzi <[email protected]> Co-authored-by: Dmitri Peresunko <[email protected]> Co-authored-by: Joshua Koenig <[email protected]> Co-authored-by: Benedikt Volkel <[email protected]> Co-authored-by: Nicolò Jacazio <[email protected]> Co-authored-by: Nicolò Jacazio <[email protected]>
No description provided.