20#include <TGeoManager.h>
25#include "BesVisLib/MdcROOTGeo.h"
26#include "Identifier/MdcID.h"
27#include "BesVisLib/BesEvent.h"
28#include "BesVisLib/BesView.h"
29#include "RawEvent/RawDataUtil.h"
32MdcROOTGeo::m_kReplica[m_kLayer] = { 40, 44, 48, 56, 64, 72, 80, 80,
33 76, 76, 88, 88, 100, 100, 112, 112, 128, 128, 140, 140,
34 160, 160, 160, 160, 176, 176, 176, 176, 208, 208, 208, 208, 240, 240, 240, 240,
35 256, 256, 256, 256, 256, 256, 256, 256,
36 288, 288, 288, 288, 288, 288
40MdcROOTGeo::m_kStereoDir[m_kTrueLayer] = { 1, 1, 1, 1, -1, -1, -1, -1,
41 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
42 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1,
46MdcROOTGeo::m_kiCorrectLayer[m_kCorrectLayer] = {9, 11, 13, 15, 17, 19, 36, 38, 40, 42};
49MdcROOTGeo::m_kiCorrectReplica[m_kCorrectLayer] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
59 m_twistedTubsColor = 8;
64 k_QNotOverflow = kFALSE;
67 for (
int layer = 0; layer < m_kLayer; layer++) {
68 m_NodeLayer[layer] = 0;
69 for (
int replica = 0; replica < m_kReplicaMax; replica++) {
70 m_NodeReplica[layer][replica] = 0;
71 m_PhysicalReplica[layer][replica] = 0;
75 for (
int i = 0; i < m_kCorrectLayer; i++) {
76 m_CorrectMap[m_kiCorrectLayer[i]] = m_kiCorrectReplica[i];
79 for (
int layer = 0; layer < m_kTrueLayer; layer++) {
80 for (
int replica = 0; replica < m_kReplicaMax; replica++) {
81 m_Mdc2DWire[layer][replica] = 0;
110 cout <<
"MdcROOTGeo::Init2DGeometry, ROOT Geometry not Initialized yet!" << endl;
116 Int_t mdcLineColor = 15;
117 Int_t mdcXYStyle = 1001;
118 Int_t mdcZRStyle = 1001;
120 Int_t mdcStereoSuperColor = 38;
121 Int_t mdcAxialSuperColor = 4;
123 Double_t local[3] = {0.0, 0.0, 0.0};
124 Double_t master[3] = {0.0, 0.0, 0.0};
126 Double_t
P[300] = {0.0};
127 Double_t center[3] = {0.0, 0.0, 0.0};
132 TGeoTube *mdcShape = (TGeoTube*)
GetVolumeMdc()->GetShape();
133 m_MdcXY =
new BesCircle2D(
"Mdc",
"Mdc", mdcShape->GetRmin(), mdcShape->GetRmax(), ¢er[0]);
135 m_MdcXY->SetFillColor(mdcColor);
136 m_MdcXY->SetFillStyle(mdcXYStyle);
137 m_MdcXY->SetLineColor(mdcLineColor);
140 Int_t layerIn[4] = {0,
142 m_kStereoLayerIn+m_kAxialLayerIn,
143 m_kStereoLayerIn+m_kAxialLayerIn+m_kStereoLayerOut
145 Int_t layerOut[4] = {m_kStereoLayerIn-1,
146 m_kStereoLayerIn+m_kAxialLayerIn-1,
147 m_kStereoLayerIn+m_kAxialLayerIn+m_kStereoLayerOut-1,
150 for (Int_t i = 0; i < 4; i++) {
151 TGeoTube *mdcSuperShapeIn = (TGeoTube*)(
GetLayer(layerIn[i])->GetVolume())->GetShape();
152 TGeoTube *mdcSuperShapeOut = (TGeoTube*)(
GetLayer(layerOut[i])->GetVolume())->GetShape();
153 name = TString(
"MdcSuper" + i);
154 m_MdcXYSuper[i] =
new BesCircle2D(name, name, mdcSuperShapeIn->GetRmin(), mdcSuperShapeOut->GetRmax(), ¢er[0]);
155 if (i%2 == 0) m_MdcXYSuper[i]->SetFillColor(mdcStereoSuperColor);
156 else m_MdcXYSuper[i]->SetFillColor(mdcAxialSuperColor);
160 for (Int_t layer = 0; layer < m_kTrueLayer; layer++) {
162 for (
int replica = 0; replica < m_kReplica[simuLayer]; replica++) {
165 name = TString(
"Mdc Layer ");
170 if (m_kStereoDir[layer] != 0) {
171 TGeoArb8 *wireShape = (TGeoArb8*)wirePhyNode->GetShape();
172 Double_t *localArb8Point, masterArb8Point[24];
173 localArb8Point = wireShape->GetVertices();
174 for (Int_t i = 0; i < 8; i++) {
175 local[0] = localArb8Point[2*i];
176 local[1] = localArb8Point[2*i+1];
177 if (i < 4) local[2] = wireShape->GetDz() * (-1.0);
178 else local[2] = wireShape->GetDz();
180 wirePhyNode->GetMatrix(-1*wirePhyNode->GetLevel())
181 ->LocalToMaster(local, &master[0]);
182 for (Int_t j = 0; j < 3; j++) {
183 masterArb8Point[3*i+j] = master[j];
187 m_Mdc2DWire[layer][replica] =
new Mdc2DWire(name, name, 8, &masterArb8Point[0]);
192 TGeoTubeSeg *wireShape = (TGeoTubeSeg*)wirePhyNode->GetShape();
194 Double_t centerR = 0.5*(wireShape->GetRmin() + wireShape->GetRmax());
195 if (layer >= m_kStereoLayerIn+m_kAxialLayerIn+m_kStereoLayerOut)
196 centerR = wireShape->GetRmax();
198 0.5*(wireShape->GetPhi1() + wireShape->GetPhi2()) * TMath::DegToRad();
199 local[0] = centerR *
cos(centerPhi);
200 local[1] = centerR *
sin(centerPhi);
202 wirePhyNode->GetMatrix(-1*wirePhyNode->GetLevel())
203 ->LocalToMaster(local, &master[0]);
205 Double_t rmin = wireShape->GetRmin();
206 Double_t rmax = wireShape->GetRmax();
207 if (layer >= m_kStereoLayerIn+m_kAxialLayerIn+m_kStereoLayerOut)
208 rmax = rmin + 2*(rmax-rmin);
209 m_Mdc2DWire[layer][replica] =
210 new Mdc2DWire( name, name, rmin, rmax, wireShape->GetDz(),centerPhi, &master[0] );
218 TGeoTube *aMdcLayer = 0;
220 for (Int_t layer = 0; layer < m_kLayer; layer++) {
221 aMdcLayer = (TGeoTube*)
GetLayer(layer)->GetVolume()->GetShape();
223 P[3*iPoint+1] = aMdcLayer->GetRmin();
224 P[3*iPoint+2] = aMdcLayer->GetDz();
229 P[3*iPoint+1] = aMdcLayer->GetRmax();
230 P[3*iPoint+2] = aMdcLayer->GetDz();
233 P[3*iPoint+1] = aMdcLayer->GetRmax();
234 P[3*iPoint+2] = aMdcLayer->GetDz() * (-1.0);
237 for (Int_t layer = m_kLayer-1; layer >= 0; layer--) {
238 aMdcLayer = (TGeoTube*)
GetLayer(layer)->GetVolume()->GetShape();
240 P[3*iPoint+1] = aMdcLayer->GetRmin();
241 P[3*iPoint+2] = aMdcLayer->GetDz() * (-1.0);
246 m_MdcZR[0] =
new BesPolygon2D(
"MdcZRUp",
"MdcZRUp", iPoint, &
P[0]);
248 for (Int_t i = 0; i < iPoint; i++)
251 m_MdcZR[1] =
new BesPolygon2D(
"MdcZRDown",
"MdcZRDown", iPoint, &
P[0]);
253 for (Int_t i = 0; i < 2; i++) {
254 m_MdcZR[i]->SetFillColor(mdcColor);
255 m_MdcZR[i]->SetFillStyle(mdcZRStyle);
256 m_MdcZR[i]->SetLineColor(mdcLineColor);
264 Int_t nDaughters = m_Mdc->GetNodes()->GetEntries();
265 cout <<
"logicalMdc contains " << nDaughters <<
" nodes : " << endl;
266 for (Int_t i = 0; i < nDaughters; i++) {
267 cout << i <<
" : " << m_Mdc->GetNode(i)->GetName() << endl;
273 if (!m_Mdc) std::cout <<
"m_Mdc = 0" << std::endl;
275 for (
int layer = 0; layer < m_kLayer; layer++) {
277 for (
int replica = 0; replica < m_kReplica[layer]; replica++) {
278 std::stringstream osname;
280 if (layer >= 0 && layer < m_kStereoLayerIn) {
282 osname <<
"pv_" <<
"logical" <<
"Mdc" <<
"Stereo" <<
"Layer" << layer <<
"Cell" <<
"_" << rep;
284 else if (layer >= m_kStereoLayerIn && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
287 osname <<
"pv_" <<
"logical" <<
"Mdc" <<
"Axial" <<
"Layer" << layer <<
"Cell" <<
"_" << rep;
289 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
290 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
292 osname <<
"pv_" <<
"logical" <<
"Mdc" <<
"Stereo" <<
"Layer" << layer <<
"Cell" <<
"_" << rep;
294 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut && layer < m_kLayer) {
296 Int_t nBeforeAxialLayerOut = m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut;
297 Int_t iTrueLayer = nBeforeAxialLayerOut + (layer - nBeforeAxialLayerOut)/2;
300 osname <<
"pv_" <<
"logical" <<
"Mdc" <<
"Axial" <<
"Layer" << iTrueLayer <<
"_0" <<
"Cell" <<
"_" << rep;
304 osname <<
"pv_" <<
"logical" <<
"Mdc" <<
"Axial" <<
"Layer" << iTrueLayer <<
"_1" <<
"Cell" <<
"_" << rep;
308 m_NodeReplica[layer][replica] =
GetNode( osname.str() );
314 for (
int layer = 0; layer < m_kLayer; layer++) {
318 TGeoNode *nodeLayer = m_Mdc->GetNode(layer);
319 m_NodeLayer[layer] = nodeLayer;
322 Int_t nDaughters = nodeLayer->GetVolume()->GetNodes()->GetEntries();
324 cout << m_NodeLayer[layer] <<
" contains " << nDaughters <<
" nodes : " << endl;
325 for (Int_t i = 0; i < nDaughters; i++) {
326 cout << i <<
" : " << nodeLayer->GetVolume()->GetNode(i)->GetName() << endl;
330 for (
int replica = 0; replica < m_kReplica[layer]; replica++) {
331 m_NodeReplica[layer][replica] = nodeLayer->GetVolume()->GetNode(replica);
344 for (intMap::iterator
iter = m_CorrectMap.begin();
iter != m_CorrectMap.end();
iter++) {
345 if (layer == (*iter).first ||
346 (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut &&
347 layer - m_kAxialLayerOut == (*iter).first)) {
348 rep -= (*iter).second;
349 if (rep < 0) rep += m_kReplica[layer];
361 m_Mdc->SetLineColor(m_MdcColor);
362 m_Mdc->SetVisibility(0);
364 for (
int segment = 1; segment <= m_kSegment; segment++) {
370 for (
int layer =0; layer < m_kLayer; layer++) {
371 if ( (layer >= 0 && layer < m_kStereoLayerIn) ||
372 (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
373 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) ) {
385 for (
int segment = 1; segment <= m_kSegment; segment++) {
386 for (
int no = 0; no < 2; no++) {
391 for (
int layer = 0; layer < m_kLayer; layer++) {
393 for (
int replica = 0; replica < m_kReplica[layer]; replica++) {
405 m_Mdc->SetLineColor(m_MdcColor);
406 m_Mdc->SetVisibility(0);
408 for (
int segment = 1; segment <= m_kSegment; segment++) {
414 for (
int layer =0; layer < m_kLayer; layer++) {
415 if ( (layer >= 0 && layer < m_kStereoLayerIn) ||
416 (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
417 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) ) {
429 for (
int segment = 1; segment <= m_kSegment; segment++) {
430 for (
int no = 0; no < 2; no++) {
435 for (
int layer = 0; layer < m_kLayer; layer++) {
437 for (
int replica = 0; replica < m_kReplica[layer]; replica++) {
449 for (
int segment = 1; segment <= m_kSegment; segment++) {
453 for (
int layer = 0; layer < m_kLayer; layer++) {
458 for (
int segment = 1; segment <= m_kSegment; segment++) {
459 for (
int no = 0; no < 2; no++) {
464 for (
int layer = 0; layer < m_kLayer; layer++) {
466 for (
int replica = 0; replica < m_kReplica[layer]; replica++) {
467 if (replica < m_kReplica[layer]/4)
GetReplica(layer, replica)->SetVisibility(0);
468 else GetReplica(layer, replica)->SetVisibility(1);
476 for (
int segment = 1; segment <= m_kSegment; segment++) {
480 for (
int layer = 0; layer < m_kLayer; layer++) {
485 for (
int segment = 1; segment <= m_kSegment; segment++) {
486 for (
int no = 0; no < 2; no++) {
491 for (
int layer = 0; layer < m_kLayer; layer++) {
493 for (
int replica = 0; replica < m_kReplica[layer]; replica++) {
494 if (replica < m_kReplica[layer]/4 ||
495 replica > m_kReplica[layer]*3/4 )
GetReplica(layer, replica)->SetVisibility(1);
496 else GetReplica(layer, replica)->SetVisibility(0);
504 if (gGeoManager == 0) std::cout <<
"Create gGeoManager first" << std::endl;
505 TGeoNode *
bes = gGeoManager->GetTopNode();
506 TGeoNode *nodeMdc =
bes->GetVolume()->GetNode(
m_childNo);
509 if (!m_Mdc) std::cout <<
"m_Mdc = 0" << std::endl;
511 for (
int segment = 0; segment < 2*m_kSegment-2; segment++) {
512 m_PhysicalSegment[segment] = gGeoManager->MakePhysicalNode( TString(
"/") +
bes->GetName() +
513 TString(
"/") + nodeMdc->GetName() +
514 TString(
"/") + m_Mdc->GetNode((m_kLayer + 2*m_kSegment - 2 - 1) - segment)->GetName() );
515 m_PhysicalSegment[segment]->SetVisibility(0);
516 m_PhysicalSegment[segment]->SetIsVolAtt(kFALSE);
517 m_PhysicalSegment[segment]->SetLineColor(m_segmentColor);
521 for (
int layer = 0; layer < m_kLayer; layer++) {
522 TGeoNode *nodeLayer =
GetLayer(layer);
524 for (
int replica = 0; replica < m_kReplica[layer]; replica++) {
525 TGeoNode *nodeReplica =
GetReplica(layer, replica);
527 m_PhysicalReplica[layer][replica] = gGeoManager->MakePhysicalNode( TString(
"/") +
bes->GetName() +
528 TString(
"/") + nodeMdc->GetName() +
529 TString(
"/") + nodeLayer->GetName() +
530 TString(
"/") + nodeReplica->GetName() );
531 m_PhysicalReplica[layer][replica]->SetVisibility(0);
532 m_PhysicalReplica[layer][replica]->SetIsVolAtt(kFALSE);
533 if ( (layer >= 0 && layer < m_kStereoLayerIn) ||
534 (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
535 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) ) {
536 m_PhysicalReplica[layer][replica]->SetLineColor(m_twistedTubsColor);
539 m_PhysicalReplica[layer][replica]->SetLineColor(m_replicaColor);
571 if (gPad) view = (
BesView*)gPad->GetView();
575 for (
int segment = 0; segment < 2*m_kSegment-2; segment++) {
576 TGeoPhysicalNode *phyNode = 0;
577 phyNode = m_PhysicalSegment[segment];
580 phyNode->SetVisibility(0);
581 if ( (segment >= 2 && segment <= 3) || segment > 59) {
619 cout <<
"m_HitsArray size(): " <<
m_HitsArray->GetEntries() << endl;
620 cout <<
"m_2DHitsArray size(): " <<
m_2DHitsArray->GetEntries() << endl;
621 for (
int i = 0; i <
m_HitsArray->GetEntries(); i++) {
622 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)
m_HitsArray->At(i);
623 phyNode->SetVisibility(0);
631 aWire->
AddInfo(aWire->GetTitle());
639 for (
int i = 0; i < m_MdcDigiCol->GetEntries(); i++) {
648 TGeoPhysicalNode *phyNode = 0;
661 aWire = m_Mdc2DWire[layer][wire];
664 aWire->
AddInfo(aWire->GetTitle());
669 sprintf(
data,
"NO time");
671 sprintf(
data,
"time=%-.1f ns",
time);
672 if(fabs(evTime)>0.0001){
673 sprintf(
data,
"%s, Tdrift(Raw)=%-.1f ns",
data,
time - evTime +230);
677 sprintf(
data,
"%s, NO charge",
data);
679 sprintf(
data,
"%s, charge=%d",
data,charge);
682 sprintf(
data,
"Fired");
703 if (gPad) view = (
BesView*)gPad->GetView();
708 phyNode->SetVisibility(1);
711 phyNode->SetVisibility(0);
719 if (gPad) view = (
BesView*)gPad->GetView();
721 for (
int i = 0; i <
m_HitsArray->GetEntries(); i++) {
722 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)
m_HitsArray->At(i);
724 phyNode->SetVisibility(1);
727 phyNode->SetVisibility(0);
746 k_QNotOverflow = input;
758 k_ColorfulWire = input;
763 k_MdcTimeSubEvTime = input;
769 std::stringstream osname;
770 osname <<
"logical" <<
"Mdc" <<
"Segment" << segment;
777 std::stringstream osname;
778 if (layer >= 0 && layer < m_kStereoLayerIn) {
779 osname <<
"logical" <<
"Mdc" <<
"Stereo" <<
"Layer" << layer;
781 else if (layer >= m_kStereoLayerIn && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
782 osname <<
"logical" <<
"Mdc" <<
"Axial" <<
"Layer" << layer;
784 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
785 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
786 osname <<
"logical" <<
"Mdc" <<
"Stereo" <<
"Layer" << layer;
788 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut &&
789 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut) {
790 osname <<
"logical" <<
"Mdc" <<
"Axial" <<
"Layer" << layer <<
"_0";
792 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut &&
794 osname <<
"logical" <<
"Mdc" <<
"Axial" <<
"Layer" << layer - m_kAxialLayerOut <<
"_1";
803 std::stringstream osname;
804 if (layer >= 0 && layer < m_kStereoLayerIn) {
805 osname <<
"logical" <<
"Mdc" <<
"Stereo" <<
"Layer" << layer <<
"Cell";
807 else if (layer >= m_kStereoLayerIn
808 && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
809 osname <<
"logical" <<
"Mdc" <<
"Axial" <<
"Layer" << layer <<
"Cell";
811 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
812 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
813 osname <<
"logical" <<
"Mdc" <<
"Stereo" <<
"Layer" << layer <<
"Cell";
815 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut &&
816 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut) {
817 osname <<
"logical" <<
"Mdc"
818 <<
"Axial" <<
"Layer" << layer <<
"_0" <<
"Cell";
820 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut
821 && layer < m_kLayer) {
822 osname <<
"logical" <<
"Mdc"
823 <<
"Axial" <<
"Layer" << layer - m_kAxialLayerOut
833 std::stringstream osname;
834 if (segment == 1 || segment == 2) {
835 osname <<
"pv_" <<
"logical" <<
"Mdc"
836 <<
"Segment" << segment <<
"_"
837 << (m_kLayer + (2*m_kSegment -2) -1) - (segment - 1);
840 osname <<
"pv_" <<
"logical" <<
"Mdc"
841 <<
"Segment" << segment <<
"_"
842 << (m_kLayer + (2*m_kSegment -2) -1) - 2 - (segment - 3)*2 - no;
845 return GetNode( osname.str() );
853 std::stringstream osname;
854 if (layer >= 0 && layer < m_kStereoLayerIn) {
855 osname <<
"pv_" <<
"logical" <<
"Mdc"
856 <<
"Stereo" <<
"Layer" << layer <<
"_" << layer;
858 else if (layer >= m_kStereoLayerIn
859 && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
860 osname <<
"pv_" <<
"logical" <<
"Mdc"
861 <<
"Axial" <<
"Layer" << layer <<
"_" << layer;
863 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
864 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
865 osname <<
"pv_" <<
"logical" <<
"Mdc"
866 <<
"Stereo" <<
"Layer" << layer <<
"_" << layer;
868 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut
869 && layer < m_kLayer) {
870 Int_t nBeforeAxialLayerOut =
871 m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut;
873 nBeforeAxialLayerOut + (layer - nBeforeAxialLayerOut)/2;
875 osname <<
"pv_" <<
"logical" <<
"Mdc"
876 <<
"Axial" <<
"Layer" << iTrueLayer <<
"_0" <<
"_" << layer;
879 osname <<
"pv_" <<
"logical" <<
"Mdc"
880 <<
"Axial" <<
"Layer" << iTrueLayer <<
"_1" <<
"_" << layer;
885 return GetNode( osname.str() );
888 if (m_NodeLayer[layer] != 0) {
889 return m_NodeLayer[layer];
903 if (m_NodeReplica[layer][replica] != 0) {
905 return m_NodeReplica[layer][replica];
916 if (m_PhysicalSegment[segment] != 0) {
917 return m_PhysicalSegment[segment];
928 if (m_PhysicalReplica[layer][replica] != 0) {
929 return m_PhysicalReplica[layer][replica];
940 if (m_Mdc2DWire[layer][wire])
return m_Mdc2DWire[layer][wire];
947 if (trueLayer < 36 || trueLayer >= m_kTrueLayer)
return trueLayer;
948 if (trueLayer >= 36)
return (36 + 2*(trueLayer-36));
956 for (
int i = 0; i < m_MdcDigiCol->GetEntries(); i++) {
970 TString opt = option;
973 if (!
m_2DGeoInit) cout <<
"MdcROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
975 if (!view) cout <<
"MdcROOTGeo::Draw(), BesView not found" << endl;
978 if (opt.Contains(
"XY")) {
980 for (Int_t i = 0; i < 4; i++) {
985 if (opt.Contains(
"ZR")) {
986 for (Int_t i = 0; i < 2; i++) {
988 m_MdcZR[i]->
Draw(
"");
996 Int_t replicaDraw = 0;
997 for (Int_t layer = 0; layer < m_kTrueLayer; layer++) {
999 for (
int replica = 0; replica < m_kReplica[simuLayer]; replica++) {
1000 if (m_kStereoDir[layer] == -1) replicaDraw = replica;
1001 else if (m_kStereoDir[layer] == 1) replicaDraw = m_kReplica[simuLayer]-1 - replica;
1002 else replicaDraw = replica;
1004 if (m_Mdc2DWire[layer][replicaDraw]) {
1007 m_Mdc2DWire[layer][replicaDraw]->
SetFired(
false);
1008 m_Mdc2DWire[layer][replicaDraw]->
Draw(wireOpt);
1020 if (!view) cout <<
"MdcROOTGeo::DrawHits(), BesView not found" << endl;
1027 TString wireOpt(
"");
1032 for (
int i = 0; i < m_MdcDigiCol->GetEntries(); i++) {
1041 aWire = m_Mdc2DWire[layer][wire];
1052 if ((k_QNotOverflow) && ((overflow&2)>0) ){
1057 aWire->
Draw(wireOpt);
double P(RecMdcKalTrack *trk)
R__EXTERN BesEvent * gEvent
double sin(const BesAngle a)
double cos(const BesAngle a)
virtual void SetNSegment(Int_t np)
virtual void Draw(Option_t *option="")
BesEventHeader GetHeader()
const TObjArray * GetMdcDigiCol() const
void SetRotatable(Bool_t input)
virtual void Draw(Option_t *option="")
Bool_t GetVisMdcHitsGlobal()
void SetQOverflow(Bool_t qOvfl)
void SetTime(Double_t time)
virtual void AddInfo(TString info)
void SetColorfulWire(Bool_t colorfulWire, Bool_t subEvTime)
void SetEvTime(Double_t time)
virtual void Draw(Option_t *option="")
virtual void SetFired(bool status=true)
void SetCharge(Double_t charge)
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
static int wire(const Identifier &id)
TGeoNode * GetSegment(int segment, int no)
Get segment node;.
void SetTFire(Bool_t input)
int CorrectReplica(int layer, int replica)
Correct some axial layer id to copyNo;.
void SetVolumeDefaultVis()
Set default visual attributes;.
TGeoVolume * GetVolumeLayer(int layer)
Get layer volume;
TGeoPhysicalNode * GetPhysicalSegment(int segment)
Get segment physical node;.
void SetQuarterVisible()
Set quater visible;.
void SetNode()
Set the pointers to theirs nodes;.
void SetMdcTimeSubEvTime(Bool_t input)
TGeoNode * GetLayer(int layer)
Get layer node;
void SetQFire(Bool_t input)
void SetQNotOverflow(Bool_t input)
void DrawHits(Option_t *option)
Draw 2D hits.
void SetColorfulWire(Bool_t input)
void InitFromROOT(TGeoVolume *vol)
Initialize ROOTGeo from TGeoVolume logicalMdc.
void Init2DGeometry()
Initialize 2D Geometry.
TGeoNode * GetReplica(int layer, int replica)
Get replica node;.
TGeoVolume * GetVolumeReplica(int layer)
Get replica volume;.
TGeoVolume * GetVolumeSegment(int segment)
Get segment volume;.
void Draw(Option_t *option)
Draw function.
void SetVisMdcHits()
Set Mdc hits visibility;.
void SetVisMdcDetector()
Set Mdc default detector visibility;.
Int_t GetSimuLayer(Int_t trueLayer)
Trans trueLayer to simuLayer (0~42)->(0~49)
Mdc2DWire * Get2DWire(Int_t layer, Int_t replica)
Get Mdc2DWire;.
void SetVolumeMdc(TGeoVolume *vol)
Set Mdc volume, while initializing from ROOT;.
void SetHalfVisible()
Set half visible;.
TGeoPhysicalNode * GetPhysicalReplica(int layer, int replica)
Get replica physical node;.
void SetPhysicalNode()
Set the pointers to the physical nodes;.
void SetAllVisible()
Set all visible;.
TGeoVolume * GetVolumeMdc()
Get Mdc volume;.
Bool_t IsHit(Int_t layer, Int_t wire)
Judge whether the digiCol contains (layer, wire)
void SetDetector()
Set default physical node attributes;.
void InitFromGDML(const char *gdmlFile, const char *setupName)
Initialize ROOTGeo from GDML.
void SetHits()
Set all physicalNodes corresponding to digiCol;.
static double MdcTime(int timeChannel)
static double MdcCharge(int chargeChannel)
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 getOverflow() const
UInt_t getChargeChannel() const
UInt_t getTimeChannel() const