20#include <TGeoManager.h>
40 for (
int part = 0; part < m_kPart; part++)
43 for (
int layer = 0; layer < m_kModuleEc; layer++)
45 m_NodeAl[part][layer] = 0;
46 m_NodeScin[part][layer] = 0;
47 for (
int scin = 0; scin < m_kScinBr; scin++)
49 m_NodePVF[part][layer][scin] = 0;
50 m_PhysicalScin[part][layer][scin] = 0;
51 m_Tof2DScin[part][layer][scin] = 0;
74 m_ScinColor = kYellow;
80 cout <<
"delete old TofROOTGeo" << endl;
81 for (
int part = 0; part < m_kPart; part++)
83 for (
int layer = 0; layer < m_kModuleEc; layer++)
85 for (
int scin = 0; scin < m_kScinBr; scin++)
87 delete m_Tof2DScin[part][layer][scin];
100 if (TString(gdmlFile).Contains(
"Tof_mrpc.gdml")) fTofMrpc = 1;
101 else cout <<
"Cannot read Tof_mrpc!" << endl;
102 if (fTofMrpc) cout <<
"fTofMrpc: " <<
"Using new Geometry of Tof!" << endl;
115 TGeoNode *contianer = vol->GetNode(0)->GetVolume()->GetNode(0);
116 if (TString(contianer->GetName()).Contains(
"container")) fTofMrpc = 1;
117 if (fTofMrpc) cout <<
"fTofMrpc: " <<
"Using new Geometry of Tof!" << endl;
128 cout <<
"TofROOTGeo::Init2DGeometry, ROOT Geometry not Initialized yet!" << endl;
133 Double_t local[3] = {0.0, 0.0, 0.0};
134 Double_t master[3] = {0.0, 0.0, 0.0};
143 for (Int_t part = 0; part < m_kPart; part++)
147 for (Int_t layer = 0; layer <
GetLayerNb(part); layer++)
149 for (
int scin = 0; scin <
GetScinNb(part); scin++)
154 name = TString(
"Tof Part 1");
160 TGeoArb8 *scinShape = (TGeoArb8*)scinPhyNode->GetShape();
161 Double_t *localArb8Point, masterArb8Point[24];
162 localArb8Point = scinShape->GetVertices();
164 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] = scinShape->GetDz() * (-1.0);
169 else local[2] = scinShape->GetDz();
172 scinPhyNode->GetMatrix(-1*scinPhyNode->GetLevel())->LocalToMaster(local, &master[0]);
175 for (Int_t j = 0; j < 3; j++) {
176 masterArb8Point[3*i+j] = master[j];
180 m_Tof2DScin[part][layer][scin] =
new Tof2DScin(name, name, 8, &masterArb8Point[0], part);
186 for (
int module = 0; module <
GetModuleNb(part); module++)
188 for (
int strip = 0; strip <
GetStripNb(part); strip++)
193 name = TString(
"EastEc");
194 name = TString(
"Tof Part");
203 name = TString(
"WestEc");
204 name = TString(
"Tof Part");
212 TGeoTrd2 *mrpcShape = (TGeoTrd2*)mrpcPhyNode->GetShape();
214 Double_t x1, x2, y1, y2, z;
215 x1 = mrpcShape->GetDx1();
216 x2 = mrpcShape->GetDx2();
217 y1 = mrpcShape->GetDy1() * 500;
218 y2 = mrpcShape->GetDy2() * 500;
219 z = mrpcShape->GetDz();
220 Double_t masterArb8Point[24];
222 for (Int_t i =0; i < 8; i++)
224 if (i == 0) { local[0] = -x1; local[1] = -y1; local[2] = -z; }
225 else if (i == 4) { local[0] = -x1; local[1] = y1; local[2] = -z; }
226 else if (i == 7) { local[0] = x1; local[1] = y1; local[2] = -z; }
227 else if (i == 3) { local[0] = x1; local[1] = -y1; local[2] = -z; }
228 else if (i == 1) { local[0] = -x2; local[1] = -y2; local[2] = z; }
229 else if (i == 5) { local[0] = -x2; local[1] = y2; local[2] = z; }
230 else if (i == 6) { local[0] = x2; local[1] = y2; local[2] = z; }
231 else if (i == 2) { local[0] = x2; local[1] = -y2; local[2] = z; }
233 mrpcPhyNode->GetMatrix(-1*mrpcPhyNode->GetLevel())->LocalToMaster(local, &master[0]);
234 for (Int_t j = 0; j < 3; j++) {
235 masterArb8Point[3*i+j] = master[j];
239 m_Tof2DScin[part][module][strip] =
new Tof2DScin(name, name, 8, &masterArb8Point[0], part);
248 for (Int_t part = 0; part < m_kPart; part++)
250 for (Int_t layer = 0; layer <
GetLayerNb(part); layer++)
252 for (
int scin = 0; scin <
GetScinNb(part); scin++)
257 name = TString(
"Tof Part 1");
265 if (part == 0) name = TString(
"EastEc");
266 else if (part == 2) name = TString(
"WestEc");
267 name = TString(
"Tof Part ");
272 TGeoArb8 *scinShape = (TGeoArb8*)scinPhyNode->GetShape();
273 Double_t *localArb8Point, masterArb8Point[24];
274 localArb8Point = scinShape->GetVertices();
276 for (Int_t i = 0; i < 8; i++)
278 local[0] = localArb8Point[2*i];
279 local[1] = localArb8Point[2*i+1];
280 if (i < 4) local[2] = scinShape->GetDz() * (-1.0);
281 else local[2] = scinShape->GetDz();
284 scinPhyNode->GetMatrix(-1*scinPhyNode->GetLevel())->LocalToMaster(local, &master[0]);
287 for (Int_t j = 0; j < 3; j++) {
288 masterArb8Point[3*i+j] = master[j];
292 m_Tof2DScin[part][layer][scin] =
new Tof2DScin(name, name, 8, &masterArb8Point[0], part);
305 if (!m_Tof) std::cout <<
"m_Tof = 0" << std::endl;
309 for (
int part = 0; part < m_kPart; part++)
311 if ( part != 1 )
continue;
312 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
314 std::stringstream osnameAl;
315 if (part == 1) osnameAl <<
"pv_" <<
"logical" <<
"AlBr" << layer+1 <<
"_0";
316 m_NodeAl[part][layer] =
GetNode( osnameAl.str() );
317 if (!m_NodeAl[part][layer]) cout <<
"empty pointer: m_NodeAl" << endl;
319 std::stringstream osnameScin;
320 if (part == 1) osnameScin <<
"pv_" <<
"logical" <<
"ScinBr" << layer+1 <<
"_0";
321 m_NodeScin[part][layer] =
GetNode( osnameScin.str() );
322 if (!m_NodeScin[part][layer]) cout <<
"empty pointer: m_NodeScin" << endl;
324 for (
int scin = 0; scin <
GetScinNb(part); scin++)
326 std::stringstream osnamePVF;
328 osnamePVF <<
"pv_" <<
"logicalPVFBr"<< layer+1 <<
"_" << (2*m_kScinBr*3 - 1) - (layer*m_kScinBr + scin)*3;
330 m_NodePVF[part][layer][scin] =
GetNode( osnamePVF.str() );
331 if (!m_NodePVF[part][layer][scin]) cout <<
"empty pointer: m_NodePVF" << endl;
336 for (
int part = 0; part < m_kPart; part++)
338 if (part == 1)
continue;
339 for (
int module = 0; module <
GetModuleNb(part); module++)
341 std::stringstream osnameModule;
342 std::stringstream osnamegasContainer;
343 std::stringstream osnamebareChamber;
344 std::stringstream osnamepcbBoard1;
346 osnamebareChamber <<
"pv_" <<
"logical_" <<
"bareChamber" <<
"_" <<
GetChamberNodeNb(module);
347 m_NodebareChamber[part][module] =
GetNode( osnamebareChamber.str() );
348 if (!m_NodebareChamber) cout <<
"empty pointer: m_NodebareChamber" << endl;
350 osnamepcbBoard1 <<
"pv_" <<
"logical_" <<
"pcbBoard1" <<
"_" <<
GetBoard1NodeNb(module);
351 m_NodepcbBoard1[part][module] =
GetNode ( osnamepcbBoard1.str() );
352 if (!m_NodepcbBoard1) cout <<
"empty pointer: m_NodepcbBoard1" << endl;
356 if (!TMath::Odd(module))
358 osnameModule <<
"pv_"<<
"logical_" <<
"container_m0" <<
"_" << module;
359 osnamegasContainer <<
"pv_" <<
"logical_" <<
"gasContainer_m0" <<
"_" <<
GetContainerNodeNb(module);
362 osnameModule <<
"pv_" <<
"logical_" <<
"container_m3" <<
"_" << module;
363 osnamegasContainer <<
"pv_" <<
"logical_" <<
"gasContainer_m3" <<
"_" <<
GetContainerNodeNb(module);
369 if (!TMath::Odd(module))
371 osnameModule <<
"pv_" <<
"logical_" <<
"container_m1" <<
"_" << module;
372 osnamegasContainer <<
"pv_" <<
"logical_" <<
"gasContainer_m1" <<
"_" <<
GetContainerNodeNb(module);
376 osnameModule <<
"pv_" <<
"logical_" <<
"container_m2" <<
"_" << module;
377 osnamegasContainer <<
"pv_" <<
"logical_" <<
"gasContainer_m2" <<
"_" <<
GetContainerNodeNb(module);
381 m_NodeModule[part][module] =
GetNode( osnameModule.str() );
382 if (!m_NodeModule[part][module]) cout<<
"empty pointer: m_NodeModule "<<endl;
383 m_NodegasContainer[part][module] =
GetNode( osnamegasContainer.str() );
384 if (!m_NodegasContainer[part][module]) cout<<
"empty pointer: m_NodegasContainer "<<endl;
386 for (
int strip = 0; strip <
GetStripNb(module); strip++)
388 std::stringstream osnameStrip;
389 osnameStrip <<
"pv_" <<
"logical_" <<
"strip_" << (
GetStripNb(module) - 1) - strip <<
"_" << strip;
390 m_NodeStrip[part][module][strip] =
GetNode( osnameStrip.str() );
391 if (!m_NodeStrip[part][module][strip]) cout<<
"empty pointer: m_NodeStrip "<<endl;
398 for (
int part = 0; part < m_kPart; part++)
400 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
402 std::stringstream osnameAl;
403 if (part == 1) osnameAl <<
"pv_" <<
"logical" <<
"AlBr" << layer+1 <<
"_0";
404 else if (part == 0) osnameAl <<
"pv_" <<
"logical" <<
"AlEcEast" <<
"_0";
405 else osnameAl <<
"pv_" <<
"logical" <<
"AlEcWest" <<
"_0";
406 m_NodeAl[part][layer] =
GetNode( osnameAl.str() );
408 std::stringstream osnameScin;
409 if (part == 1) osnameScin <<
"pv_" <<
"logical" <<
"ScinBr" << layer+1 <<
"_0";
410 else if (part == 0) osnameScin <<
"pv_" <<
"logical" <<
"ScinEcEast" <<
"_0";
411 else osnameScin <<
"pv_" <<
"logical" <<
"ScinEcWest" <<
"_0";
412 m_NodeScin[part][layer] =
GetNode( osnameScin.str() );
414 for (
int scin = 0; scin <
GetScinNb(part); scin++)
416 std::stringstream osnamePVF;
418 osnamePVF <<
"pv_" <<
"logicalPVFBr"<< layer+1 <<
"_" << (2*m_kScinBr*3 - 1) - (layer*m_kScinBr + scin)*3;
420 else if (part == 2) {
421 osnamePVF <<
"pv_" <<
"logicalPVFEcWest" <<
"_" << (2*m_kScinEc - 1) - scin*2;
423 else if (part == 0) {
424 osnamePVF <<
"pv_" <<
"logicalPVFEcEast" <<
"_" << (2*m_kScinEc - 1) - scin*2;
426 m_NodePVF[part][layer][scin] =
GetNode( osnamePVF.str() );
437 for (
int part = 0; part < m_kPart; part++)
440 if (part == 1) ipart = 2;
441 else if (part == 2) ipart = 1;
442 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
444 for (
int scin = 0; scin <
GetScinNb(part); scin++)
449 iNode = (2*m_kScinBr*3 - 1) - (layer*m_kScinBr + scin)*3;
450 m_NodePVF[part][layer][scin] = m_Tof->GetNode( ipart )->GetVolume()->GetNode(iNode);
451 m_NodeAl[part][layer] = m_NodePVF[part][layer][0]->GetVolume()->GetNode(0);
452 m_NodeScin[part][layer] = m_NodeAl[part][layer]->GetVolume()->GetNode(0);
456 m_NodeModule[part][layer] = m_Tof->GetNode(ipart)->GetVolume()->GetNode(layer);
457 m_NodegasContainer[part][layer] = m_NodeModule[part][layer]->GetVolume()->GetNode(0);
458 m_NodebareChamber[part][layer] = m_NodegasContainer[part][layer]->GetVolume()->GetNode(6);
459 m_NodepcbBoard1[part][layer] = m_NodebareChamber[part][layer]->GetVolume()->GetNode(30);
460 m_NodeStrip[part][layer][scin] = m_NodepcbBoard1[part][layer]->GetVolume()->GetNode(scin);
468 for (
int part = 0; part < m_kPart; part++)
471 if (part == 1) ipart = 2;
472 if (part == 2) ipart = 1;
473 for (
int layer = 0; layer <
GetLayerNb(part); layer++) {
474 for (
int scin = 0; scin <
GetScinNb(part); scin++) {
486 iNode = (2*m_kScinEc - 1) - scin*2;
489 iNode = (2*m_kScinBr*3 - 1) - (layer*m_kScinBr + scin)*3;
491 m_NodePVF[part][layer][scin] = m_Tof->GetNode( ipart )->GetVolume()->GetNode(iNode);
493 m_NodeAl[part][layer] = m_NodePVF[part][layer][0]->GetVolume()->GetNode(0);
495 m_NodeScin[part][layer] = m_NodeAl[part][layer]->GetVolume()->GetNode(0);
510 m_Tof->SetLineColor(m_TofColor);
511 m_Tof->SetVisibility(0);
513 for (
int part = 0; part < m_kPart; part++) {
516 for (
int layer = 0; layer <
GetLayerNb(part); layer++) {
520 GetVolumeAl(part, layer)->SetLineColor(m_ScinColor);
538 for (
int part = 0; part < m_kPart; part++)
542 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
544 for (
int scin = 0; scin <
GetScinNb(part); scin++)
550 for (
int module = 0; module <
GetModuleNb(part); module++)
552 for (
int strip = 0; strip <
GetStripNb(module); strip++)
560 for (
int part = 0; part < m_kPart; part++)
562 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
564 for (
int scin = 0; scin <
GetScinNb(part); scin++)
584 m_Tof->SetLineColor(m_TofColor);
585 m_Tof->SetVisibility(0);
587 for (
int part = 0; part < m_kPart; part++) {
588 for (
int layer = 0; layer <
GetLayerNb(part); layer++) {
592 GetVolumeAl(part, layer)->SetLineColor(m_ScinColor);
685 if (gGeoManager == 0) std::cout <<
"Create gGeoManager first" << std::endl;
686 TGeoNode *
bes = gGeoManager->GetTopNode();
689 TGeoNode *nodeTof =
bes->GetDaughter(1);
690 for (
int part = 0; part < m_kPart; part++)
700 if (part == 1) ipart = 2;
701 if (part == 2) ipart = 1;
703 nodePart = nodeTof->GetVolume()->GetNode(ipart);
709 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
711 TGeoNode *nodeAl =
GetAl(part, layer);
712 TGeoNode *nodeScin =
GetScin(part, layer);
713 for (
int scin = 0; scin <
GetScinNb(part); scin++)
715 TGeoNode *nodePVF =
GetPVF(part, layer, scin);
716 m_PhysicalScin[part][layer][scin] = gGeoManager->MakePhysicalNode( TString(
"/") +
bes->GetName() +
717 TString(
"/") + nodeTof->GetName() +
718 TString(
"/") + nodePart->GetName() +
719 TString(
"/") + nodePVF->GetName() +
720 TString(
"/") + nodeAl->GetName() +
721 TString(
"/") + nodeScin->GetName() );
722 if(!m_PhysicalScin[part][layer][scin]) cout <<
"empty pointer: m_PhysicalScin" << endl;
723 m_PhysicalScin[part][layer][scin]->SetVisibility(0);
724 m_PhysicalScin[part][layer][scin]->SetIsVolAtt(kFALSE);
725 m_PhysicalScin[part][layer][scin]->SetLineColor(m_ScinColor);
731 for (
int module = 0; module <
GetModuleNb(part); module++)
733 TGeoNode *nodeModule =
GetModule(part,module);
737 for (
int strip = 0; strip <
GetStripNb(module); strip++)
739 TGeoNode *nodeStrip =
GetStrip(part,module,strip);
740 m_PhysicalScin[part][module][strip] = gGeoManager->MakePhysicalNode( TString(
"/") +
bes->GetName() +
741 TString(
"/") + nodeTof->GetName() +
742 TString(
"/") + nodePart->GetName() +
743 TString(
"/") + nodeModule->GetName() +
744 TString(
"/") + nodegasContainer->GetName() +
745 TString(
"/") + nodebareChamber->GetName() +
746 TString(
"/") + nodepcbBoard1->GetName() +
747 TString(
"/") + nodeStrip->GetName() );
748 if(!m_PhysicalScin[part][module][strip]) cout <<
"empty pointer: m_PhysicalScin" << endl;
749 m_PhysicalScin[part][module][strip]= m_PhysicalScin[part][module][strip];
751 m_PhysicalScin[part][module][strip]->SetVisibility(0);
752 m_PhysicalScin[part][module][strip]->SetIsVolAtt(kFALSE);
753 m_PhysicalScin[part][module][strip]->SetLineColor(m_ScinColor);
760 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
762 TGeoNode *nodeAl =
GetAl(part, layer);
763 TGeoNode *nodeScin =
GetScin(part, layer);
764 for (
int scin = 0; scin <
GetScinNb(part); scin++)
766 TGeoNode *nodePVF =
GetPVF(part, layer, scin);
767 m_PhysicalScin[part][layer][scin] = gGeoManager->MakePhysicalNode( TString(
"/") +
bes->GetName() +
768 TString(
"/") + nodeTof->GetName() +
769 TString(
"/") + nodePart->GetName() +
770 TString(
"/") + nodePVF->GetName() +
771 TString(
"/") + nodeAl->GetName() +
772 TString(
"/") + nodeScin->GetName() );
775 m_PhysicalScin[part][layer][scin]->SetVisibility(0);
776 m_PhysicalScin[part][layer][scin]->SetIsVolAtt(kFALSE);
777 m_PhysicalScin[part][layer][scin]->SetLineColor(m_ScinColor);
790 if (gPad) view =
dynamic_cast<BesView*
>(gPad->GetView());
797 for (
int part = 0; part < m_kPart; part++)
801 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
803 for (
int scin = 0; scin <
GetScinNb(part); scin++)
805 TGeoPhysicalNode *phyNode = 0;
809 phyNode->SetVisibility(0);
817 for (
int module = 0; module <
GetModuleNb(part); module++)
819 for (
int strip = 0; strip <
GetStripNb(module); strip++)
821 TGeoPhysicalNode *phyNode = 0;
825 phyNode->SetVisibility(0);
835 for (
int part = 0; part < m_kPart; part++)
837 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
839 for (
int scin = 0; scin <
GetScinNb(part); scin++)
841 TGeoPhysicalNode *phyNode = 0;
845 phyNode->SetVisibility(0);
865 for (
int i = 0; i <
m_HitsArray->GetEntries(); i++)
867 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)
m_HitsArray->At(i);
871 phyNode->SetVisibility(0);
881 aScin->
AddInfo(aScin->GetTitle());
893 if (m_TofDigiCol) NDigiCol = m_TofDigiCol->GetEntries();
897 for (
int i = 0; i < NDigiCol; i++)
901 int part, layer, scin;
915 if (part_Ec == 0) part = 0;
941 TGeoPhysicalNode *phyNode = 0;
948 aScin = m_Tof2DScin[part][layer][scin];
960 aScin->
AddInfo(aScin->GetTitle());
979 aScin->
AddInfo(aScin->GetTitle());
997 aScin->
AddInfo(aScin->GetTitle());
1035 if (gPad) view =
dynamic_cast<BesView*
>(gPad->GetView());
1041 phyNode->SetVisibility(0);
1048 phyNode->SetVisibility(1);
1057 if (gPad) view =
dynamic_cast<BesView*
>(gPad->GetView());
1059 for (
int i = 0; i <
m_HitsArray->GetEntries(); i++)
1061 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)
m_HitsArray->At(i);
1071 phyNode->SetVisibility(1);
1072 phyNode->SetLineColor(801);
1078 if (part > -1) phyNode->SetLineColor(m_ScinColor);
1094 if (part == 1)
return m_kScinBr;
1097 if (fTofMrpc)
return m_kStripEc;
1107 if (part == 1)
return m_kLayerBr;
1110 if (fTofMrpc)
return m_kModuleEc;
1123 return m_kChamberNodeNb;
1127 return m_kContainerNodeNb;
1131 return m_kBoard1NodeNb;
1159 std::stringstream osname;
1161 osname <<
"logicalBrTof";
1163 else if (part == 0){
1164 osname <<
"logicalEcTofWest";
1167 osname <<
"logicalEcTofEast";
1175 std::stringstream osname;
1177 osname <<
"logical" <<
"PVFEcEast";
1179 else if (part == 2){
1180 osname <<
"logical" <<
"PVFEcWest";
1184 osname <<
"logical" <<
"PVFBr" << layer+1;
1193 std::stringstream osname;
1195 osname <<
"logical" <<
"AlEcEast";
1197 else if (part == 2){
1198 osname <<
"logical" <<
"AlEcWest";
1202 osname <<
"logical" <<
"AlBr" << layer+1;
1211 std::stringstream osname;
1213 osname <<
"logical" <<
"ScinEcEast";
1215 else if (part == 2){
1216 osname <<
"logical" <<
"ScinEcWest";
1220 osname <<
"logical" <<
"ScinBr" << layer+1;
1229 std::stringstream osname;
1230 if (part == 0 || part == 2) {
1231 osname <<
"logical" <<
"BucketEc";
1235 osname <<
"logical" <<
"BucketBr" << layer+1;
1244 if (m_NodePVF[part][layer][scin] != 0) {
1245 return m_NodePVF[part][layer][scin];
1248 std::cout <<
"Node: " <<
"Part" << part <<
"Layer" << layer <<
"PVF" << scin <<
" not found" << std::endl;
1251 return m_NodePVF[part][layer][scin];
1257 if (m_NodeAl[part][layer] != 0) {
1258 return m_NodeAl[part][layer];
1261 std::cout <<
"Node: " <<
"Part" << part <<
"Layer" << layer <<
"Al" <<
" not found" << std::endl;
1264 return m_NodeAl[part][layer];
1270 if (m_NodeScin[part][layer] != 0) {
1271 return m_NodeScin[part][layer];
1274 std::cout <<
"Node: " <<
"Part" << part <<
"Layer" << layer <<
"Scin" <<
" not found" << std::endl;
1277 return m_NodeScin[part][layer];
1284 if (m_NodeModule[part][module] != 0) {
1285 return m_NodeModule[part][module];
1288 std::cout <<
"Node: " <<
"Part" << part <<
"Module" << module <<
" not found" << std::endl;
1291 return m_NodeModule[part][module];
1296 if (m_NodegasContainer[part][module] != 0) {
1297 return m_NodegasContainer[part][module];
1300 std::cout <<
"Node: " <<
"Part" << part <<
"Module" << module <<
"gasContainer" <<
" not found" << std::endl;
1304 return m_NodegasContainer[part][module];
1309 if (m_NodebareChamber[part][module] != 0) {
1310 return m_NodebareChamber[part][module];
1313 std::cout <<
"Node: " <<
"Part" << part <<
"Module" << module <<
"bareChamber" <<
" not found" << std::endl;
1317 return m_NodebareChamber[part][module];
1322 if (m_NodepcbBoard1[part][module] != 0) {
1323 return m_NodepcbBoard1[part][module];
1326 std::cout <<
"Node: " <<
"Part" << part <<
"Module" << module <<
"pcbBoard1" <<
" not found" << std::endl;
1330 return m_NodepcbBoard1[part][module];
1335 if (m_NodeStrip[part][module][strip] != 0) {
1336 return m_NodeStrip[part][module][strip];
1339 std::cout <<
"Node: " <<
"Part" << part <<
"Module" << module <<
"Strip" << strip <<
" not found" << std::endl;
1343 return m_NodeStrip[part][module][strip];
1369 if (m_PhysicalScin[part][layer][scin] != 0) {
1370 return m_PhysicalScin[part][layer][scin];
1373 std::cout <<
"PhysicalNode: " <<
"Part"
1374 << part <<
"Layer" << layer <<
"Scin"
1375 << scin <<
" not found" << std::endl;
1383 if (m_Tof2DScin[part][layer][scin])
return m_Tof2DScin[part][layer][scin];
1390 for (Int_t part = 0; part < m_kPart; part++)
1392 for (Int_t layer = 0; layer <
GetLayerNb(part); layer++)
1394 for (
int scin = 0; scin <
GetScinNb(part); scin++)
1403 cout <<
"TofROOTGeo::GetPart, this scintillator physical node does not exist!" << endl;
1410 TString opt = option;
1413 if (!
m_2DGeoInit) cout <<
"TofROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
1415 if (!view) cout <<
"TofROOTGeo::Draw(), BesView not found" << endl;
1423 for (Int_t part = m_kPart-1; part >= 0; part--)
1425 for (Int_t layer = 0; layer <
GetLayerNb(part); layer++)
1427 for (
int scin = 0; scin <
GetScinNb(part); scin++)
1429 if (m_Tof2DScin[part][layer][scin])
1433 m_Tof2DScin[part][layer][scin]->
SetFired(
false);
1437 m_Tof2DScin[part][layer][scin]->
Draw(scinOpt);
1450 if (!view) cout <<
"TofROOTGeo::DrawHits(), BesView not found" << endl;
R__EXTERN BesEvent * gEvent
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)
const TObjArray * GetTofDigiCol() const
Bool_t GetVisTofHitsWest()
Bool_t GetVisTofHitsGlobal()
Bool_t GetVisTofHitsBarrel()
Bool_t GetVisTofHitsEast()
TGeoNode * GetNode(const std::string &nn)
Get a node(physical volume) by name;.
TGeoVolume * GetTopVolume()
Get the top(world) volume;.
TGeoVolume * GetLogicalVolume(const std::string &vn)
Get a logical volume by name;.
void ReadGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of ROOTGeo.
TObjArray * m_DetectorsArray
TObjArray * m_2DHitsArray
UInt_t getChargeChannel() const
UInt_t getTimeChannel() const
virtual Double_t GetCharge()
virtual void Draw(Option_t *option="")
virtual void AddInfo(TString info)
void SetTimeChannel(UInt_t tc)
virtual void ResetTimeCharge()
virtual void SetCharge(Double_t charge)
virtual void SetFired(bool status=true)
void SetChargeChannel(UInt_t cc)
UInt_t GetChargeChannel() const
UInt_t GetTimeChannel() const
static int endcap(const Identifier &id)
static int strip(const Identifier &id)
static int phi_module(const Identifier &id)
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
static int layer(const Identifier &id)
static int module(const Identifier &id)
TGeoNode * GetAl(int part, int layer)
Get Al node;.
void SetQuarterVisible()
Set quater visible;.
int GetModuleNb(int part)
TGeoNode * GetpcbBoard1(int part, int module)
Get pcbBoard1 node;.
TGeoVolume * GetVolumeScin(int part)
Get scintillator volume;.
void SetVolumeTof(TGeoVolume *vol)
Set Tof volume, while initializing from ROOT;.
void InitFromROOT(TGeoVolume *vol)
Initialize ROOTGeo from TGeoVolume logicalTof.
int GetContainerNodeNb(int module)
TGeoVolume * GetVolumeAl(int part, int layer)
Get Al volume;.
TGeoNode * GetModule(int part, int module)
Get module node;.
int GetBoard1NodeNb(int module)
TGeoNode * GetgasContainer(int part, int module)
Get gasContainer node;.
void Draw(Option_t *option)
Draw function.
int GetPartNb()
Get number of part;.
void SetPhysicalDefaultVis()
int GetChamberNodeNb(int module)
void InitFromGDML(const char *gdmlFile, const char *setupName)
Initialize ROOTGeo from GDML.
TGeoVolume * GetVolumeBucket(int part)
Get bucket volume;.
void SetHalfVisible()
Set half visible;.
void SetQMatch(Bool_t input)
TGeoNode * GetbareChamber(int part, int module)
Get bareChamber node;.
void SetNoEndVisible()
Set noend visible;.
void SetHits()
Set all physicalNodes corresponding to digiCol;.
TGeoVolume * GetVolumePart(int part)
Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;
void SetDetector()
Draw Detecor (what is detector depends on you)
TGeoNode * GetScin(int part, int scin)
Get scintillator node;.
void DrawHits(Option_t *option)
Draw 2D hits.
Tof2DScin * Get2DScin(Int_t part, Int_t layer, Int_t scin)
Get Tof2DScin;.
TGeoNode * GetStrip(int part, int module, int strip)
Get strip node;.
void SetVisTofDetector()
Set Tof detector visibility;.
int GetScinNb(int part)
Get number of scintillators on each part;.
void SetPhysicalNode()
Set the pointers to the physical nodes;.
TGeoNode * GetPVF(int part, int layer, int scin)
Get PVF node;.
void Init2DGeometry()
Initialize 2D Geometry.
TGeoVolume * GetVolumePVF(int part, int layer)
Get PVF volume;.
void SetTMatch(Bool_t input)
void SetVisTofHits()
Set Tof hits visibility;.
int GetStripNb(int module)
TGeoPhysicalNode * GetPhysicalScin(int part, int scin)
Get scintillator physical node;.
Int_t GetPart(TGeoPhysicalNode *phyNode)
Get part no of a scintillator physcial node.
void SetNode()
Set the pointers to theirs nodes;.
void SetVolumeDefaultVis()
Set default visual attributes;.
void SetAllVisible()
Set all visible;.