BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
MucROOTGeo Class Reference

#include <MucROOTGeo.h>

+ Inheritance diagram for MucROOTGeo:

Public Member Functions

 MucROOTGeo ()
 Constructor.
 
 ~MucROOTGeo ()
 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 GetPartNum ()
 Get number of part;.
 
int GetSegNum (int part)
 Get number of segment on part;.
 
int GetGapNum (int part)
 Get number of gap on part;.
 
int GetStripNum (int part, int seg, int gap)
 Get number of strip on gap;.
 
TGeoVolume * GetVolumeMuc ()
 Get Muc volume;.
 
TGeoVolume * GetVolumeAbsorber (int part, int seg, int absorber)
 Get absorber volume;

 
float GetAbsorberThickness (int part, int seg, int absorber)
 Get thickness of an absorber;.
 
TGeoVolume * GetVolumeAbsorberPanel (int part, int seg, int absorber, int panel)
 Get absorber panel volume;

 
TGeoVolume * GetVolumeGap (int part, int seg, int gap)
 Get gap volume;

 
TGeoVolume * GetVolumeAluminumBox (int part, int seg, int gap)
 Get box volume;

 
TGeoVolume * GetVolumeStripPlane (int part, int seg, int gap)
 Get strip plane volume;.
 
TGeoVolume * GetVolumeStrip (int part, int seg, int gap, int strip)
 Get strip volume;

 
TGeoVolume * GetVolumeGasChamber (int part, int seg, int gap, int panel, int gasChamber)
 Get rpc gas chamber volume;

 
TGeoVolume * GetVolumeBakelite (int part, int seg, int gap, int panel, int bakelite)
 Get rpc bakelite volume;

 
TGeoNode * GetGap (int part, int seg, int gap)
 Get absorber node;

 
TGeoNode * GetStripPlane (int part, int seg, int gap)
 Get box node;.
 
TGeoNode * GetStrip (int part, int seg, int gap, int strip)
 Get strip node;

 
TGeoPhysicalNode * GetPhysicalGap (int part, int seg, int gap)
 Get rpc gas chamber node;

 
TGeoPhysicalNode * GetPhysicalAluminumBox (int part, int seg, int gap)
 Get box physical node;.
 
TGeoPhysicalNode * GetPhysicalStrip (int part, int seg, int gap, int strip)
 Get strip physical node;.
 
 MucROOTGeo ()
 Constructor.
 
 ~MucROOTGeo ()
 Destructor.
 
void InitFromGDML (const char *gdmlFile, const char *setupName)
 Initialize ROOTGeo from GDML.
 
void InitFromROOT (TGeoVolume *vol)
 Initialize ROOTGeo from TGeoVolume logicalMuc.
 
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 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 ()
 Set Detecor (what is detector depends on you)
 
void SetHits ()
 Set all physicalNodes corresponding to digiCol;.
 
void SetVisMucDetector ()
 Set Muc detector visibility;.
 
void SetVisMucHits ()
 Set Muc hits visibility;.
 
int GetPartNb ()
 Get number of part;.
 
int GetSegNb (int part)
 Get number of segment on part;.
 
int GetGapNb (int part)
 Get number of gap on part;.
 
int GetStripNb (int part, int seg, int gap)
 Get number of strip on gap;.
 
int GetAbsorberNb (int part)
 Get number of absorber on part;.
 
void SetVolumeMuc (TGeoVolume *vol)
 Set Muc volume, while initializing from ROOT;.
 
TGeoVolume * GetVolumeMuc ()
 Get Muc volume;.
 
TGeoVolume * GetVolumeAbsorber (int part, int seg, int absorber)
 Get absorber volume;

 
TGeoVolume * GetVolumeAbsorberSmallBlock (int gap, int sb)
 Get absorber small block;.
 
TGeoVolume * GetVolumeAbsorberPanel (int part, int seg, int absorber, int panel)
 Get absorber panel volume;

 
TGeoVolume * GetVolumeGap (int part, int seg, int gap)
 Get gap volume;

 
TGeoVolume * GetVolumeBox (int part, int seg, int gap)
 Get box volume;

 
TGeoVolume * GetVolumeBoxSurface (int part, int seg, int gap, int up)
 Get box surface volume;

 
TGeoVolume * GetVolumeStripPlane (int part, int seg, int gap)
 Get strip plane volume;.
 
TGeoVolume * GetVolumeStrip (int part, int seg, int gap, int strip)
 Get strip volume;

 
TGeoVolume * GetVolumeGasChamber (int part, int seg, int gap, int panel, int gasChamber)
 Get rpc gas chamber volume;

 
TGeoVolume * GetVolumeGasBorder (int part, int seg, int gap, int panel, int gasChamber)
 Get rpc gas border volume;

 
TGeoVolume * GetVolumeBakelite (int part, int seg, int gap, int RpcUpDown, int panel, int bakelite)
 Get rpc bakelite volume;

 
TGeoNode * GetAbsorber (int part, int seg, int absorber)
 Get absorber node;

 
TGeoNode * GetAbsorberPanel (int part, int seg, int absorber, int panel)
 Get absorber panel node;

 
TGeoNode * GetGap (int part, int seg, int gap)
 Get gap node;

 
TGeoNode * GetStripPlane (int part, int seg, int gap)
 Get strip plane node;.
 
TGeoNode * GetStrip (int part, int seg, int gap, int strip)
 Get strip node;

 
TGeoPhysicalNode * GetPhysicalAbsorber (int part, int seg, int gap, int panel)
 Get rpc gas chamber node;

 
TGeoPhysicalNode * GetPhysicalGap (int part, int seg, int gap)
 Get gap physical node;.
 
TGeoPhysicalNode * GetPhysicalStrip (int part, int seg, int gap, int strip)
 Get strip physical node;.
 
Muc2DStripGet2DStrip (int part, int seg, int gap, int strip)
 Get Muc2DStrip;.
 
Int_t GetPart (TGeoPhysicalNode *phyNode)
 Get part no of a physcial node.
 
Bool_t IsZRVisible (int part, int seg)
 Is a segment visible in ZR view.
 
Double_t Range360 (Double_t input)
 Get input value 0~360.
 
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 MucGeo contains all of the objects necessary to describe the muc 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-16/ROOTGeo/MucROOTGeo.h.

Constructor & Destructor Documentation

◆ MucROOTGeo() [1/2]

MucROOTGeo::MucROOTGeo ( )

Constructor.

Definition at line 29 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

30{
31 // Default constructor.
32 for (int part = 0; part < m_kPart; part++) {
33 for (int seg = 0; seg < m_kSegMax; seg++) {
34 for (int gap = 0; gap < m_kGapMax; gap++) {
35 m_NodeGap[part][seg][gap] = 0;
36 m_PhysicalGap[part][seg][gap] = 0;
37 // m_NodeBox[part][seg][gap] = 0;
38 // m_PhysicalBox[part][seg][gap] = 0;
39 for (int strip = 0; strip < m_kStripMax; strip++) {
40 m_NodeStrip[part][seg][gap][strip] = 0;
41 m_PhysicalStrip[part][seg][gap][strip] = 0;
42 }
43 }
44 }
45 }
46
47 string GdmlManagementPath = getenv("GDMLMANAGEMENTROOT");
48 //cout << "MucGeoGeneral::InitFromXML(), GdmlManagementPath not found" << endl;
49 string GdmlFile = GdmlManagementPath + string("/dat/Muc.gdml");
50 //string GdmlFile = string("Muc.gdml");
51 cout << "GdmlFile " << GdmlFile << endl;
52 InitFromGdml( GdmlFile.c_str(), "Muc" );
53}
void InitFromGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of ROOTGeo.

◆ ~MucROOTGeo() [1/2]

MucROOTGeo::~MucROOTGeo ( )

Destructor.

Definition at line 55 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

56{ }

◆ MucROOTGeo() [2/2]

MucROOTGeo::MucROOTGeo ( )

Constructor.

◆ ~MucROOTGeo() [2/2]

MucROOTGeo::~MucROOTGeo ( )

Destructor.

Member Function Documentation

◆ Draw()

void MucROOTGeo::Draw ( Option_t * option)

Draw function.

Definition at line 1477 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1478{
1479 TString opt = option;
1480 opt.ToUpper();
1481
1482 if (!m_2DGeoInit) cout << "MucROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
1483 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1484 if (!view) cout << "MucROOTGeo::Draw(), BesView not found" << endl;
1485
1486 if (view->GetVisMucGlobal()) { // MucVisGlobal
1487 // seg and gap
1488 for (Int_t part = GetPartNb()-1; part >= 0; part--) { // draw west first
1489 if ( (part == 0 && view->GetVisMucEast()) ||
1490 (part == 1 && view->GetVisMucBarrel()) ||
1491 (part == 2 && view->GetVisMucWest()) ) {
1492 for (Int_t seg = 0; seg < GetSegNb(part); seg++) {
1493 if (opt.Contains("XY")) {
1494 if (m_MucXY[part][seg]) m_MucXY[part][seg]->Draw("");
1495 for (Int_t gap = 0; gap < GetGapNb(part); gap++) {
1496 if (m_MucXYGap[part][seg][gap]) m_MucXYGap[part][seg][gap]->Draw("");
1497 }
1498 }
1499 if (opt.Contains("ZR")) {
1500 if ( m_MucZR[part][seg] ) { // && IsZRVisible(part, seg) ) {
1501 if (part == 1) m_MucZR[part][seg]->SetRotatable(true);
1502 m_MucZR[part][seg]->Draw("");
1503 }
1504 for (Int_t gap = 0; gap < GetGapNb(part); gap++) {
1505 if (m_MucZRGap[part][seg][gap]) {
1506 if (part == 1) m_MucZRGap[part][seg][gap]->SetRotatable(true);
1507 m_MucZRGap[part][seg][gap]->Draw("");
1508 }
1509 }
1510 }
1511 }
1512 }
1513 }
1514
1515 // strips, should be drawn after all segs and gaps have been drawn
1516 for (Int_t part = GetPartNb()-1; part >= 0; part--) { // draw west first
1517 for (Int_t seg = 0; seg < GetSegNb(part); seg++) {
1518 for (Int_t gap = 0; gap < GetGapNb(part); gap++) {
1519 for (Int_t strip = 0; strip < GetStripNb(part, seg, gap); strip++) {
1520 if (m_Muc2DStrip[part][seg][gap][strip]) {
1521 m_Muc2DStrip[part][seg][gap][strip]->SetFired(false);
1522 if ( (part == 0 && view->GetVisMucEast()) ||
1523 (part == 1 && view->GetVisMucBarrel()) ||
1524 (part == 2 && view->GetVisMucWest()) ) {
1525 m_Muc2DStrip[part][seg][gap][strip]->Draw("");
1526 }
1527 }
1528 }
1529 }
1530 }
1531 }
1532
1533 }
1534}
void SetRotatable(Bool_t input)
virtual void Draw(Option_t *option="")
Bool_t GetVisMucWest()
Definition BesView.h:150
Bool_t GetVisMucEast()
Definition BesView.h:148
Bool_t GetVisMucGlobal()
Definition BesView.h:147
Bool_t GetVisMucBarrel()
Definition BesView.h:149
virtual void Draw(Option_t *option="")
virtual void SetFired(bool status=true)
Definition Muc2DStrip.h:31
int GetGapNb(int part)
Get number of gap on part;.
int GetSegNb(int part)
Get number of segment on part;.
int GetStripNb(int part, int seg, int gap)
Get number of strip on gap;.

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

◆ DrawHits()

void MucROOTGeo::DrawHits ( Option_t * option)

Draw 2D hits.

Definition at line 1537 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1538{
1539 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1540 if (!view) cout << "MucROOTGeo::DrawHits(), BesView not found" << endl;
1541
1542
1543 if (view->GetVisMucHitsGlobal()) {
1544
1545 /*
1546 for (Int_t part = GetPartNb()-1; part >= 0; part--) { // draw west first
1547 for (Int_t seg = 0; seg < GetSegNb(part); seg++) {
1548 for (Int_t gap = 0; gap < GetGapNb(part); gap++) {
1549 for (Int_t strip = 0; strip < GetStripNb(part, seg, gap); strip++) {
1550 if (m_Muc2DStrip[part][seg][gap][strip]) m_Muc2DStrip[part][seg][gap][strip]->ClearInfo();
1551 }
1552 }
1553 }
1554 }*/
1555
1556 //Long Peixun's update: Use m_2DHitsArray which contains ready hits rather than rebuild hits
1557 for (int i = 0; i < m_2DHitsArray->GetEntries(); ++i)
1558 {
1559 Muc2DStrip* aStrip = (Muc2DStrip*)m_2DHitsArray->At(i);
1560 if (aStrip)
1561 {
1562 if ((aStrip->GetPart() == 0 && view->GetVisMucHitsEast()) ||
1563 (aStrip->GetPart() == 1 && view->GetVisMucHitsBarrel()) ||
1564 (aStrip->GetPart() == 2 && view->GetVisMucHitsWest()) )
1565 {
1566 aStrip->SetFired(true);
1567 aStrip->Draw();
1568 }
1569 }
1570 }
1571
1572/* if (m_MucDigiCol) {
1573 for (int i = 0; i < m_MucDigiCol->GetEntries(); i++) {
1574 TMucDigi *aMucDigi = (TMucDigi*)m_MucDigiCol->At(i);
1575
1576 //cout << aMucDigi->getIntId() << endl;
1577 Identifier aMucID( aMucDigi->getIntId() );
1578 int part = MucID::part( aMucID );
1579 int seg = MucID::seg( aMucID );
1580 int gap = MucID::gap( aMucID );
1581 int strip = MucID::strip( aMucID );
1582
1583 Muc2DStrip *aStrip = 0;
1584 aStrip = m_Muc2DStrip[part][seg][gap][strip];
1585 if (aStrip) {
1586 if ( (part == 0 && view->GetVisMucHitsEast()) ||
1587 (part == 1 && view->GetVisMucHitsBarrel()) ||
1588 (part == 2 && view->GetVisMucHitsWest()) ) {
1589 aStrip->SetFired(true);
1590 aStrip->Draw();
1591 }
1592 }
1593 }
1594 } */
1595 }
1596}
Bool_t GetVisMucHitsWest()
Definition BesView.h:227
Bool_t GetVisMucHitsGlobal()
Definition BesView.h:224
Bool_t GetVisMucHitsEast()
Definition BesView.h:225
Bool_t GetVisMucHitsBarrel()
Definition BesView.h:226
virtual Int_t GetPart()
Definition Muc2DStrip.h:43

Referenced by BesEvent::DrawHits().

◆ Get2DStrip()

Muc2DStrip * MucROOTGeo::Get2DStrip ( int part,
int seg,
int gap,
int strip )

Get Muc2DStrip;.

Definition at line 1402 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1403{
1404 if (m_Muc2DStrip[part][seg][gap][strip]) return m_Muc2DStrip[part][seg][gap][strip];
1405 else return 0;
1406}

Referenced by BesEvent::ConstructMucTrackFromRec().

◆ GetAbsorber()

TGeoNode * MucROOTGeo::GetAbsorber ( int part,
int seg,
int absorber )

Get absorber node;

Definition at line 1319 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1320{
1321 if (m_NodeAbsorber[part][seg][absorber] != 0) {
1322 return m_NodeAbsorber[part][seg][absorber];
1323 }
1324 else {
1325 return 0;
1326 }
1327}

Referenced by Init2DGeometry().

◆ GetAbsorberNb()

int MucROOTGeo::GetAbsorberNb ( int part)

Get number of absorber on part;.

Definition at line 1192 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1193{
1194 return m_kAbsorber[part]; //Long Peixun's update: code optimization
1195}

Referenced by GetPart(), SetDetector(), and SetVolumeDefaultVis().

◆ GetAbsorberPanel()

TGeoNode * MucROOTGeo::GetAbsorberPanel ( int part,
int seg,
int absorber,
int panel )

Get absorber panel node;

Definition at line 1330 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1331{
1332 if (m_NodeAbsorberPanel[part][seg][absorber][panel] != 0) {
1333 return m_NodeAbsorberPanel[part][seg][absorber][panel];
1334 }
1335 else {
1336 return 0;
1337 }
1338}

◆ GetAbsorberThickness()

float MucROOTGeo::GetAbsorberThickness ( int part,
int seg,
int absorber )

Get thickness of an absorber;.

Definition at line 362 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

363{
364 float thickness = 0.0;
365 TGeoVolume *vol = GetVolumeAbsorber(part, seg, absorber);
366 if (vol) {
367 thickness = 2.0*((TGeoBBox*)vol->GetShape())->GetDZ();
368 }
369
370 return thickness;
371}
TGeoVolume * GetVolumeAbsorber(int part, int seg, int absorber)
Get absorber volume;

Referenced by MucGeoGeneral::InitFromXML().

◆ GetGap() [1/2]

TGeoNode * MucROOTGeo::GetGap ( int part,
int seg,
int gap )

Get absorber node;

Get absorber panel node;
Get gap node;

Definition at line 446 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

447{
448 if (m_NodeGap[part][seg][gap] != 0) {
449 return m_NodeGap[part][seg][gap];
450 }
451 else {
452 std::cout << "Node: " << "Part" << part << "Seg" << seg << "Gap" << gap << " not found" << std::endl;
453 return 0;
454 }
455}

Referenced by Init2DGeometry(), SetAllVisible(), SetDefaultVis(), SetHalfVisible(), SetNoEndVisible(), SetPhysicalNode(), SetQuarterVisible(), and SetVolumeDefaultVis().

◆ GetGap() [2/2]

TGeoNode * MucROOTGeo::GetGap ( int part,
int seg,
int gap )

Get gap node;

◆ GetGapNb()

int MucROOTGeo::GetGapNb ( int part)

Get number of gap on part;.

Definition at line 1180 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1181{
1182 return m_kGap[part]; //Long Peixun's update: code optimization
1183}

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

◆ GetGapNum()

int MucROOTGeo::GetGapNum ( int part)

Get number of gap on part;.

Definition at line 339 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

340{
341 int gap = m_kGap[part];
342 return gap;
343}

Referenced by MucGeoGeneral::InitFromXML().

◆ GetPart()

int MucROOTGeo::GetPart ( TGeoPhysicalNode * phyNode)

Get part no of a physcial node.

Definition at line 1409 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1410{
1411 for (int part = 0; part < GetPartNb(); part++) {
1412 for (int seg = 0; seg < GetSegNb(part); seg++) {
1413 for (int gap = 0; gap < GetGapNb(part); gap++) {
1414 if (phyNode == GetPhysicalGap(part, seg, gap)) {
1415 return part;
1416 }
1417 for (int strip = 0; strip < m_StripNum[part][seg][gap]; strip++) {
1418 if (phyNode == GetPhysicalStrip(part, seg, gap, strip)) {
1419 return part;
1420 }
1421 }
1422 }
1423 for (int absorber = 0; absorber < GetAbsorberNb(part); absorber++) {
1424 for (int panel = 0; panel < m_kPanelMax; panel++) {
1425 if (phyNode == GetPhysicalAbsorber(part, seg, absorber, panel)) {
1426 return part;
1427 }
1428 }
1429 }
1430 }
1431 }
1432
1433 return -1;
1434}
int GetAbsorberNb(int part)
Get number of absorber on part;.
TGeoPhysicalNode * GetPhysicalStrip(int part, int seg, int gap, int strip)
Get strip physical node;.
TGeoPhysicalNode * GetPhysicalGap(int part, int seg, int gap)
Get rpc gas chamber node;
TGeoPhysicalNode * GetPhysicalAbsorber(int part, int seg, int gap, int panel)
Get rpc gas chamber node;

Referenced by SetVisMucDetector(), and SetVisMucHits().

◆ GetPartNb()

int MucROOTGeo::GetPartNb ( )

Get number of part;.

Definition at line 1168 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1169{
1170 return m_kPart; //Long Peixun's update: code optimization
1171}

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

◆ GetPartNum()

int MucROOTGeo::GetPartNum ( )

Get number of part;.

Definition at line 325 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

326{
327 int part = m_kPart;
328 return part;
329}

Referenced by MucGeoGeneral::InitFromXML().

◆ GetPhysicalAbsorber()

TGeoPhysicalNode * MucROOTGeo::GetPhysicalAbsorber ( int part,
int seg,
int gap,
int panel )

Get rpc gas chamber node;

Get rpc bakelite node;
Get absorber physical node;

Definition at line 1374 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1375{
1376 return m_PhysicalAbsorber[part][seg][absorber][panel];
1377}

Referenced by GetPart(), and SetDetector().

◆ GetPhysicalAluminumBox()

TGeoPhysicalNode * MucROOTGeo::GetPhysicalAluminumBox ( int part,
int seg,
int gap )

Get box physical node;.

◆ GetPhysicalGap() [1/2]

TGeoPhysicalNode * MucROOTGeo::GetPhysicalGap ( int part,
int seg,
int gap )

Get rpc gas chamber node;

Get rpc bakelite node;
Get gap physical node;

Definition at line 495 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

496{
497 if (m_PhysicalGap[part][seg][gap] != 0) {
498 return m_PhysicalGap[part][seg][gap];
499 }
500 else {
501 std::cout << "PhysicalNode: " << "Part" << part << "Seg" << seg << "Gap" << gap << " not found" << std::endl;
502 return 0;
503 }
504}

Referenced by GetPart(), BesGeometry::GetPhysicalMucGap(), Init2DGeometry(), MucGeoGeneral::InitFromXML(), and SetDetector().

◆ GetPhysicalGap() [2/2]

TGeoPhysicalNode * MucROOTGeo::GetPhysicalGap ( int part,
int seg,
int gap )

Get gap physical node;.

◆ GetPhysicalStrip() [1/2]

TGeoPhysicalNode * MucROOTGeo::GetPhysicalStrip ( int part,
int seg,
int gap,
int strip )

Get strip physical node;.

Definition at line 519 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

520{
521 if (m_PhysicalStrip[part][seg][gap][strip] != 0) {
522 return m_PhysicalStrip[part][seg][gap][strip];
523 }
524 else {
525 std::cout << "PhysicalNode: " << "Part" << part << "Seg" << seg << "Gap" << gap << "Strip" << strip << " not found" << std::endl;
526 return 0;
527 }
528}

Referenced by BesEvent::ConstructMucTrackFromRec(), GetPart(), BesGeometry::GetPhysicalMucStrip(), Init2DGeometry(), MucGeoGeneral::InitFromXML(), SetHits(), BesVisDisplay::SetMucFiredCell(), and SetPhysicalDefaultVis().

◆ GetPhysicalStrip() [2/2]

TGeoPhysicalNode * MucROOTGeo::GetPhysicalStrip ( int part,
int seg,
int gap,
int strip )

Get strip physical node;.

◆ GetSegNb()

int MucROOTGeo::GetSegNb ( int part)

Get number of segment on part;.

Definition at line 1174 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1175{
1176 return m_kSeg[part]; //Long Peixun's update: code optimization
1177}

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

◆ GetSegNum()

int MucROOTGeo::GetSegNum ( int part)

Get number of segment on part;.

Definition at line 332 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

333{
334 int seg = m_kSeg[part];
335 return seg;
336}

Referenced by MucGeoGeneral::InitFromXML().

◆ GetStrip() [1/2]

TGeoNode * MucROOTGeo::GetStrip ( int part,
int seg,
int gap,
int strip )

Get strip node;

Definition at line 483 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

484{
485 if (m_NodeStrip[part][seg][gap][strip] != 0) {
486 return m_NodeStrip[part][seg][gap][strip];
487 }
488 else {
489 std::cout << "Node: " << "Part" << part << "Seg" << "0" << "Gap" << gap << "Strip" << strip << " not found" << std::endl;
490 return 0;
491 }
492}

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

◆ GetStrip() [2/2]

TGeoNode * MucROOTGeo::GetStrip ( int part,
int seg,
int gap,
int strip )

Get strip node;

◆ GetStripNb()

int MucROOTGeo::GetStripNb ( int part,
int seg,
int gap )

Get number of strip on gap;.

Definition at line 1186 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1187{
1188 return m_StripNum[part][seg][gap]; //Long Peixun's update: code optimization
1189}

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

◆ GetStripNum()

int MucROOTGeo::GetStripNum ( int part,
int seg,
int gap )

Get number of strip on gap;.

Definition at line 346 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

347{
348 int strip = m_StripNum[part][seg][gap];
349 return strip;
350}

Referenced by MucGeoGeneral::InitFromXML().

◆ GetStripPlane() [1/2]

TGeoNode * MucROOTGeo::GetStripPlane ( int part,
int seg,
int gap )

Get box node;.

Get strip plane node;

Definition at line 471 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

472{
473 if (m_NodeStripPlane[part][seg][gap] != 0) {
474 return m_NodeStripPlane[part][seg][gap];
475 }
476 else {
477 std::cout << "Node: " << "Part" << part << "Seg" << seg << "Gap" << gap << "StripPlane" << " not found" << std::endl;
478 return 0;
479 }
480}

Referenced by SetPhysicalNode().

◆ GetStripPlane() [2/2]

TGeoNode * MucROOTGeo::GetStripPlane ( int part,
int seg,
int gap )

Get strip plane node;.

◆ GetVolumeAbsorber() [1/2]

TGeoVolume * MucROOTGeo::GetVolumeAbsorber ( int part,
int seg,
int absorber )

Get absorber volume;

Definition at line 353 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

354{
355 std::stringstream osname;
356 osname << "l" << "Muc" << "P" << part << "S" << seg << "Ab" << absorber;
357
358 return GetLogicalVolume( osname.str() );
359}
TGeoVolume * GetLogicalVolume(const std::string &vn)
Get a logical volume by name;.

Referenced by GetAbsorberThickness(), BesGeometry::GetVolumeMucAbsorber(), SetAllVisible(), SetDefaultVis(), SetHalfVisible(), SetNoEndVisible(), SetQuarterVisible(), and SetVolumeDefaultVis().

◆ GetVolumeAbsorber() [2/2]

TGeoVolume * MucROOTGeo::GetVolumeAbsorber ( int part,
int seg,
int absorber )

Get absorber volume;

◆ GetVolumeAbsorberPanel() [1/2]

TGeoVolume * MucROOTGeo::GetVolumeAbsorberPanel ( int part,
int seg,
int absorber,
int panel )

Get absorber panel volume;

Definition at line 374 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

375{
376 std::stringstream osname;
377 osname << "l" << "Muc" << "P" << part << "S" << seg << "Ab" << absorber << "Pn" << panel;
378
379 return GetLogicalVolume( osname.str() );
380}

Referenced by BesGeometry::GetVolumeMucAbsorberPanel(), SetAllVisible(), SetDefaultVis(), SetHalfVisible(), and SetQuarterVisible().

◆ GetVolumeAbsorberPanel() [2/2]

TGeoVolume * MucROOTGeo::GetVolumeAbsorberPanel ( int part,
int seg,
int absorber,
int panel )

Get absorber panel volume;

◆ GetVolumeAbsorberSmallBlock()

TGeoVolume * MucROOTGeo::GetVolumeAbsorberSmallBlock ( int gap,
int sb )

Get absorber small block;.

Definition at line 1207 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1208{
1209 std::stringstream osname;
1210 osname << "VolumeSmallBlock" << "Gap" << gap << "SB" << sb;
1211
1212 return GetLogicalVolume( osname.str() );
1213}

Referenced by SetVolumeDefaultVis().

◆ GetVolumeAluminumBox()

TGeoVolume * MucROOTGeo::GetVolumeAluminumBox ( int part,
int seg,
int gap )

Get box volume;

Definition at line 392 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

393{
394 std::stringstream osname;
395 osname <<"l" << "Muc" << "P" << part << "S" << seg << "G" << gap <<"Al";
396
397 return GetLogicalVolume( osname.str() );
398}

◆ GetVolumeBakelite() [1/2]

TGeoVolume * MucROOTGeo::GetVolumeBakelite ( int part,
int seg,
int gap,
int panel,
int bakelite )

Get rpc bakelite volume;

Definition at line 437 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

438{
439 std::stringstream osname;
440 osname << "l" << "Muc" << "P" << part << "S" << "0" << "G" << gap << "R" << panel << "B" << bakelite;
441
442 return GetLogicalVolume( osname.str() );
443}

Referenced by BesGeometry::GetVolumeMucBakelite(), SetAllVisible(), SetDefaultVis(), SetQuarterVisible(), and SetVolumeDefaultVis().

◆ GetVolumeBakelite() [2/2]

TGeoVolume * MucROOTGeo::GetVolumeBakelite ( int part,
int seg,
int gap,
int RpcUpDown,
int panel,
int bakelite )

Get rpc bakelite volume;

Definition at line 1308 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1309{
1310 std::stringstream osname;
1311 int segment = 0;
1312 if (part ==1 && seg ==2) segment = 2;
1313 osname << "l" << "Muc" << "P" << part << "S" << segment << "G" << gap << "R" << RpcUpDown << "Pn" << panel<< "B" << bakelite;
1314
1315 return GetLogicalVolume( osname.str() );
1316}

◆ GetVolumeBox()

TGeoVolume * MucROOTGeo::GetVolumeBox ( int part,
int seg,
int gap )

Get box volume;

Definition at line 1236 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1237{
1238 std::stringstream osname;
1239 osname << "l" << "Muc" << "P" << part << "S" << seg << "G" << gap << "Al";
1240
1241 return GetLogicalVolume( osname.str() );
1242}

Referenced by SetVolumeDefaultVis().

◆ GetVolumeBoxSurface()

TGeoVolume * MucROOTGeo::GetVolumeBoxSurface ( int part,
int seg,
int gap,
int up )

Get box surface volume;

Definition at line 1245 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1246{
1247 std::stringstream osname;
1248 int segment = 0;
1249 if (part ==1 && seg ==2) segment = 2;
1250 osname << "l" << "Muc" << "P" << part << "S" << segment << "G" << gap << "AlSf" <<up;
1251
1252 return GetLogicalVolume( osname.str() );
1253}

Referenced by SetVolumeDefaultVis().

◆ GetVolumeGap() [1/2]

TGeoVolume * MucROOTGeo::GetVolumeGap ( int part,
int seg,
int gap )

Get gap volume;

Definition at line 383 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

384{
385 std::stringstream osname;
386 osname << "l" << "Muc" << "P" << part << "S" << seg << "G" << gap;
387
388 return GetLogicalVolume( osname.str() );
389}

Referenced by BesGeometry::GetVolumeMucGap(), SetAllVisible(), SetDefaultVis(), SetHalfVisible(), SetNoEndVisible(), SetQuarterVisible(), and SetVolumeDefaultVis().

◆ GetVolumeGap() [2/2]

TGeoVolume * MucROOTGeo::GetVolumeGap ( int part,
int seg,
int gap )

Get gap volume;

◆ GetVolumeGasBorder()

TGeoVolume * MucROOTGeo::GetVolumeGasBorder ( int part,
int seg,
int gap,
int panel,
int gasChamber )

Get rpc gas border volume;

Definition at line 1297 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1298{
1299 std::stringstream osname;
1300 int segment = 0;
1301 if (part ==1 && seg ==2) segment = 2;
1302 osname << "l" << "Muc" << "P" << part%2 << "S" << segment << "G" << gap << "R" << rpcUpDown << "Pn" << panel << "GB";
1303
1304 return GetLogicalVolume( osname.str() );
1305}

Referenced by SetVolumeDefaultVis().

◆ GetVolumeGasChamber() [1/2]

TGeoVolume * MucROOTGeo::GetVolumeGasChamber ( int part,
int seg,
int gap,
int panel,
int gasChamber )

Get rpc gas chamber volume;

Definition at line 428 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

429{
430 std::stringstream osname;
431 osname << "l" << "Muc" << "P" << part << "S" << "0" << "G" << gap << "R" << gasChamber << "Pn" << panel << "C";
432
433 return GetLogicalVolume( osname.str() );
434}

Referenced by BesGeometry::GetVolumeMucGasChamber(), SetAllVisible(), SetDefaultVis(), SetQuarterVisible(), and SetVolumeDefaultVis().

◆ GetVolumeGasChamber() [2/2]

TGeoVolume * MucROOTGeo::GetVolumeGasChamber ( int part,
int seg,
int gap,
int panel,
int gasChamber )

Get rpc gas chamber volume;

◆ GetVolumeMuc() [1/2]

TGeoVolume * MucROOTGeo::GetVolumeMuc ( )
inline

◆ GetVolumeMuc() [2/2]

TGeoVolume * MucROOTGeo::GetVolumeMuc ( )
inline

Get Muc volume;.

Definition at line 104 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/BesVisLib/MucROOTGeo.h.

104{ return m_Muc; }

◆ GetVolumeStrip() [1/2]

TGeoVolume * MucROOTGeo::GetVolumeStrip ( int part,
int seg,
int gap,
int strip )

Get strip volume;

Definition at line 411 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

412{
413 std::stringstream osname;
414 if(strip < 10) {
415 osname << "l" << "Muc" << "P" << part << "S" << "0" << "G" << gap << "s" << "00" << strip;
416 }
417 else if(strip<100){
418 osname << "l" << "Muc" << "P" << part << "S" << "0" << "G" << gap << "s" << "0" << strip;
419 }
420 else {
421 osname << "l" << "Muc" << "P" << part << "S" << "0" << "G" << gap << "s" << strip;
422 }
423
424 return GetLogicalVolume( osname.str() );
425}

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

◆ GetVolumeStrip() [2/2]

TGeoVolume * MucROOTGeo::GetVolumeStrip ( int part,
int seg,
int gap,
int strip )

Get strip volume;

◆ GetVolumeStripPlane() [1/2]

TGeoVolume * MucROOTGeo::GetVolumeStripPlane ( int part,
int seg,
int gap )

Get strip plane volume;.

Definition at line 401 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

402{
403 int segment = 0; if(part==1&&seg==2) segment = 2;
404 std::stringstream osname;
405 osname << "l" << "Muc" << "P" << part << "S" << segment << "G" << gap << "SP";
406
407 return GetLogicalVolume( osname.str() );
408}

Referenced by BesGeometry::GetVolumeMucStrip(), BesGeometry::GetVolumeMucStripPlane(), SetDefaultVis(), SetNode(), and SetVolumeDefaultVis().

◆ GetVolumeStripPlane() [2/2]

TGeoVolume * MucROOTGeo::GetVolumeStripPlane ( int part,
int seg,
int gap )

Get strip plane volume;.

◆ Init2DGeometry()

void MucROOTGeo::Init2DGeometry ( )

Initialize 2D Geometry.

Definition at line 120 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

121{
122 if (m_ROOTGeoInit != 1 && m_ROOTGeoInit != 2) {
123 cout << "MucROOTGeo::Init2DGeometry, ROOT Geometry not Initialized yet!" << endl;
124 return;
125 }
126 m_2DGeoInit = 1;
127
128 Int_t mucColor = 9002;
129 Int_t mucLineColor = 15; //15;
130 Int_t mucXYStyle = 1001;//3001;
131 Int_t mucZRStyle = 1001;//3007;
132
133 Int_t mucGapColor = 10; // 1002
134 Int_t mucGapStyle = 1001; //1001;
135 Int_t mucGapXYECStyle = 4000; //1001;
136 Int_t mucGapLineColor = 15;
137
138 Double_t x = 0.0, y = 0.0, z = 0.0;
139 Double_t r = 0.0, phi = 0.0;
140 Double_t local[3] = {0.0, 0.0, 0.0};
141 Double_t master[3] = {0.0, 0.0, 0.0};
142 //Int_t nPoints = 4;
143 Double_t P[300] = {0.0};
144 //Double_t center[3] = {0.0, 0.0, 0.0};
145 TString name;
146
147 Int_t part = 0, seg = 0, gap = 0, strip = 0;
148
149 //----------XY-----------
150 // Muc
151 TGeoCompositeShape *mucShape = (TGeoCompositeShape*)GetVolumeMuc()->GetShape();
152 //if (mucShape) ;
153
154 //Update by Huang Shuhui: Muc's geometry has changed.
155 TGeoBoolNode *mucBoolNode = mucShape->GetBoolNode();
156 TGeoCompositeShape *mucWithHoleShape = (TGeoCompositeShape*)mucBoolNode->GetLeftShape();
157 TGeoBoolNode *mucWithHoleBoolNode = mucWithHoleShape->GetBoolNode();
158
159 TGeoBBox *mucOuterShape = (TGeoBBox*)mucWithHoleBoolNode->GetLeftShape();
160 TGeoTube *mucInnerShape = (TGeoTube*)mucWithHoleBoolNode->GetRightShape();
161
162 //if (mucOuterShape) ;
163 //if (mucInnerShape) cout << "mucInnerShape name : " << mucInnerShape->GetName() << endl;
164 //else cout << "MucROOTGeo:Init2DGeoometry, mucInnerShape not found" << endl;
165
166 Double_t mucOuterR = mucOuterShape->GetDX();
167 Double_t mucInnerR = mucInnerShape->GetRmax() + 40.0; // 40.0 is the height of first gap
168
169 // Barrel
170 // barrel segment XY view
171
172 part = 1;
173 Int_t xySegPointSeq[4] = {0,1,1,0}; // point 0,1,2,3 -> 0,1,1,0
174 for (seg = 0; seg < GetSegNb(part); seg++) {
175 name = TString("MucBarrelSeg");
176 name += seg;
177 for (Int_t iPoint = 0; iPoint < 4; iPoint++) {
178 if (iPoint < 2) r = mucInnerR/TMath::Cos(TMath::Pi()/8.0);
179 else r = mucOuterR/TMath::Cos(TMath::Pi()/8.0);
180 phi = TMath::Pi()/8.0 * (2*seg-1 + 2*xySegPointSeq[iPoint]);
181 x = r * TMath::Cos(phi);
182 y = r * TMath::Sin(phi);
183 z = 0.0;
184 P[3*iPoint] = x;
185 P[3*iPoint+1] = y;
186 P[3*iPoint+2] = z;
187 }
188 m_MucXY[part][seg] = new BesPolygon2D(name, name, 4, &P[0]);
189 m_MucXY[part][seg]->SetFillColor(mucColor);
190 m_MucXY[part][seg]->SetFillStyle(mucXYStyle);
191 m_MucXY[part][seg]->SetLineColor(mucLineColor);
192 }
193
194 // barrel segment ZR view
195
196 part = 1;
197 for (seg = 0; seg < GetSegNb(part); seg++) {
198 for (Int_t iPoint = 0; iPoint < 4; iPoint++) {
199 if (iPoint == 0 || iPoint == 3 ) r = mucInnerR;
200 else r = mucOuterR;
201 phi = TMath::Pi()/4.0 * seg;
202
203 x = r * TMath::Cos(phi);
204 y = r * TMath::Sin(phi);
205
206 TGeoVolume *volAbsorber = 0;
207 volAbsorber= GetAbsorber(part, seg, 0)->GetVolume();
208 TGeoBBox *absorberShape = (TGeoBBox*)volAbsorber->GetShape();
209 if (seg == 2)cout<<"in MucROOTGeo::Init2DGeometry() x,y,z = "<<absorberShape->GetDX()<<" "<<absorberShape->GetDY()<<" "<<absorberShape->GetDZ()<<endl;
210 Double_t dy = absorberShape->GetDY();
211 z = dy;
212 if (iPoint < 2) z = -dy;
213
214 P[3*iPoint] = x;
215 P[3*iPoint+1] = y;
216 P[3*iPoint+2] = z;
217 }
218
219 if (seg == 2 || seg == 6) {
220 if (seg == 2) name = TString("MucBarrelUpSeg");
221 if (seg == 6) name = TString("MucBarrelDownSeg");
222
223 m_MucZR[part][seg] = new BesPolygon2D(name, name, 4, &P[0]);
224 m_MucZR[part][seg]->SetFillColor(mucColor);
225 m_MucZR[part][seg]->SetFillStyle(mucZRStyle);
226 m_MucZR[part][seg]->SetLineColor(mucLineColor);
227 }
228 }
229
230 // barrel gap
231
232 part = 1;
233 for (seg = 0; seg < GetSegNb(part); seg++) {
234 for (gap = 0; gap < GetGapNb(part); gap++) {
235
236 TGeoPhysicalNode *phyNode = 0;
237 phyNode = GetPhysicalGap(part, seg, gap);
238
239 TGeoBBox *gapShape = (TGeoBBox*)phyNode->GetShape();
240 Double_t dx = gapShape->GetDX();
241 Double_t dy = gapShape->GetDY();
242 Double_t dz = gapShape->GetDZ();
243
244 // barrel gap XY view
245 for (Int_t i = 0; i < 4; i++) {
246 local[1] = 0.0; // y
247 switch (i) {
248 case 0:
249 local[0] = -dx;
250 local[2] = -dz;
251 break;
252 case 1:
253 local[0] = dx;
254 local[2] = -dz;
255 break;
256 case 2:
257 local[0] = dx;
258 local[2] = dz;
259 break;
260 case 3:
261 local[0] = -dx;
262 local[2] = dz;
263 break;
264 }
265 phyNode->GetMatrix(-1*phyNode->GetLevel())->LocalToMaster(local, &master[0]); // transform to top
266 for (Int_t j = 0; j < 3; j++) P[3*i+j] = master[j];
267 }
268
269 name = TString("MucBarrelSeg");
270 name += seg;
271 name += TString("Gap");
272 name += gap;
273
274 m_MucXYGap[part][seg][gap] = new BesPolygon2D(name, name, 4, &P[0]);
275 m_MucXYGap[part][seg][gap]->SetFillColor(mucGapColor);
276 m_MucXYGap[part][seg][gap]->SetFillStyle(mucGapStyle);
277 m_MucXYGap[part][seg][gap]->SetLineColor(mucGapLineColor);
278
279 // barrel gap ZR view
280 for (Int_t i = 0; i < 4; i++) {
281 local[0] = 0.0; // x
282 switch (i) {
283 case 0:
284 local[1] = -dy;
285 local[2] = -dz;
286 break;
287 case 1:
288 local[1] = -dy;
289 local[2] = dz;
290 break;
291 case 2:
292 local[1] = dy;
293 local[2] = dz;
294 break;
295 case 3:
296 local[1] = dy;
297 local[2] = -dz;
298 break;
299 }
300 phyNode->GetMatrix(-1*phyNode->GetLevel())->LocalToMaster(local, &master[0]); // transform to top
301 for (Int_t j = 0; j < 3; j++) P[3*i+j] = master[j];
302 }
303
304 if (seg == 2 || seg == 6) {
305 if (seg == 2) {
306 name = TString("MucBarrelUpSegGap");
307 name += gap;
308 }
309 else if (seg == 6) {
310 name = TString("MucBarrelDownSegGap");
311 name += gap;
312 }
313
314 m_MucZRGap[part][seg][gap] = new BesPolygon2D(name, name, 4, &P[0]);
315 m_MucZRGap[part][seg][gap]->SetFillColor(mucGapColor);
316 m_MucZRGap[part][seg][gap]->SetFillStyle(mucGapStyle);
317 m_MucZRGap[part][seg][gap]->SetLineColor(mucGapLineColor);
318 }
319 }
320 }
321 // End cap
322 for (part = 0; part < GetPartNb(); part++) {
323 if (part == 1) continue;
324 for (seg = 0; seg < GetSegNb(part); seg++) {
325 Double_t segP[100];
326 Int_t iSegPoint = 0;
327
328 for (gap = 0; gap < GetGapNb(part); gap++) {
329 TGeoPhysicalNode *phyNode = 0;
330 phyNode = GetPhysicalGap(part, seg, gap);
331
332 Int_t ixyPoint = 0, izrPoint = 0;
333 Int_t nPanel = 3; //4
334 //TGeoCompositeShape *addPanelShape[nPanel];
335 //TGeoTrap *panelShape[nPanel];
336 TGeoCompositeShape *addPanelShape[4];
337 TGeoTrap *panelShape[4];
338
339
340 for (Int_t panel = nPanel-1; panel >= 0; panel--) {
341 if (panel == nPanel-1) addPanelShape[panel] = (TGeoCompositeShape*)GetGap(part, seg, gap)->GetVolume()->GetShape();
342 else addPanelShape[panel] = (TGeoCompositeShape*)addPanelShape[panel+1]->GetBoolNode()->GetLeftShape();
343
344 panelShape[panel] = (TGeoTrap*)addPanelShape[panel]->GetBoolNode()->GetRightShape();
345
346 Double_t *localArb8Point, masterArb8Point[3*8];
347 localArb8Point = panelShape[panel]->GetVertices();
348 for (Int_t i = 0; i < 8; i++) {
349 local[0] = localArb8Point[2*i];
350 local[1] = localArb8Point[2*i+1];
351 if (i < 4) local[2] = panelShape[panel]->GetDz() * (-1.0);
352 else local[2] = panelShape[panel]->GetDz();
353
354 addPanelShape[panel]->GetBoolNode()->GetRightMatrix()->LocalToMaster(local, &master[0]); // transform to gap coordinate
355
356 for (Int_t j = 0; j < 3; j++) local[j] = master[j];
357 phyNode->GetMatrix(-1*phyNode->GetLevel())->LocalToMaster(local, &master[0]); // transform to top
358 for (Int_t j = 0; j < 3; j++) {
359 masterArb8Point[3*i+j] = master[j];
360 }
361 }
362
363 // xy, add point on panel 3 and panel 0 //panel 3 -> panel 2(new geom)
364 if (panel == 2) {
365 Int_t xyPanelPointSeq[4] = {0, 3, 7, 4};
366 for (Int_t i = 0; i < 4; i++) {
367 for (Int_t j = 0; j < 3; j++) {
368 P[3*ixyPoint+j] = masterArb8Point[3*xyPanelPointSeq[i]+j];
369 }
370 ixyPoint++;
371 }
372 }
373 if (panel == 0) {
374 Int_t xyPanelPointSeq[4] = {7, 4, 0, 3};
375 for (Int_t i = 0; i < 4; i++) {
376 for (Int_t j = 0; j < 3; j++) {
377 P[3*ixyPoint+j] = masterArb8Point[3*xyPanelPointSeq[i]+j];
378 }
379 ixyPoint++;
380 }
381 }
382
383 // zr, add point on panel 3 and panel 0, use P from P[100] //panel 3 -> panel 2(new geom)
384 if (panel == 2) {
385 Int_t zrPanelPointSeq[4] = {4, 7, 6, 5};
386 for (Int_t i = 0; i < 4; i++) {
387 for (Int_t j = 0; j < 3; j++) {
388 P[100+3*izrPoint+j] = masterArb8Point[3*zrPanelPointSeq[i]+j];
389 }
390 izrPoint++;
391 }
392 }
393 if (panel == 0) {
394 Int_t zrPanelPointSeq[4] = {6, 5, 4, 7};
395 for (Int_t i = 0; i < 4; i++) {
396 for (Int_t j = 0; j < 3; j++) {
397 P[100+3*izrPoint+j] = masterArb8Point[3*zrPanelPointSeq[i]+j];
398 }
399 izrPoint++;
400 }
401 }
402 }
403
404 if (part == 0) name = TString("MucEastEc");
405 else if (part == 2) name = TString("MucWestEc");
406 name += TString("Seg");
407 name += seg;
408 name += TString("Gap");
409 name += gap;
410
411 //cout << name << endl;
412 m_MucXYGap[part][seg][gap] = new BesPolygon2D(name, name, ixyPoint, &P[0]); // ixyPoint = 8
413 m_MucXYGap[part][seg][gap]->SetFillColor(mucGapColor);
414 m_MucXYGap[part][seg][gap]->SetFillStyle(mucGapXYECStyle);
415 m_MucXYGap[part][seg][gap]->SetLineColor(mucGapLineColor);
416
417 m_MucZRGap[part][seg][gap] = new BesPolygon2D(name, name, izrPoint, &P[100]); // izrPoint = 8
418 m_MucZRGap[part][seg][gap]->SetFillColor(mucGapColor);
419 m_MucZRGap[part][seg][gap]->SetFillStyle(mucGapStyle);
420 m_MucZRGap[part][seg][gap]->SetLineColor(mucGapLineColor);
421
422 // end cap segment ZR view
423
424 if (gap == 0) {
425 Double_t zrFirstAbsorberHeight = ((TGeoBBox*)GetAbsorber(part, seg, 0)->GetVolume()->GetShape())->GetDZ()*2.0;
426 for (Int_t i = 0; i < 4; i++) {
427 for (Int_t j = 0; j < 3; j++) {
428 if ( (part == 0 && (seg == 0 || seg == 2)) || (part == 2 && (seg == 1 || seg == 3)) ) {
429 Int_t zrSegPointSeq[4] = {6, 7, 0, 1};
430 segP[3*iSegPoint+j] = P[100+3*zrSegPointSeq[i]+j];
431 }
432 else {
433 Int_t zrSegPointSeq[4] = {5, 4, 3, 2};
434 segP[3*iSegPoint+j] = P[100+3*zrSegPointSeq[i]+j];
435 }
436
437 if (j == 2) {
438 if (part == 0) segP[3*iSegPoint+j] -= zrFirstAbsorberHeight;
439 else if (part == 2) segP[3*iSegPoint+j] += zrFirstAbsorberHeight;
440 }
441 }
442 iSegPoint++;
443 }
444 }
445 else if (gap == 7) {
446 Double_t zrLastAbsorberHeight = ((TGeoBBox*)GetAbsorber(part, seg, 8)->GetVolume()->GetShape())->GetDZ()*2.0;
447 for (Int_t i = 0; i < 4; i++) {
448 for (Int_t j = 0; j < 3; j++) {
449 if ( (part == 0 && (seg == 0 || seg == 2)) || (part == 2 && (seg == 1 || seg == 3)) ){
450 Int_t zrSegPointSeq[4] = {2, 3, 4, 5};
451 segP[3*iSegPoint+j] = P[100+3*zrSegPointSeq[i]+j];
452 }
453 else {
454 Int_t zrSegPointSeq[4] = {1, 0, 7, 6};
455 segP[3*iSegPoint+j] = P[100+3*zrSegPointSeq[i]+j];
456 }
457
458 if (j == 2) {
459 if (part == 0) segP[3*iSegPoint+j] += zrLastAbsorberHeight;
460 else if (part == 2) segP[3*iSegPoint+j] -= zrLastAbsorberHeight;
461 }
462 }
463 iSegPoint++;
464 }
465 }
466
467 }
468 if (part == 0) name = TString("MucEastEc");
469 else if (part == 2) name = TString("MucWestEc");
470 name += TString("Seg");
471 name += seg;
472 m_MucZR[part][seg] = new BesPolygon2D(name, name, iSegPoint, &segP[0]); // izrPoint = 8
473 m_MucZR[part][seg]->SetFillColor(mucColor);
474 m_MucZR[part][seg]->SetFillStyle(mucZRStyle);
475 m_MucZR[part][seg]->SetLineColor(mucLineColor);
476 }
477 }
478
479 for (part = 0; part < GetPartNb(); part++) {
480 for (seg = 0; seg < GetSegNb(part); seg++) {
481 for (gap = 0; gap < GetGapNb(part); gap++) {
482 for (strip = 0; strip < GetStripNb(part, seg, gap); strip++) {
483 TGeoPhysicalNode *phyNode = 0;
484 phyNode = GetPhysicalStrip(part, seg, gap, strip);
485 TGeoBBox *stripShape = (TGeoBBox*)phyNode->GetShape();
486 Double_t dx = stripShape->GetDX();
487 Double_t dy = stripShape->GetDY();
488 Double_t dz = stripShape->GetDZ();
489 dz *= m_kStripZMuliple;
490
491 for (Int_t i = 0; i < 8; i++) {
492 switch (i) {
493 case 0:
494 local[0] = -dx;
495 local[1] = -dy;
496 local[2] = -dz;
497 break;
498 case 1:
499 local[0] = dx;
500 local[1] = -dy;
501 local[2] = -dz;
502 break;
503 case 2:
504 local[0] = dx;
505 local[1] = dy;
506 local[2] = -dz;
507 break;
508 case 3:
509 local[0] = -dx;
510 local[1] = dy;
511 local[2] = -dz;
512 break;
513 case 4:
514 local[0] = -dx;
515 local[1] = -dy;
516 local[2] = dz;
517 break;
518 case 5:
519 local[0] = dx;
520 local[1] = -dy;
521 local[2] = dz;
522 break;
523 case 6:
524 local[0] = dx;
525 local[1] = dy;
526 local[2] = dz;
527 break;
528 case 7:
529 local[0] = -dx;
530 local[1] = dy;
531 local[2] = dz;
532 break;
533 }
534
535 phyNode->GetMatrix(-1*phyNode->GetLevel())->LocalToMaster(local, &master[0]); // transform to top
536 for (Int_t j = 0; j < 3; j++) P[3*i+j] = master[j];
537 }
538
539 name = TString("Muc Part");
540 name += part;
541 name += TString(" Seg");
542 name += seg;
543 name += TString(" Gap");
544 name += gap;
545 name += TString(" Strip");
546 name += strip;
547
548 m_Muc2DStrip[part][seg][gap][strip] = new Muc2DStrip(name, name, 8, &P[0], part, seg, gap, strip);
549 }
550 }
551 }
552 }
553}
double P(RecMdcKalTrack *trk)
Double_t x[10]
TGeoNode * GetAbsorber(int part, int seg, int absorber)
Get absorber node;
TGeoNode * GetGap(int part, int seg, int gap)
Get absorber node;
double y[1000]

Referenced by BesGeometry::InitGeometry().

◆ InitFromGDML()

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

Initialize ROOTGeo from GDML.

Definition at line 102 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

103{
104 m_ROOTGeoInit = 2;
105
106 ReadGdml(gdmlFile, setupName);
107 SetNode();
108}
void SetNode()
Set the pointers to theirs nodes;.
void ReadGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of ROOTGeo.

Referenced by BesGeometry::InitFromGDML().

◆ InitFromGdml()

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

Initialize the instance of ROOTGeo.

Definition at line 59 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

60{
61 ReadGdml(gdmlFile, setupName);
62 SetNode();
63 //SetDefaultVis();
64
65 m_ROOTGeoInit = 1;
66}

Referenced by MucROOTGeo().

◆ InitFromROOT()

void MucROOTGeo::InitFromROOT ( TGeoVolume * vol)

Initialize ROOTGeo from TGeoVolume logicalMuc.

Definition at line 111 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

112{
113 m_ROOTGeoInit = 1;
114
115 SetVolumeMuc(vol);
116 SetNode();
117}
void SetVolumeMuc(TGeoVolume *vol)
Set Muc volume, while initializing from ROOT;.

Referenced by BesGeometry::InitFromROOT().

◆ IsZRVisible()

Bool_t MucROOTGeo::IsZRVisible ( int part,
int seg )

Is a segment visible in ZR view.

Definition at line 1437 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1438{
1439 if (part != 1) return true;
1440
1441 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1442 Double_t viewPhi = view->GetLongitude();
1443 viewPhi = Range360(viewPhi);
1444
1445 Int_t viewSeg = Int_t(viewPhi/45.0+0.5);
1446 Int_t upSeg = viewSeg+2;
1447 Int_t downSeg = viewSeg-2;
1448 if (upSeg < 0) upSeg += 8;
1449 else if (upSeg >= 8) upSeg -= 8;
1450 if (downSeg < 0) downSeg += 8;
1451 else if (downSeg >= 8) downSeg -= 8;
1452
1453 if (seg == upSeg || seg == downSeg) return true;
1454 else return false;
1455}
Double_t GetLongitude()
Definition BesTView.h:95
Double_t Range360(Double_t input)
Get input value 0~360.

◆ Range360()

Double_t MucROOTGeo::Range360 ( Double_t input)

Get input value 0~360.

Definition at line 1458 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1459{
1460 if (input >= 360.0) {
1461 do {
1462 input -= 360.0;
1463 }
1464 while (input >= 360.0);
1465 }
1466 else if (input < 0.0) {
1467 do {
1468 input += 360.0;
1469 }
1470 while (input < 0.0);
1471 }
1472
1473 return input;
1474}

Referenced by IsZRVisible().

◆ SetAllVisible() [1/2]

void MucROOTGeo::SetAllVisible ( )

Set all visible;.

Definition at line 187 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

188{
189 for (int part = 0; part < m_kPart; part++) {
190 for (int seg = 0; seg < m_kSeg[part]; seg++) {
191 for (int absorber = 0; absorber < m_kAbsorber[part]; absorber++) {
192 if(part == 1) {
193 GetVolumeAbsorber(part, seg, absorber)->SetVisibility(1);
194 }
195 else {
196 GetVolumeAbsorber(part, seg, absorber)->SetVisibility(0);
197 for (int panel = 0; panel < m_kPanel[part]; panel++) {
198 GetVolumeAbsorberPanel(part, seg, absorber, panel)->SetVisibility(1);
199 }
200 }
201 }
202
203 for (int gap = 0; gap < m_kGap[part]; gap++) {
204 GetVolumeGap(part, seg, gap)->SetVisibility(0);
205 for (int strip = 0; strip < m_StripNum[part][seg][gap]; strip++) {
206 GetVolumeStrip(part, seg, gap, strip)->SetVisibility(0);
207 }
208
209 for (int panel = 0; panel < m_kPanel[part]; panel++) {
210 for(int bakelite = 0; bakelite < m_kBakelite; bakelite++) {
211 GetVolumeBakelite(part, seg, gap, panel, bakelite)->SetVisibility(1);
212 }
213 for (int gasChamber = 0; gasChamber < m_kGasChamber; gasChamber++) {
214 GetVolumeGasChamber(part, seg, gap, panel, gasChamber)->SetVisibility(1);
215 }
216 }
217 }
218 }
219 }
220
221 for (int part = 0; part < m_kPart; part++) {
222 for (int seg = 0; seg < m_kSeg[part]; seg++) {
223 for (int gap = 0; gap < m_kGap[part]; gap++) {
224 GetGap(part, seg, gap)->SetVisibility(1);
225 for (int strip = 0; strip < m_StripNum[part][seg][gap]; strip++) {
226 GetStrip(part, seg, gap, strip)->SetVisibility(0);
227 }
228 }
229 }
230 }
231}
TGeoVolume * GetVolumeGasChamber(int part, int seg, int gap, int panel, int gasChamber)
Get rpc gas chamber volume;
TGeoVolume * GetVolumeBakelite(int part, int seg, int gap, int panel, int bakelite)
Get rpc bakelite volume;
TGeoVolume * GetVolumeAbsorberPanel(int part, int seg, int absorber, int panel)
Get absorber panel volume;
TGeoVolume * GetVolumeGap(int part, int seg, int gap)
Get gap volume;
TGeoVolume * GetVolumeStrip(int part, int seg, int gap, int strip)
Get strip volume;
TGeoNode * GetStrip(int part, int seg, int gap, int strip)
Get strip node;

◆ SetAllVisible() [2/2]

void MucROOTGeo::SetAllVisible ( )

Set all visible;.

◆ SetDefaultVis()

void MucROOTGeo::SetDefaultVis ( )

Set default visual attributes;.

Definition at line 121 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

122{
123 //std::cout << "begin of set defaultvis" << std::endl;
124 int mucColor = 2;
125 int absorberColor = 2;
126 int gapColor = 8;
127 int gasChamberColor = 8;
128 int bakeliteColor = 8;
129 int stripColor = 6;
130
131 m_Muc->SetLineColor(mucColor);
132 m_Muc->SetVisibility(0);
133
134 for (int part = 0; part < m_kPart; part++) {
135 for (int seg = 0; seg < m_kSeg[part]; seg++) {
136 for (int absorber = 0; absorber < m_kAbsorber[part]; absorber++) {
137 GetVolumeAbsorber(part, seg, absorber)->SetLineColor(absorberColor);
138 GetVolumeAbsorber(part, seg, absorber)->SetVisibility(0);
139 if (part != 1) {
140 for (int panel = 0; panel < m_kPanel[part]; panel++) {
141 GetVolumeAbsorberPanel(part, seg, absorber, panel)->SetLineColor(absorberColor);
142 GetVolumeAbsorberPanel(part, seg, absorber, panel)->SetVisibility(0);
143 }
144 }
145 }
146
147 for (int gap = 0; gap < m_kGap[part]; gap++) {
148 GetVolumeGap(part, seg, gap)->SetLineColor(gapColor);
149 GetVolumeGap(part, seg, gap)->SetVisibility(0);
150 GetVolumeStripPlane(part, seg, gap)->SetLineColor(gapColor);
151 GetVolumeStripPlane(part, seg, gap)->SetVisibility(0);
152
153 for (int strip = 0; strip < m_StripNum[part][seg][gap]; strip++) {
154 GetVolumeStrip(part, seg, gap, strip)->SetLineColor(stripColor);
155 GetVolumeStrip(part, seg, gap, strip)->SetVisibility(1);
156 }
157
158 for (int panel = 0; panel < m_kPanel[part]; panel++) {
159 for(int bakelite = 0; bakelite < m_kBakelite; bakelite++) {
160 GetVolumeBakelite(part, seg, gap, panel, bakelite)->SetLineColor(bakeliteColor);
161 GetVolumeBakelite(part, seg, gap, panel, bakelite)->SetVisibility(0);
162 }
163 for (int gasChamber = 0; gasChamber < m_kGasChamber; gasChamber++) {
164 GetVolumeGasChamber(part, seg, gap, panel, gasChamber)->SetLineColor(gasChamberColor);
165 GetVolumeGasChamber(part, seg, gap, panel, gasChamber)->SetVisibility(0);
166 }
167 }
168 }
169 }
170 }
171
172 for (int part = 0; part < m_kPart; part++) {
173 for (int seg = 0; seg < m_kSeg[part]; seg++) {
174 for (int gap = 0; gap < m_kGap[part]; gap++) {
175 GetGap(part, seg, gap)->SetVisibility(0);
176 for (int strip = 0; strip < m_StripNum[part][seg][gap]; strip++) {
177 GetStrip(part, seg, gap, strip)->SetVisibility(0);
178 }
179 }
180 }
181 }
182
183 //std::cout << "end of set defaultvis" << std::endl;
184}
TGeoVolume * GetVolumeStripPlane(int part, int seg, int gap)
Get strip plane volume;.

◆ SetDetector()

void MucROOTGeo::SetDetector ( )

Set Detecor (what is detector depends on you)

Definition at line 1023 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1024{
1025 BesView *view = 0;
1026 if (gPad) view = dynamic_cast<BesView*>(gPad->GetView());
1027
1028 m_DetectorsArray->Clear();
1029 for (int part = 0; part < GetPartNb(); part++) {
1030 for (int seg = 0; seg < GetSegNb(part); seg++) {
1031 for (int gap = 0; gap < GetGapNb(part); gap++) {
1032 TGeoPhysicalNode *phyNode = 0;
1033 phyNode = GetPhysicalGap(part, seg, gap);
1034 if (phyNode) {
1035 phyNode->SetVisibility(0); // set all invisible before set any visible
1036 if ( (part == 1 && seg <= 8) ||
1037 (part == 0 && seg <= 3) ||
1038 (part == 2 && seg <= 3) ) {
1039 m_DetectorsArray->Add( phyNode );
1040 }
1041 else if (view && view->GetVisFull3DMuc()) {
1042 m_DetectorsArray->Add( phyNode );
1043 }
1044 }
1045 }
1046 for (int absorber = 0; absorber < GetAbsorberNb(part); absorber++) {
1047 for (int panel = 0; panel < m_kPanelMax; panel++) {
1048 TGeoPhysicalNode *phyNode = 0;
1049 phyNode = GetPhysicalAbsorber(part, seg, absorber, panel);
1050 if (phyNode) {
1051 phyNode->SetVisibility(0);
1052 if ( (part == 1 && seg <= 8) ||
1053 (part == 0 && seg <= 3) ||
1054 (part == 2 && seg <= 3) ) {
1055 m_DetectorsArray->Add( phyNode );
1056 }
1057 else if (view && view->GetVisFull3DMuc()) {
1058 m_DetectorsArray->Add( phyNode );
1059 }
1060 }
1061 }
1062 }
1063 }
1064 }
1065
1066}
Bool_t GetVisFull3DMuc()
Definition BesView.h:164

Referenced by BesClient::HandleViewOptionMenu().

◆ SetHalfVisible()

void MucROOTGeo::SetHalfVisible ( )

Set half visible;.

Definition at line 894 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

895{
896 for (int part = 0; part < m_kPart; part++) {
897 for (int seg = 0; seg < m_kSeg[part]; seg++) {
898 for (int absorber = 0; absorber < m_kAbsorber[part]; absorber++) {
899 if (part == 1) {
900 if (seg < 3 || seg > 5) GetVolumeAbsorber(part, seg, absorber)->SetVisibility(1);
901 }
902 else {
903 GetVolumeAbsorber(part, seg, absorber)->SetVisibility(0);
904 for (int panel = 0; panel < m_kPanel[part]; panel++) {
905 if (seg == 0 || seg == 3) GetVolumeAbsorberPanel(part, seg, absorber, panel)->SetVisibility(1);
906 }
907 }
908 }
909
910 for (int gap = 0; gap < m_kGap[part]; gap++) {
911 if (part == 1 && (seg < 3 || seg > 5)) {
912 GetVolumeGap(part, seg, gap)->SetVisibility(1);
913 GetGap(part, seg, gap)->SetVisibility(1);
914 }
915 else {
916 GetVolumeGap(part, seg, gap)->SetVisibility(0);
917 GetGap(part, seg, gap)->SetVisibility(0);
918 }
919 for (int strip = 0; strip < m_StripNum[part][seg][gap]; strip++) {
920 GetVolumeStrip(part, seg, gap, strip)->SetVisibility(0);
921 }
922
923// for (int panel = 0; panel < m_kPanel[part]; panel++) {
924// for (int bakelite = 0; bakelite < m_kBakelite; bakelite++) {
925// if (part != 1 && (seg == 0 || seg == 3)) GetVolumeBakelite(part, seg, gap, panel, bakelite)->SetVisibility(1);
926// }
927// for (int gasChamber = 0; gasChamber < m_kGasChamber; gasChamber++) {
928// if (part != 1 && (seg == 0 || seg == 3)) GetVolumeGasChamber(part, seg, gap, panel, gasChamber)->SetVisibility(1);
929// }
930// }
931 }
932 }
933 }
934}

◆ SetHits()

void MucROOTGeo::SetHits ( )

Set all physicalNodes corresponding to digiCol;.

Definition at line 1069 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1070{
1071 // set previous event hits to default vis
1072 for (int i = 0; i < m_HitsArray->GetEntries(); i++) {
1073 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_HitsArray->At(i);
1074 phyNode->SetLineColor(m_stripColor);
1075 phyNode->SetVisibility(0);
1076 }
1077 m_HitsArray->Clear("C");
1078
1079 // set previous event 2D hits info to default
1080 for (int i = 0; i < m_2DHitsArray->GetEntries(); i++) {
1081 Muc2DStrip *aStrip = (Muc2DStrip*)m_2DHitsArray->At(i);
1082 aStrip->ClearInfo();
1083 aStrip->AddInfo(aStrip->GetTitle());
1084 aStrip->CloseInfo();
1085 }
1086 m_2DHitsArray->Clear("C");
1087
1088 //Long Peixun's update: Consider gEvent == NULL
1089 int NDigiCol = 0;
1090 if (gEvent)
1091 {
1092 m_MucDigiCol = gEvent->GetMucDigiCol();
1093 //Long Peixun's update: Consider m_MucDigiCol == NULL
1094 if (m_MucDigiCol) NDigiCol = m_MucDigiCol->GetEntries();
1095 else NDigiCol = 0;
1096 }
1097
1098 for (int i = 0; i < NDigiCol; i++) {
1099 Identifier aMucID( ((TMucDigi*)m_MucDigiCol->At(i))->getIntId() );
1100 int part = MucID::part( aMucID );
1101 int seg = MucID::seg( aMucID );
1102 int gap = MucID::gap( aMucID );
1103 int strip = MucID::strip( aMucID );
1104
1105 TGeoPhysicalNode *phyNode = GetPhysicalStrip( part, seg, gap, strip ); //Long Peixun's update: code optimization
1106 if (phyNode) m_HitsArray->Add( phyNode );
1107
1108 Muc2DStrip *aStrip = 0;
1109 aStrip = m_Muc2DStrip[part][seg][gap][strip];
1110 if (aStrip) {
1111 aStrip->ClearInfo();
1112 aStrip->AddInfo(aStrip->GetTitle());
1113
1114 char data[100];
1115 sprintf(data, "Fired");
1116 aStrip->AddInfo( TString(data) );
1117
1118 aStrip->CloseInfo();
1119
1120 m_2DHitsArray->Add(aStrip);
1121 }
1122 }
1123}
R__EXTERN BesEvent * gEvent
Definition BesEvent.h:279
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)
TTree * data
const TObjArray * GetMucDigiCol() const
Definition BesEvent.h:82
virtual void ClearInfo()
virtual void AddInfo(TString info)
Definition Muc2DStrip.h:35
virtual void CloseInfo()
static int part(const Identifier &id)
Definition MucID.cxx:46
static int gap(const Identifier &id)
Definition MucID.cxx:66
static int seg(const Identifier &id)
Definition MucID.cxx:56
static int strip(const Identifier &id)
Definition MucID.cxx:76

Referenced by BesEvent::SetHits().

◆ SetNode() [1/2]

void MucROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

Definition at line 69 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

70{
71 m_Muc = GetTopVolume();
72 if(!m_Muc) {
73 m_Muc = GetLogicalVolume("logicalMuc");
74 }
75 if(!m_Muc) std::cout << "m_Muc = 0" << std::endl;
76
77 int gapCount = 0;
78 for (int part = 0; part < m_kPart; part++) {
79 for (int seg = 0; seg < m_kSeg[part]; seg++) {
80 for (int gap = 0; gap < m_kGap[part]; gap++) {
81 m_StripNum[part][seg][gap] = GetVolumeStripPlane(part, seg, gap)->GetNdaughters();
82 //std::cout << part << " " << seg << " " << gap << " " << m_StripNum[part][seg][gap] <<" "<<GetVolumeStripPlane(part, seg, gap)->GetName()<< std::endl;
83
84 std::stringstream osnameGap;
85 osnameGap << "pv_" << "l" << "Muc" << "P" << part << "S" << seg << "G" << gap << "_" << gapCount;
86 m_NodeGap[part][seg][gap] = GetNode( osnameGap.str() );
87 gapCount++;
88
89 //cout<<"in MucROOTGeo "<<m_NodeGap[part][seg][gap]->GetName()<<" "<<m_NodeGap[part][seg][gap]->GetDaughter(0)->GetName()<<endl;
90
91 std::stringstream osnameBox;
92 osnameBox << "pv_" << "l" << "Muc" << "P" << part << "S" << seg << "G" << gap << "Al" << "_" << "0";
93 // m_NodeAluminumBox[part][seg][gap] = GetNode( osnameBox.str() );
94 TGeoNode *temp = GetNode( osnameBox.str() );
95
96 int segment = 0; if(part==1&&seg==2) segment = 2;
97 std::stringstream osnameStripPlane;
98 osnameStripPlane << "pv_" << "l" << "Muc" << "P" << part << "S" << segment << "G" << gap << "SP" << "_" << "0";
99 m_NodeStripPlane[part][seg][gap] = GetNode( osnameStripPlane.str() );
100
101 for (int strip = 0; strip < m_StripNum[part][seg][gap]; strip++) {
102 std::stringstream osnameStrip;
103 if(strip < 10) {
104 osnameStrip << "pv_" << "l" << "Muc" << "P" << part << "S" << segment << "G" << gap << "s" << "00" << strip << "_" << strip;
105 }
106 else if(strip < 100) {
107 osnameStrip << "pv_" << "l" << "Muc" << "P" << part << "S" << segment << "G" << gap << "s" << "0" << strip << "_" << strip;
108 }
109 else {
110 osnameStrip << "pv_" << "l" << "Muc" << "P" << part << "S" << segment << "G" << gap << "s" << strip << "_" << strip;
111 }
112
113 m_NodeStrip[part][seg][gap][strip] = GetNode( osnameStrip.str() );
114 }
115 }
116 }
117 }
118}
TGeoNode * GetNode(const std::string &nn)
Get a node(physical volume) by name;.

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

◆ SetNode() [2/2]

void MucROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

◆ SetNoEndVisible()

void MucROOTGeo::SetNoEndVisible ( )

Set noend visible;.

Definition at line 937 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

938{
939 int part = 1;
940 for (int seg = 0; seg < m_kSeg[part]; seg++) {
941 for (int absorber = 0; absorber < m_kAbsorber[part]; absorber++) {
942 GetVolumeAbsorber(part, seg, absorber)->SetVisibility(1);
943 }
944
945 for (int gap = 0; gap < m_kGap[part]; gap++) {
946 GetVolumeGap(part, seg, gap)->SetVisibility(1);
947 GetGap(part, seg, gap)->SetVisibility(1);
948 }
949 }
950}

◆ SetPhysicalDefaultVis()

void MucROOTGeo::SetPhysicalDefaultVis ( )

Definition at line 743 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

744{
745 for (int part = 0; part < GetPartNb(); part++)
746 {
747 for (int seg = 0; seg < GetSegNb(part); seg++)
748 {
749 for (int gap = 0; gap < GetGapNb(part); gap++)
750 {
751 for (int strip = 0; strip < GetStripNb(part, seg, gap); strip++)
752 //Long Peixun's update: gray -> more deep gray
753 GetPhysicalStrip(part, seg, gap, strip)->SetLineColor(922);
754 }
755 }
756 }
757}

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

◆ SetPhysicalNode() [1/2]

void MucROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

Definition at line 278 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

279{
280 int stripColor = 2;
281
282 if (gGeoManager == 0) std::cout << "Create gGeoManager first" << std::endl;
283 TGeoNode *bes = gGeoManager->GetTopNode();
284 TGeoNode *muc = bes->GetDaughter(m_childNo);
285
286 for (int part = 0; part < m_kPart; part++) {
287 for (int seg = 0; seg < m_kSeg[part]; seg++) {
288 for (int gap = 0; gap < m_kGap[part]; gap++) {
289 TGeoNode *nodeGap = GetGap(part, seg, gap);
290 m_PhysicalGap[part][seg][gap] = gGeoManager->MakePhysicalNode( TString("/") + bes->GetName() +
291 TString("/") + muc->GetName() +
292 TString("/") + nodeGap->GetName() +
293 TString("/") + nodeGap->GetDaughter(0)->GetName());
294 m_PhysicalGap[part][seg][gap]->SetVisibility(0);
295 m_PhysicalGap[part][seg][gap]->SetIsVolAtt(kFALSE);
296
297 TGeoNode *nodeStripPlane = GetStripPlane(part, seg, gap);
298 //std::cout << nodeGap->GetName() << " " << nodeStripPlane->GetName() << endl;
299
300 //TGeoNode *nodeBox = GetAluminumBox(part, seg, gap);
301// m_PhysicalAluminumBox[part][seg][gap] = gGeoManager->MakePhysicalNode( TString("/") + bes->GetName() +
302// TString("/") + muc->GetName() +
303// TString("/") + nodeGap->GetName() +
304// TString("/") + nodeGap->GetDaughter(0)->GetName() );
305
306
307 for (int strip = 0; strip < m_StripNum[part][seg][gap]; strip++) {
308 TGeoNode *nodeStrip = GetStrip(part, seg, gap, strip);
309 m_PhysicalStrip[part][seg][gap][strip] = gGeoManager->MakePhysicalNode( TString("/") + bes->GetName() +
310 TString("/") + muc->GetName() +
311 TString("/") + nodeGap->GetName() +
312 TString("/") + nodeGap->GetDaughter(0)->GetName() +
313 TString("/") + nodeStripPlane->GetName() +
314 TString("/") + nodeStrip->GetName() );
315 m_PhysicalStrip[part][seg][gap][strip]->SetVisibility(0);
316 m_PhysicalStrip[part][seg][gap][strip]->SetIsVolAtt(kFALSE);
317 m_PhysicalStrip[part][seg][gap][strip]->SetLineColor(stripColor);
318 }
319 }
320 }
321 }
322}
TGeoNode * GetStripPlane(int part, int seg, int gap)
Get box node;.

Referenced by MucGeoGeneral::InitFromXML(), and BesGeometry::InitGeometry().

◆ SetPhysicalNode() [2/2]

void MucROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

◆ SetQuarterVisible() [1/2]

void MucROOTGeo::SetQuarterVisible ( )

Set quater visible;.

Definition at line 234 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/MucROOTGeo.cxx.

235{
236 for (int part = 0; part < m_kPart; part++) {
237 for (int seg = 0; seg < m_kSeg[part]; seg++) {
238 for (int absorber = 0; absorber < m_kAbsorber[part]; absorber++) {
239 if(part == 1) {
240 if(seg > 2) GetVolumeAbsorber(part, seg, absorber)->SetVisibility(1);
241 }
242 else {
243 GetVolumeAbsorber(part, seg, absorber)->SetVisibility(0);
244 for (int panel = 0; panel < m_kPanel[part]; panel++) {
245 if(seg > 0 && seg < 3) GetVolumeAbsorberPanel(part, seg, absorber, panel)->SetVisibility(1);
246 }
247 }
248 }
249
250 for (int gap = 0; gap < m_kGap[part]; gap++) {
251 if (part == 1 && seg > 2) {
252 GetVolumeGap(part, seg, gap)->SetVisibility(1);
253 GetGap(part, seg, gap)->SetVisibility(1);
254 }
255 else {
256 GetVolumeGap(part, seg, gap)->SetVisibility(0);
257 GetGap(part, seg, gap)->SetVisibility(0);
258 }
259 for (int strip = 0; strip < m_StripNum[part][seg][gap]; strip++) {
260 GetVolumeStrip(part, seg, gap, strip)->SetVisibility(0);
261 }
262
263 for (int panel = 0; panel < m_kPanel[part]; panel++) {
264 for (int bakelite = 0; bakelite < m_kBakelite; bakelite++) {
265 if ((part != 1 && seg > 0 && seg < 3) || (part == 1 && seg > 2)) GetVolumeBakelite(part, seg, gap, panel, bakelite)->SetVisibility(1);
266 }
267 for (int gasChamber = 0; gasChamber < m_kGasChamber; gasChamber++) {
268 if ((part != 1 && seg > 0 && seg < 3) || (part == 1 && seg > 2)) GetVolumeGasChamber(part, seg, gap, panel, gasChamber)->SetVisibility(1);
269 }
270 }
271 }
272 }
273 }
274
275}

◆ SetQuarterVisible() [2/2]

void MucROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetVisMucDetector()

void MucROOTGeo::SetVisMucDetector ( )

Set Muc detector visibility;.

Definition at line 1126 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1127{
1128 BesView *view = 0;
1129 if (gPad) view = dynamic_cast<BesView*>(gPad->GetView());
1130
1131 for (int i = 0; i < m_DetectorsArray->GetEntries(); i++) {
1132 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_DetectorsArray->At(i);
1133 phyNode->SetVisibility(0);
1134
1135 if (view && view->GetVisMucGlobal()) {
1136 int part = GetPart(phyNode);
1137 if (part == 0 && view->GetVisMucEast() ||
1138 part == 1 && view->GetVisMucBarrel() ||
1139 part == 2 && view->GetVisMucWest() )
1140 phyNode->SetVisibility(1);
1141 }
1142 }
1143}
Int_t GetPart(TGeoPhysicalNode *phyNode)
Get part no of a physcial node.

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

◆ SetVisMucHits()

void MucROOTGeo::SetVisMucHits ( )

Set Muc hits visibility;.

Definition at line 1146 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

1147{
1148 BesView *view = 0;
1149 if (gPad) view = dynamic_cast<BesView*>(gPad->GetView());
1150
1151 for (int i = 0; i < m_HitsArray->GetEntries(); i++) {
1152 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_HitsArray->At(i);
1153 if (view && view->GetVisMucHitsGlobal()) {
1154 int part = GetPart(phyNode);
1155 if (part == 0 && view->GetVisMucHitsEast() ||
1156 part == 1 && view->GetVisMucHitsBarrel() ||
1157 part == 2 && view->GetVisMucHitsWest() ) {
1158 phyNode->SetVisibility(1);
1159 continue;
1160 }
1161 phyNode->SetLineColor(922); //Long Peixun's update: Set color despite of visibility
1162 }
1163 phyNode->SetVisibility(0);
1164 }
1165}

Referenced by BesGeometry::Draw3D().

◆ SetVolumeDefaultVis()

void MucROOTGeo::SetVolumeDefaultVis ( )

Set default visual attributes;.

Definition at line 654 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/MucROOTGeo.cxx.

655{
656 m_Muc->SetLineColor(m_MucColor);
657 m_Muc->SetVisibility(0);
658
659 for (int part = 0; part < GetPartNb(); part++) {
660 for (int seg = 0; seg < GetSegNb(part); seg++) {
661 for (int absorber = 0; absorber < GetAbsorberNb(part); absorber++) {
662 GetVolumeAbsorber(part, seg, absorber)->SetLineColor(m_absorberColor);
663 GetVolumeAbsorber(part, seg, absorber)->SetVisibility(0);
664// if (part != 1) {
665// for (int panel = 0; panel < m_kPanel[part]; panel++) {
666// GetVolumeAbsorberPanel(part, seg, absorber, panel)->SetLineColor(m_absorberColor);
667// GetVolumeAbsorberPanel(part, seg, absorber, panel)->SetVisibility(0);
668// }
669// }
670 }
671
672 for (int gap = 0; gap < GetGapNb(part); gap++) {
673 GetVolumeGap(part, seg, gap)->SetLineColor(m_gapColor);
674 GetVolumeGap(part, seg, gap)->SetVisibility(0);
675
676 GetVolumeBox(part, seg, gap)->SetLineColor(m_gapColor);
677 GetVolumeBox(part, seg, gap)->SetVisibility(0);
678
679 if (part == 1){
680 for (int sb = 0; sb < m_kSmallBlockMax; sb++){
681 GetVolumeAbsorberSmallBlock( gap, sb)->SetLineColor(m_absorberColor);
682 GetVolumeAbsorberSmallBlock( gap, sb)->SetVisibility(0);
683 }
684 }
685
686 GetVolumeStripPlane(part, seg, gap)->SetLineColor(m_gapColor);
687 GetVolumeStripPlane(part, seg, gap)->SetVisibility(0);
688
689 for (int strip = 0; strip < GetStripNb(part, seg, gap); strip++) {
690 GetVolumeStrip(part, seg, gap, strip)->SetLineColor(m_stripColor);
691 GetVolumeStrip(part, seg, gap, strip)->SetVisibility(0);
692 }
693
694 for (int up = 0; up < 2; up ++){
695 GetVolumeBoxSurface(part, seg, gap, up)->SetLineColor(m_bakeliteColor); //need change
696 GetVolumeBoxSurface(part, seg, gap, up)->SetVisibility(0);
697 int seg_shift = 0;
698 if (part == 1 && seg == 2)seg_shift = 1;
699 for (int panel = 0; panel < m_kPanel[part] + seg_shift; panel++) {
700 GetVolumeGasChamber(part, seg, gap, up, panel)->SetLineColor(m_gasChamberColor);
701 GetVolumeGasChamber(part, seg, gap, up, panel)->SetVisibility(0);
702
703 GetVolumeGasBorder(part, seg, gap, up, panel)->SetLineColor(m_bakeliteColor);
704 GetVolumeGasBorder(part, seg, gap, up, panel)->SetVisibility(0);
705
706 }
707 for (int panel = 0; panel < m_kBakelitePanel[part][up] + seg_shift; panel++) {
708 for (int bakelite = 0; bakelite < m_kBakelite; bakelite++) {
709 GetVolumeBakelite(part, seg, gap, up, panel, bakelite)->SetLineColor(m_bakeliteColor);
710 GetVolumeBakelite(part, seg, gap, up, panel, bakelite)->SetVisibility(0);
711 }
712 }
713 }
714
715// for (int panel = 0; panel < m_kPanel[part]; panel++) { //comment out 2007.1.2
716// for(int bakelite = 0; bakelite < m_kBakelite; bakelite++) {
717// GetVolumeBakelite(part, seg, gap, panel, bakelite)->SetLineColor(m_bakeliteColor);
718// GetVolumeBakelite(part, seg, gap, panel, bakelite)->SetVisibility(0);
719// }
720// for (int gasChamber = 0; gasChamber < m_kGasChamber; gasChamber++) {
721// GetVolumeGasChamber(part, seg, gap, panel, gasChamber)->SetLineColor(m_gasChamberColor);
722// GetVolumeGasChamber(part, seg, gap, panel, gasChamber)->SetVisibility(0);
723// }
724// }
725 }
726 }
727 }
728
729 for (int part = 0; part < GetPartNb(); part++) {
730 for (int seg = 0; seg < GetSegNb(part); seg++) {
731 for (int gap = 0; gap < GetGapNb(part); gap++) {
732 GetGap(part, seg, gap)->SetVisibility(0);
733 for (int strip = 0; strip < GetStripNb(part, seg, gap); strip++) {
734 GetStrip(part, seg, gap, strip)->SetVisibility(0);
735 }
736 }
737 }
738 }
739
740}
TGeoVolume * GetVolumeBox(int part, int seg, int gap)
Get box volume;
TGeoVolume * GetVolumeGasBorder(int part, int seg, int gap, int panel, int gasChamber)
Get rpc gas border volume;
TGeoVolume * GetVolumeBoxSurface(int part, int seg, int gap, int up)
Get box surface volume;
TGeoVolume * GetVolumeAbsorberSmallBlock(int gap, int sb)
Get absorber small block;.

◆ SetVolumeMuc()

void MucROOTGeo::SetVolumeMuc ( TGeoVolume * vol)
inline

Set Muc volume, while initializing from ROOT;.

Definition at line 101 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/BesVisLib/MucROOTGeo.h.

101{ m_Muc = vol; }

Referenced by InitFromROOT().


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