BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
TofROOTGeo Class Reference

#include <TofROOTGeo.h>

+ Inheritance diagram for TofROOTGeo:

Public Member Functions

 TofROOTGeo ()
 Constructor.
 
 ~TofROOTGeo ()
 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 GetScinNb (int part)
 Get number of scintillators on each part;.
 
TGeoVolume * GetVolumeTof ()
 Get Tof volume;.
 
TGeoVolumeAssembly * GetVolumeAssembly (int part)
 Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;

 
TGeoVolume * GetVolumeScin (int part)
 Get scintillator volume;.
 
TGeoVolume * GetVolumeBucket (int part)
 Get bucket volume;.
 
TGeoNode * GetScin (int part, int scin)
 Get scintillator node;.
 
TGeoNode * GetBucket (int part, int scin, int bucket)
 Get bucket node, 0 for west bucket, 1 for the east one;.
 
TGeoPhysicalNode * GetPhysicalScin (int part, int scin)
 Get scintillator physical node;.
 
 TofROOTGeo ()
 Constructor.
 
 ~TofROOTGeo ()
 Destructor.
 
void InitFromGDML (const char *gdmlFile, const char *setupName)
 Initialize ROOTGeo from GDML.
 
void InitFromROOT (TGeoVolume *vol)
 Initialize ROOTGeo from TGeoVolume logicalTof.
 
void Init2DGeometry ()
 Initialize 2D Geometry.
 
void SetNode ()
 Set the pointers to theirs nodes;.
 
void SetVolumeDefaultVis ()
 Set default visual attributes;.
 
void SetAllVisible ()
 Set all visible;.
 
void SetTMatch (Bool_t input)
 
void SetQMatch (Bool_t input)
 
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 SetDetector ()
 Draw Detecor (what is detector depends on you)
 
void SetHits ()
 Set all physicalNodes corresponding to digiCol;.
 
void SetVisTofDetector ()
 Set Tof detector visibility;.
 
void SetVisTofHits ()
 Set Tof hits visibility;.
 
int GetPartNb ()
 Get number of part;.
 
int GetScinNb (int part)
 Get number of scintillators on each part;.
 
int GetLayerNb (int part)
 
void SetVolumeTof (TGeoVolume *vol)
 Set Tof volume, while initializing from ROOT;.
 
TGeoVolume * GetVolumeTof ()
 Get Tof volume;.
 
TGeoVolume * GetVolumePart (int part)
 Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;

 
TGeoVolume * GetVolumePVF (int part, int layer)
 Get PVF volume;.
 
TGeoVolume * GetVolumeAl (int part, int layer)
 Get Al volume;.
 
TGeoVolume * GetVolumeScin (int part, int layer)
 Get scintillator volume;.
 
TGeoVolume * GetVolumeBucket (int part, int layer)
 Get bucket volume;.
 
TGeoNode * GetPVF (int part, int layer, int scin)
 Get PVF node;.
 
TGeoNode * GetAl (int part, int layer)
 Get Al node;.
 
TGeoNode * GetScin (int part, int layer)
 Get scintillator node;.
 
TGeoPhysicalNode * GetPhysicalScin (int part, int layer, int scin)
 Get bucket node, 0 for west bucket, 1 for the east one;.
 
Tof2DScinGet2DScin (Int_t part, Int_t layer, Int_t scin)
 Get Tof2DScin;.
 
Int_t GetPart (TGeoPhysicalNode *phyNode)
 Get part no of a scintillator physcial node.
 
void Draw (Option_t *option)
 Draw function.
 
void DrawHits (Option_t *option)
 Draw 2D hits.
 
 TofROOTGeo ()
 Constructor.
 
 ~TofROOTGeo ()
 Destructor.
 
void InitFromGDML (const char *gdmlFile, const char *setupName)
 Initialize ROOTGeo from GDML.
 
void InitFromROOT (TGeoVolume *vol)
 Initialize ROOTGeo from TGeoVolume logicalTof.
 
void Init2DGeometry ()
 Initialize 2D Geometry.
 
void SetNode ()
 Set the pointers to theirs nodes;.
 
void SetVolumeDefaultVis ()
 Set default visual attributes;.
 
void SetAllVisible ()
 Set all visible;.
 
void SetTMatch (Bool_t input)
 
void SetQMatch (Bool_t input)
 
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 SetDetector ()
 Draw Detecor (what is detector depends on you)
 
void SetHits ()
 Set all physicalNodes corresponding to digiCol;.
 
void SetVisTofDetector ()
 Set Tof detector visibility;.
 
void SetVisTofHits ()
 Set Tof hits visibility;.
 
int GetPartNb ()
 Get number of part;.
 
int GetScinNb (int part)
 Get number of scintillators on each part;.
 
int GetLayerNb (int part)
 
void SetVolumeTof (TGeoVolume *vol)
 Set Tof volume, while initializing from ROOT;.
 
TGeoVolume * GetVolumeTof ()
 Get Tof volume;.
 
TGeoVolume * GetVolumePart (int part)
 Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;

 
TGeoVolume * GetVolumePVF (int part, int layer)
 Get PVF volume;.
 
TGeoVolume * GetVolumeAl (int part, int layer)
 Get Al volume;.
 
TGeoVolume * GetVolumeScin (int part, int layer)
 Get scintillator volume;.
 
TGeoVolume * GetVolumeBucket (int part, int layer)
 Get bucket volume;.
 
TGeoNode * GetPVF (int part, int layer, int scin)
 Get PVF node;.
 
TGeoNode * GetAl (int part, int layer)
 Get Al node;.
 
TGeoNode * GetScin (int part, int layer)
 Get scintillator node;.
 
TGeoPhysicalNode * GetPhysicalScin (int part, int layer, int scin)
 Get bucket node, 0 for west bucket, 1 for the east one;.
 
Tof2DScinGet2DScin (Int_t part, Int_t layer, Int_t scin)
 Get Tof2DScin;.
 
Int_t GetPart (TGeoPhysicalNode *phyNode)
 Get part no of a scintillator physcial node.
 
void Draw (Option_t *option)
 Draw function.
 
void DrawHits (Option_t *option)
 Draw 2D hits.
 
 TofROOTGeo ()
 Constructor.
 
 ~TofROOTGeo ()
 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 GetScinNb (int part)
 Get number of scintillators on each part;.
 
TGeoVolume * GetVolumeTof ()
 Get Tof volume;.
 
TGeoVolumeAssembly * GetVolumeAssembly (int part)
 Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;

 
TGeoVolume * GetVolumeScin (int part)
 Get scintillator volume;.
 
TGeoVolume * GetVolumeBucket (int part)
 Get bucket volume;.
 
TGeoNode * GetScin (int part, int scin)
 Get scintillator node;.
 
TGeoNode * GetBucket (int part, int scin, int bucket)
 Get bucket node, 0 for west bucket, 1 for the east one;.
 
TGeoPhysicalNode * GetPhysicalScin (int part, int scin)
 Get scintillator physical node;.
 
- 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;.
 
 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;.
 
 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;.
 

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 TofGeo contains all of the objects necessary to describe the tof geometry.

Author
Zhengyun You \URL{youzy.nosp@m.@hep.nosp@m..pku..nosp@m.cn}

Definition at line 27 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/ROOTGeo/TofROOTGeo.h.

Constructor & Destructor Documentation

◆ TofROOTGeo() [1/4]

TofROOTGeo::TofROOTGeo ( )

Constructor.

Definition at line 24 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

25{
26 // Default constructor.
27 for (int part = 0; part < m_kPart; part++) {
28 for (int scin = 0; scin < m_kAssemblyBr; scin++) {
29 m_NodeScin[part][scin] = 0;
30 m_PhysicalScin[part][scin] = 0;
31 }
32 }
33}

◆ ~TofROOTGeo() [1/4]

TofROOTGeo::~TofROOTGeo ( )

Destructor.

Definition at line 35 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

36{ }

◆ TofROOTGeo() [2/4]

TofROOTGeo::TofROOTGeo ( )

Constructor.

◆ ~TofROOTGeo() [2/4]

TofROOTGeo::~TofROOTGeo ( )

Destructor.

◆ TofROOTGeo() [3/4]

TofROOTGeo::TofROOTGeo ( )

Constructor.

◆ ~TofROOTGeo() [3/4]

TofROOTGeo::~TofROOTGeo ( )

Destructor.

◆ TofROOTGeo() [4/4]

TofROOTGeo::TofROOTGeo ( )

Constructor.

◆ ~TofROOTGeo() [4/4]

TofROOTGeo::~TofROOTGeo ( )

Destructor.

Member Function Documentation

◆ Draw() [1/2]

void TofROOTGeo::Draw ( Option_t *  option)

Draw function.

Definition at line 788 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

789{
790 TString opt = option;
791 opt.ToUpper();
792
793 if (!m_2DGeoInit) cout << "TofROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
794 BesView *view = (BesView*)gPad->GetView();
795 if (!view) cout << "TofROOTGeo::Draw(), BesView not found" << endl;
796
797 if (view->GetVisTofGlobal()) { // TofVisGlobal
798 TString scinOpt;
799
800 //if (opt.Contains("XY")) {
801 // west part drawn first usually
802 for (Int_t part = m_kPart-1; part >= 0; part--) {
803 for (Int_t layer = 0; layer < GetLayerNb(part); layer++) {
804 for (int scin = 0; scin < GetScinNb(part); scin++) {
805
806 if (m_Tof2DScin[part][layer][scin]) {
807 //cout << "part " << part << " layer " << layer << " scin " << scin << endl;
808 //m_Tof2DScin[part][layer][scin]->SetHighlighted(false);
809 m_Tof2DScin[part][layer][scin]->SetFired(false);
810 if ( (part == 0 && view->GetVisTofEast()) ||
811 (part == 1 && view->GetVisTofBarrel()) ||
812 (part == 2 && view->GetVisTofWest()) )
813 m_Tof2DScin[part][layer][scin]->Draw(scinOpt);
814 }
815 }
816 }
817 }
818 }
819 }
virtual void Draw(Option_t *option="")
Definition: Tof2DScin.cxx:197
int GetScinNb(int part)
Get number of scintillators on each part;.

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

◆ Draw() [2/2]

void TofROOTGeo::Draw ( Option_t *  option)

Draw function.

◆ DrawHits() [1/2]

void TofROOTGeo::DrawHits ( Option_t *  option)

Draw 2D hits.

Definition at line 822 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

823 {
824 // cout << "Draw Hits" << endl;
825 BesView *view = (BesView*)gPad->GetView();
826 if (!view) cout << "TofROOTGeo::DrawHits(), BesView not found" << endl;
827
828 //cout << "VisTofHitsGlobal " << view->GetVisTofHitsGlobal() << endl;
829 //cout << "VisTofHitsEast " << view->GetVisTofHitsEast() << endl;
830 //cout << "VisTofHitsBarrel " << view->GetVisTofHitsBarrel() << endl;
831 //cout << "VisTofHitsWest " << view->GetVisTofHitsWest() << endl;
832
833 if (view->GetVisTofHitsGlobal()) {
834
835 // reset time and charge to zero
836 for (Int_t part = m_kPart-1; part >= 0; part--) {
837 for (Int_t layer = 0; layer < GetLayerNb(part); layer++) {
838 for (int scin = 0; scin < GetScinNb(part); scin++) {
839 if (m_Tof2DScin[part][layer][scin]) {
840 m_Tof2DScin[part][layer][scin]->ResetTimeCharge();
841 }
842 }
843 }
844 }
845
846 if (m_TofDigiCol) {
847 for (int i = 0; i < m_TofDigiCol->GetEntries(); i++) {
848 TTofDigi *aTofDigi = (TTofDigi*)m_TofDigiCol->At(i);
849
850 Identifier aTofID( aTofDigi->getIntId() );
851 int part = TofID::barrel_ec( aTofID );
852 int layer = TofID::layer( aTofID );
853 int scin = TofID::phi_module( aTofID );
854
855 Double_t charge = Double_t(aTofDigi->getChargeChannel()) / TOF_CHARGE_FACTOR;
856 //cout << "charge " << charge << endl;
857
858 Tof2DScin *aScin = 0;
859 aScin = m_Tof2DScin[part][layer][scin];
860 // Mdc TQMatch for example
861 //
862 //if (aWire &&
863 // ((overflow == 0)||(overflow == 12))){
864 // if ((k_TMatch) &&
865 // (aMdcDigi->getTimeChannel() == 0x7FFFFFFF)){
866 // continue;
867 // }
868 // if ((k_QMatch) &&
869 // (aMdcDigi->getChargeChannel() == 0x7FFFFFFF)){
870 // continue;
871 // }
872 //}
873
874 if (aScin) {
875 if ((k_TMatch)&&
876 (aTofDigi->getTimeChannel() == 0x7FFFFFFF)){
877 continue;
878 }
879 if ((k_QMatch)&&
880 (aTofDigi->getChargeChannel() == 0x7FFFFFFF)){
881 continue;
882 }
883
884 aScin->SetCharge(aScin->GetCharge() + charge);
885
886 if ( (part == 0 && view->GetVisTofHitsEast()) ||
887 (part == 1 && view->GetVisTofHitsBarrel()) ||
888 (part == 2 && view->GetVisTofHitsWest()) ) {
889 aScin->SetFired(true);
890 aScin->Draw();
891 }
892 }
893 }
894 }
895 }
896 }
UInt_t getIntId() const
Definition: TRawData.cxx:50
UInt_t getChargeChannel() const
Definition: TRawData.cxx:60
UInt_t getTimeChannel() const
Definition: TRawData.cxx:55
static int phi_module(const Identifier &id)
Definition: TofID.cxx:73
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
Definition: TofID.cxx:61
static int layer(const Identifier &id)
Definition: TofID.cxx:66

Referenced by BesEvent::DrawHits().

◆ DrawHits() [2/2]

void TofROOTGeo::DrawHits ( Option_t *  option)

Draw 2D hits.

◆ Get2DScin() [1/2]

Tof2DScin * TofROOTGeo::Get2DScin ( Int_t  part,
Int_t  layer,
Int_t  scin 
)

Get Tof2DScin;.

Definition at line 763 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

764{
765 if (m_Tof2DScin[part][layer][scin]) return m_Tof2DScin[part][layer][scin];
766 else return 0;
767}

Referenced by BesEvent::ConstructTofTrackFromRec().

◆ Get2DScin() [2/2]

Tof2DScin * TofROOTGeo::Get2DScin ( Int_t  part,
Int_t  layer,
Int_t  scin 
)

Get Tof2DScin;.

◆ GetAl() [1/2]

TGeoNode * TofROOTGeo::GetAl ( int  part,
int  layer 
)

Get Al node;.

Definition at line 701 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

702{
703 if (m_NodeAl[part][layer] != 0) {
704 return m_NodeAl[part][layer];
705 }
706 else {
707 std::cout << "Node: " << "Part" << part << "Layer" << layer << "Al" << " not found" << std::endl;
708 return 0;
709 }
710
711 return m_NodeAl[part][layer];
712}

◆ GetAl() [2/2]

TGeoNode * TofROOTGeo::GetAl ( int  part,
int  layer 
)

Get Al node;.

◆ GetBucket() [1/2]

TGeoNode * TofROOTGeo::GetBucket ( int  part,
int  scin,
int  bucket 
)

Get bucket node, 0 for west bucket, 1 for the east one;.

Definition at line 261 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

262{
263 std::stringstream osname;
264 if (part == 0) {
265 osname << "pv_" << "logical" << "Tof" << "BucketEc" << "_" << m_kAssemblyBr + m_kAssemblyEc + scin << "_1";
266 }
267 else if (part == 1) {
268 osname << "pv_" << "logical" << "Tof" << "BucketBr" << "_" << scin << "_" << bucket+1;
269 }
270 else if (part == 2) {
271 osname << "pv_" << "logical" << "Tof" << "BucketEc" << "_" << m_kAssemblyBr + scin << "_1";
272 }
273
274 return GetNode( osname.str() );
275}
TGeoNode * GetNode(const std::string &nn)
Get a node(physical volume) by name;.

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

◆ GetBucket() [2/2]

TGeoNode * TofROOTGeo::GetBucket ( int  part,
int  scin,
int  bucket 
)

Get bucket node, 0 for west bucket, 1 for the east one;.

◆ GetLayerNb() [1/2]

int TofROOTGeo::GetLayerNb ( int  part)

Definition at line 568 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

569{
570 int nLayer = m_kLayerBr;
571 if (part != 1) nLayer = m_kLayerEc;
572 return nLayer;
573}

Referenced by Draw(), DrawHits(), GetPart(), Init2DGeometry(), SetDetector(), and SetVolumeDefaultVis().

◆ GetLayerNb() [2/2]

int TofROOTGeo::GetLayerNb ( int  part)

◆ GetPart() [1/2]

Int_t TofROOTGeo::GetPart ( TGeoPhysicalNode *  phyNode)

Get part no of a scintillator physcial node.

Definition at line 770 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

771{
772 for (Int_t part = 0; part < m_kPart; part++) {
773 for (Int_t layer = 0; layer < GetLayerNb(part); layer++) {
774 for (int scin = 0; scin < GetScinNb(part); scin++) {
775 if (phyNode == GetPhysicalScin(part, layer, scin)) {
776 //cout << "GetPart()" << part << endl;
777 return part;
778 }
779 }
780 }
781 }
782
783 cout << "TofROOTGeo::GetPart, this scintillator physical node does not exist!" << endl;
784 return -1;
785}
TGeoPhysicalNode * GetPhysicalScin(int part, int scin)
Get scintillator physical node;.

Referenced by SetVisTofDetector(), and SetVisTofHits().

◆ GetPart() [2/2]

Int_t TofROOTGeo::GetPart ( TGeoPhysicalNode *  phyNode)

Get part no of a scintillator physcial node.

◆ GetPartNb() [1/4]

int TofROOTGeo::GetPartNb ( )

Get number of part;.

Definition at line 184 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

185{
186 int nPart = m_kPart;
187 return nPart;
188}

◆ GetPartNb() [2/4]

int TofROOTGeo::GetPartNb ( )

Get number of part;.

◆ GetPartNb() [3/4]

int TofROOTGeo::GetPartNb ( )

Get number of part;.

◆ GetPartNb() [4/4]

int TofROOTGeo::GetPartNb ( )

Get number of part;.

◆ GetPhysicalScin() [1/4]

TGeoPhysicalNode * TofROOTGeo::GetPhysicalScin ( int  part,
int  layer,
int  scin 
)

Get bucket node, 0 for west bucket, 1 for the east one;.

Get scintillator physical node;

Definition at line 749 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

750{
751 if (m_PhysicalScin[part][layer][scin] != 0) {
752 return m_PhysicalScin[part][layer][scin];
753 }
754 else {
755 std::cout << "PhysicalNode: " << "Part"
756 << part << "Layer" << layer << "Scin"
757 << scin << " not found" << std::endl;
758 return 0;
759 }
760}

◆ GetPhysicalScin() [2/4]

TGeoPhysicalNode * TofROOTGeo::GetPhysicalScin ( int  part,
int  layer,
int  scin 
)

Get bucket node, 0 for west bucket, 1 for the east one;.

Get scintillator physical node;

◆ GetPhysicalScin() [3/4]

TGeoPhysicalNode * TofROOTGeo::GetPhysicalScin ( int  part,
int  scin 
)

Get scintillator physical node;.

Definition at line 278 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

279{
280 if (m_PhysicalScin[part][scin] != 0) {
281 return m_PhysicalScin[part][scin];
282 }
283 else {
284 std::cout << "PhysicalNode: " << "Part" << part << "Scin" << scin << " not found" << std::endl;
285 return 0;
286 }
287}

Referenced by BesEvent::ConstructTofTrackFromRec(), GetPart(), BesGeometry::GetPhysicalTofScin(), Init2DGeometry(), SetDetector(), SetHits(), and BesVisDisplay::SetTofFiredCell().

◆ GetPhysicalScin() [4/4]

TGeoPhysicalNode * TofROOTGeo::GetPhysicalScin ( int  part,
int  scin 
)

Get scintillator physical node;.

◆ GetPVF() [1/2]

TGeoNode * TofROOTGeo::GetPVF ( int  part,
int  layer,
int  scin 
)

Get PVF node;.

Definition at line 687 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

688{
689 if (m_NodePVF[part][layer][scin] != 0) {
690 return m_NodePVF[part][layer][scin];
691 }
692 else {
693 std::cout << "Node: " << "Part" << part << "Layer" << layer << "PVF" << scin << " not found" << std::endl;
694 return 0;
695 }
696
697 return m_NodePVF[part][layer][scin];
698}

◆ GetPVF() [2/2]

TGeoNode * TofROOTGeo::GetPVF ( int  part,
int  layer,
int  scin 
)

Get PVF node;.

◆ GetScin() [1/4]

TGeoNode * TofROOTGeo::GetScin ( int  part,
int  layer 
)

Get scintillator node;.

◆ GetScin() [2/4]

TGeoNode * TofROOTGeo::GetScin ( int  part,
int  layer 
)

Get scintillator node;.

◆ GetScin() [3/4]

TGeoNode * TofROOTGeo::GetScin ( int  part,
int  scin 
)

Get scintillator node;.

Definition at line 247 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

248{
249 if (m_NodeScin[part][scin] != 0) {
250 return m_NodeScin[part][scin];
251 }
252 else {
253 std::cout << "Node: " << "Part" << part << "Scin" << scin << " not found" << std::endl;
254 return 0;
255 }
256
257 return m_NodeScin[part][scin];
258}

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

◆ GetScin() [4/4]

TGeoNode * TofROOTGeo::GetScin ( int  part,
int  scin 
)

Get scintillator node;.

◆ GetScinNb() [1/4]

int TofROOTGeo::GetScinNb ( int  part)

Get number of scintillators on each part;.

Definition at line 191 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

192{
193 int nScin = m_kAssemblyBr;
194 if (part != 1) nScin = m_kAssemblyEc;
195 return nScin;
196}

Referenced by Draw(), DrawHits(), GetPart(), Init2DGeometry(), and SetDetector().

◆ GetScinNb() [2/4]

int TofROOTGeo::GetScinNb ( int  part)

Get number of scintillators on each part;.

◆ GetScinNb() [3/4]

int TofROOTGeo::GetScinNb ( int  part)

Get number of scintillators on each part;.

◆ GetScinNb() [4/4]

int TofROOTGeo::GetScinNb ( int  part)

Get number of scintillators on each part;.

◆ GetVolumeAl() [1/2]

TGeoVolume * TofROOTGeo::GetVolumeAl ( int  part,
int  layer 
)

Get Al volume;.

Definition at line 633 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

634{
635 std::stringstream osname;
636 if (part == 0) {
637 osname << "logical" << "AlEcEast";
638 }
639 else if (part == 2){
640 osname << "logical" << "AlEcWest";
641 }
642 else {
643 if (part == 1) {
644 osname << "logical" << "AlBr" << layer+1;
645 }
646 }
647
648 return GetLogicalVolume( osname.str() );
649}
TGeoVolume * GetLogicalVolume(const std::string &vn)
Get a logical volume by name;.

Referenced by SetVolumeDefaultVis().

◆ GetVolumeAl() [2/2]

TGeoVolume * TofROOTGeo::GetVolumeAl ( int  part,
int  layer 
)

Get Al volume;.

◆ GetVolumeAssembly() [1/2]

TGeoVolumeAssembly * TofROOTGeo::GetVolumeAssembly ( int  part)

Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;

Definition at line 199 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

200{
201 std::stringstream osname;
202 if (part == 0 || part == 2) {
203 osname << "logical" << "Tof" << "AssemblyEc";
204 }
205 else {
206 if (part == 1) {
207 osname << "logical" << "Tof" << "AssemblyBr";
208 }
209 }
210
211 return GetAssemblyVolume( osname.str() );
212}
TGeoVolumeAssembly * GetAssemblyVolume(const std::string &an)
Get an assembly by name;.

◆ GetVolumeAssembly() [2/2]

TGeoVolumeAssembly * TofROOTGeo::GetVolumeAssembly ( int  part)

Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;

◆ GetVolumeBucket() [1/4]

TGeoVolume * TofROOTGeo::GetVolumeBucket ( int  part)

Get bucket volume;.

Definition at line 231 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

232{
233 std::stringstream osname;
234 if (part == 0 || part == 2) {
235 osname << "logical" << "Tof" << "BucketEc";
236 }
237 else {
238 if (part == 1) {
239 osname << "logical" << "Tof" << "BucketBr";
240 }
241 }
242
243 return GetLogicalVolume( osname.str() );
244}

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

◆ GetVolumeBucket() [2/4]

TGeoVolume * TofROOTGeo::GetVolumeBucket ( int  part)

Get bucket volume;.

◆ GetVolumeBucket() [3/4]

TGeoVolume * TofROOTGeo::GetVolumeBucket ( int  part,
int  layer 
)

Get bucket volume;.

Definition at line 671 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

672{
673 std::stringstream osname;
674 if (part == 0 || part == 2) {
675 osname << "logical" << "BucketEc";
676 }
677 else {
678 if (part == 1) {
679 osname << "logical" << "BucketBr" << layer+1;
680 }
681 }
682
683 return GetLogicalVolume( osname.str() );
684}

◆ GetVolumeBucket() [4/4]

TGeoVolume * TofROOTGeo::GetVolumeBucket ( int  part,
int  layer 
)

Get bucket volume;.

◆ GetVolumePart() [1/2]

TGeoVolume * TofROOTGeo::GetVolumePart ( int  part)

Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;

Get part volume;

Definition at line 594 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

595{
596 std::stringstream osname;
597 if (part == 1) {
598 osname << "logicalBrTof";
599 }
600 else if (part == 0){
601 osname << "logicalEcTofWest";
602 }
603 else {
604 osname << "logicalEcTofEast";
605 }
606
607 return GetLogicalVolume( osname.str() );
608
609
610
611}

Referenced by SetVolumeDefaultVis().

◆ GetVolumePart() [2/2]

TGeoVolume * TofROOTGeo::GetVolumePart ( int  part)

Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;

Get part volume;

◆ GetVolumePVF() [1/2]

TGeoVolume * TofROOTGeo::GetVolumePVF ( int  part,
int  layer 
)

Get PVF volume;.

Definition at line 614 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

615{
616 std::stringstream osname;
617 if (part == 0) {
618 osname << "logical" << "PVFEcEast";
619 }
620 else if (part == 2){
621 osname << "logical" << "PVFEcWest";
622 }
623 else {
624 if (part == 1) {
625 osname << "logical" << "PVFBr" << layer+1;
626 }
627 }
628
629 return GetLogicalVolume( osname.str() );
630}

Referenced by SetVolumeDefaultVis().

◆ GetVolumePVF() [2/2]

TGeoVolume * TofROOTGeo::GetVolumePVF ( int  part,
int  layer 
)

Get PVF volume;.

◆ GetVolumeScin() [1/4]

TGeoVolume * TofROOTGeo::GetVolumeScin ( int  part)

Get scintillator volume;.

Definition at line 215 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

216{
217 std::stringstream osname;
218 if (part == 0 || part == 2) {
219 osname << "logical" << "Tof" << "ScinEc";
220 }
221 else {
222 if (part == 1) {
223 osname << "logical" << "Tof" << "ScinBr";
224 }
225 }
226
227 return GetLogicalVolume( osname.str() );
228}

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

◆ GetVolumeScin() [2/4]

TGeoVolume * TofROOTGeo::GetVolumeScin ( int  part)

Get scintillator volume;.

◆ GetVolumeScin() [3/4]

TGeoVolume * TofROOTGeo::GetVolumeScin ( int  part,
int  layer 
)

Get scintillator volume;.

Definition at line 652 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

653{
654 std::stringstream osname;
655 if (part == 0) {
656 osname << "logical" << "ScinEcEast";
657 }
658 else if (part == 2){
659 osname << "logical" << "ScinEcWest";
660 }
661 else {
662 if (part == 1) {
663 osname << "logical" << "ScinBr" << layer+1;
664 }
665 }
666
667 return GetLogicalVolume( osname.str() );
668}

◆ GetVolumeScin() [4/4]

TGeoVolume * TofROOTGeo::GetVolumeScin ( int  part,
int  layer 
)

Get scintillator volume;.

◆ GetVolumeTof() [1/4]

TGeoVolume * TofROOTGeo::GetVolumeTof ( )
inline

Get Tof volume;.

Definition at line 62 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/ROOTGeo/TofROOTGeo.h.

62{ return m_Tof; }

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

◆ GetVolumeTof() [2/4]

TGeoVolume * TofROOTGeo::GetVolumeTof ( )
inline

Get Tof volume;.

Definition at line 96 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/BesVisLib/TofROOTGeo.h.

96{ return m_Tof; }

◆ GetVolumeTof() [3/4]

TGeoVolume * TofROOTGeo::GetVolumeTof ( )
inline

Get Tof volume;.

Definition at line 96 of file InstallArea/include/BesVisLib/BesVisLib/TofROOTGeo.h.

96{ return m_Tof; }

◆ GetVolumeTof() [4/4]

TGeoVolume * TofROOTGeo::GetVolumeTof ( )
inline

Get Tof volume;.

Definition at line 62 of file InstallArea/include/ROOTGeo/ROOTGeo/TofROOTGeo.h.

62{ return m_Tof; }

◆ Init2DGeometry() [1/2]

void TofROOTGeo::Init2DGeometry ( )

Initialize 2D Geometry.

Definition at line 77 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

78{
79 if (m_ROOTGeoInit != 1 && m_ROOTGeoInit != 2) {
80 cout << "TofROOTGeo::Init2DGeometry, ROOT Geometry not Initialized yet!" << endl;
81 return;
82 }
83 m_2DGeoInit = 1;
84
85 Double_t local[3] = {0.0, 0.0, 0.0};
86 Double_t master[3] = {0.0, 0.0, 0.0};
87 //Int_t nPoints = 8;
88 //Double_t P[300] = {0.0};
89 //Double_t center[3] = {0.0, 0.0, 0.0};
90 TString name;
91
92 // Tof Scintillators
93 for (Int_t part = 0; part < m_kPart; part++) {
94 for (Int_t layer = 0; layer < GetLayerNb(part); layer++) {
95 for (int scin = 0; scin < GetScinNb(part); scin++) {
96 TGeoPhysicalNode *scinPhyNode = GetPhysicalScin(part, layer, scin);
97 if (part == 1) {
98 name = TString("Tof Part 1");
99 name += " Layer ";
100 name += layer;
101 name += " Phi ";
102 name += scin;
103 }
104 else {
105 if (part == 0) name = TString("EastEc");
106 else if (part == 2) name = TString("WestEc");
107 name = TString("Tof Part ");
108 name += part;
109 name += " Phi ";
110 name += scin;
111 }
112 TGeoArb8 *scinShape = (TGeoArb8*)scinPhyNode->GetShape();
113 Double_t *localArb8Point, masterArb8Point[24];
114 localArb8Point = scinShape->GetVertices();
115
116 for (Int_t i = 0; i < 8; i++) {
117 local[0] = localArb8Point[2*i];
118 local[1] = localArb8Point[2*i+1];
119 if (i < 4) local[2] = scinShape->GetDz() * (-1.0);
120 else local[2] = scinShape->GetDz();
121
122 //cout << i << " local x: " << local[0] << " y: " << local[1] << " z: " << local[2] << endl;
123 scinPhyNode->GetMatrix(-1*scinPhyNode->GetLevel())->LocalToMaster(local, &master[0]); // transform to top
124 //cout << " master x: " << master[0] << " y: " << master[1] << " z: " << master[2] << endl;
125
126 for (Int_t j = 0; j < 3; j++) {
127 masterArb8Point[3*i+j] = master[j];
128 }
129 }
130
131 m_Tof2DScin[part][layer][scin] = new Tof2DScin(name, name, 8, &masterArb8Point[0], part);
132 }
133 }
134 }
135}

Referenced by BesGeometry::InitGeometry().

◆ Init2DGeometry() [2/2]

void TofROOTGeo::Init2DGeometry ( )

Initialize 2D Geometry.

◆ InitFromGdml() [1/2]

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

Initialize the instance of ROOTGeo.

Definition at line 39 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

40{
41 ReadGdml(gdmlFile, setupName);
42 SetNode();
44
45 m_ROOTGeoInit = 1;
46}
void ReadGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of ROOTGeo.
void SetDefaultVis()
Set default visual attributes;.
void SetNode()
Set the pointers to theirs nodes;.

◆ InitFromGDML() [1/2]

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

Initialize ROOTGeo from GDML.

Definition at line 59 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

60{
61 m_ROOTGeoInit = 2;
62
63 ReadGdml(gdmlFile, setupName);
64 SetNode();
65}

Referenced by BesGeometry::InitFromGDML().

◆ InitFromGDML() [2/2]

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

Initialize ROOTGeo from GDML.

◆ InitFromGdml() [2/2]

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

Initialize the instance of ROOTGeo.

◆ InitFromROOT() [1/2]

void TofROOTGeo::InitFromROOT ( TGeoVolume *  vol)

Initialize ROOTGeo from TGeoVolume logicalTof.

Definition at line 68 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

69{
70 m_ROOTGeoInit = 1;
71
72 SetVolumeTof(vol);
73 SetNode();
74}
void SetVolumeTof(TGeoVolume *vol)
Set Tof volume, while initializing from ROOT;.

Referenced by BesGeometry::InitFromROOT().

◆ InitFromROOT() [2/2]

void TofROOTGeo::InitFromROOT ( TGeoVolume *  vol)

Initialize ROOTGeo from TGeoVolume logicalTof.

◆ SetAllVisible() [1/4]

void TofROOTGeo::SetAllVisible ( )

Set all visible;.

Definition at line 110 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

111{
112 for (int part = 0; part < m_kPart; part++) {
113 GetVolumeScin(part)->SetVisibility(1);
114 GetVolumeBucket(part)->SetVisibility(1);
115
116 int nScin = 0;
117 if (part == 1) nScin = m_kAssemblyBr;
118 else nScin = m_kAssemblyEc;
119 for (int scin = 0; scin < nScin; scin++) {
120 GetScin(part, scin)->SetVisibility(1);
121
122 int nBucket = 0;
123 if (part == 1) nBucket = m_kBucketBr;
124 else nBucket = m_kBucketEc;
125 for (int bucket = 0; bucket < nBucket; bucket++) {
126 GetBucket(part, scin, bucket)->SetVisibility(1);
127 }
128 }
129 }
130}
TGeoVolume * GetVolumeScin(int part)
Get scintillator volume;.
TGeoVolume * GetVolumeBucket(int part)
Get bucket volume;.
TGeoNode * GetScin(int part, int scin)
Get scintillator node;.
TGeoNode * GetBucket(int part, int scin, int bucket)
Get bucket node, 0 for west bucket, 1 for the east one;.

Referenced by BesGeometry::SetDefaultVis().

◆ SetAllVisible() [2/4]

void TofROOTGeo::SetAllVisible ( )

Set all visible;.

◆ SetAllVisible() [3/4]

void TofROOTGeo::SetAllVisible ( )

Set all visible;.

◆ SetAllVisible() [4/4]

void TofROOTGeo::SetAllVisible ( )

Set all visible;.

◆ SetDefaultVis() [1/2]

void TofROOTGeo::SetDefaultVis ( )

Set default visual attributes;.

Definition at line 76 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

77{
78 //std::cout << "begin of set defaultvis" << std::endl;
79 int tofColor = 2;
80 int scinColor = 6;
81 int bucketColor = 4;
82
83 m_Tof->SetLineColor(tofColor);
84 m_Tof->SetVisibility(0);
85
86 for (int part = 0; part < m_kPart; part++) {
87 GetVolumeScin(part)->SetLineColor(scinColor);
88 GetVolumeScin(part)->SetVisibility(1);
89 GetVolumeBucket(part)->SetLineColor(bucketColor);
90 GetVolumeBucket(part)->SetVisibility(0);
91
92 int nScin = 0;
93 if (part == 1) nScin = m_kAssemblyBr;
94 else nScin = m_kAssemblyEc;
95 for (int scin = 0; scin < nScin; scin++) {
96 GetScin(part, scin)->SetVisibility(0);
97
98 int nBucket = 0;
99 if (part == 1) nBucket = m_kBucketBr;
100 else nBucket = m_kBucketEc;
101 for (int bucket = 0; bucket < nBucket; bucket++) {
102 GetBucket(part, scin, bucket)->SetVisibility(0);
103 }
104 }
105 }
106 //std::cout << "end of set defaultvis" << std::endl;
107}

Referenced by InitFromGdml().

◆ SetDefaultVis() [2/2]

void TofROOTGeo::SetDefaultVis ( )

Set default visual attributes;.

◆ SetDetector() [1/2]

void TofROOTGeo::SetDetector ( )

Draw Detecor (what is detector depends on you)

Definition at line 399 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

400{
401 BesView *view = 0;
402 if (gPad) view = (BesView*)gPad->GetView();
403 //if (view) cout << "viewVisFull3DTof " << view->GetVisFull3DTof() << endl;
404
405 m_DetectorsArray->Clear();
406 for (int part = 0; part < m_kPart; part++) {
407 for (int layer = 0; layer < GetLayerNb(part); layer++) {
408 for (int scin = 0; scin < GetScinNb(part); scin++) {
409 TGeoPhysicalNode *phyNode = 0;
410 phyNode = GetPhysicalScin(part, layer, scin);
411 if (phyNode) {
412 phyNode->SetVisibility(0); // set all invisible before set any visible
413 if (part == 2 ||
414 (scin >= GetScinNb(part)*0/4 && scin < GetScinNb(part)*8/8)) {
415 m_DetectorsArray->Add( phyNode );
416 }
417 else if (view && view->GetVisFull3DTof()) {
418 m_DetectorsArray->Add( phyNode );
419 }
420 }
421 }
422 }
423 }
424}

Referenced by BesClient::HandleViewOptionMenu().

◆ SetDetector() [2/2]

void TofROOTGeo::SetDetector ( )

Draw Detecor (what is detector depends on you)

◆ SetHalfVisible() [1/2]

void TofROOTGeo::SetHalfVisible ( )

Set half visible;.

Definition at line 302 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

303{
304 /*
305 for (int part = 0; part < m_kPart; part++) {
306 GetVolumeScin(part)->SetVisibility(1);
307 GetVolumeBucket(part)->SetVisibility(1);
308
309 int nScin = 0;
310 if (part == 1) nScin = m_kAssemblyBr;
311 else nScin = m_kAssemblyEc;
312 for (int scin = 0; scin < nScin; scin++) {
313 if (scin < nScin/4+1 ||
314 scin > nScin*3/4 ) GetScin(part, scin)->SetVisibility(1);
315 else GetScin(part, scin)->SetVisibility(0);
316
317 int nBucket = 0;
318 if (part == 1) nBucket = m_kBucketBr;
319 else nBucket = m_kBucketEc;
320 for (int bucket = 0; bucket < nBucket; bucket++) {
321 if (scin < nScin/4+1 ||
322 scin > nScin*3/4 ) GetBucket(part, scin, bucket)->SetVisibility(1);
323 else GetBucket(part, scin, bucket)->SetVisibility(0);
324 }
325 }
326 }
327 */
328}

◆ SetHalfVisible() [2/2]

void TofROOTGeo::SetHalfVisible ( )

Set half visible;.

◆ SetHits() [1/2]

void TofROOTGeo::SetHits ( )

Set all physicalNodes corresponding to digiCol;.

Definition at line 427 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

428{
429 // set previous event hits to default vis
430 for (int i = 0; i < m_HitsArray->GetEntries(); i++) {
431 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_HitsArray->At(i);
432 if (phyNode){
433 //phyNode->SetLineColor(m_ScinColor);
434 phyNode->SetVisibility(0);
435 }
436 }
437 m_HitsArray->Clear("C");
438
439 // set previous event 2D hits info to default
440 for (int i = 0; i < m_2DHitsArray->GetEntries(); i++) {
441 Tof2DScin *aScin = (Tof2DScin*)m_2DHitsArray->At(i);
442 aScin->ClearInfo();
443 aScin->AddInfo(aScin->GetTitle());
444 aScin->CloseInfo();
445 aScin->ResetTimeCharge();
446 }
447 m_2DHitsArray->Clear("C");
448
449 if (gEvent) m_TofDigiCol = gEvent->GetTofDigiCol();
450
451 for (int i = 0; i < m_TofDigiCol->GetEntries(); i++) {
452 TTofDigi *aTofDigi = (TTofDigi*)m_TofDigiCol->At(i);
453
454 Identifier atofID( aTofDigi->getIntId() );
455 int part = TofID::barrel_ec( atofID );
456 int layer = TofID::layer( atofID );
457 int scin = TofID::phi_module( atofID );
458
459 //Double_t charge = Double_t(aTofDigi->getChargeChannel()) / TOF_CHARGE_FACTOR;
460 //Double_t time = Double_t(aTofDigi->getTimeChannel()) / TOF_TIME_FACTOR;
461
462 Double_t charge = RawDataUtil::TofCharge(aTofDigi->getChargeChannel());
463 Double_t time = RawDataUtil::TofTime(aTofDigi->getTimeChannel());
464
465 TGeoPhysicalNode *phyNode = 0;
466 phyNode = GetPhysicalScin( part, layer, scin );
467 if (phyNode) {
468 m_HitsArray->Add( phyNode );
469 }
470
471 Tof2DScin *aScin = 0;
472 aScin = m_Tof2DScin[part][layer][scin];
473 if (aScin) {
474 char data[100];
475
476 if (aScin->GetCharge() == 0.0) {
477 aScin->ClearInfo();
478 aScin->AddInfo(aScin->GetTitle());
479 sprintf(data, "time1 = %-.3f ns, charge1 = %-.3f MeV", time, charge);
480 aScin->AddInfo( TString(data) );
481 }
482 else {
483 sprintf(data, "time2 = %-.3f ns, charge2 = %-.3f MeV", time, charge);
484 aScin->AddInfo( TString(data) );
485 sprintf(data, "Fired");
486 aScin->AddInfo( TString(data) );
487 }
488
489 aScin->CloseInfo();
490 aScin->SetCharge(aScin->GetCharge() + charge);
491
492 m_2DHitsArray->Add(aScin);
493 }
494 }
495}
TTree * data
Double_t time
static double TofTime(unsigned int timeChannel)
static double TofCharge(unsigned int chargeChannel)
virtual void CloseInfo()
Definition: Tof2DScin.cxx:121
virtual void ClearInfo()
Definition: Tof2DScin.cxx:115

Referenced by BesEvent::SetHits().

◆ SetHits() [2/2]

void TofROOTGeo::SetHits ( )

Set all physicalNodes corresponding to digiCol;.

◆ SetNode() [1/4]

void TofROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

Definition at line 49 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

50{
51 m_Tof = GetTopVolume();
52 if(!m_Tof) std::cout << "m_Tof = 0" << std::endl;
53
54 for (int part = 0; part < m_kPart; part++) {
55 int nScin = 0;
56 if (part == 1) nScin = m_kAssemblyBr;
57 else nScin = m_kAssemblyEc;
58 for (int scin = 0; scin < nScin; scin++) {
59 std::stringstream osname;
60 if (part == 0) {
61 osname << "pv_" << "logical" << "Tof" << "ScinEc" << "_" << m_kAssemblyBr + m_kAssemblyEc + scin << "_0";
62 }
63 else if (part == 1) {
64 osname << "pv_" << "logical" << "Tof" << "ScinBr" << "_" << scin << "_0";
65 }
66 else if (part == 2) {
67 osname << "pv_" << "logical" << "Tof" << "ScinEc" << "_" << m_kAssemblyBr + scin << "_0";
68 }
69
70 m_NodeScin[part][scin] = GetNode( osname.str() );
71 }
72 }
73}

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

◆ SetNode() [2/4]

void TofROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

◆ SetNode() [3/4]

void TofROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

◆ SetNode() [4/4]

void TofROOTGeo::SetNode ( )

Set the pointers to theirs nodes;.

◆ SetNoEndVisible() [1/2]

void TofROOTGeo::SetNoEndVisible ( )

Set noend visible;.

Definition at line 331 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

332{
333 /*
334 int part = 1;
335 GetVolumeScin(0)->SetVisibility(1);
336 GetVolumeBucket(0)->SetVisibility(1);
337
338 int nScin = 0;
339 nScin = m_kAssemblyBr;
340 for (int scin = 0; scin < nScin; scin++) {
341 GetScin(part, scin)->SetVisibility(1);
342
343 int nBucket = 0;
344 nBucket = m_kBucketBr;
345 for (int bucket = 0; bucket < nBucket; bucket++) {
346 GetBucket(part, scin, bucket)->SetVisibility(1);
347 }
348 }
349 */
350}

◆ SetNoEndVisible() [2/2]

void TofROOTGeo::SetNoEndVisible ( )

Set noend visible;.

◆ SetPhysicalNode() [1/4]

void TofROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

Definition at line 158 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

159{
160 int scinColor = 6;
161
162 if (gGeoManager == 0) std::cout << "Create gGeoManager first" << std::endl;
163 TGeoNode *bes = gGeoManager->GetTopNode();
164 //std::cout << "m_childNo " << m_childNo << std::endl;
165 TGeoNode *tof = bes->GetDaughter(m_childNo);
166
167 for (int part = 0; part < m_kPart; part++) {
168 int nScin = 0;
169 if (part == 1) nScin = m_kAssemblyBr;
170 else nScin = m_kAssemblyEc;
171 for (int scin = 0; scin < nScin; scin++) {
172 TGeoNode *nodeScin = GetScin(part, scin);
173 m_PhysicalScin[part][scin] = gGeoManager->MakePhysicalNode( TString("/") + bes->GetName() +
174 TString("/") + tof->GetName() +
175 TString("/") + nodeScin->GetName() );
176 m_PhysicalScin[part][scin]->SetVisibility(0);
177 m_PhysicalScin[part][scin]->SetIsVolAtt(kFALSE);
178 m_PhysicalScin[part][scin]->SetLineColor(scinColor);
179 }
180 }
181}

Referenced by BesGeometry::InitGeometry().

◆ SetPhysicalNode() [2/4]

void TofROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

◆ SetPhysicalNode() [3/4]

void TofROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

◆ SetPhysicalNode() [4/4]

void TofROOTGeo::SetPhysicalNode ( )

Set the pointers to the physical nodes;.

◆ SetQMatch() [1/2]

void TofROOTGeo::SetQMatch ( Bool_t  input = false)

Definition at line 247 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

247 {
248 k_QMatch = input;
249}

◆ SetQMatch() [2/2]

void TofROOTGeo::SetQMatch ( Bool_t  input)

◆ SetQuarterVisible() [1/4]

void TofROOTGeo::SetQuarterVisible ( )

Set quater visible;.

Definition at line 133 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/TofROOTGeo.cxx.

134{
135 for (int part = 0; part < m_kPart; part++) {
136 GetVolumeScin(part)->SetVisibility(1);
137 GetVolumeBucket(part)->SetVisibility(1);
138
139 int nScin = 0;
140 if (part == 1) nScin = m_kAssemblyBr;
141 else nScin = m_kAssemblyEc;
142 for (int scin = 0; scin < nScin; scin++) {
143 if (scin < nScin/4) GetScin(part, scin)->SetVisibility(0);
144 else GetScin(part, scin)->SetVisibility(1);
145
146 int nBucket = 0;
147 if (part == 1) nBucket = m_kBucketBr;
148 else nBucket = m_kBucketEc;
149 for (int bucket = 0; bucket < nBucket; bucket++) {
150 if (scin < nScin/4) GetBucket(part, scin, bucket)->SetVisibility(0);
151 else GetBucket(part, scin, bucket)->SetVisibility(1);
152 }
153 }
154 }
155}

◆ SetQuarterVisible() [2/4]

void TofROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetQuarterVisible() [3/4]

void TofROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetQuarterVisible() [4/4]

void TofROOTGeo::SetQuarterVisible ( )

Set quater visible;.

◆ SetTMatch() [1/2]

void TofROOTGeo::SetTMatch ( Bool_t  input = false)

Definition at line 242 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

242 {
243 k_TMatch = input;
244}

◆ SetTMatch() [2/2]

void TofROOTGeo::SetTMatch ( Bool_t  input)

◆ SetVisTofDetector() [1/2]

void TofROOTGeo::SetVisTofDetector ( )

Set Tof detector visibility;.

Definition at line 498 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

499{
500 /*
501 for (int part = 0; part < m_kPart; part++) {
502 for (int layer = 0; layer < GetLayerNb(part); layer++) {
503 for (int scin = 0; scin < GetScinNb(part); scin++) {
504 TGeoPhysicalNode *phyNode = GetPhysicalScin(part, layer, scin);
505 if (phyNode) phyNode->SetLineColor(m_ScinColor);
506 }
507 }
508 }
509 */
510
511 BesView *view = 0;
512 if (gPad) view = (BesView*)gPad->GetView();
513
514 //cout << "VisTofEast " << view->GetVisTofEast() << endl;
515 for (int i = 0; i < m_DetectorsArray->GetEntries(); i++) {
516 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_DetectorsArray->At(i);
517 phyNode->SetVisibility(0);
518 if (view && view->GetVisTofGlobal()) {
519 int part = GetPart(phyNode);
520 if (part == 0 && view->GetVisTofEast() ||
521 part == 1 && view->GetVisTofBarrel() ||
522 part == 2 && view->GetVisTofWest() )
523 phyNode->SetVisibility(1);
524 }
525 }
526}
Int_t GetPart(TGeoPhysicalNode *phyNode)
Get part no of a scintillator physcial node.

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

◆ SetVisTofDetector() [2/2]

void TofROOTGeo::SetVisTofDetector ( )

Set Tof detector visibility;.

◆ SetVisTofHits() [1/2]

void TofROOTGeo::SetVisTofHits ( )

Set Tof hits visibility;.

Definition at line 529 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

530{
531 BesView *view = 0;
532 if (gPad) view = (BesView*)gPad->GetView();
533
534 for (int i = 0; i < m_HitsArray->GetEntries(); i++) {
535 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_HitsArray->At(i);
536 if (phyNode){
537 if (view && view->GetVisTofHitsGlobal()) {
538 int part = GetPart(phyNode);
539 if (part == 0 && view->GetVisTofHitsEast() ||
540 part == 1 && view->GetVisTofHitsBarrel() ||
541 part == 2 && view->GetVisTofHitsWest() ) {
542 phyNode->SetVisibility(1);
543 phyNode->SetLineColor(kGreen);
544 continue;
545 }
546 }
547 phyNode->SetVisibility(0);
548 }
549 }
550}

Referenced by BesGeometry::Draw3D().

◆ SetVisTofHits() [2/2]

void TofROOTGeo::SetVisTofHits ( )

Set Tof hits visibility;.

◆ SetVolumeDefaultVis() [1/2]

void TofROOTGeo::SetVolumeDefaultVis ( )

Set default visual attributes;.

Definition at line 214 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/src/TofROOTGeo.cxx.

215{
216 //std::cout << "begin of set defaultvis" << std::endl;
217
218 m_Tof->SetLineColor(m_TofColor);
219 m_Tof->SetVisibility(0);
220
221 for (int part = 0; part < m_kPart; part++) {
222 GetVolumePart(part)->SetLineColor(m_ScinColor);
223 GetVolumePart(part)->SetVisibility(0);
224 for (int layer = 0; layer < GetLayerNb(part); layer++) {
225 GetVolumePVF(part, layer)->SetLineColor(m_ScinColor);
226 GetVolumePVF(part, layer)->SetVisibility(0);
227
228 GetVolumeAl(part, layer)->SetLineColor(m_ScinColor);
229 GetVolumeAl(part, layer)->SetVisibility(0);
230
231 GetVolumeScin(part, layer)->SetLineColor(m_ScinColor);
232 GetVolumeScin(part, layer)->SetVisibility(0);
233
234 GetVolumeBucket(part, layer)->SetLineColor(m_BucketColor);
235 GetVolumeBucket(part, layer)->SetVisibility(0);
236 }
237 }
238 //std::cout << "end of set defaultvis" << std::endl;
239}
TGeoVolume * GetVolumeAl(int part, int layer)
Get Al volume;.
TGeoVolume * GetVolumePart(int part)
Get assembly volume; part=0,2 for AssemblyEc, 1 for AssemblyBr;
TGeoVolume * GetVolumePVF(int part, int layer)
Get PVF volume;.

◆ SetVolumeDefaultVis() [2/2]

void TofROOTGeo::SetVolumeDefaultVis ( )

Set default visual attributes;.

◆ SetVolumeTof() [1/2]

void TofROOTGeo::SetVolumeTof ( TGeoVolume *  vol)
inline

Set Tof volume, while initializing from ROOT;.

Definition at line 93 of file EventDisplay/BesVisLib/BesVisLib-00-04-04/BesVisLib/TofROOTGeo.h.

93{ m_Tof = vol; }

Referenced by InitFromROOT().

◆ SetVolumeTof() [2/2]

void TofROOTGeo::SetVolumeTof ( TGeoVolume *  vol)
inline

Set Tof volume, while initializing from ROOT;.

Definition at line 93 of file InstallArea/include/BesVisLib/BesVisLib/TofROOTGeo.h.

93{ m_Tof = vol; }

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