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].set(0);
51 m_Tof2DScin[part][layer][scin] = 0;
74 m_ScinColor = kYellow;
81 cout <<
"delete old TofROOTGeo" << endl;
85 for (Int_t part = 0; part < m_kPart; part++)
89 for (Int_t layer = 0; layer <
GetLayerNb(part); layer++)
91 for (
int scin = 0; scin <
GetScinNb(part); scin++)
93 delete m_Tof2DScin[part][layer][scin];
99 for (
int module = 0;
module < GetModuleNb(part);
module++)
101 for (int strip = 0; strip <
GetStripNb(part); strip++)
103 delete m_Tof2DScin[part][module][strip];
111 for (Int_t part = 0; part < m_kPart; part++)
113 for (Int_t layer = 0; layer < GetLayerNb(part); layer++)
115 for (
int scin = 0; scin < GetScinNb(part); scin++)
117 delete m_Tof2DScin[part][layer][scin];
122 cout <<
"[DEBUG] Test: ~TofROOTGeo() finished" << endl;
132 if (TString(gdmlFile).Contains(
"Tof_mrpc.gdml")) fTofMrpc = 1;
133 else cout <<
"Cannot read Tof_mrpc!" << endl;
134 if (fTofMrpc) cout <<
"fTofMrpc: " <<
"Using new Geometry of Tof!" << endl;
147 TGeoNode *contianer = vol->GetNode(0)->GetVolume()->GetNode(0);
148 if (TString(contianer->GetName()).Contains(
"container")) fTofMrpc = 1;
149 if (fTofMrpc) cout <<
"fTofMrpc: " <<
"Using new Geometry of Tof!" << endl;
160 cout <<
"TofROOTGeo::Init2DGeometry, ROOT Geometry not Initialized yet!" << endl;
165 Double_t local[3] = {0.0, 0.0, 0.0};
166 Double_t master[3] = {0.0, 0.0, 0.0};
175 for (Int_t part = 0; part < m_kPart; part++)
179 for (Int_t layer = 0; layer <
GetLayerNb(part); layer++)
181 for (
int scin = 0; scin <
GetScinNb(part); scin++)
186 name = TString(
"Tof Part 1");
192 TGeoArb8 *scinShape = (TGeoArb8*)scinPhyNode->GetShape();
193 Double_t *localArb8Point, masterArb8Point[24];
194 localArb8Point = scinShape->GetVertices();
196 for (Int_t i = 0; i < 8; i++)
198 local[0] = localArb8Point[2*i];
199 local[1] = localArb8Point[2*i+1];
200 if (i < 4) local[2] = scinShape->GetDz() * (-1.0);
201 else local[2] = scinShape->GetDz();
204 scinPhyNode->GetMatrix(-1*scinPhyNode->GetLevel())->LocalToMaster(local, &master[0]);
207 for (Int_t j = 0; j < 3; j++) {
208 masterArb8Point[3*i+j] = master[j];
212 m_Tof2DScin[part][layer][scin] =
new Tof2DScin(name, name, 8, &masterArb8Point[0], part);
218 for (
int module = 0;
module < GetModuleNb(part);
module++)
220 for (int strip = 0; strip <
GetStripNb(part); strip++)
225 name = TString(
"EastEc");
226 name = TString(
"Tof Part");
235 name = TString(
"WestEc");
236 name = TString(
"Tof Part");
244 TGeoTrd2 *mrpcShape = (TGeoTrd2*)mrpcPhyNode->GetShape();
246 Double_t x1, x2, y1, y2, z;
247 x1 = mrpcShape->GetDx1();
248 x2 = mrpcShape->GetDx2();
249 y1 = mrpcShape->GetDy1() * 500;
250 y2 = mrpcShape->GetDy2() * 500;
251 z = mrpcShape->GetDz();
252 Double_t masterArb8Point[24];
254 for (Int_t i =0; i < 8; i++)
256 if (i == 0) { local[0] = -x1; local[1] = -y1; local[2] = -z; }
257 else if (i == 4) { local[0] = -x1; local[1] = y1; local[2] = -z; }
258 else if (i == 7) { local[0] = x1; local[1] = y1; local[2] = -z; }
259 else if (i == 3) { local[0] = x1; local[1] = -y1; local[2] = -z; }
260 else if (i == 1) { local[0] = -x2; local[1] = -y2; local[2] = z; }
261 else if (i == 5) { local[0] = -x2; local[1] = y2; local[2] = z; }
262 else if (i == 6) { local[0] = x2; local[1] = y2; local[2] = z; }
263 else if (i == 2) { local[0] = x2; local[1] = -y2; local[2] = z; }
265 mrpcPhyNode->GetMatrix(-1*mrpcPhyNode->GetLevel())->LocalToMaster(local, &master[0]);
266 for (Int_t j = 0; j < 3; j++) {
267 masterArb8Point[3*i+j] = master[j];
271 m_Tof2DScin[part][module][strip] =
new Tof2DScin(name, name, 8, &masterArb8Point[0], part);
280 for (Int_t part = 0; part < m_kPart; part++)
282 for (Int_t layer = 0; layer < GetLayerNb(part); layer++)
284 for (
int scin = 0; scin < GetScinNb(part); scin++)
286 TGeoPhysicalNode *scinPhyNode = GetPhysicalScin(part, layer, scin);
289 name = TString(
"Tof Part 1");
297 if (part == 0) name = TString(
"EastEc");
298 else if (part == 2) name = TString(
"WestEc");
299 name = TString(
"Tof Part ");
304 TGeoArb8 *scinShape = (TGeoArb8*)scinPhyNode->GetShape();
305 Double_t *localArb8Point, masterArb8Point[24];
306 localArb8Point = scinShape->GetVertices();
308 for (Int_t i = 0; i < 8; i++)
310 local[0] = localArb8Point[2*i];
311 local[1] = localArb8Point[2*i+1];
312 if (i < 4) local[2] = scinShape->GetDz() * (-1.0);
313 else local[2] = scinShape->GetDz();
316 scinPhyNode->GetMatrix(-1*scinPhyNode->GetLevel())->LocalToMaster(local, &master[0]);
319 for (Int_t j = 0; j < 3; j++) {
320 masterArb8Point[3*i+j] = master[j];
324 m_Tof2DScin[part][layer][scin] =
new Tof2DScin(name, name, 8, &masterArb8Point[0], part);
337 if (!m_Tof) std::cout <<
"m_Tof = 0" << std::endl;
341 for (
int part = 0; part < m_kPart; part++)
343 if ( part != 1 )
continue;
344 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
346 std::stringstream osnameAl;
347 if (part == 1) osnameAl <<
"pv_" <<
"logical" <<
"AlBr" << layer+1 <<
"_0";
348 m_NodeAl[part][layer] =
GetNode( osnameAl.str() );
349 if (!m_NodeAl[part][layer]) cout <<
"empty pointer: m_NodeAl" << endl;
351 std::stringstream osnameScin;
352 if (part == 1) osnameScin <<
"pv_" <<
"logical" <<
"ScinBr" << layer+1 <<
"_0";
353 m_NodeScin[part][layer] =
GetNode( osnameScin.str() );
354 if (!m_NodeScin[part][layer]) cout <<
"empty pointer: m_NodeScin" << endl;
356 for (
int scin = 0; scin <
GetScinNb(part); scin++)
358 std::stringstream osnamePVF;
360 osnamePVF <<
"pv_" <<
"logicalPVFBr"<< layer+1 <<
"_" << (2*m_kScinBr*3 - 1) - (layer*m_kScinBr + scin)*3;
362 m_NodePVF[part][layer][scin] =
GetNode( osnamePVF.str() );
363 if (!m_NodePVF[part][layer][scin]) cout <<
"empty pointer: m_NodePVF" << endl;
368 for (
int part = 0; part < m_kPart; part++)
370 if (part == 1)
continue;
371 for (
int module = 0;
module < GetModuleNb(part);
module++)
373 std::stringstream osnameModule;
374 std::stringstream osnamegasContainer;
375 std::stringstream osnamebareChamber;
376 std::stringstream osnamepcbBoard1;
378 osnamebareChamber <<
"pv_" <<
"logical_" <<
"bareChamber" <<
"_" <<
GetChamberNodeNb(module);
379 m_NodebareChamber[part][module] =
GetNode( osnamebareChamber.str() );
380 if (!m_NodebareChamber) cout <<
"empty pointer: m_NodebareChamber" << endl;
382 osnamepcbBoard1 <<
"pv_" <<
"logical_" <<
"pcbBoard1" <<
"_" <<
GetBoard1NodeNb(module);
383 m_NodepcbBoard1[part][module] =
GetNode ( osnamepcbBoard1.str() );
384 if (!m_NodepcbBoard1) cout <<
"empty pointer: m_NodepcbBoard1" << endl;
388 if (!TMath::Odd(module))
390 osnameModule <<
"pv_"<<
"logical_" <<
"container_m0" <<
"_" << module;
391 osnamegasContainer <<
"pv_" <<
"logical_" <<
"gasContainer_m0" <<
"_" <<
GetContainerNodeNb(module);
394 osnameModule <<
"pv_" <<
"logical_" <<
"container_m3" <<
"_" << module;
395 osnamegasContainer <<
"pv_" <<
"logical_" <<
"gasContainer_m3" <<
"_" <<
GetContainerNodeNb(module);
401 if (!TMath::Odd(module))
403 osnameModule <<
"pv_" <<
"logical_" <<
"container_m1" <<
"_" << module;
404 osnamegasContainer <<
"pv_" <<
"logical_" <<
"gasContainer_m1" <<
"_" <<
GetContainerNodeNb(module);
408 osnameModule <<
"pv_" <<
"logical_" <<
"container_m2" <<
"_" << module;
409 osnamegasContainer <<
"pv_" <<
"logical_" <<
"gasContainer_m2" <<
"_" <<
GetContainerNodeNb(module);
413 m_NodeModule[part][module] =
GetNode( osnameModule.str() );
414 if (!m_NodeModule[part][module]) cout<<
"empty pointer: m_NodeModule "<<endl;
415 m_NodegasContainer[part][module] =
GetNode( osnamegasContainer.str() );
416 if (!m_NodegasContainer[part][module]) cout<<
"empty pointer: m_NodegasContainer "<<endl;
418 for (
int strip = 0; strip <
GetStripNb(module); strip++)
420 std::stringstream osnameStrip;
421 osnameStrip <<
"pv_" <<
"logical_" <<
"strip_" << (
GetStripNb(module) - 1) - strip <<
"_" << strip;
422 m_NodeStrip[part][module][strip] =
GetNode( osnameStrip.str() );
423 if (!m_NodeStrip[part][module][strip]) cout<<
"empty pointer: m_NodeStrip "<<endl;
430 for (
int part = 0; part < m_kPart; part++)
432 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
434 std::stringstream osnameAl;
435 if (part == 1) osnameAl <<
"pv_" <<
"logical" <<
"AlBr" << layer+1 <<
"_0";
436 else if (part == 0) osnameAl <<
"pv_" <<
"logical" <<
"AlEcEast" <<
"_0";
437 else osnameAl <<
"pv_" <<
"logical" <<
"AlEcWest" <<
"_0";
438 m_NodeAl[part][layer] =
GetNode( osnameAl.str() );
440 std::stringstream osnameScin;
441 if (part == 1) osnameScin <<
"pv_" <<
"logical" <<
"ScinBr" << layer+1 <<
"_0";
442 else if (part == 0) osnameScin <<
"pv_" <<
"logical" <<
"ScinEcEast" <<
"_0";
443 else osnameScin <<
"pv_" <<
"logical" <<
"ScinEcWest" <<
"_0";
444 m_NodeScin[part][layer] =
GetNode( osnameScin.str() );
446 for (
int scin = 0; scin <
GetScinNb(part); scin++)
448 std::stringstream osnamePVF;
450 osnamePVF <<
"pv_" <<
"logicalPVFBr"<< layer+1 <<
"_" << (2*m_kScinBr*3 - 1) - (layer*m_kScinBr + scin)*3;
452 else if (part == 2) {
453 osnamePVF <<
"pv_" <<
"logicalPVFEcWest" <<
"_" << (2*m_kScinEc - 1) - scin*2;
455 else if (part == 0) {
456 osnamePVF <<
"pv_" <<
"logicalPVFEcEast" <<
"_" << (2*m_kScinEc - 1) - scin*2;
458 m_NodePVF[part][layer][scin] =
GetNode( osnamePVF.str() );
464 else if (m_ROOTGeoInit == 1)
469 for (
int part = 0; part < m_kPart; part++)
472 if (part == 1) ipart = 2;
473 else if (part == 2) ipart = 1;
474 for (
int layer = 0; layer < GetLayerNb(part); layer++)
476 for (
int scin = 0; scin < GetScinNb(part); scin++)
481 iNode = (2*m_kScinBr*3 - 1) - (layer*m_kScinBr + scin)*3;
482 m_NodePVF[part][layer][scin] = m_Tof->GetNode( ipart )->GetVolume()->GetNode(iNode);
483 m_NodeAl[part][layer] = m_NodePVF[part][layer][0]->GetVolume()->GetNode(0);
484 m_NodeScin[part][layer] = m_NodeAl[part][layer]->GetVolume()->GetNode(0);
488 m_NodeModule[part][layer] = m_Tof->GetNode(ipart)->GetVolume()->GetNode(layer);
489 m_NodegasContainer[part][layer] = m_NodeModule[part][layer]->GetVolume()->GetNode(0);
490 m_NodebareChamber[part][layer] = m_NodegasContainer[part][layer]->GetVolume()->GetNode(6);
491 m_NodepcbBoard1[part][layer] = m_NodebareChamber[part][layer]->GetVolume()->GetNode(30);
492 m_NodeStrip[part][layer][scin] = m_NodepcbBoard1[part][layer]->GetVolume()->GetNode(scin);
500 for (
int part = 0; part < m_kPart; part++)
503 if (part == 1) ipart = 2;
504 if (part == 2) ipart = 1;
505 for (
int layer = 0; layer < GetLayerNb(part); layer++) {
506 for (
int scin = 0; scin < GetScinNb(part); scin++) {
518 iNode = (2*m_kScinEc - 1) - scin*2;
521 iNode = (2*m_kScinBr*3 - 1) - (layer*m_kScinBr + scin)*3;
523 m_NodePVF[part][layer][scin] = m_Tof->GetNode( ipart )->GetVolume()->GetNode(iNode);
525 m_NodeAl[part][layer] = m_NodePVF[part][layer][0]->GetVolume()->GetNode(0);
527 m_NodeScin[part][layer] = m_NodeAl[part][layer]->GetVolume()->GetNode(0);
542 m_Tof->SetLineColor(m_TofColor);
543 m_Tof->SetVisibility(0);
545 for (
int part = 0; part < m_kPart; part++) {
548 for (
int layer = 0; layer <
GetLayerNb(part); layer++) {
552 GetVolumeAl(part, layer)->SetLineColor(m_ScinColor);
570 for (
int part = 0; part < m_kPart; part++)
574 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
576 for (
int scin = 0; scin <
GetScinNb(part); scin++)
582 for (
int module = 0;
module < GetModuleNb(part);
module++)
584 for (int strip = 0; strip <
GetStripNb(module); strip++)
592 for (
int part = 0; part < m_kPart; part++)
594 for (
int layer = 0; layer < GetLayerNb(part); layer++)
596 for (
int scin = 0; scin < GetScinNb(part); scin++)
597 GetPhysicalScin(part, layer, scin)->SetLineColor(m_ScinColor);
616 m_Tof->SetLineColor(m_TofColor);
617 m_Tof->SetVisibility(0);
619 for (
int part = 0; part < m_kPart; part++) {
620 for (
int layer = 0; layer <
GetLayerNb(part); layer++) {
624 GetVolumeAl(part, layer)->SetLineColor(m_ScinColor);
717 if (gGeoManager == 0) std::cout <<
"Create gGeoManager first" << std::endl;
718 TGeoNode *
bes = gGeoManager->GetTopNode();
721 TGeoNode *nodeTof =
bes->GetDaughter(1);
722 for (
int part = 0; part < m_kPart; part++)
732 if (part == 1) ipart = 2;
733 if (part == 2) ipart = 1;
735 nodePart = nodeTof->GetVolume()->GetNode(ipart);
741 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
743 TGeoNode *nodeAl =
GetAl(part, layer);
744 TGeoNode *nodeScin =
GetScin(part, layer);
745 for (
int scin = 0; scin <
GetScinNb(part); scin++)
747 TGeoNode *nodePVF =
GetPVF(part, layer, scin);
749 m_PhysicalScin[part][layer][scin] = gGeoManager->MakePhysicalNode( TString(
"/") +
bes->GetName() +
750 TString(
"/") + nodeTof->GetName() +
751 TString(
"/") + nodePart->GetName() +
752 TString(
"/") + nodePVF->GetName() +
753 TString(
"/") + nodeAl->GetName() +
754 TString(
"/") + nodeScin->GetName() );
755 if(!m_PhysicalScin[part][layer][scin]) cout <<
"empty pointer: m_PhysicalScin" << endl;
756 m_PhysicalScin[part][layer][scin]->SetVisibility(0);
757 m_PhysicalScin[part][layer][scin]->SetIsVolAtt(kFALSE);
758 m_PhysicalScin[part][layer][scin]->SetLineColor(m_ScinColor);
764 for (
int module = 0;
module < GetModuleNb(part);
module++)
766 TGeoNode *nodeModule = GetModule(part,module);
770 for (
int strip = 0; strip <
GetStripNb(module); strip++)
772 TGeoNode *nodeStrip =
GetStrip(part,module,strip);
774 m_PhysicalScin[part][module][strip] = gGeoManager->MakePhysicalNode( TString(
"/") +
bes->GetName() +
775 TString(
"/") + nodeTof->GetName() +
776 TString(
"/") + nodePart->GetName() +
777 TString(
"/") + nodeModule->GetName() +
778 TString(
"/") + nodegasContainer->GetName() +
779 TString(
"/") + nodebareChamber->GetName() +
780 TString(
"/") + nodepcbBoard1->GetName() +
781 TString(
"/") + nodeStrip->GetName() );
782 if(!m_PhysicalScin[part][module][strip]) cout <<
"empty pointer: m_PhysicalScin" << endl;
783 m_PhysicalScin[part][module][strip]->SetVisibility(0);
784 m_PhysicalScin[part][module][strip]->SetIsVolAtt(kFALSE);
785 m_PhysicalScin[part][module][strip]->SetLineColor(m_ScinColor);
792 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
794 TGeoNode *nodeAl =
GetAl(part, layer);
795 TGeoNode *nodeScin =
GetScin(part, layer);
796 for (
int scin = 0; scin <
GetScinNb(part); scin++)
798 TGeoNode *nodePVF =
GetPVF(part, layer, scin);
799 m_PhysicalScin[part][layer][scin] = gGeoManager->MakePhysicalNode( TString(
"/") +
bes->GetName() +
800 TString(
"/") + nodeTof->GetName() +
801 TString(
"/") + nodePart->GetName() +
802 TString(
"/") + nodePVF->GetName() +
803 TString(
"/") + nodeAl->GetName() +
804 TString(
"/") + nodeScin->GetName() );
807 m_PhysicalScin[part][layer][scin]->SetVisibility(0);
808 m_PhysicalScin[part][layer][scin]->SetIsVolAtt(kFALSE);
809 m_PhysicalScin[part][layer][scin]->SetLineColor(m_ScinColor);
822 if (gPad) view =
dynamic_cast<BesView*
>(gPad->GetView());
829 for (
int part = 0; part < m_kPart; part++)
833 for (
int layer = 0; layer <
GetLayerNb(part); layer++)
835 for (
int scin = 0; scin <
GetScinNb(part); scin++)
837 TGeoPhysicalNode *phyNode = 0;
841 phyNode->SetVisibility(0);
849 for (
int module = 0;
module < GetModuleNb(part);
module++)
851 for (int strip = 0; strip <
GetStripNb(module); strip++)
853 TGeoPhysicalNode *phyNode = 0;
857 phyNode->SetVisibility(0);
867 for (
int part = 0; part < m_kPart; part++)
869 for (
int layer = 0; layer < GetLayerNb(part); layer++)
871 for (
int scin = 0; scin < GetScinNb(part); scin++)
873 TGeoPhysicalNode *phyNode = 0;
874 phyNode = GetPhysicalScin(part, layer, scin);
877 phyNode->SetVisibility(0);
881 m_DetectorsArray->Add( phyNode );
897 for (
int i = 0; i <
m_HitsArray->GetEntries(); i++)
903 (*PphyNode)->SetVisibility(0);
913 aScin->
AddInfo(aScin->GetTitle());
933 if (m_TofDigiCol) NDigiCol = m_TofDigiCol->GetEntries();
937 for (
int i = 0; i < NDigiCol; i++)
941 int part, layer, scin;
962 if (part_Ec == 0) part = 0;
976 Double_t charge = Double_t(aTofDigi->
getChargeChannel()) / TOF_CHARGE_FACTOR;
983 PphyNode = &m_PhysicalScin[part][layer][scin];
991 aScin = m_Tof2DScin[part][layer][scin];
1003 aScin->
AddInfo(aScin->GetTitle());
1005 sprintf(
data,
"t_{leading1} = %-.3f ns, t_{trailing1} = %-.3f ns",
time, charge);
1011 sprintf(
data,
"t_{leading2} = %-.3f ns, t_{trailing2} = %-.3f ns",
time, charge);
1013 sprintf(
data,
"Fired");
1022 aScin->
AddInfo(aScin->GetTitle());
1023 sprintf(
data,
"time1 = %-.3f ns, charge1 = %-.3f MeV",
time, charge);
1028 sprintf(
data,
"time2 = %-.3f ns, charge2 = %-.3f MeV",
time, charge);
1030 sprintf(
data,
"Fired");
1040 aScin->
AddInfo(aScin->GetTitle());
1041 sprintf(
data,
"time1 = %-.3f ns, charge1 = %-.3f MeV",
time, charge);
1046 sprintf(
data,
"time2 = %-.3f ns, charge2 = %-.3f MeV",
time, charge);
1048 sprintf(
data,
"Fired");
1078 if (gPad) view =
dynamic_cast<BesView*
>(gPad->GetView());
1084 phyNode->SetVisibility(0);
1091 phyNode->SetVisibility(1);
1100 if (gPad) view =
dynamic_cast<BesView*
>(gPad->GetView());
1103 for (
int i = 0; i <
m_HitsArray->GetEntries(); i++)
1121 (*PphyNode)->SetVisibility(1);
1122 (*PphyNode)->SetLineColor(801);
1127 if (part > -1) (*PphyNode)->SetLineColor(m_ScinColor);
1143 if (part == 1)
return m_kScinBr;
1146 if (fTofMrpc)
return m_kStripEc;
1156 if (part == 1)
return m_kLayerBr;
1159 if (fTofMrpc)
return m_kModuleEc;
1172 return m_kChamberNodeNb;
1176 return m_kContainerNodeNb;
1180 return m_kBoard1NodeNb;
1208 std::stringstream osname;
1210 osname <<
"logicalBrTof";
1212 else if (part == 0){
1213 osname <<
"logicalEcTofWest";
1216 osname <<
"logicalEcTofEast";
1224 std::stringstream osname;
1226 osname <<
"logical" <<
"PVFEcEast";
1228 else if (part == 2){
1229 osname <<
"logical" <<
"PVFEcWest";
1233 osname <<
"logical" <<
"PVFBr" << layer+1;
1242 std::stringstream osname;
1244 osname <<
"logical" <<
"AlEcEast";
1246 else if (part == 2){
1247 osname <<
"logical" <<
"AlEcWest";
1251 osname <<
"logical" <<
"AlBr" << layer+1;
1260 std::stringstream osname;
1262 osname <<
"logical" <<
"ScinEcEast";
1264 else if (part == 2){
1265 osname <<
"logical" <<
"ScinEcWest";
1269 osname <<
"logical" <<
"ScinBr" << layer+1;
1278 std::stringstream osname;
1279 if (part == 0 || part == 2) {
1280 osname <<
"logical" <<
"BucketEc";
1284 osname <<
"logical" <<
"BucketBr" << layer+1;
1293 if (m_NodePVF[part][layer][scin] != 0) {
1294 return m_NodePVF[part][layer][scin];
1297 std::cout <<
"Node: " <<
"Part" << part <<
"Layer" << layer <<
"PVF" << scin <<
" not found" << std::endl;
1300 return m_NodePVF[part][layer][scin];
1306 if (m_NodeAl[part][layer] != 0) {
1307 return m_NodeAl[part][layer];
1310 std::cout <<
"Node: " <<
"Part" << part <<
"Layer" << layer <<
"Al" <<
" not found" << std::endl;
1313 return m_NodeAl[part][layer];
1319 if (m_NodeScin[part][layer] != 0) {
1320 return m_NodeScin[part][layer];
1323 std::cout <<
"Node: " <<
"Part" << part <<
"Layer" << layer <<
"Scin" <<
" not found" << std::endl;
1326 return m_NodeScin[part][layer];
1333 if (m_NodeModule[part][module] != 0) {
1334 return m_NodeModule[part][module];
1337 std::cout <<
"Node: " <<
"Part" << part <<
"Module" << module <<
" not found" << std::endl;
1340 return m_NodeModule[part][module];
1345 if (m_NodegasContainer[part][module] != 0) {
1346 return m_NodegasContainer[part][module];
1349 std::cout <<
"Node: " <<
"Part" << part <<
"Module" << module <<
"gasContainer" <<
" not found" << std::endl;
1353 return m_NodegasContainer[part][module];
1358 if (m_NodebareChamber[part][module] != 0) {
1359 return m_NodebareChamber[part][module];
1362 std::cout <<
"Node: " <<
"Part" << part <<
"Module" << module <<
"bareChamber" <<
" not found" << std::endl;
1366 return m_NodebareChamber[part][module];
1371 if (m_NodepcbBoard1[part][module] != 0) {
1372 return m_NodepcbBoard1[part][module];
1375 std::cout <<
"Node: " <<
"Part" << part <<
"Module" << module <<
"pcbBoard1" <<
" not found" << std::endl;
1379 return m_NodepcbBoard1[part][module];
1384 if (m_NodeStrip[part][module][strip] != 0) {
1385 return m_NodeStrip[part][module][strip];
1388 std::cout <<
"Node: " <<
"Part" << part <<
"Module" << module <<
"Strip" << strip <<
" not found" << std::endl;
1392 return m_NodeStrip[part][module][strip];
1419 if (m_PhysicalScin[part][layer][scin]) {
1420 return m_PhysicalScin[part][layer][scin].get();
1423 std::cout <<
"PhysicalNode: " <<
"Part"
1424 << part <<
"Layer" << layer <<
"Scin"
1425 << scin <<
" not found" << std::endl;
1433 if (m_Tof2DScin[part][layer][scin])
return m_Tof2DScin[part][layer][scin];
1440 for (Int_t part = 0; part < m_kPart; part++)
1442 for (Int_t layer = 0; layer <
GetLayerNb(part); layer++)
1444 for (
int scin = 0; scin <
GetScinNb(part); scin++)
1453 cout <<
"TofROOTGeo::GetPart, this scintillator physical node does not exist!" << endl;
1460 TString opt = option;
1463 if (!
m_2DGeoInit) cout <<
"TofROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
1465 if (!view) cout <<
"TofROOTGeo::Draw(), BesView not found" << endl;
1473 for (Int_t part = m_kPart-1; part >= 0; part--)
1475 for (Int_t layer = 0; layer <
GetLayerNb(part); layer++)
1477 for (
int scin = 0; scin <
GetScinNb(part); scin++)
1479 if (m_Tof2DScin[part][layer][scin])
1483 m_Tof2DScin[part][layer][scin]->
SetFired(
false);
1487 m_Tof2DScin[part][layer][scin]->
Draw(scinOpt);
1500 if (!view) cout <<
"TofROOTGeo::DrawHits(), BesView not found" << endl;
R__EXTERN BesEvent * gEvent
const TObjArray * GetTofDigiCol() const
TGeoPhysicalNode * get() 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 end(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)
UInt_t getTimeChannel() const
UInt_t getChargeChannel() const
void setChargeChannel(UInt_t scc)
void setTimeChannel(UInt_t stc)
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;.