///////////////////////////////////////////////////////
//
// File TGSIMClass.cc
//
//
// Initial Author:  Gagik Gavalian   UNH  11/10/1999
//
//  Generation Date : Tue Nov 23 18:21:36 EST 1999
//
//
/*______________________________________________________________________
 Modified:
           Maurik (2/3/00) Comments.
           Maurik (Nov/01) Derive from TVirtualData
This class is used to access the GSIM bank data written into the ROOT DST for the E2 run at Jefferson Lab, when writing DST using WriteRootDST with the GSIM capability turned on (default).

The class has been updated to derive from TVirtualData, so that it can be used interchangably with TEVNTClass.

See the UseGSIM() switch function in the TE2AnaTool class for more details.

______________________________________________________________________*/ 
//
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////

#include <iostream.h>
#include "TGSIMClass.h"

ClassImp(TGSIMClass)

 TGSIMClass::TGSIMClass(TGSIMClass *TmpEVNT){
Id   =   TmpEVNT->Id;
Charge   =   TmpEVNT->Charge;
Betta   =   TmpEVNT->Betta;
Px   =   TmpEVNT->Px;
Py   =   TmpEVNT->Py;
Pz   =   TmpEVNT->Pz;
X   =   TmpEVNT->X;
Y   =   TmpEVNT->Y;
Z   =   TmpEVNT->Z;
Dcstat   =   TmpEVNT->Dcstat;
Ccstat   =   TmpEVNT->Ccstat;
Scstat   =   TmpEVNT->Scstat;
Ecstat   =   TmpEVNT->Ecstat;
Lcstat   =   TmpEVNT->Lcstat;
Status   =   TmpEVNT->Status;
}

 void   TGSIMClass::Print(){
  cout << "TGSIMClass::" << endl;
  cout << "ID      " <<  Id  << " (= " << GetId() <<" )" << endl;
  cout << "Charge  " << (Int_t)GetCharge()  << endl;
  cout << "Betta   " << GetBeta()  << endl;
  cout << "Px      " << GetPx()  << endl;
  cout << "Py      " << GetPy()  << endl;
  cout << "Pz      " << GetPz()  << endl;
  cout << "X       " << GetX()  << endl;
  cout << "Y       " << GetY()  << endl;
  cout << "Z       " << GetZ()  << endl;
  cout << "DCstat  " << GetDCStat()  << endl;
  cout << "CCstat  " << GetCCStat()  << endl;
  cout << "SCstat  " << GetSCStat()  << endl;
  cout << "ECstat  " << GetECStat()  << endl;
  cout << "LCstat  " << GetLCStat()  << endl;
  cout << "Status  " << GetStat()  << endl;
  cout << "GSIM ?  " << IsGSIM() << endl;
}

 Int_t TGSIMClass::GetId(){
  //
  // Changes the GEANT Id in the bank to a PDG id and returns that.
  // This way it is compatible with TEVNTClass
  // This routine is identical to TGsim::PDG_to_Geant()
  // Unfortunately we can not be certain that routine is accessible,
  // hence the duplication.

  if(Id<0)return(0);
  
  if(Id < kG_NParticleTypes)return(TGSIMClass__fgGeant_Particle_Id[Id]);
  else return(0);

}

 Float_t TGSIMClass::GetBeta(){
  //
  // Fix the Beta which may not have been filled in properly.
  //

  if(Betta<=0){
    return(Betta);
    
  }else{
    return(Betta);
  }
}

 Char_t TGSIMClass::GetCharge(){
  //
  // Fix Charge, which may not be properly set.
  //
  if(Id == 3 || Id == 9 || Id == 6 || Id == 12)return(-1); 
  if(Id == 1 || Id == 7 || Id == 13 )return(0);
  else return(1);
}


////////////////////////////////////////////////////////////////
//
//  End of File  TGSIMClass.cc
////////////////////////////////////////////////////////////////


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.