CGEM BOSS 6.6.5.i
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 ClearHits ()
 
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.
 
- Public Member Functions inherited from SubDetectorROOTGeo
 SubDetectorROOTGeo ()
 Constructor.
 
virtual ~SubDetectorROOTGeo ()
 Destructor.
 
void ReadGdml (const char *gdmlFile, const char *setupName)
 Initialize the instance of ROOTGeo.
 
int IsInitialized ()
 If the ROOT geometry of this subdetctor is initialized;.
 
void SetChildNo (int childNo)
 
TGeoVolume * GetLogicalVolume (const std::string &vn)
 Get a logical volume by name;.
 
TGeoVolume * GetTopVolume ()
 Get the top(world) volume;.
 
TGeoVolumeAssembly * GetAssemblyVolume (const std::string &an)
 Get an assembly by name;.
 
TGeoNode * GetNode (const std::string &nn)
 Get a node(physical volume) by name;.
 
 SubDetectorROOTGeo ()
 Constructor.
 
virtual ~SubDetectorROOTGeo ()
 Destructor.
 
virtual void ReadGdml (const char *gdmlFile, const char *setupName)
 Initialize the instance of ROOTGeo.
 
virtual int IsInitialized ()
 If the ROOT geometry of this subdetctor is initialized;.
 
virtual void SetChildNo (int childNo)
 
virtual TGeoVolume * GetLogicalVolume (const std::string &vn)
 Get a logical volume by name;.
 
virtual TGeoVolume * GetTopVolume ()
 Get the top(world) volume;.
 
virtual TGeoVolumeAssembly * GetAssemblyVolume (const std::string &an)
 Get an assembly by name;.
 
virtual TGeoNode * GetNode (const std::string &nn)
 Get a node(physical volume) by name;.
 
virtual int GetHitsNum ()
 Get number of hits in HitsArray;.
 
virtual TGeoPhysicalNode * GetHit (int i)
 Get ith hit in HitsArray;.
 
virtual void SetDetectorOn ()
 Set all physicalNodes in m_DeteorsArray visible;.
 

Additional Inherited Members

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

Detailed Description

Class 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/ROOTGeo-00-00-15/ROOTGeo/EmcROOTGeo.h.

Constructor & Destructor Documentation

◆ EmcROOTGeo() [1/2]

EmcROOTGeo::EmcROOTGeo ( )

Constructor.

Definition at line 28 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

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

◆ ~EmcROOTGeo() [1/2]

EmcROOTGeo::~EmcROOTGeo ( )

Destructor.

Definition at line 50 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

51{ }

◆ EmcROOTGeo() [2/2]

EmcROOTGeo::EmcROOTGeo ( )

Constructor.

◆ ~EmcROOTGeo() [2/2]

EmcROOTGeo::~EmcROOTGeo ( )

Destructor.

Member Function Documentation

◆ Align()

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 1466 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

1467{
1468 //phyNode->Align(newmat, newshape, check);
1469
1470 if (!newmat && !newshape) return;
1471 TGeoNode *node = phyNode->GetNode();
1472
1473 Int_t fLevel=phyNode->GetLevel();
1474 TGeoNode *nnode = 0;
1475 TGeoVolume *vm = phyNode->GetVolume(fLevel-2);
1476 // fLevel-2 is good for Emc geometry, use fLevel-1 if I want to use it in TofROOTGeo
1477 TGeoVolume *vd = 0;
1478
1479 TGeoNode *nodeArray[30];
1480 TString orgName = phyNode->GetName();
1481 Int_t i,id;
1482 if (!phyNode->IsAligned()) {
1483 for (i=0; i<=fLevel-2; i++) {
1484 nodeArray[i] = phyNode->GetNode(i);
1485 }
1486
1487 // fLevel-2 is good for Emc geometry,
1488 // in ROOT::TGeoPhysicalNode::Align,
1489 // it starts from 0, so some nodes were lost.
1490 for (i=fLevel-2; i<fLevel; i++) {
1491 // Get daughter node and its id inside vm
1492 node = phyNode->GetNode(i+1);
1493 id = vm->GetIndex(node);
1494
1495 if (id < 0) {
1496 //printf("cannot align node %s",phyNode->GetNode(i+1)->GetName());
1497 return;
1498 }
1499 // Clone daughter volume and node
1500 vd = node->GetVolume()->CloneVolume();
1501 nnode = node->MakeCopyNode();
1502 // Correct pointers to mother and volume
1503 nnode->SetName(node->GetName());
1504 nnode->SetVolume(vd);
1505 nnode->SetMotherVolume(vm);
1506 // Decouple old node from mother volume and connect new one
1507 vm->GetNodes()->RemoveAt(id);
1508 vm->GetNodes()->AddAt(nnode,id);
1509 nodeArray[i+1] = nnode;
1510 vm = vd;
1511 }
1512 } else {
1513 nnode = phyNode->GetNode();
1514 }
1515
1516 TString name;
1517 for (Int_t j = 0; j < phyNode->GetLevel()+1; j++) {
1518 name += "/";
1519 name += nodeArray[j]->GetName();
1520 }
1521 //phyNode->SetPath(name);
1522 phyNode->SetName(name);
1523 phyNode->Refresh();
1524
1525 // Now nnode is a cloned node of the one that need to be aligned
1526 TGeoNodeMatrix *aligned = (TGeoNodeMatrix*)nnode;
1527 vm = nnode->GetMotherVolume();
1528 vd = nnode->GetVolume();
1529 if (newmat) {
1530 // Register matrix and make it the active one
1531 if (!newmat->IsRegistered()) newmat->RegisterYourself();
1532 aligned->SetMatrix(newmat);
1533 // Update the global matrix for the aligned node
1534 TGeoHMatrix *global = phyNode->GetMatrix();
1535 TGeoHMatrix *up = phyNode->GetMatrix(fLevel-1);
1536 *global = up;
1537 global->Multiply(newmat);
1538 }
1539 // Change the shape for the aligned node
1540 if (newshape) vd->SetShape(newshape);
1541 // Now we have to re-voxelize the mother volume
1542 vm->SetVoxelFinder(0);
1543 vm->Voxelize("ALL");
1544 vm->FindOverlaps();
1545 // Eventually check for overlaps
1546 if (check) vm->CheckOverlaps();
1547 //phyNode->SetAligned(kTRUE);
1548}

Referenced by RestorePhyNode().

◆ ClearHits()

void EmcROOTGeo::ClearHits ( )

Definition at line 786 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

787{
788 //cout << "m_HitsArray->GetEntries(): " << m_HitsArray->GetEntries() << endl;
789 //cout << "m_PhyNodeOrgArray->GetEntries(): " << m_PhyNodeOrgArray->GetEntries() << endl;
790 //cout << "m_2DHitsArray->GetEntries(): " << m_2DHitsArray->GetEntries() << endl;
791 for (int i = 0; i < m_HitsArray->GetEntries(); i++) {
792 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_HitsArray->At(i);
793 //cout << phyNode->GetName() << endl;
794 int color = m_brCrystalColor;
795 int part = GetPart(phyNode);
796 if (part == 0 || part == 2)
797 color = m_ecCrystalColor;
798
799 phyNode->SetLineColor(color);
800 phyNode->SetVisibility(0);
801
802 RestorePhyNode(phyNode, (TGeoNode*)m_PhyNodeOrgArray->At(i));
803 }
804 m_PhyNodeOrgArray->Clear("C");
805 m_HitsArray->Clear("C");
806
807 // set previous event 2D hits info to default
808 for (int i = 0; i < m_2DHitsArray->GetEntries(); i++) {
809 Emc2DCrystal *aCrystal = (Emc2DCrystal*)m_2DHitsArray->At(i);
810 aCrystal->ClearInfo();
811 aCrystal->AddInfo(aCrystal->GetTitle());
812 aCrystal->CloseInfo();
813 }
814 m_2DHitsArray->Clear("C");
815}
virtual void CloseInfo()
virtual void AddInfo(TString info)
virtual void ClearInfo()
void RestorePhyNode(TGeoPhysicalNode *phyNode, TGeoNode *node)
Restore the physical node to original shape.

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

◆ ComputeEndCopyNb()

int EmcROOTGeo::ComputeEndCopyNb ( int num)

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

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

1305{
1306 int copyNb;
1307 switch (num){
1308 case 30:
1309 copyNb = 5;
1310 break;
1311 case 31:
1312 copyNb = 6;
1313 break;
1314 case 32:
1315 copyNb = 14;
1316 break;
1317 case 33:
1318 copyNb = 15;
1319 break;
1320 case 34:
1321 copyNb = 16;
1322 break;
1323 default:
1324 copyNb = num;
1325 break;
1326 }
1327 return copyNb;
1328}
int num[96]
Definition ranlxd.c:373

◆ ComputeThetaPhi()

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

Compute theta, phi from sector, nb.

Definition at line 1188 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

1189{
1190 if ((sector>=0)&&(sector<3))
1191 sector+=16;
1192 if ((sector!=7)&&(sector!=15))
1193 {
1194 if ((nb>=0)&&(nb<4))
1195 {
1196 CryNumberTheta = 0;
1197 CryNumberPhi = (sector-3)*4+nb;
1198 }
1199 else if ((nb>=4)&&(nb<8))
1200 {
1201 CryNumberTheta = 1;
1202 CryNumberPhi = (sector-3)*4+nb-4;
1203 }
1204 else if ((nb>=8)&&(nb<13))
1205 {
1206 CryNumberTheta = 2;
1207 CryNumberPhi = (sector-3)*5+nb-8;
1208 }
1209 else if ((nb>=13)&&(nb<18))
1210 {
1211 CryNumberTheta = 3;
1212 CryNumberPhi = (sector-3)*5+nb-13;
1213 }
1214 else if ((nb>=18)&&(nb<24))
1215 {
1216 CryNumberTheta = 4;
1217 CryNumberPhi = (sector-3)*6+nb-18;
1218 }
1219 else if ((nb>=24)&&(nb<30))
1220 {
1221 CryNumberTheta = 5;
1222 CryNumberPhi = (sector-3)*6+nb-24;
1223 }
1224 }
1225 else// if((sector=7)||(sector==15))
1226 {
1227 if ((nb>=0)&&(nb<4))
1228 {
1229 CryNumberTheta = 0;
1230 CryNumberPhi = (sector-3)*4+3-nb;
1231 }
1232 else if ((nb>=4)&&(nb<8))
1233 {
1234 CryNumberTheta = 1;
1235 CryNumberPhi = (sector-3)*4+7-nb;
1236 }
1237 else if ((nb>=8)&&(nb<13))
1238 {
1239 CryNumberTheta = 2;
1240 CryNumberPhi = (sector-3)*5+12-nb;
1241 }
1242 else if ((nb>=13)&&(nb<18))
1243 {
1244 CryNumberTheta = 3;
1245 CryNumberPhi = (sector-3)*5+17-nb;
1246 }
1247 else if ((nb>=18)&&(nb<24))
1248 {
1249 CryNumberTheta = 4;
1250 CryNumberPhi = (sector-3)*6+23-nb;
1251 }
1252 else if ((nb>=24)&&(nb<30))
1253 {
1254 CryNumberTheta = 5;
1255 CryNumberPhi = (sector-3)*6+29-nb;
1256 }
1257 }
1258
1259 if (id==2)
1260 {
1261 switch (CryNumberTheta)
1262 {
1263 case 0:
1264 if (CryNumberPhi<32)
1265 CryNumberPhi = 31-CryNumberPhi;
1266 else
1267 CryNumberPhi = 95-CryNumberPhi;
1268 break;
1269 case 1:
1270 if (CryNumberPhi<32)
1271 CryNumberPhi = 31-CryNumberPhi;
1272 else
1273 CryNumberPhi = 95-CryNumberPhi;
1274 break;
1275 case 2:
1276 if (CryNumberPhi<40)
1277 CryNumberPhi = 39-CryNumberPhi;
1278 else
1279 CryNumberPhi = 119-CryNumberPhi;
1280 break;
1281 case 3:
1282 if (CryNumberPhi<40)
1283 CryNumberPhi = 39-CryNumberPhi;
1284 else
1285 CryNumberPhi = 119-CryNumberPhi;
1286 break;
1287 case 4:
1288 if (CryNumberPhi<48)
1289 CryNumberPhi = 47-CryNumberPhi;
1290 else
1291 CryNumberPhi = 143-CryNumberPhi;
1292 break;
1293 case 5:
1294 if (CryNumberPhi<48)
1295 CryNumberPhi = 47-CryNumberPhi;
1296 else
1297 CryNumberPhi = 143-CryNumberPhi;
1298 break;
1299 }
1300 }
1301}

◆ Draw()

void EmcROOTGeo::Draw ( Option_t * option)

Draw function.

Definition at line 1360 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

1361{
1362 TString opt = option;
1363 opt.ToUpper();
1364
1365 if (!m_2DGeoInit) cout << "EmcROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
1366 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1367 if (!view) cout << "EmcROOTGeo::Draw(), BesView not found" << endl;
1368
1369 if (view->GetVisEmcGlobal()) { // EmcVisGlobal
1370 TString crystalOpt;
1371
1372 //if (opt.Contains("XY")) {
1373 // west part drawn first usually
1374 for (Int_t part = GetPartNb()-1; part >= 0; part--) {
1375 for (int theta = 0; theta < GetThetaNb(part); theta++) {
1376 for (int phi = 0; phi < GetPhiNb(part, theta); phi++) {
1377
1378 if (m_Emc2DCrystal[part][phi][theta]) {
1379 //cout << "part " << part << " layer " << layer << " crystal " << crystal << endl;
1380 m_Emc2DCrystal[part][phi][theta]->SetFired(false);
1381 if ( (part == 0 && view->GetVisEmcEast()) ||
1382 (part == 1 && view->GetVisEmcBarrel()) ||
1383 (part == 2 && view->GetVisEmcWest()) )
1384 m_Emc2DCrystal[part][phi][theta]->Draw(crystalOpt);
1385 }
1386 }
1387 }
1388 }
1389 }
1390}
Bool_t GetVisEmcBarrel()
Definition BesView.h:155
Bool_t GetVisEmcGlobal()
Definition BesView.h:153
Bool_t GetVisEmcWest()
Definition BesView.h:156
Bool_t GetVisEmcEast()
Definition BesView.h:154
virtual void SetFired(bool status=true)
virtual void Draw(Option_t *option="")
int GetPhiNb(int part)
Get number of phi on part;.
int GetThetaNb(int part)
Get number of theta on part;.

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

◆ DrawHits()

void EmcROOTGeo::DrawHits ( Option_t * option)

Draw 2D hits.

Definition at line 1393 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

1394{
1395 // cout << "EmcROOTGeo::DrawHits" << endl;
1396 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1397 if (!view) cout << "EmcROOTGeo::DrawHits(), BesView not found" << endl;
1398
1399 //cout << "VisEmcHitsGlobal " << view->GetVisEmcHitsGlobal() << endl;
1400 //cout << "VisEmcHitsEast " << view->GetVisEmcHitsEast() << endl;
1401 //cout << "VisEmcHitsBarrel " << view->GetVisEmcHitsBarrel() << endl;
1402 //cout << "VisEmcHitsWest " << view->GetVisEmcHitsWest() << endl;
1403
1404 if (view->GetVisEmcHitsGlobal())
1405 {
1406 //Long Peixun's update: Use m_2DHitsArray which contains ready hits rather than rebuild hits
1407 for (int i = 0; i < m_2DHitsArray->GetEntries(); ++i)
1408 {
1409 Emc2DCrystal* aCrystal = (Emc2DCrystal*)m_2DHitsArray->At(i);
1410 if (aCrystal && aCrystal->GetCharge() > 5)
1411 {
1412 if ( (aCrystal->GetPart() == 0 && view->GetVisEmcHitsEast()) ||
1413 (aCrystal->GetPart() == 1 && view->GetVisEmcHitsBarrel()) ||
1414 (aCrystal->GetPart() == 2 && view->GetVisEmcHitsWest()) )
1415 {
1416 aCrystal->SetFired(true);
1417 aCrystal->Draw();
1418 }
1419 }
1420 }
1421
1422/* // reset time and charge to zero
1423 for (Int_t part = GetPartNb()-1; part >= 0; part--) {
1424 for (int theta = 0; theta < GetThetaNb(part); theta++) {
1425 for (int phi = 0; phi < GetPhiNb(part, theta); phi++) {
1426 if (m_Emc2DCrystal[part][phi][theta]) {
1427 m_Emc2DCrystal[part][phi][theta]->ResetTimeCharge();
1428 //m_Emc2DCrystal[part][phi][theta]->ClearInfo();
1429 }
1430 }
1431 }
1432 }
1433
1434 if (m_EmcDigiCol) {
1435 for (int i = 0; i < m_EmcDigiCol->GetEntries(); i++) {
1436 TEmcDigi *aEmcDigi = (TEmcDigi*)m_EmcDigiCol->At(i);
1437
1438 //cout << aEmcDigi->getIntId() << endl;
1439 Identifier aEmcID( aEmcDigi->getIntId() );
1440 int part = EmcID::barrel_ec( aEmcID );
1441 int theta = EmcID::theta_module( aEmcID );
1442 int phi = EmcID::phi_module( aEmcID );
1443
1444 Emc2DCrystal *aCrystal = 0;
1445 aCrystal = m_Emc2DCrystal[part][phi][theta];
1446
1447 //Double_t charge = Double_t(aEmcDigi->getChargeChannel()) / EMC_CHARGE_FACTOR;
1448 Double_t charge = RawDataUtil::EmcCharge(aEmcDigi->getMeasure(),
1449 aEmcDigi->getChargeChannel());
1450 aCrystal->SetCharge(charge);
1451 //cout << "charge " << aCrystal->GetCharge() << endl;
1452
1453 if (aCrystal&&charge > 5) {
1454 if ( (part == 0 && view->GetVisEmcHitsEast()) ||
1455 (part == 1 && view->GetVisEmcHitsBarrel()) ||
1456 (part == 2 && view->GetVisEmcHitsWest()) ) {
1457 aCrystal->SetFired(true);
1458 aCrystal->Draw();
1459 }
1460 }
1461 }
1462 } */
1463 }
1464}
Bool_t GetVisEmcHitsBarrel()
Definition BesView.h:234
Bool_t GetVisEmcHitsGlobal()
Definition BesView.h:232
Bool_t GetVisEmcHitsWest()
Definition BesView.h:235
Bool_t GetVisEmcHitsEast()
Definition BesView.h:233
virtual Int_t GetPart()
virtual Double_t GetCharge()

Referenced by BesEvent::DrawHits().

◆ Get2DCrystal()

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

Get Emc2DCrystal;.

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

1332{
1333 if (m_Emc2DCrystal[part][phi][theta]) return m_Emc2DCrystal[part][phi][theta];
1334 else return 0;
1335}

Referenced by BesEvent::ConstructEmcTrackFromRec().

◆ GetCrystal() [1/2]

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

Get crystal one;.

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

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

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

◆ GetCrystal() [2/2]

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

Get crystal one;.

◆ GetCrystal2()

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

Get crystal2 one;.

Definition at line 1154 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

1155{
1156 // in fact, br only 44 crystal nodes;
1157 if (GetTheta2(part, phi, theta) == 0) return 0;
1158 else return GetTheta2(part, phi, theta)->GetDaughter(0);
1159}
TGeoNode * GetTheta2(int part, int phi, int theta)
Get theta2 node;.

Referenced by SetVolumeDefaultVis().

◆ GetPart() [1/3]

TGeoNode * EmcROOTGeo::GetPart ( int part)

Get part node;.

Definition at line 415 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

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

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

◆ GetPart() [2/3]

TGeoNode * EmcROOTGeo::GetPart ( int part)

Get part node;.

◆ GetPart() [3/3]

int EmcROOTGeo::GetPart ( TGeoPhysicalNode * phyNode)

Get part no of a crystal physcial node.

Definition at line 1338 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

1339{
1340 for (int part = 0; part < GetPartNb(); part++) {
1341 for (int theta = 0; theta < GetThetaNb(part); theta++) {
1342 for (int phi = 0; phi < GetPhiNb(part, theta); phi++) {
1343 if (phyNode == GetPhysicalCrystal(part, phi, theta)) {
1344 //cout << "EmcROOTGeo::GetPart()" << part << endl;
1345 return part;
1346 }
1347 if (phyNode == GetPhysicalCrystal2(part, phi, theta)) {
1348 //cout << "EmcROOTGeo::GetPart()" << part << endl;
1349 return part;
1350 }
1351 }
1352 }
1353 }
1354
1355 cout << "EmcROOTGeo::GetPart, this crystal physical node does not exist!" << endl;
1356 return -1;
1357}
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;.

◆ GetPartNb() [1/2]

int EmcROOTGeo::GetPartNb ( )

Get number of part;.

Definition at line 316 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

317{
318 int part = m_kPart;
319
320 return part;
321}

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

◆ GetPartNb() [2/2]

int EmcROOTGeo::GetPartNb ( )

Get number of part;.

◆ GetPhi() [1/2]

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

Get phi node;.

Definition at line 429 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

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

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

◆ GetPhi() [2/2]

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

Get phi node;.

◆ GetPhiNb() [1/2]

int EmcROOTGeo::GetPhiNb ( int part)

Get number of phi on part;.

Definition at line 333 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

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

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

◆ GetPhiNb() [2/2]

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

Get number of phi on part;.

Definition at line 968 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

969{
970 int phiNb = m_kPhiBr;
971 if (part != 1) {
972 if (theta < 2) phiNb = 4*m_kSectorEc;
973 else if (theta >= 2 && theta < 4) phiNb = 5*m_kSectorEc;
974 else if (theta >= 4 && theta < m_kThetaEc) phiNb = 6*m_kSectorEc;
975 }
976
977 return phiNb;
978}

◆ GetPhysicalCrystal() [1/2]

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

Get crystal physical node;.

Definition at line 472 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

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

Referenced by BesEvent::ConstructEmcTrackFromRec(), GetPart(), BesGeometry::GetPhysicalEmcCrystal(), Init2DGeometry(), EmcRecROOTGeo::InitFromXML(), SetDetector(), BesVisDisplay::SetEmcFiredCell(), SetHits(), and SetPhysicalDefaultVis().

◆ GetPhysicalCrystal() [2/2]

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

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

◆ GetPhysicalCrystal2()

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 1174 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

1175{
1176 return m_PhysicalCrystal2[part][phi][theta];
1177}

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

◆ GetTheta() [1/2]

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

Get theta node;.

Definition at line 453 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

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

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

◆ GetTheta() [2/2]

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

Get theta node;.

◆ GetTheta2()

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

Get theta2 node;.

Definition at line 1136 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

1137{
1138 if (m_NodeTheta2[part][phi][theta] != 0) {
1139 return m_NodeTheta2[part][phi][theta];
1140 }
1141 else {
1142 return 0;
1143 }
1144}

Referenced by GetCrystal2(), and SetVolumeDefaultVis().

◆ GetThetaNb() [1/2]

int EmcROOTGeo::GetThetaNb ( int part)

Get number of theta on part;.

Definition at line 324 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

325{
326 int thetaNb = m_kThetaBr;
327 if (part != 1) thetaNb = m_kThetaEc;
328
329 return thetaNb;;
330}

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

◆ GetThetaNb() [2/2]

int EmcROOTGeo::GetThetaNb ( int part)

Get number of theta on part;.

◆ GetVolumeCrystal() [1/2]

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

Get crystal volume;.

Definition at line 394 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

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

Referenced by BesGeometry::GetVolumeEmcCrystal(), SetDefaultVis(), and SetVolumeDefaultVis().

◆ GetVolumeCrystal() [2/2]

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

Get crystal volume;.

◆ GetVolumeEmc() [1/2]

TGeoVolume * EmcROOTGeo::GetVolumeEmc ( )
inline

Get Emc volume;.

Definition at line 68 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/ROOTGeo/EmcROOTGeo.h.

68{ return m_Emc; }

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

◆ GetVolumeEmc() [2/2]

TGeoVolume * EmcROOTGeo::GetVolumeEmc ( )
inline

Get Emc volume;.

Definition at line 106 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/BesVisLib/EmcROOTGeo.h.

106{ return m_Emc; }

◆ GetVolumePart() [1/2]

TGeoVolume * EmcROOTGeo::GetVolumePart ( int part)

Get part volume;.

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

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

Referenced by BesGeometry::GetVolumeEmcPart(), SetDefaultVis(), and SetVolumeDefaultVis().

◆ GetVolumePart() [2/2]

TGeoVolume * EmcROOTGeo::GetVolumePart ( int part)

Get part volume;.

◆ GetVolumePhi() [1/2]

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

Get phi volume;

Definition at line 357 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

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

Referenced by BesGeometry::GetVolumeEmcPhi(), SetDefaultVis(), and SetVolumeDefaultVis().

◆ GetVolumePhi() [2/2]

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

Get phi volume;

◆ GetVolumeTheta() [1/2]

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

Get theta volume;.

Definition at line 373 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

374{
375 // part0phi0theta0-34, part0phi6theta0-34, part0phi8theta0-34, part0phi7theta0-34
376 // part1theta0-43
377 std::stringstream osname;
378 if (part == 1 && theta >= 0 && theta < 44) {
379 osname << "logical" << "Emc" << "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 osname << "logical" << "Emc" << "Part" << part << "Phi" << phi << "Theta" << theta;
385 return GetLogicalVolume( osname.str() );
386 }
387 else {
388 std::cout << "No volume " << osname.str() << std::endl;
389 return 0;
390 }
391}

Referenced by BesGeometry::GetVolumeEmcTheta(), SetDefaultVis(), and SetVolumeDefaultVis().

◆ GetVolumeTheta() [2/2]

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

Get theta volume;.

◆ HasTwoNodes()

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

Whether this id is combined of two nodes.

Definition at line 1180 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

1181{
1182 if (part == 1) return false;
1183 else return true;
1184}

◆ Init2DGeometry()

void EmcROOTGeo::Init2DGeometry ( )

Initialize 2D Geometry.

Definition at line 102 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

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

Referenced by BesGeometry::InitGeometry().

◆ InitFromGDML()

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

Initialize ROOTGeo from GDML.

Definition at line 84 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

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

Referenced by BesGeometry::InitFromGDML().

◆ InitFromGdml()

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

Initialize the instance of ROOTGeo.

Definition at line 54 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

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

Referenced by EmcROOTGeo().

◆ InitFromROOT()

void EmcROOTGeo::InitFromROOT ( TGeoVolume * vol)

Initialize ROOTGeo from TGeoVolume logicalEmc.

Definition at line 93 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

94{
95 m_ROOTGeoInit = 1;
96
97 SetVolumeEmc(vol);
98 SetNode();
99}
void SetVolumeEmc(TGeoVolume *vol)
Set Emc volume, while initializing from ROOT;.

Referenced by BesGeometry::InitFromROOT().

◆ RestorePhyNode()

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

Restore the physical node to original shape.

Definition at line 1550 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

1551{
1552 Align(phyNode, node->GetMatrix(), node->GetVolume()->GetShape());
1553}
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 ClearHits().

◆ SetAllVisible() [1/2]

void EmcROOTGeo::SetAllVisible ( )

Set all visible;.

Definition at line 166 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

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

◆ SetAllVisible() [2/2]

void EmcROOTGeo::SetAllVisible ( )

Set all visible;.

◆ SetDefaultVis()

void EmcROOTGeo::SetDefaultVis ( )

Set default visual attributes;.

Definition at line 107 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

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

◆ SetDetector()

void EmcROOTGeo::SetDetector ( )

Set Detecor (what is detector depends on you)

Definition at line 722 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

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

Referenced by BesClient::HandleViewOptionMenu().

◆ SetHalfVisible()

void EmcROOTGeo::SetHalfVisible ( )

Set half visible;.

Definition at line 558 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

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

◆ SetHits()

void EmcROOTGeo::SetHits ( )

Set all physicalNodes corresponding to digiCol;.

Definition at line 818 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

819{
820 // set previous event hits to default vis
821 //Long Peixun's update: move to ClearHits()
822 ClearHits();
823
824 // set new hits
825 //Long Peixun's update: Consider gEvent == NULL
826 int NDigiCol = 0;
827 if (gEvent)
828 {
829 m_EmcDigiCol = gEvent->GetEmcDigiCol();
830 //Long Peixun's update: Consider m_EmcDigiCol == NULL
831 if (m_EmcDigiCol) NDigiCol = m_EmcDigiCol->GetEntries();
832 else NDigiCol = 0;
833 }
834
835 for (int i = 0; i < NDigiCol; i++) {
836 TEmcDigi *aEmcDigi = (TEmcDigi*)m_EmcDigiCol->At(i);
837 Identifier aEmcID( aEmcDigi->getIntId() );
838 int part = EmcID::barrel_ec( aEmcID );
839 int theta = EmcID::theta_module( aEmcID );
840 int phi = EmcID::phi_module( aEmcID );
841
842 Double_t charge = RawDataUtil::EmcCharge(aEmcDigi->getMeasure(),
843 aEmcDigi->getChargeChannel());
844 Double_t time = RawDataUtil::EmcTime(aEmcDigi->getTimeChannel());
845
846 TGeoPhysicalNode *phyNode = 0;
847 phyNode = GetPhysicalCrystal( part, phi, theta );
848 if (phyNode) {
849 m_PhyNodeOrgArray->Add ( phyNode->GetNode() );
850
851 //Double_t *P; // = new Double_t[16];
852 //TGeoArb8 *oldArb8 = (TGeoArb8*)phyNode->GetShape();
853 //P = oldArb8->GetVertices();
854 //TGeoArb8 *newArb8 = new TGeoArb8(charge, &P[0]);
855
856 //TGeoTranslation *newmat =
857 // new TGeoTranslation(0.0, 0.0, oldArb8->GetDz()+newArb8->GetDz());
858 //newmat->RegisterYourself();
859
860 //Align(phyNode, newmat, newArb8);
861
862 m_HitsArray->Add(phyNode); //Long Peiuxn's update: Remove annotation
863 ////delete newArb8;
864 ////delete newmat;
865 }
866
867 phyNode = GetPhysicalCrystal2( part, phi, theta );
868 if (phyNode) {
869 m_PhyNodeOrgArray->Add ( phyNode->GetNode() );
870
871 //Double_t *P; // = new Double_t[16];
872 //TGeoArb8 *oldArb8 = (TGeoArb8*)phyNode->GetShape();
873 //P = oldArb8->GetVertices();
874 //TGeoArb8 *newArb8 = new TGeoArb8(charge, &P[0]);
875
876 //TGeoTranslation *newmat =
877 // new TGeoTranslation(0.0, 0.0, oldArb8->GetDz()+newArb8->GetDz());
878 //newmat->RegisterYourself();
879
880 //Align(phyNode, newmat, newArb8);
881
882 //m_HitsArray->Add( phyNode );
883 ////delete newArb8;
884 ////delete newmat;
885 }
886
887 Emc2DCrystal *aCrystal = 0;
888 aCrystal = m_Emc2DCrystal[part][phi][theta];
889 if (aCrystal) {
890 aCrystal->SetTime(time); //Long Peixun's update: Set Emc crystals' time and charge
891 aCrystal->SetCharge(charge);
892
893 aCrystal->ClearInfo();
894 aCrystal->AddInfo(aCrystal->GetTitle());
895
896 char data[100];
897 sprintf(data, "time = %-.3f ns, charge = %-.3f MeV", time, charge);
898 aCrystal->AddInfo( TString(data) );
899 sprintf(data, "Fired");
900 aCrystal->AddInfo( TString(data) );
901
902 aCrystal->CloseInfo();
903
904 m_2DHitsArray->Add(aCrystal);
905 }
906 }
907}
R__EXTERN BesEvent * gEvent
Definition BesEvent.h:318
Double_t time
const TObjArray * GetEmcDigiCol() const
Definition BesEvent.h:114
virtual void SetTime(Double_t time)
virtual void SetCharge(Double_t charge)
static unsigned int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
Definition EmcID.cxx:38
static unsigned int theta_module(const Identifier &id)
Definition EmcID.cxx:43
static unsigned int phi_module(const Identifier &id)
Definition EmcID.cxx:48
static double EmcTime(int timeChannel)
Definition RawDataUtil.h:20
static double EmcCharge(int measure, int chargeChannel)
Definition RawDataUtil.h:23
UInt_t getMeasure() const
Definition TEmcDigi.cxx:37
UInt_t getIntId() const
Definition TRawData.cxx:50
UInt_t getChargeChannel() const
Definition TRawData.cxx:60
UInt_t getTimeChannel() const
Definition TRawData.cxx:55

Referenced by BesEvent::SetHits().

◆ SetNode() [1/2]

void EmcROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

Definition at line 64 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

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

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

◆ SetNode() [2/2]

void EmcROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

◆ SetNoEndVisible()

void EmcROOTGeo::SetNoEndVisible ( )

Set noend visible;.

Definition at line 597 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

598{
599 /*
600 for (int theta = 0; theta < GetThetaNb(1); theta++) {
601 for (int phi = 0; phi < GetPhiNb(1); phi++) {
602 GetPhysicalCrystal(1, phi, theta)->SetVisibility(1);
603 }
604 }
605 */
606}

◆ SetPhysicalDefaultVis()

void EmcROOTGeo::SetPhysicalDefaultVis ( )

Set default physical node attributes;.

Definition at line 683 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

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

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

◆ SetPhysicalNode() [1/2]

void EmcROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

Definition at line 255 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

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

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

◆ SetPhysicalNode() [2/2]

void EmcROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

◆ SetQuarterVisible() [1/2]

void EmcROOTGeo::SetQuarterVisible ( )

Set quater visible;.

Definition at line 208 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/EmcROOTGeo.cxx.

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

◆ SetQuarterVisible() [2/2]

void EmcROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetVisEmcDetector()

void EmcROOTGeo::SetVisEmcDetector ( )

Set Emc detector visibility;.

Definition at line 910 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/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_DetectorsArray->GetEntries(); i++) {
916 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_DetectorsArray->At(i);
917 phyNode->SetVisibility(0);
918 if (view && view->GetVisEmcGlobal()) {
919 int part = GetPart(phyNode);
920 if (part == 0 && view->GetVisEmcEast() ||
921 part == 1 && view->GetVisEmcBarrel() ||
922 part == 2 && view->GetVisEmcWest() )
923 phyNode->SetVisibility(1);
924 }
925 }
926}

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

◆ SetVisEmcHits()

void EmcROOTGeo::SetVisEmcHits ( )

Set Emc hits visibility;.

Definition at line 929 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

930{
931 BesView *view = 0;
932 if (gPad) view = dynamic_cast<BesView*>(gPad->GetView());
933
934 for (int i = 0; i < m_HitsArray->GetEntries(); i++) {
935 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_HitsArray->At(i);
936 int part = GetPart(phyNode);
937 if (view && view->GetVisEmcHitsGlobal()) {
938 if (part == 0 && view->GetVisEmcHitsEast() ||
939 part == 1 && view->GetVisEmcHitsBarrel() ||
940 part == 2 && view->GetVisEmcHitsWest() ) {
941 phyNode->SetVisibility(1);
942 phyNode->SetLineColor(881); //Long Peixun's update: Magenta -> Violet
943 continue;
944 }
945 }
946 //Long Peixun's update: Unfired visibility should be determined by Detector option rather than His option
947 //phyNode->SetVisibility(0);
948 if (part == 1) phyNode->SetLineColor(m_brCrystalColor);
949 else phyNode->SetLineColor(m_ecCrystalColor);
950 }
951}

Referenced by BesGeometry::Draw3D().

◆ SetVolumeAppendInVis()

void EmcROOTGeo::SetVolumeAppendInVis ( )

Set default visual attributes;.

Definition at line 265 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

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

Referenced by SetVolumeDefaultVis().

◆ SetVolumeDefaultVis()

void EmcROOTGeo::SetVolumeDefaultVis ( )

Set default visual attributes;.

Definition at line 369 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/src/EmcROOTGeo.cxx.

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

◆ SetVolumeEmc()

void EmcROOTGeo::SetVolumeEmc ( TGeoVolume * vol)
inline

Set Emc volume, while initializing from ROOT;.

Definition at line 103 of file EventDisplay/BesVisLib/BesVisLib-00-06-12/BesVisLib/EmcROOTGeo.h.

103{ m_Emc = vol; }

Referenced by InitFromROOT().


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