BRAT 2.4.5
Class index
Full class index
brahmlib
BRAHMS
ROOT page
//
// List of detectors 
//

//
// $Id: BrDetectorList.cxx,v 1.4 2001/12/21 19:48:53 operator Exp $
// $Author: operator $
// $Date: 2001/12/21 19:48:53 $
// $Copyright: BRAHMS Collaboration 2000
//
// $Log: BrDetectorList.cxx,v $
// Revision 1.4  2001/12/21 19:48:53  operator
// fixed detector type for TD1 & TMRS
//
// Revision 1.3  2001/12/21 15:18:51  ejkim
// add "TD1" & "TMRS" fro trigger counter etc
//
// Revision 1.2  2001/07/16 18:42:05  cholm
// Fixed dictionary generation, so that detctor bits work in interpreted code,
// i.e., the configuration scripts.  Also added the method Print so that one
// can print which detectors are on/off easily in a given detector mask.
//
// Revision 1.1.1.1  2001/06/21 14:55:19  hagel
// Initial revision of brat2
//
// Revision 1.5  2000/11/23 01:30:35  brahmlib
// Changed name/title types to const Char_t* instead of Char_t* in CTOR.
//
// Revision 1.4  2000/08/14 17:29:10  cholm
// Following advice of Fons Rademarkers, I've changed the datatype of
// BrDetectorList::kNumberOfDetectors from static const Int_t to enum,
// so that TDataMember::GetMaxIndex(0) for BrDetectorList::kDetectorNames[]
// doens't return  large negative number, which f**k up the HTML generation.
//
// Revision 1.3  2000/07/28 20:40:09  alv
// Removed unnecessary include statements for iostream, iomanip, TMath and cmath.
// Used symbolic name (BrDetectorList::kNumDetectors) in array declarations.
//
// Revision 1.2  2000/05/17 10:36:22  ouerdane
// see top of file
//
// Revision 1.1  2000/04/06 20:17:45  cholm
// Added the classes BrAppOption, BrAppOptionManager, and
// BrDetectorList. The first two are for command line processing,
// the third for easy detector list, can be used for many purposes.
//
//
#include <TObject.h>
#include <BrDetectorList.h>
#ifndef WIN32
#ifndef __IOSTREAM__
#include <iostream>
#endif
#ifndef __IOMANIP__
#include <iomanip>
#endif
#else 
#include <iostream.h>
#include <iomanip.h>
#endif
//____________________________________________________________________
ClassImp(BrDetectorList); 

//____________________________________________________________________
 BrDetectorList::BrDetectorList(EBrSectorBit mask) 
  : fDetectorMask(mask)
{
  // Default constructor. By default, all detectors are on. 
}

//____________________________________________________________________
 BrDetectorList::BrDetectorList(BrDetectorList& mask) 
  : fDetectorMask(mask.GetDetectorMask())
{
}

//____________________________________________________________________
 const Char_t* BrDetectorList::GetDetectorName(EBrDetectorBit bit)
{
  // Return name of detector, accroding to bit given as arg. 

  if (bit >= 0 
      && Int_t(bit) < kNumDetectors)
    return BrDetectorList::kDetectorNames[bit];
  return 0;
}

//____________________________________________________________________
 const Char_t* BrDetectorList::GetDetectorType(EBrDetectorBit bit)
{
  // Return name of detector, according to bit given as arg. 

  if (bit >= 0 
      && Int_t(bit) < kNumDetectors)
    return BrDetectorList::kDetectorTypes[bit];
  return 0;
}

//____________________________________________________________________
 void BrDetectorList::Print(Option_t* option) const 
{
  cout << " Bit | Detector | Type     | on/off" << endl
       << "-----+----------+----------+--------" << endl;
  for (Int_t i = 0; i < kNumDetectors; i++) 
    cout << setw(4) << i 
         << " | " << setw(8)  
	 << BrDetectorList::GetDetectorName(EBrDetectorBit(i)) 
	 << " | " << setw(8)  
	 << BrDetectorList::GetDetectorType(EBrDetectorBit(i)) 
	 << " | " << (IsOn(EBrDetectorBit(i)) ? "on" : "off") << endl;
  cout << "-----+----------+----------+--------" << endl;
}
  

// This is changed to a enum type following advice of Fons R.
// const Int_t BrDetectorList::kNumDetectors  = 17;

//____________________________________________________________________
// Array of detector names. 
//const Char_t* 
// BrDetectorList::kDetectorNames[BrDetectorList::kNumDetectors]
const Char_t* 
BrDetectorList::kDetectorNames[] = { 
  "T1", "T2", "C1", "TOF1",           // 4 in front forward
  "T3", "T4", "T5", "TOF2", "RICH",   // 5 in back forward     
  "TPM1", "TPM2", "TFP1", "GASC",     // 4 in mid rapidity       
  "MultTile", "MultSi", "BB", "ZDC",   // 4 in global
  "TD1","TMRS"
}
;

//____________________________________________________________________
// Array of detector types. 
const Char_t* 
BrDetectorList::kDetectorTypes[BrDetectorList::kNumDetectors] = { 
  "TPC", "TPC", "C1", "Tof",          // 4 in front forward
  "DC", "DC", "DC", "Tof", "RICH",    // 5 in back forward     
  "TPC", "TPC", "Tof", "GASC",        // 4 in mid rapidity       
  "Tile", "Si", "BB", "ZDC",           // 4 in global
  "Tof","Tof"
}
;



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