TofROOTGeo Class Reference

#include <TofROOTGeo.h>

Inheritance diagram for TofROOTGeo:

SubDetectorROOTGeo SubDetectorROOTGeo List of all members.

Public Member Functions

 TofROOTGeo ()
 Constructor.
 ~TofROOTGeo ()
 Destructor.
void InitFromGdml (const char *gdmlFile, const char *setupName)
 Initialize the instance of ROOTGeo.
void SetNode ()
 Set the pointers to theirs nodes;.
void SetDefaultVis ()
 Set default visual attributes;.
void SetAllVisible ()
 Set all visible;.
void SetQuarterVisible ()
 Set quater visible;.
void SetPhysicalNode ()
 Set the pointers to the physical nodes;.
int GetPartNb ()
 Get number of part;.
int GetScinNb (int part)
 Get number of scintillators on each part;.
TGeoVolume * GetVolumeTof ()
 Get Tof volume;.
TGeoVolumeAssembly * GetVolumeAssembly (int part)
 Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;.
TGeoVolume * GetVolumeScin (int part)
 Get scintillator volume;.
TGeoVolume * GetVolumeBucket (int part)
 Get bucket volume;.
TGeoNode * GetScin (int part, int scin)
 Get scintillator node;.
TGeoNode * GetBucket (int part, int scin, int bucket)
 Get bucket node, 0 for west bucket, 1 for the east one;.
TGeoPhysicalNode * GetPhysicalScin (int part, int scin)
 Get scintillator physical node;.
 TofROOTGeo ()
 Constructor.
 ~TofROOTGeo ()
 Destructor.
void InitFromGDML (const char *gdmlFile, const char *setupName)
 Initialize ROOTGeo from GDML.
void InitFromROOT (TGeoVolume *vol)
 Initialize ROOTGeo from TGeoVolume logicalTof.
void Init2DGeometry ()
 Initialize 2D Geometry.
void SetNode ()
 Set the pointers to theirs nodes;.
void SetVolumeDefaultVis ()
 Set default visual attributes;.
void SetAllVisible ()
 Set all visible;.
void SetTMatch (Bool_t input)
void SetQMatch (Bool_t input)
void SetQuarterVisible ()
 Set quater visible;.
void SetHalfVisible ()
 Set half visible;.
void SetNoEndVisible ()
 Set noend visible;.
void SetPhysicalNode ()
 Set the pointers to the physical nodes;.
void SetDetector ()
 Draw Detecor (what is detector depends on you).
void SetHits ()
 Set all physicalNodes corresponding to digiCol;.
void SetVisTofDetector ()
 Set Tof detector visibility;.
void SetVisTofHits ()
 Set Tof hits visibility;.
int GetPartNb ()
 Get number of part;.
int GetScinNb (int part)
 Get number of scintillators on each part;.
int GetLayerNb (int part)
void SetVolumeTof (TGeoVolume *vol)
 Set Tof volume, while initializing from ROOT;.
TGeoVolume * GetVolumeTof ()
 Get Tof volume;.
TGeoVolume * GetVolumePart (int part)
 Get part volume;.
TGeoVolume * GetVolumePVF (int part, int layer)
 Get PVF volume;.
TGeoVolume * GetVolumeAl (int part, int layer)
 Get Al volume;.
TGeoVolume * GetVolumeScin (int part, int layer)
 Get scintillator volume;.
TGeoVolume * GetVolumeBucket (int part, int layer)
 Get bucket volume;.
TGeoNode * GetPVF (int part, int layer, int scin)
 Get PVF node;.
TGeoNode * GetAl (int part, int layer)
 Get Al node;.
TGeoNode * GetScin (int part, int layer)
 Get scintillator node;.
TGeoPhysicalNode * GetPhysicalScin (int part, int layer, int scin)
 Get scintillator physical node;.
Tof2DScinGet2DScin (Int_t part, Int_t layer, Int_t scin)
 Get Tof2DScin;.
Int_t GetPart (TGeoPhysicalNode *phyNode)
 Get part no of a scintillator physcial node.
void Draw (Option_t *option)
 Draw function.
void DrawHits (Option_t *option)
 Draw 2D hits.
void ReadGdml (const char *gdmlFile, const char *setupName)
 Initialize the instance of ROOTGeo.
virtual void ReadGdml (const char *gdmlFile, const char *setupName)
 Initialize the instance of ROOTGeo.
int IsInitialized ()
 If the ROOT geometry of this subdetctor is initialized;.
virtual int IsInitialized ()
 If the ROOT geometry of this subdetctor is initialized;.
void SetChildNo (int childNo)
virtual void SetChildNo (int childNo)
TGeoVolume * GetLogicalVolume (const std::string &vn)
 Get a logical volume by name;.
virtual TGeoVolume * GetLogicalVolume (const std::string &vn)
 Get a logical volume by name;.
TGeoVolume * GetTopVolume ()
 Get the top(world) volume;.
virtual TGeoVolume * GetTopVolume ()
 Get the top(world) volume;.
TGeoVolumeAssembly * GetAssemblyVolume (const std::string &an)
 Get an assembly by name;.
virtual TGeoVolumeAssembly * GetAssemblyVolume (const std::string &an)
 Get an assembly by name;.
TGeoNode * GetNode (const std::string &nn)
 Get a node(physical volume) by name;.
virtual TGeoNode * GetNode (const std::string &nn)
 Get a node(physical volume) by name;.
virtual int GetHitsNum ()
 Get number of hits in HitsArray;.
virtual TGeoPhysicalNode * GetHit (int i)
 Get ith hit in HitsArray;.
virtual void SetDetectorOn ()
 Set all physicalNodes in m_DeteorsArray visible;.

Protected Attributes

int m_ROOTGeoInit
int m_childNo
TGeoVolume * m_TopVolume
TGeoVolume * m_TopVolume
int m_2DGeoInit
TObjArray * m_DetectorsArray
TObjArray * m_HitsArray
TObjArray * m_2DHitsArray

Private Attributes

TGeoVolume * m_Tof
TGeoNode * m_NodeScin [m_kPart][m_kAssemblyBr]
TGeoPhysicalNode * m_PhysicalScin [m_kPart][m_kAssemblyBr]
Bool_t k_TMatch
Bool_t k_QMatch
int m_TofColor
int m_BucketColor
int m_ScinColor
TGeoVolume * m_Tof
TGeoNode * m_NodePVF [m_kPart][m_kLayerBr][m_kScinBr]
TGeoNode * m_NodeAl [m_kPart][m_kLayerBr]
TGeoNode * m_NodeScin [m_kPart][m_kLayerBr]
TGeoPhysicalNode * m_PhysicalScin [m_kPart][m_kLayerBr][m_kScinBr]
const TObjArray * m_TofDigiCol
Tof2DScinm_Tof2DScin [m_kPart][m_kLayerBr][m_kScinBr]

Static Private Attributes

static const int m_kPart = 3
static const int m_kAssemblyEc = 48
static const int m_kAssemblyBr = 88
static const int m_kBucketEc = 1
static const int m_kBucketBr = 2
static const int m_kLayerBr = 2
static const int m_kLayerEc = 1
static const int m_kScinBr = 88
static const int m_kScinEc = 48
static const int TOF_TIME_FACTOR = 1000000
static const int TOF_CHARGE_FACTOR = 1000000

Detailed Description

Class TofGeo contains all of the objects necessary to describe the tof geometry.

Author:
Zhengyun You {mailto:youzy@hep.pku.cn}

Definition at line 27 of file TofROOTGeo.h.


Constructor & Destructor Documentation

TofROOTGeo::TofROOTGeo (  ) 

Constructor.

Definition at line 24 of file TofROOTGeo.cxx.

References m_kAssemblyBr, m_kPart, m_NodeScin, and m_PhysicalScin.

00025 { 
00026   // Default constructor.
00027   for (int part = 0; part < m_kPart; part++) {
00028     for (int scin = 0; scin < m_kAssemblyBr; scin++) {
00029       m_NodeScin[part][scin] = 0;
00030       m_PhysicalScin[part][scin] = 0;
00031     }
00032   }
00033 }

TofROOTGeo::~TofROOTGeo (  ) 

Destructor.

Definition at line 35 of file TofROOTGeo.cxx.

00036 { }

TofROOTGeo::TofROOTGeo (  ) 

Constructor.

TofROOTGeo::~TofROOTGeo (  ) 

Destructor.


Member Function Documentation

void TofROOTGeo::Draw ( Option_t *  option  ) 

Draw function.

Definition at line 788 of file TofROOTGeo.cxx.

References Tof2DScin::Draw(), GetLayerNb(), GetScinNb(), BesView::GetVisTofBarrel(), BesView::GetVisTofEast(), BesView::GetVisTofGlobal(), BesView::GetVisTofWest(), SubDetectorROOTGeo::m_2DGeoInit, m_Tof2DScin, and Tof2DScin::SetFired().

Referenced by BesGeometry::Draw2DXY(), and BesGeometry::Draw2DZR().

00789 {
00790   TString opt = option;
00791   opt.ToUpper();
00792 
00793   if (!m_2DGeoInit) cout << "TofROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
00794   BesView *view = (BesView*)gPad->GetView();
00795   if (!view) cout << "TofROOTGeo::Draw(), BesView not found" << endl;
00796 
00797   if (view->GetVisTofGlobal()) { // TofVisGlobal
00798     TString scinOpt;
00799 
00800     //if (opt.Contains("XY")) {
00801     // west part drawn first usually
00802     for (Int_t part = m_kPart-1; part >= 0; part--) {
00803       for (Int_t layer = 0; layer < GetLayerNb(part); layer++) {
00804         for (int scin = 0; scin < GetScinNb(part); scin++) {
00805 
00806           if (m_Tof2DScin[part][layer][scin]) {
00807             //cout << "part " << part << " layer " << layer << " scin " << scin << endl;
00808             //m_Tof2DScin[part][layer][scin]->SetHighlighted(false);
00809             m_Tof2DScin[part][layer][scin]->SetFired(false);
00810             if ( (part == 0 && view->GetVisTofEast())   ||
00811                 (part == 1 && view->GetVisTofBarrel()) ||
00812                 (part == 2 && view->GetVisTofWest()) )
00813               m_Tof2DScin[part][layer][scin]->Draw(scinOpt);
00814           }
00815         }
00816       }
00817     }
00818   }
00819   }

void TofROOTGeo::DrawHits ( Option_t *  option  ) 

Draw 2D hits.

Definition at line 822 of file TofROOTGeo.cxx.

References TofID::barrel_ec(), GetLayerNb(), GetScinNb(), BesView::GetVisTofHitsBarrel(), BesView::GetVisTofHitsEast(), BesView::GetVisTofHitsGlobal(), BesView::GetVisTofHitsWest(), genRecEmupikp::i, k_QMatch, k_TMatch, TofID::layer(), m_Tof2DScin, m_TofDigiCol, TofID::phi_module(), Tof2DScin::ResetTimeCharge(), Tof2DScin::SetCharge(), and TOF_CHARGE_FACTOR.

Referenced by BesEvent::DrawHits().

00823     {
00824       // cout << "Draw Hits" << endl;
00825       BesView *view = (BesView*)gPad->GetView();
00826       if (!view) cout << "TofROOTGeo::DrawHits(), BesView not found" << endl;
00827 
00828       //cout << "VisTofHitsGlobal " << view->GetVisTofHitsGlobal() << endl;
00829       //cout << "VisTofHitsEast   " << view->GetVisTofHitsEast()   << endl;
00830       //cout << "VisTofHitsBarrel " << view->GetVisTofHitsBarrel() << endl;
00831       //cout << "VisTofHitsWest   " << view->GetVisTofHitsWest()   << endl;
00832 
00833       if (view->GetVisTofHitsGlobal()) {
00834 
00835         // reset time and charge to zero
00836         for (Int_t part = m_kPart-1; part >= 0; part--) {
00837           for (Int_t layer = 0; layer < GetLayerNb(part); layer++) {
00838             for (int scin = 0; scin < GetScinNb(part); scin++) {
00839               if (m_Tof2DScin[part][layer][scin]) {
00840                 m_Tof2DScin[part][layer][scin]->ResetTimeCharge();
00841               }
00842             }
00843           }
00844         }
00845 
00846         if (m_TofDigiCol) {
00847           for (int i = 0; i < m_TofDigiCol->GetEntries(); i++) {
00848             TTofDigi *aTofDigi = (TTofDigi*)m_TofDigiCol->At(i);
00849 
00850             Identifier aTofID( aTofDigi->getIntId() );
00851             int part   = TofID::barrel_ec( aTofID );
00852             int layer  = TofID::layer( aTofID );
00853             int scin   = TofID::phi_module( aTofID );
00854 
00855             Double_t charge = Double_t(aTofDigi->getChargeChannel()) / TOF_CHARGE_FACTOR;
00856             //cout << "charge " << charge << endl;
00857 
00858             Tof2DScin *aScin = 0;
00859             aScin = m_Tof2DScin[part][layer][scin];
00860             // Mdc TQMatch for example
00861             //
00862             //if (aWire &&
00863             //        ((overflow == 0)||(overflow == 12))){
00864             //    if ((k_TMatch) &&
00865             //            (aMdcDigi->getTimeChannel() == 0x7FFFFFFF)){
00866             //        continue;
00867             //    }
00868             //    if ((k_QMatch) &&
00869             //            (aMdcDigi->getChargeChannel() == 0x7FFFFFFF)){
00870             //        continue;
00871             //    }
00872             //}
00873 
00874             if (aScin) {
00875               if ((k_TMatch)&&
00876                   (aTofDigi->getTimeChannel() == 0x7FFFFFFF)){
00877                 continue;
00878               }
00879               if ((k_QMatch)&&
00880                   (aTofDigi->getChargeChannel() == 0x7FFFFFFF)){
00881                 continue;
00882               }
00883 
00884               aScin->SetCharge(aScin->GetCharge() + charge);
00885 
00886               if ( (part == 0 && view->GetVisTofHitsEast())   ||
00887                   (part == 1 && view->GetVisTofHitsBarrel()) ||
00888                   (part == 2 && view->GetVisTofHitsWest()) ) {
00889                 aScin->SetFired(true);
00890                 aScin->Draw();
00891               }
00892             }
00893           }
00894         }
00895       }
00896     }

Tof2DScin * TofROOTGeo::Get2DScin ( Int_t  part,
Int_t  layer,
Int_t  scin 
)

Get Tof2DScin;.

Definition at line 763 of file TofROOTGeo.cxx.

References m_Tof2DScin.

Referenced by BesEvent::ConstructTofTrackFromRec().

00764 {
00765   if (m_Tof2DScin[part][layer][scin]) return m_Tof2DScin[part][layer][scin];
00766   else return 0;
00767 }

TGeoNode * TofROOTGeo::GetAl ( int  part,
int  layer 
)

Get Al node;.

Definition at line 701 of file TofROOTGeo.cxx.

References m_NodeAl.

00702 {
00703   if (m_NodeAl[part][layer] != 0) {
00704     return m_NodeAl[part][layer];
00705   }
00706   else {
00707     std::cout << "Node: " << "Part" << part << "Layer" << layer << "Al" << " not found" << std::endl;
00708     return 0;
00709   }
00710 
00711   return m_NodeAl[part][layer];
00712 }

virtual TGeoVolumeAssembly* SubDetectorROOTGeo::GetAssemblyVolume ( const std::string an  )  [virtual, inherited]

Get an assembly by name;.

TGeoVolumeAssembly * SubDetectorROOTGeo::GetAssemblyVolume ( const std::string an  )  [inherited]

Get an assembly by name;.

Definition at line 52 of file SubDetectorROOTGeo.cxx.

Referenced by GetVolumeAssembly().

00053 {
00054   TGeoVolumeAssembly *av = (TGeoVolumeAssembly*)TGDMLProcessor::GetInstance()->GetAssemblyVolume(an);
00055   if (!av) std::cout << "Assembly Volume " << an << " not found " << std::endl;
00056   return av;
00057 }

TGeoNode * TofROOTGeo::GetBucket ( int  part,
int  scin,
int  bucket 
)

Get bucket node, 0 for west bucket, 1 for the east one;.

Definition at line 261 of file TofROOTGeo.cxx.

References SubDetectorROOTGeo::GetNode(), m_kAssemblyBr, and m_kAssemblyEc.

Referenced by SetAllVisible(), SetDefaultVis(), and SetQuarterVisible().

00262 {
00263   std::stringstream osname;
00264   if (part == 0) {
00265     osname << "pv_" << "logical" << "Tof" << "BucketEc" << "_" << m_kAssemblyBr + m_kAssemblyEc + scin << "_1"; 
00266   }
00267   else if (part == 1) {
00268     osname << "pv_" << "logical" << "Tof" << "BucketBr" << "_" << scin << "_" << bucket+1; 
00269   }
00270   else if (part == 2) {
00271     osname << "pv_" << "logical" << "Tof" << "BucketEc" << "_" << m_kAssemblyBr + scin << "_1"; 
00272   }
00273   
00274   return GetNode( osname.str() );
00275 }

TGeoPhysicalNode * SubDetectorROOTGeo::GetHit ( int  i  )  [virtual, inherited]

Get ith hit in HitsArray;.

Definition at line 65 of file SubDetectorROOTGeo.cxx.

References SubDetectorROOTGeo::m_HitsArray.

00066 {
00067     if (i < m_HitsArray->GetEntries())
00068         return (TGeoPhysicalNode*)m_HitsArray->At(i);
00069     else
00070         return 0;
00071 }

virtual int SubDetectorROOTGeo::GetHitsNum (  )  [inline, virtual, inherited]

Get number of hits in HitsArray;.

Definition at line 61 of file SubDetectorROOTGeo.h.

References SubDetectorROOTGeo::m_HitsArray.

00061 { return m_HitsArray->GetEntries(); }

int TofROOTGeo::GetLayerNb ( int  part  ) 

Definition at line 568 of file TofROOTGeo.cxx.

References m_kLayerBr, and m_kLayerEc.

Referenced by Draw(), DrawHits(), GetPart(), Init2DGeometry(), SetDetector(), and SetVolumeDefaultVis().

00569 {
00570   int nLayer = m_kLayerBr;
00571   if (part != 1) nLayer = m_kLayerEc;
00572   return nLayer;
00573 }

virtual TGeoVolume* SubDetectorROOTGeo::GetLogicalVolume ( const std::string vn  )  [virtual, inherited]

Get a logical volume by name;.

TGeoVolume * SubDetectorROOTGeo::GetLogicalVolume ( const std::string vn  )  [inherited]

Get a logical volume by name;.

Definition at line 45 of file SubDetectorROOTGeo.cxx.

Referenced by MucROOTGeo::GetVolumeAbsorber(), MucROOTGeo::GetVolumeAbsorberPanel(), MucROOTGeo::GetVolumeAbsorberSmallBlock(), GetVolumeAl(), MucROOTGeo::GetVolumeAluminumBox(), MucROOTGeo::GetVolumeBakelite(), MucROOTGeo::GetVolumeBox(), MucROOTGeo::GetVolumeBoxSurface(), GetVolumeBucket(), EmcROOTGeo::GetVolumeCrystal(), MucROOTGeo::GetVolumeGap(), MucROOTGeo::GetVolumeGasBorder(), MucROOTGeo::GetVolumeGasChamber(), MdcROOTGeo::GetVolumeLayer(), GetVolumePart(), EmcROOTGeo::GetVolumePart(), EmcROOTGeo::GetVolumePhi(), GetVolumePVF(), MdcROOTGeo::GetVolumeReplica(), GetVolumeScin(), MdcROOTGeo::GetVolumeSegment(), MucROOTGeo::GetVolumeStrip(), MucROOTGeo::GetVolumeStripPlane(), EmcROOTGeo::GetVolumeTheta(), MucROOTGeo::SetNode(), EmcROOTGeo::SetNode(), EmcROOTGeo::SetPhysicalNode(), and EmcROOTGeo::SetVolumeAppendInVis().

00046 {
00047   TGeoVolume *lv = (TGeoVolume*)TGDMLProcessor::GetInstance()->GetLogicalVolume(vn);
00048   if (!lv) std::cout << "Logical Volume " << vn << " not found " << std::endl;
00049   return lv;
00050 }

virtual TGeoNode* SubDetectorROOTGeo::GetNode ( const std::string nn  )  [virtual, inherited]

Get a node(physical volume) by name;.

TGeoNode * SubDetectorROOTGeo::GetNode ( const std::string nn  )  [inherited]

Get a node(physical volume) by name;.

Definition at line 59 of file SubDetectorROOTGeo.cxx.

Referenced by GetBucket(), MdcROOTGeo::GetLayer(), EmcROOTGeo::GetPart(), EmcROOTGeo::GetPhi(), MdcROOTGeo::GetSegment(), MucROOTGeo::Init2DGeometry(), SetNode(), MucROOTGeo::SetNode(), and MdcROOTGeo::SetNode().

00060 {
00061   TGeoNode *node = (TGeoNode*)TGDMLProcessor::GetInstance()->GetPhysicalVolume(nn);
00062   if (!node) std::cout << "Physical Volume " << nn << " not found " << std::endl;
00063   return node;
00064 }

Int_t TofROOTGeo::GetPart ( TGeoPhysicalNode *  phyNode  ) 

Get part no of a scintillator physcial node.

Definition at line 770 of file TofROOTGeo.cxx.

References GetLayerNb(), GetPhysicalScin(), and GetScinNb().

Referenced by SetVisTofDetector(), and SetVisTofHits().

00771 {
00772   for (Int_t part = 0; part < m_kPart; part++) {
00773     for (Int_t layer = 0; layer < GetLayerNb(part); layer++) {
00774       for (int scin = 0; scin < GetScinNb(part); scin++) {
00775         if (phyNode == GetPhysicalScin(part, layer, scin)) {
00776           //cout << "GetPart()" << part << endl;
00777           return part;
00778         }
00779       }
00780     }
00781   }
00782 
00783   cout << "TofROOTGeo::GetPart, this scintillator physical node does not exist!" << endl;
00784   return -1;
00785 }

int TofROOTGeo::GetPartNb (  ) 

Get number of part;.

int TofROOTGeo::GetPartNb (  ) 

Get number of part;.

Definition at line 184 of file TofROOTGeo.cxx.

References m_kPart.

00185 {
00186   int nPart = m_kPart;
00187   return nPart;
00188 }

TGeoPhysicalNode * TofROOTGeo::GetPhysicalScin ( int  part,
int  layer,
int  scin 
)

Get scintillator physical node;.

Definition at line 749 of file TofROOTGeo.cxx.

References m_PhysicalScin.

00750 {
00751   if (m_PhysicalScin[part][layer][scin] != 0) {
00752     return m_PhysicalScin[part][layer][scin];
00753   }
00754   else {
00755     std::cout << "PhysicalNode: " << "Part"
00756       << part << "Layer" << layer << "Scin"
00757       << scin << " not found" << std::endl;
00758     return 0;
00759   }
00760 }

TGeoPhysicalNode * TofROOTGeo::GetPhysicalScin ( int  part,
int  scin 
)

Get scintillator physical node;.

Definition at line 278 of file TofROOTGeo.cxx.

References m_PhysicalScin.

Referenced by BesEvent::ConstructTofTrackFromRec(), GetPart(), BesGeometry::GetPhysicalTofScin(), Init2DGeometry(), SetDetector(), SetHits(), and BesVisDisplay::SetTofFiredCell().

00279 {
00280   if (m_PhysicalScin[part][scin] != 0) {
00281     return m_PhysicalScin[part][scin];
00282   }
00283   else {
00284     std::cout << "PhysicalNode: " << "Part" << part << "Scin" << scin << " not found" << std::endl;
00285     return 0;
00286   } 
00287 }

TGeoNode * TofROOTGeo::GetPVF ( int  part,
int  layer,
int  scin 
)

Get PVF node;.

Definition at line 687 of file TofROOTGeo.cxx.

References m_NodePVF.

00688 {
00689   if (m_NodePVF[part][layer][scin] != 0) {
00690     return m_NodePVF[part][layer][scin];
00691   }
00692   else {
00693     std::cout << "Node: " << "Part" << part << "Layer" << layer << "PVF" << scin << " not found" << std::endl;
00694     return 0;
00695   }
00696 
00697   return m_NodePVF[part][layer][scin];
00698 }

TGeoNode* TofROOTGeo::GetScin ( int  part,
int  layer 
)

Get scintillator node;.

TGeoNode * TofROOTGeo::GetScin ( int  part,
int  scin 
)

Get scintillator node;.

Definition at line 247 of file TofROOTGeo.cxx.

References m_NodeScin.

Referenced by SetAllVisible(), SetDefaultVis(), SetPhysicalNode(), and SetQuarterVisible().

00248 {
00249   if (m_NodeScin[part][scin] != 0) {
00250     return m_NodeScin[part][scin];
00251   }
00252   else {
00253     std::cout << "Node: " << "Part" << part << "Scin" << scin << " not found" << std::endl;
00254     return 0;
00255   } 
00256 
00257   return m_NodeScin[part][scin];
00258 }

int TofROOTGeo::GetScinNb ( int  part  ) 

Get number of scintillators on each part;.

int TofROOTGeo::GetScinNb ( int  part  ) 

Get number of scintillators on each part;.

Definition at line 191 of file TofROOTGeo.cxx.

References m_kAssemblyBr, and m_kAssemblyEc.

Referenced by Draw(), DrawHits(), GetPart(), Init2DGeometry(), and SetDetector().

00192 {
00193   int nScin = m_kAssemblyBr;
00194   if (part != 1) nScin = m_kAssemblyEc;
00195   return nScin;
00196 }

virtual TGeoVolume* SubDetectorROOTGeo::GetTopVolume (  )  [inline, virtual, inherited]

Get the top(world) volume;.

Definition at line 52 of file SubDetectorROOTGeo.h.

References SubDetectorROOTGeo::m_TopVolume.

00052 { return m_TopVolume; }

TGeoVolume* SubDetectorROOTGeo::GetTopVolume (  )  [inline, inherited]

Get the top(world) volume;.

Definition at line 51 of file SubDetectorROOTGeo.h.

References SubDetectorROOTGeo::m_TopVolume.

Referenced by MucROOTGeo::Init2DGeometry(), SetNode(), MucROOTGeo::SetNode(), MdcROOTGeo::SetNode(), and EmcROOTGeo::SetNode().

00051 { return m_TopVolume; }

TGeoVolume * TofROOTGeo::GetVolumeAl ( int  part,
int  layer 
)

Get Al volume;.

Definition at line 633 of file TofROOTGeo.cxx.

References SubDetectorROOTGeo::GetLogicalVolume().

Referenced by SetVolumeDefaultVis().

00634 {
00635   std::stringstream osname;
00636   if (part == 0) {
00637     osname << "logical" << "AlEcEast";
00638   }
00639   else if (part == 2){
00640     osname << "logical" << "AlEcWest";
00641   }
00642   else {
00643     if (part == 1) {
00644       osname << "logical" << "AlBr" << layer+1;
00645     }
00646   }
00647 
00648   return GetLogicalVolume( osname.str() );
00649 }

TGeoVolumeAssembly * TofROOTGeo::GetVolumeAssembly ( int  part  ) 

Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;.

Definition at line 199 of file TofROOTGeo.cxx.

References SubDetectorROOTGeo::GetAssemblyVolume().

00200 {
00201   std::stringstream osname;
00202   if (part == 0 || part == 2) {
00203     osname << "logical" << "Tof" << "AssemblyEc";
00204   }
00205   else {
00206     if (part == 1) {
00207       osname << "logical" << "Tof" << "AssemblyBr";
00208     }
00209   }
00210 
00211   return GetAssemblyVolume( osname.str() );
00212 }

TGeoVolume * TofROOTGeo::GetVolumeBucket ( int  part,
int  layer 
)

Get bucket volume;.

Definition at line 671 of file TofROOTGeo.cxx.

References SubDetectorROOTGeo::GetLogicalVolume().

00672 {
00673   std::stringstream osname;
00674   if (part == 0 || part == 2) {
00675     osname << "logical" << "BucketEc";
00676   }
00677   else {
00678     if (part == 1) {
00679       osname << "logical" << "BucketBr" << layer+1;
00680     }
00681   }
00682 
00683   return GetLogicalVolume( osname.str() );
00684 }

TGeoVolume * TofROOTGeo::GetVolumeBucket ( int  part  ) 

Get bucket volume;.

Definition at line 231 of file TofROOTGeo.cxx.

References SubDetectorROOTGeo::GetLogicalVolume().

Referenced by SetAllVisible(), SetDefaultVis(), SetQuarterVisible(), and SetVolumeDefaultVis().

00232 {
00233   std::stringstream osname;
00234   if (part == 0 || part == 2) {
00235     osname << "logical" << "Tof" << "BucketEc";
00236   }
00237   else {
00238     if (part == 1) {
00239       osname << "logical" << "Tof" << "BucketBr";
00240     }
00241   }
00242   
00243   return GetLogicalVolume( osname.str() );
00244 }

TGeoVolume * TofROOTGeo::GetVolumePart ( int  part  ) 

Get part volume;.

Definition at line 594 of file TofROOTGeo.cxx.

References SubDetectorROOTGeo::GetLogicalVolume().

Referenced by SetVolumeDefaultVis().

00595 {
00596   std::stringstream osname;
00597   if (part == 1) {
00598     osname << "logicalBrTof";
00599   }
00600   else if (part == 0){
00601     osname << "logicalEcTofWest";
00602   }
00603   else {
00604     osname << "logicalEcTofEast";
00605   }
00606 
00607   return GetLogicalVolume( osname.str() );
00608 
00609 
00610 
00611 }

TGeoVolume * TofROOTGeo::GetVolumePVF ( int  part,
int  layer 
)

Get PVF volume;.

Definition at line 614 of file TofROOTGeo.cxx.

References SubDetectorROOTGeo::GetLogicalVolume().

Referenced by SetVolumeDefaultVis().

00615 {
00616   std::stringstream osname;
00617   if (part == 0) {
00618     osname << "logical" << "PVFEcEast";
00619   }
00620   else if (part == 2){
00621     osname << "logical" << "PVFEcWest";
00622   }
00623   else {
00624     if (part == 1) {
00625       osname << "logical" << "PVFBr" << layer+1;
00626     }
00627   }
00628 
00629   return GetLogicalVolume( osname.str() );
00630 }

TGeoVolume * TofROOTGeo::GetVolumeScin ( int  part,
int  layer 
)

Get scintillator volume;.

Definition at line 652 of file TofROOTGeo.cxx.

References SubDetectorROOTGeo::GetLogicalVolume().

00653 {
00654   std::stringstream osname;
00655   if (part == 0) {
00656     osname << "logical" << "ScinEcEast";
00657   }
00658   else if (part == 2){
00659     osname << "logical" << "ScinEcWest";
00660   }
00661   else {
00662     if (part == 1) {
00663       osname << "logical" << "ScinBr" << layer+1;
00664     }
00665   }
00666 
00667   return GetLogicalVolume( osname.str() );
00668 }

TGeoVolume * TofROOTGeo::GetVolumeScin ( int  part  ) 

Get scintillator volume;.

Definition at line 215 of file TofROOTGeo.cxx.

References SubDetectorROOTGeo::GetLogicalVolume().

Referenced by SetAllVisible(), SetDefaultVis(), SetQuarterVisible(), and SetVolumeDefaultVis().

00216 {
00217   std::stringstream osname;
00218   if (part == 0 || part == 2) {
00219     osname << "logical" << "Tof" << "ScinEc";
00220   }
00221   else {
00222     if (part == 1) {
00223       osname << "logical" << "Tof" << "ScinBr";
00224     }
00225   }
00226 
00227   return GetLogicalVolume( osname.str() );
00228 }

TGeoVolume* TofROOTGeo::GetVolumeTof (  )  [inline]

Get Tof volume;.

Definition at line 96 of file TofROOTGeo.h.

References m_Tof.

00096 { return m_Tof; }

TGeoVolume* TofROOTGeo::GetVolumeTof (  )  [inline]

Get Tof volume;.

Definition at line 62 of file TofROOTGeo.h.

References m_Tof.

Referenced by BesGeometry::GetVolumeTof(), and BesGeometry::InitFromGDML().

00062 { return m_Tof; }

void TofROOTGeo::Init2DGeometry (  ) 

Initialize 2D Geometry.

Definition at line 77 of file TofROOTGeo.cxx.

References GetLayerNb(), GetPhysicalScin(), GetScinNb(), genRecEmupikp::i, ganga-rec::j, SubDetectorROOTGeo::m_2DGeoInit, SubDetectorROOTGeo::m_ROOTGeoInit, and m_Tof2DScin.

Referenced by BesGeometry::InitGeometry().

00078 {
00079     if (m_ROOTGeoInit != 1 && m_ROOTGeoInit != 2) {
00080         cout << "TofROOTGeo::Init2DGeometry, ROOT Geometry not Initialized yet!" << endl;
00081         return;
00082     }
00083     m_2DGeoInit = 1;
00084 
00085     Double_t local[3] = {0.0, 0.0, 0.0};
00086     Double_t master[3] = {0.0, 0.0, 0.0};
00087     //Int_t    nPoints = 8;
00088     //Double_t  P[300] = {0.0};
00089     //Double_t  center[3] = {0.0, 0.0, 0.0};
00090     TString  name;
00091 
00092     // Tof Scintillators
00093     for (Int_t part = 0; part < m_kPart; part++) {
00094         for (Int_t layer = 0; layer < GetLayerNb(part); layer++) {
00095             for (int scin = 0; scin < GetScinNb(part); scin++) {
00096                 TGeoPhysicalNode *scinPhyNode = GetPhysicalScin(part, layer, scin);
00097                 if (part == 1) {
00098                     name = TString("Tof Part 1");
00099                     name += " Layer ";
00100                     name += layer;
00101                     name += " Phi ";
00102                     name += scin;
00103                 }
00104                 else {
00105                     if (part == 0) name = TString("EastEc");
00106                     else if (part == 2) name = TString("WestEc");
00107                     name = TString("Tof Part ");
00108                     name += part;
00109                     name += " Phi ";
00110                     name += scin;
00111                 }
00112                 TGeoArb8 *scinShape = (TGeoArb8*)scinPhyNode->GetShape();
00113                 Double_t *localArb8Point, masterArb8Point[24];
00114                 localArb8Point = scinShape->GetVertices();
00115 
00116                 for (Int_t i = 0; i < 8; i++) {
00117                     local[0] = localArb8Point[2*i];
00118                     local[1] = localArb8Point[2*i+1];
00119                     if (i < 4) local[2] = scinShape->GetDz() * (-1.0);
00120                     else local[2] = scinShape->GetDz();
00121 
00122                     //cout << i << " local x: " << local[0] << " y: " << local[1] << " z: " << local[2] << endl;
00123                     scinPhyNode->GetMatrix(-1*scinPhyNode->GetLevel())->LocalToMaster(local, &master[0]); // transform to top
00124                     //cout << " master x: " << master[0] << " y: " << master[1] << " z: " << master[2] << endl;
00125 
00126                     for (Int_t j = 0; j < 3; j++) {
00127                         masterArb8Point[3*i+j] = master[j];
00128                     }
00129                 }
00130 
00131                 m_Tof2DScin[part][layer][scin] = new Tof2DScin(name, name, 8, &masterArb8Point[0], part);
00132             }
00133         }
00134     }
00135 }

void TofROOTGeo::InitFromGDML ( const char *  gdmlFile,
const char *  setupName 
)

Initialize ROOTGeo from GDML.

Definition at line 59 of file TofROOTGeo.cxx.

References SubDetectorROOTGeo::m_ROOTGeoInit, SubDetectorROOTGeo::ReadGdml(), and SetNode().

Referenced by BesGeometry::InitFromGDML().

00060 {
00061     m_ROOTGeoInit = 2;
00062 
00063     ReadGdml(gdmlFile, setupName);
00064     SetNode();
00065 }

void TofROOTGeo::InitFromGdml ( const char *  gdmlFile,
const char *  setupName 
)

Initialize the instance of ROOTGeo.

Definition at line 39 of file TofROOTGeo.cxx.

References SubDetectorROOTGeo::m_ROOTGeoInit, SubDetectorROOTGeo::ReadGdml(), SetDefaultVis(), and SetNode().

00040 {
00041   ReadGdml(gdmlFile, setupName);
00042   SetNode();
00043   SetDefaultVis();
00044 
00045   m_ROOTGeoInit = 1;  
00046 }

void TofROOTGeo::InitFromROOT ( TGeoVolume *  vol  ) 

Initialize ROOTGeo from TGeoVolume logicalTof.

Definition at line 68 of file TofROOTGeo.cxx.

References SubDetectorROOTGeo::m_ROOTGeoInit, SetNode(), and SetVolumeTof().

Referenced by BesGeometry::InitFromROOT().

00069 {
00070     m_ROOTGeoInit = 1;
00071 
00072     SetVolumeTof(vol);
00073     SetNode();
00074 }

virtual int SubDetectorROOTGeo::IsInitialized (  )  [inline, virtual, inherited]

If the ROOT geometry of this subdetctor is initialized;.

Definition at line 43 of file SubDetectorROOTGeo.h.

References SubDetectorROOTGeo::m_ROOTGeoInit.

00043 { return m_ROOTGeoInit; }

int SubDetectorROOTGeo::IsInitialized (  )  [inline, inherited]

If the ROOT geometry of this subdetctor is initialized;.

Definition at line 42 of file SubDetectorROOTGeo.h.

References SubDetectorROOTGeo::m_ROOTGeoInit.

00042 { return m_ROOTGeoInit; }

virtual void SubDetectorROOTGeo::ReadGdml ( const char *  gdmlFile,
const char *  setupName 
) [virtual, inherited]

Initialize the instance of ROOTGeo.

void SubDetectorROOTGeo::ReadGdml ( const char *  gdmlFile,
const char *  setupName 
) [inherited]

Initialize the instance of ROOTGeo.

Definition at line 31 of file SubDetectorROOTGeo.cxx.

References SubDetectorROOTGeo::m_config, SubDetectorROOTGeo::m_sxp, and SubDetectorROOTGeo::m_TopVolume.

Referenced by InitFromGDML(), InitFromGdml(), MucROOTGeo::InitFromGDML(), MucROOTGeo::InitFromGdml(), MdcROOTGeo::InitFromGDML(), MdcROOTGeo::InitFromGdml(), EmcROOTGeo::InitFromGDML(), and EmcROOTGeo::InitFromGdml().

00032 {
00033   m_config.SetURI( gdmlFile );
00034   m_config.SetSetupName( setupName );
00035   m_config.SetType ( "ROOT" );
00036   
00037   m_sxp.Configure( &m_config );
00038   m_sxp.Initialize();
00039   m_sxp.Run();
00040   
00041   m_TopVolume = (TGeoVolume*)TGDMLProcessor::GetInstance()->GetWorldVolume();
00042   if (!m_TopVolume) std::cout << "Top Volume not found " << std::endl;
00043 }

void TofROOTGeo::SetAllVisible (  ) 

Set all visible;.

void TofROOTGeo::SetAllVisible (  ) 

Set all visible;.

Definition at line 110 of file TofROOTGeo.cxx.

References GetBucket(), GetScin(), GetVolumeBucket(), GetVolumeScin(), m_kAssemblyBr, m_kAssemblyEc, m_kBucketBr, m_kBucketEc, and m_kPart.

Referenced by BesGeometry::SetDefaultVis().

00111 {
00112   for (int part = 0; part < m_kPart; part++) {
00113     GetVolumeScin(part)->SetVisibility(1);
00114     GetVolumeBucket(part)->SetVisibility(1);
00115     
00116     int nScin = 0;
00117     if (part == 1) nScin = m_kAssemblyBr;
00118     else nScin = m_kAssemblyEc; 
00119     for (int scin = 0; scin < nScin; scin++) {
00120       GetScin(part, scin)->SetVisibility(1);
00121       
00122       int nBucket = 0;
00123       if (part == 1) nBucket = m_kBucketBr;
00124       else nBucket = m_kBucketEc; 
00125       for (int bucket = 0; bucket < nBucket; bucket++) {
00126         GetBucket(part, scin, bucket)->SetVisibility(1);
00127       }
00128     }
00129   }
00130 }

virtual void SubDetectorROOTGeo::SetChildNo ( int  childNo  )  [inline, virtual, inherited]

Definition at line 46 of file SubDetectorROOTGeo.h.

References SubDetectorROOTGeo::m_childNo.

00046 { m_childNo = childNo; }

void SubDetectorROOTGeo::SetChildNo ( int  childNo  )  [inline, inherited]

Definition at line 45 of file SubDetectorROOTGeo.h.

References SubDetectorROOTGeo::m_childNo.

Referenced by BesGeometry::InitFromGDML(), BesGeometry::InitFromROOT(), MucGeoGeneral::InitFromXML(), and EmcROOTGeo::SetPhysicalNode().

00045 { m_childNo = childNo; }

void TofROOTGeo::SetDefaultVis (  ) 

Set default visual attributes;.

Definition at line 76 of file TofROOTGeo.cxx.

References GetBucket(), GetScin(), GetVolumeBucket(), GetVolumeScin(), m_kAssemblyBr, m_kAssemblyEc, m_kBucketBr, m_kBucketEc, m_kPart, and m_Tof.

Referenced by InitFromGdml().

00077 {
00078   //std::cout << "begin of set defaultvis" << std::endl;
00079   int tofColor    = 2;
00080   int scinColor   = 6;
00081   int bucketColor = 4;
00082 
00083   m_Tof->SetLineColor(tofColor);
00084   m_Tof->SetVisibility(0);
00085   
00086   for (int part = 0; part < m_kPart; part++) {
00087     GetVolumeScin(part)->SetLineColor(scinColor);
00088     GetVolumeScin(part)->SetVisibility(1);
00089     GetVolumeBucket(part)->SetLineColor(bucketColor);
00090     GetVolumeBucket(part)->SetVisibility(0);
00091 
00092     int nScin = 0;
00093     if (part == 1) nScin = m_kAssemblyBr;
00094     else nScin = m_kAssemblyEc; 
00095     for (int scin = 0; scin < nScin; scin++) {
00096       GetScin(part, scin)->SetVisibility(0);
00097       
00098       int nBucket = 0;
00099       if (part == 1) nBucket = m_kBucketBr;
00100       else nBucket = m_kBucketEc; 
00101       for (int bucket = 0; bucket < nBucket; bucket++) {
00102         GetBucket(part, scin, bucket)->SetVisibility(0);
00103       }
00104     }
00105   }
00106   //std::cout << "end of set defaultvis" << std::endl;
00107 }

void TofROOTGeo::SetDetector (  ) 

Draw Detecor (what is detector depends on you).

Definition at line 399 of file TofROOTGeo.cxx.

References GetLayerNb(), GetPhysicalScin(), GetScinNb(), BesView::GetVisFull3DTof(), and SubDetectorROOTGeo::m_DetectorsArray.

Referenced by BesClient::HandleViewOptionMenu().

00400 {
00401     BesView *view = 0;
00402     if (gPad) view = (BesView*)gPad->GetView();
00403     //if (view) cout << "viewVisFull3DTof " << view->GetVisFull3DTof() << endl;
00404 
00405     m_DetectorsArray->Clear();
00406     for (int part = 0; part < m_kPart; part++) {
00407         for (int layer = 0; layer < GetLayerNb(part); layer++) {
00408             for (int scin = 0; scin < GetScinNb(part); scin++) {
00409                 TGeoPhysicalNode *phyNode = 0;
00410                 phyNode = GetPhysicalScin(part, layer, scin);
00411                 if (phyNode) {
00412                     phyNode->SetVisibility(0); // set all invisible before set any visible
00413                     if (part == 2 ||
00414                             (scin >= GetScinNb(part)*0/4 && scin < GetScinNb(part)*8/8)) {
00415                         m_DetectorsArray->Add( phyNode );
00416                     }
00417                     else if (view && view->GetVisFull3DTof()) {
00418                         m_DetectorsArray->Add( phyNode );
00419                     }
00420                 }
00421             }
00422         }
00423     }
00424 }

void SubDetectorROOTGeo::SetDetectorOn (  )  [virtual, inherited]

Set all physicalNodes in m_DeteorsArray visible;.

Definition at line 73 of file SubDetectorROOTGeo.cxx.

References genRecEmupikp::i, and SubDetectorROOTGeo::m_DetectorsArray.

00074 {
00075     for (Int_t i = 0; i < m_DetectorsArray->GetEntries(); i++) {
00076         TGeoPhysicalNode *pNode = (TGeoPhysicalNode*)m_DetectorsArray->At(i);
00077         if (pNode) pNode->SetVisibility(1);
00078     }
00079 }

void TofROOTGeo::SetHalfVisible (  ) 

Set half visible;.

Definition at line 302 of file TofROOTGeo.cxx.

00303 {
00304     /*
00305     for (int part = 0; part < m_kPart; part++) {
00306       GetVolumeScin(part)->SetVisibility(1);
00307       GetVolumeBucket(part)->SetVisibility(1);
00308       
00309       int nScin = 0;
00310       if (part == 1) nScin = m_kAssemblyBr;
00311       else nScin = m_kAssemblyEc;
00312       for (int scin = 0; scin < nScin; scin++) {
00313         if (scin < nScin/4+1 ||
00314         scin > nScin*3/4 ) GetScin(part, scin)->SetVisibility(1);
00315         else                   GetScin(part, scin)->SetVisibility(0);
00316       
00317         int nBucket = 0;
00318         if (part == 1) nBucket = m_kBucketBr;
00319         else nBucket = m_kBucketEc;
00320         for (int bucket = 0; bucket < nBucket; bucket++) {
00321       if (scin < nScin/4+1 ||
00322           scin > nScin*3/4 ) GetBucket(part, scin, bucket)->SetVisibility(1);
00323       else                   GetBucket(part, scin, bucket)->SetVisibility(0);
00324         }
00325       }
00326     }
00327     */
00328 }

void TofROOTGeo::SetHits (  ) 

Set all physicalNodes corresponding to digiCol;.

Definition at line 427 of file TofROOTGeo.cxx.

References Tof2DScin::AddInfo(), TofID::barrel_ec(), Tof2DScin::ClearInfo(), Tof2DScin::CloseInfo(), Tof2DScin::GetCharge(), GetPhysicalScin(), BesEvent::GetTofDigiCol(), gEvent, genRecEmupikp::i, TofID::layer(), SubDetectorROOTGeo::m_2DHitsArray, SubDetectorROOTGeo::m_HitsArray, m_Tof2DScin, m_TofDigiCol, TofID::phi_module(), Tof2DScin::SetCharge(), RawDataUtil::TofCharge(), and RawDataUtil::TofTime().

Referenced by BesEvent::SetHits().

00428 {
00429     // set previous event hits to default vis
00430     for (int i = 0; i < m_HitsArray->GetEntries(); i++) {
00431         TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_HitsArray->At(i);
00432         if (phyNode){
00433             //phyNode->SetLineColor(m_ScinColor);
00434             phyNode->SetVisibility(0);
00435         }
00436     }
00437     m_HitsArray->Clear("C");
00438 
00439     // set previous event 2D hits info to default
00440     for (int i = 0; i < m_2DHitsArray->GetEntries(); i++) {
00441       Tof2DScin *aScin = (Tof2DScin*)m_2DHitsArray->At(i);
00442       aScin->ClearInfo();
00443       aScin->AddInfo(aScin->GetTitle());
00444       aScin->CloseInfo();
00445       aScin->ResetTimeCharge();
00446     }
00447     m_2DHitsArray->Clear("C");
00448 
00449     if (gEvent) m_TofDigiCol = gEvent->GetTofDigiCol();
00450 
00451     for (int i = 0; i < m_TofDigiCol->GetEntries(); i++) {
00452       TTofDigi *aTofDigi = (TTofDigi*)m_TofDigiCol->At(i);
00453 
00454       Identifier atofID( aTofDigi->getIntId() );
00455       int part  = TofID::barrel_ec(  atofID );
00456       int layer = TofID::layer(      atofID );
00457       int scin  = TofID::phi_module( atofID );
00458 
00459       //Double_t charge = Double_t(aTofDigi->getChargeChannel()) / TOF_CHARGE_FACTOR;
00460       //Double_t time   = Double_t(aTofDigi->getTimeChannel())   / TOF_TIME_FACTOR;
00461 
00462       Double_t charge = RawDataUtil::TofCharge(aTofDigi->getChargeChannel());
00463       Double_t time   = RawDataUtil::TofTime(aTofDigi->getTimeChannel());
00464 
00465       TGeoPhysicalNode *phyNode = 0;
00466       phyNode = GetPhysicalScin( part, layer, scin );
00467       if (phyNode) {
00468         m_HitsArray->Add( phyNode );
00469       }
00470 
00471       Tof2DScin *aScin = 0;
00472       aScin = m_Tof2DScin[part][layer][scin];
00473       if (aScin) {
00474         char data[100];
00475 
00476         if (aScin->GetCharge() == 0.0) {
00477           aScin->ClearInfo();
00478           aScin->AddInfo(aScin->GetTitle());
00479           sprintf(data, "time1 = %-.3f ns, charge1 = %-.3f MeV", time, charge);
00480           aScin->AddInfo( TString(data) );
00481         }
00482         else {
00483           sprintf(data, "time2 = %-.3f ns, charge2 = %-.3f MeV", time, charge);
00484           aScin->AddInfo( TString(data) );
00485           sprintf(data, "Fired");
00486           aScin->AddInfo( TString(data) );
00487         }
00488 
00489         aScin->CloseInfo();
00490         aScin->SetCharge(aScin->GetCharge() + charge);
00491 
00492         m_2DHitsArray->Add(aScin);
00493       }
00494     }
00495 }

void TofROOTGeo::SetNode (  ) 

Set the pointers to theirs nodes;.

void TofROOTGeo::SetNode (  ) 

Set the pointers to theirs nodes;.

Definition at line 49 of file TofROOTGeo.cxx.

References SubDetectorROOTGeo::GetNode(), SubDetectorROOTGeo::GetTopVolume(), m_kAssemblyBr, m_kAssemblyEc, m_kPart, m_NodeScin, and m_Tof.

Referenced by InitFromGDML(), InitFromGdml(), and InitFromROOT().

00050 {
00051   m_Tof = GetTopVolume();
00052   if(!m_Tof) std::cout << "m_Tof = 0" << std::endl;
00053   
00054   for (int part = 0; part < m_kPart; part++) {
00055     int nScin = 0;
00056     if (part == 1) nScin = m_kAssemblyBr;
00057     else nScin = m_kAssemblyEc; 
00058     for (int scin = 0; scin < nScin; scin++) {
00059       std::stringstream osname;
00060       if (part == 0) {
00061         osname << "pv_" << "logical" << "Tof" << "ScinEc" << "_" << m_kAssemblyBr + m_kAssemblyEc + scin << "_0"; 
00062     }
00063       else if (part == 1) {
00064         osname << "pv_" << "logical" << "Tof" << "ScinBr" << "_" << scin << "_0"; 
00065       }
00066       else if (part == 2) {
00067         osname << "pv_" << "logical" << "Tof" << "ScinEc" << "_" << m_kAssemblyBr + scin << "_0"; 
00068       }
00069       
00070       m_NodeScin[part][scin] = GetNode( osname.str() );
00071     }
00072   }
00073 }

void TofROOTGeo::SetNoEndVisible (  ) 

Set noend visible;.

Definition at line 331 of file TofROOTGeo.cxx.

00332 {
00333     /*
00334     int part = 1;
00335     GetVolumeScin(0)->SetVisibility(1);
00336     GetVolumeBucket(0)->SetVisibility(1);
00337       
00338     int nScin = 0;
00339     nScin = m_kAssemblyBr;
00340     for (int scin = 0; scin < nScin; scin++) {
00341       GetScin(part, scin)->SetVisibility(1);
00342 
00343       int nBucket = 0;
00344       nBucket = m_kBucketBr;
00345       for (int bucket = 0; bucket < nBucket; bucket++) {
00346         GetBucket(part, scin, bucket)->SetVisibility(1);
00347       }
00348     }
00349     */
00350 }

void TofROOTGeo::SetPhysicalNode (  ) 

Set the pointers to the physical nodes;.

void TofROOTGeo::SetPhysicalNode (  ) 

Set the pointers to the physical nodes;.

Definition at line 158 of file TofROOTGeo.cxx.

References GetScin(), SubDetectorROOTGeo::m_childNo, m_kAssemblyBr, m_kAssemblyEc, m_kPart, and m_PhysicalScin.

Referenced by BesGeometry::InitGeometry().

00159 {
00160   int scinColor = 6;
00161 
00162   if (gGeoManager == 0) std::cout << "Create gGeoManager first" << std::endl; 
00163   TGeoNode *bes = gGeoManager->GetTopNode();
00164   //std::cout << "m_childNo " << m_childNo << std::endl;
00165   TGeoNode *tof = bes->GetDaughter(m_childNo);
00166   
00167   for (int part = 0; part < m_kPart; part++) {
00168     int nScin = 0;
00169     if (part == 1) nScin = m_kAssemblyBr;
00170     else nScin = m_kAssemblyEc; 
00171     for (int scin = 0; scin < nScin; scin++) {
00172       TGeoNode *nodeScin = GetScin(part, scin);
00173       m_PhysicalScin[part][scin] = gGeoManager->MakePhysicalNode( TString("/") + bes->GetName() + 
00174                                                                   TString("/") + tof->GetName() +
00175                                                                   TString("/") + nodeScin->GetName() );
00176       m_PhysicalScin[part][scin]->SetVisibility(0);
00177       m_PhysicalScin[part][scin]->SetIsVolAtt(kFALSE);
00178       m_PhysicalScin[part][scin]->SetLineColor(scinColor);
00179     }
00180   }
00181 }

void TofROOTGeo::SetQMatch ( Bool_t  input  ) 

Definition at line 247 of file TofROOTGeo.cxx.

References showlog::input, and k_QMatch.

Referenced by BesClient::SetTofQMatch().

00247                                          {
00248     k_QMatch = input;
00249 }

void TofROOTGeo::SetQuarterVisible (  ) 

Set quater visible;.

void TofROOTGeo::SetQuarterVisible (  ) 

Set quater visible;.

Definition at line 133 of file TofROOTGeo.cxx.

References GetBucket(), GetScin(), GetVolumeBucket(), GetVolumeScin(), m_kAssemblyBr, m_kAssemblyEc, m_kBucketBr, m_kBucketEc, and m_kPart.

00134 {
00135   for (int part = 0; part < m_kPart; part++) {
00136     GetVolumeScin(part)->SetVisibility(1);
00137     GetVolumeBucket(part)->SetVisibility(1);
00138     
00139     int nScin = 0;
00140     if (part == 1) nScin = m_kAssemblyBr;
00141     else nScin = m_kAssemblyEc; 
00142     for (int scin = 0; scin < nScin; scin++) {
00143       if (scin < nScin/4) GetScin(part, scin)->SetVisibility(0);
00144       else                GetScin(part, scin)->SetVisibility(1);
00145       
00146       int nBucket = 0;
00147       if (part == 1) nBucket = m_kBucketBr;
00148       else nBucket = m_kBucketEc; 
00149       for (int bucket = 0; bucket < nBucket; bucket++) {
00150         if (scin < nScin/4) GetBucket(part, scin, bucket)->SetVisibility(0);
00151         else                GetBucket(part, scin, bucket)->SetVisibility(1);
00152       }
00153     }
00154   }
00155 }

void TofROOTGeo::SetTMatch ( Bool_t  input  ) 

Definition at line 242 of file TofROOTGeo.cxx.

References showlog::input, and k_TMatch.

Referenced by BesClient::SetTofTMatch().

00242                                          {
00243     k_TMatch = input;
00244 }

void TofROOTGeo::SetVisTofDetector (  ) 

Set Tof detector visibility;.

Definition at line 498 of file TofROOTGeo.cxx.

References GetPart(), BesView::GetVisTofBarrel(), BesView::GetVisTofEast(), BesView::GetVisTofGlobal(), BesView::GetVisTofWest(), genRecEmupikp::i, and SubDetectorROOTGeo::m_DetectorsArray.

Referenced by BesGeometry::Draw3D(), and BesClient::HandleViewOptionMenu().

00499 {
00500   /*
00501      for (int part = 0; part < m_kPart; part++) {
00502      for (int layer = 0; layer < GetLayerNb(part); layer++) {
00503      for (int scin = 0; scin < GetScinNb(part); scin++) {
00504      TGeoPhysicalNode *phyNode = GetPhysicalScin(part, layer, scin);
00505      if (phyNode) phyNode->SetLineColor(m_ScinColor);
00506      }
00507      }
00508      }
00509      */
00510 
00511   BesView *view = 0;
00512   if (gPad) view = (BesView*)gPad->GetView();
00513 
00514   //cout << "VisTofEast " << view->GetVisTofEast() << endl;
00515   for (int i = 0; i < m_DetectorsArray->GetEntries(); i++) {
00516     TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_DetectorsArray->At(i);
00517     phyNode->SetVisibility(0);
00518     if (view && view->GetVisTofGlobal()) {
00519       int part = GetPart(phyNode);
00520       if (part == 0 && view->GetVisTofEast()   ||
00521           part == 1 && view->GetVisTofBarrel() ||
00522           part == 2 && view->GetVisTofWest()   )
00523         phyNode->SetVisibility(1);
00524     }
00525   }
00526 }

void TofROOTGeo::SetVisTofHits (  ) 

Set Tof hits visibility;.

Definition at line 529 of file TofROOTGeo.cxx.

References GetPart(), BesView::GetVisTofHitsBarrel(), BesView::GetVisTofHitsEast(), BesView::GetVisTofHitsGlobal(), BesView::GetVisTofHitsWest(), genRecEmupikp::i, and SubDetectorROOTGeo::m_HitsArray.

Referenced by BesGeometry::Draw3D().

00530 {
00531   BesView *view = 0;
00532   if (gPad) view = (BesView*)gPad->GetView();
00533 
00534   for (int i = 0; i < m_HitsArray->GetEntries(); i++) {
00535     TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_HitsArray->At(i);
00536     if (phyNode){
00537       if (view && view->GetVisTofHitsGlobal()) {
00538         int part = GetPart(phyNode);
00539         if (part == 0 && view->GetVisTofHitsEast()   ||
00540             part == 1 && view->GetVisTofHitsBarrel() ||
00541             part == 2 && view->GetVisTofHitsWest()   ) {
00542           phyNode->SetVisibility(1);
00543           phyNode->SetLineColor(kGreen);
00544           continue;
00545         }
00546       }
00547       phyNode->SetVisibility(0);
00548     }
00549   }
00550 }

void TofROOTGeo::SetVolumeDefaultVis (  ) 

Set default visual attributes;.

Definition at line 214 of file TofROOTGeo.cxx.

References GetLayerNb(), GetVolumeAl(), GetVolumeBucket(), GetVolumePart(), GetVolumePVF(), GetVolumeScin(), m_BucketColor, m_ScinColor, m_Tof, and m_TofColor.

00215 {
00216     //std::cout << "begin of set defaultvis" << std::endl;
00217 
00218     m_Tof->SetLineColor(m_TofColor);
00219     m_Tof->SetVisibility(0);
00220 
00221     for (int part = 0; part < m_kPart; part++) {
00222         GetVolumePart(part)->SetLineColor(m_ScinColor);
00223         GetVolumePart(part)->SetVisibility(0);
00224         for (int layer = 0; layer < GetLayerNb(part); layer++) {
00225             GetVolumePVF(part, layer)->SetLineColor(m_ScinColor);
00226             GetVolumePVF(part, layer)->SetVisibility(0);
00227 
00228             GetVolumeAl(part, layer)->SetLineColor(m_ScinColor);
00229             GetVolumeAl(part, layer)->SetVisibility(0);
00230 
00231             GetVolumeScin(part, layer)->SetLineColor(m_ScinColor);
00232             GetVolumeScin(part, layer)->SetVisibility(0);
00233 
00234             GetVolumeBucket(part, layer)->SetLineColor(m_BucketColor);
00235             GetVolumeBucket(part, layer)->SetVisibility(0);
00236         }
00237     }
00238     //std::cout << "end of set defaultvis" << std::endl;
00239 }

void TofROOTGeo::SetVolumeTof ( TGeoVolume *  vol  )  [inline]

Set Tof volume, while initializing from ROOT;.

Definition at line 93 of file TofROOTGeo.h.

References m_Tof.

Referenced by InitFromROOT().

00093 { m_Tof = vol; }


Member Data Documentation

Bool_t TofROOTGeo::k_QMatch [private]

Definition at line 156 of file TofROOTGeo.h.

Referenced by DrawHits(), and SetQMatch().

Bool_t TofROOTGeo::k_TMatch [private]

Definition at line 155 of file TofROOTGeo.h.

Referenced by DrawHits(), and SetTMatch().

int SubDetectorROOTGeo::m_2DGeoInit [protected, inherited]

Definition at line 79 of file SubDetectorROOTGeo.h.

Referenced by Draw(), MucROOTGeo::Draw(), MdcROOTGeo::Draw(), EmcROOTGeo::Draw(), Init2DGeometry(), MucROOTGeo::Init2DGeometry(), MdcROOTGeo::Init2DGeometry(), and EmcROOTGeo::Init2DGeometry().

TObjArray* SubDetectorROOTGeo::m_2DHitsArray [protected, inherited]

Definition at line 85 of file SubDetectorROOTGeo.h.

Referenced by SetHits(), MucROOTGeo::SetHits(), MdcROOTGeo::SetHits(), and EmcROOTGeo::SetHits().

int TofROOTGeo::m_BucketColor [private]

Definition at line 159 of file TofROOTGeo.h.

Referenced by SetVolumeDefaultVis().

int SubDetectorROOTGeo::m_childNo [protected, inherited]

Definition at line 67 of file SubDetectorROOTGeo.h.

Referenced by SubDetectorROOTGeo::SetChildNo(), SetPhysicalNode(), MucROOTGeo::SetPhysicalNode(), and MdcROOTGeo::SetPhysicalNode().

TObjArray* SubDetectorROOTGeo::m_DetectorsArray [protected, inherited]

Definition at line 83 of file SubDetectorROOTGeo.h.

Referenced by SetDetector(), MucROOTGeo::SetDetector(), MdcROOTGeo::SetDetector(), EmcROOTGeo::SetDetector(), SubDetectorROOTGeo::SetDetectorOn(), EmcROOTGeo::SetVisEmcDetector(), MdcROOTGeo::SetVisMdcDetector(), MucROOTGeo::SetVisMucDetector(), and SetVisTofDetector().

TObjArray* SubDetectorROOTGeo::m_HitsArray [protected, inherited]

Definition at line 84 of file SubDetectorROOTGeo.h.

Referenced by SubDetectorROOTGeo::GetHit(), SubDetectorROOTGeo::GetHitsNum(), SetHits(), MucROOTGeo::SetHits(), MdcROOTGeo::SetHits(), EmcROOTGeo::SetHits(), EmcROOTGeo::SetVisEmcHits(), MdcROOTGeo::SetVisMdcHits(), MucROOTGeo::SetVisMucHits(), and SetVisTofHits().

const int TofROOTGeo::m_kAssemblyBr = 88 [static, private]

Definition at line 85 of file TofROOTGeo.h.

Referenced by GetBucket(), GetScinNb(), SetAllVisible(), SetDefaultVis(), SetNode(), SetPhysicalNode(), SetQuarterVisible(), and TofROOTGeo().

const int TofROOTGeo::m_kAssemblyEc = 48 [static, private]

Definition at line 84 of file TofROOTGeo.h.

Referenced by GetBucket(), GetScinNb(), SetAllVisible(), SetDefaultVis(), SetNode(), SetPhysicalNode(), and SetQuarterVisible().

static const int TofROOTGeo::m_kBucketBr = 2 [static, private]

Definition at line 87 of file TofROOTGeo.h.

Referenced by SetAllVisible(), SetDefaultVis(), and SetQuarterVisible().

static const int TofROOTGeo::m_kBucketEc = 1 [static, private]

Definition at line 86 of file TofROOTGeo.h.

Referenced by SetAllVisible(), SetDefaultVis(), and SetQuarterVisible().

const int TofROOTGeo::m_kLayerBr = 2 [static, private]

Definition at line 145 of file TofROOTGeo.h.

Referenced by GetLayerNb().

const int TofROOTGeo::m_kLayerEc = 1 [static, private]

Definition at line 146 of file TofROOTGeo.h.

Referenced by GetLayerNb().

static const int TofROOTGeo::m_kPart = 3 [static, private]

Definition at line 83 of file TofROOTGeo.h.

Referenced by GetPartNb(), SetAllVisible(), SetDefaultVis(), SetNode(), SetPhysicalNode(), SetQuarterVisible(), and TofROOTGeo().

const int TofROOTGeo::m_kScinBr = 88 [static, private]

Definition at line 147 of file TofROOTGeo.h.

const int TofROOTGeo::m_kScinEc = 48 [static, private]

Definition at line 148 of file TofROOTGeo.h.

TGeoNode* TofROOTGeo::m_NodeAl[m_kPart][m_kLayerBr] [private]

Definition at line 164 of file TofROOTGeo.h.

Referenced by GetAl().

TGeoNode* TofROOTGeo::m_NodePVF[m_kPart][m_kLayerBr][m_kScinBr] [private]

Definition at line 163 of file TofROOTGeo.h.

Referenced by GetPVF().

TGeoNode* TofROOTGeo::m_NodeScin[m_kPart][m_kLayerBr] [private]

Definition at line 165 of file TofROOTGeo.h.

TGeoNode* TofROOTGeo::m_NodeScin[m_kPart][m_kAssemblyBr] [private]

Definition at line 90 of file TofROOTGeo.h.

Referenced by GetScin(), SetNode(), and TofROOTGeo().

TGeoPhysicalNode* TofROOTGeo::m_PhysicalScin[m_kPart][m_kLayerBr][m_kScinBr] [private]

Definition at line 166 of file TofROOTGeo.h.

TGeoPhysicalNode* TofROOTGeo::m_PhysicalScin[m_kPart][m_kAssemblyBr] [private]

Definition at line 91 of file TofROOTGeo.h.

Referenced by GetPhysicalScin(), SetPhysicalNode(), and TofROOTGeo().

int SubDetectorROOTGeo::m_ROOTGeoInit [protected, inherited]

Definition at line 66 of file SubDetectorROOTGeo.h.

Referenced by Init2DGeometry(), MucROOTGeo::Init2DGeometry(), MdcROOTGeo::Init2DGeometry(), EmcROOTGeo::Init2DGeometry(), InitFromGDML(), InitFromGdml(), MucROOTGeo::InitFromGDML(), MucROOTGeo::InitFromGdml(), MdcROOTGeo::InitFromGDML(), MdcROOTGeo::InitFromGdml(), EmcROOTGeo::InitFromGDML(), EmcROOTGeo::InitFromGdml(), InitFromROOT(), MucROOTGeo::InitFromROOT(), MdcROOTGeo::InitFromROOT(), EmcROOTGeo::InitFromROOT(), and SubDetectorROOTGeo::IsInitialized().

int TofROOTGeo::m_ScinColor [private]

Definition at line 160 of file TofROOTGeo.h.

Referenced by SetVolumeDefaultVis().

TGeoVolume* TofROOTGeo::m_Tof [private]

Definition at line 162 of file TofROOTGeo.h.

TGeoVolume* TofROOTGeo::m_Tof [private]

Definition at line 89 of file TofROOTGeo.h.

Referenced by GetVolumeTof(), SetDefaultVis(), SetNode(), SetVolumeDefaultVis(), and SetVolumeTof().

Tof2DScin* TofROOTGeo::m_Tof2DScin[m_kPart][m_kLayerBr][m_kScinBr] [private]

Definition at line 171 of file TofROOTGeo.h.

Referenced by Draw(), DrawHits(), Get2DScin(), Init2DGeometry(), and SetHits().

int TofROOTGeo::m_TofColor [private]

Definition at line 158 of file TofROOTGeo.h.

Referenced by SetVolumeDefaultVis().

const TObjArray* TofROOTGeo::m_TofDigiCol [private]

Definition at line 168 of file TofROOTGeo.h.

Referenced by DrawHits(), and SetHits().

TGeoVolume* SubDetectorROOTGeo::m_TopVolume [protected, inherited]

Definition at line 81 of file SubDetectorROOTGeo.h.

TGeoVolume* SubDetectorROOTGeo::m_TopVolume [protected, inherited]

Definition at line 69 of file SubDetectorROOTGeo.h.

Referenced by SubDetectorROOTGeo::GetTopVolume(), and SubDetectorROOTGeo::ReadGdml().

const int TofROOTGeo::TOF_CHARGE_FACTOR = 1000000 [static, private]

Definition at line 153 of file TofROOTGeo.h.

Referenced by DrawHits().

const int TofROOTGeo::TOF_TIME_FACTOR = 1000000 [static, private]

Definition at line 152 of file TofROOTGeo.h.


Generated on Tue Nov 29 23:36:07 2016 for BOSS_7.0.2 by  doxygen 1.4.7