BRAT 2.4.5
Class index
Full class index
brahmlib
BRAHMS
ROOT page
//
//
//    BrBbRdo
//                                                                  
// BRAHMS Reconstructed Data Element for Beam-Beam counters.  This is
// a single DataObject containing Reconstructed Data Object
// information from the beam beam counters. It is derived from the
// BrDataObject class and can thus be added directly to an eventnode.
//
// See BrRdoModuleBB for creation of these elements.
//
// Modifications:
//   April 8, 1999 Added routine to check left and right hits.
//                IsLeftTubeHit(i) IsRightTubeHit 
//

// 
// $Id: BrBbRdo.cxx,v 1.3 2001/10/19 15:26:02 ouerdane Exp $
// $Author: ouerdane $
// $Date: 2001/10/19 15:26:02 $
//
#include "BrBbRdo.h"
#ifndef __IOSTREAM__
#include <iostream>
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif


//__________________________________________________________
ClassImp(BrBbRdo);

//__________________________________________________________
 BrBbRdo::BrBbRdo(){
  // default constructor
  //
  Clear();
}
//__________________________________________________________
 BrBbRdo::BrBbRdo(Char_t* Name, Char_t* Title)
  : BrDataObject(Name, Title)
{
  // default named constructor
  //
  Clear();
}

//__________________________________________________________
 void BrBbRdo::Clear(){
  //Zero all elements

  fLeftHits  = 0;
  fRightHits = 0;
  fLeftMult  = 0;
  fRightMult = 0;
  fLeftTime=0.0;
  fRightTime=0.0;
  fZ0   = -999.;
  fTime0= -999.;
  fTimeMethod = 0;
  for(int i=0;i<4;i++)
    {
      fPatternLeft[i]=0;
      fPatternRight[i]=0;
    }
}
//__________________________________________________________
 void BrBbRdo::SetLeftHitTube(Int_t tubeno){
  // Mark tube as Hit in left array
  //
  if(tubeno < 1 && tubeno> 64){
    this->TObject::Warning("SetLeftHitTube","Tube no out of range");
    return;
  }
  int word = (tubeno-1)/ 32;
  int bit  = (tubeno-1)%32;
  fPatternLeft[word] = fPatternLeft[word] & (1<<bit);
  return;

}

//__________________________________________________________
 Bool_t BrBbRdo::IsLeftTubeHit(Int_t tubeno){
 if(tubeno < 1 && tubeno> 64){
    this->TObject::Warning("IsLeftTubeHit","Tube no out of range");
    return kFALSE;
  }
  int word = (tubeno-1)/ 32;
  int bit  = (tubeno-1)%32;
  return ( 0!= (fPatternLeft[word] & (1<<bit)));

}

//__________________________________________________________
 void BrBbRdo::SetRightHitTube(Int_t tubeno){
  // Mark tube as Hit in left array
  //
  if(tubeno < 1 && tubeno> 64){
    Warning("SetLeftHitTube","Tube no out of range");
    return;
  }
  int word = (tubeno-1)/ 32;
  int bit  = (tubeno-1)%32;
  fPatternLeft[word] = fPatternLeft[word] & (1<<bit);
  return;

}

//__________________________________________________________
 Bool_t BrBbRdo::IsRightTubeHit(Int_t tubeno){
  // Check if a given tube in right array is hit.
  //
 if(tubeno < 1 && tubeno> 64){
    this->TObject::Warning("SetRightHitTube","Tube no out of range");
    return kFALSE;
  }
  int word = (tubeno-1)/ 32;
  int bit  = (tubeno-1)%32;
  return (0 != (fPatternRight[word] & (1<<bit)));

}

//__________________________________________________________
 void BrBbRdo::Print(Option_t* option) const 
{
  // Print the data contained
  // Options:
  //    F         Full array numbers (default)
  //    B         Left and right numbers 
  TString opt(option); 
  opt.ToLower(); 

  cout << "BrBbRdo: " << GetName() << "(" << GetTitle() << ")" 
       << endl; 
  
  if (opt.Contains("f")) {
    cout << " Both arrays: " << endl
	 << "  Primary vertex z: " << fZ0 << endl
	 << "  Primary vertex t: " << fTime0 << endl
	 << "  Multiplicity:     " << fMult << endl
	 << "  Timing method:    " << flush;
    switch (fTimeMethod) {
    case kTimeFromBigBB:   cout << "Big tubes" << endl; break;
    case kTimeFromSmallBB: cout << "Small tubes" << endl; break;
    case kTimeFromFastBB:  cout << "Fastest tubes" << endl; break;
    default:               cout << "unknown" << endl; break;
    }
  }
  
  if (opt.Contains("b")) {
    for (Int_t i = 0; i < 2; i++) {
      cout << " " << (i == 0 ? "Left" : "Right") << " array: " << endl
	   << "  Hits:             " 
	   << (i == 0 ? fLeftHits : fRightHits) << endl 
	   << "  Multiplicity:     " 
	   << (i == 0 ? fLeftMult : fRightMult) << endl
	   << "  Time:             " 
	   << (i == 0 ? fLeftTime : fRightTime) << endl
	   << "  Pattern:          " 
	   << flush;
      for (Int_t j = 0; j < 4; j++) 
	cout << (i == 0 ? fPatternLeft : fPatternRight)[i] << " " << flush;
      cout << endl;
    }
  }
}


//  $Log: BrBbRdo.cxx,v $
//  Revision 1.3  2001/10/19 15:26:02  ouerdane
//  Initialized time method member to 0 in constructor
//
//  Revision 1.2  2001/08/07 12:41:45  cholm
//  Added standard Print method
//
//  Revision 1.1  2001/06/22 17:35:13  cholm
//  Change names so that every data class has the same format so that
//  we have that down from the very beginning, so that we will not have to
//  worry about that later on.  The affected classes are:
//
//
//          BrRdoBB             ->        BrBbRdo
//          BrRdoZDC            ->        BrZdcRdo
//  	BrTPCCluster	    ->	      BrTpcCluster
//  	BrTPCClusterTable   ->	      BrTpcClusterTable
//
//  Revision 1.1.1.1  2001/06/21 14:55:02  hagel
//  Initial revision of brat2
//
//  Revision 1.4  2000/12/19 19:28:37  hagel
//  Added Clear method (to use these conveniently in Tree's)
//
//  Revision 1.3  2000/12/16 01:04:23  videbaek
//  cosmetic changes for Digitizew
//  The BB rdo assigned a vertex valu of 0even if not found properly.
//  Constructor now sets to -999. to avoid confusion.
//
//  Revision 1.2  1999/04/14 20:12:41  videbaek
//  Use DbManager methods to access parameters.
//
//  Revision 1.1  1998/10/09 19:22:24  videbaek
//  Add the BrBbRdo and BrRdoModule classes
//
//

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