BRAT 2.4.5
Class index
Full class index
brahmlib
BRAHMS
ROOT page
// $Id: BrDetectorVolume.cxx,v 1.12 2002/08/06 19:03:43 hagel Exp $
// $Author: hagel $
//
//

#include <stdio.h>

#include <BrIostream.h>
//
// Brat Classes
//
#include "BrDetectorVolume.h"
#include "BrRotMatrix.h"
#include "BrVector3D.h"
#include "BrUnits.h"

//Needed for MySQL db access
#include "BrRunsDb.h"
#include "BrRunInfoManager.h"
#include "BrGeometriesDb.h"

ClassImp(BrDetectorVolume);
ClassImp(BrAsciiVolumeMap)

////////////////////////////////////////////////////////////
//
// BrDetectorVolume is a BRAHMS base class providing information
// about detector geometry, and uniform access to a specific
// detector that may have additional information.
//
// Some of the basic functionality is that each detectorvolume
// contains a BrCoordinateSystem information and thus enable transformation
// between Local, Global and other Master Systems. In addition there are definitions
// of other volume parameters as active volume, shape etc. that
// can be helpful in projection of lines to detector specific planes. 
//
//
////////////////////////////////////////////////////////////

//____________________________________________________________________________________
  BrDetectorVolume::BrDetectorVolume():TNamed() {
// Default Constructor. Set counter and list data members to zero.
// Don't use this constructor unless you have to and know
// what you are doing

}

BrDetectorVolume::BrDetectorVolume(const Char_t *name, const Char_t *title,
				   const Char_t *ASCIIFileName)
  :TNamed(name,title) {
  // This constructor should only be used in stand alone application
  /// and not in connection with the VolumeDbManager.
  fVerbose=kFALSE;
  ReadASCIIFile(ASCIIFileName,name);
  fRunDb      = 0;  //Reading ASCII file; don't need run manager
  fGeometryDb = 0;
  fRunManager = 0;
  fAsciiVolumeList = 0;
}



BrDetectorVolume::BrDetectorVolume(const Char_t *name, const Char_t *title)
  :TNamed(name,title) {
  //Normal named constructor

  fVerbose=kFALSE;
  fRunDb      = 0; //Don't need for this constructor
  fGeometryDb = 0;
  fRunManager = 0;
  fAsciiVolumeList = 0;
}

BrDetectorVolume::BrDetectorVolume(const Char_t *name, TObjArray *asciiVolList)
  :TNamed(name,name) {
  //Constructor called from BrGeometryDbManager in MySQL mode

  fVerbose=kFALSE;
  fRunDb           = BrRunsDb::Instance();
  fRunManager      = BrRunInfoManager::Instance();
  fGeometryDb      = BrGeometriesDb::Instance();
  fAsciiVolumeList = asciiVolList;
}

BrDetectorVolume::BrDetectorVolume(const Char_t *name, const Char_t *title, 
				   Float_t sizeX, Float_t sizeY, Float_t sizeZ,
                                   BrVector3D& origin, BrRotMatrix& rotMatrix)
  :TNamed(name,title) {
  //Constructor specifying size, origin and rotMatrix directly

  fVerbose = kFALSE;
  SetVolumeParameters(sizeX,sizeY,sizeZ,origin,rotMatrix);
  fRunDb      = 0;
  fGeometryDb = 0;
  fRunManager = 0;
  fAsciiVolumeList = 0;
}


BrDetectorVolume::~BrDetectorVolume() {
}

//____________________________________________________________________
void 
BrDetectorVolume::SetVolumeParameters(float xl, float yl, float zl, 
				      float angle, float beta, float xl_center, 
				      float yl_center, float zl_center, 
				      char *type)
{

  fSize[0] = xl;
  fSize[1] = yl;
  fSize[2] = zl;
  strcpy(fType, type);
  
  //
  // Define the coordinate system using a vector origin
  // and a rotation matrix.
  //
  BrVector3D origin(xl_center, yl_center, zl_center);
  Float_t ang1, ang2;
  if(angle < 0.0){
      ang1 = -angle;
      ang2 = (Float_t)180.; 
  }
  else
    {
      ang1 = angle;
      ang2 = (Float_t)0.0;
    }
  
  Float_t theta3 = ang1;
  Float_t phi3   = ang2;
  Float_t theta2 = 90.0;
  Float_t phi2   = 90.0;
  
  BrRotMatrix *rBeta;
  
  if(beta>0){
    rBeta = new BrRotMatrix(90, 0, 90+beta, 90, beta, 90);
  }
  else if(beta<0){
    rBeta = new BrRotMatrix(90, 0, 90+beta, 90, -beta, -90);
  }
  else {
    rBeta = new BrRotMatrix(90, 0, 90., 90, 0., 0.);
  }
  
  BrRotMatrix rotmi(90.+angle,0.,theta2,phi2, theta3, phi3);
  BrRotMatrix rotm(&rotmi, rBeta);
  fSystem.SetOrigin(origin);
  fSystem.SetRotMatrix(rotm);
}

//____________________________________________________________________
void BrDetectorVolume::AddVerticalRotation(Float_t &theta2,Float_t &phi2,
					   Float_t &theta3,Float_t &phi3,
					   Float_t beta)
{
  
  
  
  const Double_t degrad = BrUnits::degree;
  
  Double_t t2 = (Double_t)theta2 * degrad;
  Double_t p2 = (Double_t)phi2 * degrad;
  Double_t t3 = (Double_t)theta3 * degrad;
  Double_t p3 = (Double_t)phi3 * degrad;
  Double_t b  = (Double_t)beta * degrad;
  
  Double_t cost2 = TMath::Cos(t2) * (TMath::Cos(b) - TMath::Sin(b));
  Double_t sinp2 = TMath::Sin(t2)*TMath::Sin(p2)*TMath::Cos(b)/TMath::Sin(t2);
  
  Double_t cost3 = TMath::Cos(t3) * TMath::Cos(b);
  Double_t sinp3 = (TMath::Sin(t3)*TMath::Sin(p3)+TMath::Tan(b))*TMath::Cos(b)/TMath::Sin(t3);
  

  theta2 = TMath::ACos(cost2) / degrad;
  phi2   = TMath::ASin(sinp2) / degrad;
  
  theta3 = TMath::ACos(cost3) / degrad;
  if(TMath::Abs(p3) > 0)
    phi3   = -TMath::ASin(sinp3) / degrad + 180.0;
  else
    phi3 = TMath::ASin(sinp3) / degrad;
  
}

//____________________________________________________________________
void BrDetectorVolume::SetVolumeParameters(Float_t sizeX, Float_t sizeY, 
                                   Float_t sizeZ,
                                   BrVector3D origin, BrRotMatrix rotMatrix)
{
  //Alternate volume parameter setting routine.  More modern KH 4-May-2001
  //Convenient to use with MySQL mode of DB after calling 
  //name, title constructor

  fSize[0] = sizeX;
  fSize[1] = sizeY;
  fSize[2] = sizeZ;
  fSystem.SetOrigin(origin);
  fSystem.SetRotMatrix(rotMatrix);
}

//____________________________________________________________________
void 
BrDetectorVolume::ListParameters()
{
  //  2/22/02 - Slated to become obsolete - use Print() instead
  Warning("ListParameters","Obsolete - Use Print() instead");
  Print("d");
}


//____________________________________________________________________
Bool_t 
BrDetectorVolume::ReadASCIIFile(const Char_t *ASCIIFileName,
				const Char_t *DetectorName)
{
  FILE *GeoFile;
#define maxgeoline 80
  Char_t geo_line[maxgeoline];
  Char_t det_name[5],det_type[5];
  
  Float_t xl,yl,zl,angle,beta,xl_center,yl_center,zl_center;
  Char_t *c;
  Int_t idet;

  if (fVerbose)
    {
      printf("Opening Volume file %s\n",ASCIIFileName);
      printf("Looking for %s\n",DetectorName);
    }

  if( !(GeoFile = fopen( ASCIIFileName,"r"))){
    cout << "File not present : " << ASCIIFileName << endl;
    return kFALSE;
  }

  while(( c = fgets(geo_line,maxgeoline,GeoFile))) {
    
    idet = strncmp(geo_line,"DETECTOR=",8);
    if( !idet ) {
      
      //       We have found a detector, so process as such.
      beta=0.0;
      sscanf(geo_line,"DETECTOR= %s TYPE: %s",det_name,det_type);
      
      if( !strcasecmp(det_name,"TPC1") ) 
	strcpy(det_name,"T1");
      if( !strcasecmp(det_name,"TPC2") ) 
	strcpy(det_name,"T2");
      fgets(geo_line,maxgeoline,GeoFile);
      sscanf(geo_line," Det size   x = %f",&xl);
      fgets(geo_line,maxgeoline,GeoFile);
      sscanf(geo_line," Det size   y = %f",&yl);
      fgets(geo_line,maxgeoline,GeoFile);
      sscanf(geo_line," Det size   z = %f",&zl);
      fgets(geo_line,maxgeoline,GeoFile);
      sscanf(geo_line," rotation ang = %f",&angle);
      long nbytes = ftell(GeoFile);
      fgets(geo_line,maxgeoline,GeoFile);
      if (sscanf(geo_line," vertical ang = %f",&beta));         
      else
	fseek(GeoFile, nbytes, SEEK_SET);
      fgets(geo_line,maxgeoline,GeoFile);
      sscanf(geo_line," Det center x = %f",&xl_center);
      fgets(geo_line,maxgeoline,GeoFile);
      sscanf(geo_line," Det center y = %f",&yl_center);
      fgets(geo_line,maxgeoline,GeoFile);
      sscanf(geo_line," Det center z = %f",&zl_center);
     
      if(!strcasecmp(DetectorName,det_name)) {
	SetVolumeParameters(xl,yl,zl,angle,beta,
			    xl_center,yl_center,zl_center,det_type);
	fclose(GeoFile);
	return kTRUE;
      }
      if( !strncasecmp(det_type,"TOF",3) ) {
	//	   cout<<"Found TOF Detector "<<det_name<<endl;
      }
      else if( !strncasecmp(det_type,"TRAK",4) ) {
	//	    cout<<"Found TRAK Detector "<<det_name<<endl;
      }
      else if( !strncasecmp(det_type,"CHKV",4) ) {
	//	    cout<<"Found CHKV Detector "<<det_name<<endl;
      }
      else {
	printf("Found no Detectorn");
	return kFALSE;
      }
    }
  }
  return kFALSE;
}




//______________________________________________________________
void BrDetectorVolume::GlobalToLocal(const float* xg,
				     float* xl, int flag)
{
  BrVector3D Xg(xg);
  BrVector3D Xl; 
  if(flag==0)
    Xl = fSystem.TransformFromMaster(Xg);
  else
    Xl = fSystem.RotateFromMaster(Xg);
  for(int i=0;i<3;i++) xl[i]=(Float_t)Xl(i);
}

//______________________________________________________________
void BrDetectorVolume::GlobalToLocal(const BrVector3D& xg, 
				     BrVector3D& xl, int flag)
{

  if(flag==0)
    xl = fSystem.TransformFromMaster(xg);
  else
    xl = fSystem.RotateFromMaster(xg);
}

//______________________________________________________________
BrLine3D BrDetectorVolume::GlobalToLocal(const BrLine3D& line)
{
  BrVector3D xl = fSystem.TransformFromMaster(line.GetOrigin());
  BrVector3D al = fSystem.RotateFromMaster(line.GetDirection());
  BrLine3D newline(xl,al);
  return newline;
}

//______________________________________________________________
void BrDetectorVolume::LocalToGlobal(const float xl[3],
				     float xg[3],int flag)
{

  //flag = 1 transform direction cosines
  //flag = 0 transform coordinates
  BrVector3D Xl(xl);
  BrVector3D Xg; 
  if(flag==0)
    Xg = fSystem.TransformToMaster(Xl);
  else
    Xg = fSystem.RotateToMaster(Xl);
  for(int i=0;i<3;i++) xg[i]=(Float_t)Xg(i);
}

//______________________________________________________________
void BrDetectorVolume::LocalToGlobal(const BrVector3D& xl, 
				     BrVector3D& xg,int flag)
{
  //flag = 1 transform direction cosines
  //flag = 0 transform coordinates
  if(flag==0)
	xg = fSystem.TransformToMaster(xl);
  else
    xg = fSystem.RotateToMaster(xl);
}

//______________________________________________________________
BrLine3D BrDetectorVolume::LocalToGlobal(const BrLine3D& line)
{
  BrVector3D xg,ag;
  LocalToGlobal(line.GetOrigin(),xg,0);
  LocalToGlobal(line.GetDirection(),ag,1);
  BrLine3D newline(xg,ag);
  return newline;
}


//______________________________________________________________
BrVector3D 
BrDetectorVolume::GetPosVector3D()
{
  // Return volume position as a vector
  //
  return (fSystem.GetOrigin());
}

//______________________________________________________________
BrVector3D 
BrDetectorVolume::GetPosition()
{
  // Return volume position as a vector
  //
  return (fSystem.GetOrigin());
}

//______________________________________________________________
ostream& operator<< (ostream & os, BrDetectorVolume *volume_p)
{
  //double *m;
  os<<"Volume Name is :" <<   volume_p->GetName()<<"n";
  os<<" Position      :" <<   volume_p->GetPosition() << "n";
  os<<" RotMatrix     :n" << volume_p->GetRotMatrix() << "n";
  os << endl;
  return os;
}

//______________________________________________________________
ostream& operator<< (ostream & os, BrDetectorVolume &volume_p)
{
  os<<&volume_p;
  return os;
}
//______________________________________________________________
BrPlane3D 
BrDetectorVolume::GetFrontPlane() {
  //
  // Get the Front Plane of the detector in the Master Coordinate system
  //
  BrVector3D La( fSize[0]/2.,          0, -fSize[2]/2);
  BrVector3D Lb(-fSize[0]/2.,          0, -fSize[2]/2);
  BrVector3D Lc(          0., fSize[1]/2, -fSize[2]/2);
  BrVector3D Ga = fSystem.TransformToMaster(La);
  BrVector3D Gb = fSystem.TransformToMaster(Lb);
  BrVector3D Gc = fSystem.TransformToMaster(Lc);
  BrPlane3D plane(Ga, Gb, Gc);
  return plane;
}

//______________________________________________________________
BrPlane3D 
BrDetectorVolume::GetBackPlane() {
  //
  // Return Back in Master Coordinate system.
  //
  BrVector3D La( fSize[0]/2.,          0, fSize[2]/2);
  BrVector3D Lb(-fSize[0]/2.,          0, fSize[2]/2);
  BrVector3D Lc(          0., fSize[1]/2, fSize[2]/2);
  BrVector3D Ga = fSystem.TransformToMaster(La);
  BrVector3D Gb = fSystem.TransformToMaster(Lb);
  BrVector3D Gc = fSystem.TransformToMaster(Lc);
  BrPlane3D plane(Ga, Gb, Gc);
  return plane;
}

//______________________________________________________________
BrPlane3D 
BrDetectorVolume::GetMidPlane() {
  //
  // Return MidPlane  in Master Coordinate system.
  //
  BrVector3D La( fSize[0]/2.,          0, 0);
  BrVector3D Lb(-fSize[0]/2.,          0, 0);
  BrVector3D Lc(          0., fSize[1]/2, 0);
  BrVector3D Ga = fSystem.TransformToMaster(La);
  BrVector3D Gb = fSystem.TransformToMaster(Lb);
  BrVector3D Gc = fSystem.TransformToMaster(Lc);
  BrPlane3D plane(Ga, Gb, Gc);
  return plane;
}

//_____________________________________________________________________________
void BrDetectorVolume::Print(Option_t* option) const
{
  // Options:
  //   B         Basic information
  //   D         Detector information
  //
  TString opt(option);
  opt.ToLower();

  // Basic information
  if (opt.Contains("b"))
    cout << "BrDetectorVolume: " << GetName() << " - " << GetTitle()
         << endl;

  // Detector information
  if (opt.Contains("d")) {
    const BrRotMatrix* rotm = fSystem.GetRotMatrix();
    const BrVector3D origin = fSystem.GetOrigin();
    
    printf("Detector Volume  %s, Type : %s n",
	   GetName(),fType);
    printf(" Size:    %4.2f %4.2f %4.2fn",fSize[0],fSize[1],fSize[2]);
    printf(" Position %4.2f %4.2f %4.2fn",origin[0],origin[1],origin[2]);
    cout << *rotm << endl;
    cout << *fSystem.GetInverseRotMatrix() << endl;

  }
}

//_____________________________________________________________________________
void BrDetectorVolume::Update() {
  //Update the geometry parameters to those of the run currently selected.
  //Do it only if a new run is being selected.  Not necessary to do it
  //if this is being called for the same run as it was the last time through.

  const BrRunInfo *run = fRunManager->GetCurrentRun();
  Int_t runno = run->GetRunNo();

  if(runno == fCurrentRunNo) return;
  fCurrentRunNo = runno;

  //Check that we're connected to geometry db
  if (!fGeometryDb->IsConnected()) {
     //Try to connect to the geometry database
     if (!fGeometryDb->Connect()) {
        Warning("BuildDetectorVolume","couldn't connect to geometry database");
        return;
        }
     }

  Bool_t stat = FillVolume();
  if(!stat) Error("Update","Volume fill failed");

  //Close connection to geometry db
  fGeometryDb->Close();
}

Bool_t BrDetectorVolume::FillVolume() {
  //Fill the detector volume from entries in MySQL database.
  //By convention, we store the volume parameters in the DB in coordinates
  //of the volume (platform) they are sitting on.  In addition, the
  //name of the parent volume (platform volume is placed on) is specified.
  //To fill the BrDetectorVolume with global values, we start with
  //the volume name, continue to get other volumes out specified by parent
  //volume name until we reach the CAVE volume.  This is recognized
  //by having a parent volume with a length of 0.  After each volume is
  //extracted from the DB, the coordinates are translated into the master
  //system of the parent volume and the rotation matrix is convoluted with
  //the existing rotation matrix.
  //Once this is done, the parameters are used to fill vol
  //
  //Return status:
  //kTRUE if volume found and successfully filled
  //kFALSE if volume not found or not successfully filled

  const BrRunInfo *run = fRunManager->GetCurrentRun();

  BrDbVolumePlatformMap *map;
  map = fGeometryDb->GetVolumePlatformMapByName(GetName());

  Bool_t isFFS = kFALSE;
  Bool_t isBFS = kFALSE;
  Bool_t isMRS = kFALSE;
  Int_t platformType = map->GetPlatformType();
  Float_t specAng;
  if(platformType == BrDbVolumePlatformMap::kFFS) {
     isFFS = kTRUE;
     specAng = run->GetFFSAngle();
     }
  else if(platformType == BrDbVolumePlatformMap::kBFS) {
     isBFS = kTRUE;
     specAng = run->GetBFSAngle();
     }
  else if(platformType == BrDbVolumePlatformMap::kMRS) {
     isMRS = kTRUE;
     specAng = run->GetMRSAngle();
     }
  else {
     Error("FillVolume","Platform type for %s not valid, it is %dn",GetName(),platformType);
     }

  if(specAng == 0.0) {
     Warning("FillVolume","Run %d did not have an angle registered; Please enter appropriate angle into run DB",run->GetRunNo());
     return kFALSE;
     }

  BrDbDetectorVolume *dbVol;
  dbVol = GetDetectorVolumeWithCondition(GetName(),specAng,platformType);
  if(!dbVol) {
     Warning("FillVolume","Specified volume %s does not exist in GeometryDB",GetName());
     return kFALSE;
     }

  BrVector3D masterPosition(dbVol->GetPosX(),dbVol->GetPosY(),dbVol->GetPosZ());
  BrRotMatrix masterRotm(dbVol->GetTheta(),dbVol->GetPhi(),dbVol->GetPsi());

  const Char_t *parentName = dbVol->GetParentName();
  Int_t parentLen = strlen(parentName);

  while(strcmp(parentName,"CAVE")) { //stop when we find a parent = cave
     BrDbDetectorVolume *parent;
     Double_t xp,yp,zp;
     Double_t theta,phi,psi;
     parent = GetDetectorVolumeWithCondition(parentName,specAng,platformType);
     xp    = parent->GetPosX();
     yp    = parent->GetPosY();
     zp    = parent->GetPosZ();
     theta = parent->GetTheta();
     phi   = parent->GetPhi();
     psi   = parent->GetPsi();
     //printf("Got theta for parent %s = %fn",parent->GetName(),theta);
     //Coordinate system of parent volume
     BrVector3D parentPosition(xp,yp,zp);
     BrRotMatrix parentRotm(theta,phi,psi);
     BrCoordinateSystem parentSystem(parentPosition,parentRotm);

     //Transform daughter into parent system.
     //masterPosition = parentSystem.TransformToMaster(localPosition);
     masterPosition = parentSystem.TransformToMaster(masterPosition);
     masterRotm = parentRotm * masterRotm;

     //Now, get next parent
     parentName = parent->GetParentName();
     parentLen = strlen(parentName);
     }

  Float_t sizeX = dbVol->GetSizeX();
  Float_t sizeY = dbVol->GetSizeY();
  Float_t sizeZ = dbVol->GetSizeZ();
  SetVolumeParameters(sizeX,sizeY,sizeZ,masterPosition,masterRotm);

  return kTRUE;
}

BrDbDetectorVolume *BrDetectorVolume::GetDetectorVolumeWithCondition(const Char_t *name,Float_t specAngle,Int_t platformType) {
  //Get detector volumes out of the DB with name like one specified and 
  //valid time less than run time. Then search through and find
  //the one valid at the latest time which is earlier than the current run.
  //We do that by looking for the smallest difference between the start of
  //validity and the run time.

  Bool_t readAscii = kFALSE;
  TIter nextAsciiVol(fAsciiVolumeList);

  BrAsciiVolumeMap *asciiVol;
  while((asciiVol = (BrAsciiVolumeMap*)nextAsciiVol())) {
     if(asciiVol->IsVolume(name)) {
        printf("Doing ASCII read of volume %sn",name);
        return (new BrDbDetectorVolume(asciiVol->GetFilename().Data()));
        }
     }

  const BrRunInfo *run = fRunManager->GetCurrentRun();

  Int_t ispecAngle = (Int_t)(specAngle * 100.); //angle we sort on in DB.

  Int_t runTime = run->GetUnixStartTime();
  Char_t condition[160];

  sprintf(condition,"validStart <= %d AND DetName like '%s' AND spectrometerAngle = %d AND platformType = %d",runTime,name,ispecAngle,platformType);

  if(!strcmp(name,"CAVE")) {
     sprintf(condition,"validStart <= %d AND DetName like '%s'",runTime,name);
     }

  TObjArray *arr = fGeometryDb->GetXDetectorVolume(condition);
  if(!arr) {
      Warning("GetDetectorVolumeWithCondition","No entries found");
     return 0;
     }
  //printf("specAngle = %f, condition = %sn",specAngle,condition);
  if(arr->GetEntries() == 0) {
      Warning("GetDetectorVolumeWithCondition","Found 0 entries for %s that started before run %d",name,run->GetRunNo());
     }

  BrDbDetectorVolume *retVol = 0;
  Int_t diff;
  UInt_t big = 1<<31;
  Int_t minDiff = big - 1;  //time difference should not be larger than that!!!
  Int_t maxRevision = 0;
  TIter next(arr);
  BrDbDetectorVolume *volTmp;
  while((volTmp = (BrDbDetectorVolume*)next())) {
     diff = runTime - volTmp->GetValidStart();
     if(diff < 0) {
        //Be safe; should never come here because of condition specified above
        printf("diff < 0!!!; something is wrong; check it outn");
        }

     //This algorithm picks the latest startValid which is earlier than the
     //run under consideration.  If two such are found, pick the highest
     //revision.  Extra coding has to be added to give possibility of
     //picking an earlier revision if desired.  For the moment that is
     //not possible.  Note also that we use run boundaries.  If an
     //improvement to the geometry was made e.g. one run after an earlier 
     //revision, then the revision of the later goes back to 1.
     Int_t revision = volTmp->GetRevisionId();
     if(diff < minDiff) {
        minDiff = diff;
	retVol = volTmp;
        maxRevision = revision;
        }
     else if(diff == minDiff) {
        //Case if we have more than one that started at same time.
        //Pick one with largest revision
        if(maxRevision < revision) {
           retVol = volTmp;
           maxRevision = revision;
           }
        }
     }
  if (fVerbose > 5)
    printf("Picking revision %d for volume %sn",maxRevision,name);
  //Need to create new one copied from old one since old one will be deleted
  //when we delete arr.
  if(retVol) retVol = new BrDbDetectorVolume(*retVol);
  else {
      Warning("GetDetectorVolumeWithCondition","Found no entries for %s that started before run %d",name,run->GetRunNo());
     }
  delete arr;

  return retVol;
}


//////////////////////////////////////////////////////////////////////////////
//
//	$Log: BrDetectorVolume.cxx,v $
//	Revision 1.12  2002/08/06 19:03:43  hagel
//	Add extra print diagnostic
//	
//	Revision 1.11  2002/04/16 14:44:12  hagel
//	Implement Hall Probe reading from Db in ySQL mode.  Major surgery on BrGeometryDbManager concerning building BrDetectorVolume and BrMagnetVolume
//	
//	Revision 1.10  2002/04/02 19:40:44  videbaek
//	Added method GetMidPlane
//	
//	Revision 1.9  2002/02/26 08:57:47  cholm
//	Added const'ness to many methods - needed by ISO C++
//	
//	Revision 1.8  2002/02/22 21:49:15  videbaek
//	Add Print method, and give warning for ListParameters as becoming obsolete.
//	
//	Revision 1.7  2002/02/08 22:55:48  hagel
//	Take advantage of new features of BrRotMatrix
//	
//	Revision 1.6  2001/11/05 23:41:42  hagel
//	Changes to MySQL mode for Geometry DB manager
//	
//	Revision 1.5  2001/10/09 16:26:47  videbaek
//	The Addverticalrotation did not realy work for all setting of primary
//	theta, and phi values. Removed calls to this and replaced by
//	creating local rotation matrix followed by multiplictaion.
//	This was checked for volumes with both ang > and < 0 as well as pos and
//	negative beta.
//	
//	Revision 1.4  2001/09/24 00:12:12  videbaek
//	Added a change for the AddVerticalRotation that checks transformations for
//	volumes with phi > 90. In fact with the brat 2.1.0 version it did indeed
//	fail.
//	
//	Revision 1.3  2001/09/22 16:18:18  videbaek
//	Commit changes to BrDetectorVolume and BrMagnetVolume that
//	Pawel has made. Check out with test programs as well as reconstruction so declared ok.
//	
//	Revision 1.2  2001/09/08 18:53:19  videbaek
//	initialize verbosity
//	
//	Revision 1.1.1.1  2001/06/21 14:55:18  hagel
//	Initial revision of brat2
//	
//	Revision 1.25  2001/05/07 21:17:08  hagel
//	Changes to implement MySQL Db stuff
//	
//	Revision 1.24  2001/03/07 17:36:46  hagel
//	Changes to use with new MySQL DB access
//	
//	Revision 1.23  2000/12/07 22:12:52  videbaek
//	Added current setting capabilities
//	
//	Revision 1.22  2000/11/23 01:30:36  brahmlib
//	Changed name/title types to const Char_t* instead of Char_t* in CTOR.
//	
//	Revision 1.21  2000/11/22 21:04:48  videbaek
//	BrMagnetVolume is now derived from BrDetectorVolume. Modified and uniform methods
//	now.
//	
//	Revision 1.20  2000/11/17 15:33:10  videbaek
//	Belated checkin
//	
//	Revision 1.19  2000/10/24 21:10:20  videbaek
//	Removed from code the changes that has been omitted by pre-processor flags for
//	a long time.
//	
//	Revision 1.18  2000/09/22 08:47:06  trine
//	Corrected small bug in LocalToGlobal(Float_t*, Float_t*, Int_t) and
//	GlobalToLocal(Float_t* ,Float_t*, Int_t)
//	
//	Revision 1.17  2000/09/18 21:27:19  videbaek
//	Changed neede for Internal modifications to
//	BrDetectorVolume. removed GetAngle from BaseDetector.
//	
//	Revision 1.16  2000/06/07 19:44:39  videbaek
//	Add name of file in case of error.
//	Moved CVS log info to end of file.
//	
//	Revision 1.15  2000/05/24 13:54:15  cholm
//	Cosmetical changes.
//	
//	Revision 1.14  2000/05/23 21:13:12  jhlee
//	Add GetFrontPlane and GetBackPlane
//	
//	Revision 1.13  2000/05/05 21:21:20  videbaek
//	remove long comment
//	
//	Revision 1.12  2000/04/06 20:17:48  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.
//	
//	Revision 1.11  1999/03/07 00:00:42  hagel
//	1. Implemented  BrFSTrackingModule.  Started with BrMRSTrackingModule and made
//	
//	Revision 1.10  1998/12/21 20:18:32  videbaek
//	Added magnet voluems. Additional features for Modules.
//	New BrMatch intended to replace TSonataMath. Some changes in
//	matrix routines.
//
//	Revision 1.9  1998/12/16 23:51:41  hagel
//	Add constructor and ReadASCIIFile methods without fspec and mids since that
//	is not needed anymore.  Keep other ones for time being for compatibility with
//	code that already exists.
//
//	Revision 1.8  1998/12/04 21:33:28  videbaek
//	Modification for better geometry contnued. Nor complete yet
//	Fix type SHLIB->$(SHLIB) .. in makefile
//
//	Revision 1.7  1998/12/01 21:20:33  videbaek
//	Added refs in Detector volume to deal with BrVector3D
//	rather than only float* references.
//
//	Revision 1.6  1998/10/05 21:01:09  videbaek
//	Initialize fCut
//
//	Revision 1.5  1998/09/27 16:55:43  alv
//	make first argument of LocalToGlobal and GlobalToLocal const.
//
//	Revision 1.4  1998/07/03 16:07:22  hagel
//	Clean up g++ warnings
//
//	Revision 1.3  1998/06/20 23:20:39  hagel
//	Add basic ostream support to BrDetectorVolume
//
//	Revision 1.2  1998/04/29 02:15:36  hagel
//	Added GlobalToLocal and LocalToGlobal
//
//	Revision 1.1.1.1  1998/03/04 21:32:48  brahmlib
//	Brat base
//
////////////////////////////////////////////////////////////////////////////////////////

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