-
Notifications
You must be signed in to change notification settings - Fork 59
Add EBLoadRaw for EBV2 tool chain #338
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
base: Application
Are you sure you want to change the base?
Conversation
|
For the force matching, we have tested them a while ago, and current processed data on pnfs are all already with that update. |
|
Looks good. |
| CData = new std::vector<CardData>; | ||
| TData = new TriggerData; | ||
| MData = new MRDOut; | ||
| LData = new PsecData; |
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.
CData TData MData and LData appear to be leaking
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.
I'm not so sure....
on line 597 CData is populated with PMTData->Get("CardData", *CData); (note the de-reference means it should set the value of CData, not overwrite the pointer), and subsequently on line 599 the CData pointer is passed to the CardData BoostStore, which will take ownership and handle deletion.
That does make me somewhat nervous that the CardData BoostStore may delete CData, resulting in the de-reference on line 597 segfaulting.... 🤔 Presumably if this doesn't happen CData CardData doesn't get deleted, or at least by the time it does, line 597 is never encountered again....
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.
your correct i rescind my objection
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.
but agree with your comment about tis reuse...
one can set the pointer and ask the boost store not to manage the data which is a fix for that
| // First, parse the lines and get all files. | ||
| std::string line; | ||
| ifstream myfile(FileList.c_str()); | ||
| if (myfile.is_open()) |
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.
perhaps an else { std::cerr<<... would be sensible
| m_data->CStore.Set("subrunNumber", -9999); | ||
| } | ||
|
|
||
| if (std::regex_search(fileName, match, rawFileNumber_regex) && match.size() > 1) |
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.
you can do a single regex match that captures multiple matches at once....
sscanf may be a simpler alternative for something this simple.
| ss_trigoverlap << "TrigOverlap_R" << RunNumber << "S" << SubRunNumber << "p" << PartFileNumber; | ||
| std::cout << "EBLoadRaw: Loading Trigger Overlap data: " << ss_trigoverlap.str() << std::endl; | ||
| BoostStore TrigOverlapStore; | ||
| bool store_exist = TrigOverlapStore.Initialise(ss_trigoverlap.str().c_str()); |
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.
should this have a configurable path prefix?
| } | ||
| LoadedLAPPDTotalEntries += LAPPDTotalEntries; | ||
| } | ||
| catch (std::exception &e) |
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.
does anything in this try block actually throw?
| { | ||
| BoostStore TrigOverlapStore; | ||
| std::stringstream ss_trigoverlap; | ||
| ss_trigoverlap << "TrigOverlap_R" << RunNumber << "S" << SubRunNumber << "p" << PartFileNumber; |
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.
preceding path?
EBLoadRaw Tool in EventBuildingV2 tool set.
This is splitted from PR #307
Changes based on your comments:
· EBLoadRaw line 295 - maybe relax this check to if line[0]=='#' otherwise trailing comments would result in the file being omitted.
Changed, now it's at line 314. I leave the previous commented line there just in case.
New changes:
I add some variables like 'PMTMatchingForced' to force a matching at the end of each partfile. Without it there maybe ~1 to 5% of events unpaired because of the asynchronizely loading and pairing of PMT and trigger.