From c76397131bc52135ab0fa8141086d78d512cb530 Mon Sep 17 00:00:00 2001 From: "Stephen A. Wood" <saw@jlab.org> Date: Fri, 17 Jan 2014 16:48:14 -0500 Subject: [PATCH] Edit some comments to help with THtml generated documentation. --- src/THcAerogelHit.h | 2 +- src/THcAnalyzer.cxx | 15 +++++++++----- src/THcCherenkovHit.h | 2 +- src/THcDC.h | 2 +- src/THcDCHit.h | 2 +- src/THcDCLookupTTDConv.h | 2 +- src/THcDCTimeToDistConv.h | 2 +- src/THcDCTrack.h | 2 +- src/THcDCWire.h | 2 +- src/THcDetectorMap.cxx | 40 +++++++++++++++++++++++++++++++------- src/THcDetectorMap.h | 2 +- src/THcDriftChamber.h | 2 +- src/THcDriftChamberPlane.h | 2 +- src/THcHallCSpectrometer.h | 2 +- src/THcHitList.cxx | 17 ++++++++++++---- src/THcHitList.h | 2 +- src/THcHodoscope.h | 2 +- src/THcHodoscopeHit.h | 2 +- src/THcParmList.cxx | 15 ++++++++++++++ src/THcRawDCHit.h | 2 +- src/THcRawHit.cxx | 4 +--- src/THcRawHit.h | 2 +- src/THcRawShowerHit.h | 2 +- src/THcScintillatorPlane.h | 2 +- src/THcShower.h | 2 +- src/THcShowerPlane.h | 2 +- src/THcSignalHit.h | 2 +- src/THcSpacePoint.h | 2 +- 28 files changed, 95 insertions(+), 42 deletions(-) diff --git a/src/THcAerogelHit.h b/src/THcAerogelHit.h index c007c84..49ddd24 100644 --- a/src/THcAerogelHit.h +++ b/src/THcAerogelHit.h @@ -12,7 +12,7 @@ class THcAerogelHit : public THcHodoscopeHit { private: - ClassDef(THcAerogelHit,0); // Aerogel hit class + ClassDef(THcAerogelHit,0); // Raw Aerogel hit }; #endif diff --git a/src/THcAnalyzer.cxx b/src/THcAnalyzer.cxx index 6c97bba..6d3f0c9 100644 --- a/src/THcAnalyzer.cxx +++ b/src/THcAnalyzer.cxx @@ -61,8 +61,10 @@ THcAnalyzer::~THcAnalyzer() //_____________________________________________________________________________ void THcAnalyzer::PrintReport(const char* templatefile, const char* ofile) { - // Copy template to ofile, replacing {stuff} with the evaluated - // value of stuff. + // Generate "reports" such as end of run scaler/efficiency sheets + // Reads a template file, copying that file to the output, replacing + // variables and expressions inside of braces ({}) with evaluated values. + // Similar but not identical to ENGINE/CTP report templates. ifstream ifile; ifile.open(templatefile); @@ -139,9 +141,12 @@ void THcAnalyzer::PrintReport(const char* templatefile, const char* ofile) //_____________________________________________________________________________ void THcAnalyzer::LoadInfo() { - // Copy some run information into gHcParms variables so that in can - // be used in reports. - // For example run number, first event analyzed, number of events, etc. + // Create several THcParms variables in gHcParms containing + // run information such as + // run number, first event analyzed, number of events, etc. + // gen_run_number - Current run + // gen_run_starting_event - Id of first event analyzed + // gen_event_id_number - Id of last event analyzed Int_t* runnum; Int_t* firstevent; Int_t* lastevent; diff --git a/src/THcCherenkovHit.h b/src/THcCherenkovHit.h index de1180c..63a0aab 100644 --- a/src/THcCherenkovHit.h +++ b/src/THcCherenkovHit.h @@ -12,7 +12,7 @@ class THcCherenkovHit : public THcHodoscopeHit { private: - ClassDef(THcCherenkovHit,0); // Cherenkov hit class + ClassDef(THcCherenkovHit,0); // Raw Cherenkov hit }; #endif diff --git a/src/THcDC.h b/src/THcDC.h index 68ea807..05d5def 100644 --- a/src/THcDC.h +++ b/src/THcDC.h @@ -173,7 +173,7 @@ protected: void Setup(const char* name, const char* description); void PrintSpacePoints(); - ClassDef(THcDC,0) // Drift Chamber class + ClassDef(THcDC,0) // Set of Drift Chambers detector }; //////////////////////////////////////////////////////////////////////////////// diff --git a/src/THcDCHit.h b/src/THcDCHit.h index 80302bd..c5ca7a7 100644 --- a/src/THcDCHit.h +++ b/src/THcDCHit.h @@ -78,7 +78,7 @@ private: THcDCHit( const THcDCHit& ); THcDCHit& operator=( const THcDCHit& ); - ClassDef(THcDCHit,2) // VDCHit class + ClassDef(THcDCHit,2) // Drift Chamber Hit }; //////////////////////////////////////////////////////////////////////////////// diff --git a/src/THcDCLookupTTDConv.h b/src/THcDCLookupTTDConv.h index e1bbea1..3d61574 100644 --- a/src/THcDCLookupTTDConv.h +++ b/src/THcDCLookupTTDConv.h @@ -29,7 +29,7 @@ protected: Int_t fNumBins; Double_t* fTable; - ClassDef(THcDCLookupTTDConv,0) // VDC Analytic TTD Conv class + ClassDef(THcDCLookupTTDConv,0) // Time to Distance conversion lookup }; diff --git a/src/THcDCTimeToDistConv.h b/src/THcDCTimeToDistConv.h index 960a5c3..2ff7062 100644 --- a/src/THcDCTimeToDistConv.h +++ b/src/THcDCTimeToDistConv.h @@ -24,7 +24,7 @@ private: THcDCTimeToDistConv( const THcDCTimeToDistConv& ); THcDCTimeToDistConv& operator=( const THcDCTimeToDistConv& ); - ClassDef(THcDCTimeToDistConv,0) // DCTimeToDistConv class + ClassDef(THcDCTimeToDistConv,0) // Time to Distance conversion base class }; //////////////////////////////////////////////////////////////////////////////// diff --git a/src/THcDCTrack.h b/src/THcDCTrack.h index a9b84c6..cc97ff1 100644 --- a/src/THcDCTrack.h +++ b/src/THcDCTrack.h @@ -85,6 +85,6 @@ private: THcDCTrack( const THcDCTrack& ); THcDCTrack& operator=( const THcDCTrack& ); - ClassDef(THcDCTrack,0) // DCTrack class + ClassDef(THcDCTrack,0) // Full Drift Chamber track }; #endif diff --git a/src/THcDCWire.h b/src/THcDCWire.h index 0e3ce6d..53f6fcb 100644 --- a/src/THcDCWire.h +++ b/src/THcDCWire.h @@ -43,7 +43,7 @@ private: THcDCWire( const THcDCWire& ); THcDCWire& operator=( const THcDCWire& ); - ClassDef(THcDCWire,0) // VDCWire class + ClassDef(THcDCWire,0) // Drift Chamber Wire class }; //////////////////////////////////////////////////////////////////////////////// diff --git a/src/THcDetectorMap.cxx b/src/THcDetectorMap.cxx index 187c465..a4ff120 100644 --- a/src/THcDetectorMap.cxx +++ b/src/THcDetectorMap.cxx @@ -4,12 +4,8 @@ // // THcDetectorMap // -// Class to read and hold Hall C style detector map -// -// Will need method to retrieve all map entries for a given -// detector id. -// -// Not sure we will keep this class, but still need the parsing of the map file +// Class to read and Hall C style detector map +// FillMap method builds a map for a specific detector // ////////////////////////////////////////////////////////////////////////// @@ -54,8 +50,11 @@ struct Functor }; //_____________________________________________________________________________ Int_t THcDetectorMap::FillMap(THaDetMap *detmap, const char *detectorname) -// Should probably return a status { + // Build a DAQ hardware to detector element map for detector detectorname + // Reads through the entire list of mappings, adding one element to + // detmap for each electronics channel that maps to detectorname. + list<ModChanList>::iterator imod; list<ChaninMod>::iterator ichan; ChaninMod Achan; @@ -171,8 +170,35 @@ Int_t THcDetectorMap::FillMap(THaDetMap *detmap, const char *detectorname) return(0); } +//_____________________________________________________________________________ void THcDetectorMap::Load(const char *fname) { +// Load a Hall C ENGINE style detector map file. The map file maps +// a given roc, slot/module, and channel # into a given detector id#, plane +// number, counter number and signal type. The mapping between detector +// names and ids is found in the comments at the begging of the map file. +// This method looks for those comments, of the form: +// XXX_ID = n +// to establish that mapping between detector name and detector ID. +// +// Lines of the form +// DETECTOR = n +// ROC = n +// SLOT = n +// are used to establish the module (roc and slot) and the detector +// for the mapping lines that follow. +// The actual mappings are of the form +// subadd, plane, counter [, signal] +// Each of these lines, combined with the detector, roc, slot values +// establish the roc, slot, subadess -> detector, plane, counter#, sigtype map +// Other lines that may be in the map file are +// NSUBADD = n +// BSUB = n +// MASK = hex value +// These define characteristics of the electronics module (# channels, +// The bit number specifying the location of the subaddress in a data word +// and hex mask that the data word is anded with to retrieve data) + static const char* const whtspc = " \t"; ifstream ifile; diff --git a/src/THcDetectorMap.h b/src/THcDetectorMap.h index 1dd95b2..420f7de 100644 --- a/src/THcDetectorMap.h +++ b/src/THcDetectorMap.h @@ -60,7 +60,7 @@ class THcDetectorMap : public TObject { protected: - ClassDef(THcDetectorMap,0); + ClassDef(THcDetectorMap,0); // Map electronics channels to Detector, Plane, Counter, Signal }; #endif diff --git a/src/THcDriftChamber.h b/src/THcDriftChamber.h index b77fca4..a788446 100644 --- a/src/THcDriftChamber.h +++ b/src/THcDriftChamber.h @@ -134,7 +134,7 @@ protected: Double_t* stubcoef[4]; std::map<int,TMatrixD*> fAA3Inv; - ClassDef(THcDriftChamber,0) // Drift Chamber class + ClassDef(THcDriftChamber,0) // A single drift chamber }; //////////////////////////////////////////////////////////////////////////////// diff --git a/src/THcDriftChamberPlane.h b/src/THcDriftChamberPlane.h index d6aa10c..b7aac91 100644 --- a/src/THcDriftChamberPlane.h +++ b/src/THcDriftChamberPlane.h @@ -109,7 +109,7 @@ protected: THcHodoscope* fglHod; // Hodoscope to get start time - ClassDef(THcDriftChamberPlane,0) + ClassDef(THcDriftChamberPlane,0); // A single plane within a THcDriftChamber }; #endif diff --git a/src/THcHallCSpectrometer.h b/src/THcHallCSpectrometer.h index 19826c0..f906546 100644 --- a/src/THcHallCSpectrometer.h +++ b/src/THcHallCSpectrometer.h @@ -57,7 +57,7 @@ protected: // Flag for fProperties indicating that tracks are to be sorted by chi2 static const UInt_t kSortTracks = BIT(16); - ClassDef(THcHallCSpectrometer,0) //A Hall A High Resolution Spectrometer + ClassDef(THcHallCSpectrometer,0) //A Hall C Spectrometer }; #endif diff --git a/src/THcHitList.cxx b/src/THcHitList.cxx index 4659785..c133fbf 100644 --- a/src/THcHitList.cxx +++ b/src/THcHitList.cxx @@ -4,9 +4,9 @@ // // THcHitList // -// Add hitlist to the Hall A detector base -// May not need to inherit from THaDetectorBase since we may end up -// replacing most of the methods +// Class to build a Hall C ENGINE style list of raw hits from the raw data. +// Detectors that use hit lists need to inherit from this class +// as well as THaTrackingDetector or THaNonTrackingDetector // ////////////////////////////////////////////////////////////////////////// @@ -30,7 +30,8 @@ THcHitList::~THcHitList() { void THcHitList::InitHitList(THaDetMap* detmap, const char *hitclass, Int_t maxhits) { - // Probably called by ReadDatabase + // Save the electronics to detector mapping + // Initialize a hit array of hits of class hitclass fRawHitList = new TClonesArray(hitclass, maxhits); fRawHitClass = fRawHitList->GetClass(); @@ -44,6 +45,14 @@ void THcHitList::InitHitList(THaDetMap* detmap, } Int_t THcHitList::DecodeToHitList( const THaEvData& evdata ) { + // Clear the hit list + // Find all populated channels belonging to the detector and add + // the data to the hitlist. A given counter in the detector can have + // at most one entry in the hit list. However, the raw "hit" can contain + // multiple signal types (e.g. ADC+, ADC-, TDC+, TDC-), or multiple + // hits for multihit tdcs. + // The hit list is sorted (by plane, counter) after filling. + THcRawHit* rawhit; // cout << " Clearing TClonesArray " << endl; fRawHitList->Clear( ); diff --git a/src/THcHitList.h b/src/THcHitList.h index 494866b..040d4c0 100644 --- a/src/THcHitList.h +++ b/src/THcHitList.h @@ -41,6 +41,6 @@ public: protected: - ClassDef(THcHitList,0) + ClassDef(THcHitList,0); // List of raw hits sorted by plane, counter }; #endif diff --git a/src/THcHodoscope.h b/src/THcHodoscope.h index 7d18bc8..2c90d46 100644 --- a/src/THcHodoscope.h +++ b/src/THcHodoscope.h @@ -131,7 +131,7 @@ protected: void Setup(const char* name, const char* description); - ClassDef(THcHodoscope,0) // Generic hodoscope class + ClassDef(THcHodoscope,0) // Hodoscope detector }; //////////////////////////////////////////////////////////////////////////////// diff --git a/src/THcHodoscopeHit.h b/src/THcHodoscopeHit.h index 853e8f2..ef88875 100644 --- a/src/THcHodoscopeHit.h +++ b/src/THcHodoscopeHit.h @@ -32,7 +32,7 @@ class THcHodoscopeHit : public THcRawHit { private: - ClassDef(THcHodoscopeHit, 0); // Hodoscope hit class + ClassDef(THcHodoscopeHit, 0); // Raw Hodoscope hit }; #endif diff --git a/src/THcParmList.cxx b/src/THcParmList.cxx index d75c690..a645b93 100644 --- a/src/THcParmList.cxx +++ b/src/THcParmList.cxx @@ -42,6 +42,17 @@ inline static bool IsComment( const string& s, string::size_type pos ) void THcParmList::Load( const char* fname, Int_t RunNumber ) { + // Read a CTP style parameter file. + // + // Parameter values and arrays of values are cached in a THaVarList + // and are available for use elsewhere in the analyzer. + // Text strings are saved in a THaTextvars list. + // Parameter files can contain "include" statements of the form + // #include "filename" + // + // If a run number is given, ignore input until a line with a matching + // run number or run number range is found. All parameters following + // the are read until a non matching run number or range is encountered. static const char* const whtspc = " \t"; @@ -420,6 +431,8 @@ Int_t THcParmList::LoadParmValues(const DBRequest* list, const char* prefix) // must be given, and the memory already allocated // NOTE: initial code taken wholesale from THaDBFile. // GN 2012 + // If prefix is specified, prepend each requested parameter name with + // the prefix. const DBRequest *ti = list; Int_t cnt=0; @@ -561,6 +574,8 @@ Int_t THcParmList::ReadArray(const char* attrC, T* array, Int_t size) //_____________________________________________________________________________ void THcParmList::PrintFull( Option_t* option ) const { + // Print all the numeric parameter desciptions and values. + // Print all the text parameters THaVarList::PrintFull(option); TextList->Print(); } diff --git a/src/THcRawDCHit.h b/src/THcRawDCHit.h index 05a6b20..5e07787 100644 --- a/src/THcRawDCHit.h +++ b/src/THcRawDCHit.h @@ -33,7 +33,7 @@ protected: private: - ClassDef(THcRawDCHit, 0); // DC hit class + ClassDef(THcRawDCHit, 0); // Raw Drift Chamber hit }; #endif diff --git a/src/THcRawHit.cxx b/src/THcRawHit.cxx index 3e37972..e2cd54e 100644 --- a/src/THcRawHit.cxx +++ b/src/THcRawHit.cxx @@ -10,12 +10,10 @@ #include "THcRawHit.h" -//THcRawHit::~THcRawHit() -//{} Int_t THcRawHit::Compare(const TObject* obj) const { - // Compare to sort by plane and counter + // Comparision function for Sort(). const THcRawHit* hit = dynamic_cast<const THcRawHit*>(obj); diff --git a/src/THcRawHit.h b/src/THcRawHit.h index 7372463..1ee7d16 100644 --- a/src/THcRawHit.h +++ b/src/THcRawHit.h @@ -39,7 +39,7 @@ public: private: - ClassDef(THcRawHit,0) // Track ID abstract base class + ClassDef(THcRawHit,0) // Raw Hit Base Class }; #endif diff --git a/src/THcRawShowerHit.h b/src/THcRawShowerHit.h index 0384295..76f0d14 100644 --- a/src/THcRawShowerHit.h +++ b/src/THcRawShowerHit.h @@ -29,7 +29,7 @@ class THcRawShowerHit : public THcRawHit { private: - ClassDef(THcRawShowerHit, 0); // Shower hit class + ClassDef(THcRawShowerHit, 0); // Raw Shower counter hit }; #endif diff --git a/src/THcScintillatorPlane.h b/src/THcScintillatorPlane.h index cb832fa..9b5f33e 100644 --- a/src/THcScintillatorPlane.h +++ b/src/THcScintillatorPlane.h @@ -113,7 +113,7 @@ class THcScintillatorPlane : public THaSubDetector { virtual Int_t DefineVariables( EMode mode = kDefine ); virtual void InitializePedestals( ); - ClassDef(THcScintillatorPlane,0) + ClassDef(THcScintillatorPlane,0); // Scintillator bars in a plane }; #endif diff --git a/src/THcShower.h b/src/THcShower.h index 4286a82..89e6c05 100644 --- a/src/THcShower.h +++ b/src/THcShower.h @@ -197,7 +197,7 @@ protected: friend class THcShowerPlane; //to access debug flags. - ClassDef(THcShower,0) // Generic class + ClassDef(THcShower,0) // Shower counter detector }; /////////////////////////////////////////////////////////////////////////////// diff --git a/src/THcShowerPlane.h b/src/THcShowerPlane.h index 8cb7e14..41fecdf 100644 --- a/src/THcShowerPlane.h +++ b/src/THcShowerPlane.h @@ -147,6 +147,6 @@ protected: virtual Int_t ReadDatabase( const TDatime& date ); virtual Int_t DefineVariables( EMode mode = kDefine ); virtual void InitializePedestals( ); - ClassDef(THcShowerPlane,0) + ClassDef(THcShowerPlane,0); // Calorimeter bars in a plane }; #endif diff --git a/src/THcSignalHit.h b/src/THcSignalHit.h index 6af80a6..808c730 100644 --- a/src/THcSignalHit.h +++ b/src/THcSignalHit.h @@ -29,7 +29,7 @@ class THcSignalHit : public TObject { Int_t fPaddleNumber; Double_t fData; - ClassDef(THcSignalHit,0) + ClassDef(THcSignalHit,0); // Single signal value and wire/counter number }; ///////////////////////////////////////////////////////////////// #endif diff --git a/src/THcSpacePoint.h b/src/THcSpacePoint.h index bf63699..36faa3d 100644 --- a/src/THcSpacePoint.h +++ b/src/THcSpacePoint.h @@ -84,7 +84,7 @@ protected: Double_t fStub[4]; // Should we also have a pointer back to the chamber object - ClassDef(THcSpacePoint,0) // Drift Chamber class + ClassDef(THcSpacePoint,0); // Space Point/stub track in a single drift chamber }; //////////////////////////////////////////////////////////////////////////////// -- GitLab