HMPID condition paramters calibration using DCS DPs#9171
Conversation
| startValidity = std::chrono::duration_cast<std::chrono::milliseconds>(timeNow.time_since_epoch()).count(); // in ms | ||
| } | ||
|
|
||
| mProcessor->setStartValidity(startValidity); |
There was a problem hiding this comment.
you are setting startvalidity each time you receive something, i.e. at least every 5 s (when the full DPs image is sent even if nothing was changed). Should not you use as a start validity the beginning of the integration period?
| // Called At the end of the Stream of DPs, in | ||
| // HMPIDDCSDataProcessorSpec::endOfStream() function | ||
| void HMPIDDCSProcessor::finalize() | ||
| { |
There was a problem hiding this comment.
As far as I can see, you create a CCDB object only in the endOfStream, but this means never, as the workflow is running permanently, w/o any correlation with data taking (SOR/EOR).
In case you need to perform some action at the EOR, you can use https://github.com/AliceO2Group/AliceO2/blob/dev/Detectors/DCS/include/DetectorsDCS/RunStatusChecker.h, see how EMCAL does this:
|
|
||
| /// / return timestamp of first fetched datapoint for a given ID (Tin/Tout, | ||
| /// Environment pressure, HV, chamber pressure) | ||
| TimeStampType getMinTime(const std::vector<DPCOM> dps) |
There was a problem hiding this comment.
pass by ref. instead of copy: const std::vector<DPCOM>& dps
| } | ||
| // return timestamp of last fetched datapoint for a given ID (Tin/Tout, | ||
| // Environment pressure, HV, chamber pressure) | ||
| TimeStampType getMaxTime(const std::vector<DPCOM> dps) |
| return lastTime; | ||
| } | ||
|
|
||
| void checkEntries(const std::vector<TF1> arQthresh, |
|
|
||
| for (int iCh = 0; iCh < 7; ++iCh) { | ||
| for (int iSec = 0; iSec < 6; ++iSec) { | ||
| auto tf = arQthresh.at(6 * iCh + iSec); |
There was a problem hiding this comment.
use [i] instead of .at(i), also below
|
|
||
| std::unique_ptr<HMPIDDCSProcessor> mProcessor; | ||
| HighResClock::time_point mTimer; | ||
| int64_t mDPsUpdateInterval; |
There was a problem hiding this comment.
I don't see where you set or use update interval. Please avoid very frequent updates of CCDB at every change. See how other detectors, e.g. FIT/FT0/calibration/testWorkflow/FT0DCSDataProcessorSpec.h do
There was a problem hiding this comment.
Hi @shahor02, variable mDPsUpdateInterval is not used indeed, is there by mistake, we are going to remove it! We update CCDB just at the end of RUN (see endOfStream method). I think this is correct! At least if I have not misunderstood something!
There was a problem hiding this comment.
Hi @gvolpe79
The endOfStream for the DP processor is rather meaningless: the DP processing workflow runs continuously and is not synchronized with SOR/EOR. The only way to detect run start/stop is to use mRunChecker.getRunStatus() as you do and send run-related output from the run(..) method. That said, note that it is not 100% reliable: if the AliECS crashes, the EOR will be never flagged in the CCDB. @knopers8 works on fixing this but the ETA is not clear.
| std::unique_ptr<TF1> pEnv = finalizeEnvPressure(); | ||
| for (int iCh = 0; iCh < 7; iCh++) { | ||
|
|
||
| std::unique_ptr<TF1> pChPres = finalizeChPressure(iCh); |
There was a problem hiding this comment.
What is the role of these histos? They are created and deleted when going out of scope w/o being used
There was a problem hiding this comment.
Indeed, are not in the CCDB but used to create the objects (charge threshold) to be stored in the CCDB (see lines 717 and 718 ) and then deleted.
There was a problem hiding this comment.
I see that you are using the name only, why do you need to create a histo?
There was a problem hiding this comment.
They are not an histos, they are TF1 objects coming from the fit of histos.
There was a problem hiding this comment.
OK, still don't fully understand the logic, but given that it is done once per run at finalization, the overhead should not be important.
| outputs, AlgorithmSpec{adaptFromTask<o2::hmpid::HMPIDDCSDataProcessor>()}, | ||
| Options{{"ccdb-path", | ||
| VariantType::String, | ||
| "localhost:8080", |
There was a problem hiding this comment.
please use o2::base::NameConf::getCCDBServer() as a default.
There was a problem hiding this comment.
Do you mean to replace the local host?
There was a problem hiding this comment.
Yes, the default server should be o2::base::NameConf::getCCDBServer(), so it can be globally changed.
There was a problem hiding this comment.
ok, we are going to modify the line
| {"Use CCDB to configure"}}, | ||
| {"follow-hmpid-run", | ||
| VariantType::Bool, | ||
| false, |
There was a problem hiding this comment.
if I get it right, with default setting (no run following) you will not produce any output? Is this what you want?
There was a problem hiding this comment.
Yes, this is what we want.
There was a problem hiding this comment.
ok, but then it is not clear why this is an option, moreover set to false by default ?
There was a problem hiding this comment.
You are right, the idea was to optimize the code later on! Anyway, since it is simple to modify it, we are doing to do it now.
No description provided.