Skip to content
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

Source code file directories and names #417

Open
whit2333 opened this issue Nov 1, 2018 · 0 comments
Open

Source code file directories and names #417

whit2333 opened this issue Nov 1, 2018 · 0 comments

Comments

@whit2333
Copy link

whit2333 commented Nov 1, 2018

It would be good to structure the source code better.

Suggestions:

  1. Put the interface headers in an include directory. This nearly all the header files I think.
  2. Put (and install) the header files in their own directory. For example include/hcana/HEADER.h.
  3. This leads to use cases like:
#include "hcana/THcParmList.h"

(note this doesn't have to happen in the current source code include directories can be added to compiler flags).

  1. This header name space then leads to clearer class names. (Using class name prefixes is old fashioned and ignores the namespace feature of C++).
#include "hcana/ParameterList.h"
  1. Clearer header file and class names leads us finally to functional separation. Perhaps by detector type: (note this is just a suggestion)
#include "hcana/cer/Cherenkov.h"
#include "hcana/cer/CherenkovHit.h"

Here is how it could look:

hcana/include
├── beam
│   ├── BCMCurrent.h
│   ├── RasteredBeam.h
│   ├── Raster.h
│   └── RasterRawHit.h
├── cer
│   ├── Aerogel.h
│   ├── AerogelHit.h
│   ├── Cherenkov.h
│   └── CherenkovHit.h
├── core
│   ├── Analyzer.h
│   ├── ConfigEvtHandler.h
│   ├── DetectorMap.h
│   ├── DummySpectrometer.h
│   ├── Formula.h
│   ├── Globals.h
│   ├── HallCSpectrometer.h
│   ├── HitList.h
│   ├── Interface.h
│   ├── ParmList.h
│   ├── PeriodicReport.h
│   ├── Run.h
│   ├── RunParameters.h
│   └── SignalHit.h
├── dc
│   ├── DC.h
│   ├── DCHit.h
│   ├── DCLookupTTDConv.h
│   ├── DCTimeToDistConv.h
│   ├── DCTrack.h
│   ├── DCWire.h
│   ├── DriftChamber.h
│   └── DriftChamberPlane.h
├── hodo
│   ├── HodoEff.h
│   ├── HodoHit.h
│   ├── Hodoscope.h
│   └── ScintillatorPlane.h
├── phys
├── raw
│   ├── RawAdcHit.h
│   ├── RawDCHit.h
│   ├── RawHit.h
│   ├── RawHodoHit.h
│   ├── RawShowerHit.h
│   └── RawTdcHit.h
├── recon
│   ├── CoinTime.h
│   ├── ExtTarCor.h
│   ├── PrimaryKine.h
│   ├── ReactionPoint.h
│   ├── SecondaryKine.h
│   └── SpacePoint.h
├── scaler
│   ├── Scaler9001.h
│   ├── Scaler9250.h
│   └── ScalerEvtHandler.h
├── shower
│   ├── ShowerArray.h
│   ├── Shower.h
│   ├── ShowerHit.h
│   └── ShowerPlane.h
└── trig
    ├── TimeSyncEvtHandler.h
    ├── TrigApp.h
    ├── TrigDet.h
    ├── TrigRawHit.h
    └── TIBlobModule.h

Again, this is just a suggestion to help others understand the code, and is common practice in C++ projects.

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

No branches or pull requests

1 participant