Skip to content

[eg] deprecate cfortran and Hepevt headers that are implementation details - #23388

Open
ferdymercury wants to merge 4 commits into
root-project:masterfrom
ferdymercury:beg
Open

ferdymercury wants to merge 4 commits into
root-project:masterfrom
ferdymercury:beg

Conversation

@ferdymercury

Copy link
Copy Markdown
Collaborator

It's urgent to avoid a sure collision with Debian when doing make install

libcfitsio-dev installs cfortran.h on the same destination as ROOT.

@ferdymercury
ferdymercury marked this pull request as ready for review September 16, 2026 16:02
@ferdymercury ferdymercury added the skip code analysis Skip the code analysis CI steps for this PR, including verifying clang-formatting and running Ruff. label Sep 16, 2026
@ferdymercury ferdymercury added this to the 6.42.00 milestone Sep 16, 2026
Comment thread montecarlo/eg/inc/Hepevt.h Outdated

@pcanal pcanal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I understand the challenge with cfortran.h being duplicated across product.

That said, Hepevt.h is part of the TGenerator interface and defined/declare the default layout a fortran implemented generator can/should use to leverage the default implementation available within TGenerator.

So this PR (underlying feature) is not a technical/straight-forward cleanup but rather a real feature deprecation: "no longer supporting Fortran based generator".

So this deserve a larger discussion and the conclusion might be to recommend this PR, to delay this PR or to expand this PR to deprecate a larger set of functionality.

@ferdymercury

ferdymercury commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator Author

That said, Hepevt.h is part of the TGenerator interface

Why so?

It's only used by TGenerator.cxx but not by TGenerator.h

Or you mean someone was using

#include "TGenerator.h"
#include "Hepevt.h"

directly in some downstream code? and then binding those in some way ?

@pcanal

pcanal commented Sep 16, 2026

Copy link
Copy Markdown
Member

directly in some downstream code? and then binding those in some way ?

yes (via the 'magic' of common blocks)

Per the documentation:

If the generator code stores event data in the /HEPEVT/ common block 
Then the default implementation of ImportParticles should suffice.   
The common block /HEPEVT/ is structed like                           
                                                                     
\verbatim
  // C                                                            
  typedef struct {                                                   
     Int_t    nevhep;           // Event number                      
     Int_t    nhep;             // # of particles                    
     Int_t    isthep[4000];     // Status flag of i'th particle      
     Int_t    idhep[4000];      // PDG # of particle                 
     Int_t    jmohep[4000][2];  // 1st & 2nd mother particle #       
     Int_t    jdahep[4000][2];  // 1st & 2nd daughter particle #     
     Double_t phep[4000][5];    // 4-momentum and 1 word             
     Double_t vhep[4000][4];    // 4-position of production          
  } HEPEVT_DEF;                                                      
                                                                     
                                                                     
  C Fortran                                                          
        COMMON/HEPEVT/NEVHEP,NHEP,ISTHEP(4000),IDHEP(4000),          
      +    JMOHEP(2,4000),JDAHEP(2,4000),PHEP(5,4000),VHEP(4,4000)   
        INTEGER NEVHEP,NHEP,ISTHEP,IDHEP,JMOHEP,JDAHEP               
        DOUBLE PRECISION PHEP,VHEP                                   
\endverbatim

@ferdymercury

Copy link
Copy Markdown
Collaborator Author

yes (via the 'magic' of common blocks)

wouldn't it make then more sense to copy-paste HepEvt.h into TGenerator.h rather than having a separate header? And then remove HepEvt.h Otherwise it can also be 'magically' broken if only includes TGenerator.h, right?

@github-actions

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 11h 35m 13s ⏱️
 3 879 tests  3 879 ✅ 0 💤 0 ❌
76 263 runs  76 263 ✅ 0 💤 0 ❌

Results for commit 818bf64.

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

Labels

pr:squash on merge skip code analysis Skip the code analysis CI steps for this PR, including verifying clang-formatting and running Ruff.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants