BRAT 2.4.5
Class index
Full class index
brahmlib
BRAHMS
ROOT page
//_________________________________________________________________
// 
//	BrTileDig
//
// Elementary objects for digitized Mult Tiles information. The are
// derived from BrDataObject in order to be attached directly to a
// BrEventNode.
//
// The index into the internal array of ADC values are the one
// defined by the DAQ event builder - see also BrRawDataInput. 
//
// For an example on reading back the digits, see BrSiDig. 
//

//_________________________________________________________________
//
// $Id: BrTileDig.cxx,v 1.3 2001/06/28 16:43:33 cholm Exp $
// $Author: cholm $
// $Date: 2001/06/28 16:43:33 $
// $Copyright: 2001 BRAHMS Collaboration <brahmlib@rhic.bnl.gov>
//
#include "BrTileDig.h"
#include <iostream.h>
#include <iomanip.h>

//_________________________________________________________________
ClassImp(BrTileDig);

//_________________________________________________________________
 BrTileDig::BrTileDig() 
{
  // Default CTOR, do not use 
  Clear();
}

//_________________________________________________________________
 BrTileDig::BrTileDig(const Char_t* name, const Char_t* title) 
  : BrDataObject(name, title)
{
  //  Named CTOR.  
  Clear();
}

//_______________________________________________________________
 Short_t BrTileDig::GetAdc(const Int_t itube) const 
{
  // Get ADC value.  itube is channel number in range [1,fNumSiChan]
  if(itube > 0 && itube <= fNumTilesChan)
    return fAdc[itube-1];
  else 
    return 0;
}

//_______________________________________________________________
 void BrTileDig::SetAdc(const Int_t itube,const Short_t val) 
{
  // Set ADC value.  itube is channel number in range [1,fNumSiChan]
  if(itube > 0 && itube<= fNumTilesChan)
    fAdc[itube-1] = val;
}

//_______________________________________________________________
 Short_t BrTileDig::GetId(const Int_t itube) const  
{
  // Get ID.  itube is channel number in range [1,fNumSiChan]
  if(itube > 0 && itube <= fNumTilesChan)
    return fId[itube-1];
  else 
    return 0;
}

//_______________________________________________________________
 void BrTileDig::SetId(const Int_t itube,const Short_t val) 
{
  // Set ID.  itube is channel number in range [1,fNumSiChan]
  if(itube > 0 && itube<= fNumTilesChan) 
    fId[itube-1] = val;
}

//_______________________________________________________________
 void BrTileDig::Clear(Option_t* option) 
{
  //Set all values to 0
  fNumTilesChan = BR_TILE_CHAN_MAX;
  for(Short_t i = 0; i < fNumTilesChan; i++) {
    fAdc[i] = 0;
    fId[i]  = 0;
  }
}
//_______________________________________________________________
 void BrTileDig::Print(Option_t* option) const
{
  // Print information on this object. 
  // Options:
  //    D         Give detailed class information as well 
  //    R         Recursively list internal data (Default)
  cout << "TMA Digits:" << endl;

  TString opt(option);
  opt.ToLower();

  BrDataObject::Print(option);
  if (opt.Contains("d")) 
    cout << endl 
         << "  Original author: Hiro Ito" << endl
         << "  Last Modifications: " << endl 
         << "    $Author: cholm $" << endl  
         << "    $Date: 2001/06/28 16:43:33 $"   << endl 
         << "    $Revision: 1.3 $ " << endl  
         << endl 
         << "-------------------------------------------------" << endl;

  if (opt.Contains("r"))
    for(Short_t i = 0; i < fNumTilesChan; i++) 
      cout << "  ID # " << setw(4) << fId[i] 
	   << "  ADC: " << setw(8) << fAdc[i] << endl; 
}


//  $Log: BrTileDig.cxx,v $
//  Revision 1.3  2001/06/28 16:43:33  cholm
//  Added initialisation and fleshed out a couple of methods.
//
//  Revision 1.2  2001/06/25 14:26:53  cholm
//  Made Print conform to TObject
//
//  Revision 1.1.1.1  2001/06/21 14:55:01  hagel
//  Initial revision of brat2
//
//  Revision 1.2  2001/05/31 01:47:10  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.1  2001/01/29 20:46:33  cholm
//  Added the two classes BrSiDig and BrTileDig, which are basically a renaming
//  of the classes BrDigSi and BrDigTiles, however, the new ones fit in with
//  the intented naming scheme. The two old classes are kept for backward
//  compatiblity , but can be faced out soon.
//
//  Revision 1.6  2000/12/19 20:16:50  hagel
//  Implemented Clear method (to make using with tree's more convenient)
//
//  Revision 1.5  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.4  2000/05/24 13:58:04  cholm
//  Added some new method. Most noticably "BrDigSi::GetNumberOfChannels()",
//  and "BrDigMultSi::GetName()". Hito has maked "BrDigMultSi" as obsolete,
//  should probably be put in the Attic.
//  Also. "BrDitigitizeMultSi" now uses "BrDigSi", similar to what
//  "BrDigitizeMultTile" does.
//  Put a body into "BrDigSi::List()".
//
//  Revision 1.3  2000/05/20 18:18:27  hito
//  I (Hiro) added the Silicon strip detector.
//
//  Revision 1.2  2000/03/17 01:01:26  hagel
//  Add fId, GetId() SetId() to BrTileDig
//
//  Revision 1.1  2000/02/16 22:22:21  brahmlib
//  New Raw Digitzed data class - replaces BrDigMultTiles.
//
//

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