Skip to content

New standalone C++ class to create/fill DQM histograms for CRV. - #1949

Draft
RobMina wants to merge 5 commits into
Mu2e:mainfrom
RobMina:feature/CRVDigiDQM
Draft

New standalone C++ class to create/fill DQM histograms for CRV.#1949
RobMina wants to merge 5 commits into
Mu2e:mainfrom
RobMina:feature/CRVDigiDQM

Conversation

@RobMina

@RobMina RobMina commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@FNALbuild

Copy link
Copy Markdown
Collaborator

Hi @RobMina,
You have proposed changes to files in these packages:

  • /
  • DQMHelpers
  • CRVReco

which require these tests: build.

@Mu2e/write, @Mu2e/fnalbuild-users have access to CI actions on main.

⌛ The following tests have been triggered for 913a6a9: build (Build queue - API unavailable)

About FNALbuild. Code review on Mu2e/Offline.

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at 913a6a9.

Test Result Details
test with Command did not list any other PRs to include
merge Merged 913a6a9 at 8fc19ed
build (prof) Log file. Build time: 08 min 52 sec
ceSimReco Log file.
g4test_03MT Log file.
transportOnly Log file.
POT Log file.
g4study Log file.
cosmicSimReco Log file.
cosmicOffSpill Log file.
ceSteps Log file.
ceDigi Log file.
muDauSteps Log file.
ceMix Log file.
rootOverlaps Log file.
g4surfaceCheck Log file.
trigger Log file. Return Code 1.
check_cmake Log file.
FIXME, TODO TODO (0) FIXME (0) in 5 files
clang-tidy ➡️ 4 errors 123 warnings
whitespace check no whitespace errors found

N.B. These results were obtained from a build of this Pull Request at 913a6a9 after being merged into the base branch at 8fc19ed.

For more information, please check the job page here.
Build artifacts are deleted after 5 days. If this is not desired, select Keep this build forever on the job page.

@FNALbuild

Copy link
Copy Markdown
Collaborator

📝 The HEAD of main has changed to 8af4faf. Tests are now out of date.

@rlcee

rlcee commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

To start, this is an impressive PR, much more than I expected to start the DQMHelper concept. I can't absorb it all, and there are things I don't really understand. Here are few high-level comments

  • The original concept was to do endjob-type work in the post-grid-job metrics-maker code or here. We expect to add individual DQM files together to get, for example, the total DQM output for a run or a week of runs, and we'd re-run the metrics maker on these combined files. Not sure if this design is compatible, to what extent
  • I expected only the helpers (the online/offline shared code) to live in DQMHelpers, The modules and fcl make it more like a whole dqm system. We need to decide what lives in DQM repo vs Offline
  • do you have an example output file, from raw data, we could look at?

Pending any CRV group comments, if I had to manage this merge, I might just merge and see how it works out, since too much to actually look at or think about.

…g diagnostic histogram to a single 2D histogram instead of NxN separate hists.
@RobMina

RobMina commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks Ray! Sorry that you already started to review, I had a few more updates I wanted to make.

I was able to test this using modified versions of the online (https://github.com/Mu2e/otsdaq-mu2e-crv/blob/mu2e/ots_ops/otsdaq-mu2e-crv/ArtModules/CrvDQM_module.cc) and Offline (https://github.com/Mu2e/Offline/blob/main/CRVReco/src/CrvDQMcollector_module.cc) modules.

As an example, I ran over one file (raw.mu2e.trk.vst.124155_000001.art) from dataset raw.mu2e.trk.vst.art and the output histogram files are:

/exp/mu2e/data/users/ram2aq/crv_dqm/124155/crvDigiDQM_124155_000001.root
/exp/mu2e/data/users/ram2aq/crv_dqm/124155/crvStatusDQM_124155_000001.root

For comparison, I also ran over a cosmic MC file (dig.mu2e.CosmicCRYExtracted.MDC2025au_best_v1_5.001400_00001974.art) from (dig.mu2e.CosmicCRYExtracted.MDC2025au_best_v1_5.art):

/exp/mu2e/data/users/ram2aq/crv_dqm/MDC2025au/crvDigiDQM_MDC2025au_001400_00001974.root
/exp/mu2e/data/users/ram2aq/crv_dqm/MDC2025au/crvStatusDQM_MDC2025au_001400_00001974.root

Comment thread CRVReco/fcl/prolog_v12.fcl Outdated
crvDaqErrorModuleLabel : "CrvDigi"
crvDigiDQMDir : "CRVDigiDQM"
fillInclusiveDigiDQM : true
# KPP cabling: fold ROC4 onto ROC2. Set false once the full

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a fcl parameter of the DAQ digi generator. The current Pass1 scripts already change ROC 4 to ROC 2, so that all art data should see the correct ROC numbers.

Comment thread CRVReco/src/CrvDQMcollector_module.cc Outdated
fhicl::Atom<std::string> crvDaqErrorModuleLabel{Name("crvDaqErrorModuleLabel"), Comment("label of module that found the CRV-DAQ errors")};
fhicl::Atom<std::string> crvDigiDQMDir{Name("crvDigiDQMDir"), Comment("TFileService subdirectory for CRVDigiDQM histograms"), "CRVDigiDQM"};
fhicl::Atom<bool> fillInclusiveDigiDQM{Name("fillInclusiveDigiDQM"), Comment("also fill BarId/SiPM/ADC in CRVDigiDQM"), true};
fhicl::Atom<bool> crvDigiDQMkppReadout{Name("crvDigiDQMkppReadout"), Comment("KPP cabling: fold ROC 4 onto ROC 2 and book h1/h2_channels"), true};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

see comment made for fcl file

Comment thread CRVReco/src/CrvDQMcollector_module.cc Outdated
std::vector<TH1F*> _histPEsROC; //for each channel
std::vector<bool> _notConnected; //for each channel

std::vector<TH1F*> _histDigisPerChannelAndEvent;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this actually being stored or used anywhere (other than being filled later in the code)? If so, it should be moved to the helper class. If not, it should be removed.

@rlcee

rlcee commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

can the two output files be created together as one file?
comparing to /pnfs/mu2e/persistent/datasets/phy-ntd/dqm/mu2e/cosmics_crv/crvreco-004-000-file/root/f2/62/dqm.mu2e.cosmics_crv.crvreco-004-000-file.122499_000011-001.root
I see some overlap, but not obviously intended to be the same. Is this intentional and final (for now)?
I also see two layers of directories
crv_dirs

…move _histDigisPerChannelAndEvent into standalone C++ class, and clean up comments.
@RobMina

RobMina commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Thanks Ray and Ralf!

I merged the two fcls into one so the digi/status histograms live in the same output file.
KPP data: /exp/mu2e/data/users/ram2aq/crv_dqm/124155/crvDQM_124155_000001.root
Cosmic MC: /exp/mu2e/data/users/ram2aq/crv_dqm/MDC2025au/crvDQM_MDC2025au_001400_00001974.root

The histogram directory in each is now one level deep instead of two (each file has two separate directories, one for digi and one for status histograms).

Regarding the comparison to the dqm.mu2e.cosmics_crv.crvreco file -- there should be some overlap (specifically, the digi histograms), but I have not yet implemented the reco-level histograms in a standalone C++ class. That would be the next step after the implementation details (for example, what lives in DQM and what lives in Offline) are ironed out.

I think I addressed Ralf's three comments.

@rlcee

rlcee commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

We still need to decide where the modules live - here, in a CRV subdir, or in DQM repo. The metric extractor is in the DQM repo which has to be co-developed. There are several options. The general procedure is to get the stakeholders together: Yuri, Dave, CRV and DQM to hash it out. With the CM next week, we won't have our usual meetings, so that's a big delay. Not sure the best way forward.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants