21#include <TGeoManager.h>
27#include "BesVisLib/BesEvent.h"
28#include "BesVisLib/BesView.h"
29#include "BesVisLib/TofROOTGeo.h"
30#include "Identifier/TofID.h"
31#include "RawEvent/RawDataUtil.h"
37 for (
int part = 0; part < m_kPart; part++ )
40 for (
int layer = 0; layer < m_kModuleEc; layer++ )
44 m_NodeAl[part][layer] =
nullptr;
45 m_NodeScin[part][layer] =
nullptr;
48 for (
int scin = 0; scin < m_kScinBr; scin++ )
50 if ( layer < 2 ) m_NodePVF[part][layer][scin] =
nullptr;
52 m_PhysicalScin[part][layer][scin] =
nullptr;
53 m_Tof2DScin[part][layer][scin] =
nullptr;
76 m_ScinColor = kYellow;
81 cout <<
"delete old TofROOTGeo" << endl;
82 for (
int part = 0; part < m_kPart; part++ )
84 for (
int layer = 0; layer < m_kModuleEc; layer++ )
86 for (
int scin = 0; scin < m_kScinBr; scin++ ) {
delete m_Tof2DScin[part][layer][scin]; }
96 if ( TString( gdmlFile ).Contains(
"Tof_mrpc.gdml" ) ) fTofMrpc = 1;
97 else cout <<
"Cannot read Tof_mrpc!" << endl;
100 <<
"Using new Geometry of Tof!" << endl;
111 TGeoNode* contianer = vol->GetNode( 0 )->GetVolume()->GetNode( 0 );
112 if ( TString( contianer->GetName() ).Contains(
"container" ) ) fTofMrpc = 1;
115 <<
"Using new Geometry of Tof!" << endl;
124 cout <<
"TofROOTGeo::Init2DGeometry, ROOT Geometry not Initialized yet!" << endl;
129 Double_t local[3] = { 0.0, 0.0, 0.0 };
130 Double_t master[3] = { 0.0, 0.0, 0.0 };
139 for ( Int_t part = 0; part < m_kPart; part++ )
143 for ( Int_t layer = 0; layer <
GetLayerNb( part ); layer++ )
145 for (
int scin = 0; scin <
GetScinNb( part ); scin++ )
150 name = TString(
"Tof Part 1" );
156 TGeoArb8* scinShape = (TGeoArb8*)scinPhyNode->GetShape();
157 Double_t *localArb8Point, masterArb8Point[24];
158 localArb8Point = scinShape->GetVertices();
160 for ( Int_t i = 0; i < 8; i++ )
162 local[0] = localArb8Point[2 * i];
163 local[1] = localArb8Point[2 * i + 1];
164 if ( i < 4 ) local[2] = scinShape->GetDz() * ( -1.0 );
165 else local[2] = scinShape->GetDz();
169 scinPhyNode->GetMatrix( -1 * scinPhyNode->GetLevel() )
170 ->LocalToMaster( local, &master[0] );
174 for ( Int_t j = 0; j < 3; j++ ) { masterArb8Point[3 * i + j] = master[j]; }
177 m_Tof2DScin[part][layer][scin] =
178 new Tof2DScin( name, name, 8, &masterArb8Point[0], part );
184 for (
int module = 0;
module < GetModuleNb( part );
module++ )
186 for ( int strip = 0; strip <
GetStripNb( part ); strip++ )
188 TGeoPhysicalNode* mrpcPhyNode =
GetPhysicalScin( part, module, strip );
191 name = TString(
"EastEc" );
192 name = TString(
"Tof Part" );
199 else if ( part == 2 )
201 name = TString(
"WestEc" );
202 name = TString(
"Tof Part" );
210 TGeoTrd2* mrpcShape = (TGeoTrd2*)mrpcPhyNode->GetShape();
212 Double_t x1, x2, y1, y2, z;
213 x1 = mrpcShape->GetDx1();
214 x2 = mrpcShape->GetDx2();
215 y1 = mrpcShape->GetDy1() * 500;
216 y2 = mrpcShape->GetDy2() * 500;
217 z = mrpcShape->GetDz();
218 Double_t masterArb8Point[24];
220 for ( Int_t i = 0; i < 8; i++ )
271 mrpcPhyNode->GetMatrix( -1 * mrpcPhyNode->GetLevel() )
272 ->LocalToMaster( local, &master[0] );
273 for ( Int_t j = 0; j < 3; j++ ) { masterArb8Point[3 * i + j] = master[j]; }
276 m_Tof2DScin[part][module][strip] =
277 new Tof2DScin( name, name, 8, &masterArb8Point[0], part );
286 for ( Int_t part = 0; part < m_kPart; part++ )
288 for ( Int_t layer = 0; layer < GetLayerNb( part ); layer++ )
290 for (
int scin = 0; scin < GetScinNb( part ); scin++ )
292 TGeoPhysicalNode* scinPhyNode = GetPhysicalScin( part, layer, scin );
295 name = TString(
"Tof Part 1" );
303 if ( part == 0 ) name = TString(
"EastEc" );
304 else if ( part == 2 ) name = TString(
"WestEc" );
305 name = TString(
"Tof Part " );
310 TGeoArb8* scinShape = (TGeoArb8*)scinPhyNode->GetShape();
311 Double_t *localArb8Point, masterArb8Point[24];
312 localArb8Point = scinShape->GetVertices();
314 for ( Int_t i = 0; i < 8; i++ )
316 local[0] = localArb8Point[2 * i];
317 local[1] = localArb8Point[2 * i + 1];
318 if ( i < 4 ) local[2] = scinShape->GetDz() * ( -1.0 );
319 else local[2] = scinShape->GetDz();
323 scinPhyNode->GetMatrix( -1 * scinPhyNode->GetLevel() )
324 ->LocalToMaster( local, &master[0] );
328 for ( Int_t j = 0; j < 3; j++ ) { masterArb8Point[3 * i + j] = master[j]; }
331 m_Tof2DScin[part][layer][scin] =
332 new Tof2DScin( name, name, 8, &masterArb8Point[0], part );
343 if ( !m_Tof ) std::cout <<
"m_Tof = 0" << std::endl;
347 for (
int part = 0; part < m_kPart; part++ )
349 if ( part != 1 )
continue;
350 for (
int layer = 0; layer <
GetLayerNb( part ); layer++ )
352 std::stringstream osnameAl;
356 <<
"AlBr" << layer + 1 <<
"_0";
357 m_NodeAl[part][layer] =
GetNode( osnameAl.str() );
358 if ( !m_NodeAl[part][layer] ) cout <<
"empty pointer: m_NodeAl" << endl;
360 std::stringstream osnameScin;
364 <<
"ScinBr" << layer + 1 <<
"_0";
365 m_NodeScin[part][layer] =
GetNode( osnameScin.str() );
366 if ( !m_NodeScin[part][layer] ) cout <<
"empty pointer: m_NodeScin" << endl;
368 for (
int scin = 0; scin <
GetScinNb( part ); scin++ )
370 std::stringstream osnamePVF;
374 <<
"logicalPVFBr" << layer + 1 <<
"_"
375 << ( 2 * m_kScinBr * 3 - 1 ) - ( layer * m_kScinBr + scin ) * 3;
377 m_NodePVF[part][layer][scin] =
GetNode( osnamePVF.str() );
378 if ( !m_NodePVF[part][layer][scin] ) cout <<
"empty pointer: m_NodePVF" << endl;
383 for (
int part = 0; part < m_kPart; part++ )
385 if ( part == 1 )
continue;
386 for (
int module = 0;
module < GetModuleNb( part );
module++ )
388 std::stringstream osnameModule;
389 std::stringstream osnamegasContainer;
390 std::stringstream osnamebareChamber;
391 std::stringstream osnamepcbBoard1;
393 osnamebareChamber <<
"pv_"
397 m_NodebareChamber[part][module] =
GetNode( osnamebareChamber.str() );
398 if ( !m_NodebareChamber ) cout <<
"empty pointer: m_NodebareChamber" << endl;
400 osnamepcbBoard1 <<
"pv_"
404 m_NodepcbBoard1[part][module] =
GetNode( osnamepcbBoard1.str() );
405 if ( !m_NodepcbBoard1 ) cout <<
"empty pointer: m_NodepcbBoard1" << endl;
409 if ( !TMath::Odd( module ) )
411 osnameModule <<
"pv_"
415 osnamegasContainer <<
"pv_"
422 osnameModule <<
"pv_"
426 osnamegasContainer <<
"pv_"
435 if ( !TMath::Odd( module ) )
437 osnameModule <<
"pv_"
441 osnamegasContainer <<
"pv_"
448 osnameModule <<
"pv_"
452 osnamegasContainer <<
"pv_"
459 m_NodeModule[part][module] =
GetNode( osnameModule.str() );
460 if ( !m_NodeModule[part][module] ) cout <<
"empty pointer: m_NodeModule " << endl;
461 m_NodegasContainer[part][module] =
GetNode( osnamegasContainer.str() );
462 if ( !m_NodegasContainer[part][module] )
463 cout <<
"empty pointer: m_NodegasContainer " << endl;
465 for (
int strip = 0; strip <
GetStripNb( module ); strip++ )
467 std::stringstream osnameStrip;
470 <<
"strip_" << (
GetStripNb( module ) - 1 ) - strip <<
"_" << strip;
471 m_NodeStrip[part][module][strip] =
GetNode( osnameStrip.str() );
472 if ( !m_NodeStrip[part][module][strip] )
473 cout <<
"empty pointer: m_NodeStrip " << endl;
480 for (
int part = 0; part < m_kPart; part++ )
482 for (
int layer = 0; layer <
GetLayerNb( part ); layer++ )
484 std::stringstream osnameAl;
488 <<
"AlBr" << layer + 1 <<
"_0";
489 else if ( part == 0 )
499 m_NodeAl[part][layer] =
GetNode( osnameAl.str() );
501 std::stringstream osnameScin;
505 <<
"ScinBr" << layer + 1 <<
"_0";
506 else if ( part == 0 )
516 m_NodeScin[part][layer] =
GetNode( osnameScin.str() );
518 for (
int scin = 0; scin <
GetScinNb( part ); scin++ )
520 std::stringstream osnamePVF;
524 <<
"logicalPVFBr" << layer + 1 <<
"_"
525 << ( 2 * m_kScinBr * 3 - 1 ) - ( layer * m_kScinBr + scin ) * 3;
527 else if ( part == 2 )
530 <<
"logicalPVFEcWest"
531 <<
"_" << ( 2 * m_kScinEc - 1 ) - scin * 2;
533 else if ( part == 0 )
536 <<
"logicalPVFEcEast"
537 <<
"_" << ( 2 * m_kScinEc - 1 ) - scin * 2;
539 m_NodePVF[part][layer][scin] =
GetNode( osnamePVF.str() );
545 else if ( m_ROOTGeoInit == 1 )
550 for (
int part = 0; part < m_kPart; part++ )
553 if ( part == 1 ) ipart = 2;
554 else if ( part == 2 ) ipart = 1;
555 for (
int layer = 0; layer < GetLayerNb( part ); layer++ )
557 for (
int scin = 0; scin < GetScinNb( part ); scin++ )
562 iNode = ( 2 * m_kScinBr * 3 - 1 ) - ( layer * m_kScinBr + scin ) * 3;
563 m_NodePVF[part][layer][scin] =
564 m_Tof->GetNode( ipart )->GetVolume()->GetNode( iNode );
565 m_NodeAl[part][layer] = m_NodePVF[part][layer][0]->GetVolume()->GetNode( 0 );
566 m_NodeScin[part][layer] = m_NodeAl[part][layer]->GetVolume()->GetNode( 0 );
570 m_NodeModule[part][layer] =
571 m_Tof->GetNode( ipart )->GetVolume()->GetNode( layer );
572 m_NodegasContainer[part][layer] =
573 m_NodeModule[part][layer]->GetVolume()->GetNode( 0 );
574 m_NodebareChamber[part][layer] =
575 m_NodegasContainer[part][layer]->GetVolume()->GetNode( 6 );
576 m_NodepcbBoard1[part][layer] =
577 m_NodebareChamber[part][layer]->GetVolume()->GetNode( 30 );
578 m_NodeStrip[part][layer][scin] =
579 m_NodepcbBoard1[part][layer]->GetVolume()->GetNode( scin );
587 for (
int part = 0; part < m_kPart; part++ )
590 if ( part == 1 ) ipart = 2;
591 if ( part == 2 ) ipart = 1;
592 for (
int layer = 0; layer < GetLayerNb( part ); layer++ )
594 for (
int scin = 0; scin < GetScinNb( part ); scin++ )
606 if ( part != 1 ) { iNode = ( 2 * m_kScinEc - 1 ) - scin * 2; }
608 { iNode = ( 2 * m_kScinBr * 3 - 1 ) - ( layer * m_kScinBr + scin ) * 3; }
609 m_NodePVF[part][layer][scin] = m_Tof->GetNode( ipart )->GetVolume()->GetNode(
612 m_NodeAl[part][layer] = m_NodePVF[part][layer][0]->GetVolume()->GetNode( 0 );
614 m_NodeScin[part][layer] = m_NodeAl[part][layer]->GetVolume()->GetNode( 0 );
627 m_Tof->SetLineColor( m_TofColor );
628 m_Tof->SetVisibility( 0 );
630 for (
int part = 0; part < m_kPart; part++ )
634 for (
int layer = 0; layer <
GetLayerNb( part ); layer++ )
636 GetVolumePVF( part, layer )->SetLineColor( m_ScinColor );
639 GetVolumeAl( part, layer )->SetLineColor( m_ScinColor );
656 for (
int part = 0; part < m_kPart; part++ )
660 for (
int layer = 0; layer <
GetLayerNb( part ); layer++ )
662 for (
int scin = 0; scin <
GetScinNb( part ); scin++ )
668 for (
int module = 0;
module < GetModuleNb( part );
module++ )
670 for ( int strip = 0; strip <
GetStripNb( module ); strip++ )
678 for (
int part = 0; part < m_kPart; part++ )
680 for (
int layer = 0; layer < GetLayerNb( part ); layer++ )
682 for (
int scin = 0; scin < GetScinNb( part ); scin++ )
683 GetPhysicalScin( part, layer, scin )->SetLineColor( m_ScinColor );
694 m_Tof->SetLineColor( m_TofColor );
695 m_Tof->SetVisibility( 0 );
697 for (
int part = 0; part < m_kPart; part++ )
699 for (
int layer = 0; layer <
GetLayerNb( part ); layer++ )
701 GetVolumePVF( part, layer )->SetLineColor( m_ScinColor );
704 GetVolumeAl( part, layer )->SetLineColor( m_ScinColor );
789 if ( gGeoManager == 0 ) std::cout <<
"Create gGeoManager first" << std::endl;
790 TGeoNode*
bes = gGeoManager->GetTopNode();
793 TGeoNode* nodeTof =
bes->GetDaughter( 1 );
794 for (
int part = 0; part < m_kPart; part++ )
804 if ( part == 1 ) ipart = 2;
805 if ( part == 2 ) ipart = 1;
807 nodePart = nodeTof->GetVolume()->GetNode( ipart );
813 for (
int layer = 0; layer <
GetLayerNb( part ); layer++ )
815 TGeoNode* nodeAl =
GetAl( part, layer );
816 TGeoNode* nodeScin =
GetScin( part, layer );
817 for (
int scin = 0; scin <
GetScinNb( part ); scin++ )
819 TGeoNode* nodePVF =
GetPVF( part, layer, scin );
820 m_PhysicalScin[part][layer][scin] = gGeoManager->MakePhysicalNode(
821 TString(
"/" ) +
bes->GetName() + TString(
"/" ) + nodeTof->GetName() +
822 TString(
"/" ) + nodePart->GetName() + TString(
"/" ) + nodePVF->GetName() +
823 TString(
"/" ) + nodeAl->GetName() + TString(
"/" ) + nodeScin->GetName() );
824 if ( !m_PhysicalScin[part][layer][scin] )
825 cout <<
"empty pointer: m_PhysicalScin" << endl;
826 m_PhysicalScin[part][layer][scin]->SetVisibility( 0 );
827 m_PhysicalScin[part][layer][scin]->SetIsVolAtt( kFALSE );
828 m_PhysicalScin[part][layer][scin]->SetLineColor( m_ScinColor );
834 for (
int module = 0;
module < GetModuleNb( part );
module++ )
836 TGeoNode* nodeModule = GetModule( part, module );
840 for (
int strip = 0; strip <
GetStripNb( module ); strip++ )
842 TGeoNode* nodeStrip =
GetStrip( part, module, strip );
843 m_PhysicalScin[part][module][strip] = gGeoManager->MakePhysicalNode(
844 TString(
"/" ) + bes->GetName() + TString(
"/" ) + nodeTof->GetName() +
845 TString(
"/" ) + nodePart->GetName() + TString(
"/" ) + nodeModule->GetName() +
846 TString(
"/" ) + nodegasContainer->GetName() + TString(
"/" ) +
847 nodebareChamber->GetName() + TString(
"/" ) + nodepcbBoard1->GetName() +
848 TString(
"/" ) + nodeStrip->GetName() );
849 if ( !m_PhysicalScin[part][module][strip] )
850 cout <<
"empty pointer: m_PhysicalScin" << endl;
851 m_PhysicalScin[part][module][strip] = m_PhysicalScin[part][module][strip];
853 m_PhysicalScin[part][module][strip]->SetVisibility( 0 );
854 m_PhysicalScin[part][module][strip]->SetIsVolAtt( kFALSE );
855 m_PhysicalScin[part][module][strip]->SetLineColor( m_ScinColor );
862 for (
int layer = 0; layer <
GetLayerNb( part ); layer++ )
864 TGeoNode* nodeAl =
GetAl( part, layer );
865 TGeoNode* nodeScin =
GetScin( part, layer );
866 for (
int scin = 0; scin <
GetScinNb( part ); scin++ )
868 TGeoNode* nodePVF =
GetPVF( part, layer, scin );
869 m_PhysicalScin[part][layer][scin] = gGeoManager->MakePhysicalNode(
870 TString(
"/" ) + bes->GetName() + TString(
"/" ) + nodeTof->GetName() +
871 TString(
"/" ) + nodePart->GetName() + TString(
"/" ) + nodePVF->GetName() +
872 TString(
"/" ) + nodeAl->GetName() + TString(
"/" ) + nodeScin->GetName() );
876 m_PhysicalScin[part][layer][scin]->SetVisibility( 0 );
877 m_PhysicalScin[part][layer][scin]->SetIsVolAtt( kFALSE );
878 m_PhysicalScin[part][layer][scin]->SetLineColor( m_ScinColor );
889 if ( gPad ) view =
dynamic_cast<BesView*
>( gPad->GetView() );
896 for (
int part = 0; part < m_kPart; part++ )
900 for (
int layer = 0; layer <
GetLayerNb( part ); layer++ )
902 for (
int scin = 0; scin <
GetScinNb( part ); scin++ )
904 TGeoPhysicalNode* phyNode = 0;
908 phyNode->SetVisibility( 0 );
916 for (
int module = 0;
module < GetModuleNb( part );
module++ )
918 for ( int strip = 0; strip <
GetStripNb( module ); strip++ )
920 TGeoPhysicalNode* phyNode = 0;
924 phyNode->SetVisibility( 0 );
934 for (
int part = 0; part < m_kPart; part++ )
936 for (
int layer = 0; layer < GetLayerNb( part ); layer++ )
938 for (
int scin = 0; scin < GetScinNb( part ); scin++ )
940 TGeoPhysicalNode* phyNode = 0;
941 phyNode = GetPhysicalScin( part, layer, scin );
944 phyNode->SetVisibility( 0 );
948 m_DetectorsArray->Add( phyNode );
962 for (
int i = 0; i <
m_HitsArray->GetEntries(); i++ )
964 TGeoPhysicalNode* phyNode = (TGeoPhysicalNode*)
m_HitsArray->At( i );
968 phyNode->SetVisibility( 0 );
978 aScin->
AddInfo( aScin->GetTitle() );
988 m_TofDigiCol =
gEvent->GetTofDigiCol();
990 if ( m_TofDigiCol ) NDigiCol = m_TofDigiCol->GetEntries();
994 for (
int i = 0; i < NDigiCol; i++ )
998 int part, layer, scin;
1012 if ( part_Ec == 0 ) part = 0;
1032 if ( layer < 0 || scin < 0 )
1034 std::cout <<
"TofROOTGeo::SetHits() error: "
1035 <<
" part=" << part <<
" layer=" << layer <<
" scin=" << scin << std::endl;
1040 Double_t charge = Double_t( aTofDigi->
getChargeChannel() ) / TOF_CHARGE_FACTOR;
1045 TGeoPhysicalNode* phyNode = 0;
1050 aScin = m_Tof2DScin[part][layer][scin];
1062 aScin->
AddInfo( aScin->GetTitle() );
1064 sprintf(
data,
"t_{leading1} = %-.3f ns, t_{trailing1} = %-.3f ns",
time, charge );
1070 sprintf(
data,
"t_{leading2} = %-.3f ns, t_{trailing2} = %-.3f ns",
time, charge );
1081 aScin->
AddInfo( aScin->GetTitle() );
1082 sprintf(
data,
"time1 = %-.3f ns, charge1 = %-.3f MeV",
time, charge );
1087 sprintf(
data,
"time2 = %-.3f ns, charge2 = %-.3f MeV",
time, charge );
1099 aScin->
AddInfo( aScin->GetTitle() );
1100 sprintf(
data,
"time1 = %-.3f ns, charge1 = %-.3f MeV",
time, charge );
1105 sprintf(
data,
"time2 = %-.3f ns, charge2 = %-.3f MeV",
time, charge );
1135 if ( gPad ) view =
dynamic_cast<BesView*
>( gPad->GetView() );
1141 phyNode->SetVisibility( 0 );
1144 int part =
GetPart( phyNode );
1147 phyNode->SetVisibility( 1 );
1154 if ( gPad ) view =
dynamic_cast<BesView*
>( gPad->GetView() );
1156 for (
int i = 0; i <
m_HitsArray->GetEntries(); i++ )
1158 TGeoPhysicalNode* phyNode = (TGeoPhysicalNode*)
m_HitsArray->At( i );
1161 int part =
GetPart( phyNode );
1168 phyNode->SetVisibility( 1 );
1169 phyNode->SetLineColor( 801 );
1175 if ( part > -1 ) phyNode->SetLineColor( m_ScinColor );
1187 if ( part == 1 )
return m_kScinBr;
1190 if ( fTofMrpc )
return m_kStripEc;
1198 if ( part == 1 )
return m_kLayerBr;
1201 if ( fTofMrpc )
return m_kModuleEc;
1233 std::stringstream osname;
1234 if ( part == 1 ) { osname <<
"logicalBrTof"; }
1235 else if ( part == 0 ) { osname <<
"logicalEcTofWest"; }
1236 else { osname <<
"logicalEcTofEast"; }
1241 std::stringstream osname;
1247 else if ( part == 2 )
1257 <<
"PVFBr" << layer + 1;
1264 std::stringstream osname;
1270 else if ( part == 2 )
1280 <<
"AlBr" << layer + 1;
1287 std::stringstream osname;
1293 else if ( part == 2 )
1303 <<
"ScinBr" << layer + 1;
1310 std::stringstream osname;
1311 if ( part == 0 || part == 2 )
1321 <<
"BucketBr" << layer + 1;
1328 if ( m_NodePVF[part][layer][scin] != 0 ) {
return m_NodePVF[part][layer][scin]; }
1331 std::cout <<
"Node: "
1332 <<
"Part" << part <<
"Layer" << layer <<
"PVF" << scin <<
" not found"
1336 return m_NodePVF[part][layer][scin];
1340 if ( m_NodeAl[part][layer] != 0 ) {
return m_NodeAl[part][layer]; }
1343 std::cout <<
"Node: "
1344 <<
"Part" << part <<
"Layer" << layer <<
"Al"
1345 <<
" not found" << std::endl;
1348 return m_NodeAl[part][layer];
1352 if ( m_NodeScin[part][layer] != 0 ) {
return m_NodeScin[part][layer]; }
1355 std::cout <<
"Node: "
1356 <<
"Part" << part <<
"Layer" << layer <<
"Scin"
1357 <<
" not found" << std::endl;
1360 return m_NodeScin[part][layer];
1365 if ( m_NodeModule[part][module] != 0 ) {
return m_NodeModule[part][module]; }
1368 std::cout <<
"Node: "
1369 <<
"Part" << part <<
"Module" << module <<
" not found" << std::endl;
1372 return m_NodeModule[part][module];
1376 if ( m_NodegasContainer[part][module] != 0 ) {
return m_NodegasContainer[part][module]; }
1379 std::cout <<
"Node: "
1380 <<
"Part" << part <<
"Module" << module <<
"gasContainer"
1381 <<
" not found" << std::endl;
1385 return m_NodegasContainer[part][module];
1389 if ( m_NodebareChamber[part][module] != 0 ) {
return m_NodebareChamber[part][module]; }
1392 std::cout <<
"Node: "
1393 <<
"Part" << part <<
"Module" << module <<
"bareChamber"
1394 <<
" not found" << std::endl;
1398 return m_NodebareChamber[part][module];
1402 if ( m_NodepcbBoard1[part][module] != 0 ) {
return m_NodepcbBoard1[part][module]; }
1405 std::cout <<
"Node: "
1406 <<
"Part" << part <<
"Module" << module <<
"pcbBoard1"
1407 <<
" not found" << std::endl;
1411 return m_NodepcbBoard1[part][module];
1415 if ( m_NodeStrip[part][module][strip] != 0 ) {
return m_NodeStrip[part][module][strip]; }
1418 std::cout <<
"Node: "
1419 <<
"Part" << part <<
"Module" << module <<
"Strip" << strip <<
" not found"
1424 return m_NodeStrip[part][module][strip];
1448 if ( m_PhysicalScin[part][layer][scin] != 0 ) {
return m_PhysicalScin[part][layer][scin]; }
1451 std::cout <<
"PhysicalNode: "
1452 <<
"Part" << part <<
"Layer" << layer <<
"Scin" << scin <<
" not found"
1459 if ( m_Tof2DScin[part][layer][scin] )
return m_Tof2DScin[part][layer][scin];
1464 for ( Int_t part = 0; part < m_kPart; part++ )
1466 for ( Int_t layer = 0; layer <
GetLayerNb( part ); layer++ )
1468 for (
int scin = 0; scin <
GetScinNb( part ); scin++ )
1478 cout <<
"TofROOTGeo::GetPart, this scintillator physical node does not exist!" << endl;
1483 TString opt = option;
1486 if ( !
m_2DGeoInit ) cout <<
"TofROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
1488 if ( !view ) cout <<
"TofROOTGeo::Draw(), BesView not found" << endl;
1496 for ( Int_t part = m_kPart - 1; part >= 0; part-- )
1498 for ( Int_t layer = 0; layer <
GetLayerNb( part ); layer++ )
1500 for (
int scin = 0; scin <
GetScinNb( part ); scin++ )
1502 if ( m_Tof2DScin[part][layer][scin] )
1506 m_Tof2DScin[part][layer][scin]->SetFired(
false );
1510 m_Tof2DScin[part][layer][scin]->Draw( scinOpt );
1521 if ( !view ) cout <<
"TofROOTGeo::DrawHits(), BesView not found" << endl;
1537 if ( ( k_TMatch ) && ( aScin->
GetTimeChannel() == 0x7FFFFFFF ) )
continue;
1538 if ( ( k_QMatch ) && ( aScin->
GetChargeChannel() == 0x7FFFFFFF ) )
continue;
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)
R__EXTERN BesEvent * gEvent
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;.
TObjArray * m_2DHitsArray
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
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;.