CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcROOTGeo Class Reference

#include <MdcROOTGeo.h>

+ Inheritance diagram for MdcROOTGeo:

Public Member Functions

 MdcROOTGeo ()
 Constructor.
 
 ~MdcROOTGeo ()
 Destructor.
 
void InitFromGdml (const char *gdmlFile, const char *setupName)
 Initialize the instance of ROOTGeo.
 
void SetNode ()
 Set the pointers to theirs nodes;.
 
int CorrectReplica (int layer, int replica)
 Correct some axial layer id to copyNo;.
 
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 GetSegmentNb ()
 Get number of segments;.
 
int GetLayerNb ()
 Get number of layers;.
 
int GetReplicaNb (int layer)
 Get number of replicas on each layer;.
 
TGeoVolume * GetVolumeMdc ()
 Get Mdc volume;.
 
TGeoVolume * GetVolumeSegment (int segment)
 Get segment volume;.
 
TGeoVolume * GetVolumeLayer (int layer)
 Get layer volume;

 
TGeoVolume * GetVolumeReplica (int layer)
 Get replica volume;.
 
TGeoNode * GetSegment (int segment, int no)
 Get segment node;.
 
TGeoNode * GetLayer (int layer)
 Get layer node;

 
TGeoNode * GetReplica (int layer, int replica)
 Get replica node;.
 
TGeoPhysicalNode * GetPhysicalReplica (int layer, int replica)
 Get replica physical node;.
 
 MdcROOTGeo (Bool_t cgem_flag=0)
 Constructor.
 
 ~MdcROOTGeo ()
 Destructor.
 
void InitFromGDML (const char *gdmlFile, const char *setupName)
 Initialize ROOTGeo from GDML.
 
void InitFromROOT (TGeoVolume *vol)
 Initialize ROOTGeo from TGeoVolume logicalMdc.
 
void Init2DGeometry ()
 Initialize 2D Geometry.
 
void SetNode ()
 Set the pointers to theirs nodes;.
 
int CorrectReplica (int layer, int replica)
 Correct some axial layer id to copyNo;.
 
void SetVolumeDefaultVis ()
 Set default visual attributes;.
 
void SetAllVisible ()
 Set all visible;.
 
void SetQuarterVisible ()
 Set quater visible;.
 
void SetHalfVisible ()
 Set half visible;.
 
void SetPhysicalNode ()
 Set the pointers to the physical nodes;.
 
void SetPhysicalDefaultVis ()
 Set default physical node attributes;.
 
void SetDetector ()
 Draw Detecor (what is detector depends on you)
 
void ClearHits ()
 Set all physicalNodes corresponding to digiCol;.
 
void SetHits ()
 
void SetTFire (Bool_t input)
 
void SetQFire (Bool_t input)
 
void SetQNotOverflow (Bool_t input)
 
void SetColorfulWire (Bool_t input)
 
void SetMdcTimeSubEvTime (Bool_t input)
 
void SetVisMdcDetector ()
 Set Mdc default detector visibility;.
 
void SetVisMdcHits ()
 Set Mdc hits visibility;.
 
int GetSegmentNb ()
 Get number of segments;.
 
int GetLayerNb ()
 Get number of layers;.
 
int GetReplicaNb (int layer)
 Get number of replicas on each layer;.
 
void SetVolumeMdc (TGeoVolume *vol)
 Set Mdc volume, while initializing from ROOT;.
 
TGeoVolume * GetVolumeMdc ()
 Get Mdc volume;.
 
TGeoVolume * GetVolumeSegment (int segment)
 Get segment volume;.
 
TGeoVolume * GetVolumeLayer (int layer)
 Get layer volume;

 
TGeoVolume * GetVolumeReplica (int layer)
 Get replica volume;.
 
TGeoNode * GetSegment (int segment, int no)
 Get segment node;.
 
TGeoNode * GetLayer (int layer)
 Get layer node;

 
TGeoNode * GetReplica (int layer, int replica)
 Get replica node;.
 
TGeoPhysicalNode * GetPhysicalSegment (int segment)
 Get segment physical node;.
 
TGeoPhysicalNode * GetPhysicalReplica (int layer, int replica)
 Get replica physical node;.
 
Mdc2DWireGet2DWire (Int_t layer, Int_t replica)
 Get Mdc2DWire;.
 
Int_t GetSimuLayer (Int_t trueLayer)
 Trans trueLayer to simuLayer (0~42)->(0~49)
 
Bool_t IsHit (Int_t layer, Int_t wire)
 Judge whether the digiCol contains (layer, wire)
 
void Draw (Option_t *option)
 Draw function.
 
void DrawHits (Option_t *option)
 Draw 2D hits.
 
 MdcROOTGeo (Bool_t cgem_flag=0)
 Constructor.
 
 ~MdcROOTGeo ()
 Destructor.
 
void InitFromGDML (const char *gdmlFile, const char *setupName)
 Initialize ROOTGeo from GDML.
 
void InitFromROOT (TGeoVolume *vol)
 Initialize ROOTGeo from TGeoVolume logicalMdc.
 
void Init2DGeometry ()
 Initialize 2D Geometry.
 
void SetNode ()
 Set the pointers to theirs nodes;.
 
int CorrectReplica (int layer, int replica)
 Correct some axial layer id to copyNo;.
 
void SetVolumeDefaultVis ()
 Set default visual attributes;.
 
void SetAllVisible ()
 Set all visible;.
 
void SetQuarterVisible ()
 Set quater visible;.
 
void SetHalfVisible ()
 Set half visible;.
 
void SetPhysicalNode ()
 Set the pointers to the physical nodes;.
 
void SetPhysicalDefaultVis ()
 Set default physical node attributes;.
 
void SetDetector ()
 Draw Detecor (what is detector depends on you)
 
void ClearHits ()
 Set all physicalNodes corresponding to digiCol;.
 
void SetHits ()
 
void SetTFire (Bool_t input)
 
void SetQFire (Bool_t input)
 
void SetQNotOverflow (Bool_t input)
 
void SetColorfulWire (Bool_t input)
 
void SetMdcTimeSubEvTime (Bool_t input)
 
void SetVisMdcDetector ()
 Set Mdc default detector visibility;.
 
void SetVisMdcHits ()
 Set Mdc hits visibility;.
 
int GetSegmentNb ()
 Get number of segments;.
 
int GetLayerNb ()
 Get number of layers;.
 
int GetReplicaNb (int layer)
 Get number of replicas on each layer;.
 
void SetVolumeMdc (TGeoVolume *vol)
 Set Mdc volume, while initializing from ROOT;.
 
TGeoVolume * GetVolumeMdc ()
 Get Mdc volume;.
 
TGeoVolume * GetVolumeSegment (int segment)
 Get segment volume;.
 
TGeoVolume * GetVolumeLayer (int layer)
 Get layer volume;

 
TGeoVolume * GetVolumeReplica (int layer)
 Get replica volume;.
 
TGeoNode * GetSegment (int segment, int no)
 Get segment node;.
 
TGeoNode * GetLayer (int layer)
 Get layer node;

 
TGeoNode * GetReplica (int layer, int replica)
 Get replica node;.
 
TGeoPhysicalNode * GetPhysicalSegment (int segment)
 Get segment physical node;.
 
TGeoPhysicalNode * GetPhysicalReplica (int layer, int replica)
 Get replica physical node;.
 
Mdc2DWireGet2DWire (Int_t layer, Int_t replica)
 Get Mdc2DWire;.
 
Int_t GetSimuLayer (Int_t trueLayer)
 Trans trueLayer to simuLayer (0~42)->(0~49)
 
Bool_t IsHit (Int_t layer, Int_t wire)
 Judge whether the digiCol contains (layer, wire)
 
void Draw (Option_t *option)
 Draw function.
 
void DrawHits (Option_t *option)
 Draw 2D hits.
 
 MdcROOTGeo ()
 Constructor.
 
 ~MdcROOTGeo ()
 Destructor.
 
void InitFromGdml (const char *gdmlFile, const char *setupName)
 Initialize the instance of ROOTGeo.
 
void SetNode ()
 Set the pointers to theirs nodes;.
 
int CorrectReplica (int layer, int replica)
 Correct some axial layer id to copyNo;.
 
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 GetSegmentNb ()
 Get number of segments;.
 
int GetLayerNb ()
 Get number of layers;.
 
int GetReplicaNb (int layer)
 Get number of replicas on each layer;.
 
TGeoVolume * GetVolumeMdc ()
 Get Mdc volume;.
 
TGeoVolume * GetVolumeSegment (int segment)
 Get segment volume;.
 
TGeoVolume * GetVolumeLayer (int layer)
 Get layer volume;

 
TGeoVolume * GetVolumeReplica (int layer)
 Get replica volume;.
 
TGeoNode * GetSegment (int segment, int no)
 Get segment node;.
 
TGeoNode * GetLayer (int layer)
 Get layer node;

 
TGeoNode * GetReplica (int layer, int replica)
 Get replica node;.
 
TGeoPhysicalNode * GetPhysicalReplica (int layer, int replica)
 Get replica 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;.
 

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

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

Definition at line 29 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/ROOTGeo/MdcROOTGeo.h.

Constructor & Destructor Documentation

◆ MdcROOTGeo() [1/4]

MdcROOTGeo::MdcROOTGeo ( )

Constructor.

Definition at line 36 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

37{
38 // Default constructor.
39 for (int layer = 0; layer < m_kLayer; layer++) {
40 for (int replica = 0; replica < m_kReplicaMax; replica++) {
41 m_NodeReplica[layer][replica] = 0;
42 m_PhysicalReplica[layer][replica] = 0;
43 }
44 }
45
46 for (int i = 0; i < m_kCorrectLayer; i++) {
47 m_CorrectMap[m_kiCorrectLayer[i]] = m_kiCorrectReplica[i];
48 }
49}

◆ ~MdcROOTGeo() [1/4]

MdcROOTGeo::~MdcROOTGeo ( )

Destructor.

Definition at line 51 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

52{ }

◆ MdcROOTGeo() [2/4]

MdcROOTGeo::MdcROOTGeo ( Bool_t  cgem_flag = 0)

Constructor.

Definition at line 51 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

53{
54 m_MdcColor = 3;
55 m_segmentColor = 0;
56 m_hypeColor = 3;
57 m_tubeColor = 4;
58 //m_twistedTubsColor = kBlue;
59 m_twistedTubsColor = 63; //Long Peixun's update: Blue -> Green, as same as XY View
60 //m_replicaColor = kCyan;
61 m_replicaColor = 73; //Long Peixun's update: Grey -> Blue, as same as XY View
62
63 //Long Peixun's update: According to CGEM flag, set start wire layer
64 if (cgem_flag) m_StartLayer = 8;
65 else m_StartLayer = 0;
66
67 k_TFire = kTRUE;
68 k_QFire = kTRUE;
69 k_QNotOverflow = kFALSE;
70
71 // Default constructor.
72 for (int layer = 0; layer < m_kLayer; layer++) {
73 m_NodeLayer[layer] = 0;
74 for (int replica = 0; replica < m_kReplicaMax; replica++) {
75 m_NodeReplica[layer][replica] = 0;
76 //Long Peixun's update: TGeoPhysicalNode* -> MdcPhysicalPointer
77 m_PhysicalReplica[layer][replica].set(0);
78 }
79 }
80
81 for (int i = 0; i < m_kCorrectLayer; i++) {
82 m_CorrectMap[m_kiCorrectLayer[i]] = m_kiCorrectReplica[i];
83 }
84
85 for (int layer = 0; layer < m_kTrueLayer; layer++) {
86 for (int replica = 0; replica < m_kReplicaMax; replica++) {
87 m_Mdc2DWire[layer][replica] = 0;
88 }
89 }
90}

◆ ~MdcROOTGeo() [2/4]

MdcROOTGeo::~MdcROOTGeo ( )

Destructor.

◆ MdcROOTGeo() [3/4]

MdcROOTGeo::MdcROOTGeo ( Bool_t  cgem_flag = 0)

Constructor.

◆ ~MdcROOTGeo() [3/4]

MdcROOTGeo::~MdcROOTGeo ( )

Destructor.

◆ MdcROOTGeo() [4/4]

MdcROOTGeo::MdcROOTGeo ( )

Constructor.

◆ ~MdcROOTGeo() [4/4]

MdcROOTGeo::~MdcROOTGeo ( )

Destructor.

Member Function Documentation

◆ ClearHits() [1/2]

void MdcROOTGeo::ClearHits ( )

Set all physicalNodes corresponding to digiCol;.

Definition at line 677 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

678{
679 //Long Peixun's update: Annotate cout
680 // cout << "m_HitsArray size(): " << m_HitsArray->GetEntries() << endl;
681 // cout << "m_2DHitsArray size(): " << m_2DHitsArray->GetEntries() << endl;
682
683 //Long Peixun's update: the element type of m_HitsArray is replaced by MdcPhysicalPointer
684 for (int i = 0; i < m_HitsArray->GetEntries(); i++)
685 {
687 (*PphyNode)->SetVisibility(0);
688 }
689 m_HitsArray->Clear("C");
690
691 // set previous event 2D hits info to default
692 for (int i = 0; i < m_2DHitsArray->GetEntries(); i++) {
693 Mdc2DWire *aWire = (Mdc2DWire*)m_2DHitsArray->At(i);
694 aWire->ClearInfo();
695 aWire->AddInfo(aWire->GetTitle());
696 aWire->CloseInfo();
697 }
698 m_2DHitsArray->Clear("C");
699}
virtual void ClearInfo()
Definition: Mdc2DWire.cxx:189
virtual void CloseInfo()
Definition: Mdc2DWire.cxx:195

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

◆ ClearHits() [2/2]

void MdcROOTGeo::ClearHits ( )

Set all physicalNodes corresponding to digiCol;.

◆ CorrectReplica() [1/4]

int MdcROOTGeo::CorrectReplica ( int  layer,
int  replica 
)

Correct some axial layer id to copyNo;.

Definition at line 103 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

104{
105 int rep = replica;
106 for (intMap::iterator iter = m_CorrectMap.begin(); iter != m_CorrectMap.end(); iter++) {
107 if (layer == (*iter).first ||
108 (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut &&
109 layer - m_kAxialLayerOut == (*iter).first)) {
110 rep -= (*iter).second;
111 if (rep < 0) rep += m_kReplica[layer];
112 }
113 }
114
115 //std::cout << "layer" << layer << " " << replica << "->" << rep << std::endl;
116 return rep;
117}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)

Referenced by SetNode().

◆ CorrectReplica() [2/4]

int MdcROOTGeo::CorrectReplica ( int  layer,
int  replica 
)

Correct some axial layer id to copyNo;.

◆ CorrectReplica() [3/4]

int MdcROOTGeo::CorrectReplica ( int  layer,
int  replica 
)

Correct some axial layer id to copyNo;.

◆ CorrectReplica() [4/4]

int MdcROOTGeo::CorrectReplica ( int  layer,
int  replica 
)

Correct some axial layer id to copyNo;.

◆ Draw() [1/2]

void MdcROOTGeo::Draw ( Option_t *  option)

Draw function.

Definition at line 1074 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

1075{
1076 TString opt = option;
1077 opt.ToUpper();
1078
1079 if (!m_2DGeoInit) cout << "MdcROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
1080 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1081 if (!view) cout << "MdcROOTGeo::Draw(), BesView not found" << endl;
1082
1083 if (view->GetVisMdcGlobal()) { // MdcVisGlobal
1084 if (opt.Contains("XY")) {
1085 m_MdcXY->Draw("");
1086 //Long Peixun's update: Annotate
1087 // for (Int_t i = 0; i < 4; i++) {
1088 // m_MdcXYSuper[i]->Draw("");
1089 // }
1090 }
1091
1092 if (opt.Contains("ZR")) {
1093 for (Int_t i = 0; i < 2; i++) {
1094 //m_MdcZR[i]->SetRotatable(true); //Long Peixun's update: Move to initializer
1095 m_MdcZR[i]->Draw("");
1096 }
1097 }
1098
1099 TString wireOpt;
1100 if (view->GetVisMdcTubes()) wireOpt += "TUBE";
1101 if (view->GetVisMdcWires()) wireOpt += ",WIRE";
1102
1103 Int_t replicaDraw = 0; // change draw sequence in a circle, (-1: 0->Max; 1: Max->0)
1104 //Long Peixun's update: Ignore layer 0~7 if detector contains CGEM
1105 for (Int_t layer = m_StartLayer; layer < m_kTrueLayer; layer++) {
1106 Int_t simuLayer = GetSimuLayer(layer);
1107 for (int replica = 0; replica < m_kReplica[simuLayer]; replica++) {
1108 if (m_kStereoDir[layer] == -1) replicaDraw = replica;
1109 else if (m_kStereoDir[layer] == 1) replicaDraw = m_kReplica[simuLayer]-1 - replica;
1110 else replicaDraw = replica;
1111
1112 if (m_Mdc2DWire[layer][replicaDraw]) {
1113 //cout << layer << " " << replicaDraw << endl;
1114 //m_Mdc2DWire[layer][replicaDraw]->SetHighlighted(false);
1115 m_Mdc2DWire[layer][replicaDraw]->SetFired(false);
1116 m_Mdc2DWire[layer][replicaDraw]->Draw(wireOpt);
1117 }
1118 }
1119 }
1120 }
1121}
virtual void Draw(Option_t *option="")
virtual void Draw(Option_t *option="")
virtual void Draw(Option_t *option="")
Definition: Mdc2DWire.cxx:285
Int_t GetSimuLayer(Int_t trueLayer)
Trans trueLayer to simuLayer (0~42)->(0~49)

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

◆ Draw() [2/2]

void MdcROOTGeo::Draw ( Option_t *  option)

Draw function.

◆ DrawHits() [1/2]

void MdcROOTGeo::DrawHits ( Option_t *  option)

Draw 2D hits.

Definition at line 1124 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

1125{
1126 // cout << "Draw Hits" << endl;
1127 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1128 if (!view) cout << "MdcROOTGeo::DrawHits(), BesView not found" << endl;
1129
1130 //cout << "VisMdcHitsGlobal " << view->GetVisMdcHitsGlobal() << endl;
1131 //cout << "VisMdcHits " << view->GetVisMdcHits() << endl;
1132
1133
1134 if (view->GetVisMdcHitsGlobal()) {
1135 TString wireOpt("");
1136 if (view->GetVisMdcTubes()) wireOpt += ",TUBE";
1137 if (view->GetVisMdcHits()) wireOpt += ",WIRE";
1138
1139 //Long Peixun's update: Use m_2DHitsArray which contains ready hits rather than rebuild hits
1140 for (int i = 0; i < m_2DHitsArray->GetEntries(); ++i)
1141 {
1142 Mdc2DWire* aWire = (Mdc2DWire*)m_2DHitsArray->At(i);
1143 if (aWire)
1144 {
1145 if ((k_TFire) && (aWire->GetTimeChannel() == 0x7FFFFFFF))
1146 continue;
1147 if ((k_QFire) && (aWire->GetChargeChannel() == 0x7FFFFFFF))
1148 continue;
1149 if ((k_QNotOverflow) && aWire->GetQOverflow() )
1150 continue;
1151 aWire->SetFired(true);
1152 aWire->SetColorfulWire(k_ColorfulWire, k_MdcTimeSubEvTime);
1153 aWire->Draw(wireOpt);
1154 }
1155 }
1156
1157/* if (m_MdcDigiCol) {
1158 for (int i = 0; i < m_MdcDigiCol->GetEntries(); i++) {
1159 TMdcDigi *aMdcDigi = (TMdcDigi*)m_MdcDigiCol->At(i);
1160
1161 Identifier aMdcID( aMdcDigi->getIntId() );
1162 int layer = MdcID::layer( aMdcID );
1163 int wire = MdcID::wire( aMdcID );
1164 unsigned int overflow = aMdcDigi->getOverflow();
1165
1166 Mdc2DWire *aWire = 0;
1167 aWire = m_Mdc2DWire[layer][wire];
1168 if (aWire){
1169 if ((k_TFire) && (aMdcDigi->getTimeChannel() == 0x7FFFFFFF)){
1170 continue;
1171 }
1172 if ((k_QFire) && (aMdcDigi->getChargeChannel() == 0x7FFFFFFF)){
1173 continue;
1174 }
1175 //if ((!k_TOverflow) && ((overflow&1)>0) ){
1176 // continue;
1177 //}
1178 if ((k_QNotOverflow) && ((overflow&2)>0) ){
1179 continue;
1180 }
1181 aWire->SetFired(true);
1182 aWire->SetColorfulWire(k_ColorfulWire,k_MdcTimeSubEvTime);
1183 aWire->Draw(wireOpt);
1184 }
1185 }
1186 } */
1187 }
1188}
void SetColorfulWire(Bool_t colorfulWire, Bool_t subEvTime)
Definition: Mdc2DWire.cxx:538

Referenced by BesEvent::DrawHits().

◆ DrawHits() [2/2]

void MdcROOTGeo::DrawHits ( Option_t *  option)

Draw 2D hits.

◆ Get2DWire() [1/2]

Mdc2DWire * MdcROOTGeo::Get2DWire ( Int_t  layer,
Int_t  replica 
)

Get Mdc2DWire;.

Definition at line 1044 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

1045{
1046 if (m_Mdc2DWire[layer][wire]) return m_Mdc2DWire[layer][wire];
1047 else return 0;
1048}

Referenced by BesEvent::ConstructMdcTrackFromRec().

◆ Get2DWire() [2/2]

Mdc2DWire * MdcROOTGeo::Get2DWire ( Int_t  layer,
Int_t  replica 
)

Get Mdc2DWire;.

◆ GetLayer() [1/4]

TGeoNode * MdcROOTGeo::GetLayer ( int  layer)

Get layer node;

Definition at line 334 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

335{
336 std::stringstream osname;
337 if (layer >= 0 && layer < m_kStereoLayerIn) {
338 osname << "pv_" << "logical" << "Mdc" << "Stereo" << "Layer" << layer << "_" << layer;
339 }
340 else if (layer >= m_kStereoLayerIn && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
341 osname << "pv_" << "logical" << "Mdc" << "Axial" << "Layer" << layer << "_" << layer;
342 }
343 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
344 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
345 osname << "pv_" << "logical" << "Mdc" << "Stereo" << "Layer" << layer << "_" << layer;
346 }
347 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut &&
348 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut) {
349 osname << "pv_" << "logical" << "Mdc" << "Axial" << "Layer" << layer << "_0" << "_"
350 << 2*layer - m_kStereoLayerIn - m_kAxialLayerIn - m_kStereoLayerOut;
351 }
352 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut &&
353 layer < m_kLayer) {
354 osname << "pv_" << "logical" << "Mdc" << "Axial" << "Layer" << layer - m_kAxialLayerOut << "_1" << "_"
355 << 2*(layer - m_kAxialLayerOut) - m_kStereoLayerIn - m_kAxialLayerIn - m_kStereoLayerOut + 1;
356 }
357
358 //std::cout << osname.str() << std::endl;
359 return GetNode( osname.str() );
360}
TGeoNode * GetNode(const std::string &nn)
Get a node(physical volume) by name;.

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

◆ GetLayer() [2/4]

TGeoNode * MdcROOTGeo::GetLayer ( int  layer)

Get layer node;

◆ GetLayer() [3/4]

TGeoNode * MdcROOTGeo::GetLayer ( int  layer)

Get layer node;

◆ GetLayer() [4/4]

TGeoNode * MdcROOTGeo::GetLayer ( int  layer)

Get layer node;

◆ GetLayerNb() [1/4]

int MdcROOTGeo::GetLayerNb ( )

Get number of layers;.

◆ GetLayerNb() [2/4]

int MdcROOTGeo::GetLayerNb ( )
inline

Get number of layers;.

Definition at line 99 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/BesVisLib/MdcROOTGeo.h.

99{ return m_kLayer; }

◆ GetLayerNb() [3/4]

int MdcROOTGeo::GetLayerNb ( )
inline

Get number of layers;.

Definition at line 99 of file InstallArea/include/BesVisLib/BesVisLib/MdcROOTGeo.h.

99{ return m_kLayer; }

◆ GetLayerNb() [4/4]

int MdcROOTGeo::GetLayerNb ( )

Get number of layers;.

◆ GetPhysicalReplica() [1/4]

TGeoPhysicalNode * MdcROOTGeo::GetPhysicalReplica ( int  layer,
int  replica 
)

Get replica physical node;.

Definition at line 376 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

377{
378 if (m_PhysicalReplica[layer][replica] != 0) {
379 return m_PhysicalReplica[layer][replica];
380 }
381 else {
382 std::cout << "PhysicalNode: " << "Layer" << layer << "Replica" << replica << " not found" << std::endl;
383 return 0;
384 }
385}

Referenced by BesEvent::ConstructMdcTrackFromRec(), BesGeometry::GetPhysicalMdcReplica(), Init2DGeometry(), BesVisDisplay::SetMdcFiredCell(), and SetPhysicalDefaultVis().

◆ GetPhysicalReplica() [2/4]

TGeoPhysicalNode * MdcROOTGeo::GetPhysicalReplica ( int  layer,
int  replica 
)

Get replica physical node;.

◆ GetPhysicalReplica() [3/4]

TGeoPhysicalNode * MdcROOTGeo::GetPhysicalReplica ( int  layer,
int  replica 
)

Get replica physical node;.

◆ GetPhysicalReplica() [4/4]

TGeoPhysicalNode * MdcROOTGeo::GetPhysicalReplica ( int  layer,
int  replica 
)

Get replica physical node;.

◆ GetPhysicalSegment() [1/2]

TGeoPhysicalNode * MdcROOTGeo::GetPhysicalSegment ( int  segment)

Get segment physical node;.

Definition at line 1019 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

1020{
1021 if (m_PhysicalSegment[segment] != 0) {
1022 return m_PhysicalSegment[segment];
1023 }
1024 else {
1025 //std::cout << "PhysicalNode: " << "Segment" << segment << " not found" << std::endl;
1026 return 0;
1027 }
1028}

◆ GetPhysicalSegment() [2/2]

TGeoPhysicalNode * MdcROOTGeo::GetPhysicalSegment ( int  segment)

Get segment physical node;.

◆ GetReplica() [1/4]

TGeoNode * MdcROOTGeo::GetReplica ( int  layer,
int  replica 
)

Get replica node;.

Definition at line 363 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

364{
365 if (m_NodeReplica[layer][replica] != 0) {
366 //std::cout << " replica " << layer << " " << replica << " found " << std::endl;
367 return m_NodeReplica[layer][replica];
368 }
369 else {
370 std::cout << "Node: " << "Layer" << layer << "Replica" << replica << " not found" << std::endl;
371 return 0;
372 }
373}

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

◆ GetReplica() [2/4]

TGeoNode * MdcROOTGeo::GetReplica ( int  layer,
int  replica 
)

Get replica node;.

◆ GetReplica() [3/4]

TGeoNode * MdcROOTGeo::GetReplica ( int  layer,
int  replica 
)

Get replica node;.

◆ GetReplica() [4/4]

TGeoNode * MdcROOTGeo::GetReplica ( int  layer,
int  replica 
)

Get replica node;.

◆ GetReplicaNb() [1/4]

int MdcROOTGeo::GetReplicaNb ( int  layer)
inline

Get number of replicas on each layer;.

Definition at line 67 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/ROOTGeo/MdcROOTGeo.h.

67{ return m_kReplica[layer]; }

◆ GetReplicaNb() [2/4]

int MdcROOTGeo::GetReplicaNb ( int  layer)
inline

Get number of replicas on each layer;.

Definition at line 102 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/BesVisLib/MdcROOTGeo.h.

102{ return m_kReplica[layer]; }

◆ GetReplicaNb() [3/4]

int MdcROOTGeo::GetReplicaNb ( int  layer)
inline

Get number of replicas on each layer;.

Definition at line 102 of file InstallArea/include/BesVisLib/BesVisLib/MdcROOTGeo.h.

102{ return m_kReplica[layer]; }

◆ GetReplicaNb() [4/4]

int MdcROOTGeo::GetReplicaNb ( int  layer)
inline

Get number of replicas on each layer;.

Definition at line 67 of file InstallArea/include/ROOTGeo/ROOTGeo/MdcROOTGeo.h.

67{ return m_kReplica[layer]; }

◆ GetSegment() [1/4]

TGeoNode * MdcROOTGeo::GetSegment ( int  segment,
int  no 
)

Get segment node;.

Definition at line 320 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

321{
322 std::stringstream osname;
323 if (segment == 1 || segment == 2) {
324 osname << "pv_" << "logical" << "Mdc" << "Segment" << segment << "_" << m_kLayer + segment - 1;
325 }
326 else {
327 osname << "pv_" << "logical" << "Mdc" << "Segment" << segment << "_" << m_kLayer + 2 + (segment - 3)*2 + no;
328 }
329
330 return GetNode( osname.str() );
331}

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

◆ GetSegment() [2/4]

TGeoNode * MdcROOTGeo::GetSegment ( int  segment,
int  no 
)

Get segment node;.

◆ GetSegment() [3/4]

TGeoNode * MdcROOTGeo::GetSegment ( int  segment,
int  no 
)

Get segment node;.

◆ GetSegment() [4/4]

TGeoNode * MdcROOTGeo::GetSegment ( int  segment,
int  no 
)

Get segment node;.

◆ GetSegmentNb() [1/4]

int MdcROOTGeo::GetSegmentNb ( )

Get number of segments;.

◆ GetSegmentNb() [2/4]

int MdcROOTGeo::GetSegmentNb ( )
inline

Get number of segments;.

Definition at line 96 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/BesVisLib/MdcROOTGeo.h.

96{ return m_kSegment; }

◆ GetSegmentNb() [3/4]

int MdcROOTGeo::GetSegmentNb ( )
inline

Get number of segments;.

Definition at line 96 of file InstallArea/include/BesVisLib/BesVisLib/MdcROOTGeo.h.

96{ return m_kSegment; }

◆ GetSegmentNb() [4/4]

int MdcROOTGeo::GetSegmentNb ( )

Get number of segments;.

◆ GetSimuLayer() [1/2]

Int_t MdcROOTGeo::GetSimuLayer ( Int_t  trueLayer)

Trans trueLayer to simuLayer (0~42)->(0~49)

Definition at line 1051 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

1052{
1053 if (trueLayer < 36 || trueLayer >= m_kTrueLayer) return trueLayer;
1054 if (trueLayer >= 36) return (36 + 2*(trueLayer-36));
1055 return trueLayer;
1056}

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

◆ GetSimuLayer() [2/2]

Int_t MdcROOTGeo::GetSimuLayer ( Int_t  trueLayer)

Trans trueLayer to simuLayer (0~42)->(0~49)

◆ GetVolumeLayer() [1/4]

TGeoVolume * MdcROOTGeo::GetVolumeLayer ( int  layer)

Get layer volume;

Definition at line 268 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

269{
270 std::stringstream osname;
271 if (layer >= 0 && layer < m_kStereoLayerIn) {
272 osname << "logical" << "Mdc" << "Stereo" << "Layer" << layer;
273 }
274 else if (layer >= m_kStereoLayerIn && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
275 osname << "logical" << "Mdc" << "Axial" << "Layer" << layer;
276 }
277 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
278 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
279 osname << "logical" << "Mdc" << "Stereo" << "Layer" << layer;
280 }
281 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut &&
282 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut) {
283 osname << "logical" << "Mdc" << "Axial" << "Layer" << layer << "_0";
284 }
285 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut &&
286 layer < m_kLayer) {
287 osname << "logical" << "Mdc" << "Axial" << "Layer" << layer - m_kAxialLayerOut << "_1";
288 }
289
290 return GetLogicalVolume( osname.str() );
291}
TGeoVolume * GetLogicalVolume(const std::string &vn)
Get a logical volume by name;.

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

◆ GetVolumeLayer() [2/4]

TGeoVolume * MdcROOTGeo::GetVolumeLayer ( int  layer)

Get layer volume;

◆ GetVolumeLayer() [3/4]

TGeoVolume * MdcROOTGeo::GetVolumeLayer ( int  layer)

Get layer volume;

◆ GetVolumeLayer() [4/4]

TGeoVolume * MdcROOTGeo::GetVolumeLayer ( int  layer)

Get layer volume;

◆ GetVolumeMdc() [1/4]

TGeoVolume * MdcROOTGeo::GetVolumeMdc ( )
inline

◆ GetVolumeMdc() [2/4]

TGeoVolume * MdcROOTGeo::GetVolumeMdc ( )
inline

Get Mdc volume;.

Definition at line 108 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/BesVisLib/MdcROOTGeo.h.

108{ return m_Mdc; }

◆ GetVolumeMdc() [3/4]

TGeoVolume * MdcROOTGeo::GetVolumeMdc ( )
inline

Get Mdc volume;.

Definition at line 108 of file InstallArea/include/BesVisLib/BesVisLib/MdcROOTGeo.h.

108{ return m_Mdc; }

◆ GetVolumeMdc() [4/4]

TGeoVolume * MdcROOTGeo::GetVolumeMdc ( )
inline

Get Mdc volume;.

Definition at line 70 of file InstallArea/include/ROOTGeo/ROOTGeo/MdcROOTGeo.h.

70{ return m_Mdc; }

◆ GetVolumeReplica() [1/4]

TGeoVolume * MdcROOTGeo::GetVolumeReplica ( int  layer)

Get replica volume;.

Definition at line 294 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

295{
296 std::stringstream osname;
297 if (layer >= 0 && layer < m_kStereoLayerIn) {
298 osname << "logical" << "Mdc" << "Stereo" << "Layer" << layer << "TwistedTubs";
299 }
300 else if (layer >= m_kStereoLayerIn && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
301 osname << "logical" << "Mdc" << "Axial" << "Layer" << layer << "Replica";
302 }
303 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
304 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
305 osname << "logical" << "Mdc" << "Stereo" << "Layer" << layer << "TwistedTubs";
306 }
307 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut &&
308 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut) {
309 osname << "logical" << "Mdc" << "Axial" << "Layer" << layer << "_0" << "Replica";
310 }
311 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut &&
312 layer < m_kLayer) {
313 osname << "logical" << "Mdc" << "Axial" << "Layer" << layer - m_kAxialLayerOut << "_1" << "Replica";
314 }
315
316 return GetLogicalVolume( osname.str() );
317}

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

◆ GetVolumeReplica() [2/4]

TGeoVolume * MdcROOTGeo::GetVolumeReplica ( int  layer)

Get replica volume;.

◆ GetVolumeReplica() [3/4]

TGeoVolume * MdcROOTGeo::GetVolumeReplica ( int  layer)

Get replica volume;.

◆ GetVolumeReplica() [4/4]

TGeoVolume * MdcROOTGeo::GetVolumeReplica ( int  layer)

Get replica volume;.

◆ GetVolumeSegment() [1/4]

TGeoVolume * MdcROOTGeo::GetVolumeSegment ( int  segment)

Get segment volume;.

Definition at line 260 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

261{
262 std::stringstream osname;
263 osname << "logical" << "Mdc" << "Segment" << segment;
264 return GetLogicalVolume( osname.str() );
265}

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

◆ GetVolumeSegment() [2/4]

TGeoVolume * MdcROOTGeo::GetVolumeSegment ( int  segment)

Get segment volume;.

◆ GetVolumeSegment() [3/4]

TGeoVolume * MdcROOTGeo::GetVolumeSegment ( int  segment)

Get segment volume;.

◆ GetVolumeSegment() [4/4]

TGeoVolume * MdcROOTGeo::GetVolumeSegment ( int  segment)

Get segment volume;.

◆ Init2DGeometry() [1/2]

void MdcROOTGeo::Init2DGeometry ( )

Initialize 2D Geometry.

Definition at line 126 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

127{
128 if (m_ROOTGeoInit != 1 && m_ROOTGeoInit != 2) {
129 cout << "MdcROOTGeo::Init2DGeometry, ROOT Geometry not Initialized yet!" << endl;
130 return;
131 }
132
133 m_2DGeoInit = 1;
134 Int_t mdcColor = 11; //1002; // 41, 29
135 Int_t mdcLineColor = 15;
136 Int_t mdcXYStyle = 1001;//3001;
137 Int_t mdcZRStyle = 1001;//3007;
138 Int_t mdcStereoSuperColor = 38;
139 Int_t mdcAxialSuperColor = 4;
140
141 Double_t local[3] = {0.0, 0.0, 0.0};
142 Double_t master[3] = {0.0, 0.0, 0.0};
143 //Int_t nPoints = 4;
144 Double_t P[306] = {0.0}; //Long Peixun's update: 300 -> 306, at most 102 points
145 Double_t center[3] = {0.0, 0.0, 0.0};
146 TString name;
147
148 //----------XY-----------
149 // Mdc
150 TGeoTube *mdcShape = (TGeoTube*)GetVolumeMdc()->GetShape();
151 //Long Peixun's update: Consider CGEM detector
152 Double_t rmin = mdcShape->GetRmin();
153 if (m_StartLayer > 0) //if contains CGEM
154 {
155 TGeoTube *mdcShapeOuter = (TGeoTube*)(GetLayer(m_StartLayer)->GetVolume())->GetShape();
156 rmin = mdcShapeOuter->GetRmin();
157 }
158
159 m_MdcXY = new BesCircle2D("Mdc", "Mdc", rmin, mdcShape->GetRmax(), &center[0]);
160 m_MdcXY->SetNSegment(360);
161 m_MdcXY->SetFillColor(mdcColor);
162 m_MdcXY->SetFillStyle(mdcXYStyle);
163 m_MdcXY->SetLineColor(mdcLineColor);
164
165 //Long Peixun's update: Annotate
166/* // Mdc Supers
167 Int_t layerIn[4] = {0,
168 m_kStereoLayerIn,
169 m_kStereoLayerIn+m_kAxialLayerIn,
170 m_kStereoLayerIn+m_kAxialLayerIn+m_kStereoLayerOut
171 };
172 Int_t layerOut[4] = {m_kStereoLayerIn-1,
173 m_kStereoLayerIn+m_kAxialLayerIn-1,
174 m_kStereoLayerIn+m_kAxialLayerIn+m_kStereoLayerOut-1,
175 m_kLayer-1
176 };
177 for (Int_t i = 0; i < 4; i++) {
178 TGeoTube *mdcSuperShapeIn = (TGeoTube*)(GetLayer(layerIn[i])->GetVolume())->GetShape();
179 TGeoTube *mdcSuperShapeOut = (TGeoTube*)(GetLayer(layerOut[i])->GetVolume())->GetShape();
180 name = TString("MdcSuper" + i);
181 m_MdcXYSuper[i] = new BesCircle2D(name, name, mdcSuperShapeIn->GetRmin(), mdcSuperShapeOut->GetRmax(), &center[0]);
182 if (i%2 == 0) m_MdcXYSuper[i]->SetFillColor(mdcStereoSuperColor);
183 else m_MdcXYSuper[i]->SetFillColor(mdcAxialSuperColor);
184 } */
185
186 // Mdc Wires
187 //Long Peixun's update: Ignore layer 0~7 if detector contains CGEM
188 for (Int_t layer = m_StartLayer; layer < m_kTrueLayer; layer++) {
189 Int_t simuLayer = GetSimuLayer(layer);
190 for (int replica = 0; replica < m_kReplica[simuLayer]; replica++) {
191 //cout << "layer " << layer << " replica " << replica << endl;
192 TGeoPhysicalNode *wirePhyNode = GetPhysicalReplica(simuLayer, replica);
193 name = TString("Mdc Layer ");
194 name += layer;
195 name += " Wire ";
196 name += replica;
197
198 if (m_kStereoDir[layer] != 0) { // stereo Layer
199 TGeoArb8 *wireShape = (TGeoArb8*)wirePhyNode->GetShape();
200 Double_t *localArb8Point, masterArb8Point[24];
201 localArb8Point = wireShape->GetVertices();
202 for (Int_t i = 0; i < 8; i++) {
203 local[0] = localArb8Point[2*i];
204 local[1] = localArb8Point[2*i+1];
205 if (i < 4) local[2] = wireShape->GetDz() * (-1.0);
206 else local[2] = wireShape->GetDz();
207
208 wirePhyNode->GetMatrix(-1*wirePhyNode->GetLevel())
209 ->LocalToMaster(local, &master[0]); // transform to top
210 for (Int_t j = 0; j < 3; j++) {
211 masterArb8Point[3*i+j] = master[j];
212 }
213 }
214
215 m_Mdc2DWire[layer][replica] = new Mdc2DWire(name, name, 8, &masterArb8Point[0]);
216
217 }
218 else { // axial Layer
219
220 TGeoTubeSeg *wireShape = (TGeoTubeSeg*)wirePhyNode->GetShape();
221
222 Double_t centerR = 0.5*(wireShape->GetRmin() + wireShape->GetRmax());
223 if (layer >= m_kStereoLayerIn+m_kAxialLayerIn+m_kStereoLayerOut)
224 centerR = wireShape->GetRmax();
225 Double_t centerPhi =
226 0.5*(wireShape->GetPhi1() + wireShape->GetPhi2()) * TMath::DegToRad();
227 local[0] = centerR * cos(centerPhi);
228 local[1] = centerR * sin(centerPhi);
229 local[2] = 0.0;
230 wirePhyNode->GetMatrix(-1*wirePhyNode->GetLevel())
231 ->LocalToMaster(local, &master[0]); // transform to top
232
233 Double_t rmin = wireShape->GetRmin();
234 Double_t rmax = wireShape->GetRmax();
235 if (layer >= m_kStereoLayerIn+m_kAxialLayerIn+m_kStereoLayerOut)
236 rmax = rmin + 2*(rmax-rmin);
237 m_Mdc2DWire[layer][replica] =
238 new Mdc2DWire( name, name, rmin, rmax, wireShape->GetDz(),centerPhi, &master[0] );
239 }
240 }
241 }
242
243 //----------ZR-----------
244 // Mdc
245 Int_t iPoint = 0;
246 TGeoTube *aMdcLayer = 0;
247
248 //Long Peixun's update: Ignore layer 0~7 if detector contains CGEM
249 for (Int_t layer = m_StartLayer; layer < m_kLayer; layer++) {
250 aMdcLayer = (TGeoTube*)GetLayer(layer)->GetVolume()->GetShape();
251 P[3*iPoint] = 0.0;
252 P[3*iPoint+1] = aMdcLayer->GetRmin();
253 P[3*iPoint+2] = aMdcLayer->GetDz();
254 iPoint++;
255 }
256
257 P[3*iPoint] = 0.0;
258 P[3*iPoint+1] = aMdcLayer->GetRmax();
259 P[3*iPoint+2] = aMdcLayer->GetDz();
260 iPoint++;
261 P[3*iPoint] = 0.0;
262 P[3*iPoint+1] = aMdcLayer->GetRmax();
263 P[3*iPoint+2] = aMdcLayer->GetDz() * (-1.0);
264 iPoint++;
265
266 for (Int_t layer = m_kLayer-1; layer >= m_StartLayer; layer--) {
267 aMdcLayer = (TGeoTube*)GetLayer(layer)->GetVolume()->GetShape();
268 P[3*iPoint] = 0.0;
269 P[3*iPoint+1] = aMdcLayer->GetRmin();
270 P[3*iPoint+2] = aMdcLayer->GetDz() * (-1.0);
271 iPoint++;
272 }
273
274
275 m_MdcZR[0] = new BesPolygon2D("MdcZRUp", "MdcZRUp", iPoint, &P[0]);
276
277 for (Int_t i = 0; i < iPoint; i++)
278 P[3*i+1] *= -1.0;
279
280 m_MdcZR[1] = new BesPolygon2D("MdcZRDown", "MdcZRDown", iPoint, &P[0]);
281
282 for (Int_t i = 0; i < 2; i++) {
283 m_MdcZR[i]->SetFillColor(mdcColor);
284 m_MdcZR[i]->SetFillStyle(mdcZRStyle);
285 m_MdcZR[i]->SetLineColor(mdcLineColor);
286 m_MdcZR[i]->SetRotatable(true); //Long Peixun's update
287 }
288}
double P(RecMdcKalTrack *trk)
double sin(const BesAngle a)
double cos(const BesAngle a)
TGeoPhysicalNode * GetPhysicalReplica(int layer, int replica)
Get replica physical node;.

Referenced by BesGeometry::InitGeometry().

◆ Init2DGeometry() [2/2]

void MdcROOTGeo::Init2DGeometry ( )

Initialize 2D Geometry.

◆ InitFromGdml() [1/2]

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

Initialize the instance of ROOTGeo.

Definition at line 55 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

56{
57 ReadGdml(gdmlFile, setupName);
58 SetNode();
60
61 m_ROOTGeoInit = 1;
62}
void SetNode()
Set the pointers to theirs nodes;.
void SetDefaultVis()
Set default visual attributes;.
void ReadGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of ROOTGeo.

◆ InitFromGDML() [1/2]

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

Initialize ROOTGeo from GDML.

Definition at line 110 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

111{
112 m_ROOTGeoInit = 2;
113 ReadGdml(gdmlFile, setupName);
114 SetNode();
115}

Referenced by BesGeometry::InitFromGDML().

◆ InitFromGDML() [2/2]

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

Initialize ROOTGeo from GDML.

◆ InitFromGdml() [2/2]

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

Initialize the instance of ROOTGeo.

◆ InitFromROOT() [1/2]

void MdcROOTGeo::InitFromROOT ( TGeoVolume *  vol)

Initialize ROOTGeo from TGeoVolume logicalMdc.

Definition at line 118 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

119{
120 m_ROOTGeoInit = 1;
121 SetVolumeMdc(vol);
122 SetNode();
123}
void SetVolumeMdc(TGeoVolume *vol)
Set Mdc volume, while initializing from ROOT;.

Referenced by BesGeometry::InitFromROOT().

◆ InitFromROOT() [2/2]

void MdcROOTGeo::InitFromROOT ( TGeoVolume *  vol)

Initialize ROOTGeo from TGeoVolume logicalMdc.

◆ IsHit() [1/2]

Bool_t MdcROOTGeo::IsHit ( Int_t  layer,
Int_t  wire 
)

Judge whether the digiCol contains (layer, wire)

Definition at line 1059 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

1060{
1061 if (m_MdcDigiCol) {
1062 for (int i = 0; i < m_MdcDigiCol->GetEntries(); i++) {
1063 Identifier mdcID( ((TMdcDigi*)m_MdcDigiCol->At(i))->getIntId() );
1064 if (layer == MdcID::layer( mdcID ) && wire == MdcID::wire( mdcID )) {
1065 return kTRUE;
1066 }
1067 }
1068 }
1069
1070 return kFALSE;
1071}
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
static int wire(const Identifier &id)

◆ IsHit() [2/2]

Bool_t MdcROOTGeo::IsHit ( Int_t  layer,
Int_t  wire 
)

Judge whether the digiCol contains (layer, wire)

◆ SetAllVisible() [1/4]

void MdcROOTGeo::SetAllVisible ( )

Set all visible;.

Definition at line 170 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

171{
172 for (int segment = 1; segment <= m_kSegment; segment++) {
173 GetVolumeSegment(segment)->SetVisibility(0);
174 }
175
176 for (int layer = 0; layer < m_kLayer; layer++) {
177 GetVolumeLayer(layer)->SetVisibility(1);
178 GetVolumeReplica(layer)->SetVisibility(0);
179 }
180
181 for (int segment = 1; segment <= m_kSegment; segment++) {
182 for (int no = 0; no < 2; no++) {
183 GetSegment(segment, no)->SetVisibility(1);
184 }
185 }
186
187 for (int layer = 0; layer < m_kLayer; layer++) {
188 GetLayer(layer)->SetVisibility(1);
189 for (int replica = 0; replica < m_kReplica[layer]; replica++) {
190 GetReplica(layer, replica)->SetVisibility(0);
191 }
192 }
193}
TGeoNode * GetSegment(int segment, int no)
Get segment node;.
TGeoVolume * GetVolumeLayer(int layer)
Get layer volume;
TGeoNode * GetReplica(int layer, int replica)
Get replica node;.
TGeoVolume * GetVolumeReplica(int layer)
Get replica volume;.
TGeoVolume * GetVolumeSegment(int segment)
Get segment volume;.

◆ SetAllVisible() [2/4]

void MdcROOTGeo::SetAllVisible ( )

Set all visible;.

◆ SetAllVisible() [3/4]

void MdcROOTGeo::SetAllVisible ( )

Set all visible;.

◆ SetAllVisible() [4/4]

void MdcROOTGeo::SetAllVisible ( )

Set all visible;.

◆ SetColorfulWire() [1/2]

void MdcROOTGeo::SetColorfulWire ( Bool_t  input)

Definition at line 860 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

860 {
861 k_ColorfulWire = input;
862}

◆ SetColorfulWire() [2/2]

void MdcROOTGeo::SetColorfulWire ( Bool_t  input)

◆ SetDefaultVis() [1/2]

void MdcROOTGeo::SetDefaultVis ( )

Set default visual attributes;.

Definition at line 120 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

121{
122 //std::cout << "begin of set defaultvis" << std::endl;
123 int mdcColor = 3;
124 int segmentColor = 0;
125 int hypeColor = 3;
126 int tubeColor = 4;
127 int twistedTubsColor = 3;
128 int replicaColor = 4;
129
130 m_Mdc->SetLineColor(mdcColor);
131 m_Mdc->SetVisibility(0);
132
133 for (int segment = 1; segment <= m_kSegment; segment++) {
134 GetVolumeSegment(segment)->SetLineColor(segmentColor);
135 GetVolumeSegment(segment)->SetVisibility(0);
136 }
137
138 for (int layer =0; layer < m_kLayer; layer++) {
139 if ( (layer >= 0 && layer < m_kStereoLayerIn) ||
140 (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
141 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) ) {
142 GetVolumeLayer(layer)->SetLineColor(hypeColor);
143 GetVolumeReplica(layer)->SetLineColor(twistedTubsColor);
144 }
145 else {
146 GetVolumeLayer(layer)->SetLineColor(tubeColor);
147 GetVolumeReplica(layer)->SetLineColor(replicaColor);
148 }
149 GetVolumeLayer(layer)->SetVisibility(0);
150 GetVolumeReplica(layer)->SetVisibility(1);
151 }
152
153 for (int segment = 1; segment <= m_kSegment; segment++) {
154 for (int no = 0; no < 2; no++) {
155 GetSegment(segment, no)->SetVisibility(0);
156 }
157 }
158
159 for (int layer = 0; layer < m_kLayer; layer++) {
160 GetLayer(layer)->SetVisibility(0);
161 for (int replica = 0; replica < m_kReplica[layer]; replica++) {
162 GetReplica(layer, replica)->SetVisibility(0);
163 }
164 }
165
166 //std::cout << "end of set defaultvis" << std::endl;
167}

Referenced by InitFromGdml().

◆ SetDefaultVis() [2/2]

void MdcROOTGeo::SetDefaultVis ( )

Set default visual attributes;.

◆ SetDetector() [1/2]

void MdcROOTGeo::SetDetector ( )

Draw Detecor (what is detector depends on you)

Definition at line 629 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

630{
631 BesView *view = 0;
632 if (gPad) view = dynamic_cast<BesView*>(gPad->GetView());
633 //if (view) cout << "viewVisFull3DMdc " << view->GetVisFull3DMdc() << endl;
634
635 m_DetectorsArray->Clear();
636 for (int segment = 0; segment < 2*m_kSegment-2; segment++) {
637 TGeoPhysicalNode *phyNode = 0;
638 phyNode = m_PhysicalSegment[segment];
639 //cout << m_PhysicalSegment[segment]->GetName() << endl;
640 if (phyNode) {
641 phyNode->SetVisibility(0); // set all invisible before set any visible
642 if ( (segment >= 2 && segment <= 3) || segment > 59) {
643 m_DetectorsArray->Add( phyNode );
644 }
645 else if (view && view->GetVisFull3DMdc()) {
646 m_DetectorsArray->Add( phyNode );
647 }
648 }
649 }
650 /*
651 for (int part = 0; part < m_kPart; part++) {
652 int nPhi = (part == 1 ? m_kPhiBr : m_kPhiEc);
653 for (int phi = 0; phi < nPhi; phi++) {
654 int nTheta = (part == 1 ? m_kThetaBr : m_kThetaEc);
655 for (int theta = 0; theta < nTheta; theta++) {
656 // This is you detector, set it on
657 if ( (part == 1 && theta != 0 && theta != 43 && ((phi != 0 && phi != 60) || theta%2 == 0)) ||
658 (part != 1 && theta != 0) ) {
659 m_PhysicalCrystal[part][phi][theta]->SetVisibility(0);
660 }
661
662 // This is you hit
663 // when you are to set fired hits to another color, say red,
664 // SetIsVolAtt(kFALSE) and to then SetLineColor(kRed);
665 if (phi == 12 && theta == 5) {
666 m_PhysicalCrystal[part][phi][theta]->SetVisibility(1);
667 m_PhysicalCrystal[part][phi][theta]->SetLineColor(2);
668 }
669 }
670 }
671 }
672 std::cout << "end of set detector on" << std::endl;
673 */
674}

Referenced by BesClient::HandleViewOptionMenu().

◆ SetDetector() [2/2]

void MdcROOTGeo::SetDetector ( )

Draw Detecor (what is detector depends on you)

◆ SetHalfVisible() [1/2]

void MdcROOTGeo::SetHalfVisible ( )

Set half visible;.

Definition at line 512 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

513{
514 for (int segment = 1; segment <= m_kSegment; segment++) {
515 GetVolumeSegment(segment)->SetVisibility(0);
516 }
517
518 //Long Peixun's update: Ignore layer 0~7 if detector contains CGEM
519 for (int layer = m_StartLayer; layer < m_kLayer; layer++) {
520 GetVolumeLayer(layer)->SetVisibility(0);
521 GetVolumeReplica(layer)->SetVisibility(1);
522 }
523
524 for (int segment = 1; segment <= m_kSegment; segment++) {
525 for (int no = 0; no < 2; no++) {
526 GetSegment(segment, no)->SetVisibility(0);
527 }
528 }
529
530 //Long Peixun's update: Ignore layer 0~7 if detector contains CGEM
531 for (int layer = m_StartLayer; layer < m_kLayer; layer++) {
532 GetLayer(layer)->SetVisibility(0);
533 for (int replica = 0; replica < m_kReplica[layer]; replica++) {
534 if (replica < m_kReplica[layer]/4 ||
535 replica > m_kReplica[layer]*3/4 ) GetReplica(layer, replica)->SetVisibility(1);
536 else GetReplica(layer, replica)->SetVisibility(0);
537 }
538 }
539}

◆ SetHalfVisible() [2/2]

void MdcROOTGeo::SetHalfVisible ( )

Set half visible;.

◆ SetHits() [1/2]

void MdcROOTGeo::SetHits ( )

Definition at line 702 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

703{
704 // set previous event hits to default vis
705 //Long Peixun's update: move to ClearHits()
706 ClearHits();
707
708 // set new hits
709 //Long Peixun's update: Consider gEvent == NULL
710 int NDigiCol = 0;
711 if (gEvent)
712 {
713 m_MdcDigiCol = gEvent->GetMdcDigiCol();
714 //Long Peixun's update: Consider m_MdcDigiCol == NULL
715 if (m_MdcDigiCol) NDigiCol = m_MdcDigiCol->GetEntries();
716 else NDigiCol = 0;
717 }
718
719 for (int i = 0; i < NDigiCol; i++) {
720 TMdcDigi *aMdcDigi = (TMdcDigi*)m_MdcDigiCol->At(i);
721 Identifier aMdcID( aMdcDigi->getIntId() );
722 int layer = MdcID::layer( aMdcID );
723 int wire = MdcID::wire( aMdcID );
724
725 Double_t time = RawDataUtil::MdcTime(aMdcDigi->getTimeChannel());
726 Int_t charge = RawDataUtil::MdcCharge(aMdcDigi->getChargeChannel());
727 unsigned int overflow = aMdcDigi->getOverflow();
728
729 //Long Peixun's update: the element type of m_HitsArray is replaced by MdcPhysicalPointer
730 MdcPhysicalPointer* phyNode = 0;
731 if (layer < 36)
732 { // number of layers in the three inner
733 phyNode = &m_PhysicalReplica[layer][wire];
734 // Long Peixun's update: Add additional information into pointer
735 phyNode->setTimeChannel(aMdcDigi->getTimeChannel());
736 phyNode->setChargeChannel(aMdcDigi->getChargeChannel());
737 phyNode->setQOverflow(overflow & 2);
738 if (phyNode) m_HitsArray->Add(phyNode);
739 }
740 else
741 {
742 phyNode = &m_PhysicalReplica[GetSimuLayer(layer)][wire];
743 if (phyNode) m_HitsArray->Add(phyNode);
744 phyNode->setTimeChannel(aMdcDigi->getTimeChannel());
745 phyNode->setChargeChannel(aMdcDigi->getChargeChannel());
746 phyNode->setQOverflow(overflow & 2);
747
748 phyNode = &m_PhysicalReplica[GetSimuLayer(layer) + 1][wire];
749 if (phyNode) m_HitsArray->Add(phyNode);
750 phyNode->setTimeChannel(aMdcDigi->getTimeChannel());
751 phyNode->setChargeChannel(aMdcDigi->getChargeChannel());
752 phyNode->setQOverflow(overflow & 2);
753 }
754
755 Mdc2DWire *aWire = 0;
756 aWire = m_Mdc2DWire[layer][wire];
757 if (aWire) {
758 aWire->ClearInfo();
759 aWire->AddInfo(aWire->GetTitle());
760 double evTime = gEvent->GetHeader().GetEvTime();
761
762 char data[200]; //Long Peixun's update: 100 -> 200
763 if(time>1000000) {
764 sprintf(data, "NO time");
765 }else{
766 sprintf(data, "time=%-.1f ns", time);
767 if(fabs(evTime)>0.0001){
768 sprintf(data, "%s, Tdrift(Raw)=%-.1f ns", data, time - evTime +230);
769 }
770 }
771 if(charge>1000000) {
772 sprintf(data, "%s, NO charge", data);
773 }else{
774 sprintf(data, "%s, charge=%d", data,charge);
775 }
776 aWire->AddInfo( TString(data) );
777 sprintf(data, "Fired");
778 aWire->AddInfo( TString(data) );
779
780 aWire->SetTime(time);//yzhang
781 aWire->SetCharge(charge);//yzhang
782 aWire->SetQOverflow(overflow&2);//yzhang
783 aWire->SetEvTime(evTime);
784
785 //Long Peixun's update: Set raw channel data of aWire
786 aWire->SetTimeChannel(aMdcDigi->getTimeChannel());
787 aWire->SetChargeChannel(aMdcDigi->getChargeChannel());
788
789 aWire->CloseInfo();
790
791 m_2DHitsArray->Add(aWire);
792 }
793 }
794}
TTree * data
Double_t time
void SetChargeChannel(UInt_t cc)
Definition: Mdc2DWire.cxx:531
void SetQOverflow(Bool_t qOvfl)
Definition: Mdc2DWire.cxx:513
void SetTime(Double_t time)
Definition: Mdc2DWire.cxx:499
void SetEvTime(Double_t time)
Definition: Mdc2DWire.cxx:520
void SetTimeChannel(UInt_t tc)
Definition: Mdc2DWire.cxx:527
void SetCharge(Double_t charge)
Definition: Mdc2DWire.cxx:506
void setQOverflow(Bool_t sqof)
void setTimeChannel(UInt_t stc)
void setChargeChannel(UInt_t scc)
void ClearHits()
Set all physicalNodes corresponding to digiCol;.
static double MdcCharge(int chargeChannel)

Referenced by BesEvent::SetHits().

◆ SetHits() [2/2]

void MdcROOTGeo::SetHits ( )

◆ SetMdcTimeSubEvTime() [1/2]

void MdcROOTGeo::SetMdcTimeSubEvTime ( Bool_t  input)

Definition at line 865 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

865 {
866 k_MdcTimeSubEvTime = input;
867}

◆ SetMdcTimeSubEvTime() [2/2]

void MdcROOTGeo::SetMdcTimeSubEvTime ( Bool_t  input)

◆ SetNode() [1/4]

void MdcROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

Definition at line 65 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

66{
67 m_Mdc = GetTopVolume();
68 if(!m_Mdc) std::cout << "m_Mdc = 0" << std::endl;
69
70 for (int layer = 0; layer < m_kLayer; layer++) {
71 //std::cout << "Layer " << layer << std::endl;
72 for (int replica = 0; replica < m_kReplica[layer]; replica++) {
73 std::stringstream osname;
74 int rep = replica;
75 if (layer >= 0 && layer < m_kStereoLayerIn) {
76 osname << "pv_" << "logical" << "Mdc" << "Stereo" << "Layer" << layer << "TwistedTubs" << "_" << rep;
77 }
78 else if (layer >= m_kStereoLayerIn && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
79 rep = CorrectReplica(layer, rep);
80 osname << "pv_" << "logical" << "Mdc" << "Axial" << "Layer" << layer << "Replica" << "_" << rep;
81 }
82 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
83 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
84 osname << "pv_" << "logical" << "Mdc" << "Stereo" << "Layer" << layer << "TwistedTubs" << "_" << rep;
85 }
86 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut &&
87 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut) {
88 rep = CorrectReplica(layer, rep);
89 osname << "pv_" << "logical" << "Mdc" << "Axial" << "Layer" << layer << "_0" << "Replica" << "_" << rep;
90 }
91 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut &&
92 layer < m_kLayer) {
93 rep = CorrectReplica(layer, rep);
94 osname << "pv_" << "logical" << "Mdc" << "Axial" << "Layer" << layer - m_kAxialLayerOut << "_1" << "Replica" << "_" << rep;
95 }
96
97 m_NodeReplica[layer][replica] = GetNode( osname.str() );
98 }
99 }
100}
int CorrectReplica(int layer, int replica)
Correct some axial layer id to copyNo;.

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

◆ SetNode() [2/4]

void MdcROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

◆ SetNode() [3/4]

void MdcROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

◆ SetNode() [4/4]

void MdcROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

◆ SetPhysicalDefaultVis() [1/2]

void MdcROOTGeo::SetPhysicalDefaultVis ( )

Set default physical node attributes;.

Definition at line 592 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

593{
594 // for (int part = 0; part < m_kPart; part++)
595 // {
596 // int nPhi = (part == 1 ? m_kPhiBr : m_kPhiEc);
597 // for (int phi = 0; phi < nPhi; phi++)
598 // {
599 // int nTheta = (part == 1 ? m_kThetaBr : m_kThetaEc);
600 // for (int theta = 0; theta < nTheta; theta++)
601 // {
602 // m_PhysicalCrystal[part][phi][theta]->SetIsVolAtt(kFALSE);
603 // if (part == 1) m_PhysicalCrystal[part][phi][theta]->SetLineColor(m_brCrystalColor);
604 // else m_PhysicalCrystal[part][phi][theta]->SetLineColor(m_ecCrystalColor);
605 // }
606 // }
607 // }
608
609 for (int layer = m_StartLayer; layer < m_kLayer; layer++)
610 {
611 if ( (layer >= 0 && layer < m_kStereoLayerIn) ||
612 (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
613 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) )
614 {
615 for (int replica = 0; replica < m_kReplica[layer]; replica++)
616 GetPhysicalReplica(layer, replica)->SetLineColor(m_twistedTubsColor);
617 }
618 else
619 {
620 for (int replica = 0; replica < m_kReplica[layer]; replica++)
621 GetPhysicalReplica(layer, replica)->SetLineColor(m_replicaColor);
622 }
623 }
624 //std::cout << "end of set defaultvis" << std::endl;
625}

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

◆ SetPhysicalDefaultVis() [2/2]

void MdcROOTGeo::SetPhysicalDefaultVis ( )

Set default physical node attributes;.

◆ SetPhysicalNode() [1/4]

void MdcROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

Definition at line 223 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

224{
225 int twistedTubsColor = 3;
226 int replicaColor = 4;
227
228 if (gGeoManager == 0) std::cout << "Create gGeoManager first" << std::endl;
229 TGeoNode *bes = gGeoManager->GetTopNode();
230 //std::cout << "m_childNo " << m_childNo << std::endl;
231 TGeoNode *mdc = bes->GetDaughter(m_childNo);
232
233 //if(!m_Mdc) std::cout << "m_Mdc = 0" << std::endl;
234
235 for (int layer = 0; layer < m_kLayer; layer++) {
236 TGeoNode *nodeLayer = GetLayer(layer);
237 //std::cout << "Layer " << layer << std::endl;
238 for (int replica = 0; replica < m_kReplica[layer]; replica++) {
239 TGeoNode *nodeReplica = GetReplica(layer, replica);
240 m_PhysicalReplica[layer][replica] = gGeoManager->MakePhysicalNode( TString("/") + bes->GetName() +
241 TString("/") + mdc->GetName() +
242 TString("/") + nodeLayer->GetName() +
243 TString("/") + nodeReplica->GetName());
244 m_PhysicalReplica[layer][replica]->SetVisibility(0);
245 m_PhysicalReplica[layer][replica]->SetIsVolAtt(kFALSE);
246 if ( (layer >= 0 && layer < m_kStereoLayerIn) ||
247 (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
248 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) ) {
249 m_PhysicalReplica[layer][replica]->SetLineColor(twistedTubsColor);
250 }
251 else {
252 m_PhysicalReplica[layer][replica]->SetLineColor(replicaColor);
253 }
254 //if (m_PhysicalReplica[layer][replica]->IsVolAttributes()) std::cout << "yes " << std::endl;
255 }
256 }
257}
std::string mdc
Definition: CalibModel.cxx:45

Referenced by BesGeometry::InitGeometry().

◆ SetPhysicalNode() [2/4]

void MdcROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

◆ SetPhysicalNode() [3/4]

void MdcROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

◆ SetPhysicalNode() [4/4]

void MdcROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

◆ SetQFire() [1/2]

void MdcROOTGeo::SetQFire ( Bool_t  input)

Definition at line 854 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

854 {
855 k_QFire = input;
856 //cout << "Mdc ROOT Geometry ADC Match: " << k_QMatch << endl;
857}

◆ SetQFire() [2/2]

void MdcROOTGeo::SetQFire ( Bool_t  input)

◆ SetQNotOverflow() [1/2]

void MdcROOTGeo::SetQNotOverflow ( Bool_t  input)

Definition at line 848 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

848 {
849 k_QNotOverflow = input;
850 //cout << "Mdc ROOT Geometry TDC Match: " << k_TMatch << endl;
851}

◆ SetQNotOverflow() [2/2]

void MdcROOTGeo::SetQNotOverflow ( Bool_t  input)

◆ SetQuarterVisible() [1/4]

void MdcROOTGeo::SetQuarterVisible ( )

Set quater visible;.

Definition at line 196 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/MdcROOTGeo.cxx.

197{
198 for (int segment = 1; segment <= m_kSegment; segment++) {
199 GetVolumeSegment(segment)->SetVisibility(0);
200 }
201
202 for (int layer = 0; layer < m_kLayer; layer++) {
203 GetVolumeLayer(layer)->SetVisibility(0);
204 GetVolumeReplica(layer)->SetVisibility(1);
205 }
206
207 for (int segment = 1; segment <= m_kSegment; segment++) {
208 for (int no = 0; no < 2; no++) {
209 GetSegment(segment, no)->SetVisibility(0);
210 }
211 }
212
213 for (int layer = 0; layer < m_kLayer; layer++) {
214 GetLayer(layer)->SetVisibility(0);
215 for (int replica = 0; replica < m_kReplica[layer]; replica++) {
216 if (replica < m_kReplica[layer]/4) GetReplica(layer, replica)->SetVisibility(0);
217 else GetReplica(layer, replica)->SetVisibility(1);
218 }
219 }
220}

◆ SetQuarterVisible() [2/4]

void MdcROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetQuarterVisible() [3/4]

void MdcROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetQuarterVisible() [4/4]

void MdcROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetTFire() [1/2]

void MdcROOTGeo::SetTFire ( Bool_t  input)

Definition at line 836 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

836 {
837 k_TFire= input;
838 //cout << "Mdc ROOT Geometry TDC Match: " << k_TMatch << endl;
839}

◆ SetTFire() [2/2]

void MdcROOTGeo::SetTFire ( Bool_t  input)

◆ SetVisMdcDetector() [1/2]

void MdcROOTGeo::SetVisMdcDetector ( )

Set Mdc default detector visibility;.

Definition at line 797 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

798{
799 BesView *view = 0;
800 if (gPad) view = dynamic_cast<BesView*>(gPad->GetView());
801
802 for (int i = 0; i < m_DetectorsArray->GetEntries(); i++) {
803 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_DetectorsArray->At(i);
804 if (view && view->GetVisMdcGlobal()) {
805 phyNode->SetVisibility(1);
806 continue;
807 }
808 phyNode->SetVisibility(0);
809 }
810}

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

◆ SetVisMdcDetector() [2/2]

void MdcROOTGeo::SetVisMdcDetector ( )

Set Mdc default detector visibility;.

◆ SetVisMdcHits() [1/2]

void MdcROOTGeo::SetVisMdcHits ( )

Set Mdc hits visibility;.

Definition at line 813 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

814{
815 BesView *view = 0;
816 if (gPad) view = dynamic_cast<BesView*>(gPad->GetView());
817
818 for (int i = 0; i < m_HitsArray->GetEntries(); i++)
819 {
821 if (view && view->GetVisMdcHitsGlobal())
822 {
823 //Long Peixun's update: Consider overflow options in 3D view
824 if ( (k_TFire && PphyNode->getTimeChannel() == 0x7FFFFFFF)
825 || (k_QFire && PphyNode->getChargeChannel() == 0x7FFFFFFF)
826 || (k_QNotOverflow && PphyNode->getQOverflow()) )
827 (*PphyNode)->SetVisibility(0);
828 else
829 (*PphyNode)->SetVisibility(1);
830 }
831 else (*PphyNode)->SetVisibility(0);
832 }
833}
Bool_t getQOverflow() const
UInt_t getTimeChannel() const
UInt_t getChargeChannel() const

Referenced by BesGeometry::Draw3D().

◆ SetVisMdcHits() [2/2]

void MdcROOTGeo::SetVisMdcHits ( )

Set Mdc hits visibility;.

◆ SetVolumeDefaultVis() [1/2]

void MdcROOTGeo::SetVolumeDefaultVis ( )

Set default visual attributes;.

Definition at line 390 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/MdcROOTGeo.cxx.

391{
392 //std::cout << "begin of set defaultvis" << std::endl;
393 m_Mdc->SetLineColor(m_MdcColor);
394 m_Mdc->SetVisibility(0);
395
396 for (int segment = 1; segment <= m_kSegment; segment++) {
397 GetVolumeSegment(segment)->SetLineColor(m_segmentColor);
398 //if (segment > 3) GetVolumeSegment(segment)->SetVisibility(0);
399 GetVolumeSegment(segment)->SetVisibility(1);
400 }
401
402 //Long Peixun's update: Ignore layer 0~7 if detector contains CGEM
403 for (int layer = m_StartLayer; layer < m_kLayer; layer++) {
404 if ( (layer >= 0 && layer < m_kStereoLayerIn) ||
405 (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
406 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) ) {
407 GetVolumeLayer(layer)->SetLineColor(m_hypeColor);
408 GetVolumeReplica(layer)->SetLineColor(m_twistedTubsColor);
409 }
410 else {
411 GetVolumeLayer(layer)->SetLineColor(m_tubeColor);
412 GetVolumeReplica(layer)->SetLineColor(m_replicaColor);
413 }
414 GetVolumeLayer(layer)->SetVisibility(0);
415 GetVolumeReplica(layer)->SetVisibility(1);
416 }
417
418 for (int segment = 1; segment <= m_kSegment; segment++) {
419 for (int no = 0; no < 2; no++) {
420 GetSegment(segment, no)->SetVisibility(0);
421 }
422 }
423
424 //Long Peixun's update: Ignore layer 0~7 if detector contains CGEM
425 for (int layer = m_StartLayer; layer < m_kLayer; layer++) {
426 GetLayer(layer)->SetVisibility(0);
427 for (int replica = 0; replica < m_kReplica[layer]; replica++) {
428 GetReplica(layer, replica)->SetVisibility(0);
429 }
430 }
431
432 //std::cout << "end of set defaultvis" << std::endl;
433}

◆ SetVolumeDefaultVis() [2/2]

void MdcROOTGeo::SetVolumeDefaultVis ( )

Set default visual attributes;.

◆ SetVolumeMdc() [1/2]

void MdcROOTGeo::SetVolumeMdc ( TGeoVolume *  vol)
inline

Set Mdc volume, while initializing from ROOT;.

Definition at line 105 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/BesVisLib/MdcROOTGeo.h.

105{ m_Mdc = vol; }

Referenced by InitFromROOT().

◆ SetVolumeMdc() [2/2]

void MdcROOTGeo::SetVolumeMdc ( TGeoVolume *  vol)
inline

Set Mdc volume, while initializing from ROOT;.

Definition at line 105 of file InstallArea/include/BesVisLib/BesVisLib/MdcROOTGeo.h.

105{ m_Mdc = vol; }

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