BOSS 7.0.6
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 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

◆ Draw()

void TofROOTGeo::Draw ( Option_t *  option)

Draw function.

Definition at line 1408 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1409{
1410 TString opt = option;
1411 opt.ToUpper();
1412
1413 if (!m_2DGeoInit) cout << "TofROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
1414 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1415 if (!view) cout << "TofROOTGeo::Draw(), BesView not found" << endl;
1416
1417 if (view->GetVisTofGlobal())
1418 { // TofVisGlobal
1419 TString scinOpt;
1420
1421 //if (opt.Contains("XY")) {
1422 // west part drawn first usually
1423 for (Int_t part = m_kPart-1; part >= 0; part--)
1424 {
1425 for (Int_t layer = 0; layer < GetLayerNb(part); layer++)
1426 {
1427 for (int scin = 0; scin < GetScinNb(part); scin++)
1428 {
1429 if (m_Tof2DScin[part][layer][scin])
1430 {
1431 //cout << "part " << part << " layer " << layer << " scin " << scin << endl;
1432 //m_Tof2DScin[part][layer][scin]->SetHighlighted(false);
1433 m_Tof2DScin[part][layer][scin]->SetFired(false);
1434 if ( (part == 0 && view->GetVisTofEast()) ||
1435 (part == 1 && view->GetVisTofBarrel()) ||
1436 (part == 2 && view->GetVisTofWest()) )
1437 m_Tof2DScin[part][layer][scin]->Draw(scinOpt);
1438 }
1439 }
1440 }
1441 }
1442 }
1443}
Bool_t GetVisTofBarrel()
Definition: BesView.h:123
Bool_t GetVisTofEast()
Definition: BesView.h:122
Bool_t GetVisTofGlobal()
Definition: BesView.h:121
Bool_t GetVisTofWest()
Definition: BesView.h:124
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 1446 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1447{
1448 // cout << "Draw Hits" << endl;
1449 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1450 if (!view) cout << "TofROOTGeo::DrawHits(), BesView not found" << endl;
1451
1452 //cout << "VisTofHitsGlobal " << view->GetVisTofHitsGlobal() << endl;
1453 //cout << "VisTofHitsEast " << view->GetVisTofHitsEast() << endl;
1454 //cout << "VisTofHitsBarrel " << view->GetVisTofHitsBarrel() << endl;
1455 //cout << "VisTofHitsWest " << view->GetVisTofHitsWest() << endl;
1456
1457 if (view->GetVisTofHitsGlobal())
1458 {
1459 //Long Peixun's update: Use m_2DHitsArray which contains ready hits rather than rebuild hits
1460 for (int i = 0; i < m_2DHitsArray->GetEntries(); ++i)
1461 {
1462 Tof2DScin* aScin = (Tof2DScin*)m_2DHitsArray->At(i);
1463 if (aScin)
1464 {
1465 if ((k_TMatch) && (aScin->GetTimeChannel() == 0x7FFFFFFF))
1466 continue;
1467 if ((k_QMatch) && (aScin->GetChargeChannel() == 0x7FFFFFFF))
1468 continue;
1469
1470 if ((aScin->GetPart() == 0 && view->GetVisTofHitsEast()) ||
1471 (aScin->GetPart() == 1 && view->GetVisTofHitsBarrel()) ||
1472 (aScin->GetPart() == 2 && view->GetVisTofHitsWest()) )
1473 {
1474 aScin->SetFired(true);
1475 aScin->Draw();
1476 }
1477 }
1478 }
1479
1480/* // reset time and charge to zero
1481 for (Int_t part = m_kPart-1; part >= 0; part--) {
1482 for (Int_t layer = 0; layer < GetLayerNb(part); layer++) {
1483 for (int scin = 0; scin < GetScinNb(part); scin++) {
1484 if (m_Tof2DScin[part][layer][scin]) {
1485 m_Tof2DScin[part][layer][scin]->ResetTimeCharge();
1486 }
1487 }
1488 }
1489 }
1490
1491 if (m_TofDigiCol) {
1492 for (int i = 0; i < m_TofDigiCol->GetEntries(); i++) {
1493 TTofDigi *aTofDigi = (TTofDigi*)m_TofDigiCol->At(i);
1494
1495 Identifier aTofID( aTofDigi->getIntId() );
1496 int part = TofID::barrel_ec( aTofID );
1497 int layer = TofID::layer( aTofID );
1498 int scin = TofID::phi_module( aTofID );
1499
1500 Double_t charge = Double_t(aTofDigi->getChargeChannel()) / TOF_CHARGE_FACTOR;
1501 //cout << "charge " << charge << endl;
1502
1503 Tof2DScin *aScin = 0;
1504 aScin = m_Tof2DScin[part][layer][scin];
1505 // Mdc TQMatch for example
1506 //
1507 //if (aWire &&
1508 // ((overflow == 0)||(overflow == 12))){
1509 // if ((k_TMatch) &&
1510 // (aMdcDigi->getTimeChannel() == 0x7FFFFFFF)){
1511 // continue;
1512 // }
1513 // if ((k_QMatch) &&
1514 // (aMdcDigi->getChargeChannel() == 0x7FFFFFFF)){
1515 // continue;
1516 // }
1517 //}
1518
1519 if (aScin) {
1520 if ((k_TMatch)&&
1521 (aTofDigi->getTimeChannel() == 0x7FFFFFFF)){
1522 continue;
1523 }
1524 if ((k_QMatch)&&
1525 (aTofDigi->getChargeChannel() == 0x7FFFFFFF)){
1526 continue;
1527 }
1528
1529 aScin->SetCharge(aScin->GetCharge() + charge);
1530
1531 if ( (part == 0 && view->GetVisTofHitsEast()) ||
1532 (part == 1 && view->GetVisTofHitsBarrel()) ||
1533 (part == 2 && view->GetVisTofHitsWest()) ) {
1534 aScin->SetFired(true);
1535 aScin->Draw();
1536 }
1537 }
1538 }
1539 } */
1540 }
1541}
Bool_t GetVisTofHitsWest()
Definition: BesView.h:203
Bool_t GetVisTofHitsGlobal()
Definition: BesView.h:200
Bool_t GetVisTofHitsBarrel()
Definition: BesView.h:202
Bool_t GetVisTofHitsEast()
Definition: BesView.h:201
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 1381 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1382{
1383 if (m_Tof2DScin[part][layer][scin]) return m_Tof2DScin[part][layer][scin];
1384 else return 0;
1385}

Referenced by BesEvent::ConstructTofTrackFromRec().

◆ GetAl()

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

Get Al node;.

Definition at line 1255 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1256{
1257 if (m_NodeAl[part][layer] != 0) {
1258 return m_NodeAl[part][layer];
1259 }
1260 else {
1261 std::cout << "Node: " << "Part" << part << "Layer" << layer << "Al" << " not found" << std::endl;
1262 return 0;
1263 }
1264 return m_NodeAl[part][layer];
1265}

◆ GetbareChamber()

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

Get bareChamber node;.

Definition at line 1307 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1308{
1309 if (m_NodebareChamber[part][module] != 0) {
1310 return m_NodebareChamber[part][module];
1311 }
1312 else {
1313 std::cout << "Node: " << "Part" << part << "Module" << module << "bareChamber" << " not found" << std::endl;
1314 return 0;
1315 }
1316
1317 return m_NodebareChamber[part][module];
1318}

◆ GetBoard1NodeNb()

int TofROOTGeo::GetBoard1NodeNb ( int  module)

Definition at line 1129 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1130{
1131 return m_kBoard1NodeNb;
1132}

◆ 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 1121 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1122{
1123 return m_kChamberNodeNb;
1124}

◆ GetContainerNodeNb()

int TofROOTGeo::GetContainerNodeNb ( int  module)

Definition at line 1125 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1126{
1127 return m_kContainerNodeNb;
1128}

◆ GetgasContainer()

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

Get gasContainer node;.

Definition at line 1294 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1295{
1296 if (m_NodegasContainer[part][module] != 0) {
1297 return m_NodegasContainer[part][module];
1298 }
1299 else {
1300 std::cout << "Node: " << "Part" << part << "Module" << module << "gasContainer" << " not found" << std::endl;
1301 return 0;
1302 }
1303
1304 return m_NodegasContainer[part][module];
1305}

◆ GetLayerNb()

int TofROOTGeo::GetLayerNb ( int  part)

Definition at line 1103 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1104{
1105 //Long Peixun's update: code optimization
1106 //Huang Shuhui's update: for Tof with MRPC
1107 if (part == 1) return m_kLayerBr;
1108 else
1109 {
1110 if (fTofMrpc) return m_kModuleEc;
1111 return m_kLayerEc;
1112 }
1113}

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

◆ GetModule()

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

Get module node;.

Definition at line 1282 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1283{
1284 if (m_NodeModule[part][module] != 0) {
1285 return m_NodeModule[part][module];
1286 }
1287 else {
1288 std::cout << "Node: " << "Part" << part << "Module" << module << " not found" << std::endl;
1289 return 0;
1290 }
1291 return m_NodeModule[part][module];
1292}

◆ GetModuleNb()

int TofROOTGeo::GetModuleNb ( int  part)

Definition at line 1117 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1118{
1119 return m_kModuleEc;
1120}

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

◆ GetMrpc()

bool TofROOTGeo::GetMrpc ( ) const
inline

Definition at line 40 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/TofROOTGeo.h.

40{ return fTofMrpc; }

◆ GetPart()

Int_t TofROOTGeo::GetPart ( TGeoPhysicalNode *  phyNode)

Get part no of a scintillator physcial node.

Definition at line 1388 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1389{
1390 for (Int_t part = 0; part < m_kPart; part++)
1391 {
1392 for (Int_t layer = 0; layer < GetLayerNb(part); layer++)
1393 {
1394 for (int scin = 0; scin < GetScinNb(part); scin++)
1395 {
1396 if (phyNode == GetPhysicalScin(part, layer, scin)) {
1397 //cout << "GetPart()" << part << endl;
1398 return part;
1399 }
1400 }
1401 }
1402 }
1403 cout << "TofROOTGeo::GetPart, this scintillator physical node does not exist!" << endl;
1404 return -1;
1405}
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 1320 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1321{
1322 if (m_NodepcbBoard1[part][module] != 0) {
1323 return m_NodepcbBoard1[part][module];
1324 }
1325 else {
1326 std::cout << "Node: " << "Part" << part << "Module" << module << "pcbBoard1" << " not found" << std::endl;
1327 return 0;
1328 }
1329
1330 return m_NodepcbBoard1[part][module];
1331}

◆ 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 1367 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1368{
1369 if (m_PhysicalScin[part][layer][scin] != 0) {
1370 return m_PhysicalScin[part][layer][scin];
1371 }
1372 else {
1373 std::cout << "PhysicalNode: " << "Part"
1374 << part << "Layer" << layer << "Scin"
1375 << scin << " not found" << std::endl;
1376 return 0;
1377 }
1378}

◆ 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(), SetHits(), SetPhysicalDefaultVis(), and BesVisDisplay::SetTofFiredCell().

◆ GetPVF()

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

Get PVF node;.

Definition at line 1242 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1243{
1244 if (m_NodePVF[part][layer][scin] != 0) {
1245 return m_NodePVF[part][layer][scin];
1246 }
1247 else {
1248 std::cout << "Node: " << "Part" << part << "Layer" << layer << "PVF" << scin << " not found" << std::endl;
1249 return 0;
1250 }
1251 return m_NodePVF[part][layer][scin];
1252}

◆ 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 1333 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1334{
1335 if (m_NodeStrip[part][module][strip] != 0) {
1336 return m_NodeStrip[part][module][strip];
1337 }
1338 else {
1339 std::cout << "Node: " << "Part" << part << "Module" << module << "Strip" << strip << " not found" << std::endl;
1340 return 0;
1341 }
1342
1343 return m_NodeStrip[part][module][strip];
1344}

◆ GetStripNb()

int TofROOTGeo::GetStripNb ( int  module)

Definition at line 1133 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1134{
1135 return m_kStripEc;
1136}

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

◆ GetVolumeAl()

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

Get Al volume;.

Definition at line 1191 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1192{
1193 std::stringstream osname;
1194 if (part == 0) {
1195 osname << "logical" << "AlEcEast";
1196 }
1197 else if (part == 2){
1198 osname << "logical" << "AlEcWest";
1199 }
1200 else {
1201 if (part == 1) {
1202 osname << "logical" << "AlBr" << layer+1;
1203 }
1204 }
1205 return GetLogicalVolume( osname.str() );
1206}
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 1227 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1228{
1229 std::stringstream osname;
1230 if (part == 0 || part == 2) {
1231 osname << "logical" << "BucketEc";
1232 }
1233 else {
1234 if (part == 1) {
1235 osname << "logical" << "BucketBr" << layer+1;
1236 }
1237 }
1238 return GetLogicalVolume( osname.str() );
1239}

◆ GetVolumePart()

TGeoVolume * TofROOTGeo::GetVolumePart ( int  part)

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

Get part volume;

Definition at line 1157 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1158{
1159 std::stringstream osname;
1160 if (part == 1) {
1161 osname << "logicalBrTof";
1162 }
1163 else if (part == 0){
1164 osname << "logicalEcTofWest";
1165 }
1166 else {
1167 osname << "logicalEcTofEast";
1168 }
1169 return GetLogicalVolume( osname.str() );
1170}

Referenced by SetVolumeDefaultVis().

◆ GetVolumePVF()

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

Get PVF volume;.

Definition at line 1173 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1174{
1175 std::stringstream osname;
1176 if (part == 0) {
1177 osname << "logical" << "PVFEcEast";
1178 }
1179 else if (part == 2){
1180 osname << "logical" << "PVFEcWest";
1181 }
1182 else {
1183 if (part == 1) {
1184 osname << "logical" << "PVFBr" << layer+1;
1185 }
1186 }
1187 return GetLogicalVolume( osname.str() );
1188}

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 1209 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1210{
1211 std::stringstream osname;
1212 if (part == 0) {
1213 osname << "logical" << "ScinEcEast";
1214 }
1215 else if (part == 2){
1216 osname << "logical" << "ScinEcWest";
1217 }
1218 else {
1219 if (part == 1) {
1220 osname << "logical" << "ScinBr" << layer+1;
1221 }
1222 }
1223 return GetLogicalVolume( osname.str() );
1224}

◆ 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 113 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/TofROOTGeo.h.

113{ return m_Tof; }

◆ Init2DGeometry()

void TofROOTGeo::Init2DGeometry ( )

Initialize 2D Geometry.

Definition at line 124 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

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

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 94 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

95{
96 m_ROOTGeoInit = 2;
97
98 //Huang Shuhui's update: Load in Tof_mrpc Gdml Geometry, set fTofMrpc flag
99 fTofMrpc = 0;
100 if (TString(gdmlFile).Contains("Tof_mrpc.gdml")) fTofMrpc = 1;
101 else cout << "Cannot read Tof_mrpc!" << endl;
102 if (fTofMrpc) cout << "fTofMrpc: " << "Using new Geometry of Tof!" << endl;
103
104 ReadGdml(gdmlFile, setupName);
105 SetNode();
106}

Referenced by BesGeometry::InitFromGDML().

◆ InitFromROOT()

void TofROOTGeo::InitFromROOT ( TGeoVolume *  vol)

Initialize ROOTGeo from TGeoVolume logicalTof.

Definition at line 109 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

110{
111 m_ROOTGeoInit = 1;
112
113 //Huang Shuhui's update: To judge MRPC
114 fTofMrpc = 0;
115 TGeoNode *contianer = vol->GetNode(0)->GetVolume()->GetNode(0);
116 if (TString(contianer->GetName()).Contains("container")) fTofMrpc = 1;
117 if (fTofMrpc) cout << "fTofMrpc: " << "Using new Geometry of Tof!" << endl;
118
119 SetVolumeTof(vol);
120 SetNode();
121}
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 787 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

788{
789 BesView *view = 0;
790 if (gPad) view = dynamic_cast<BesView*>(gPad->GetView());
791 //if (view) cout << "viewVisFull3DTof " << view->GetVisFull3DTof() << endl;
792 m_DetectorsArray->Clear();
793
794 //Long Peixun's update: for Tof Mrpc
795 if (fTofMrpc)
796 {
797 for (int part = 0; part < m_kPart; part++)
798 {
799 if (part == 1)
800 {
801 for (int layer = 0; layer < GetLayerNb(part); layer++)
802 {
803 for (int scin = 0; scin < GetScinNb(part); scin++)
804 {
805 TGeoPhysicalNode *phyNode = 0;
806 phyNode = GetPhysicalScin(part, layer, scin);
807 if (phyNode)
808 {
809 phyNode->SetVisibility(0); // set all invisible before set any visible
810 m_DetectorsArray->Add( phyNode );
811 }
812 }
813 }
814 }
815 else
816 {
817 for (int module = 0; module < GetModuleNb(part); module++)
818 {
819 for (int strip = 0; strip < GetStripNb(module); strip++)
820 {
821 TGeoPhysicalNode *phyNode = 0;
822 phyNode = GetPhysicalScin(part, module, strip);
823 if (phyNode)
824 {
825 phyNode->SetVisibility(0); // set all invisible before set any visible
826 m_DetectorsArray->Add( phyNode );
827 }
828 }
829 }
830 }
831 }
832 }
833 else
834 {
835 for (int part = 0; part < m_kPart; part++)
836 {
837 for (int layer = 0; layer < GetLayerNb(part); layer++)
838 {
839 for (int scin = 0; scin < GetScinNb(part); scin++)
840 {
841 TGeoPhysicalNode *phyNode = 0;
842 phyNode = GetPhysicalScin(part, layer, scin);
843 if (phyNode)
844 {
845 phyNode->SetVisibility(0); // set all invisible before set any visible
846 //Long Peixun's update: Remove useless judgement
847 // if (part == 2 ||
848 // (scin >= GetScinNb(part)*0/4 && scin < GetScinNb(part)*8/8)) {
849 m_DetectorsArray->Add( phyNode );
850 // }
851 // else if (view && view->GetVisFull3DTof()) {
852 // m_DetectorsArray->Add( phyNode );
853 // }
854 }
855 }
856 }
857 }
858 }
859}

Referenced by BesClient::HandleViewOptionMenu().

◆ SetHalfVisible()

void TofROOTGeo::SetHalfVisible ( )

Set half visible;.

Definition at line 632 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

633{
634 /*
635 for (int part = 0; part < m_kPart; part++) {
636 GetVolumeScin(part)->SetVisibility(1);
637 GetVolumeBucket(part)->SetVisibility(1);
638
639 int nScin = 0;
640 if (part == 1) nScin = m_kAssemblyBr;
641 else nScin = m_kAssemblyEc;
642 for (int scin = 0; scin < nScin; scin++) {
643 if (scin < nScin/4+1 ||
644 scin > nScin*3/4 ) GetScin(part, scin)->SetVisibility(1);
645 else GetScin(part, scin)->SetVisibility(0);
646
647 int nBucket = 0;
648 if (part == 1) nBucket = m_kBucketBr;
649 else nBucket = m_kBucketEc;
650 for (int bucket = 0; bucket < nBucket; bucket++) {
651 if (scin < nScin/4+1 ||
652 scin > nScin*3/4 ) GetBucket(part, scin, bucket)->SetVisibility(1);
653 else GetBucket(part, scin, bucket)->SetVisibility(0);
654 }
655 }
656 }
657 */
658}

◆ SetHits()

void TofROOTGeo::SetHits ( )

Set all physicalNodes corresponding to digiCol;.

Definition at line 862 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

863{
864 // set previous event hits to default vis
865 for (int i = 0; i < m_HitsArray->GetEntries(); i++)
866 {
867 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_HitsArray->At(i);
868 if (phyNode)
869 {
870 //phyNode->SetLineColor(m_ScinColor);
871 phyNode->SetVisibility(0);
872 }
873 }
874 m_HitsArray->Clear("C");
875
876 // set previous event 2D hits info to default
877 for (int i = 0; i < m_2DHitsArray->GetEntries(); i++)
878 {
879 Tof2DScin *aScin = (Tof2DScin*)m_2DHitsArray->At(i);
880 aScin->ClearInfo();
881 aScin->AddInfo(aScin->GetTitle());
882 aScin->CloseInfo();
883 aScin->ResetTimeCharge();
884 }
885 m_2DHitsArray->Clear("C");
886
887 //Long Peixun's update: Consider gEvent == NULL
888 int NDigiCol = 0;
889 if (gEvent)
890 {
891 m_TofDigiCol = gEvent->GetTofDigiCol();
892 //Long Peixun's update: Consider m_TofDigiCol == NULL
893 if (m_TofDigiCol) NDigiCol = m_TofDigiCol->GetEntries();
894 else NDigiCol = 0;
895 }
896
897 for (int i = 0; i < NDigiCol; i++)
898 {
899 TTofDigi *aTofDigi = (TTofDigi*)m_TofDigiCol->At(i);
900 Identifier atofID(aTofDigi->getIntId());
901 int part, layer, scin;
902
903 if (fTofMrpc)
904 { //Huang Shuhui's update: for Tof_mrpc hits
905 part = TofID::barrel_ec(atofID);
906 if (part == 1)
907 {
908 layer = TofID::layer(atofID);
909 scin = TofID::phi_module(atofID);
910 }
911 else
912 {
913 //In BOSS 7.0.3
914 int part_Ec = TofID::endcap(atofID);
915 if (part_Ec == 0) part = 0;
916 else part = 2;
917 layer = TofID::module(atofID);
918 scin = TofID::strip(atofID);
919
920 //In CgemBOSS 6.6.5.b
921 // int part_Ec = TofID::end(atofID);
922 // if (part_Ec == 0) part = 0;
923 // else part = 2;
924 // layer = TofID::layer(atofID);
925 // scin = TofID::phi_module(atofID);
926 }
927 }
928 else
929 {
930 part = TofID::barrel_ec(atofID);
931 layer = TofID::layer(atofID);
932 scin = TofID::phi_module(atofID);
933 }
934
935 //Long Peixun has a question: Do we need to divide by TOF_*_FACTOR?
936 Double_t charge = Double_t(aTofDigi->getChargeChannel()) / TOF_CHARGE_FACTOR;
937 Double_t time = Double_t(aTofDigi->getTimeChannel()) / TOF_TIME_FACTOR;
938 //Double_t charge = RawDataUtil::TofCharge(aTofDigi->getChargeChannel());
939 //Double_t time = RawDataUtil::TofTime(aTofDigi->getTimeChannel());
940
941 TGeoPhysicalNode *phyNode = 0;
942 phyNode = GetPhysicalScin( part, layer, scin );
943 if (phyNode) {
944 m_HitsArray->Add( phyNode );
945 }
946
947 Tof2DScin *aScin = 0;
948 aScin = m_Tof2DScin[part][layer][scin];
949 if (aScin)
950 {
951 char data[100];
952
953 if (fTofMrpc)
954 { //Huang Shuhui's update: for Tof_mrpc hits
955 if (part != 1)
956 {
957 if (aScin->GetCharge() == 0.0)
958 {
959 aScin->ClearInfo();
960 aScin->AddInfo(aScin->GetTitle());
961 //Long Peixun's update: Subscript index
962 sprintf(data, "t_{leading1} = %-.3f ns, t_{trailing1} = %-.3f ns", time, charge);
963 aScin->AddInfo( TString(data) );
964 }
965 else
966 {
967 //Long Peixun's update: Subscript index
968 sprintf(data, "t_{leading2} = %-.3f ns, t_{trailing2} = %-.3f ns", time, charge);
969 aScin->AddInfo( TString(data) );
970 sprintf(data, "Fired");
971 aScin->AddInfo( TString(data) );
972 }
973 }
974 else
975 {
976 if (aScin->GetCharge() == 0.0)
977 {
978 aScin->ClearInfo();
979 aScin->AddInfo(aScin->GetTitle());
980 sprintf(data, "time1 = %-.3f ns, charge1 = %-.3f MeV", time, charge);
981 aScin->AddInfo( TString(data) );
982 }
983 else
984 {
985 sprintf(data, "time2 = %-.3f ns, charge2 = %-.3f MeV", time, charge);
986 aScin->AddInfo( TString(data) );
987 sprintf(data, "Fired");
988 aScin->AddInfo( TString(data) );
989 }
990 }
991 }
992 else
993 {
994 if (aScin->GetCharge() == 0.0)
995 {
996 aScin->ClearInfo();
997 aScin->AddInfo(aScin->GetTitle());
998 sprintf(data, "time1 = %-.3f ns, charge1 = %-.3f MeV", time, charge);
999 aScin->AddInfo( TString(data) );
1000 }
1001 else
1002 {
1003 sprintf(data, "time2 = %-.3f ns, charge2 = %-.3f MeV", time, charge);
1004 aScin->AddInfo( TString(data) );
1005 sprintf(data, "Fired");
1006 aScin->AddInfo( TString(data) );
1007 }
1008 }
1009
1010 aScin->CloseInfo();
1011 aScin->SetCharge(aScin->GetCharge() + charge);
1012 //Long Peixun's update: Set raw channel data of aScin
1013 aScin->SetTimeChannel(aTofDigi->getTimeChannel());
1014 aScin->SetChargeChannel(aTofDigi->getChargeChannel());
1015 m_2DHitsArray->Add(aScin);
1016 }
1017 }
1018}
R__EXTERN BesEvent * gEvent
Definition: BesEvent.h:279
const TObjArray * GetTofDigiCol() const
Definition: BesEvent.h:74
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
virtual void AddInfo(TString info)
Definition: Tof2DScin.h:35
void SetTimeChannel(UInt_t tc)
Definition: Tof2DScin.h:55
virtual void ResetTimeCharge()
Definition: Tof2DScin.h:43
virtual void SetCharge(Double_t charge)
Definition: Tof2DScin.h:40
virtual void CloseInfo()
Definition: Tof2DScin.cxx:130
void SetChargeChannel(UInt_t cc)
Definition: Tof2DScin.h:56
virtual void ClearInfo()
Definition: Tof2DScin.cxx:124
static int endcap(const Identifier &id)
Definition: TofID.cxx:124
static int strip(const Identifier &id)
Definition: TofID.cxx:136
static int phi_module(const Identifier &id)
Definition: TofID.cxx:73
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
Definition: TofID.cxx:61
static int layer(const Identifier &id)
Definition: TofID.cxx:66
static int module(const Identifier &id)
Definition: TofID.cxx:130
sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)
float charge

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 661 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

662{
663 /*
664 int part = 1;
665 GetVolumeScin(0)->SetVisibility(1);
666 GetVolumeBucket(0)->SetVisibility(1);
667
668 int nScin = 0;
669 nScin = m_kAssemblyBr;
670 for (int scin = 0; scin < nScin; scin++) {
671 GetScin(part, scin)->SetVisibility(1);
672
673 int nBucket = 0;
674 nBucket = m_kBucketBr;
675 for (int bucket = 0; bucket < nBucket; bucket++) {
676 GetBucket(part, scin, bucket)->SetVisibility(1);
677 }
678 }
679 */
680}

◆ SetPhysicalDefaultVis()

void TofROOTGeo::SetPhysicalDefaultVis ( )

Definition at line 534 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

535{
536 if (fTofMrpc)
537 { //Tof with MRPC
538 for (int part = 0; part < m_kPart; part++)
539 {
540 if (part == 1)
541 {
542 for (int layer = 0; layer < GetLayerNb(part); layer++)
543 {
544 for (int scin = 0; scin < GetScinNb(part); scin++)
545 GetPhysicalScin(part, layer, scin)->SetLineColor(m_ScinColor);
546 }
547 }
548 else
549 {
550 for (int module = 0; module < GetModuleNb(part); module++)
551 {
552 for (int strip = 0; strip < GetStripNb(module); strip++)
553 GetPhysicalScin(part, module, strip);
554 }
555 }
556 }
557 }
558 else
559 { //Old Tof
560 for (int part = 0; part < m_kPart; part++)
561 {
562 for (int layer = 0; layer < GetLayerNb(part); layer++)
563 {
564 for (int scin = 0; scin < GetScinNb(part); scin++)
565 GetPhysicalScin(part, layer, scin)->SetLineColor(m_ScinColor);
566 }
567 }
568 }
569}

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 577 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

577 {
578 k_QMatch = input;
579}

◆ 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 572 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

572 {
573 k_TMatch = input;
574}

◆ SetVisTofDetector()

void TofROOTGeo::SetVisTofDetector ( )

Set Tof detector visibility;.

Definition at line 1021 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1022{
1023 /*
1024 for (int part = 0; part < m_kPart; part++) {
1025 for (int layer = 0; layer < GetLayerNb(part); layer++) {
1026 for (int scin = 0; scin < GetScinNb(part); scin++) {
1027 TGeoPhysicalNode *phyNode = GetPhysicalScin(part, layer, scin);
1028 if (phyNode) phyNode->SetLineColor(m_ScinColor);
1029 }
1030 }
1031 }
1032 */
1033
1034 BesView *view = 0;
1035 if (gPad) view = dynamic_cast<BesView*>(gPad->GetView());
1036
1037 //cout << "VisTofEast " << view->GetVisTofEast() << endl;
1038 for (int i = 0; i < m_DetectorsArray->GetEntries(); i++)
1039 {
1040 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_DetectorsArray->At(i);
1041 phyNode->SetVisibility(0);
1042 if (view && view->GetVisTofGlobal())
1043 {
1044 int part = GetPart(phyNode);
1045 if (part == 0 && view->GetVisTofEast() ||
1046 part == 1 && view->GetVisTofBarrel() ||
1047 part == 2 && view->GetVisTofWest() )
1048 phyNode->SetVisibility(1);
1049 }
1050 }
1051}
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 1054 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

1055{
1056 BesView *view = 0;
1057 if (gPad) view = dynamic_cast<BesView*>(gPad->GetView());
1058
1059 for (int i = 0; i < m_HitsArray->GetEntries(); i++)
1060 {
1061 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_HitsArray->At(i);
1062 if (phyNode)
1063 {
1064 int part = GetPart(phyNode);
1065 if (view && view->GetVisTofHitsGlobal())
1066 {
1067 if (part == 0 && view->GetVisTofHitsEast() ||
1068 part == 1 && view->GetVisTofHitsBarrel() ||
1069 part == 2 && view->GetVisTofHitsWest() )
1070 {
1071 phyNode->SetVisibility(1);
1072 phyNode->SetLineColor(801); //Long Peixun's update: Green -> Orange
1073 continue;
1074 }
1075 }
1076 //Long Peixun's update: Unfired visibility should be determined by Detector option rather than His option
1077 //phyNode->SetVisibility(0);
1078 if (part > -1) phyNode->SetLineColor(m_ScinColor);
1079 }
1080 }
1081}

Referenced by BesGeometry::Draw3D().

◆ SetVolumeDefaultVis()

void TofROOTGeo::SetVolumeDefaultVis ( )

Set default visual attributes;.

Definition at line 506 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/TofROOTGeo.cxx.

507{
508 //std::cout << "begin of set defaultvis" << std::endl;
509
510 m_Tof->SetLineColor(m_TofColor);
511 m_Tof->SetVisibility(0);
512
513 for (int part = 0; part < m_kPart; part++) {
514 GetVolumePart(part)->SetLineColor(m_ScinColor);
515 GetVolumePart(part)->SetVisibility(0);
516 for (int layer = 0; layer < GetLayerNb(part); layer++) {
517 GetVolumePVF(part, layer)->SetLineColor(m_ScinColor);
518 GetVolumePVF(part, layer)->SetVisibility(0);
519
520 GetVolumeAl(part, layer)->SetLineColor(m_ScinColor);
521 GetVolumeAl(part, layer)->SetVisibility(0);
522
523 GetVolumeScin(part, layer)->SetLineColor(m_ScinColor);
524 GetVolumeScin(part, layer)->SetVisibility(0);
525
526 GetVolumeBucket(part, layer)->SetLineColor(m_BucketColor);
527 GetVolumeBucket(part, layer)->SetVisibility(0);
528 }
529 }
530 //std::cout << "end of set defaultvis" << std::endl;
531}
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 110 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/TofROOTGeo.h.

110{ m_Tof = vol; }

Referenced by InitFromROOT().


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