BRAT 2.4.5
Class index
Full class index
brahmlib
BRAHMS
ROOT page
//______________________________________________________________________
//
// BrTileParameters is a BRAHMS data class providing storage
// and access function for MultTile specific digitization parameters. 
// This allows modification of the BrDetectorParams content by the 
// user.
//

//______________________________________________________________________
//
// $Id: BrTileParameters.cxx,v 1.1.1.1 2001/06/21 14:55:00 hagel Exp $
// $Author: hagel $
// $Date: 2001/06/21 14:55:00 $
// $Copyright: 2001 BRAHMS Collaboration
//
#include <iostream.h>
#include <iomanip.h>
#include "BrTileParameters.h"
#include "BrDataObject.h"

//______________________________________________________________________
ClassImp(BrTileParameters);


//______________________________________________________________________
 BrTileParameters::BrTileParameters()
{
  // 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
}

//_________________________________________________________________________
 BrTileParameters::BrTileParameters(Char_t *name, 
				   Char_t *title) 
  : BrMultParameters(name, title)
{
  SetDefaultParams();
}

//_________________________________________________________________________
 BrTileParameters::BrTileParameters(Char_t *name, 
				   Char_t *title,
				   Char_t *filename) 
  : BrMultParameters(name, title)
{
  SetDefaultParams();
  ReadASCIIFile(filename);
}

//_________________________________________________________________________
 BrTileParameters::~BrTileParameters()
{
  // Default destructor
}

//_________________________________________________________________________
 void BrTileParameters::SetDefaultParams()
{
  // Set a set of reasonable default parameters.
  // Number of tubes etc are ok with present design. 
  // This is mainly to ensure that the private members are
  // initialized with values that do not give rise to any
  // problems in the methods which uses these parameters;
  //
  fAdcGain     = 101758;  // Pe-> ADC conv = 1.0 // 
  fSigmaTime   =.050;     // 50 psec
  fSigmaAdc    = 1.;      // dAdc/Adc == 100% of PE statistics
  fTdcConv     = 0.025;   // 25 pico seconds per channel (Philips 7681)
  fTdcOffset   = 10;      // channel number for t0
  fAdcOffset   = 200;     // Pedestal channel number
  fNoRings     = 8;       // Number of rings 
  fNoRows      = 6;       // Number of rows
}

//_________________________________________________________________________
 void BrTileParameters::ListParameters() const
{
  // List the detector parameters
  BrMultParameters::ListParameters();
  cout << "**MultTile Parameter Listing; The Detector name is " 
       << GetName() << endl
       << "Simulation Parameters " << endl
       << " TDC conversion     " << setw(8) << fTdcConv*1000. 
       << " (psec per channel)"  << endl
       << " sigma (TDC)        " << setw(8) << fSigmaTime*1000.    
       << " (psec)"              << endl
       << " TDC Offset         " << setw(8) << fTdcOffset 
       << " (channels)"          << endl;
}

//_________________________________________________________________________
 void BrTileParameters::SetASCIIParameters(Char_t *line) 
{
  //Interpret a line for Tile 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,"fSigmaTime"))
      sscanf(value_loc,"%f",&fSigmaTime);
    else if(!strcasecmp(paramName,"fTdcConv"))
      sscanf(value_loc,"%f",&fTdcConv);
    else if(!strcasecmp(paramName,"fTdcOffset"))
      sscanf(value_loc,"%f",&fTdcOffset);
    else 
      BrMultParameters::SetASCIIParameters(line);
    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: BrTileParameters.cxx,v $
// Revision 1.1.1.1  2001/06/21 14:55:00  hagel
// Initial revision of brat2
//
// Revision 1.5  2001/05/31 01:47:14  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.
//
// Revision 1.4  2001/05/03 18:45:54  cholm
// Fixed a few superflous warnings, and uninitialised array in BrTileParameters
//
// Revision 1.3  2001/04/02 01:18:37  sanders
// BrRdoMult and BrRdoModuleMult reinstated.  These files develop the joint
// Si+Tile multiplicity.  BrRdoModuleMult now gets it parameters from the
// BrTileRdoModule and BrSiRdoModule classes and is a friend of these classes.
//
// Revision 1.2  2001/01/31 17:34:19  cholm
// Corrected bug in BrTileParameters when readin from DetectorParameters.txt
//
// Revision 1.1  2001/01/29 20:14:21  cholm
// Changed name of BrDetectorParamsMultTile to BrTileParameters. See also
// corresponding log message for BrSiParameters.
//
// Revision 1.4  2000/08/17 14:50:43  hito
// *** empty log message ***
//
// Revision 1.3  2000/07/26 22:08:37  hito
// Mapping of digitization for si and tile were changed to reflect the raw data
// and the change in gbrahms.
//
// Revision 1.2  2000/03/21 21:22:20  cholm
// Several changes: A few hacks where needed to compile on Digital Unix, noticably in my - Christian Holm - classes for the DB and Exceptions. Proberly still need to do something to some of Konstantins stuff. Also, I removed a lot of warnings fromt the compiler, by teddying up the code. Several places, old C-style indecies in for loops were assumed. Corrected. Unused variables have been commented out.
//
// Revision 1.1  1999/11/30 22:22:15  videbaek
// dded new class to digitize Multiplicity tiles.
//
//

This page automatically generated by script docBrat by Christian Holm

Copyright ; 2002 BRAHMS Collaboration <brahmlib@rcf.rhic.bnl.gov>
Last Update on by

Validate HTML
Validate CSS