CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
TofROOTGeo Class Reference

#include <TofROOTGeo.h>

+ Inheritance diagram for TofROOTGeo:

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.
 
bool GetMrpc () const
 
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 SetPhysicalDefaultVis ()
 
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 ClearHits ()
 
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)
 
int GetModuleNb (int part)
 
int GetStripNb (int module)
 
int GetChamberNodeNb (int module)
 
int GetContainerNodeNb (int module)
 
int GetBoard1NodeNb (int module)
 
void SetVolumeTof (TGeoVolume *vol)
 Set Tof volume, while initializing from ROOT;.
 
TGeoVolume * GetVolumeTof ()
 Get Tof volume;.
 
TGeoVolume * GetVolumePart (int part)
 Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;

 
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;.
 
TGeoNode * GetModule (int part, int module)
 Get module node;.
 
TGeoNode * GetStrip (int part, int module, int strip)
 Get strip node;.
 
TGeoNode * GetgasContainer (int part, int module)
 Get gasContainer node;.
 
TGeoNode * GetbareChamber (int part, int module)
 Get bareChamber node;.
 
TGeoNode * GetpcbBoard1 (int part, int module)
 Get pcbBoard1 node;.
 
TGeoPhysicalNode * GetPhysicalScin (int part, int layer, int scin)
 Get bucket node, 0 for west bucket, 1 for the east one;.
 
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.
 
- Public Member Functions inherited from SubDetectorROOTGeo
 SubDetectorROOTGeo ()
 Constructor.
 
virtual ~SubDetectorROOTGeo ()
 Destructor.
 
void ReadGdml (const char *gdmlFile, const char *setupName)
 Initialize the instance of ROOTGeo.
 
int IsInitialized ()
 If the ROOT geometry of this subdetctor is initialized;.
 
void SetChildNo (int childNo)
 
TGeoVolume * GetLogicalVolume (const std::string &vn)
 Get a logical volume by name;.
 
TGeoVolume * GetTopVolume ()
 Get the top(world) volume;.
 
TGeoVolumeAssembly * GetAssemblyVolume (const std::string &an)
 Get an assembly by name;.
 
TGeoNode * GetNode (const std::string &nn)
 Get a node(physical volume) by name;.
 
 SubDetectorROOTGeo ()
 Constructor.
 
virtual ~SubDetectorROOTGeo ()
 Destructor.
 
virtual void ReadGdml (const char *gdmlFile, const char *setupName)
 Initialize the instance of ROOTGeo.
 
virtual int IsInitialized ()
 If the ROOT geometry of this subdetctor is initialized;.
 
virtual void SetChildNo (int childNo)
 
virtual TGeoVolume * GetLogicalVolume (const std::string &vn)
 Get a logical volume by name;.
 
virtual TGeoVolume * GetTopVolume ()
 Get the top(world) volume;.
 
virtual TGeoVolumeAssembly * GetAssemblyVolume (const std::string &an)
 Get an assembly 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;.
 

Additional Inherited Members

- Protected Attributes inherited from SubDetectorROOTGeo
int m_ROOTGeoInit
 
int m_childNo
 
TGeoVolume * m_TopVolume
 
int m_2DGeoInit
 
TObjArray * m_DetectorsArray
 
TObjArray * m_HitsArray
 
TObjArray * m_2DHitsArray
 

Detailed Description

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

Author
Zhengyun You \URL{youzy.nosp@m.@hep.nosp@m..pku..nosp@m.cn}

Definition at line 27 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/ROOTGeo/TofROOTGeo.h.

Constructor & Destructor Documentation

◆ TofROOTGeo() [1/2]

TofROOTGeo::TofROOTGeo ( )

Constructor.

Definition at line 24 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

25{
26 // Default constructor.
27 for (int part = 0; part < m_kPart; part++) {
28 for (int scin = 0; scin < m_kAssemblyBr; scin++) {
29 m_NodeScin[part][scin] = 0;
30 m_PhysicalScin[part][scin] = 0;
31 }
32 }
33}

◆ ~TofROOTGeo() [1/2]

TofROOTGeo::~TofROOTGeo ( )

Destructor.

Definition at line 35 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

36{ }

◆ TofROOTGeo() [2/2]

TofROOTGeo::TofROOTGeo ( )

Constructor.

◆ ~TofROOTGeo() [2/2]

TofROOTGeo::~TofROOTGeo ( )

Destructor.

Member Function Documentation

◆ ClearHits()

void TofROOTGeo::ClearHits ( )

Definition at line 894 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

895{
896 //Long Peixun's update: the element type of m_HitsArray is replaced by TofPhysicalPointer
897 for (int i = 0; i < m_HitsArray->GetEntries(); i++)
898 {
900 if (PphyNode)
901 {
902 //phyNode->SetLineColor(m_ScinColor);
903 (*PphyNode)->SetVisibility(0);
904 }
905 }
906 m_HitsArray->Clear("C");
907
908 // set previous event 2D hits info to default
909 for (int i = 0; i < m_2DHitsArray->GetEntries(); i++)
910 {
911 Tof2DScin *aScin = (Tof2DScin*)m_2DHitsArray->At(i);
912 aScin->ClearInfo();
913 aScin->AddInfo(aScin->GetTitle());
914 aScin->CloseInfo();
915 aScin->ResetTimeCharge();
916 }
917 m_2DHitsArray->Clear("C");
918}
virtual void AddInfo(TString info)
Definition: Tof2DScin.h:35
virtual void ResetTimeCharge()
Definition: Tof2DScin.h:43
virtual void CloseInfo()
Definition: Tof2DScin.cxx:130
virtual void ClearInfo()
Definition: Tof2DScin.cxx:124

Referenced by BesEvent::ClearHits(), and SetHits().

◆ Draw()

void TofROOTGeo::Draw ( Option_t *  option)

Draw function.

Definition at line 1458 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1459{
1460 TString opt = option;
1461 opt.ToUpper();
1462
1463 if (!m_2DGeoInit) cout << "TofROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
1464 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1465 if (!view) cout << "TofROOTGeo::Draw(), BesView not found" << endl;
1466
1467 if (view->GetVisTofGlobal())
1468 { // TofVisGlobal
1469 TString scinOpt;
1470
1471 //if (opt.Contains("XY")) {
1472 // west part drawn first usually
1473 for (Int_t part = m_kPart-1; part >= 0; part--)
1474 {
1475 for (Int_t layer = 0; layer < GetLayerNb(part); layer++)
1476 {
1477 for (int scin = 0; scin < GetScinNb(part); scin++)
1478 {
1479 if (m_Tof2DScin[part][layer][scin])
1480 {
1481 //cout << "part " << part << " layer " << layer << " scin " << scin << endl;
1482 //m_Tof2DScin[part][layer][scin]->SetHighlighted(false);
1483 m_Tof2DScin[part][layer][scin]->SetFired(false);
1484 if ( (part == 0 && view->GetVisTofEast()) ||
1485 (part == 1 && view->GetVisTofBarrel()) ||
1486 (part == 2 && view->GetVisTofWest()) )
1487 m_Tof2DScin[part][layer][scin]->Draw(scinOpt);
1488 }
1489 }
1490 }
1491 }
1492 }
1493}
Bool_t GetVisTofBarrel()
Definition: BesView.h:142
Bool_t GetVisTofEast()
Definition: BesView.h:141
Bool_t GetVisTofGlobal()
Definition: BesView.h:140
Bool_t GetVisTofWest()
Definition: BesView.h:143
virtual void Draw(Option_t *option="")
Definition: Tof2DScin.cxx:207
virtual void SetFired(bool status=true)
Definition: Tof2DScin.h:31
int GetScinNb(int part)
Get number of scintillators on each part;.

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

◆ DrawHits()

void TofROOTGeo::DrawHits ( Option_t *  option)

Draw 2D hits.

Definition at line 1496 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1497{
1498 // cout << "Draw Hits" << endl;
1499 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1500 if (!view) cout << "TofROOTGeo::DrawHits(), BesView not found" << endl;
1501
1502 //cout << "VisTofHitsGlobal " << view->GetVisTofHitsGlobal() << endl;
1503 //cout << "VisTofHitsEast " << view->GetVisTofHitsEast() << endl;
1504 //cout << "VisTofHitsBarrel " << view->GetVisTofHitsBarrel() << endl;
1505 //cout << "VisTofHitsWest " << view->GetVisTofHitsWest() << endl;
1506
1507 if (view->GetVisTofHitsGlobal())
1508 {
1509 //Long Peixun's update: Use m_2DHitsArray which contains ready hits rather than rebuild hits
1510 for (int i = 0; i < m_2DHitsArray->GetEntries(); ++i)
1511 {
1512 Tof2DScin* aScin = (Tof2DScin*)m_2DHitsArray->At(i);
1513 if (aScin)
1514 {
1515 if ((k_TMatch) && (aScin->GetTimeChannel() == 0x7FFFFFFF))
1516 continue;
1517 if ((k_QMatch) && (aScin->GetChargeChannel() == 0x7FFFFFFF))
1518 continue;
1519
1520 if ((aScin->GetPart() == 0 && view->GetVisTofHitsEast()) ||
1521 (aScin->GetPart() == 1 && view->GetVisTofHitsBarrel()) ||
1522 (aScin->GetPart() == 2 && view->GetVisTofHitsWest()) )
1523 {
1524 aScin->SetFired(true);
1525 aScin->Draw();
1526 }
1527 }
1528 }
1529
1530/* // reset time and charge to zero
1531 for (Int_t part = m_kPart-1; part >= 0; part--) {
1532 for (Int_t layer = 0; layer < GetLayerNb(part); layer++) {
1533 for (int scin = 0; scin < GetScinNb(part); scin++) {
1534 if (m_Tof2DScin[part][layer][scin]) {
1535 m_Tof2DScin[part][layer][scin]->ResetTimeCharge();
1536 }
1537 }
1538 }
1539 }
1540
1541 if (m_TofDigiCol) {
1542 for (int i = 0; i < m_TofDigiCol->GetEntries(); i++) {
1543 TTofDigi *aTofDigi = (TTofDigi*)m_TofDigiCol->At(i);
1544
1545 Identifier aTofID( aTofDigi->getIntId() );
1546 int part = TofID::barrel_ec( aTofID );
1547 int layer = TofID::layer( aTofID );
1548 int scin = TofID::phi_module( aTofID );
1549
1550 Double_t charge = Double_t(aTofDigi->getChargeChannel()) / TOF_CHARGE_FACTOR;
1551 //cout << "charge " << charge << endl;
1552
1553 Tof2DScin *aScin = 0;
1554 aScin = m_Tof2DScin[part][layer][scin];
1555 // Mdc TQMatch for example
1556 //
1557 //if (aWire &&
1558 // ((overflow == 0)||(overflow == 12))){
1559 // if ((k_TMatch) &&
1560 // (aMdcDigi->getTimeChannel() == 0x7FFFFFFF)){
1561 // continue;
1562 // }
1563 // if ((k_QMatch) &&
1564 // (aMdcDigi->getChargeChannel() == 0x7FFFFFFF)){
1565 // continue;
1566 // }
1567 //}
1568
1569 if (aScin) {
1570 if ((k_TMatch)&&
1571 (aTofDigi->getTimeChannel() == 0x7FFFFFFF)){
1572 continue;
1573 }
1574 if ((k_QMatch)&&
1575 (aTofDigi->getChargeChannel() == 0x7FFFFFFF)){
1576 continue;
1577 }
1578
1579 aScin->SetCharge(aScin->GetCharge() + charge);
1580
1581 if ( (part == 0 && view->GetVisTofHitsEast()) ||
1582 (part == 1 && view->GetVisTofHitsBarrel()) ||
1583 (part == 2 && view->GetVisTofHitsWest()) ) {
1584 aScin->SetFired(true);
1585 aScin->Draw();
1586 }
1587 }
1588 }
1589 } */
1590 }
1591}
Bool_t GetVisTofHitsWest()
Definition: BesView.h:224
Bool_t GetVisTofHitsGlobal()
Definition: BesView.h:221
Bool_t GetVisTofHitsBarrel()
Definition: BesView.h:223
Bool_t GetVisTofHitsEast()
Definition: BesView.h:222
virtual Int_t GetPart()
Definition: Tof2DScin.h:49
UInt_t GetChargeChannel() const
Definition: Tof2DScin.h:58
UInt_t GetTimeChannel() const
Definition: Tof2DScin.h:57

Referenced by BesEvent::DrawHits().

◆ Get2DScin()

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

Get Tof2DScin;.

Definition at line 1431 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1432{
1433 if (m_Tof2DScin[part][layer][scin]) return m_Tof2DScin[part][layer][scin];
1434 else return 0;
1435}

Referenced by BesEvent::ConstructTofTrackFromRec().

◆ GetAl()

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

Get Al node;.

Definition at line 1304 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1305{
1306 if (m_NodeAl[part][layer] != 0) {
1307 return m_NodeAl[part][layer];
1308 }
1309 else {
1310 std::cout << "Node: " << "Part" << part << "Layer" << layer << "Al" << " not found" << std::endl;
1311 return 0;
1312 }
1313 return m_NodeAl[part][layer];
1314}

◆ GetbareChamber()

TGeoNode * TofROOTGeo::GetbareChamber ( int  part,
int  module 
)

Get bareChamber node;.

Definition at line 1356 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1357{
1358 if (m_NodebareChamber[part][module] != 0) {
1359 return m_NodebareChamber[part][module];
1360 }
1361 else {
1362 std::cout << "Node: " << "Part" << part << "Module" << module << "bareChamber" << " not found" << std::endl;
1363 return 0;
1364 }
1365
1366 return m_NodebareChamber[part][module];
1367}

◆ GetBoard1NodeNb()

int TofROOTGeo::GetBoard1NodeNb ( int  module)

Definition at line 1178 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1179{
1180 return m_kBoard1NodeNb;
1181}

◆ GetBucket()

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 DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

262{
263 std::stringstream osname;
264 if (part == 0) {
265 osname << "pv_" << "logical" << "Tof" << "BucketEc" << "_" << m_kAssemblyBr + m_kAssemblyEc + scin << "_1";
266 }
267 else if (part == 1) {
268 osname << "pv_" << "logical" << "Tof" << "BucketBr" << "_" << scin << "_" << bucket+1;
269 }
270 else if (part == 2) {
271 osname << "pv_" << "logical" << "Tof" << "BucketEc" << "_" << m_kAssemblyBr + scin << "_1";
272 }
273
274 return GetNode( osname.str() );
275}
TGeoNode * GetNode(const std::string &nn)
Get a node(physical volume) by name;.

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

◆ GetChamberNodeNb()

int TofROOTGeo::GetChamberNodeNb ( int  module)

Definition at line 1170 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1171{
1172 return m_kChamberNodeNb;
1173}

◆ GetContainerNodeNb()

int TofROOTGeo::GetContainerNodeNb ( int  module)

Definition at line 1174 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1175{
1176 return m_kContainerNodeNb;
1177}

◆ GetgasContainer()

TGeoNode * TofROOTGeo::GetgasContainer ( int  part,
int  module 
)

Get gasContainer node;.

Definition at line 1343 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1344{
1345 if (m_NodegasContainer[part][module] != 0) {
1346 return m_NodegasContainer[part][module];
1347 }
1348 else {
1349 std::cout << "Node: " << "Part" << part << "Module" << module << "gasContainer" << " not found" << std::endl;
1350 return 0;
1351 }
1352
1353 return m_NodegasContainer[part][module];
1354}

◆ GetLayerNb()

int TofROOTGeo::GetLayerNb ( int  part)

Definition at line 1152 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1153{
1154 //Long Peixun's update: code optimization
1155 //Huang Shuhui's update: for Tof with MRPC
1156 if (part == 1) return m_kLayerBr;
1157 else
1158 {
1159 if (fTofMrpc) return m_kModuleEc;
1160 return m_kLayerEc;
1161 }
1162}

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

◆ GetModule()

TGeoNode * TofROOTGeo::GetModule ( int  part,
int  module 
)

Get module node;.

Definition at line 1331 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1332{
1333 if (m_NodeModule[part][module] != 0) {
1334 return m_NodeModule[part][module];
1335 }
1336 else {
1337 std::cout << "Node: " << "Part" << part << "Module" << module << " not found" << std::endl;
1338 return 0;
1339 }
1340 return m_NodeModule[part][module];
1341}

◆ GetModuleNb()

int TofROOTGeo::GetModuleNb ( int  part)

Definition at line 1166 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1167{
1168 return m_kModuleEc;
1169}

Referenced by Init2DGeometry(), SetDetector(), and SetPhysicalDefaultVis().

◆ GetMrpc()

bool TofROOTGeo::GetMrpc ( ) const
inline

Definition at line 41 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/BesVisLib/TofROOTGeo.h.

41{ return fTofMrpc; }

◆ GetPart()

Int_t TofROOTGeo::GetPart ( TGeoPhysicalNode *  phyNode)

Get part no of a scintillator physcial node.

Definition at line 1438 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1439{
1440 for (Int_t part = 0; part < m_kPart; part++)
1441 {
1442 for (Int_t layer = 0; layer < GetLayerNb(part); layer++)
1443 {
1444 for (int scin = 0; scin < GetScinNb(part); scin++)
1445 {
1446 if (phyNode == GetPhysicalScin(part, layer, scin)) {
1447 //cout << "GetPart()" << part << endl;
1448 return part;
1449 }
1450 }
1451 }
1452 }
1453 cout << "TofROOTGeo::GetPart, this scintillator physical node does not exist!" << endl;
1454 return -1;
1455}
TGeoPhysicalNode * GetPhysicalScin(int part, int scin)
Get scintillator physical node;.

Referenced by SetVisTofDetector(), and SetVisTofHits().

◆ GetPartNb() [1/2]

int TofROOTGeo::GetPartNb ( )

Get number of part;.

Definition at line 184 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

185{
186 int nPart = m_kPart;
187 return nPart;
188}

◆ GetPartNb() [2/2]

int TofROOTGeo::GetPartNb ( )

Get number of part;.

◆ GetpcbBoard1()

TGeoNode * TofROOTGeo::GetpcbBoard1 ( int  part,
int  module 
)

Get pcbBoard1 node;.

Definition at line 1369 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1370{
1371 if (m_NodepcbBoard1[part][module] != 0) {
1372 return m_NodepcbBoard1[part][module];
1373 }
1374 else {
1375 std::cout << "Node: " << "Part" << part << "Module" << module << "pcbBoard1" << " not found" << std::endl;
1376 return 0;
1377 }
1378
1379 return m_NodepcbBoard1[part][module];
1380}

◆ GetPhysicalScin() [1/2]

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

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

Get scintillator physical node;

Definition at line 1416 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1417{
1418 //Long Peixun's update: TGeoPhysicalNode* -> TofPhysicalPointer
1419 if (m_PhysicalScin[part][layer][scin]) {
1420 return m_PhysicalScin[part][layer][scin].get();
1421 }
1422 else {
1423 std::cout << "PhysicalNode: " << "Part"
1424 << part << "Layer" << layer << "Scin"
1425 << scin << " not found" << std::endl;
1426 return 0;
1427 }
1428}

◆ GetPhysicalScin() [2/2]

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

Get scintillator physical node;.

Definition at line 278 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

279{
280 if (m_PhysicalScin[part][scin] != 0) {
281 return m_PhysicalScin[part][scin];
282 }
283 else {
284 std::cout << "PhysicalNode: " << "Part" << part << "Scin" << scin << " not found" << std::endl;
285 return 0;
286 }
287}

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

◆ GetPVF()

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

Get PVF node;.

Definition at line 1291 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1292{
1293 if (m_NodePVF[part][layer][scin] != 0) {
1294 return m_NodePVF[part][layer][scin];
1295 }
1296 else {
1297 std::cout << "Node: " << "Part" << part << "Layer" << layer << "PVF" << scin << " not found" << std::endl;
1298 return 0;
1299 }
1300 return m_NodePVF[part][layer][scin];
1301}

◆ GetScin() [1/2]

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

Get scintillator node;.

◆ GetScin() [2/2]

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

Get scintillator node;.

Definition at line 247 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

248{
249 if (m_NodeScin[part][scin] != 0) {
250 return m_NodeScin[part][scin];
251 }
252 else {
253 std::cout << "Node: " << "Part" << part << "Scin" << scin << " not found" << std::endl;
254 return 0;
255 }
256
257 return m_NodeScin[part][scin];
258}

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

◆ GetScinNb() [1/2]

int TofROOTGeo::GetScinNb ( int  part)

Get number of scintillators on each part;.

Definition at line 191 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

192{
193 int nScin = m_kAssemblyBr;
194 if (part != 1) nScin = m_kAssemblyEc;
195 return nScin;
196}

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

◆ GetScinNb() [2/2]

int TofROOTGeo::GetScinNb ( int  part)

Get number of scintillators on each part;.

◆ GetStrip()

TGeoNode * TofROOTGeo::GetStrip ( int  part,
int  module,
int  strip 
)

Get strip node;.

Definition at line 1382 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1383{
1384 if (m_NodeStrip[part][module][strip] != 0) {
1385 return m_NodeStrip[part][module][strip];
1386 }
1387 else {
1388 std::cout << "Node: " << "Part" << part << "Module" << module << "Strip" << strip << " not found" << std::endl;
1389 return 0;
1390 }
1391
1392 return m_NodeStrip[part][module][strip];
1393}

◆ GetStripNb()

int TofROOTGeo::GetStripNb ( int  module)

Definition at line 1182 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1183{
1184 return m_kStripEc;
1185}

Referenced by Init2DGeometry(), SetDetector(), and SetPhysicalDefaultVis().

◆ GetVolumeAl()

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

Get Al volume;.

Definition at line 1240 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1241{
1242 std::stringstream osname;
1243 if (part == 0) {
1244 osname << "logical" << "AlEcEast";
1245 }
1246 else if (part == 2){
1247 osname << "logical" << "AlEcWest";
1248 }
1249 else {
1250 if (part == 1) {
1251 osname << "logical" << "AlBr" << layer+1;
1252 }
1253 }
1254 return GetLogicalVolume( osname.str() );
1255}
TGeoVolume * GetLogicalVolume(const std::string &vn)
Get a logical volume by name;.

Referenced by SetVolumeDefaultVis().

◆ GetVolumeAssembly()

TGeoVolumeAssembly * TofROOTGeo::GetVolumeAssembly ( int  part)

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

Definition at line 199 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

200{
201 std::stringstream osname;
202 if (part == 0 || part == 2) {
203 osname << "logical" << "Tof" << "AssemblyEc";
204 }
205 else {
206 if (part == 1) {
207 osname << "logical" << "Tof" << "AssemblyBr";
208 }
209 }
210
211 return GetAssemblyVolume( osname.str() );
212}
TGeoVolumeAssembly * GetAssemblyVolume(const std::string &an)
Get an assembly by name;.

◆ GetVolumeBucket() [1/2]

TGeoVolume * TofROOTGeo::GetVolumeBucket ( int  part)

Get bucket volume;.

Definition at line 231 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

232{
233 std::stringstream osname;
234 if (part == 0 || part == 2) {
235 osname << "logical" << "Tof" << "BucketEc";
236 }
237 else {
238 if (part == 1) {
239 osname << "logical" << "Tof" << "BucketBr";
240 }
241 }
242
243 return GetLogicalVolume( osname.str() );
244}

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

◆ GetVolumeBucket() [2/2]

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

Get bucket volume;.

Definition at line 1276 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1277{
1278 std::stringstream osname;
1279 if (part == 0 || part == 2) {
1280 osname << "logical" << "BucketEc";
1281 }
1282 else {
1283 if (part == 1) {
1284 osname << "logical" << "BucketBr" << layer+1;
1285 }
1286 }
1287 return GetLogicalVolume( osname.str() );
1288}

◆ GetVolumePart()

TGeoVolume * TofROOTGeo::GetVolumePart ( int  part)

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

Get part volume;

Definition at line 1206 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1207{
1208 std::stringstream osname;
1209 if (part == 1) {
1210 osname << "logicalBrTof";
1211 }
1212 else if (part == 0){
1213 osname << "logicalEcTofWest";
1214 }
1215 else {
1216 osname << "logicalEcTofEast";
1217 }
1218 return GetLogicalVolume( osname.str() );
1219}

Referenced by SetVolumeDefaultVis().

◆ GetVolumePVF()

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

Get PVF volume;.

Definition at line 1222 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1223{
1224 std::stringstream osname;
1225 if (part == 0) {
1226 osname << "logical" << "PVFEcEast";
1227 }
1228 else if (part == 2){
1229 osname << "logical" << "PVFEcWest";
1230 }
1231 else {
1232 if (part == 1) {
1233 osname << "logical" << "PVFBr" << layer+1;
1234 }
1235 }
1236 return GetLogicalVolume( osname.str() );
1237}

Referenced by SetVolumeDefaultVis().

◆ GetVolumeScin() [1/2]

TGeoVolume * TofROOTGeo::GetVolumeScin ( int  part)

Get scintillator volume;.

Definition at line 215 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

216{
217 std::stringstream osname;
218 if (part == 0 || part == 2) {
219 osname << "logical" << "Tof" << "ScinEc";
220 }
221 else {
222 if (part == 1) {
223 osname << "logical" << "Tof" << "ScinBr";
224 }
225 }
226
227 return GetLogicalVolume( osname.str() );
228}

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

◆ GetVolumeScin() [2/2]

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

Get scintillator volume;.

Definition at line 1258 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1259{
1260 std::stringstream osname;
1261 if (part == 0) {
1262 osname << "logical" << "ScinEcEast";
1263 }
1264 else if (part == 2){
1265 osname << "logical" << "ScinEcWest";
1266 }
1267 else {
1268 if (part == 1) {
1269 osname << "logical" << "ScinBr" << layer+1;
1270 }
1271 }
1272 return GetLogicalVolume( osname.str() );
1273}

◆ GetVolumeTof() [1/2]

TGeoVolume * TofROOTGeo::GetVolumeTof ( )
inline

Get Tof volume;.

Definition at line 62 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/ROOTGeo/TofROOTGeo.h.

62{ return m_Tof; }

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

◆ GetVolumeTof() [2/2]

TGeoVolume * TofROOTGeo::GetVolumeTof ( )
inline

Get Tof volume;.

Definition at line 117 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/BesVisLib/TofROOTGeo.h.

117{ return m_Tof; }

◆ Init2DGeometry()

void TofROOTGeo::Init2DGeometry ( )

Initialize 2D Geometry.

Definition at line 156 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

157{
158 if (m_ROOTGeoInit != 1 && m_ROOTGeoInit != 2)
159 {
160 cout << "TofROOTGeo::Init2DGeometry, ROOT Geometry not Initialized yet!" << endl;
161 return;
162 }
163 m_2DGeoInit = 1;
164
165 Double_t local[3] = {0.0, 0.0, 0.0};
166 Double_t master[3] = {0.0, 0.0, 0.0};
167 //Int_t nPoints = 8;
168 //Double_t P[300] = {0.0};
169 //Double_t center[3] = {0.0, 0.0, 0.0};
170 TString name;
171
172 //Huang Shuhui's update: Tof Mrpc
173 if (fTofMrpc)
174 {
175 for (Int_t part = 0; part < m_kPart; part++)
176 {
177 if (part == 1)
178 {
179 for (Int_t layer = 0; layer < GetLayerNb(part); layer++)
180 {
181 for (int scin = 0; scin < GetScinNb(part); scin++)
182 {
183 TGeoPhysicalNode *scinPhyNode = GetPhysicalScin(part, layer, scin);
184 if (part == 1)
185 {
186 name = TString("Tof Part 1");
187 name += " Layer ";
188 name += layer;
189 name += " Phi ";
190 name += scin;
191 }
192 TGeoArb8 *scinShape = (TGeoArb8*)scinPhyNode->GetShape();
193 Double_t *localArb8Point, masterArb8Point[24];
194 localArb8Point = scinShape->GetVertices();
195
196 for (Int_t i = 0; i < 8; i++)
197 {
198 local[0] = localArb8Point[2*i];
199 local[1] = localArb8Point[2*i+1];
200 if (i < 4) local[2] = scinShape->GetDz() * (-1.0);
201 else local[2] = scinShape->GetDz();
202
203 //cout << i << " local x: " << local[0] << " y: " << local[1] << " z: " << local[2] << endl;
204 scinPhyNode->GetMatrix(-1*scinPhyNode->GetLevel())->LocalToMaster(local, &master[0]); // transform to top
205 //cout << " master x: " << master[0] << " y: " << master[1] << " z: " << master[2] << endl;
206
207 for (Int_t j = 0; j < 3; j++) {
208 masterArb8Point[3*i+j] = master[j];
209 }
210 }
211
212 m_Tof2DScin[part][layer][scin] = new Tof2DScin(name, name, 8, &masterArb8Point[0], part);
213 }//scin
214 }//layer
215 }//part = 1
216 else
217 {
218 for (int module = 0; module < GetModuleNb(part); module++)
219 {
220 for (int strip = 0; strip < GetStripNb(part); strip++)
221 {
222 TGeoPhysicalNode *mrpcPhyNode = GetPhysicalScin(part, module, strip);
223 if (part == 0)
224 {
225 name = TString("EastEc");
226 name = TString("Tof Part");
227 name += part;
228 name += " Module ";
229 name += module;
230 name += " Strip ";
231 name += strip;
232 }
233 else if (part == 2)
234 {
235 name = TString("WestEc");
236 name = TString("Tof Part");
237 name += part;
238 name += " Module ";
239 name += module;
240 name += " Strip ";
241 name += strip;
242 }
243
244 TGeoTrd2 *mrpcShape = (TGeoTrd2*)mrpcPhyNode->GetShape();
245
246 Double_t x1, x2, y1, y2, z;
247 x1 = mrpcShape->GetDx1();
248 x2 = mrpcShape->GetDx2();
249 y1 = mrpcShape->GetDy1() * 500;// *500, make mrpc thick in ZR view
250 y2 = mrpcShape->GetDy2() * 500;// *500, make mrpc thick in ZR view
251 z = mrpcShape->GetDz();
252 Double_t masterArb8Point[24];
253
254 for (Int_t i =0; i < 8; i++)
255 {
256 if (i == 0) { local[0] = -x1; local[1] = -y1; local[2] = -z; }
257 else if (i == 4) { local[0] = -x1; local[1] = y1; local[2] = -z; }
258 else if (i == 7) { local[0] = x1; local[1] = y1; local[2] = -z; }
259 else if (i == 3) { local[0] = x1; local[1] = -y1; local[2] = -z; }
260 else if (i == 1) { local[0] = -x2; local[1] = -y2; local[2] = z; }
261 else if (i == 5) { local[0] = -x2; local[1] = y2; local[2] = z; }
262 else if (i == 6) { local[0] = x2; local[1] = y2; local[2] = z; }
263 else if (i == 2) { local[0] = x2; local[1] = -y2; local[2] = z; }
264
265 mrpcPhyNode->GetMatrix(-1*mrpcPhyNode->GetLevel())->LocalToMaster(local, &master[0]);// transform to top
266 for (Int_t j = 0; j < 3; j++) {
267 masterArb8Point[3*i+j] = master[j];
268 }
269 }
270
271 m_Tof2DScin[part][module][strip] = new Tof2DScin(name, name, 8, &masterArb8Point[0], part);
272 }//strip
273 }//module
274 }//part = 0/2
275 }//part
276 }
277 else //Old Tof Geometry
278 {
279 // Tof Scintillators
280 for (Int_t part = 0; part < m_kPart; part++)
281 {
282 for (Int_t layer = 0; layer < GetLayerNb(part); layer++)
283 {
284 for (int scin = 0; scin < GetScinNb(part); scin++)
285 {
286 TGeoPhysicalNode *scinPhyNode = GetPhysicalScin(part, layer, scin);
287 if (part == 1)
288 {
289 name = TString("Tof Part 1");
290 name += " Layer ";
291 name += layer;
292 name += " Phi ";
293 name += scin;
294 }
295 else
296 {
297 if (part == 0) name = TString("EastEc");
298 else if (part == 2) name = TString("WestEc");
299 name = TString("Tof Part ");
300 name += part;
301 name += " Phi ";
302 name += scin;
303 }
304 TGeoArb8 *scinShape = (TGeoArb8*)scinPhyNode->GetShape();
305 Double_t *localArb8Point, masterArb8Point[24];
306 localArb8Point = scinShape->GetVertices();
307
308 for (Int_t i = 0; i < 8; i++)
309 {
310 local[0] = localArb8Point[2*i];
311 local[1] = localArb8Point[2*i+1];
312 if (i < 4) local[2] = scinShape->GetDz() * (-1.0);
313 else local[2] = scinShape->GetDz();
314
315 //cout << i << " local x: " << local[0] << " y: " << local[1] << " z: " << local[2] << endl;
316 scinPhyNode->GetMatrix(-1*scinPhyNode->GetLevel())->LocalToMaster(local, &master[0]); // transform to top
317 //cout << " master x: " << master[0] << " y: " << master[1] << " z: " << master[2] << endl;
318
319 for (Int_t j = 0; j < 3; j++) {
320 masterArb8Point[3*i+j] = master[j];
321 }
322 }
323
324 m_Tof2DScin[part][layer][scin] = new Tof2DScin(name, name, 8, &masterArb8Point[0], part);
325 }
326 } //scin
327 } //layer
328 } //part
329}

Referenced by BesGeometry::InitGeometry().

◆ InitFromGdml()

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

Initialize the instance of ROOTGeo.

Definition at line 39 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

40{
41 ReadGdml(gdmlFile, setupName);
42 SetNode();
44
45 m_ROOTGeoInit = 1;
46}
void ReadGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of ROOTGeo.
void SetDefaultVis()
Set default visual attributes;.
void SetNode()
Set the pointers to theirs nodes;.

◆ InitFromGDML()

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

Initialize ROOTGeo from GDML.

Definition at line 126 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

127{
128 m_ROOTGeoInit = 2;
129
130 //Huang Shuhui's update: Load in Tof_mrpc Gdml Geometry, set fTofMrpc flag
131 fTofMrpc = 0;
132 if (TString(gdmlFile).Contains("Tof_mrpc.gdml")) fTofMrpc = 1;
133 else cout << "Cannot read Tof_mrpc!" << endl;
134 if (fTofMrpc) cout << "fTofMrpc: " << "Using new Geometry of Tof!" << endl;
135
136 ReadGdml(gdmlFile, setupName);
137 SetNode();
138}

Referenced by BesGeometry::InitFromGDML().

◆ InitFromROOT()

void TofROOTGeo::InitFromROOT ( TGeoVolume *  vol)

Initialize ROOTGeo from TGeoVolume logicalTof.

Definition at line 141 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

142{
143 m_ROOTGeoInit = 1;
144
145 //Huang Shuhui's update: To judge MRPC
146 fTofMrpc = 0;
147 TGeoNode *contianer = vol->GetNode(0)->GetVolume()->GetNode(0);
148 if (TString(contianer->GetName()).Contains("container")) fTofMrpc = 1;
149 if (fTofMrpc) cout << "fTofMrpc: " << "Using new Geometry of Tof!" << endl;
150
151 SetVolumeTof(vol);
152 SetNode();
153}
void SetVolumeTof(TGeoVolume *vol)
Set Tof volume, while initializing from ROOT;.

Referenced by BesGeometry::InitFromROOT().

◆ SetAllVisible() [1/2]

void TofROOTGeo::SetAllVisible ( )

Set all visible;.

Definition at line 110 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

111{
112 for (int part = 0; part < m_kPart; part++) {
113 GetVolumeScin(part)->SetVisibility(1);
114 GetVolumeBucket(part)->SetVisibility(1);
115
116 int nScin = 0;
117 if (part == 1) nScin = m_kAssemblyBr;
118 else nScin = m_kAssemblyEc;
119 for (int scin = 0; scin < nScin; scin++) {
120 GetScin(part, scin)->SetVisibility(1);
121
122 int nBucket = 0;
123 if (part == 1) nBucket = m_kBucketBr;
124 else nBucket = m_kBucketEc;
125 for (int bucket = 0; bucket < nBucket; bucket++) {
126 GetBucket(part, scin, bucket)->SetVisibility(1);
127 }
128 }
129 }
130}
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;.

◆ SetAllVisible() [2/2]

void TofROOTGeo::SetAllVisible ( )

Set all visible;.

◆ SetDefaultVis()

void TofROOTGeo::SetDefaultVis ( )

Set default visual attributes;.

Definition at line 76 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

77{
78 //std::cout << "begin of set defaultvis" << std::endl;
79 int tofColor = 2;
80 int scinColor = 6;
81 int bucketColor = 4;
82
83 m_Tof->SetLineColor(tofColor);
84 m_Tof->SetVisibility(0);
85
86 for (int part = 0; part < m_kPart; part++) {
87 GetVolumeScin(part)->SetLineColor(scinColor);
88 GetVolumeScin(part)->SetVisibility(1);
89 GetVolumeBucket(part)->SetLineColor(bucketColor);
90 GetVolumeBucket(part)->SetVisibility(0);
91
92 int nScin = 0;
93 if (part == 1) nScin = m_kAssemblyBr;
94 else nScin = m_kAssemblyEc;
95 for (int scin = 0; scin < nScin; scin++) {
96 GetScin(part, scin)->SetVisibility(0);
97
98 int nBucket = 0;
99 if (part == 1) nBucket = m_kBucketBr;
100 else nBucket = m_kBucketEc;
101 for (int bucket = 0; bucket < nBucket; bucket++) {
102 GetBucket(part, scin, bucket)->SetVisibility(0);
103 }
104 }
105 }
106 //std::cout << "end of set defaultvis" << std::endl;
107}

Referenced by InitFromGdml().

◆ SetDetector()

void TofROOTGeo::SetDetector ( )

Draw Detecor (what is detector depends on you)

Definition at line 819 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

820{
821 BesView *view = 0;
822 if (gPad) view = dynamic_cast<BesView*>(gPad->GetView());
823 //if (view) cout << "viewVisFull3DTof " << view->GetVisFull3DTof() << endl;
824 m_DetectorsArray->Clear();
825
826 //Long Peixun's update: for Tof Mrpc
827 if (fTofMrpc)
828 {
829 for (int part = 0; part < m_kPart; part++)
830 {
831 if (part == 1)
832 {
833 for (int layer = 0; layer < GetLayerNb(part); layer++)
834 {
835 for (int scin = 0; scin < GetScinNb(part); scin++)
836 {
837 TGeoPhysicalNode *phyNode = 0;
838 phyNode = GetPhysicalScin(part, layer, scin);
839 if (phyNode)
840 {
841 phyNode->SetVisibility(0); // set all invisible before set any visible
842 m_DetectorsArray->Add( phyNode );
843 }
844 }
845 }
846 }
847 else
848 {
849 for (int module = 0; module < GetModuleNb(part); module++)
850 {
851 for (int strip = 0; strip < GetStripNb(module); strip++)
852 {
853 TGeoPhysicalNode *phyNode = 0;
854 phyNode = GetPhysicalScin(part, module, strip);
855 if (phyNode)
856 {
857 phyNode->SetVisibility(0); // set all invisible before set any visible
858 m_DetectorsArray->Add( phyNode );
859 }
860 }
861 }
862 }
863 }
864 }
865 else
866 {
867 for (int part = 0; part < m_kPart; part++)
868 {
869 for (int layer = 0; layer < GetLayerNb(part); layer++)
870 {
871 for (int scin = 0; scin < GetScinNb(part); scin++)
872 {
873 TGeoPhysicalNode *phyNode = 0;
874 phyNode = GetPhysicalScin(part, layer, scin);
875 if (phyNode)
876 {
877 phyNode->SetVisibility(0); // set all invisible before set any visible
878 //Long Peixun's update: Remove useless judgement
879 // if (part == 2 ||
880 // (scin >= GetScinNb(part)*0/4 && scin < GetScinNb(part)*8/8)) {
881 m_DetectorsArray->Add( phyNode );
882 // }
883 // else if (view && view->GetVisFull3DTof()) {
884 // m_DetectorsArray->Add( phyNode );
885 // }
886 }
887 }
888 }
889 }
890 }
891}

Referenced by BesClient::HandleViewOptionMenu().

◆ SetHalfVisible()

void TofROOTGeo::SetHalfVisible ( )

Set half visible;.

Definition at line 664 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

665{
666 /*
667 for (int part = 0; part < m_kPart; part++) {
668 GetVolumeScin(part)->SetVisibility(1);
669 GetVolumeBucket(part)->SetVisibility(1);
670
671 int nScin = 0;
672 if (part == 1) nScin = m_kAssemblyBr;
673 else nScin = m_kAssemblyEc;
674 for (int scin = 0; scin < nScin; scin++) {
675 if (scin < nScin/4+1 ||
676 scin > nScin*3/4 ) GetScin(part, scin)->SetVisibility(1);
677 else GetScin(part, scin)->SetVisibility(0);
678
679 int nBucket = 0;
680 if (part == 1) nBucket = m_kBucketBr;
681 else nBucket = m_kBucketEc;
682 for (int bucket = 0; bucket < nBucket; bucket++) {
683 if (scin < nScin/4+1 ||
684 scin > nScin*3/4 ) GetBucket(part, scin, bucket)->SetVisibility(1);
685 else GetBucket(part, scin, bucket)->SetVisibility(0);
686 }
687 }
688 }
689 */
690}

◆ SetHits()

void TofROOTGeo::SetHits ( )

Set all physicalNodes corresponding to digiCol;.

Definition at line 921 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

922{
923 // set previous event hits to default vis
924 //Long Peixun's update: move to ClearHits()
925 ClearHits();
926
927 //Long Peixun's update: Consider gEvent == NULL
928 int NDigiCol = 0;
929 if (gEvent)
930 {
931 m_TofDigiCol = gEvent->GetTofDigiCol();
932 //Long Peixun's update: Consider m_TofDigiCol == NULL
933 if (m_TofDigiCol) NDigiCol = m_TofDigiCol->GetEntries();
934 else NDigiCol = 0;
935 }
936
937 for (int i = 0; i < NDigiCol; i++)
938 {
939 TTofDigi *aTofDigi = (TTofDigi*)m_TofDigiCol->At(i);
940 Identifier atofID(aTofDigi->getIntId());
941 int part, layer, scin;
942
943 if (fTofMrpc)
944 { //Huang Shuhui's update: for Tof_mrpc hits
945 part = TofID::barrel_ec(atofID);
946 if (part == 1)
947 {
948 layer = TofID::layer(atofID);
949 scin = TofID::phi_module(atofID);
950 }
951 else
952 {
953 //In BOSS 7.0.3
954 // int part_Ec = TofID::endcap(atofID);
955 // if (part_Ec == 0) part = 0;
956 // else part = 2;
957 // layer = TofID::module(atofID);
958 // scin = TofID::strip(atofID);
959
960 //In CgemBOSS 6.6.5.b
961 int part_Ec = TofID::end(atofID);
962 if (part_Ec == 0) part = 0;
963 else part = 2;
964 layer = TofID::layer(atofID);
965 scin = TofID::phi_module(atofID);
966 }
967 }
968 else
969 {
970 part = TofID::barrel_ec(atofID);
971 layer = TofID::layer(atofID);
972 scin = TofID::phi_module(atofID);
973 }
974
975 //Long Peixun has a question: Do we need to divide by TOF_*_FACTOR?
976 Double_t charge = Double_t(aTofDigi->getChargeChannel()) / TOF_CHARGE_FACTOR;
977 Double_t time = Double_t(aTofDigi->getTimeChannel()) / TOF_TIME_FACTOR;
978 //Double_t charge = RawDataUtil::TofCharge(aTofDigi->getChargeChannel());
979 //Double_t time = RawDataUtil::TofTime(aTofDigi->getTimeChannel());
980
981 //Long Peixun's update: the element type of m_HitsArray is replaced by TofPhysicalPointer
982 TofPhysicalPointer* PphyNode = 0;
983 PphyNode = &m_PhysicalScin[part][layer][scin];
984 if (PphyNode) {
985 PphyNode->setTimeChannel(aTofDigi->getTimeChannel());
986 PphyNode->setChargeChannel(aTofDigi->getChargeChannel());
987 m_HitsArray->Add(PphyNode);
988 }
989
990 Tof2DScin *aScin = 0;
991 aScin = m_Tof2DScin[part][layer][scin];
992 if (aScin)
993 {
994 char data[100];
995
996 if (fTofMrpc)
997 { //Huang Shuhui's update: for Tof_mrpc hits
998 if (part != 1)
999 {
1000 if (aScin->GetCharge() == 0.0)
1001 {
1002 aScin->ClearInfo();
1003 aScin->AddInfo(aScin->GetTitle());
1004 //Long Peixun's update: Subscript index
1005 sprintf(data, "t_{leading1} = %-.3f ns, t_{trailing1} = %-.3f ns", time, charge);
1006 aScin->AddInfo( TString(data) );
1007 }
1008 else
1009 {
1010 //Long Peixun's update: Subscript index
1011 sprintf(data, "t_{leading2} = %-.3f ns, t_{trailing2} = %-.3f ns", time, charge);
1012 aScin->AddInfo( TString(data) );
1013 sprintf(data, "Fired");
1014 aScin->AddInfo( TString(data) );
1015 }
1016 }
1017 else
1018 {
1019 if (aScin->GetCharge() == 0.0)
1020 {
1021 aScin->ClearInfo();
1022 aScin->AddInfo(aScin->GetTitle());
1023 sprintf(data, "time1 = %-.3f ns, charge1 = %-.3f MeV", time, charge);
1024 aScin->AddInfo( TString(data) );
1025 }
1026 else
1027 {
1028 sprintf(data, "time2 = %-.3f ns, charge2 = %-.3f MeV", time, charge);
1029 aScin->AddInfo( TString(data) );
1030 sprintf(data, "Fired");
1031 aScin->AddInfo( TString(data) );
1032 }
1033 }
1034 }
1035 else
1036 {
1037 if (aScin->GetCharge() == 0.0)
1038 {
1039 aScin->ClearInfo();
1040 aScin->AddInfo(aScin->GetTitle());
1041 sprintf(data, "time1 = %-.3f ns, charge1 = %-.3f MeV", time, charge);
1042 aScin->AddInfo( TString(data) );
1043 }
1044 else
1045 {
1046 sprintf(data, "time2 = %-.3f ns, charge2 = %-.3f MeV", time, charge);
1047 aScin->AddInfo( TString(data) );
1048 sprintf(data, "Fired");
1049 aScin->AddInfo( TString(data) );
1050 }
1051 }
1052
1053 aScin->CloseInfo();
1054 aScin->SetCharge(aScin->GetCharge() + charge);
1055 //Long Peixun's update: Set raw channel data of aScin
1056 aScin->SetTimeChannel(aTofDigi->getTimeChannel());
1057 aScin->SetChargeChannel(aTofDigi->getChargeChannel());
1058 m_2DHitsArray->Add(aScin);
1059 }
1060 }
1061}
R__EXTERN BesEvent * gEvent
Definition: BesEvent.h:318
TTree * data
Double_t time
const TObjArray * GetTofDigiCol() const
Definition: BesEvent.h:110
UInt_t getIntId() const
Definition: TRawData.cxx:50
UInt_t getChargeChannel() const
Definition: TRawData.cxx:60
UInt_t getTimeChannel() const
Definition: TRawData.cxx:55
virtual Double_t GetCharge()
Definition: Tof2DScin.h:42
void SetTimeChannel(UInt_t tc)
Definition: Tof2DScin.h:55
virtual void SetCharge(Double_t charge)
Definition: Tof2DScin.h:40
void SetChargeChannel(UInt_t cc)
Definition: Tof2DScin.h:56
static int end(const Identifier &id)
Definition: TofID.cxx:129
static int phi_module(const Identifier &id)
Definition: TofID.cxx:117
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
Definition: TofID.cxx:95
static int layer(const Identifier &id)
Definition: TofID.cxx:109
void setChargeChannel(UInt_t scc)
void setTimeChannel(UInt_t stc)

Referenced by BesEvent::SetHits().

◆ SetNode() [1/2]

void TofROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

Definition at line 49 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

50{
51 m_Tof = GetTopVolume();
52 if(!m_Tof) std::cout << "m_Tof = 0" << std::endl;
53
54 for (int part = 0; part < m_kPart; part++) {
55 int nScin = 0;
56 if (part == 1) nScin = m_kAssemblyBr;
57 else nScin = m_kAssemblyEc;
58 for (int scin = 0; scin < nScin; scin++) {
59 std::stringstream osname;
60 if (part == 0) {
61 osname << "pv_" << "logical" << "Tof" << "ScinEc" << "_" << m_kAssemblyBr + m_kAssemblyEc + scin << "_0";
62 }
63 else if (part == 1) {
64 osname << "pv_" << "logical" << "Tof" << "ScinBr" << "_" << scin << "_0";
65 }
66 else if (part == 2) {
67 osname << "pv_" << "logical" << "Tof" << "ScinEc" << "_" << m_kAssemblyBr + scin << "_0";
68 }
69
70 m_NodeScin[part][scin] = GetNode( osname.str() );
71 }
72 }
73}

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

◆ SetNode() [2/2]

void TofROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

◆ SetNoEndVisible()

void TofROOTGeo::SetNoEndVisible ( )

Set noend visible;.

Definition at line 693 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

694{
695 /*
696 int part = 1;
697 GetVolumeScin(0)->SetVisibility(1);
698 GetVolumeBucket(0)->SetVisibility(1);
699
700 int nScin = 0;
701 nScin = m_kAssemblyBr;
702 for (int scin = 0; scin < nScin; scin++) {
703 GetScin(part, scin)->SetVisibility(1);
704
705 int nBucket = 0;
706 nBucket = m_kBucketBr;
707 for (int bucket = 0; bucket < nBucket; bucket++) {
708 GetBucket(part, scin, bucket)->SetVisibility(1);
709 }
710 }
711 */
712}

◆ SetPhysicalDefaultVis()

void TofROOTGeo::SetPhysicalDefaultVis ( )

Definition at line 566 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

567{
568 if (fTofMrpc)
569 { //Tof with MRPC
570 for (int part = 0; part < m_kPart; part++)
571 {
572 if (part == 1)
573 {
574 for (int layer = 0; layer < GetLayerNb(part); layer++)
575 {
576 for (int scin = 0; scin < GetScinNb(part); scin++)
577 GetPhysicalScin(part, layer, scin)->SetLineColor(m_ScinColor);
578 }
579 }
580 else
581 {
582 for (int module = 0; module < GetModuleNb(part); module++)
583 {
584 for (int strip = 0; strip < GetStripNb(module); strip++)
585 GetPhysicalScin(part, module, strip);
586 }
587 }
588 }
589 }
590 else
591 { //Old Tof
592 for (int part = 0; part < m_kPart; part++)
593 {
594 for (int layer = 0; layer < GetLayerNb(part); layer++)
595 {
596 for (int scin = 0; scin < GetScinNb(part); scin++)
597 GetPhysicalScin(part, layer, scin)->SetLineColor(m_ScinColor);
598 }
599 }
600 }
601}

Referenced by BesGeometry::Draw3D(), and BesGeometry::SetPhysicalDefaultVis().

◆ SetPhysicalNode() [1/2]

void TofROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

Definition at line 158 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

159{
160 int scinColor = 6;
161
162 if (gGeoManager == 0) std::cout << "Create gGeoManager first" << std::endl;
163 TGeoNode *bes = gGeoManager->GetTopNode();
164 //std::cout << "m_childNo " << m_childNo << std::endl;
165 TGeoNode *tof = bes->GetDaughter(m_childNo);
166
167 for (int part = 0; part < m_kPart; part++) {
168 int nScin = 0;
169 if (part == 1) nScin = m_kAssemblyBr;
170 else nScin = m_kAssemblyEc;
171 for (int scin = 0; scin < nScin; scin++) {
172 TGeoNode *nodeScin = GetScin(part, scin);
173 m_PhysicalScin[part][scin] = gGeoManager->MakePhysicalNode( TString("/") + bes->GetName() +
174 TString("/") + tof->GetName() +
175 TString("/") + nodeScin->GetName() );
176 m_PhysicalScin[part][scin]->SetVisibility(0);
177 m_PhysicalScin[part][scin]->SetIsVolAtt(kFALSE);
178 m_PhysicalScin[part][scin]->SetLineColor(scinColor);
179 }
180 }
181}

Referenced by BesGeometry::InitGeometry().

◆ SetPhysicalNode() [2/2]

void TofROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

◆ SetQMatch()

void TofROOTGeo::SetQMatch ( Bool_t  input = false)

Definition at line 609 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

609 {
610 k_QMatch = input;
611}

◆ SetQuarterVisible() [1/2]

void TofROOTGeo::SetQuarterVisible ( )

Set quater visible;.

Definition at line 133 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

134{
135 for (int part = 0; part < m_kPart; part++) {
136 GetVolumeScin(part)->SetVisibility(1);
137 GetVolumeBucket(part)->SetVisibility(1);
138
139 int nScin = 0;
140 if (part == 1) nScin = m_kAssemblyBr;
141 else nScin = m_kAssemblyEc;
142 for (int scin = 0; scin < nScin; scin++) {
143 if (scin < nScin/4) GetScin(part, scin)->SetVisibility(0);
144 else GetScin(part, scin)->SetVisibility(1);
145
146 int nBucket = 0;
147 if (part == 1) nBucket = m_kBucketBr;
148 else nBucket = m_kBucketEc;
149 for (int bucket = 0; bucket < nBucket; bucket++) {
150 if (scin < nScin/4) GetBucket(part, scin, bucket)->SetVisibility(0);
151 else GetBucket(part, scin, bucket)->SetVisibility(1);
152 }
153 }
154 }
155}

◆ SetQuarterVisible() [2/2]

void TofROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetTMatch()

void TofROOTGeo::SetTMatch ( Bool_t  input = false)

Definition at line 604 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

604 {
605 k_TMatch = input;
606}

◆ SetVisTofDetector()

void TofROOTGeo::SetVisTofDetector ( )

Set Tof detector visibility;.

Definition at line 1064 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1065{
1066 /*
1067 for (int part = 0; part < m_kPart; part++) {
1068 for (int layer = 0; layer < GetLayerNb(part); layer++) {
1069 for (int scin = 0; scin < GetScinNb(part); scin++) {
1070 TGeoPhysicalNode *phyNode = GetPhysicalScin(part, layer, scin);
1071 if (phyNode) phyNode->SetLineColor(m_ScinColor);
1072 }
1073 }
1074 }
1075 */
1076
1077 BesView *view = 0;
1078 if (gPad) view = dynamic_cast<BesView*>(gPad->GetView());
1079
1080 //cout << "VisTofEast " << view->GetVisTofEast() << endl;
1081 for (int i = 0; i < m_DetectorsArray->GetEntries(); i++)
1082 {
1083 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_DetectorsArray->At(i);
1084 phyNode->SetVisibility(0);
1085 if (view && view->GetVisTofGlobal())
1086 {
1087 int part = GetPart(phyNode);
1088 if (part == 0 && view->GetVisTofEast() ||
1089 part == 1 && view->GetVisTofBarrel() ||
1090 part == 2 && view->GetVisTofWest() )
1091 phyNode->SetVisibility(1);
1092 }
1093 }
1094}
Int_t GetPart(TGeoPhysicalNode *phyNode)
Get part no of a scintillator physcial node.

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

◆ SetVisTofHits()

void TofROOTGeo::SetVisTofHits ( )

Set Tof hits visibility;.

Definition at line 1097 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

1098{
1099 BesView *view = 0;
1100 if (gPad) view = dynamic_cast<BesView*>(gPad->GetView());
1101
1102 //Long Peixun's update: the element type of m_HitsArray is replaced by TofPhysicalPointer
1103 for (int i = 0; i < m_HitsArray->GetEntries(); i++)
1104 {
1106 if (PphyNode)
1107 {
1108 int part = GetPart(PphyNode->get());
1109 if (view && view->GetVisTofHitsGlobal())
1110 {
1111 //Long Peixun's update: consider Match
1112 if ((k_TMatch) && (PphyNode->getTimeChannel() == 0x7FFFFFFF))
1113 continue;
1114 if ((k_QMatch) && (PphyNode->getChargeChannel() == 0x7FFFFFFF))
1115 continue;
1116
1117 if (part == 0 && view->GetVisTofHitsEast() ||
1118 part == 1 && view->GetVisTofHitsBarrel() ||
1119 part == 2 && view->GetVisTofHitsWest() )
1120 {
1121 (*PphyNode)->SetVisibility(1);
1122 (*PphyNode)->SetLineColor(801); //Long Peixun's update: Green -> Orange
1123 continue;
1124 }
1125 }
1126 //Long Peixun's update: Unfired visibility should be determined by Detector option rather than His option
1127 if (part > -1) (*PphyNode)->SetLineColor(m_ScinColor);
1128 }
1129 }
1130}
TGeoPhysicalNode * get() const
UInt_t getTimeChannel() const
UInt_t getChargeChannel() const

Referenced by BesGeometry::Draw3D().

◆ SetVolumeDefaultVis()

void TofROOTGeo::SetVolumeDefaultVis ( )

Set default visual attributes;.

Definition at line 538 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/TofROOTGeo.cxx.

539{
540 //std::cout << "begin of set defaultvis" << std::endl;
541
542 m_Tof->SetLineColor(m_TofColor);
543 m_Tof->SetVisibility(0);
544
545 for (int part = 0; part < m_kPart; part++) {
546 GetVolumePart(part)->SetLineColor(m_ScinColor);
547 GetVolumePart(part)->SetVisibility(0);
548 for (int layer = 0; layer < GetLayerNb(part); layer++) {
549 GetVolumePVF(part, layer)->SetLineColor(m_ScinColor);
550 GetVolumePVF(part, layer)->SetVisibility(0);
551
552 GetVolumeAl(part, layer)->SetLineColor(m_ScinColor);
553 GetVolumeAl(part, layer)->SetVisibility(0);
554
555 GetVolumeScin(part, layer)->SetLineColor(m_ScinColor);
556 GetVolumeScin(part, layer)->SetVisibility(0);
557
558 GetVolumeBucket(part, layer)->SetLineColor(m_BucketColor);
559 GetVolumeBucket(part, layer)->SetVisibility(0);
560 }
561 }
562 //std::cout << "end of set defaultvis" << std::endl;
563}
TGeoVolume * GetVolumeAl(int part, int layer)
Get Al volume;.
TGeoVolume * GetVolumePart(int part)
Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;
TGeoVolume * GetVolumePVF(int part, int layer)
Get PVF volume;.

◆ SetVolumeTof()

void TofROOTGeo::SetVolumeTof ( TGeoVolume *  vol)
inline

Set Tof volume, while initializing from ROOT;.

Definition at line 114 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/BesVisLib/TofROOTGeo.h.

114{ m_Tof = vol; }

Referenced by InitFromROOT().


The documentation for this class was generated from the following files: