diff --git a/src/THcAerogelHit.h b/src/THcAerogelHit.h index c007c84ff544c17767109abc9aef5c80f38a106e..49ddd246adb84eecf18c6214fb2e12e05bb2026d 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 6c97bba481b5793e99d0a1a9568d61d7053fee0e..6d3f0c9fd92b9d609b5c47cc239b4ea7d5708b0c 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 de1180c7b11493c289d24fd172bc1dc35ebe2709..63a0aab95b7faf61220b5709bfc5d50f7eed1919 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 68ea8072538fb3fa7112d25aac64a30987c23bfc..05d5def06181cd6bed17bdba9c9716f418e0e693 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 80302bd549954fb18dd65c1dd315d0b6ffcef71b..c5ca7a74d3e14038ab2fc037cfd7bc31be6adee5 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 e1bbea121d91a039e4b477ceabc0c75895bc438e..3d6157436ddca4ab5150af81744fa6e831ef7b23 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 960a5c373c8396a57c593c8657df78430d70bc2d..2ff706206455a2e40d4ed6b8cfa574fc1145b800 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 a9b84c6fbf4ee6ab8392baf357fbfdd44e2cd81f..cc97ff1c03c7e924bef06e537b78be51417e3c43 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 0e3ce6dce6122392e1e54f4e965b7b797861b529..53f6fcbe39e317c450dfb8440b59c72cfd14c027 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 187c465db60946ed96919af5618a3ad64b04bf61..a4ff120c9cc6dfe477596163af65859494b52acd 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 1dd95b2471267ffd7dee8ef096caf6e381b2091b..420f7de84400227c5352079a1a88d4b938e5d8de 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 b77fca45ed75f682d81e0de0737e9201216f16b1..a7884461cb2e337027420deb215fc2692d7c8f77 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 d6aa10c896ab37b1bb7349a8deeab219c3ffd4ea..b7aac91b7f1b5b9f18b2ca562b8dc91a0cac3cb0 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 19826c076097e3aef7867211e542c3c3aa2cc18c..f906546ec9c187e94ec3f607d90b2089420ae0ad 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 4659785a0495a78dc04e5fe89c67c1d5653d0700..c133fbfbcbdd65ec5b6da0cb960460125c33af1c 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 494866bcb875b326dc40d246e126a7dbc25c3383..040d4c061a70c19ef2106e06c34eaf35d1842f47 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 7d18bc8d808b8ea6cead145c8c615e79544b0504..2c90d460172b2d0f00090210ff900c64502c9fe5 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 853e8f24706d04fe073633ead7c928658e6153ff..ef88875d11635a8a696bc1ac4ffdfb6a2439e0b1 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 d75c690c11fa07a916eed61a8f1867af33b24579..a645b9328ccfc58f65b410704299da7c003e122a 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 05a6b2084963f3a3b62992e8c70e03a4879a52ea..5e077878e66b710a68183ce8618a465d0ba98ffb 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 3e37972a189932d7dd987a50bcbdf8ec59388f37..e2cd54e6116145954a70011f6c9888519cec4dd6 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 7372463c724a5e66229e48ad9bfb3b3bf270a6af..1ee7d16431cc7d2d6e95b32e2750e5ccdabdf3f4 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 0384295b96051c5757c9731ed4f9828eb128a76a..76f0d140a5cae64d1dbff7ce837d276ee6da002f 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 cb832fa7dd0975bf1eb0d064e6e6cb91a2e60cfb..9b5f33e5cc5a40300b3c93bfc7e7755d2ccb1bc1 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 4286a8252b1b169efb2b52fd473c49adf22a7b44..89e6c053558b36af11955fd09c1ed7f41838f587 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 8cb7e141d6c2cf355d56a25a50f62dc98a3f1356..41fecdfcb29768015bca2e7ec96828da94a01e8b 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 6af80a6e68a203261d306336022d015a237a71cf..808c730b287d256ade1d35f8dab854c9c0445d7f 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 bf63699e881b5d921b4aefea52ec1d3d7518d4c1..36faa3d347b911c4728e5baab1422ba3459b9b92 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 }; ////////////////////////////////////////////////////////////////////////////////