BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcROOTGeo Class Reference

#include <EmcROOTGeo.h>

Inheritance diagram for EmcROOTGeo:

Public Member Functions

 EmcROOTGeo ()
 Constructor.
 ~EmcROOTGeo ()
 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 GetThetaNb (int part)
 Get number of theta on part;.
int GetPhiNb (int part)
 Get number of phi on part;.
TGeoVolume * GetVolumeEmc ()
 Get Emc volume;.
TGeoVolume * GetVolumePart (int part)
 Get part volume;.
TGeoVolume * GetVolumePhi (int part, int phi)
 Get phi volume;.
TGeoVolume * GetVolumeTheta (int part, int phi, int theta)
 Get theta volume;.
TGeoVolume * GetVolumeCrystal (int part, int phi, int theta)
 Get crystal volume;.
TGeoNode * GetPart (int part)
 Get part node;.
TGeoNode * GetPhi (int part, int phi)
 Get phi node;.
TGeoNode * GetTheta (int part, int phi, int theta)
 Get theta node;.
TGeoNode * GetCrystal (int part, int phi, int theta)
 Get crystal one;.
TGeoPhysicalNode * GetPhysicalCrystal (int part, int phi, int theta)
 Get crystal physical node;.
 EmcROOTGeo ()
 Constructor.
 ~EmcROOTGeo ()
 Destructor.
void InitFromGDML (const char *gdmlFile, const char *setupName)
 Initialize ROOTGeo from GDML.
void InitFromROOT (TGeoVolume *vol)
 Initialize ROOTGeo from TGeoVolume logicalEmc.
void Init2DGeometry ()
 Initialize 2D Geometry.
void SetNode ()
 Set the pointers to theirs nodes;.
void SetVolumeAppendInVis ()
 Set default visual attributes;.
void SetVolumeDefaultVis ()
 Set default visual attributes;.
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 SetPhysicalDefaultVis ()
 Set default physical node attributes;.
void SetDetector ()
 Set Detecor (what is detector depends on you).
void SetHits ()
 Set all physicalNodes corresponding to digiCol;.
void SetVisEmcDetector ()
 Set Emc detector visibility;.
void SetVisEmcHits ()
 Set Emc hits visibility;.
int GetPartNb ()
 Get number of part;.
int GetThetaNb (int part)
 Get number of theta on part;.
int GetPhiNb (int part, int theta)
 Get number of phi on part;.
void SetVolumeEmc (TGeoVolume *vol)
 Set Emc volume, while initializing from ROOT;.
TGeoVolume * GetVolumeEmc ()
 Get Emc volume;.
TGeoVolume * GetVolumePart (int part)
 Get part volume;.
TGeoVolume * GetVolumePhi (int part, int phi)
 Get phi volume;.
TGeoVolume * GetVolumeTheta (int part, int phi, int theta)
 Get theta volume;.
TGeoVolume * GetVolumeCrystal (int part, int phi, int theta)
 Get crystal volume;.
TGeoNode * GetPart (int part)
 Get part node;.
TGeoNode * GetPhi (int part, int phi)
 Get phi node;.
TGeoNode * GetTheta (int part, int phi, int theta)
 Get theta node;.
TGeoNode * GetTheta2 (int part, int phi, int theta)
 Get theta2 node;.
TGeoNode * GetCrystal (int part, int phi, int theta)
 Get crystal one;.
TGeoNode * GetCrystal2 (int part, int phi, int theta)
 Get crystal2 one;.
TGeoPhysicalNode * GetPhysicalCrystal (int part, int phi, int theta)
 Get crystal physical node; all part,phi,theta has a physicalNode.
TGeoPhysicalNode * GetPhysicalCrystal2 (int part, int phi, int theta)
 Get crystal physical node2; EC nb 5,6,14,15,16 in any sector has two physicalNode.
bool HasTwoNodes (int part, int phi, int theta)
 Whether this id is combined of two nodes.
void ComputeThetaPhi (int id, int sector, int nb, int &CryNumberTheta, int &CryNumberPhi)
 Compute theta, phi from sector, nb.
int ComputeEndCopyNb (int num)
 Compute copyNb, copyNb 5,6,14,15,16 corresponding to two volume.
Emc2DCrystalGet2DCrystal (Int_t part, Int_t phi, Int_t theta)
 Get Emc2DCrystal;.
Int_t GetPart (TGeoPhysicalNode *phyNode)
 Get part no of a crystal physcial node.
void Draw (Option_t *option)
 Draw function.
void DrawHits (Option_t *option)
 Draw 2D hits.
void Align (TGeoPhysicalNode *phyNode, TGeoMatrix *newmat=0, TGeoShape *newshape=0, Bool_t check=kFALSE)
 Align a physical node, change its position and shape.
void RestorePhyNode (TGeoPhysicalNode *phyNode, TGeoNode *node)
 Restore the physical node to original shape.
 EmcROOTGeo ()
 Constructor.
 ~EmcROOTGeo ()
 Destructor.
void InitFromGDML (const char *gdmlFile, const char *setupName)
 Initialize ROOTGeo from GDML.
void InitFromROOT (TGeoVolume *vol)
 Initialize ROOTGeo from TGeoVolume logicalEmc.
void Init2DGeometry ()
 Initialize 2D Geometry.
void SetNode ()
 Set the pointers to theirs nodes;.
void SetVolumeAppendInVis ()
 Set default visual attributes;.
void SetVolumeDefaultVis ()
 Set default visual attributes;.
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 SetPhysicalDefaultVis ()
 Set default physical node attributes;.
void SetDetector ()
 Set Detecor (what is detector depends on you).
void SetHits ()
 Set all physicalNodes corresponding to digiCol;.
void SetVisEmcDetector ()
 Set Emc detector visibility;.
void SetVisEmcHits ()
 Set Emc hits visibility;.
int GetPartNb ()
 Get number of part;.
int GetThetaNb (int part)
 Get number of theta on part;.
int GetPhiNb (int part, int theta)
 Get number of phi on part;.
void SetVolumeEmc (TGeoVolume *vol)
 Set Emc volume, while initializing from ROOT;.
TGeoVolume * GetVolumeEmc ()
 Get Emc volume;.
TGeoVolume * GetVolumePart (int part)
 Get part volume;.
TGeoVolume * GetVolumePhi (int part, int phi)
 Get phi volume;.
TGeoVolume * GetVolumeTheta (int part, int phi, int theta)
 Get theta volume;.
TGeoVolume * GetVolumeCrystal (int part, int phi, int theta)
 Get crystal volume;.
TGeoNode * GetPart (int part)
 Get part node;.
TGeoNode * GetPhi (int part, int phi)
 Get phi node;.
TGeoNode * GetTheta (int part, int phi, int theta)
 Get theta node;.
TGeoNode * GetTheta2 (int part, int phi, int theta)
 Get theta2 node;.
TGeoNode * GetCrystal (int part, int phi, int theta)
 Get crystal one;.
TGeoNode * GetCrystal2 (int part, int phi, int theta)
 Get crystal2 one;.
TGeoPhysicalNode * GetPhysicalCrystal (int part, int phi, int theta)
 Get crystal physical node; all part,phi,theta has a physicalNode.
TGeoPhysicalNode * GetPhysicalCrystal2 (int part, int phi, int theta)
 Get crystal physical node2; EC nb 5,6,14,15,16 in any sector has two physicalNode.
bool HasTwoNodes (int part, int phi, int theta)
 Whether this id is combined of two nodes.
void ComputeThetaPhi (int id, int sector, int nb, int &CryNumberTheta, int &CryNumberPhi)
 Compute theta, phi from sector, nb.
int ComputeEndCopyNb (int num)
 Compute copyNb, copyNb 5,6,14,15,16 corresponding to two volume.
Emc2DCrystalGet2DCrystal (Int_t part, Int_t phi, Int_t theta)
 Get Emc2DCrystal;.
Int_t GetPart (TGeoPhysicalNode *phyNode)
 Get part no of a crystal physcial node.
void Draw (Option_t *option)
 Draw function.
void DrawHits (Option_t *option)
 Draw 2D hits.
void Align (TGeoPhysicalNode *phyNode, TGeoMatrix *newmat=0, TGeoShape *newshape=0, Bool_t check=kFALSE)
 Align a physical node, change its position and shape.
void RestorePhyNode (TGeoPhysicalNode *phyNode, TGeoNode *node)
 Restore the physical node to original shape.
 EmcROOTGeo ()
 Constructor.
 ~EmcROOTGeo ()
 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 GetThetaNb (int part)
 Get number of theta on part;.
int GetPhiNb (int part)
 Get number of phi on part;.
TGeoVolume * GetVolumeEmc ()
 Get Emc volume;.
TGeoVolume * GetVolumePart (int part)
 Get part volume;.
TGeoVolume * GetVolumePhi (int part, int phi)
 Get phi volume;.
TGeoVolume * GetVolumeTheta (int part, int phi, int theta)
 Get theta volume;.
TGeoVolume * GetVolumeCrystal (int part, int phi, int theta)
 Get crystal volume;.
TGeoNode * GetPart (int part)
 Get part node;.
TGeoNode * GetPhi (int part, int phi)
 Get phi node;.
TGeoNode * GetTheta (int part, int phi, int theta)
 Get theta node;.
TGeoNode * GetCrystal (int part, int phi, int theta)
 Get crystal one;.
TGeoPhysicalNode * GetPhysicalCrystal (int part, int phi, int theta)
 Get crystal physical node;.
 EmcROOTGeo ()
 Constructor.
 ~EmcROOTGeo ()
 Destructor.
void InitFromGDML (const char *gdmlFile, const char *setupName)
 Initialize ROOTGeo from GDML.
void InitFromROOT (TGeoVolume *vol)
 Initialize ROOTGeo from TGeoVolume logicalEmc.
void Init2DGeometry ()
 Initialize 2D Geometry.
void SetNode ()
 Set the pointers to theirs nodes;.
void SetVolumeAppendInVis ()
 Set default visual attributes;.
void SetVolumeDefaultVis ()
 Set default visual attributes;.
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 SetPhysicalDefaultVis ()
 Set default physical node attributes;.
void SetDetector ()
 Set Detecor (what is detector depends on you).
void SetHits ()
 Set all physicalNodes corresponding to digiCol;.
void SetVisEmcDetector ()
 Set Emc detector visibility;.
void SetVisEmcHits ()
 Set Emc hits visibility;.
int GetPartNb ()
 Get number of part;.
int GetThetaNb (int part)
 Get number of theta on part;.
int GetPhiNb (int part, int theta)
 Get number of phi on part;.
void SetVolumeEmc (TGeoVolume *vol)
 Set Emc volume, while initializing from ROOT;.
TGeoVolume * GetVolumeEmc ()
 Get Emc volume;.
TGeoVolume * GetVolumePart (int part)
 Get part volume;.
TGeoVolume * GetVolumePhi (int part, int phi)
 Get phi volume;.
TGeoVolume * GetVolumeTheta (int part, int phi, int theta)
 Get theta volume;.
TGeoVolume * GetVolumeCrystal (int part, int phi, int theta)
 Get crystal volume;.
TGeoNode * GetPart (int part)
 Get part node;.
TGeoNode * GetPhi (int part, int phi)
 Get phi node;.
TGeoNode * GetTheta (int part, int phi, int theta)
 Get theta node;.
TGeoNode * GetTheta2 (int part, int phi, int theta)
 Get theta2 node;.
TGeoNode * GetCrystal (int part, int phi, int theta)
 Get crystal one;.
TGeoNode * GetCrystal2 (int part, int phi, int theta)
 Get crystal2 one;.
TGeoPhysicalNode * GetPhysicalCrystal (int part, int phi, int theta)
 Get crystal physical node; all part,phi,theta has a physicalNode.
TGeoPhysicalNode * GetPhysicalCrystal2 (int part, int phi, int theta)
 Get crystal physical node2; EC nb 5,6,14,15,16 in any sector has two physicalNode.
bool HasTwoNodes (int part, int phi, int theta)
 Whether this id is combined of two nodes.
void ComputeThetaPhi (int id, int sector, int nb, int &CryNumberTheta, int &CryNumberPhi)
 Compute theta, phi from sector, nb.
int ComputeEndCopyNb (int num)
 Compute copyNb, copyNb 5,6,14,15,16 corresponding to two volume.
Emc2DCrystalGet2DCrystal (Int_t part, Int_t phi, Int_t theta)
 Get Emc2DCrystal;.
Int_t GetPart (TGeoPhysicalNode *phyNode)
 Get part no of a crystal physcial node.
void Draw (Option_t *option)
 Draw function.
void DrawHits (Option_t *option)
 Draw 2D hits.
void Align (TGeoPhysicalNode *phyNode, TGeoMatrix *newmat=0, TGeoShape *newshape=0, Bool_t check=kFALSE)
 Align a physical node, change its position and shape.
void RestorePhyNode (TGeoPhysicalNode *phyNode, TGeoNode *node)
 Restore the physical node to original shape.
 EmcROOTGeo ()
 Constructor.
 ~EmcROOTGeo ()
 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 GetThetaNb (int part)
 Get number of theta on part;.
int GetPhiNb (int part)
 Get number of phi on part;.
TGeoVolume * GetVolumeEmc ()
 Get Emc volume;.
TGeoVolume * GetVolumePart (int part)
 Get part volume;.
TGeoVolume * GetVolumePhi (int part, int phi)
 Get phi volume;.
TGeoVolume * GetVolumeTheta (int part, int phi, int theta)
 Get theta volume;.
TGeoVolume * GetVolumeCrystal (int part, int phi, int theta)
 Get crystal volume;.
TGeoNode * GetPart (int part)
 Get part node;.
TGeoNode * GetPhi (int part, int phi)
 Get phi node;.
TGeoNode * GetTheta (int part, int phi, int theta)
 Get theta node;.
TGeoNode * GetCrystal (int part, int phi, int theta)
 Get crystal one;.
TGeoPhysicalNode * GetPhysicalCrystal (int part, int phi, int theta)
 Get crystal physical node;.
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;.
 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;.
 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;.
 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;.

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 EmcGeo contains all of the objects necessary to describe the emc geometry.

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

Definition at line 30 of file DetectorDescription/ROOTGeo/include/ROOTGeo/EmcROOTGeo.h.

Constructor & Destructor Documentation

◆ EmcROOTGeo() [1/6]

EmcROOTGeo::EmcROOTGeo ( )

Constructor.

Definition at line 31 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

31 {
32 // Default constructor.
33 m_kPhiEc = 16;
34 m_kThetaEc = 35;
35
36 for ( int part = 0; part < m_kPart; part++ )
37 {
38 for ( int phi = 0; phi < m_kPhiBr; phi++ )
39 {
40 for ( int theta = 0; theta < m_kThetaBr; theta++ )
41 {
42 m_NodeTheta[part][phi][theta] = 0;
43 m_PhysicalCrystal[part][phi][theta] = 0;
44 }
45 }
46 }
47
48 string GdmlManagementPath = getenv( "GDMLMANAGEMENTDATAROOT" );
49 if ( GdmlManagementPath == "" ) cout << "EmcROOTGeo::GdmlManagementPath not set!" << endl;
50 string GdmlFile = GdmlManagementPath + string( "/dat/Emc.gdml" );
51 cout << "EmcROOTGeo: Construct Emc from GdmlFile " << GdmlFile << endl;
52 InitFromGdml( GdmlFile.c_str(), "Emc" );
53}
void InitFromGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of ROOTGeo.

◆ ~EmcROOTGeo() [1/6]

EmcROOTGeo::~EmcROOTGeo ( )

Destructor.

Definition at line 55 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

55{}

◆ EmcROOTGeo() [2/6]

EmcROOTGeo::EmcROOTGeo ( )

Constructor.

◆ ~EmcROOTGeo() [2/6]

EmcROOTGeo::~EmcROOTGeo ( )

Destructor.

◆ EmcROOTGeo() [3/6]

EmcROOTGeo::EmcROOTGeo ( )

Constructor.

◆ ~EmcROOTGeo() [3/6]

EmcROOTGeo::~EmcROOTGeo ( )

Destructor.

◆ EmcROOTGeo() [4/6]

EmcROOTGeo::EmcROOTGeo ( )

Constructor.

◆ ~EmcROOTGeo() [4/6]

EmcROOTGeo::~EmcROOTGeo ( )

Destructor.

◆ EmcROOTGeo() [5/6]

EmcROOTGeo::EmcROOTGeo ( )

Constructor.

◆ ~EmcROOTGeo() [5/6]

EmcROOTGeo::~EmcROOTGeo ( )

Destructor.

◆ EmcROOTGeo() [6/6]

EmcROOTGeo::EmcROOTGeo ( )

Constructor.

◆ ~EmcROOTGeo() [6/6]

EmcROOTGeo::~EmcROOTGeo ( )

Destructor.

Member Function Documentation

◆ Align() [1/3]

void EmcROOTGeo::Align ( TGeoPhysicalNode * phyNode,
TGeoMatrix * newmat = 0,
TGeoShape * newshape = 0,
Bool_t check = kFALSE )

Align a physical node, change its position and shape.

Definition at line 1415 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

1416 {
1417 // phyNode->Align(newmat, newshape, check);
1418
1419 if ( !newmat && !newshape ) return;
1420 TGeoNode* node = phyNode->GetNode();
1421
1422 Int_t fLevel = phyNode->GetLevel();
1423 TGeoNode* nnode = 0;
1424 TGeoVolume* vm = phyNode->GetVolume( fLevel - 2 );
1425 // fLevel-2 is good for Emc geometry, use fLevel-1 if I want to use it in TofROOTGeo
1426 TGeoVolume* vd = 0;
1427
1428 TGeoNode* nodeArray[30];
1429 TString orgName = phyNode->GetName();
1430 Int_t i, id;
1431 if ( !phyNode->IsAligned() )
1432 {
1433 for ( i = 0; i <= fLevel - 2; i++ ) { nodeArray[i] = phyNode->GetNode( i ); }
1434
1435 // fLevel-2 is good for Emc geometry,
1436 // in ROOT::TGeoPhysicalNode::Align,
1437 // it starts from 0, so some nodes were lost.
1438 for ( i = fLevel - 2; i < fLevel; i++ )
1439 {
1440 // Get daughter node and its id inside vm
1441 node = phyNode->GetNode( i + 1 );
1442 id = vm->GetIndex( node );
1443
1444 if ( id < 0 )
1445 {
1446 // printf("cannot align node %s",phyNode->GetNode(i+1)->GetName());
1447 return;
1448 }
1449 // Clone daughter volume and node
1450 vd = node->GetVolume()->CloneVolume();
1451 nnode = node->MakeCopyNode();
1452 // Correct pointers to mother and volume
1453 nnode->SetName( node->GetName() );
1454 nnode->SetVolume( vd );
1455 nnode->SetMotherVolume( vm );
1456 // Decouple old node from mother volume and connect new one
1457 vm->GetNodes()->RemoveAt( id );
1458 vm->GetNodes()->AddAt( nnode, id );
1459 nodeArray[i + 1] = nnode;
1460 vm = vd;
1461 }
1462 }
1463 else { nnode = phyNode->GetNode(); }
1464
1465 TString name;
1466 for ( Int_t j = 0; j < phyNode->GetLevel() + 1; j++ )
1467 {
1468 name += "/";
1469 name += nodeArray[j]->GetName();
1470 }
1471 // phyNode->SetPath(name);
1472 phyNode->SetName( name );
1473 phyNode->Refresh();
1474
1475 // Now nnode is a cloned node of the one that need to be aligned
1476 TGeoNodeMatrix* aligned = (TGeoNodeMatrix*)nnode;
1477 vm = nnode->GetMotherVolume();
1478 vd = nnode->GetVolume();
1479 if ( newmat )
1480 {
1481 // Register matrix and make it the active one
1482 if ( !newmat->IsRegistered() ) newmat->RegisterYourself();
1483 aligned->SetMatrix( newmat );
1484 // Update the global matrix for the aligned node
1485 TGeoHMatrix* global = phyNode->GetMatrix();
1486 TGeoHMatrix* up = phyNode->GetMatrix( fLevel - 1 );
1487 *global = up;
1488 global->Multiply( newmat );
1489 }
1490 // Change the shape for the aligned node
1491 if ( newshape ) vd->SetShape( newshape );
1492 // Now we have to re-voxelize the mother volume
1493 vm->SetVoxelFinder( 0 );
1494 vm->Voxelize( "ALL" );
1495 vm->FindOverlaps();
1496 // Eventually check for overlaps
1497 if ( check ) vm->CheckOverlaps();
1498 // phyNode->SetAligned(kTRUE);
1499}

Referenced by RestorePhyNode().

◆ Align() [2/3]

void EmcROOTGeo::Align ( TGeoPhysicalNode * phyNode,
TGeoMatrix * newmat = 0,
TGeoShape * newshape = 0,
Bool_t check = kFALSE )

Align a physical node, change its position and shape.

◆ Align() [3/3]

void EmcROOTGeo::Align ( TGeoPhysicalNode * phyNode,
TGeoMatrix * newmat = 0,
TGeoShape * newshape = 0,
Bool_t check = kFALSE )

Align a physical node, change its position and shape.

◆ ComputeEndCopyNb() [1/3]

int EmcROOTGeo::ComputeEndCopyNb ( int num)

Compute copyNb, copyNb 5,6,14,15,16 corresponding to two volume.

Definition at line 1262 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

1262 {
1263 int copyNb;
1264 switch ( num )
1265 {
1266 case 30: copyNb = 5; break;
1267 case 31: copyNb = 6; break;
1268 case 32: copyNb = 14; break;
1269 case 33: copyNb = 15; break;
1270 case 34: copyNb = 16; break;
1271 default: copyNb = num; break;
1272 }
1273 return copyNb;
1274}

◆ ComputeEndCopyNb() [2/3]

int EmcROOTGeo::ComputeEndCopyNb ( int num)

Compute copyNb, copyNb 5,6,14,15,16 corresponding to two volume.

◆ ComputeEndCopyNb() [3/3]

int EmcROOTGeo::ComputeEndCopyNb ( int num)

Compute copyNb, copyNb 5,6,14,15,16 corresponding to two volume.

◆ ComputeThetaPhi() [1/3]

void EmcROOTGeo::ComputeThetaPhi ( int id,
int sector,
int nb,
int & CryNumberTheta,
int & CryNumberPhi )

Compute theta, phi from sector, nb.

Definition at line 1160 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

1161 {
1162 if ( ( sector >= 0 ) && ( sector < 3 ) ) sector += 16;
1163 if ( ( sector != 7 ) && ( sector != 15 ) )
1164 {
1165 if ( ( nb >= 0 ) && ( nb < 4 ) )
1166 {
1167 CryNumberTheta = 0;
1168 CryNumberPhi = ( sector - 3 ) * 4 + nb;
1169 }
1170 else if ( ( nb >= 4 ) && ( nb < 8 ) )
1171 {
1172 CryNumberTheta = 1;
1173 CryNumberPhi = ( sector - 3 ) * 4 + nb - 4;
1174 }
1175 else if ( ( nb >= 8 ) && ( nb < 13 ) )
1176 {
1177 CryNumberTheta = 2;
1178 CryNumberPhi = ( sector - 3 ) * 5 + nb - 8;
1179 }
1180 else if ( ( nb >= 13 ) && ( nb < 18 ) )
1181 {
1182 CryNumberTheta = 3;
1183 CryNumberPhi = ( sector - 3 ) * 5 + nb - 13;
1184 }
1185 else if ( ( nb >= 18 ) && ( nb < 24 ) )
1186 {
1187 CryNumberTheta = 4;
1188 CryNumberPhi = ( sector - 3 ) * 6 + nb - 18;
1189 }
1190 else if ( ( nb >= 24 ) && ( nb < 30 ) )
1191 {
1192 CryNumberTheta = 5;
1193 CryNumberPhi = ( sector - 3 ) * 6 + nb - 24;
1194 }
1195 }
1196 else // if((sector=7)||(sector==15))
1197 {
1198 if ( ( nb >= 0 ) && ( nb < 4 ) )
1199 {
1200 CryNumberTheta = 0;
1201 CryNumberPhi = ( sector - 3 ) * 4 + 3 - nb;
1202 }
1203 else if ( ( nb >= 4 ) && ( nb < 8 ) )
1204 {
1205 CryNumberTheta = 1;
1206 CryNumberPhi = ( sector - 3 ) * 4 + 7 - nb;
1207 }
1208 else if ( ( nb >= 8 ) && ( nb < 13 ) )
1209 {
1210 CryNumberTheta = 2;
1211 CryNumberPhi = ( sector - 3 ) * 5 + 12 - nb;
1212 }
1213 else if ( ( nb >= 13 ) && ( nb < 18 ) )
1214 {
1215 CryNumberTheta = 3;
1216 CryNumberPhi = ( sector - 3 ) * 5 + 17 - nb;
1217 }
1218 else if ( ( nb >= 18 ) && ( nb < 24 ) )
1219 {
1220 CryNumberTheta = 4;
1221 CryNumberPhi = ( sector - 3 ) * 6 + 23 - nb;
1222 }
1223 else if ( ( nb >= 24 ) && ( nb < 30 ) )
1224 {
1225 CryNumberTheta = 5;
1226 CryNumberPhi = ( sector - 3 ) * 6 + 29 - nb;
1227 }
1228 }
1229
1230 if ( id == 2 )
1231 {
1232 switch ( CryNumberTheta )
1233 {
1234 case 0:
1235 if ( CryNumberPhi < 32 ) CryNumberPhi = 31 - CryNumberPhi;
1236 else CryNumberPhi = 95 - CryNumberPhi;
1237 break;
1238 case 1:
1239 if ( CryNumberPhi < 32 ) CryNumberPhi = 31 - CryNumberPhi;
1240 else CryNumberPhi = 95 - CryNumberPhi;
1241 break;
1242 case 2:
1243 if ( CryNumberPhi < 40 ) CryNumberPhi = 39 - CryNumberPhi;
1244 else CryNumberPhi = 119 - CryNumberPhi;
1245 break;
1246 case 3:
1247 if ( CryNumberPhi < 40 ) CryNumberPhi = 39 - CryNumberPhi;
1248 else CryNumberPhi = 119 - CryNumberPhi;
1249 break;
1250 case 4:
1251 if ( CryNumberPhi < 48 ) CryNumberPhi = 47 - CryNumberPhi;
1252 else CryNumberPhi = 143 - CryNumberPhi;
1253 break;
1254 case 5:
1255 if ( CryNumberPhi < 48 ) CryNumberPhi = 47 - CryNumberPhi;
1256 else CryNumberPhi = 143 - CryNumberPhi;
1257 break;
1258 }
1259 }
1260}

◆ ComputeThetaPhi() [2/3]

void EmcROOTGeo::ComputeThetaPhi ( int id,
int sector,
int nb,
int & CryNumberTheta,
int & CryNumberPhi )

Compute theta, phi from sector, nb.

◆ ComputeThetaPhi() [3/3]

void EmcROOTGeo::ComputeThetaPhi ( int id,
int sector,
int nb,
int & CryNumberTheta,
int & CryNumberPhi )

Compute theta, phi from sector, nb.

◆ Draw() [1/3]

void EmcROOTGeo::Draw ( Option_t * option)

Draw function.

Definition at line 1306 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

1306 {
1307 TString opt = option;
1308 opt.ToUpper();
1309
1310 if ( !m_2DGeoInit ) cout << "EmcROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
1311 BesView* view = dynamic_cast<BesView*>( gPad->GetView() );
1312 if ( !view ) cout << "EmcROOTGeo::Draw(), BesView not found" << endl;
1313
1314 if ( view->GetVisEmcGlobal() )
1315 { // EmcVisGlobal
1316 TString crystalOpt;
1317
1318 // if (opt.Contains("XY")) {
1319 // west part drawn first usually
1320 for ( Int_t part = GetPartNb() - 1; part >= 0; part-- )
1321 {
1322 for ( int theta = 0; theta < GetThetaNb( part ); theta++ )
1323 {
1324 for ( int phi = 0; phi < GetPhiNb( part, theta ); phi++ )
1325 {
1326
1327 if ( m_Emc2DCrystal[part][phi][theta] )
1328 {
1329 // cout << "part " << part << " layer " << layer << " crystal " << crystal << endl;
1330 m_Emc2DCrystal[part][phi][theta]->SetFired( false );
1331 if ( ( part == 0 && view->GetVisEmcEast() ) ||
1332 ( part == 1 && view->GetVisEmcBarrel() ) ||
1333 ( part == 2 && view->GetVisEmcWest() ) )
1334 m_Emc2DCrystal[part][phi][theta]->Draw( crystalOpt );
1335 }
1336 }
1337 }
1338 }
1339 }
1340}
int GetPhiNb(int part)
Get number of phi on part;.
int GetThetaNb(int part)
Get number of theta on part;.

◆ Draw() [2/3]

void EmcROOTGeo::Draw ( Option_t * option)

Draw function.

◆ Draw() [3/3]

void EmcROOTGeo::Draw ( Option_t * option)

Draw function.

◆ DrawHits() [1/3]

void EmcROOTGeo::DrawHits ( Option_t * option)

Draw 2D hits.

Definition at line 1342 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

1342 {
1343 // cout << "EmcROOTGeo::DrawHits" << endl;
1344 BesView* view = dynamic_cast<BesView*>( gPad->GetView() );
1345 if ( !view ) cout << "EmcROOTGeo::DrawHits(), BesView not found" << endl;
1346
1347 // cout << "VisEmcHitsGlobal " << view->GetVisEmcHitsGlobal() << endl;
1348 // cout << "VisEmcHitsEast " << view->GetVisEmcHitsEast() << endl;
1349 // cout << "VisEmcHitsBarrel " << view->GetVisEmcHitsBarrel() << endl;
1350 // cout << "VisEmcHitsWest " << view->GetVisEmcHitsWest() << endl;
1351
1352 if ( view->GetVisEmcHitsGlobal() )
1353 {
1354 // Long Peixun's update: Use m_2DHitsArray which contains ready hits rather than rebuild
1355 // hits
1356 for ( int i = 0; i < m_2DHitsArray->GetEntries(); ++i )
1357 {
1358 Emc2DCrystal* aCrystal = (Emc2DCrystal*)m_2DHitsArray->At( i );
1359 if ( aCrystal && aCrystal->GetCharge() > 5 )
1360 {
1361 if ( ( aCrystal->GetPart() == 0 && view->GetVisEmcHitsEast() ) ||
1362 ( aCrystal->GetPart() == 1 && view->GetVisEmcHitsBarrel() ) ||
1363 ( aCrystal->GetPart() == 2 && view->GetVisEmcHitsWest() ) )
1364 {
1365 aCrystal->SetFired( true );
1366 aCrystal->Draw();
1367 }
1368 }
1369 }
1370
1371 /* // reset time and charge to zero
1372 for (Int_t part = GetPartNb()-1; part >= 0; part--) {
1373 for (int theta = 0; theta < GetThetaNb(part); theta++) {
1374 for (int phi = 0; phi < GetPhiNb(part, theta); phi++) {
1375 if (m_Emc2DCrystal[part][phi][theta]) {
1376 m_Emc2DCrystal[part][phi][theta]->ResetTimeCharge();
1377 //m_Emc2DCrystal[part][phi][theta]->ClearInfo();
1378 }
1379 }
1380 }
1381 }
1382
1383 if (m_EmcDigiCol) {
1384 for (int i = 0; i < m_EmcDigiCol->GetEntries(); i++) {
1385 TEmcDigi *aEmcDigi = (TEmcDigi*)m_EmcDigiCol->At(i);
1386
1387 //cout << aEmcDigi->getIntId() << endl;
1388 Identifier aEmcID( aEmcDigi->getIntId() );
1389 int part = EmcID::barrel_ec( aEmcID );
1390 int theta = EmcID::theta_module( aEmcID );
1391 int phi = EmcID::phi_module( aEmcID );
1392
1393 Emc2DCrystal *aCrystal = 0;
1394 aCrystal = m_Emc2DCrystal[part][phi][theta];
1395
1396 //Double_t charge = Double_t(aEmcDigi->getChargeChannel()) /
1397 EMC_CHARGE_FACTOR; Double_t charge = RawDataUtil::EmcCharge(aEmcDigi->getMeasure(),
1398 aEmcDigi->getChargeChannel());
1399 aCrystal->SetCharge(charge);
1400 //cout << "charge " << aCrystal->GetCharge() << endl;
1401
1402 if (aCrystal&&charge > 5) {
1403 if ( (part == 0 && view->GetVisEmcHitsEast()) ||
1404 (part == 1 && view->GetVisEmcHitsBarrel()) ||
1405 (part == 2 && view->GetVisEmcHitsWest()) ) {
1406 aCrystal->SetFired(true);
1407 aCrystal->Draw();
1408 }
1409 }
1410 }
1411 } */
1412 }
1413}
virtual void Draw(Option_t *option="")

◆ DrawHits() [2/3]

void EmcROOTGeo::DrawHits ( Option_t * option)

Draw 2D hits.

◆ DrawHits() [3/3]

void EmcROOTGeo::DrawHits ( Option_t * option)

Draw 2D hits.

◆ Get2DCrystal() [1/3]

Emc2DCrystal * EmcROOTGeo::Get2DCrystal ( Int_t part,
Int_t phi,
Int_t theta )

Get Emc2DCrystal;.

Definition at line 1276 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

1276 {
1277 if ( m_Emc2DCrystal[part][phi][theta] ) return m_Emc2DCrystal[part][phi][theta];
1278 else return 0;
1279}

◆ Get2DCrystal() [2/3]

Emc2DCrystal * EmcROOTGeo::Get2DCrystal ( Int_t part,
Int_t phi,
Int_t theta )

Get Emc2DCrystal;.

◆ Get2DCrystal() [3/3]

Emc2DCrystal * EmcROOTGeo::Get2DCrystal ( Int_t part,
Int_t phi,
Int_t theta )

Get Emc2DCrystal;.

◆ GetCrystal() [1/6]

TGeoNode * EmcROOTGeo::GetCrystal ( int part,
int phi,
int theta )

Get crystal one;.

Definition at line 465 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

465 {
466 // in fact, br only 44 crystal nodes;
467 return GetTheta( part, phi, theta )->GetDaughter( 0 );
468}
TGeoNode * GetTheta(int part, int phi, int theta)
Get theta node;.

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

◆ GetCrystal() [2/6]

TGeoNode * EmcROOTGeo::GetCrystal ( int part,
int phi,
int theta )

Get crystal one;.

◆ GetCrystal() [3/6]

TGeoNode * EmcROOTGeo::GetCrystal ( int part,
int phi,
int theta )

Get crystal one;.

◆ GetCrystal() [4/6]

TGeoNode * EmcROOTGeo::GetCrystal ( int part,
int phi,
int theta )

Get crystal one;.

◆ GetCrystal() [5/6]

TGeoNode * EmcROOTGeo::GetCrystal ( int part,
int phi,
int theta )

Get crystal one;.

◆ GetCrystal() [6/6]

TGeoNode * EmcROOTGeo::GetCrystal ( int part,
int phi,
int theta )

Get crystal one;.

◆ GetCrystal2() [1/3]

TGeoNode * EmcROOTGeo::GetCrystal2 ( int part,
int phi,
int theta )

Get crystal2 one;.

Definition at line 1128 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

1129{
1130 // in fact, br only 44 crystal nodes;
1131 if ( GetTheta2( part, phi, theta ) == 0 ) return 0;
1132 else return GetTheta2( part, phi, theta )->GetDaughter( 0 );
1133}
TGeoNode * GetTheta2(int part, int phi, int theta)
Get theta2 node;.

Referenced by SetVolumeDefaultVis().

◆ GetCrystal2() [2/3]

TGeoNode * EmcROOTGeo::GetCrystal2 ( int part,
int phi,
int theta )

Get crystal2 one;.

◆ GetCrystal2() [3/3]

TGeoNode * EmcROOTGeo::GetCrystal2 ( int part,
int phi,
int theta )

Get crystal2 one;.

◆ GetPart() [1/9]

TGeoNode * EmcROOTGeo::GetPart ( int part)

Get part node;.

Definition at line 423 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

423 {
424 std::stringstream osname;
425 if ( part == 1 ) { osname << "pv_logicalBSCWorld_2"; }
426 else { osname << "pv_logicalEndWorld_" << 1 - part / 2; }
427 // osname << "pv_" << "logical" << "Emc" << "Part" << (part == 2 ? (part -2) : part) << "_"
428 // << part;
429
430 return GetNode( osname.str() );
431}
TGeoNode * GetNode(const std::string &nn)
Get a node(physical volume) by name;.

Referenced by SetAllVisible(), SetDefaultVis(), SetHits(), SetPhysicalNode(), SetQuarterVisible(), SetVisEmcDetector(), SetVisEmcHits(), and SetVolumeDefaultVis().

◆ GetPart() [2/9]

TGeoNode * EmcROOTGeo::GetPart ( int part)

Get part node;.

◆ GetPart() [3/9]

TGeoNode * EmcROOTGeo::GetPart ( int part)

Get part node;.

◆ GetPart() [4/9]

TGeoNode * EmcROOTGeo::GetPart ( int part)

Get part node;.

◆ GetPart() [5/9]

TGeoNode * EmcROOTGeo::GetPart ( int part)

Get part node;.

◆ GetPart() [6/9]

TGeoNode * EmcROOTGeo::GetPart ( int part)

Get part node;.

◆ GetPart() [7/9]

int EmcROOTGeo::GetPart ( TGeoPhysicalNode * phyNode)

Get part no of a crystal physcial node.

Definition at line 1281 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

1281 {
1282 for ( int part = 0; part < GetPartNb(); part++ )
1283 {
1284 for ( int theta = 0; theta < GetThetaNb( part ); theta++ )
1285 {
1286 for ( int phi = 0; phi < GetPhiNb( part, theta ); phi++ )
1287 {
1288 if ( phyNode == GetPhysicalCrystal( part, phi, theta ) )
1289 {
1290 // cout << "EmcROOTGeo::GetPart()" << part << endl;
1291 return part;
1292 }
1293 if ( phyNode == GetPhysicalCrystal2( part, phi, theta ) )
1294 {
1295 // cout << "EmcROOTGeo::GetPart()" << part << endl;
1296 return part;
1297 }
1298 }
1299 }
1300 }
1301
1302 cout << "EmcROOTGeo::GetPart, this crystal physical node does not exist!" << endl;
1303 return -1;
1304}
TGeoPhysicalNode * GetPhysicalCrystal2(int part, int phi, int theta)
Get crystal physical node2; EC nb 5,6,14,15,16 in any sector has two physicalNode.
TGeoPhysicalNode * GetPhysicalCrystal(int part, int phi, int theta)
Get crystal physical node;.

◆ GetPart() [8/9]

Int_t EmcROOTGeo::GetPart ( TGeoPhysicalNode * phyNode)

Get part no of a crystal physcial node.

◆ GetPart() [9/9]

Int_t EmcROOTGeo::GetPart ( TGeoPhysicalNode * phyNode)

Get part no of a crystal physcial node.

◆ GetPartNb() [1/6]

int EmcROOTGeo::GetPartNb ( )

Get number of part;.

Definition at line 321 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

321 {
322 int part = m_kPart;
323
324 return part;
325}

Referenced by Draw(), GetPart(), Init2DGeometry(), and EmcRecROOTGeo::InitFromXML().

◆ GetPartNb() [2/6]

int EmcROOTGeo::GetPartNb ( )

Get number of part;.

◆ GetPartNb() [3/6]

int EmcROOTGeo::GetPartNb ( )

Get number of part;.

◆ GetPartNb() [4/6]

int EmcROOTGeo::GetPartNb ( )

Get number of part;.

◆ GetPartNb() [5/6]

int EmcROOTGeo::GetPartNb ( )

Get number of part;.

◆ GetPartNb() [6/6]

int EmcROOTGeo::GetPartNb ( )

Get number of part;.

◆ GetPhi() [1/6]

TGeoNode * EmcROOTGeo::GetPhi ( int part,
int phi )

Get phi node;.

Definition at line 433 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

433 {
434 int phiNb = -1;
435 std::stringstream osname;
436 if ( part == 1 )
437 { // barrel
438 phiNb = 308 - phi;
439 osname << "pv_logicalBSCPhi_" << phiNb;
440 }
441 else
442 { // endcap
443 if ( phi >= 0 && phi < 6 ) { osname << "pv_logicalEndPhi0_" << 15 - phi; }
444 else if ( phi >= 8 && phi < 14 ) { osname << "pv_logicalEndPhi0_" << 17 - phi; }
445 else if ( phi == 6 || phi == 14 ) { osname << "pv_logicalEndPhi1_" << ( 30 - phi ) / 8; }
446 else if ( phi == 7 || phi == 15 ) { osname << "pv_logicalEndPhi2_" << ( 15 - phi ) / 8; }
447 }
448 // osname << "pv_" << "logical" << "Emc" << "Part" << (part == 2 ? (part -2) : part) << "Phi"
449 // << phi << "_" << phi;
450
451 return GetNode( osname.str() );
452}

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

◆ GetPhi() [2/6]

TGeoNode * EmcROOTGeo::GetPhi ( int part,
int phi )

Get phi node;.

◆ GetPhi() [3/6]

TGeoNode * EmcROOTGeo::GetPhi ( int part,
int phi )

Get phi node;.

◆ GetPhi() [4/6]

TGeoNode * EmcROOTGeo::GetPhi ( int part,
int phi )

Get phi node;.

◆ GetPhi() [5/6]

TGeoNode * EmcROOTGeo::GetPhi ( int part,
int phi )

Get phi node;.

◆ GetPhi() [6/6]

TGeoNode * EmcROOTGeo::GetPhi ( int part,
int phi )

Get phi node;.

◆ GetPhiNb() [1/6]

int EmcROOTGeo::GetPhiNb ( int part)

Get number of phi on part;.

Definition at line 335 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

335 {
336 int phiNb = m_kPhiBr;
337 if ( part != 1 ) phiNb = m_kPhiEc;
338
339 return phiNb;
340}

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

◆ GetPhiNb() [2/6]

int EmcROOTGeo::GetPhiNb ( int part)

Get number of phi on part;.

◆ GetPhiNb() [3/6]

int EmcROOTGeo::GetPhiNb ( int part)

Get number of phi on part;.

◆ GetPhiNb() [4/6]

int EmcROOTGeo::GetPhiNb ( int part,
int theta )

Get number of phi on part;.

Definition at line 947 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

948{
949 int phiNb = m_kPhiBr;
950 if ( part != 1 )
951 {
952 if ( theta < 2 ) phiNb = 4 * m_kSectorEc;
953 else if ( theta >= 2 && theta < 4 ) phiNb = 5 * m_kSectorEc;
954 else if ( theta >= 4 && theta < m_kThetaEc ) phiNb = 6 * m_kSectorEc;
955 }
956
957 return phiNb;
958}

◆ GetPhiNb() [5/6]

int EmcROOTGeo::GetPhiNb ( int part,
int theta )

Get number of phi on part;.

◆ GetPhiNb() [6/6]

int EmcROOTGeo::GetPhiNb ( int part,
int theta )

Get number of phi on part;.

◆ GetPhysicalCrystal() [1/6]

TGeoPhysicalNode * EmcROOTGeo::GetPhysicalCrystal ( int part,
int phi,
int theta )

Get crystal physical node;.

Definition at line 470 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

470 {
471 if ( m_PhysicalCrystal[part][phi][theta] != 0 )
472 { return m_PhysicalCrystal[part][phi][theta]; }
473 else
474 {
475 std::cout << "PhysicalNode: "
476 << "Part" << part << "Phi" << phi << "Theta" << theta << " not found"
477 << std::endl;
478 return 0;
479 }
480}

Referenced by GetPart(), Init2DGeometry(), EmcRecROOTGeo::InitFromXML(), SetDetector(), SetHits(), and SetPhysicalDefaultVis().

◆ GetPhysicalCrystal() [2/6]

TGeoPhysicalNode * EmcROOTGeo::GetPhysicalCrystal ( int part,
int phi,
int theta )

Get crystal physical node; all part,phi,theta has a physicalNode.

◆ GetPhysicalCrystal() [3/6]

TGeoPhysicalNode * EmcROOTGeo::GetPhysicalCrystal ( int part,
int phi,
int theta )

Get crystal physical node; all part,phi,theta has a physicalNode.

◆ GetPhysicalCrystal() [4/6]

TGeoPhysicalNode * EmcROOTGeo::GetPhysicalCrystal ( int part,
int phi,
int theta )

Get crystal physical node;.

◆ GetPhysicalCrystal() [5/6]

TGeoPhysicalNode * EmcROOTGeo::GetPhysicalCrystal ( int part,
int phi,
int theta )

Get crystal physical node; all part,phi,theta has a physicalNode.

◆ GetPhysicalCrystal() [6/6]

TGeoPhysicalNode * EmcROOTGeo::GetPhysicalCrystal ( int part,
int phi,
int theta )

Get crystal physical node;.

◆ GetPhysicalCrystal2() [1/3]

TGeoPhysicalNode * EmcROOTGeo::GetPhysicalCrystal2 ( int part,
int phi,
int theta )

Get crystal physical node2; EC nb 5,6,14,15,16 in any sector has two physicalNode.

Definition at line 1149 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

1151{
1152 return m_PhysicalCrystal2[part][phi][theta];
1153}

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

◆ GetPhysicalCrystal2() [2/3]

TGeoPhysicalNode * EmcROOTGeo::GetPhysicalCrystal2 ( int part,
int phi,
int theta )

Get crystal physical node2; EC nb 5,6,14,15,16 in any sector has two physicalNode.

◆ GetPhysicalCrystal2() [3/3]

TGeoPhysicalNode * EmcROOTGeo::GetPhysicalCrystal2 ( int part,
int phi,
int theta )

Get crystal physical node2; EC nb 5,6,14,15,16 in any sector has two physicalNode.

◆ GetTheta() [1/6]

TGeoNode * EmcROOTGeo::GetTheta ( int part,
int phi,
int theta )

Get theta node;.

Definition at line 454 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

454 {
455 if ( m_NodeTheta[part][phi][theta] != 0 ) { return m_NodeTheta[part][phi][theta]; }
456 else
457 {
458 std::cout << "Node: "
459 << "Part" << part << "Phi" << phi << "Theta" << theta << " not found"
460 << std::endl;
461 return 0;
462 }
463}

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

◆ GetTheta() [2/6]

TGeoNode * EmcROOTGeo::GetTheta ( int part,
int phi,
int theta )

Get theta node;.

◆ GetTheta() [3/6]

TGeoNode * EmcROOTGeo::GetTheta ( int part,
int phi,
int theta )

Get theta node;.

◆ GetTheta() [4/6]

TGeoNode * EmcROOTGeo::GetTheta ( int part,
int phi,
int theta )

Get theta node;.

◆ GetTheta() [5/6]

TGeoNode * EmcROOTGeo::GetTheta ( int part,
int phi,
int theta )

Get theta node;.

◆ GetTheta() [6/6]

TGeoNode * EmcROOTGeo::GetTheta ( int part,
int phi,
int theta )

Get theta node;.

◆ GetTheta2() [1/3]

TGeoNode * EmcROOTGeo::GetTheta2 ( int part,
int phi,
int theta )

Get theta2 node;.

Definition at line 1116 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

1117{
1118 if ( m_NodeTheta2[part][phi][theta] != 0 ) { return m_NodeTheta2[part][phi][theta]; }
1119 else { return 0; }
1120}

Referenced by GetCrystal2(), and SetVolumeDefaultVis().

◆ GetTheta2() [2/3]

TGeoNode * EmcROOTGeo::GetTheta2 ( int part,
int phi,
int theta )

Get theta2 node;.

◆ GetTheta2() [3/3]

TGeoNode * EmcROOTGeo::GetTheta2 ( int part,
int phi,
int theta )

Get theta2 node;.

◆ GetThetaNb() [1/6]

int EmcROOTGeo::GetThetaNb ( int part)

Get number of theta on part;.

Definition at line 327 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

327 {
328 int thetaNb = m_kThetaBr;
329 if ( part != 1 ) thetaNb = m_kThetaEc;
330
331 return thetaNb;
332 ;
333}

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

◆ GetThetaNb() [2/6]

int EmcROOTGeo::GetThetaNb ( int part)

Get number of theta on part;.

◆ GetThetaNb() [3/6]

int EmcROOTGeo::GetThetaNb ( int part)

Get number of theta on part;.

◆ GetThetaNb() [4/6]

int EmcROOTGeo::GetThetaNb ( int part)

Get number of theta on part;.

◆ GetThetaNb() [5/6]

int EmcROOTGeo::GetThetaNb ( int part)

Get number of theta on part;.

◆ GetThetaNb() [6/6]

int EmcROOTGeo::GetThetaNb ( int part)

Get number of theta on part;.

◆ GetVolumeCrystal() [1/6]

TGeoVolume * EmcROOTGeo::GetVolumeCrystal ( int part,
int phi,
int theta )

Get crystal volume;.

Definition at line 397 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

397 {
398 // part0phi0theta0-34, part0phi6theta0-34, part0phi8theta0-34, part0phi7theta0-34
399 // part1theta0-43
400 std::stringstream osname;
401 if ( part == 1 && theta >= 0 && theta < 44 )
402 {
403 osname << "logical"
404 << "Emc"
405 << "Part" << part << "Theta" << theta << "Crystal";
406 return GetLogicalVolume( osname.str() );
407 }
408 else if ( part == 0 && theta >= 0 && theta < 35 &&
409 ( phi == 0 || phi == 6 || phi == 8 || phi == 7 ) )
410 {
411 osname << "logical"
412 << "Emc"
413 << "Part" << part << "Phi" << phi << "Theta" << theta << "Crystal";
414 return GetLogicalVolume( osname.str() );
415 }
416 else
417 {
418 std::cout << "No volume " << osname.str() << std::endl;
419 return 0;
420 }
421}
TGeoVolume * GetLogicalVolume(const std::string &vn)
Get a logical volume by name;.

Referenced by SetDefaultVis(), and SetVolumeDefaultVis().

◆ GetVolumeCrystal() [2/6]

TGeoVolume * EmcROOTGeo::GetVolumeCrystal ( int part,
int phi,
int theta )

Get crystal volume;.

◆ GetVolumeCrystal() [3/6]

TGeoVolume * EmcROOTGeo::GetVolumeCrystal ( int part,
int phi,
int theta )

Get crystal volume;.

◆ GetVolumeCrystal() [4/6]

TGeoVolume * EmcROOTGeo::GetVolumeCrystal ( int part,
int phi,
int theta )

Get crystal volume;.

◆ GetVolumeCrystal() [5/6]

TGeoVolume * EmcROOTGeo::GetVolumeCrystal ( int part,
int phi,
int theta )

Get crystal volume;.

◆ GetVolumeCrystal() [6/6]

TGeoVolume * EmcROOTGeo::GetVolumeCrystal ( int part,
int phi,
int theta )

Get crystal volume;.

◆ GetVolumeEmc() [1/6]

TGeoVolume * EmcROOTGeo::GetVolumeEmc ( )
inline

Get Emc volume;.

Definition at line 66 of file DetectorDescription/ROOTGeo/include/ROOTGeo/EmcROOTGeo.h.

66{ return m_Emc; }

◆ GetVolumeEmc() [2/6]

TGeoVolume * EmcROOTGeo::GetVolumeEmc ( )
inline

Get Emc volume;.

Definition at line 101 of file EventDisplay/BesVisLib/include/BesVisLib/EmcROOTGeo.h.

101{ return m_Emc; }

◆ GetVolumeEmc() [3/6]

TGeoVolume * EmcROOTGeo::GetVolumeEmc ( )
inline

Get Emc volume;.

Definition at line 101 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/EmcROOTGeo.h.

101{ return m_Emc; }

◆ GetVolumeEmc() [4/6]

TGeoVolume * EmcROOTGeo::GetVolumeEmc ( )
inline

Get Emc volume;.

Definition at line 66 of file InstallArea/x86_64-el9-gcc13-dbg/include/ROOTGeo/EmcROOTGeo.h.

66{ return m_Emc; }

◆ GetVolumeEmc() [5/6]

TGeoVolume * EmcROOTGeo::GetVolumeEmc ( )
inline

Get Emc volume;.

Definition at line 101 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/EmcROOTGeo.h.

101{ return m_Emc; }

◆ GetVolumeEmc() [6/6]

TGeoVolume * EmcROOTGeo::GetVolumeEmc ( )
inline

Get Emc volume;.

Definition at line 66 of file InstallArea/x86_64-el9-gcc13-opt/include/ROOTGeo/EmcROOTGeo.h.

66{ return m_Emc; }

◆ GetVolumePart() [1/6]

TGeoVolume * EmcROOTGeo::GetVolumePart ( int part)

Get part volume;.

Definition at line 342 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

342 {
343 // only part0 and part1 logical volume.
344 std::stringstream osname;
345 osname << "logical"
346 << "Emc"
347 << "Part" << part;
348 if ( part == 0 || part == 1 ) { return GetLogicalVolume( osname.str() ); }
349 else
350 {
351 std::cout << "No volume " << osname.str() << std::endl;
352 return 0;
353 }
354}

Referenced by SetDefaultVis(), and SetVolumeDefaultVis().

◆ GetVolumePart() [2/6]

TGeoVolume * EmcROOTGeo::GetVolumePart ( int part)

Get part volume;.

◆ GetVolumePart() [3/6]

TGeoVolume * EmcROOTGeo::GetVolumePart ( int part)

Get part volume;.

◆ GetVolumePart() [4/6]

TGeoVolume * EmcROOTGeo::GetVolumePart ( int part)

Get part volume;.

◆ GetVolumePart() [5/6]

TGeoVolume * EmcROOTGeo::GetVolumePart ( int part)

Get part volume;.

◆ GetVolumePart() [6/6]

TGeoVolume * EmcROOTGeo::GetVolumePart ( int part)

Get part volume;.

◆ GetVolumePhi() [1/6]

TGeoVolume * EmcROOTGeo::GetVolumePhi ( int part,
int phi )

Get phi volume;.

Definition at line 356 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

356 {
357 // only part0phi0-15, part1phi0-119
358 std::stringstream osname;
359 osname << "logical"
360 << "Emc"
361 << "Part" << part << "Phi" << phi;
362 if ( ( part == 0 && phi >= 0 && phi < 16 ) || ( part == 1 && phi >= 0 && phi < 120 ) )
363 { return GetLogicalVolume( osname.str() ); }
364 else
365 {
366 std::cout << "No volume " << osname.str() << std::endl;
367 return 0;
368 }
369}

Referenced by SetDefaultVis(), and SetVolumeDefaultVis().

◆ GetVolumePhi() [2/6]

TGeoVolume * EmcROOTGeo::GetVolumePhi ( int part,
int phi )

Get phi volume;.

◆ GetVolumePhi() [3/6]

TGeoVolume * EmcROOTGeo::GetVolumePhi ( int part,
int phi )

Get phi volume;.

◆ GetVolumePhi() [4/6]

TGeoVolume * EmcROOTGeo::GetVolumePhi ( int part,
int phi )

Get phi volume;.

◆ GetVolumePhi() [5/6]

TGeoVolume * EmcROOTGeo::GetVolumePhi ( int part,
int phi )

Get phi volume;.

◆ GetVolumePhi() [6/6]

TGeoVolume * EmcROOTGeo::GetVolumePhi ( int part,
int phi )

Get phi volume;.

◆ GetVolumeTheta() [1/6]

TGeoVolume * EmcROOTGeo::GetVolumeTheta ( int part,
int phi,
int theta )

Get theta volume;.

Definition at line 371 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

371 {
372 // part0phi0theta0-34, part0phi6theta0-34, part0phi8theta0-34, part0phi7theta0-34
373 // part1theta0-43
374 std::stringstream osname;
375 if ( part == 1 && theta >= 0 && theta < 44 )
376 {
377 osname << "logical"
378 << "Emc"
379 << "Part" << part << "Theta" << theta;
380 return GetLogicalVolume( osname.str() );
381 }
382 else if ( part == 0 && theta >= 0 && theta < 35 &&
383 ( phi == 0 || phi == 6 || phi == 8 || phi == 7 ) )
384 {
385 osname << "logical"
386 << "Emc"
387 << "Part" << part << "Phi" << phi << "Theta" << theta;
388 return GetLogicalVolume( osname.str() );
389 }
390 else
391 {
392 std::cout << "No volume " << osname.str() << std::endl;
393 return 0;
394 }
395}

Referenced by SetDefaultVis(), and SetVolumeDefaultVis().

◆ GetVolumeTheta() [2/6]

TGeoVolume * EmcROOTGeo::GetVolumeTheta ( int part,
int phi,
int theta )

Get theta volume;.

◆ GetVolumeTheta() [3/6]

TGeoVolume * EmcROOTGeo::GetVolumeTheta ( int part,
int phi,
int theta )

Get theta volume;.

◆ GetVolumeTheta() [4/6]

TGeoVolume * EmcROOTGeo::GetVolumeTheta ( int part,
int phi,
int theta )

Get theta volume;.

◆ GetVolumeTheta() [5/6]

TGeoVolume * EmcROOTGeo::GetVolumeTheta ( int part,
int phi,
int theta )

Get theta volume;.

◆ GetVolumeTheta() [6/6]

TGeoVolume * EmcROOTGeo::GetVolumeTheta ( int part,
int phi,
int theta )

Get theta volume;.

◆ HasTwoNodes() [1/3]

bool EmcROOTGeo::HasTwoNodes ( int part,
int phi,
int theta )

Whether this id is combined of two nodes.

Definition at line 1155 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

1155 {
1156 if ( part == 1 ) return false;
1157 else return true;
1158}

◆ HasTwoNodes() [2/3]

bool EmcROOTGeo::HasTwoNodes ( int part,
int phi,
int theta )

Whether this id is combined of two nodes.

◆ HasTwoNodes() [3/3]

bool EmcROOTGeo::HasTwoNodes ( int part,
int phi,
int theta )

Whether this id is combined of two nodes.

◆ Init2DGeometry() [1/3]

void EmcROOTGeo::Init2DGeometry ( )

Initialize 2D Geometry.

Definition at line 97 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

97 {
98 if ( m_ROOTGeoInit != 1 && m_ROOTGeoInit != 2 )
99 {
100 cout << "EmcROOTGeo::Init2DGeometry, ROOT Geometry not Initialized yet!" << endl;
101 return;
102 }
103 m_2DGeoInit = 1;
104
105 Double_t local[3] = { 0.0, 0.0, 0.0 };
106 Double_t master[3] = { 0.0, 0.0, 0.0 };
107 // Int_t nPoints = 8;
108 // Double_t P[300] = {0.0};
109 // Double_t center[3] = {0.0, 0.0, 0.0};
110 TString name;
111 TString title;
112
113 // Emc crystals
114 for ( int part = 0; part < GetPartNb(); part++ )
115 {
116 for ( int theta = 0; theta < GetThetaNb( part ); theta++ )
117 {
118 for ( int phi = 0; phi < GetPhiNb( part, theta ); phi++ )
119 {
120 TGeoPhysicalNode* phyNode = 0;
121 phyNode = GetPhysicalCrystal( part, phi, theta );
122 if ( part == 1 ) name = TString( "Barrel" );
123 else
124 {
125 if ( part == 0 ) name = TString( "EastEc" );
126 else if ( part == 2 ) name = TString( "WestEc" );
127 }
128 name = TString( "Emc Part" );
129 name += part;
130 name += " Theta";
131 if ( part == 1 ) name += m_kThetaBr - 1 - theta;
132 else name += theta;
133 name += " Phi";
134 name += phi;
135
136 char data[100];
137 sprintf( data, "Emc part %i, #theta %i, #phi %i", part, theta, phi );
138 title = TString( data );
139
140 TGeoArb8* crystalShape = (TGeoArb8*)phyNode->GetShape();
141 Double_t *localArb8Point, masterArb8Point[24 * 2];
142 localArb8Point = crystalShape->GetVertices();
143 for ( Int_t i = 0; i < 8; i++ )
144 {
145 local[0] = localArb8Point[2 * i];
146 local[1] = localArb8Point[2 * i + 1];
147 if ( i < 4 ) local[2] = crystalShape->GetDz() * ( -1.0 );
148 else local[2] = crystalShape->GetDz();
149
150 phyNode->GetMatrix( -1 * phyNode->GetLevel() )->LocalToMaster( local, &master[0] );
151 // transform to top
152 for ( Int_t j = 0; j < 3; j++ ) { masterArb8Point[3 * i + j] = master[j]; }
153 }
154
155 TGeoPhysicalNode* phyNode2 = 0;
156 phyNode2 = GetPhysicalCrystal2( part, phi, theta );
157 if ( phyNode2 != 0 )
158 {
159 crystalShape = (TGeoArb8*)phyNode2->GetShape();
160 localArb8Point = crystalShape->GetVertices();
161 for ( Int_t i = 0; i < 8; i++ )
162 {
163 local[0] = localArb8Point[2 * i];
164 local[1] = localArb8Point[2 * i + 1];
165 if ( i < 4 ) local[2] = crystalShape->GetDz() * ( -1.0 );
166 else local[2] = crystalShape->GetDz();
167 phyNode2->GetMatrix( -1 * phyNode->GetLevel() )
168 ->LocalToMaster( local, &master[0] ); // transform to top
169 for ( Int_t j = 0; j < 3; j++ ) { masterArb8Point[24 + 3 * i + j] = master[j]; }
170 }
171 }
172
173 if ( phyNode2 == 0 )
174 m_Emc2DCrystal[part][phi][theta] =
175 new Emc2DCrystal( name, title, 8, &masterArb8Point[0], part, theta );
176 else
177 m_Emc2DCrystal[part][phi][theta] =
178 new Emc2DCrystal( name, title, 16, &masterArb8Point[0], part, theta );
179 }
180 }
181 }
182}
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
titledef title[20]

◆ Init2DGeometry() [2/3]

void EmcROOTGeo::Init2DGeometry ( )

Initialize 2D Geometry.

◆ Init2DGeometry() [3/3]

void EmcROOTGeo::Init2DGeometry ( )

Initialize 2D Geometry.

◆ InitFromGDML() [1/3]

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

Initialize ROOTGeo from GDML.

Definition at line 83 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

83 {
84 m_ROOTGeoInit = 2;
85
86 ReadGdml( gdmlFile, setupName );
87 SetNode();
88}
void SetNode()
Set the pointers to theirs nodes;.
void ReadGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of ROOTGeo.

◆ InitFromGDML() [2/3]

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

Initialize ROOTGeo from GDML.

◆ InitFromGDML() [3/3]

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

Initialize ROOTGeo from GDML.

◆ InitFromGdml() [1/3]

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

Initialize the instance of ROOTGeo.

Definition at line 57 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

57 {
58 ReadGdml( gdmlFile, setupName );
59 SetNode();
60 // SetDefaultVis();
61
62 m_ROOTGeoInit = 1;
63}

Referenced by EmcROOTGeo().

◆ InitFromGdml() [2/3]

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

Initialize the instance of ROOTGeo.

◆ InitFromGdml() [3/3]

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

Initialize the instance of ROOTGeo.

◆ InitFromROOT() [1/3]

void EmcROOTGeo::InitFromROOT ( TGeoVolume * vol)

Initialize ROOTGeo from TGeoVolume logicalEmc.

Definition at line 90 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

90 {
91 m_ROOTGeoInit = 1;
92
93 SetVolumeEmc( vol );
94 SetNode();
95}
void SetVolumeEmc(TGeoVolume *vol)
Set Emc volume, while initializing from ROOT;.

◆ InitFromROOT() [2/3]

void EmcROOTGeo::InitFromROOT ( TGeoVolume * vol)

Initialize ROOTGeo from TGeoVolume logicalEmc.

◆ InitFromROOT() [3/3]

void EmcROOTGeo::InitFromROOT ( TGeoVolume * vol)

Initialize ROOTGeo from TGeoVolume logicalEmc.

◆ RestorePhyNode() [1/3]

void EmcROOTGeo::RestorePhyNode ( TGeoPhysicalNode * phyNode,
TGeoNode * node )

Restore the physical node to original shape.

Definition at line 1501 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

1501 {
1502 Align( phyNode, node->GetMatrix(), node->GetVolume()->GetShape() );
1503}
void Align(TGeoPhysicalNode *phyNode, TGeoMatrix *newmat=0, TGeoShape *newshape=0, Bool_t check=kFALSE)
Align a physical node, change its position and shape.

Referenced by SetHits().

◆ RestorePhyNode() [2/3]

void EmcROOTGeo::RestorePhyNode ( TGeoPhysicalNode * phyNode,
TGeoNode * node )

Restore the physical node to original shape.

◆ RestorePhyNode() [3/3]

void EmcROOTGeo::RestorePhyNode ( TGeoPhysicalNode * phyNode,
TGeoNode * node )

Restore the physical node to original shape.

◆ SetAllVisible() [1/6]

void EmcROOTGeo::SetAllVisible ( )

Set all visible;.

Definition at line 173 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

173 {
174 /* for (int part = 0; part < m_kPart-1; part++) {
175 int nPhi = (part == 1 ? m_kPhiBr : m_kPhiEc);
176 for (int phi = 0; phi < nPhi; phi++) {
177 GetVolumePhi(part, phi)->SetVisibility(1);
178 }
179 if (part == 1) {
180 for (int theta = 0; theta < m_kThetaBr; theta++) {
181 GetVolumeTheta(part, 0, theta)->SetVisibility(1);
182 GetVolumeCrystal(part, 0, theta)->SetVisibility(0);
183 }
184 }
185 else if (part == 0) {
186 int iPhi[4] = {0,6,8,7};
187 for (int i = 0; i < 4; i++) {
188 int phi = iPhi[i];
189 int nTheta = (part == 1 ? m_kThetaBr : m_kThetaEc);
190 for (int theta = 0; theta < nTheta; theta++) {
191 GetVolumeTheta(part, phi, theta)->SetVisibility(1);
192 GetVolumeCrystal(part, phi, theta)->SetVisibility(0);
193 }
194 }
195 }
196 }
197 */
198
199 for ( int part = 0; part < m_kPart; part++ )
200 {
201 GetPart( part )->SetVisibility( 0 );
202 int nPhi = ( part == 1 ? m_kPhiBr : m_kPhiEc );
203 for ( int phi = 0; phi < nPhi; phi++ )
204 {
205 GetPhi( part, phi )->SetVisibility( 0 );
206 int nTheta = ( part == 1 ? m_kThetaBr : m_kThetaEc );
207 for ( int theta = 0; theta < nTheta; theta++ )
208 {
209 GetTheta( part, phi, theta )->SetVisibility( 0 );
210 GetCrystal( part, phi, theta )->SetVisibility( 1 );
211 }
212 }
213 }
214}
TGeoNode * GetCrystal(int part, int phi, int theta)
Get crystal one;.
TGeoNode * GetPart(int part)
Get part node;.
TGeoNode * GetPhi(int part, int phi)
Get phi node;.

◆ SetAllVisible() [2/6]

void EmcROOTGeo::SetAllVisible ( )

Set all visible;.

◆ SetAllVisible() [3/6]

void EmcROOTGeo::SetAllVisible ( )

Set all visible;.

◆ SetAllVisible() [4/6]

void EmcROOTGeo::SetAllVisible ( )

Set all visible;.

◆ SetAllVisible() [5/6]

void EmcROOTGeo::SetAllVisible ( )

Set all visible;.

◆ SetAllVisible() [6/6]

void EmcROOTGeo::SetAllVisible ( )

Set all visible;.

◆ SetDefaultVis() [1/3]

void EmcROOTGeo::SetDefaultVis ( )

Set default visual attributes;.

Definition at line 106 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

106 {
107 // std::cout << "begin of set defaultvis" << std::endl;
108 int emcColor = 2;
109 int partColor = 2;
110 int phiColor = 4;
111 int thetaColor = 4;
112 int brCrystalColor = 4;
113 int ecCrystalColor = 7;
114
115 m_Emc->SetLineColor( emcColor );
116 m_Emc->SetVisibility( 0 );
117
118 for ( int part = 0; part < m_kPart - 1; part++ )
119 {
120 GetVolumePart( part )->SetLineColor( partColor );
121 int nPhi = ( part == 1 ? m_kPhiBr : m_kPhiEc );
122 for ( int phi = 0; phi < nPhi; phi++ )
123 {
124 GetVolumePhi( part, phi )->SetLineColor( phiColor );
125 GetVolumePhi( part, phi )->SetVisibility( 0 );
126 }
127 if ( part == 1 )
128 {
129 for ( int theta = 0; theta < m_kThetaBr; theta++ )
130 {
131 GetVolumeTheta( part, 0, theta )->SetLineColor( thetaColor );
132 GetVolumeTheta( part, 0, theta )->SetVisibility( 0 );
133 GetVolumeCrystal( part, 0, theta )->SetLineColor( brCrystalColor );
134 GetVolumeCrystal( part, 0, theta )->SetVisibility( 1 );
135 }
136 }
137 else if ( part == 0 )
138 {
139 int iPhi[4] = { 0, 6, 8, 7 };
140 for ( int i = 0; i < 4; i++ )
141 {
142 int phi = iPhi[i];
143 int nTheta = ( part == 1 ? m_kThetaBr : m_kThetaEc );
144 for ( int theta = 0; theta < nTheta; theta++ )
145 {
146 GetVolumeTheta( part, phi, theta )->SetLineColor( thetaColor );
147 GetVolumeTheta( part, phi, theta )->SetVisibility( 0 );
148 GetVolumeCrystal( part, phi, theta )->SetLineColor( ecCrystalColor );
149 GetVolumeCrystal( part, phi, theta )->SetVisibility( 1 );
150 }
151 }
152 }
153 }
154
155 for ( int part = 0; part < m_kPart; part++ )
156 {
157 GetPart( part )->SetVisibility( 0 );
158 int nPhi = ( part == 1 ? m_kPhiBr : m_kPhiEc );
159 for ( int phi = 0; phi < nPhi; phi++ )
160 {
161 GetPhi( part, phi )->SetVisibility( 0 );
162 int nTheta = ( part == 1 ? m_kThetaBr : m_kThetaEc );
163 for ( int theta = 0; theta < nTheta; theta++ )
164 {
165 GetTheta( part, phi, theta )->SetVisibility( 0 );
166 GetCrystal( part, phi, theta )->SetVisibility( 0 );
167 }
168 }
169 }
170 // std::cout << "end of set defaultvis" << std::endl;
171}
TGeoVolume * GetVolumeCrystal(int part, int phi, int theta)
Get crystal volume;.
TGeoVolume * GetVolumeTheta(int part, int phi, int theta)
Get theta volume;.
TGeoVolume * GetVolumePart(int part)
Get part volume;.
TGeoVolume * GetVolumePhi(int part, int phi)
Get phi volume;.

◆ SetDefaultVis() [2/3]

void EmcROOTGeo::SetDefaultVis ( )

Set default visual attributes;.

◆ SetDefaultVis() [3/3]

void EmcROOTGeo::SetDefaultVis ( )

Set default visual attributes;.

◆ SetDetector() [1/3]

void EmcROOTGeo::SetDetector ( )

Set Detecor (what is detector depends on you).

Definition at line 712 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

712 {
713 BesView* view = 0;
714 if ( gPad ) view = dynamic_cast<BesView*>( gPad->GetView() );
715 // if (view) cout << "viewVisFull3DEmc " << view->GetVisFull3DEmc() << endl;
716
717 m_DetectorsArray->Clear();
718
719 // Barrel
720 int part = 1;
721 for ( int theta = 0; theta < GetThetaNb( part ); theta++ )
722 {
723 for ( int phi = 0; phi < GetPhiNb( part, theta ); phi++ )
724 {
725 TGeoPhysicalNode* phyNode = GetPhysicalCrystal( part, phi, theta );
726 if ( phyNode )
727 {
728 phyNode->SetVisibility( 0 ); // set all invisible before set any visible
729 if ( phi >= 0 && phi < m_kPhiBr * 4 / 4
730 //|| (theta == 0 || theta == 43) && phi >= m_kPhiBr/4 || phi == 0
731 )
732 { m_DetectorsArray->Add( phyNode ); }
733 else if ( view && view->GetVisFull3DEmc() ) { m_DetectorsArray->Add( phyNode ); }
734 }
735 }
736 }
737
738 // End cap
739 for ( int part = 0; part < m_kPart; part++ )
740 {
741 if ( part == 1 ) continue;
742 for ( int theta = 0; theta < GetThetaNb( part ); theta++ )
743 {
744 for ( int phi = 0; phi < GetPhiNb( part, theta ); phi++ )
745 {
746 TGeoPhysicalNode* phyNode = GetPhysicalCrystal( part, phi, theta );
747 if ( phyNode )
748 {
749 phyNode->SetVisibility( 0 ); // set all invisible before set any visible
750 if ( part == 2 && phi <= GetPhiNb( part, theta ) ||
751 part == 0 && phi <= GetPhiNb( part, theta ) )
752 { m_DetectorsArray->Add( phyNode ); }
753 else if ( view && view->GetVisFull3DEmc() ) { m_DetectorsArray->Add( phyNode ); }
754 }
755
756 phyNode = 0;
757 phyNode = GetPhysicalCrystal2( part, phi, theta );
758 if ( phyNode )
759 {
760 phyNode->SetVisibility( 0 ); // set all invisible before set any visible
761 if ( part == 2 && phi <= GetPhiNb( part, theta ) ||
762 part == 0 && phi <= GetPhiNb( part, theta ) )
763 { m_DetectorsArray->Add( phyNode ); }
764 else if ( view && view->GetVisFull3DEmc() ) { m_DetectorsArray->Add( phyNode ); }
765 }
766 }
767 }
768 }
769
770 // std::cout << "EmcROOTGeo::SetDetector(), end of set detector " << std::endl;
771}

◆ SetDetector() [2/3]

void EmcROOTGeo::SetDetector ( )

Set Detecor (what is detector depends on you).

◆ SetDetector() [3/3]

void EmcROOTGeo::SetDetector ( )

Set Detecor (what is detector depends on you).

◆ SetHalfVisible() [1/3]

void EmcROOTGeo::SetHalfVisible ( )

Set half visible;.

Definition at line 555 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

555 {
556 /*
557 for (int theta = 0; theta < GetThetaNb(1); theta++) {
558 for (int phi = 0; phi < GetPhiNb(1); phi++) {
559 if (phi >= GetPhiNb(1)/4 && phi < GetPhiNb(1)*3/4) {
560 GetPhysicalCrystal(1, phi, theta)->SetVisibility(0);
561 }
562 else {
563 GetPhysicalCrystal(1, phi, theta)->SetVisibility(1);
564 }
565 }
566 }
567
568 for (int theta = 0; theta < GetThetaNb(0); theta++) {
569 for (int i = 0; i < 16; i++) {
570 if (i >= 7 && i <= 14) {
571 GetPhysicalCrystal(0, i, theta)->SetVisibility(0);
572 }
573 else {
574 GetPhysicalCrystal(0, i, theta)->SetVisibility(1);
575 }
576 }
577 }
578
579 for (int theta = 0; theta < GetThetaNb(2); theta++) {
580 for (int i = 0; i < 16; i++) {
581 if ((i >= 0 && i < 7) || i == 15) {
582 GetPhysicalCrystal(2, i, theta)->SetVisibility(0);
583 }
584 else {
585 GetPhysicalCrystal(2, i, theta)->SetVisibility(1);
586 }
587 }
588 }
589 */
590}

◆ SetHalfVisible() [2/3]

void EmcROOTGeo::SetHalfVisible ( )

Set half visible;.

◆ SetHalfVisible() [3/3]

void EmcROOTGeo::SetHalfVisible ( )

Set half visible;.

◆ SetHits() [1/3]

void EmcROOTGeo::SetHits ( )

Set all physicalNodes corresponding to digiCol;.

Definition at line 773 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

773 {
774 // set previous event hits to default vis
775 // cout << "m_HitsArray->GetEntries(): " << m_HitsArray->GetEntries() << endl;
776 // cout << "m_PhyNodeOrgArray->GetEntries(): " << m_PhyNodeOrgArray->GetEntries() << endl;
777 // cout << "m_2DHitsArray->GetEntries(): " << m_2DHitsArray->GetEntries() << endl;
778 for ( int i = 0; i < m_HitsArray->GetEntries(); i++ )
779 {
780 TGeoPhysicalNode* phyNode = (TGeoPhysicalNode*)m_HitsArray->At( i );
781 // cout << phyNode->GetName() << endl;
782 int color = m_brCrystalColor;
783 int part = GetPart( phyNode );
784 if ( part == 0 || part == 2 ) color = m_ecCrystalColor;
785
786 phyNode->SetLineColor( color );
787 phyNode->SetVisibility( 0 );
788
789 RestorePhyNode( phyNode, (TGeoNode*)m_PhyNodeOrgArray->At( i ) );
790 }
791 m_PhyNodeOrgArray->Clear( "C" );
792 m_HitsArray->Clear( "C" );
793
794 // set previous event 2D hits info to default
795 for ( int i = 0; i < m_2DHitsArray->GetEntries(); i++ )
796 {
797 Emc2DCrystal* aCrystal = (Emc2DCrystal*)m_2DHitsArray->At( i );
798 aCrystal->ClearInfo();
799 aCrystal->AddInfo( aCrystal->GetTitle() );
800 aCrystal->CloseInfo();
801 }
802 m_2DHitsArray->Clear( "C" );
803
804 // set new hits
805 // Long Peixun's update: Consider gEvent == NULL
806 int NDigiCol = 0;
807 if ( gEvent )
808 {
809 m_EmcDigiCol = gEvent->GetEmcDigiCol();
810 // Long Peixun's update: Consider m_EmcDigiCol == NULL
811 if ( m_EmcDigiCol ) NDigiCol = m_EmcDigiCol->GetEntries();
812 else NDigiCol = 0;
813 }
814
815 for ( int i = 0; i < NDigiCol; i++ )
816 {
817 TEmcDigi* aEmcDigi = (TEmcDigi*)m_EmcDigiCol->At( i );
818 Identifier aEmcID( aEmcDigi->getIntId() );
819 int part = EmcID::barrel_ec( aEmcID );
820 int theta = EmcID::theta_module( aEmcID );
821 int phi = EmcID::phi_module( aEmcID );
822
823 Double_t charge =
824 RawDataUtil::EmcCharge( aEmcDigi->getMeasure(), aEmcDigi->getChargeChannel() );
825 Double_t time = RawDataUtil::EmcTime( aEmcDigi->getTimeChannel() );
826
827 TGeoPhysicalNode* phyNode = 0;
828 phyNode = GetPhysicalCrystal( part, phi, theta );
829 if ( phyNode )
830 {
831 m_PhyNodeOrgArray->Add( phyNode->GetNode() );
832
833 // Double_t *P; // = new Double_t[16];
834 // TGeoArb8 *oldArb8 = (TGeoArb8*)phyNode->GetShape();
835 // P = oldArb8->GetVertices();
836 // TGeoArb8 *newArb8 = new TGeoArb8(charge, &P[0]);
837
838 // TGeoTranslation *newmat =
839 // new TGeoTranslation(0.0, 0.0, oldArb8->GetDz()+newArb8->GetDz());
840 // newmat->RegisterYourself();
841
842 // Align(phyNode, newmat, newArb8);
843
844 m_HitsArray->Add( phyNode ); // Long Peiuxn's update: Remove annotation
845 ////delete newArb8;
846 ////delete newmat;
847 }
848
849 phyNode = GetPhysicalCrystal2( part, phi, theta );
850 if ( phyNode )
851 {
852 m_PhyNodeOrgArray->Add( phyNode->GetNode() );
853
854 // Double_t *P; // = new Double_t[16];
855 // TGeoArb8 *oldArb8 = (TGeoArb8*)phyNode->GetShape();
856 // P = oldArb8->GetVertices();
857 // TGeoArb8 *newArb8 = new TGeoArb8(charge, &P[0]);
858
859 // TGeoTranslation *newmat =
860 // new TGeoTranslation(0.0, 0.0, oldArb8->GetDz()+newArb8->GetDz());
861 // newmat->RegisterYourself();
862
863 // Align(phyNode, newmat, newArb8);
864
865 // m_HitsArray->Add( phyNode );
866 ////delete newArb8;
867 ////delete newmat;
868 }
869
870 Emc2DCrystal* aCrystal = 0;
871 aCrystal = m_Emc2DCrystal[part][phi][theta];
872 if ( aCrystal )
873 {
874 aCrystal->SetTime( time ); // Long Peixun's update: Set Emc crystals' time and charge
875 aCrystal->SetCharge( charge );
876
877 aCrystal->ClearInfo();
878 aCrystal->AddInfo( aCrystal->GetTitle() );
879
880 char data[100];
881 sprintf( data, "time = %-.3f ns, charge = %-.3f MeV", time, charge );
882 aCrystal->AddInfo( TString( data ) );
883 sprintf( data, "Fired" );
884 aCrystal->AddInfo( TString( data ) );
885
886 aCrystal->CloseInfo();
887
888 m_2DHitsArray->Add( aCrystal );
889 }
890 }
891}
Double_t time
virtual void CloseInfo()
virtual void ClearInfo()
static unsigned int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0).
Definition EmcID.cxx:36
static unsigned int theta_module(const Identifier &id)
Definition EmcID.cxx:41
static unsigned int phi_module(const Identifier &id)
Definition EmcID.cxx:46
void RestorePhyNode(TGeoPhysicalNode *phyNode, TGeoNode *node)
Restore the physical node to original shape.
static double EmcTime(int timeChannel)
static double EmcCharge(int measure, int chargeChannel)
UInt_t getMeasure() const
Definition TEmcDigi.cxx:29
UInt_t getIntId() const
Definition TRawData.cxx:42
UInt_t getChargeChannel() const
Definition TRawData.cxx:48
UInt_t getTimeChannel() const
Definition TRawData.cxx:45

◆ SetHits() [2/3]

void EmcROOTGeo::SetHits ( )

Set all physicalNodes corresponding to digiCol;.

◆ SetHits() [3/3]

void EmcROOTGeo::SetHits ( )

Set all physicalNodes corresponding to digiCol;.

◆ SetNode() [1/6]

void EmcROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

Definition at line 65 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

65 {
66
67 // Ma Qiumei Add for removing Warning Infomations
68 gErrorIgnoreLevel = kFatal;
69
70 m_Emc = GetTopVolume();
71 if ( !m_Emc ) { m_Emc = GetLogicalVolume( "logicalEMC" ); }
72 if ( !m_Emc ) std::cout << "m_Emc = 0" << std::endl;
73 else cout << "Find logicalEMC!" << endl;
74
75 for ( int part = 0; part < m_kPart; part++ )
76 {
77 // TGeoNode *nodePart = GetPart(part);
78 // if(nodePart) cout<<nodePart->GetName()<<endl;
79 int nPhi = ( part == 1 ? m_kPhiBr : m_kPhiEc );
80
81 for ( int phi = 0; phi < nPhi; phi++ )
82 {
83 // total number of daughters in BSCPhi is 215
84 int nTheta = ( part == 1 ? 219 : m_kThetaEc );
85 TGeoNode* nodePhi = GetPhi( part, phi );
86 // if(nodePhi) cout<<nodePhi->GetName()<<endl;
87
88 for ( int theta = 0; theta < nTheta; theta++ )
89 {
90 string name = nodePhi->GetDaughter( theta )->GetName();
91 int nthe = -1;
92 string strthe;
93 if ( name.find( "BSCCasing", 0 ) == 7 ) { strthe = name.substr( 16, 2 ); }
94 else if ( name.find( "EndCasing", 0 ) == 7 ) { strthe = name.substr( 19, 2 ); }
95
96 istringstream thetaBuf( strthe );
97 thetaBuf >> nthe;
98
99 if ( nthe >= 0 ) { m_NodeTheta[part][phi][nthe] = nodePhi->GetDaughter( theta ); }
100 }
101 }
102 }
103 // std::cout << "end of set node" << std::endl;
104}

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

◆ SetNode() [2/6]

void EmcROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

◆ SetNode() [3/6]

void EmcROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

◆ SetNode() [4/6]

void EmcROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

◆ SetNode() [5/6]

void EmcROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

◆ SetNode() [6/6]

void EmcROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

◆ SetNoEndVisible() [1/3]

void EmcROOTGeo::SetNoEndVisible ( )

Set noend visible;.

Definition at line 592 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

592 {
593 /*
594 for (int theta = 0; theta < GetThetaNb(1); theta++) {
595 for (int phi = 0; phi < GetPhiNb(1); phi++) {
596 GetPhysicalCrystal(1, phi, theta)->SetVisibility(1);
597 }
598 }
599 */
600}

◆ SetNoEndVisible() [2/3]

void EmcROOTGeo::SetNoEndVisible ( )

Set noend visible;.

◆ SetNoEndVisible() [3/3]

void EmcROOTGeo::SetNoEndVisible ( )

Set noend visible;.

◆ SetPhysicalDefaultVis() [1/3]

void EmcROOTGeo::SetPhysicalDefaultVis ( )

Set default physical node attributes;.

Definition at line 676 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

676 {
677 for ( int part = 0; part < m_kPart; part++ )
678 {
679 for ( int theta = 0; theta < GetThetaNb( part ); theta++ )
680 {
681 for ( int phi = 0; phi < GetPhiNb( part, theta ); phi++ )
682 {
683 TGeoPhysicalNode* phyCrystal = GetPhysicalCrystal( part, phi, theta );
684 TGeoPhysicalNode* phyCrystal2 = GetPhysicalCrystal2( part, phi, theta );
685 if ( part == 1 )
686 {
687 if ( phyCrystal )
688 {
689 phyCrystal->SetIsVolAtt( kFALSE );
690 phyCrystal->SetLineColor( m_brCrystalColor );
691 }
692 }
693 else
694 {
695 if ( phyCrystal )
696 {
697 phyCrystal->SetIsVolAtt( kFALSE );
698 phyCrystal->SetLineColor( m_ecCrystalColor );
699 }
700 if ( phyCrystal2 )
701 {
702 phyCrystal2->SetIsVolAtt( kFALSE );
703 phyCrystal2->SetLineColor( m_ecCrystalColor );
704 }
705 }
706 }
707 }
708 }
709 // std::cout << "end of set defaultvis" << std::endl;
710}

◆ SetPhysicalDefaultVis() [2/3]

void EmcROOTGeo::SetPhysicalDefaultVis ( )

Set default physical node attributes;.

◆ SetPhysicalDefaultVis() [3/3]

void EmcROOTGeo::SetPhysicalDefaultVis ( )

Set default physical node attributes;.

◆ SetPhysicalNode() [1/6]

void EmcROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

Definition at line 259 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

259 {
260 // int brCrystalColor = 4;
261 // int ecCrystalColor = 7;
262
263 // Ma Qiumei Add for removing Warning Infomations
264 gErrorIgnoreLevel = kFatal;
265
266 if ( gGeoManager == 0 ) std::cout << "Create gGeoManager first" << std::endl;
267 else cout << "gGeoManager success!" << endl;
268
269 TGeoVolume* volEmc = GetLogicalVolume( "logicalEMC" );
270 if ( !volEmc ) std::cout << "logicalEMC not found !" << std::endl;
271
272 // construct bes world
273 float m_BesR = 5200;
274 float m_BesZ = 5680;
275 TGeoIdentity* identity = new TGeoIdentity();
276
277 TGeoMaterial* mat = new TGeoMaterial( "VOID", 0, 0, 0 );
278 TGeoMedium* med = new TGeoMedium( "MED", 1, mat );
279 TGeoVolume* m_Bes =
280 gGeoManager->MakeBox( "volBes", med, 0.5 * m_BesR, 0.5 * m_BesR, 0.5 * m_BesZ );
281 gGeoManager->SetTopVolume( m_Bes );
282 m_Bes->AddNode( volEmc, 0, identity );
283 // cout<<"Ndaughters="<<m_Bes->GetNdaughters()<<endl;
284 SetChildNo( m_Bes->GetNdaughters() - 1 );
285
286 gGeoManager->SetDrawExtraPaths(); // draw physical node or not;
287 gGeoManager->CloseGeometry();
288 gGeoManager->SetNsegments( 20 );
289
290 TGeoNode* bes = gGeoManager->GetTopNode();
291 TGeoNode* emc = bes->GetDaughter( 0 );
292
293 for ( int part = 0; part < m_kPart; part++ )
294 {
295 TGeoNode* nodePart = GetPart( part );
296 int nPhi = ( part == 1 ? m_kPhiBr : m_kPhiEc );
297 for ( int phi = 0; phi < nPhi; phi++ )
298 {
299 TGeoNode* nodePhi = GetPhi( part, phi );
300 int nTheta = ( part == 1 ? m_kThetaBr : m_kThetaEc );
301 for ( int theta = 0; theta < nTheta; theta++ )
302 {
303 // cout<<part<<"\t"<<phi<<"\t"<<theta<<endl;
304 TGeoNode* nodeTheta = GetTheta( part, phi, theta );
305 TGeoNode* nodeCrystal = GetCrystal( part, phi, theta );
306 TString strPath = TString( "/" ) + bes->GetName() + TString( "/" ) + emc->GetName() +
307 TString( "/" ) + nodePart->GetName() + TString( "/" ) +
308 nodePhi->GetName() + TString( "/" ) + nodeTheta->GetName() +
309 TString( "/" ) + nodeCrystal->GetName();
310 m_PhysicalCrystal[part][phi][theta] = gGeoManager->MakePhysicalNode( strPath );
311
312 // m_PhysicalCrystal[part][phi][theta]->SetVisibility(0);
313 // m_PhysicalCrystal[part][phi][theta]->SetIsVolAtt(kFALSE);
314 // if (part == 1) m_PhysicalCrystal[part][phi][theta]->SetLineColor(brCrystalColor);
315 // else m_PhysicalCrystal[part][phi][theta]->SetLineColor(ecCrystalColor);
316 }
317 }
318 }
319}

Referenced by EmcRecROOTGeo::InitFromXML().

◆ SetPhysicalNode() [2/6]

void EmcROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

◆ SetPhysicalNode() [3/6]

void EmcROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

◆ SetPhysicalNode() [4/6]

void EmcROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

◆ SetPhysicalNode() [5/6]

void EmcROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

◆ SetPhysicalNode() [6/6]

void EmcROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

◆ SetQuarterVisible() [1/6]

void EmcROOTGeo::SetQuarterVisible ( )

Set quater visible;.

Definition at line 216 of file DetectorDescription/ROOTGeo/src/EmcROOTGeo.cxx.

216 {
217 /* for (int part = 1; part < m_kPart-1; part++) {
218 for (int phi = 1; phi <= m_kPhiBr; phi++) {
219 GetVolumePhi(part, phi)->SetVisibility(0);
220 }
221
222 for (int theta = 1; theta <= m_kThetaBr; theta++) {
223 GetVolumeTheta(part, theta)->SetVisibility(1);
224 GetVolumeCrystal(part, theta)->SetVisibility(0);
225 }
226 }
227
228 for (int part = 1; part < m_kPart-1; part++) {
229 for (int phi = 1; phi <= m_kPhiBr; phi++) {
230 GetPhi(part, phi)->SetVisibility(0);
231 for (int theta = 1; theta <= m_kThetaBr; theta++) {
232 if (phi < m_kPhiBr/4) GetTheta(part, phi, theta)->SetVisibility(0);
233 else GetTheta(part, phi, theta)->SetVisibility(1);
234 GetCrystal(part, phi, theta)->SetVisibility(0);
235 }
236 }
237 }
238 */
239
240 for ( int part = 0; part < m_kPart; part++ )
241 {
242 GetPart( part )->SetVisibility( 0 );
243 int nPhi = ( part == 1 ? m_kPhiBr : m_kPhiEc );
244 for ( int phi = 0; phi < nPhi; phi++ )
245 {
246 GetPhi( part, phi )->SetVisibility( 0 );
247 int nTheta = ( part == 1 ? m_kThetaBr : m_kThetaEc );
248 for ( int theta = 0; theta < nTheta; theta++ )
249 {
250 GetTheta( part, phi, theta )->SetVisibility( 0 );
251 if ( ( part == 1 && ( phi >= 0 && phi < nPhi / 4 ) ) || ( part != 1 ) )
252 { GetCrystal( part, phi, theta )->SetVisibility( 1 ); }
253 else { GetCrystal( part, phi, theta )->SetVisibility( 0 ); }
254 }
255 }
256 }
257}

◆ SetQuarterVisible() [2/6]

void EmcROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetQuarterVisible() [3/6]

void EmcROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetQuarterVisible() [4/6]

void EmcROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetQuarterVisible() [5/6]

void EmcROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetQuarterVisible() [6/6]

void EmcROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetVisEmcDetector() [1/3]

void EmcROOTGeo::SetVisEmcDetector ( )

Set Emc detector visibility;.

Definition at line 893 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

893 {
894 BesView* view = 0;
895 if ( gPad ) view = dynamic_cast<BesView*>( gPad->GetView() );
896
897 for ( int i = 0; i < m_DetectorsArray->GetEntries(); i++ )
898 {
899 TGeoPhysicalNode* phyNode = (TGeoPhysicalNode*)m_DetectorsArray->At( i );
900 phyNode->SetVisibility( 0 );
901 if ( view && view->GetVisEmcGlobal() )
902 {
903 int part = GetPart( phyNode );
904 if ( part == 0 && view->GetVisEmcEast() || part == 1 && view->GetVisEmcBarrel() ||
905 part == 2 && view->GetVisEmcWest() )
906 phyNode->SetVisibility( 1 );
907 }
908 }
909}

◆ SetVisEmcDetector() [2/3]

void EmcROOTGeo::SetVisEmcDetector ( )

Set Emc detector visibility;.

◆ SetVisEmcDetector() [3/3]

void EmcROOTGeo::SetVisEmcDetector ( )

Set Emc detector visibility;.

◆ SetVisEmcHits() [1/3]

void EmcROOTGeo::SetVisEmcHits ( )

Set Emc hits visibility;.

Definition at line 911 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

911 {
912 BesView* view = 0;
913 if ( gPad ) view = dynamic_cast<BesView*>( gPad->GetView() );
914
915 for ( int i = 0; i < m_HitsArray->GetEntries(); i++ )
916 {
917 TGeoPhysicalNode* phyNode = (TGeoPhysicalNode*)m_HitsArray->At( i );
918 int part = GetPart( phyNode );
919 if ( view && view->GetVisEmcHitsGlobal() )
920 {
921 if ( part == 0 && view->GetVisEmcHitsEast() ||
922 part == 1 && view->GetVisEmcHitsBarrel() || part == 2 && view->GetVisEmcHitsWest() )
923 {
924 phyNode->SetVisibility( 1 );
925 phyNode->SetLineColor( 881 ); // Long Peixun's update: Magenta -> Violet
926 continue;
927 }
928 }
929 // Long Peixun's update: Unfired visibility should be determined by Detector option rather
930 // than His option phyNode->SetVisibility(0);
931 if ( part == 1 ) phyNode->SetLineColor( m_brCrystalColor );
932 else phyNode->SetLineColor( m_ecCrystalColor );
933 }
934}

◆ SetVisEmcHits() [2/3]

void EmcROOTGeo::SetVisEmcHits ( )

Set Emc hits visibility;.

◆ SetVisEmcHits() [3/3]

void EmcROOTGeo::SetVisEmcHits ( )

Set Emc hits visibility;.

◆ SetVolumeAppendInVis() [1/3]

void EmcROOTGeo::SetVolumeAppendInVis ( )

Set default visual attributes;.

Definition at line 273 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

273 {
274
275 //-------------------------------------------------------------
276 // Barrel
277 // GetLogicalVolume
278 TGeoVolume *logicRear, *logicOrgGlass, *logicRearCasing, *logicAlPlate, *logicPD,
279 *logicPreAmpBox, *logicAirInPABox, *logicHangingPlate, *logicWaterPipe;
280 TGeoVolume *logicCable, *logicOCGirder, *logicSupportBar, *logicSupportBar1, *logicEndRing,
281 *logicGear, *logicTaperRing1, *logicTaperRing2, *logicTaperRing3;
282
283 // Ma Qiumei Add for removing Warning Infomations
284 gErrorIgnoreLevel = kFatal;
285
286 logicRear = GetLogicalVolume( "logicalRearBox" );
287 logicOrgGlass = GetLogicalVolume( "logicalOrganicGlass" );
288 logicRearCasing = GetLogicalVolume( "logicalRearCasing" );
289 logicAlPlate = GetLogicalVolume( "logicalAlPlate" );
290 logicPD = GetLogicalVolume( "logicalPD" );
291 logicPreAmpBox = GetLogicalVolume( "logicalPreAmpBox" );
292 logicAirInPABox = GetLogicalVolume( "logicalAirInPABox" );
293 logicHangingPlate = GetLogicalVolume( "logicalHangingPlate" );
294 logicWaterPipe = GetLogicalVolume( "logicalWaterPipe" );
295
296 for ( int i = 0; i < 44; i++ )
297 {
298
299 std::ostringstream osnameBSCCable1;
300 osnameBSCCable1 << "logicalBSCCable_1_" << i;
301 logicCable = GetLogicalVolume( osnameBSCCable1.str() );
302 if ( logicCable ) logicCable->SetVisibility( 0 );
303
304 std::ostringstream osnameBSCCable2;
305 osnameBSCCable2 << "logicalBSCCable_2_" << i;
306 logicCable = GetLogicalVolume( osnameBSCCable2.str() );
307 if ( logicCable ) logicCable->SetVisibility( 0 );
308
309 std::ostringstream osnameOCGirder1;
310 osnameOCGirder1 << "logicalOpenningCutGirder_1_" << i;
311 logicOCGirder = GetLogicalVolume( osnameOCGirder1.str() );
312 if ( logicOCGirder ) logicOCGirder->SetVisibility( 0 );
313
314 std::ostringstream osnameOCGirder2;
315 osnameOCGirder2 << "logicalOpenningCutGirder_2_" << i;
316 logicOCGirder = GetLogicalVolume( osnameOCGirder2.str() );
317 if ( logicOCGirder ) logicOCGirder->SetVisibility( 0 );
318
319 std::ostringstream osnameOCGirder3;
320 osnameOCGirder3 << "logicalOpenningCutGirder_3_" << i;
321 logicOCGirder = GetLogicalVolume( osnameOCGirder3.str() );
322 if ( logicOCGirder ) logicOCGirder->SetVisibility( 0 );
323
324 std::ostringstream osnameOCGirder4;
325 osnameOCGirder4 << "logicalOpenningCutGirder_4_" << i;
326 logicOCGirder = GetLogicalVolume( osnameOCGirder4.str() );
327 if ( logicOCGirder ) logicOCGirder->SetVisibility( 0 );
328 }
329
330 //-------------------------------------------------------------
331 // Support system
332 logicSupportBar = GetLogicalVolume( "logicalSupportBar0" );
333 logicSupportBar1 = GetLogicalVolume( "logicalSupportBar1" );
334 logicEndRing = GetLogicalVolume( "logicalEndRing" );
335 logicGear = GetLogicalVolume( "logicalGear" );
336 logicTaperRing1 = GetLogicalVolume( "logicalTaperRing1" );
337 logicTaperRing2 = GetLogicalVolume( "logicalTaperRing2" );
338 logicTaperRing3 = GetLogicalVolume( "logicalTaperRing3" );
339
340 if ( logicRear ) logicRear->SetVisibility( 0 );
341 if ( logicOrgGlass ) logicOrgGlass->SetVisibility( 0 );
342 if ( logicRearCasing ) logicRearCasing->SetVisibility( 0 );
343 if ( logicAlPlate ) logicAlPlate->SetVisibility( 0 );
344 if ( logicPD ) logicPD->SetVisibility( 0 );
345 if ( logicPreAmpBox ) logicPreAmpBox->SetVisibility( 0 );
346 if ( logicAirInPABox ) logicAirInPABox->SetVisibility( 0 );
347 if ( logicHangingPlate ) logicHangingPlate->SetVisibility( 0 );
348 if ( logicWaterPipe ) logicWaterPipe->SetVisibility( 0 );
349 if ( logicGear ) logicGear->SetVisibility( 0 );
350 if ( logicTaperRing1 ) logicTaperRing1->SetVisibility( 0 );
351 if ( logicTaperRing2 ) logicTaperRing2->SetVisibility( 0 );
352 if ( logicTaperRing3 ) logicTaperRing3->SetVisibility( 0 );
353 if ( logicSupportBar ) logicSupportBar->SetVisibility( 0 );
354 if ( logicSupportBar1 ) logicSupportBar1->SetVisibility( 0 );
355 if ( logicEndRing ) logicEndRing->SetVisibility( 0 );
356}

Referenced by SetVolumeDefaultVis().

◆ SetVolumeAppendInVis() [2/3]

void EmcROOTGeo::SetVolumeAppendInVis ( )

Set default visual attributes;.

◆ SetVolumeAppendInVis() [3/3]

void EmcROOTGeo::SetVolumeAppendInVis ( )

Set default visual attributes;.

◆ SetVolumeDefaultVis() [1/3]

void EmcROOTGeo::SetVolumeDefaultVis ( )

Set default visual attributes;.

Definition at line 358 of file EventDisplay/BesVisLib/src/EmcROOTGeo.cxx.

358 {
359
361
362 // std::cout << "begin of set defaultvis" << std::endl;
363 m_Emc->SetLineColor( m_EmcColor );
364 m_Emc->SetVisibility( 0 );
365
366 for ( int part = 0; part < m_kPart - 1; part++ )
367 {
368 GetVolumePart( part )->SetLineColor( m_partColor );
369 int nPhi = ( part == 1 ? m_kPhiBr : m_kSectorEc );
370 for ( int phi = 0; phi < nPhi; phi++ )
371 {
372 GetVolumePhi( part, phi )->SetLineColor( m_phiColor );
373 GetVolumePhi( part, phi )->SetVisibility( 0 );
374 }
375 if ( part == 1 )
376 {
377 for ( int theta = 0; theta < m_kThetaBr; theta++ )
378 {
379 GetVolumeTheta( part, 0, theta )->SetLineColor( m_thetaColor );
380 GetVolumeTheta( part, 0, theta )->SetVisibility( 0 );
381 GetVolumeCrystal( part, 0, theta )->SetLineColor( m_brCrystalColor );
382 GetVolumeCrystal( part, 0, theta )->SetVisibility( 0 );
383 }
384 }
385 else if ( part == 0 )
386 {
387 int iPhi[3] = { 0, 1, 2 };
388 for ( int i = 0; i < 3; i++ )
389 {
390 int phi = iPhi[i];
391 int nTheta = ( part == 1 ? m_kThetaBr : m_kNbEc );
392 for ( int theta = 0; theta < nTheta; theta++ )
393 {
394 GetVolumeTheta( part, phi, theta )->SetLineColor( m_thetaColor );
395 GetVolumeTheta( part, phi, theta )->SetVisibility( 0 );
396 GetVolumeCrystal( part, phi, theta )->SetLineColor( m_ecCrystalColor );
397 GetVolumeCrystal( part, phi, theta )->SetVisibility( 0 );
398 }
399 }
400 }
401 }
402
403 // phi and sector
404 for ( int part = 0; part < m_kPart; part++ )
405 {
406 GetPart( part )->SetVisibility( 0 );
407 int nPhi = ( part == 1 ? m_kPhiBr : m_kSectorEc );
408 for ( int phi = 0; phi < nPhi; phi++ ) { GetPhi( part, phi )->SetVisibility( 0 ); }
409 }
410
411 // theta with real phi
412 for ( int part = 0; part < m_kPart; part++ )
413 {
414 for ( int theta = 0; theta < GetThetaNb( part ); theta++ )
415 {
416 for ( int phi = 0; phi < GetPhiNb( part, theta ); phi++ )
417 {
418 // cout << "part " << part << " theta " << theta << " phi " << phi << endl;
419 TGeoNode* nodeTheta = GetTheta( part, phi, theta );
420 if ( nodeTheta ) nodeTheta->SetVisibility( 0 );
421 TGeoNode* nodeCrystal = GetCrystal( part, phi, theta );
422 if ( nodeCrystal ) nodeCrystal->SetVisibility( 0 );
423
424 TGeoNode* nodeTheta2 = GetTheta2( part, phi, theta );
425 if ( nodeTheta2 ) nodeTheta2->SetVisibility( 0 );
426 TGeoNode* nodeCrystal2 = GetCrystal2( part, phi, theta );
427 if ( nodeCrystal2 ) nodeCrystal2->SetVisibility( 0 );
428 }
429 }
430 }
431 // std::cout << "end of set defaultvis" << std::endl;
432}
TGeoNode * GetCrystal2(int part, int phi, int theta)
Get crystal2 one;.
void SetVolumeAppendInVis()
Set default visual attributes;.

◆ SetVolumeDefaultVis() [2/3]

void EmcROOTGeo::SetVolumeDefaultVis ( )

Set default visual attributes;.

◆ SetVolumeDefaultVis() [3/3]

void EmcROOTGeo::SetVolumeDefaultVis ( )

Set default visual attributes;.

◆ SetVolumeEmc() [1/3]

void EmcROOTGeo::SetVolumeEmc ( TGeoVolume * vol)
inline

Set Emc volume, while initializing from ROOT;.

Definition at line 98 of file EventDisplay/BesVisLib/include/BesVisLib/EmcROOTGeo.h.

98{ m_Emc = vol; }

Referenced by InitFromROOT().

◆ SetVolumeEmc() [2/3]

void EmcROOTGeo::SetVolumeEmc ( TGeoVolume * vol)
inline

Set Emc volume, while initializing from ROOT;.

Definition at line 98 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/EmcROOTGeo.h.

98{ m_Emc = vol; }

◆ SetVolumeEmc() [3/3]

void EmcROOTGeo::SetVolumeEmc ( TGeoVolume * vol)
inline

Set Emc volume, while initializing from ROOT;.

Definition at line 98 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/EmcROOTGeo.h.

98{ m_Emc = vol; }

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