Skip to content

Source code file directories and names #417

Description

@whit2333

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions