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

#include <EmcROOTGeo.h>

+ Inheritance diagram for EmcROOTGeo:

Public Member Functions

 EmcROOTGeo ()
 Constructor.
 
 ~EmcROOTGeo ()
 Destructor.
 
void InitFromGdml (const char *gdmlFile, const char *setupName)
 Initialize the instance of ROOTGeo.
 
void SetNode ()
 Set the pointers to theirs nodes;.
 
void SetDefaultVis ()
 Set default visual attributes;.
 
void SetAllVisible ()
 Set all visible;.
 
void SetQuarterVisible ()
 Set quater visible;.
 
void SetPhysicalNode ()
 Set the pointers to the physical nodes;.
 
int GetPartNb ()
 Get number of part;.
 
int GetThetaNb (int part)
 Get number of theta on part;.
 
int GetPhiNb (int part)
 Get number of phi on part;.
 
TGeoVolume * GetVolumeEmc ()
 Get Emc volume;.
 
TGeoVolume * GetVolumePart (int part)
 Get part volume;.
 
TGeoVolume * GetVolumePhi (int part, int phi)
 Get phi volume;

 
TGeoVolume * GetVolumeTheta (int part, int phi, int theta)
 Get theta volume;.
 
TGeoVolume * GetVolumeCrystal (int part, int phi, int theta)
 Get crystal volume;.
 
TGeoNode * GetPart (int part)
 Get part node;.
 
TGeoNode * GetPhi (int part, int phi)
 Get phi node;.
 
TGeoNode * GetTheta (int part, int phi, int theta)
 Get theta node;.
 
TGeoNode * GetCrystal (int part, int phi, int theta)
 Get crystal one;.
 
TGeoPhysicalNode * GetPhysicalCrystal (int part, int phi, int theta)
 Get crystal physical node;.
 
 EmcROOTGeo ()
 Constructor.
 
 ~EmcROOTGeo ()
 Destructor.
 
void InitFromGDML (const char *gdmlFile, const char *setupName)
 Initialize ROOTGeo from GDML.
 
void InitFromROOT (TGeoVolume *vol)
 Initialize ROOTGeo from TGeoVolume logicalEmc.
 
void Init2DGeometry ()
 Initialize 2D Geometry.
 
void SetNode ()
 Set the pointers to theirs nodes;.
 
void SetVolumeAppendInVis ()
 Set default visual attributes;.
 
void SetVolumeDefaultVis ()
 Set default visual attributes;.
 
void SetAllVisible ()
 Set all visible;.
 
void SetQuarterVisible ()
 Set quater visible;.
 
void SetHalfVisible ()
 Set half visible;.
 
void SetNoEndVisible ()
 Set noend visible;.
 
void SetPhysicalNode ()
 Set the pointers to the physical nodes;.
 
void SetPhysicalDefaultVis ()
 Set default physical node attributes;.
 
void SetDetector ()
 Set Detecor (what is detector depends on you)
 
void SetHits ()
 Set all physicalNodes corresponding to digiCol;.
 
void SetVisEmcDetector ()
 Set Emc detector visibility;.
 
void SetVisEmcHits ()
 Set Emc hits visibility;.
 
int GetPartNb ()
 Get number of part;.
 
int GetThetaNb (int part)
 Get number of theta on part;.
 
int GetPhiNb (int part, int theta)
 Get number of phi on part;.
 
void SetVolumeEmc (TGeoVolume *vol)
 Set Emc volume, while initializing from ROOT;.
 
TGeoVolume * GetVolumeEmc ()
 Get Emc volume;.
 
TGeoVolume * GetVolumePart (int part)
 Get part volume;.
 
TGeoVolume * GetVolumePhi (int part, int phi)
 Get phi volume;

 
TGeoVolume * GetVolumeTheta (int part, int phi, int theta)
 Get theta volume;.
 
TGeoVolume * GetVolumeCrystal (int part, int phi, int theta)
 Get crystal volume;.
 
TGeoNode * GetPart (int part)
 Get part node;.
 
TGeoNode * GetPhi (int part, int phi)
 Get phi node;.
 
TGeoNode * GetTheta (int part, int phi, int theta)
 Get theta node;.
 
TGeoNode * GetTheta2 (int part, int phi, int theta)
 Get theta2 node;.
 
TGeoNode * GetCrystal (int part, int phi, int theta)
 Get crystal one;.
 
TGeoNode * GetCrystal2 (int part, int phi, int theta)
 Get crystal2 one;.
 
TGeoPhysicalNode * GetPhysicalCrystal (int part, int phi, int theta)
 Get crystal physical node; all part,phi,theta has a physicalNode.
 
TGeoPhysicalNode * GetPhysicalCrystal2 (int part, int phi, int theta)
 Get crystal physical node2; EC nb 5,6,14,15,16 in any sector has two physicalNode.
 
bool HasTwoNodes (int part, int phi, int theta)
 Whether this id is combined of two nodes.
 
void ComputeThetaPhi (int id, int sector, int nb, int &CryNumberTheta, int &CryNumberPhi)
 Compute theta, phi from sector, nb.
 
int ComputeEndCopyNb (int num)
 Compute copyNb, copyNb 5,6,14,15,16 corresponding to two volume.
 
Emc2DCrystalGet2DCrystal (Int_t part, Int_t phi, Int_t theta)
 Get Emc2DCrystal;.
 
Int_t GetPart (TGeoPhysicalNode *phyNode)
 Get part no of a crystal physcial node.
 
void Draw (Option_t *option)
 Draw function.
 
void DrawHits (Option_t *option)
 Draw 2D hits.
 
void Align (TGeoPhysicalNode *phyNode, TGeoMatrix *newmat=0, TGeoShape *newshape=0, Bool_t check=kFALSE)
 Align a physical node, change its position and shape.
 
void RestorePhyNode (TGeoPhysicalNode *phyNode, TGeoNode *node)
 Restore the physical node to original shape.
 
- 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-16/ROOTGeo/EmcROOTGeo.h.

Constructor & Destructor Documentation

◆ EmcROOTGeo() [1/2]

EmcROOTGeo::EmcROOTGeo ( )

Constructor.

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

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

◆ ~EmcROOTGeo() [1/2]

EmcROOTGeo::~EmcROOTGeo ( )

Destructor.

Definition at line 53 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

54{ }

◆ 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 1464 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

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

Referenced by RestorePhyNode().

◆ ComputeEndCopyNb()

int EmcROOTGeo::ComputeEndCopyNb ( int  num)

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

Definition at line 1302 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

1303{
1304 int copyNb;
1305 switch (num){
1306 case 30:
1307 copyNb = 5;
1308 break;
1309 case 31:
1310 copyNb = 6;
1311 break;
1312 case 32:
1313 copyNb = 14;
1314 break;
1315 case 33:
1316 copyNb = 15;
1317 break;
1318 case 34:
1319 copyNb = 16;
1320 break;
1321 default:
1322 copyNb = num;
1323 break;
1324 }
1325 return copyNb;
1326}

◆ ComputeThetaPhi()

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

Compute theta, phi from sector, nb.

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

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

◆ Draw()

void EmcROOTGeo::Draw ( Option_t *  option)

Draw function.

Definition at line 1358 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

1359{
1360 TString opt = option;
1361 opt.ToUpper();
1362
1363 if (!m_2DGeoInit) cout << "EmcROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
1364 BesView *view = dynamic_cast<BesView*>(gPad->GetView());
1365 if (!view) cout << "EmcROOTGeo::Draw(), BesView not found" << endl;
1366
1367 if (view->GetVisEmcGlobal()) { // EmcVisGlobal
1368 TString crystalOpt;
1369
1370 //if (opt.Contains("XY")) {
1371 // west part drawn first usually
1372 for (Int_t part = GetPartNb()-1; part >= 0; part--) {
1373 for (int theta = 0; theta < GetThetaNb(part); theta++) {
1374 for (int phi = 0; phi < GetPhiNb(part, theta); phi++) {
1375
1376 if (m_Emc2DCrystal[part][phi][theta]) {
1377 //cout << "part " << part << " layer " << layer << " crystal " << crystal << endl;
1378 m_Emc2DCrystal[part][phi][theta]->SetFired(false);
1379 if ( (part == 0 && view->GetVisEmcEast()) ||
1380 (part == 1 && view->GetVisEmcBarrel()) ||
1381 (part == 2 && view->GetVisEmcWest()) )
1382 m_Emc2DCrystal[part][phi][theta]->Draw(crystalOpt);
1383 }
1384 }
1385 }
1386 }
1387 }
1388}
Bool_t GetVisEmcBarrel()
Definition: BesView.h:136
Bool_t GetVisEmcGlobal()
Definition: BesView.h:134
Bool_t GetVisEmcWest()
Definition: BesView.h:137
Bool_t GetVisEmcEast()
Definition: BesView.h:135
virtual void SetFired(bool status=true)
Definition: Emc2DCrystal.h:31
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 1391 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

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

Referenced by BesEvent::DrawHits().

◆ Get2DCrystal()

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

Get Emc2DCrystal;.

Definition at line 1329 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

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

Referenced by BesEvent::ConstructEmcTrackFromRec().

◆ GetCrystal() [1/2]

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

Get crystal one;.

Definition at line 475 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

476{
477 // in fact, br only 44 crystal nodes;
478 return GetTheta(part, phi, theta)->GetDaughter(0);
479}
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 1152 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

1153{
1154 // in fact, br only 44 crystal nodes;
1155 if (GetTheta2(part, phi, theta) == 0) return 0;
1156 else return GetTheta2(part, phi, theta)->GetDaughter(0);
1157}
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 425 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

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

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

◆ GetPart() [2/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 1336 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

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

327{
328 int part = m_kPart;
329
330 return part;
331}

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 439 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

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

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 343 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

344{
345 int phiNb = m_kPhiBr;
346 if (part != 1) phiNb = m_kPhiEc;
347
348 return phiNb;
349}

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

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

◆ GetPhysicalCrystal() [1/2]

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

Get crystal physical node;.

Definition at line 482 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

483{
484 if (m_PhysicalCrystal[part][phi][theta] != 0) {
485 return m_PhysicalCrystal[part][phi][theta];
486 }
487 else {
488 std::cout << "PhysicalNode: " << "Part" << part << "Phi" << phi << "Theta" << theta << " not found" << std::endl;
489 return 0;
490 }
491}

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

1173{
1174 return m_PhysicalCrystal2[part][phi][theta];
1175}

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 463 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

464{
465 if (m_NodeTheta[part][phi][theta] != 0) {
466 return m_NodeTheta[part][phi][theta];
467 }
468 else {
469 std::cout << "Node: " << "Part" << part << "Phi" << phi << "Theta" << theta << " not found" << std::endl;
470 return 0;
471 }
472}

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

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

Referenced by GetCrystal2(), and SetVolumeDefaultVis().

◆ GetThetaNb() [1/2]

int EmcROOTGeo::GetThetaNb ( int  part)

Get number of theta on part;.

Definition at line 334 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

335{
336 int thetaNb = m_kThetaBr;
337 if (part != 1) thetaNb = m_kThetaEc;
338
339 return thetaNb;;
340}

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 404 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

405{
406 // part0phi0theta0-34, part0phi6theta0-34, part0phi8theta0-34, part0phi7theta0-34
407 // part1theta0-43
408 std::stringstream osname;
409 if (part == 1 && theta >= 0 && theta < 44) {
410 osname << "logical" << "Emc" << "Part" << part << "Theta" << theta << "Crystal";
411 return GetLogicalVolume( osname.str() );
412 }
413 else if ( part == 0 && theta >= 0 && theta < 35 &&
414 (phi == 0 || phi == 6 || phi == 8 || phi == 7) ) {
415 osname << "logical" << "Emc" << "Part" << part << "Phi" << phi << "Theta" << theta << "Crystal";
416 return GetLogicalVolume( osname.str() );
417 }
418 else {
419 std::cout << "No volume " << osname.str() << std::endl;
420 return 0;
421 }
422}
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-16/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 103 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/BesVisLib/EmcROOTGeo.h.

103{ return m_Emc; }

◆ GetVolumePart() [1/2]

TGeoVolume * EmcROOTGeo::GetVolumePart ( int  part)

Get part volume;.

Definition at line 352 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

353{
354 // only part0 and part1 logical volume.
355 std::stringstream osname;
356 osname << "logical" << "Emc" << "Part" << part;
357 if (part == 0 || part == 1) {
358 return GetLogicalVolume( osname.str() );
359 }
360 else {
361 std::cout << "No volume " << osname.str() << std::endl;
362 return 0;
363 }
364}

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 367 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

368{
369 // only part0phi0-15, part1phi0-119
370 std::stringstream osname;
371 osname << "logical" << "Emc" << "Part" << part << "Phi" << phi;
372 if ( (part == 0 && phi >= 0 && phi < 16) ||
373 (part == 1 && phi >= 0 && phi < 120) ) {
374 return GetLogicalVolume( osname.str() );
375 }
376 else {
377 std::cout << "No volume " << osname.str() << std::endl;
378 return 0;
379 }
380}

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 383 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

384{
385 // part0phi0theta0-34, part0phi6theta0-34, part0phi8theta0-34, part0phi7theta0-34
386 // part1theta0-43
387 std::stringstream osname;
388 if (part == 1 && theta >= 0 && theta < 44) {
389 osname << "logical" << "Emc" << "Part" << part << "Theta" << theta;
390 return GetLogicalVolume( osname.str() );
391 }
392 else if ( part == 0 && theta >= 0 && theta < 35 &&
393 (phi == 0 || phi == 6 || phi == 8 || phi == 7) ) {
394 osname << "logical" << "Emc" << "Part" << part << "Phi" << phi << "Theta" << theta;
395 return GetLogicalVolume( osname.str() );
396 }
397 else {
398 std::cout << "No volume " << osname.str() << std::endl;
399 return 0;
400 }
401}

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

1179{
1180 if (part == 1) return false;
1181 else return true;
1182}

◆ Init2DGeometry()

void EmcROOTGeo::Init2DGeometry ( )

Initialize 2D Geometry.

Definition at line 105 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

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

Referenced by BesGeometry::InitGeometry().

◆ InitFromGdml()

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

Initialize the instance of ROOTGeo.

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

58{
59 ReadGdml(gdmlFile, setupName);
60 SetNode();
61 //SetDefaultVis();
62
63 m_ROOTGeoInit = 1;
64}
void SetNode()
Set the pointers to theirs nodes;.
void ReadGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of ROOTGeo.

Referenced by EmcROOTGeo().

◆ InitFromGDML()

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

Initialize ROOTGeo from GDML.

Definition at line 87 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

88{
89 m_ROOTGeoInit = 2;
90
91 ReadGdml(gdmlFile, setupName);
92 SetNode();
93}

Referenced by BesGeometry::InitFromGDML().

◆ InitFromROOT()

void EmcROOTGeo::InitFromROOT ( TGeoVolume *  vol)

Initialize ROOTGeo from TGeoVolume logicalEmc.

Definition at line 96 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

97{
98 m_ROOTGeoInit = 1;
99
100 SetVolumeEmc(vol);
101 SetNode();
102}
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 1548 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

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

Referenced by SetHits().

◆ SetAllVisible() [1/2]

void EmcROOTGeo::SetAllVisible ( )

Set all visible;.

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

174{
175 /* for (int part = 0; part < m_kPart-1; part++) {
176 int nPhi = (part == 1 ? m_kPhiBr : m_kPhiEc);
177 for (int phi = 0; phi < nPhi; phi++) {
178 GetVolumePhi(part, phi)->SetVisibility(1);
179 }
180 if (part == 1) {
181 for (int theta = 0; theta < m_kThetaBr; theta++) {
182 GetVolumeTheta(part, 0, theta)->SetVisibility(1);
183 GetVolumeCrystal(part, 0, theta)->SetVisibility(0);
184 }
185 }
186 else if (part == 0) {
187 int iPhi[4] = {0,6,8,7};
188 for (int i = 0; i < 4; i++) {
189 int phi = iPhi[i];
190 int nTheta = (part == 1 ? m_kThetaBr : m_kThetaEc);
191 for (int theta = 0; theta < nTheta; theta++) {
192 GetVolumeTheta(part, phi, theta)->SetVisibility(1);
193 GetVolumeCrystal(part, phi, theta)->SetVisibility(0);
194 }
195 }
196 }
197 }
198 */
199
200 for (int part = 0; part < m_kPart; part++) {
201 GetPart(part)->SetVisibility(0);
202 int nPhi = (part == 1 ? m_kPhiBr : m_kPhiEc);
203 for (int phi = 0; phi < nPhi; phi++) {
204 GetPhi(part, phi)->SetVisibility(0);
205 int nTheta = (part == 1 ? m_kThetaBr : m_kThetaEc);
206 for (int theta = 0; theta < nTheta; theta++) {
207 GetTheta(part, phi, theta)->SetVisibility(0);
208 GetCrystal(part, phi, theta)->SetVisibility(1);
209 }
210 }
211 }
212}
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 114 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

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

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

Referenced by BesClient::HandleViewOptionMenu().

◆ SetHalfVisible()

void EmcROOTGeo::SetHalfVisible ( )

Set half visible;.

Definition at line 563 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

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

◆ SetHits()

void EmcROOTGeo::SetHits ( )

Set all physicalNodes corresponding to digiCol;.

Definition at line 791 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

792{
793 // set previous event hits to default vis
794 //cout << "m_HitsArray->GetEntries(): " << m_HitsArray->GetEntries() << endl;
795 //cout << "m_PhyNodeOrgArray->GetEntries(): " << m_PhyNodeOrgArray->GetEntries() << endl;
796 //cout << "m_2DHitsArray->GetEntries(): " << m_2DHitsArray->GetEntries() << endl;
797 for (int i = 0; i < m_HitsArray->GetEntries(); i++) {
798 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_HitsArray->At(i);
799 //cout << phyNode->GetName() << endl;
800 int color = m_brCrystalColor;
801 int part = GetPart(phyNode);
802 if (part == 0 || part == 2)
803 color = m_ecCrystalColor;
804
805 phyNode->SetLineColor(color);
806 phyNode->SetVisibility(0);
807
808 RestorePhyNode(phyNode, (TGeoNode*)m_PhyNodeOrgArray->At(i));
809 }
810 m_PhyNodeOrgArray->Clear("C");
811 m_HitsArray->Clear("C");
812
813 // set previous event 2D hits info to default
814 for (int i = 0; i < m_2DHitsArray->GetEntries(); i++) {
815 Emc2DCrystal *aCrystal = (Emc2DCrystal*)m_2DHitsArray->At(i);
816 aCrystal->ClearInfo();
817 aCrystal->AddInfo(aCrystal->GetTitle());
818 aCrystal->CloseInfo();
819 }
820 m_2DHitsArray->Clear("C");
821
822 // set new hits
823 //Long Peixun's update: Consider gEvent == NULL
824 int NDigiCol = 0;
825 if (gEvent)
826 {
827 m_EmcDigiCol = gEvent->GetEmcDigiCol();
828 //Long Peixun's update: Consider m_EmcDigiCol == NULL
829 if (m_EmcDigiCol) NDigiCol = m_EmcDigiCol->GetEntries();
830 else NDigiCol = 0;
831 }
832
833 for (int i = 0; i < NDigiCol; i++) {
834 TEmcDigi *aEmcDigi = (TEmcDigi*)m_EmcDigiCol->At(i);
835 Identifier aEmcID( aEmcDigi->getIntId() );
836 int part = EmcID::barrel_ec( aEmcID );
837 int theta = EmcID::theta_module( aEmcID );
838 int phi = EmcID::phi_module( aEmcID );
839
840 Double_t charge = RawDataUtil::EmcCharge(aEmcDigi->getMeasure(),
841 aEmcDigi->getChargeChannel());
842 Double_t time = RawDataUtil::EmcTime(aEmcDigi->getTimeChannel());
843
844 TGeoPhysicalNode *phyNode = 0;
845 phyNode = GetPhysicalCrystal( part, phi, theta );
846 if (phyNode) {
847 m_PhyNodeOrgArray->Add ( phyNode->GetNode() );
848
849 //Double_t *P; // = new Double_t[16];
850 //TGeoArb8 *oldArb8 = (TGeoArb8*)phyNode->GetShape();
851 //P = oldArb8->GetVertices();
852 //TGeoArb8 *newArb8 = new TGeoArb8(charge, &P[0]);
853
854 //TGeoTranslation *newmat =
855 // new TGeoTranslation(0.0, 0.0, oldArb8->GetDz()+newArb8->GetDz());
856 //newmat->RegisterYourself();
857
858 //Align(phyNode, newmat, newArb8);
859
860 m_HitsArray->Add(phyNode); //Long Peiuxn's update: Remove annotation
861 ////delete newArb8;
862 ////delete newmat;
863 }
864
865 phyNode = GetPhysicalCrystal2( part, phi, theta );
866 if (phyNode) {
867 m_PhyNodeOrgArray->Add ( phyNode->GetNode() );
868
869 //Double_t *P; // = new Double_t[16];
870 //TGeoArb8 *oldArb8 = (TGeoArb8*)phyNode->GetShape();
871 //P = oldArb8->GetVertices();
872 //TGeoArb8 *newArb8 = new TGeoArb8(charge, &P[0]);
873
874 //TGeoTranslation *newmat =
875 // new TGeoTranslation(0.0, 0.0, oldArb8->GetDz()+newArb8->GetDz());
876 //newmat->RegisterYourself();
877
878 //Align(phyNode, newmat, newArb8);
879
880 //m_HitsArray->Add( phyNode );
881 ////delete newArb8;
882 ////delete newmat;
883 }
884
885 Emc2DCrystal *aCrystal = 0;
886 aCrystal = m_Emc2DCrystal[part][phi][theta];
887 if (aCrystal) {
888 aCrystal->SetTime(time); //Long Peixun's update: Set Emc crystals' time and charge
889 aCrystal->SetCharge(charge);
890
891 aCrystal->ClearInfo();
892 aCrystal->AddInfo(aCrystal->GetTitle());
893
894 char data[100];
895 sprintf(data, "time = %-.3f ns, charge = %-.3f MeV", time, charge);
896 aCrystal->AddInfo( TString(data) );
897 sprintf(data, "Fired");
898 aCrystal->AddInfo( TString(data) );
899
900 aCrystal->CloseInfo();
901
902 m_2DHitsArray->Add(aCrystal);
903 }
904 }
905}
R__EXTERN BesEvent * gEvent
Definition: BesEvent.h:279
Double_t time
const TObjArray * GetEmcDigiCol() const
Definition: BesEvent.h:78
virtual void CloseInfo()
virtual void SetTime(Double_t time)
Definition: Emc2DCrystal.h:39
virtual void AddInfo(TString info)
Definition: Emc2DCrystal.h:35
virtual void ClearInfo()
virtual void SetCharge(Double_t charge)
Definition: Emc2DCrystal.h:40
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
void RestorePhyNode(TGeoPhysicalNode *phyNode, TGeoNode *node)
Restore the physical node to original shape.
static double EmcTime(int timeChannel)
Definition: RawDataUtil.h:14
static double EmcCharge(int measure, int chargeChannel)
Definition: RawDataUtil.h:17
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
float charge

Referenced by BesEvent::SetHits().

◆ SetNode() [1/2]

void EmcROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

Definition at line 67 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

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

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

603{
604 /*
605 for (int theta = 0; theta < GetThetaNb(1); theta++) {
606 for (int phi = 0; phi < GetPhiNb(1); phi++) {
607 GetPhysicalCrystal(1, phi, theta)->SetVisibility(1);
608 }
609 }
610 */
611}

◆ SetPhysicalDefaultVis()

void EmcROOTGeo::SetPhysicalDefaultVis ( )

Set default physical node attributes;.

Definition at line 688 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

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

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

◆ SetPhysicalNode() [1/2]

void EmcROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

Definition at line 262 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

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

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 215 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-16/src/EmcROOTGeo.cxx.

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

◆ SetQuarterVisible() [2/2]

void EmcROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetVisEmcDetector()

void EmcROOTGeo::SetVisEmcDetector ( )

Set Emc detector visibility;.

Definition at line 908 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

909{
910 BesView *view = 0;
911 if (gPad) view = dynamic_cast<BesView*>(gPad->GetView());
912
913 for (int i = 0; i < m_DetectorsArray->GetEntries(); i++) {
914 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_DetectorsArray->At(i);
915 phyNode->SetVisibility(0);
916 if (view && view->GetVisEmcGlobal()) {
917 int part = GetPart(phyNode);
918 if (part == 0 && view->GetVisEmcEast() ||
919 part == 1 && view->GetVisEmcBarrel() ||
920 part == 2 && view->GetVisEmcWest() )
921 phyNode->SetVisibility(1);
922 }
923 }
924}

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

◆ SetVisEmcHits()

void EmcROOTGeo::SetVisEmcHits ( )

Set Emc hits visibility;.

Definition at line 927 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

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

Referenced by BesGeometry::Draw3D().

◆ SetVolumeAppendInVis()

void EmcROOTGeo::SetVolumeAppendInVis ( )

Set default visual attributes;.

Definition at line 268 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

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

Referenced by SetVolumeDefaultVis().

◆ SetVolumeDefaultVis()

void EmcROOTGeo::SetVolumeDefaultVis ( )

Set default visual attributes;.

Definition at line 374 of file EventDisplay/BesVisLib/BesVisLib-00-06-02/src/EmcROOTGeo.cxx.

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

100{ m_Emc = vol; }

Referenced by InitFromROOT().


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