4 #define _PHI_MAX_ 62.00
9 #define _YAXIS_MAX_ 0.80
16 {
"VST/VstStove00/VstChipAssembly00/VstMimosaShell", kGreen+1},
18 {
"VST/VstStove00/VstChipAssembly00/VstWaterPipe", kCyan+1},
19 {
"VST/VstStove00/VstChipAssembly00/VstWater", kBlue},
21 {
"VST/VstStove00/VstChipAssembly00/VstColdPlate", kBlack},
23 {
"VST/VstStove00/VstChipAssembly00/VstSideWall", kGray+2},
24 {
"VST/VstStove00/VstChipAssembly00/VstFlatRoof", kGray+2},
25 {
"VST/VstStove00/VstChipAssembly00/VstRoofSideBeam", kGray+2},
27 {
"VST/VstStove00/VstChipAssembly00/VstEnforcementBeam", kBlack},
29 {
"VST/VstStove00/VstChipAssembly00/VstCellFlexLayer", kRed+1},
30 {
"VST/VstStove00/VstChipAssembly00/VstAluStrips", kRed+1},
36 unsigned len = path.Length();
40 for(
unsigned iq=0; iq<len; iq++) {
43 else if (path[iq] ==
'_')
46 if (!skip) ret += path[iq];
54 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
56 TFile* f =
new TFile(
"simparams.root");
57 f->Get(
"FairBaseParSet");
60 TString cavePrefix =
"/cave";
63 vector <TString> subs;
64 for(
int i=0; i<
sizeof(
dets)/
sizeof(
dets[0]); i++)
66 subs.push_back(cavePrefix);
70 subs.push_back(cavePrefix +
"/" +
dets[i].name);
73 const int NSUB = subs.size();
76 for (
int i = 0; i < NSUB; i++) {
79 tmp->SetMarkerStyle(21);
81 tmp->SetMarkerSize(1.0);
82 tmp->SetFillColor(
dets[i].color);
90 double caveAccu = 0.0;
92 double phi = (
_PHI_MIN_ + (i - 0.5)*phi_bin_width)*TMath::Pi()/180.;
93 printf(
"bin# %3d (of %3d) ...\n", i, _BIN_NUM_);
96 double xx[3] = {0.0, 0.0, 0.1}, nn[3] = {TMath::Cos(phi), TMath::Sin(phi)};
97 gGeoManager->SetCurrentPoint (xx);
98 gGeoManager->SetCurrentDirection(nn);
100 for(TGeoNode *node = gGeoManager->GetCurrentNode(); ; ) {
101 TGeoMaterial *
material = node->GetVolume()->GetMaterial();
102 double radlen = material->GetRadLen();
104 gGeoManager->FindNextBoundary();
105 double thickness = gGeoManager->GetStep();
110 TString path =
RemoveCrap(gGeoManager->GetPath());
113 for (
int iii = 0; iii < NSUB; iii++)
114 if (iii == cave && path.EqualTo( cavePrefix )) {
116 caveAccu += thickness/radlen;
119 else if (iii != cave && path.BeginsWith( subs[iii] )) {
121 h[cave]->SetBinContent(i+1, h[cave]->GetBinContent(i+1) + 100. * caveAccu);
125 h[iii]->SetBinContent(i+1, h[iii]->GetBinContent(i+1) + 100. * thickness/radlen);
130 node = gGeoManager->Step();
131 assert(gGeoManager->IsEntering());
134 if (gGeoManager->IsOutside())
break;
138 THStack *hs =
new THStack(
"hs",
"EIC Detector Geometry: Radiation Length Scan");
139 for (
int i = 0; i < NSUB; i++) {
143 TCanvas*
c1 =
new TCanvas(
"c1",
"c1", 800, 600);
144 c1->SetFrameBorderSize(0);
147 hs->GetXaxis()->SetTitle(
"Phi");
148 hs->GetXaxis()->SetLabelSize(0.03);
149 hs->GetYaxis()->SetTitle(
"radiation length X/X0, [%]");
150 hs->GetYaxis()->SetLabelSize(0.03);
153 TLegend *legend=
new TLegend(0.38,0.88 - NSUB*.04,0.62,0.88);
154 legend->SetTextFont(72);
155 legend->SetTextSize(0.03);
156 for (
int i = 0; i < NSUB; i++) {
157 legend->AddEntry(h[ NSUB - i - 1 ],
dets[NSUB - i - 1].name,
"p");
163 double averageRadLength = 0.0;
165 for (
int iii = 0; iii < NSUB; iii++)
167 averageRadLength += h[iii]->GetBinContent(iq+1);
169 printf(
"Average rad.length: %5.3f\n", averageRadLength/_BIN_NUM_);
172 c1->SaveAs(
"radlen.gif");