Skip to content

New PDVD OpHit calibrator#129

Draft
lpaulucc wants to merge 5 commits intodevelopfrom
lp_pdvdcalibrator
Draft

New PDVD OpHit calibrator#129
lpaulucc wants to merge 5 commits intodevelopfrom
lp_pdvdcalibrator

Conversation

@lpaulucc
Copy link
Member

Adding a new calibrator for ProtoDUNE-VD that can handle the different SPE areas for different hardware channels.

@vpec0
Copy link
Member

vpec0 commented Feb 2, 2026

Hi Laura, is there a reason to make a PDVD customised calibrator? How does it differ from the calibrator which is there already? Wouldn't it be better to have a generic, configurable calibrator that could be used for any ProtoDUNE data and maybe for the far detector, too?

@lpaulucc
Copy link
Member Author

lpaulucc commented Feb 2, 2026

Yes, initially I thought of having a generic calibrator that could be used by all but the PDSP calibrator was created with many hard coded values. I was going to make sure PDSP did not break but I couldn't find a test case for it. So I created a new one. We could change the name to have it generic and still keep the PDSP one. Do you think it would make more sense?

@vpec0
Copy link
Member

vpec0 commented Feb 3, 2026

yes, it does make sense. It feels like most of the code (not that there's much) is copied from the SP calibrator. I have made an attempt to make the SP calibrator be more generic in #122. That way, although there are hardcoded numbers specific for SP, they can be over configured from a fhicl. Ideally we would have a generic calibrator with specific configurations for each use case.

@lpaulucc
Copy link
Member Author

lpaulucc commented Feb 3, 2026

Oh, I did not remember about this other PR. Can you check if the new configs that I included here for PDVD work in your module? If so, we can "merge" the two and I will close this one.

@vpec0
Copy link
Member

vpec0 commented Feb 4, 2026

Can you check if the new configs that I included here for PDVD work in your module?

The calibrator here does pretty much the same thing to the one in #122. In there I tried to extend the original SP calibrator so that we would keep the history and compatibility. However, the calibrator here now has the configs for PD VD and I can imagine merging would be tedious. #122 can be dropped.

{

fBadChannels = pset.get<std::vector<int> >("BadChannels");
fHdwChannels = pset.get<std::vector<int> >("HdwChannels");
Copy link
Member

Choose a reason for hiding this comment

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

Is fHdwChannels a good name? I know there are different channel definitions and I think what is passed to the calibrator is the "offline channel" number/ID. I don't know if this is the standard naming, but the Hdw prefix makes me thing about the numbering defined by the hardware people.

fBadChannels = pset.get<std::vector<int> >("BadChannels");
fHdwChannels = pset.get<std::vector<int> >("HdwChannels");
fSPEAreas = pset.get<std::vector<float> >("SPEAreas");
fSPEShifts = pset.get<std::vector<float> >("SPEShifts");
Copy link
Member

Choose a reason for hiding this comment

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

Maybe these fSPEShifts can be empty by default? They would only be applied if they were specified. Thus lines 47 and 48 would be conditional. It would prevent the "expensive" look up in the map if not necessary.


//Map for associating each hardware channel with its correspondent SPE area
for(size_t i=0; i<fHdwChannels.size();i++){
fAreaMap.emplace(fHdwChannels[i], fSPEAreas[i]);
Copy link
Member

Choose a reason for hiding this comment

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

The two maps could be defined as a single map of pairs. This would remove extra lookup.

@lpaulucc
Copy link
Member Author

lpaulucc commented Feb 5, 2026

Hi Viktor, I agree with your comments and I think the modifications you included in the calibrator are already a better version of this one in terms of names and the map, no? I am fine with closing this PR as long as the new changes you include in the PDSP calibrator do not break it. Did you test it with old data? We could just include the configs for PDVD in a new or existing fhicl file.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants