From d2a6875c2b1f19533272ffb04904cf917f15e17d Mon Sep 17 00:00:00 2001 From: "Stephen A. Wood" <saw@jlab.org> Date: Wed, 10 Sep 2014 14:41:41 -0400 Subject: [PATCH] Get rid of some warnings and excess couts --- src/THcDetectorMap.cxx | 4 ++-- src/THcDriftChamberPlane.cxx | 12 +++++++++--- src/THcHallCSpectrometer.cxx | 9 +++++---- src/THcInterface.cxx | 4 ++-- src/THcParmList.cxx | 8 ++++---- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/THcDetectorMap.cxx b/src/THcDetectorMap.cxx index c6d25a0..b85a650 100644 --- a/src/THcDetectorMap.cxx +++ b/src/THcDetectorMap.cxx @@ -329,9 +329,9 @@ void THcDetectorMap::Load(const char *fname) fNchans++; } } - cout << endl << " Detector ID Map" << endl << endl; + cout << endl << " Detector ID Map" << endl << endl; for(Int_t i=0; i < fNIDs; i++) { - cout << i << " "; + cout << " "; cout << fIDMap[i].name << " " << fIDMap[i].id << endl; } cout << endl; diff --git a/src/THcDriftChamberPlane.cxx b/src/THcDriftChamberPlane.cxx index b1828dd..56e5484 100644 --- a/src/THcDriftChamberPlane.cxx +++ b/src/THcDriftChamberPlane.cxx @@ -91,7 +91,6 @@ Int_t THcDriftChamberPlane::ReadDatabase( const TDatime& date ) Int_t NumDriftMapBins; Double_t DriftMapFirstBin; Double_t DriftMapBinSize; - Double_t DriftMap[1000]; prefix[0]=tolower(GetParent()->GetPrefix()[0]); prefix[1]='\0'; @@ -99,11 +98,17 @@ Int_t THcDriftChamberPlane::ReadDatabase( const TDatime& date ) {"driftbins", &NumDriftMapBins, kInt}, {"drift1stbin", &DriftMapFirstBin, kDouble}, {"driftbinsz", &DriftMapBinSize, kDouble}, - {Form("wc%sfract",GetName()),DriftMap,kDouble,1000}, {0} }; gHcParms->LoadParmValues((DBRequest*)&list,prefix); + Double_t *DriftMap = new Double_t[NumDriftMapBins]; + DBRequest list2[]={ + {Form("wc%sfract",GetName()),DriftMap,kDouble,NumDriftMapBins}, + {0} + }; + gHcParms->LoadParmValues((DBRequest*)&list2,prefix); + // Retrieve parameters we need from parent class THcDC* fParent; @@ -194,10 +199,11 @@ Int_t THcDriftChamberPlane::ReadDatabase( const TDatime& date ) fPlaneCoef[7]=-hzchi*hxpsi + hxchi*hzpsi; // 0. fPlaneCoef[8]= hychi*hxpsi - hxchi*hypsi; // 1. - cout << fPlaneNum << " " << fNWires << " " << fWireOrder << endl; + // cout << fPlaneNum << " " << fNWires << " " << fWireOrder << endl; fTTDConv = new THcDCLookupTTDConv(DriftMapFirstBin,fPitch/2,DriftMapBinSize, NumDriftMapBins,DriftMap); + delete [] DriftMap; Int_t nWires = fParent->GetNWires(fPlaneNum); // For HMS, wire numbers start with one, but arrays start with zero. diff --git a/src/THcHallCSpectrometer.cxx b/src/THcHallCSpectrometer.cxx index c954154..f8daf05 100644 --- a/src/THcHallCSpectrometer.cxx +++ b/src/THcHallCSpectrometer.cxx @@ -245,7 +245,7 @@ Int_t THcHallCSpectrometer::ReadDatabase( const TDatime& date ) int good=1; while(good && line[0]=='!') { good = getline(ifile,line).good(); - cout << line << endl; + // cout << line << endl; } // Read in focal plane rotation coefficients // Probably not used, so for now, just paste in fortran code as a comment @@ -262,9 +262,9 @@ Int_t THcHallCSpectrometer::ReadDatabase( const TDatime& date ) // Read in reconstruction coefficients and exponents line=" "; good = getline(ifile,line).good(); - cout << line << endl; + // cout << line << endl; fNReconTerms = 0; - cout << "Reading matrix elements" << endl; + //cout << "Reading matrix elements" << endl; while(good && line.compare(0,4," ---")!=0) { if(fNReconTerms >= fMaxReconElements) { Error(here, "too much data in reconstruction coefficient file %s",reconCoeffFilename.c_str()); @@ -283,8 +283,9 @@ Int_t THcHallCSpectrometer::ReadDatabase( const TDatime& date ) fNReconTerms++; good = getline(ifile,line).good(); } + cout << "Read " << fNReconTerms << " matrix element terms" << endl; if(!good) { - Error(here, "error processing reconstruction coefficient file %s",reconCoeffFilename.c_str()); + Error(here, "Error processing reconstruction coefficient file %s",reconCoeffFilename.c_str()); return kInitError; // Is this the right return code? } diff --git a/src/THcInterface.cxx b/src/THcInterface.cxx index ef72321..e7c1d5b 100644 --- a/src/THcInterface.cxx +++ b/src/THcInterface.cxx @@ -86,8 +86,8 @@ THcInterface::THcInterface( const char* appClassName, int* argc, char** argv, // gHaDB = new THaFileDB(); gHaTextvars = new THaTextvars; - cout << "In THcInterface ... " << endl; - cout << "Decoder => " << gHaDecoder << endl; + // cout << "In THcInterface ... " << endl; + // cout << "Decoder => " << gHaDecoder << endl; // Set the maximum size for a file written by Podd contained by the TTree // putting it to 1.5 GB, down from the default 1.9 GB since something odd diff --git a/src/THcParmList.cxx b/src/THcParmList.cxx index 56d46c4..08057a2 100644 --- a/src/THcParmList.cxx +++ b/src/THcParmList.cxx @@ -61,7 +61,7 @@ void THcParmList::Load( const char* fname, Int_t RunNumber ) Int_t nfiles=0; ifiles[nfiles].open(fname); if(ifiles[nfiles].is_open()) { - cout << nfiles << ": " << "Opened \"" << fname << "\"" << endl; + cout << "Opening parameter file: [" << nfiles << "] " << fname << endl; nfiles++; } @@ -94,7 +94,7 @@ void THcParmList::Load( const char* fname, Int_t RunNumber ) if(!getline(ifiles[nfiles-1],line)) { ifiles[nfiles-1].close(); nfiles--; - cout << nfiles << ": " << "Closed" << endl; + // cout << nfiles << ": " << "Closed" << endl; continue; } // Look for include statement @@ -112,10 +112,10 @@ void THcParmList::Load( const char* fname, Int_t RunNumber ) } else { line.erase(line.find_first_of(whtspc)); } - cout << line << endl; + // cout << line << endl; ifiles[nfiles].open(line.c_str()); if(ifiles[nfiles].is_open()) { - cout << nfiles << ": " << "Opened \"" << line << "\"" << endl; + cout << "Opening parameter file: [" << nfiles << "] " << line << endl; nfiles++; } continue; -- GitLab