Skip to content

[EMCAL-732] implementation of EMCAL standalone AOD producer workflow#7644

Merged
shahor02 merged 5 commits intoAliceO2Group:devfrom
fjonasALICE:EMCAL-732
Nov 19, 2021
Merged

[EMCAL-732] implementation of EMCAL standalone AOD producer workflow#7644
shahor02 merged 5 commits intoAliceO2Group:devfrom
fjonasALICE:EMCAL-732

Conversation

@fjonasALICE
Copy link
Contributor

No description provided.

@fjonasALICE fjonasALICE requested a review from mfasDa as a code owner November 17, 2021 16:45
Copy link
Collaborator

@mfasDa mfasDa left a comment

Choose a reason for hiding this comment

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

Only a small change from my side requested

Comment on lines +50 to +51
static const char* BININGCELLS;
static const char* BINDINGCELLSTRG;
Copy link
Collaborator

Choose a reason for hiding this comment

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

No longer needed.

Copy link
Collaborator

@mfasDa mfasDa left a comment

Choose a reason for hiding this comment

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

The BC mapping does not work, when testing I get negative values in the index column and consequently a crash once I try to access the BC. This must be changed using a counter for the BC ID that is used for all 4 tables. The BC table in this case can be filled inside the event loop.


// fill table
caloCellsCursor(0,
bcID,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not going to work. We need the index in the BC table, not the global BCID. Since the BCs are sorted in the trigger record table it is sufficient to add counter and fill the BC table for the same event right after the cell and calo table with the index the same counter value.


// filled only with BCID, rest dummy for no2
caloCellsTRGTableCursor(0,
bcID,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Needs same BC counter as mentioned before.


// fill collision cursor
collisionsCursor(0,
bcID,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Once more

Comment on lines +132 to +139
std::sort(bcMap.begin(), bcMap.end(), std::less<int64_t>());
uint64_t triggerMask = 1;
for (auto& bcID : bcMap) {
bcCursor(0,
runNumber,
bcID,
triggerMask);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should go directly in the event loop. Instead of filling 0 in the index column we use the counter value used in the other tables.


LOG(INFO) << "Found " << cellsInEvent.size() << " cells in event";

auto bcID = interactionRecord.toLong();
Copy link
Collaborator

@jgrosseo jgrosseo Nov 18, 2021

Choose a reason for hiding this comment

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

This is wrong. You have to fill into the tables the tree entry of the BC entry in the BC tree. You get this with bcCursor.lastIndex() after filling the respective BC entry.
So you need a loop over BCs, you cannot fill first one, then the other (unless you know which ones you fill and you do not reorder as you do below)

Copy link
Collaborator

Choose a reason for hiding this comment

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

bcCursor is a lambda function, lastIndex() doesn't exist. Can't we just take a running index (i.e. iev) that we increment per event/bc in the loop?

- Using event loop index for BC Index
- Fill BC table in loop over events
mfasDa
mfasDa previously approved these changes Nov 18, 2021
Copy link
Collaborator

@mfasDa mfasDa left a comment

Choose a reason for hiding this comment

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

Tested and working, should be fine now. @jgrosseo Could you please merge once the CI finishes?

@shahor02
Copy link
Collaborator

sorry I've missed something, but what is the point of the standalone producer? Isn't it better to change the usual one is such a way that it supports EMCal only?

@mfasDa
Copy link
Collaborator

mfasDa commented Nov 18, 2021

@shahor02 I was actually checking with you in a private Mattermost conversation whether there is any chance to have the AODProducer supporting also stand-alone runs. Currently the global producer will not work if there is not at least FIT and a primary vertex reconstructed, which we don't have in the stand-alone run. Definitely we want AODs from the stand-alone runs we took in the pilot beam, we would like to test the analysis chain using the analysis framework, we want to repeat the pi0 analysis using the run3 analysis framework as validation of the analysis task. As you see the conversion from CTF to AOD for triggered detectors in the stand alone case is super simple, because we just need to port the cell container and link with the BC table, where the BC we provide ourselves. Adding this option to the global AODProducer will need quite sizeable modification. I am not generally against adding a stand alone mode to the global AOD producer, I also prefer common code instead of many code duplications, and maybe other detectors have similar interests as well. But for such a simple purpose I am wondering whether a stand-alone workflow is the more efficient way to go.

@shahor02
Copy link
Collaborator

I've just rechecked our mm conversation, there I was also suggested to make the standard aodproducer to work with caloriemeters only. it should not be a big deal, I think one should simply foresee the possibility to run w/o primary vertex and use triggered detectors triggers to create globalBC maps.
This standalone code is simple, but if the something is changing in the AOD, you will need to change it also here...
Anyway, one can have this for the moment, but I would suggest eventually switching to the standard one. Pinging to @nburmaso .

@mfasDa
Copy link
Collaborator

mfasDa commented Nov 19, 2021

@shahor02 Thanks for your comment! If the option would be foreseen in the standard AOD producer that would of course be better. Still it does not hurt to merge this one, because then we have something in the mean time to work with and commission the EMCAL analysis framework. Once the global producer is ready to support stand-alone runs of triggered detectors we will move to that and delete this one again.

uint64_t tfNumber;
if (mTFNumber == -1L) {
// TODO has to be made globally unique (by using absolute time of TF). For now is unique within the run
tfNumber = dh->tfCounter; // getTFNumber(startIR, runNumber);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note that this part was changed in the standard AOD producer:

tfNumber = uint64_t(dh->firstTForbit) + (uint64_t(dh->runNumber) << 32); // getTFNumber(mStartIR, runNumber);

I'll fix this and merge

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks a lot for fixing!

Copy link
Collaborator

@shahor02 shahor02 left a comment

Choose a reason for hiding this comment

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

all tests were passed, merging after applying a trivial fix

@shahor02 shahor02 merged commit b31ae36 into AliceO2Group:dev Nov 19, 2021
@mfasDa
Copy link
Collaborator

mfasDa commented Nov 19, 2021

@shahor02 Thanks a lot for merging! We promise we will migrate to the standard AOD producer once it supports stand alone runs and remove this one again. We will however not mess around with changing other tables there, this should be done by the experts, too much damage could be done for other detectors if something goes wrong in the implementation.

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.

4 participants