|
//____________________________________________________________________ // // // //____________________________________________________________________ // // $Id: BrMultParameters.cxx,v 1.1.1.1 2001/06/21 14:55:01 hagel Exp $ // $Author: hagel $ // $Date: 2001/06/21 14:55:01 $ // $Copyright: (C) 2001 BRAHMS Collaboration <brahmlib@rhic.bnl.gov> // #ifndef BRAT_BrMultParameters #include "BrMultParameters.h" #endif #include <iostream.h> #include <iomanip.h> //____________________________________________________________________ ClassImp(BrMultParameters); //______________________________________________________________________ BrMultParameters::BrMultParameters() { // Constructor. Set counter and list data members to zero. // Don't use this constructor unless you have to and know // what you are doing // Use BrDetectorParams(Char_t, Char_t ) instead } //_________________________________________________________________________ BrMultParameters::BrMultParameters(Char_t *name, Char_t *title) : BrDetectorParamsBase(name, title) { // Standard constructor. // the name should be that of the associated detector e.g. "Tile" } //_________________________________________________________________________ BrMultParameters::BrMultParameters(Char_t *name, Char_t *title, Char_t *filename) : BrDetectorParamsBase(name, title) { // Standard constructor. // the name should be that of the associated detector e.g. "Tile" } //_________________________________________________________________________ void BrMultParameters::ListParameters() const { // List the detector parameters cout << "** MultParameter Listing; The Detector name is " << GetName() << endl << "Detector Parameters" << endl << " No modules = " << setw(8) << fNoRings * fNoRows << " in " << fNoRings << " rings and " << fNoRows << " rows " << endl << "Simulation Parameters " << endl << " ADC relative Gain " << setw(8) << fAdcGain << " Channels per PE" << endl << " ADC resolution " << setw(8) << fSigmaAdc << " (factor)" << endl << " ADC Offset " << setw(8) << fAdcOffset << " (channels)" << endl; } //_________________________________________________________________________ void BrMultParameters::SetASCIIParameters(Char_t *line) { //Interpret a line for TMA/SMA params. // Form is ParamName:value. // Eg // fTwopar:.20 // or // fEff: 0.95 Char_t paramName[80]; // Find first non-blank character in the line (in case user didn't // start in column 1 Int_t i; for(i = 0; i < (Int_t)strlen(line); i++) if(strncmp(&line[i]," ",1)) break; //Copy that to paramName strcpy(paramName,&line[i]); Char_t *iloc = strchr(paramName,':'); Char_t *value_loc = iloc+1; if(iloc) { iloc[0] = 0; //blank out the semicolon Char_t *ilocc = strchr(paramName,' '); if(ilocc) ilocc[0] = 0; //blank out space at end if it exists if(!strcasecmp(paramName,"fNoRows")) { sscanf(value_loc,"%d",&fNoRows); } else if(!strcasecmp(paramName,"fNoRings")) { sscanf(value_loc,"%d",&fNoRings); } else if(!strcasecmp(paramName,"fAdcGain")) { sscanf(value_loc,"%f",&fAdcGain); } else if(!strcasecmp(paramName,"fSigmaAdc")) { sscanf(value_loc,"%f",&fSigmaAdc); } else if(!strcasecmp(paramName,"fAdcOffset")) { sscanf(value_loc,"%f",&fAdcOffset); } else { cout<<"Error: "<<paramName<<" is not one of the parameters"<<endl; return; } return; //this is a normal return } else { cout<<"Error, : missing to delineate name from value"<<endl; cout<<"The string is "<<line<<endl; cout<<"No value set!!!"<<endl; return; } } //____________________________________________________________________ // // $Log: BrMultParameters.cxx,v $ // Revision 1.1.1.1 2001/06/21 14:55:01 hagel // Initial revision of brat2 // // Revision 1.1 2001/05/31 01:46:01 cholm // Second rewamp of this directory. All RDO modules use the common // BrMultRdoModule, and they both write BrMultRdo Objects. Also introduced // ABC for Br[Tile|Si][Parameters|Calibration] since they have a lot in common, // and the code can be made more efficient this way. // // A possible further thing to do, is to make an ABC for the CentModules, and // the corresponding calibration modules, since they are very VERY similar. // However, the current module BrMultCentModule is in the way. Need to talk // to Steve about that. // // |
||||||
This page automatically generated by script docBrat by Christian Holm |
Copyright ; 2002 BRAHMS Collaboration
<brahmlib@rcf.rhic.bnl.gov>
|