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 = 9;
64 if (cgem_flag) m_StartLayer = 8;
65 else m_StartLayer = 0;
69 k_QNotOverflow = kFALSE;
72 for (
int layer = 0; layer < m_kLayer; layer++) {
73 m_NodeLayer[layer] = 0;
74 for (
int replica = 0; replica < m_kReplicaMax; replica++) {
75 m_NodeReplica[layer][replica] = 0;
76 m_PhysicalReplica[layer][replica] = 0;
80 for (
int i = 0; i < m_kCorrectLayer; i++) {
81 m_CorrectMap[m_kiCorrectLayer[i]] = m_kiCorrectReplica[i];
84 for (
int layer = 0; layer < m_kTrueLayer; layer++) {
85 for (
int replica = 0; replica < m_kReplicaMax; replica++) {
86 m_Mdc2DWire[layer][replica] = 0;
94 cout <<
"delete old MdcROOTGeo" << endl;
95 for (Int_t layer = 0; layer < m_kTrueLayer; ++layer)
98 for (Int_t replica = 0; replica < m_kReplica[simuLayer]; ++replica)
100 delete m_Mdc2DWire[layer][replica];
128 cout <<
"MdcROOTGeo::Init2DGeometry, ROOT Geometry not Initialized yet!" << endl;
134 Int_t mdcLineColor = 15;
135 Int_t mdcXYStyle = 1001;
136 Int_t mdcZRStyle = 1001;
137 Int_t mdcStereoSuperColor = 38;
138 Int_t mdcAxialSuperColor = 4;
140 Double_t local[3] = {0.0, 0.0, 0.0};
141 Double_t master[3] = {0.0, 0.0, 0.0};
143 Double_t
P[306] = {0.0};
144 Double_t center[3] = {0.0, 0.0, 0.0};
149 TGeoTube *mdcShape = (TGeoTube*)
GetVolumeMdc()->GetShape();
151 Double_t rmin = mdcShape->GetRmin();
152 if (m_StartLayer > 0)
154 TGeoTube *mdcShapeOuter = (TGeoTube*)(
GetLayer(m_StartLayer)->GetVolume())->GetShape();
155 rmin = mdcShapeOuter->GetRmin();
158 m_MdcXY =
new BesCircle2D(
"Mdc",
"Mdc", rmin, mdcShape->GetRmax(), ¢er[0]);
160 m_MdcXY->SetFillColor(mdcColor);
161 m_MdcXY->SetFillStyle(mdcXYStyle);
162 m_MdcXY->SetLineColor(mdcLineColor);
187 for (Int_t layer = m_StartLayer; layer < m_kTrueLayer; layer++) {
189 for (
int replica = 0; replica < m_kReplica[simuLayer]; replica++) {
192 name = TString(
"Mdc Layer ");
197 if (m_kStereoDir[layer] != 0) {
198 TGeoArb8 *wireShape = (TGeoArb8*)wirePhyNode->GetShape();
199 Double_t *localArb8Point, masterArb8Point[24];
200 localArb8Point = wireShape->GetVertices();
201 for (Int_t i = 0; i < 8; i++) {
202 local[0] = localArb8Point[2*i];
203 local[1] = localArb8Point[2*i+1];
204 if (i < 4) local[2] = wireShape->GetDz() * (-1.0);
205 else local[2] = wireShape->GetDz();
207 wirePhyNode->GetMatrix(-1*wirePhyNode->GetLevel())
208 ->LocalToMaster(local, &master[0]);
209 for (Int_t j = 0; j < 3; j++) {
210 masterArb8Point[3*i+j] = master[j];
214 m_Mdc2DWire[layer][replica] =
new Mdc2DWire(name, name, 8, &masterArb8Point[0]);
219 TGeoTubeSeg *wireShape = (TGeoTubeSeg*)wirePhyNode->GetShape();
221 Double_t centerR = 0.5*(wireShape->GetRmin() + wireShape->GetRmax());
222 if (layer >= m_kStereoLayerIn+m_kAxialLayerIn+m_kStereoLayerOut)
223 centerR = wireShape->GetRmax();
225 0.5*(wireShape->GetPhi1() + wireShape->GetPhi2()) * TMath::DegToRad();
226 local[0] = centerR *
cos(centerPhi);
227 local[1] = centerR *
sin(centerPhi);
229 wirePhyNode->GetMatrix(-1*wirePhyNode->GetLevel())
230 ->LocalToMaster(local, &master[0]);
232 Double_t rmin = wireShape->GetRmin();
233 Double_t rmax = wireShape->GetRmax();
234 if (layer >= m_kStereoLayerIn+m_kAxialLayerIn+m_kStereoLayerOut)
235 rmax = rmin + 2*(rmax-rmin);
236 m_Mdc2DWire[layer][replica] =
237 new Mdc2DWire( name, name, rmin, rmax, wireShape->GetDz(),centerPhi, &master[0] );
245 TGeoTube *aMdcLayer = 0;
248 for (Int_t layer = m_StartLayer; layer < m_kLayer; layer++) {
249 aMdcLayer = (TGeoTube*)
GetLayer(layer)->GetVolume()->GetShape();
251 P[3*iPoint+1] = aMdcLayer->GetRmin();
252 P[3*iPoint+2] = aMdcLayer->GetDz();
257 P[3*iPoint+1] = aMdcLayer->GetRmax();
258 P[3*iPoint+2] = aMdcLayer->GetDz();
261 P[3*iPoint+1] = aMdcLayer->GetRmax();
262 P[3*iPoint+2] = aMdcLayer->GetDz() * (-1.0);
265 for (Int_t layer = m_kLayer-1; layer >= m_StartLayer; layer--) {
266 aMdcLayer = (TGeoTube*)
GetLayer(layer)->GetVolume()->GetShape();
268 P[3*iPoint+1] = aMdcLayer->GetRmin();
269 P[3*iPoint+2] = aMdcLayer->GetDz() * (-1.0);
274 m_MdcZR[0] =
new BesPolygon2D(
"MdcZRUp",
"MdcZRUp", iPoint, &
P[0]);
276 for (Int_t i = 0; i < iPoint; i++)
279 m_MdcZR[1] =
new BesPolygon2D(
"MdcZRDown",
"MdcZRDown", iPoint, &
P[0]);
281 for (Int_t i = 0; i < 2; i++) {
282 m_MdcZR[i]->SetFillColor(mdcColor);
283 m_MdcZR[i]->SetFillStyle(mdcZRStyle);
284 m_MdcZR[i]->SetLineColor(mdcLineColor);
293 Int_t nDaughters =
m_TopVolume->GetNodes()->GetEntries();
294 cout <<
"logicalMdc contains " << nDaughters <<
" nodes : " << endl;
295 for (Int_t i = 0; i < nDaughters; i++) {
296 cout << i <<
" : " <<
m_TopVolume->GetNode(i)->GetName() << endl;
302 if (!m_Mdc) std::cout <<
"m_Mdc = 0" << std::endl;
305 for (
int layer = m_StartLayer; layer < m_kLayer; layer++) {
307 for (
int replica = 0; replica < m_kReplica[layer]; replica++) {
308 std::stringstream osname;
310 if (layer >= 0 && layer < m_kStereoLayerIn) {
312 osname <<
"pv_" <<
"logical" <<
"Mdc" <<
"Stereo" <<
"Layer" << layer <<
"Cell" <<
"_" << rep;
314 else if (layer >= m_kStereoLayerIn && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
317 osname <<
"pv_" <<
"logical" <<
"Mdc" <<
"Axial" <<
"Layer" << layer <<
"Cell" <<
"_" << rep;
319 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
320 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
322 osname <<
"pv_" <<
"logical" <<
"Mdc" <<
"Stereo" <<
"Layer" << layer <<
"Cell" <<
"_" << rep;
324 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut && layer < m_kLayer) {
326 Int_t nBeforeAxialLayerOut = m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut;
327 Int_t iTrueLayer = nBeforeAxialLayerOut + (layer - nBeforeAxialLayerOut)/2;
330 osname <<
"pv_" <<
"logical" <<
"Mdc" <<
"Axial" <<
"Layer" << iTrueLayer <<
"_0" <<
"Cell" <<
"_" << rep;
334 osname <<
"pv_" <<
"logical" <<
"Mdc" <<
"Axial" <<
"Layer" << iTrueLayer <<
"_1" <<
"Cell" <<
"_" << rep;
338 m_NodeReplica[layer][replica] =
GetNode( osname.str() );
345 for (
int layer = m_StartLayer; layer < m_kLayer; layer++) {
349 TGeoNode *nodeLayer = m_Mdc->GetNode(layer);
350 m_NodeLayer[layer] = nodeLayer;
353 Int_t nDaughters = nodeLayer->GetVolume()->GetNodes()->GetEntries();
361 for (
int replica = 0; replica < m_kReplica[layer]; replica++) {
362 m_NodeReplica[layer][replica] = nodeLayer->GetVolume()->GetNode(replica);
375 for (intMap::iterator
iter = m_CorrectMap.begin();
iter != m_CorrectMap.end();
iter++) {
376 if (layer == (*iter).first ||
377 (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut &&
378 layer - m_kAxialLayerOut == (*iter).first)) {
379 rep -= (*iter).second;
380 if (rep < 0) rep += m_kReplica[layer];
392 m_Mdc->SetLineColor(m_MdcColor);
393 m_Mdc->SetVisibility(0);
395 for (
int segment = 1; segment <= m_kSegment; segment++) {
402 for (
int layer = m_StartLayer; layer < m_kLayer; layer++) {
403 if ( (layer >= 0 && layer < m_kStereoLayerIn) ||
404 (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
405 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) ) {
417 for (
int segment = 1; segment <= m_kSegment; segment++) {
418 for (
int no = 0;
no < 2;
no++) {
424 for (
int layer = m_StartLayer; layer < m_kLayer; layer++) {
426 for (
int replica = 0; replica < m_kReplica[layer]; replica++) {
438 m_Mdc->SetLineColor(m_MdcColor);
439 m_Mdc->SetVisibility(0);
441 for (
int segment = 1; segment <= m_kSegment; segment++) {
448 for (
int layer = m_StartLayer; layer < m_kLayer; layer++) {
449 if ( (layer >= 0 && layer < m_kStereoLayerIn) ||
450 (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
451 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) ) {
463 for (
int segment = 1; segment <= m_kSegment; segment++) {
464 for (
int no = 0;
no < 2;
no++) {
470 for (
int layer = m_StartLayer; layer < m_kLayer; layer++) {
472 for (
int replica = 0; replica < m_kReplica[layer]; replica++) {
484 for (
int segment = 1; segment <= m_kSegment; segment++) {
489 for (
int layer = m_StartLayer; layer < m_kLayer; layer++) {
494 for (
int segment = 1; segment <= m_kSegment; segment++) {
495 for (
int no = 0;
no < 2;
no++) {
501 for (
int layer = m_StartLayer; layer < m_kLayer; layer++) {
503 for (
int replica = 0; replica < m_kReplica[layer]; replica++) {
504 if (replica < m_kReplica[layer]/4)
GetReplica(layer, replica)->SetVisibility(0);
505 else GetReplica(layer, replica)->SetVisibility(1);
513 for (
int segment = 1; segment <= m_kSegment; segment++) {
518 for (
int layer = m_StartLayer; layer < m_kLayer; layer++) {
523 for (
int segment = 1; segment <= m_kSegment; segment++) {
524 for (
int no = 0;
no < 2;
no++) {
530 for (
int layer = m_StartLayer; layer < m_kLayer; layer++) {
532 for (
int replica = 0; replica < m_kReplica[layer]; replica++) {
533 if (replica < m_kReplica[layer]/4 ||
534 replica > m_kReplica[layer]*3/4 )
GetReplica(layer, replica)->SetVisibility(1);
535 else GetReplica(layer, replica)->SetVisibility(0);
543 if (gGeoManager == 0) std::cout <<
"Create gGeoManager first" << std::endl;
544 TGeoNode *
bes = gGeoManager->GetTopNode();
545 TGeoNode *nodeMdc =
bes->GetVolume()->GetNode(
m_childNo);
548 if (!m_Mdc) std::cout <<
"m_Mdc = 0" << std::endl;
550 for (
int segment = 0; segment < 2*m_kSegment-2; segment++) {
551 m_PhysicalSegment[segment] = gGeoManager->MakePhysicalNode( TString(
"/") +
bes->GetName() +
552 TString(
"/") + nodeMdc->GetName() +
553 TString(
"/") + m_Mdc->GetNode((m_kLayer + 2*m_kSegment - 2 - 1) - segment)->GetName() );
554 m_PhysicalSegment[segment]->SetVisibility(0);
555 m_PhysicalSegment[segment]->SetIsVolAtt(kFALSE);
556 m_PhysicalSegment[segment]->SetLineColor(m_segmentColor);
561 for (
int layer = m_StartLayer; layer < m_kLayer; layer++) {
562 TGeoNode *nodeLayer =
GetLayer(layer);
564 for (
int replica = 0; replica < m_kReplica[layer]; replica++) {
565 TGeoNode *nodeReplica =
GetReplica(layer, replica);
567 m_PhysicalReplica[layer][replica] = gGeoManager->MakePhysicalNode( TString(
"/") +
bes->GetName() +
568 TString(
"/") + nodeMdc->GetName() +
569 TString(
"/") + nodeLayer->GetName() +
570 TString(
"/") + nodeReplica->GetName() );
571 m_PhysicalReplica[layer][replica]->SetVisibility(0);
572 m_PhysicalReplica[layer][replica]->SetIsVolAtt(kFALSE);
573 if ( (layer >= 0 && layer < m_kStereoLayerIn) ||
574 (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
575 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) ) {
576 m_PhysicalReplica[layer][replica]->SetLineColor(m_twistedTubsColor);
579 m_PhysicalReplica[layer][replica]->SetLineColor(m_replicaColor);
607 for (
int layer = m_StartLayer; layer < m_kLayer; layer++)
609 if ( (layer >= 0 && layer < m_kStereoLayerIn) ||
610 (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
611 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) )
613 for (
int replica = 0; replica < m_kReplica[layer]; replica++)
618 for (
int replica = 0; replica < m_kReplica[layer]; replica++)
630 if (gPad) view =
dynamic_cast<BesView*
>(gPad->GetView());
634 for (
int segment = 0; segment < 2*m_kSegment-2; segment++) {
635 TGeoPhysicalNode *phyNode = 0;
636 phyNode = m_PhysicalSegment[segment];
639 phyNode->SetVisibility(0);
640 if ( (segment >= 2 && segment <= 3) || segment > 59) {
681 for (
int i = 0; i <
m_HitsArray->GetEntries(); i++) {
682 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)
m_HitsArray->At(i);
683 phyNode->SetVisibility(0);
691 aWire->
AddInfo(aWire->GetTitle());
703 if (m_MdcDigiCol) NDigiCol = m_MdcDigiCol->GetEntries();
707 for (
int i = 0; i < NDigiCol; i++) {
716 TGeoPhysicalNode *phyNode = 0;
729 aWire = m_Mdc2DWire[layer][wire];
732 aWire->
AddInfo(aWire->GetTitle());
740 if(fabs(evTime)>0.0001){
775 if (gPad) view =
dynamic_cast<BesView*
>(gPad->GetView());
780 phyNode->SetVisibility(1);
783 phyNode->SetVisibility(0);
791 if (gPad) view =
dynamic_cast<BesView*
>(gPad->GetView());
793 for (
int i = 0; i <
m_HitsArray->GetEntries(); i++) {
794 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)
m_HitsArray->At(i);
796 phyNode->SetVisibility(1);
799 phyNode->SetVisibility(0);
818 k_QNotOverflow = input;
830 k_ColorfulWire = input;
835 k_MdcTimeSubEvTime = input;
841 std::stringstream osname;
842 osname <<
"logical" <<
"Mdc" <<
"Segment" << segment;
849 std::stringstream osname;
850 if (layer >= 0 && layer < m_kStereoLayerIn) {
851 osname <<
"logical" <<
"Mdc" <<
"Stereo" <<
"Layer" << layer;
853 else if (layer >= m_kStereoLayerIn && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
854 osname <<
"logical" <<
"Mdc" <<
"Axial" <<
"Layer" << layer;
856 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
857 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
858 osname <<
"logical" <<
"Mdc" <<
"Stereo" <<
"Layer" << layer;
860 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut &&
861 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut) {
862 osname <<
"logical" <<
"Mdc" <<
"Axial" <<
"Layer" << layer <<
"_0";
864 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut &&
866 osname <<
"logical" <<
"Mdc" <<
"Axial" <<
"Layer" << layer - m_kAxialLayerOut <<
"_1";
875 std::stringstream osname;
876 if (layer >= 0 && layer < m_kStereoLayerIn) {
877 osname <<
"logical" <<
"Mdc" <<
"Stereo" <<
"Layer" << layer <<
"Cell";
879 else if (layer >= m_kStereoLayerIn
880 && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
881 osname <<
"logical" <<
"Mdc" <<
"Axial" <<
"Layer" << layer <<
"Cell";
883 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
884 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
885 osname <<
"logical" <<
"Mdc" <<
"Stereo" <<
"Layer" << layer <<
"Cell";
887 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut &&
888 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut) {
889 osname <<
"logical" <<
"Mdc"
890 <<
"Axial" <<
"Layer" << layer <<
"_0" <<
"Cell";
892 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut
893 && layer < m_kLayer) {
894 osname <<
"logical" <<
"Mdc"
895 <<
"Axial" <<
"Layer" << layer - m_kAxialLayerOut
905 std::stringstream osname;
906 if (segment == 1 || segment == 2) {
907 osname <<
"pv_" <<
"logical" <<
"Mdc"
908 <<
"Segment" << segment <<
"_"
909 << m_kSegmentNodeOffset - (segment - 1);
913 osname <<
"pv_" <<
"logical" <<
"Mdc"
914 <<
"Segment" << segment <<
"_"
915 << m_kSegmentNodeOffset - m_kSegmentBr - 2*(segment - 1 - m_kSegmentBr) -
no;
919 return GetNode( osname.str() );
927 std::stringstream osname;
928 if (layer >= 0 && layer < m_kStereoLayerIn) {
929 osname <<
"pv_" <<
"logical" <<
"Mdc"
930 <<
"Stereo" <<
"Layer" << layer <<
"_" << layer;
932 else if (layer >= m_kStereoLayerIn
933 && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
934 osname <<
"pv_" <<
"logical" <<
"Mdc"
935 <<
"Axial" <<
"Layer" << layer <<
"_" << layer;
937 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
938 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
939 osname <<
"pv_" <<
"logical" <<
"Mdc"
940 <<
"Stereo" <<
"Layer" << layer <<
"_" << layer;
942 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut
943 && layer < m_kLayer) {
944 Int_t nBeforeAxialLayerOut =
945 m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut;
947 nBeforeAxialLayerOut + (layer - nBeforeAxialLayerOut)/2;
949 osname <<
"pv_" <<
"logical" <<
"Mdc"
950 <<
"Axial" <<
"Layer" << iTrueLayer <<
"_0" <<
"_" << layer;
953 osname <<
"pv_" <<
"logical" <<
"Mdc"
954 <<
"Axial" <<
"Layer" << iTrueLayer <<
"_1" <<
"_" << layer;
959 return GetNode( osname.str() );
962 if (m_NodeLayer[layer] != 0) {
963 return m_NodeLayer[layer];
977 if (m_NodeReplica[layer][replica] != 0) {
979 return m_NodeReplica[layer][replica];
990 if (m_PhysicalSegment[segment] != 0) {
991 return m_PhysicalSegment[segment];
1002 if (m_PhysicalReplica[layer][replica] != 0) {
1003 return m_PhysicalReplica[layer][replica];
1014 if (m_Mdc2DWire[layer][wire])
return m_Mdc2DWire[layer][wire];
1021 if (trueLayer < 36 || trueLayer >= m_kTrueLayer)
return trueLayer;
1022 if (trueLayer >= 36)
return (36 + 2*(trueLayer-36));
1030 for (
int i = 0; i < m_MdcDigiCol->GetEntries(); i++) {
1044 TString opt = option;
1047 if (!
m_2DGeoInit) cout <<
"MdcROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
1049 if (!view) cout <<
"MdcROOTGeo::Draw(), BesView not found" << endl;
1052 if (opt.Contains(
"XY")) {
1060 if (opt.Contains(
"ZR")) {
1061 for (Int_t i = 0; i < 2; i++) {
1063 m_MdcZR[i]->
Draw(
"");
1071 Int_t replicaDraw = 0;
1073 for (Int_t layer = m_StartLayer; layer < m_kTrueLayer; layer++) {
1075 for (
int replica = 0; replica < m_kReplica[simuLayer]; replica++) {
1076 if (m_kStereoDir[layer] == -1) replicaDraw = replica;
1077 else if (m_kStereoDir[layer] == 1) replicaDraw = m_kReplica[simuLayer]-1 - replica;
1078 else replicaDraw = replica;
1080 if (m_Mdc2DWire[layer][replicaDraw]) {
1083 m_Mdc2DWire[layer][replicaDraw]->
SetFired(
false);
1084 m_Mdc2DWire[layer][replicaDraw]->
Draw(wireOpt);
1096 if (!view) cout <<
"MdcROOTGeo::DrawHits(), BesView not found" << endl;
1103 TString wireOpt(
"");
1121 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 SetChargeChannel(UInt_t cc)
UInt_t GetTimeChannel() const
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)
void SetTimeChannel(UInt_t tc)
virtual void Draw(Option_t *option="")
Bool_t GetQOverflow() const
UInt_t GetChargeChannel() const
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 SetPhysicalDefaultVis()
Set default physical node attributes;.
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()
Draw Detecor (what is detector depends on you)
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
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)