9 #define _THETA_MIN_ 2.0
14 #define _YAXIS_MAX_ 0.12
26 {
"TPC/TpcIfc", kBlue},
27 {
"TPC/TpcGas", kCyan},
38 unsigned len = path.Length();
42 for(
unsigned iq=0; iq<len; iq++) {
45 else if (path[iq] ==
'_')
48 if (!skip) ret += path[iq];
56 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
58 TFile* f =
new TFile(
"simparams.root");
59 f->Get(
"FairBaseParSet");
62 TString cavePrefix =
"/cave";
65 vector <TString> subs;
66 for(
int i=0; i<
sizeof(
dets)/
sizeof(
dets[0]); i++)
68 subs.push_back(cavePrefix);
72 subs.push_back(cavePrefix +
"/" +
dets[i].name);
75 const int NSUB = subs.size();
78 for (
int i = 0; i < NSUB; i++) {
85 tmp->SetMarkerStyle(21);
87 tmp->SetMarkerSize(1.0);
88 tmp->SetFillColor(
dets[i].color);
94 double caveAccu = 0.0;
99 double theta = 2 * atan(exp(-eta));
101 double theta_bin_width = (180.0 - 2*
_THETA_MIN_)/_BIN_NUM_;
102 double theta = (
_THETA_MIN_ + (i - 0.5)*theta_bin_width)*TMath::Pi()/180.;
104 printf(
"bin# %3d (of %3d) ...\n", i, _BIN_NUM_);
106 double xx[3] = {0.0, 0.0, 0.1}, nn[3] = {TMath::Sin(theta), 0.0, TMath::Cos(theta)};
107 gGeoManager->SetCurrentPoint (xx);
108 gGeoManager->SetCurrentDirection(nn);
110 for(TGeoNode *node = gGeoManager->GetCurrentNode(); ; ) {
111 TGeoMaterial *
material = node->GetVolume()->GetMaterial();
112 double radlen = material->GetRadLen();
114 gGeoManager->FindNextBoundary();
115 double thickness = gGeoManager->GetStep();
119 TString path =
RemoveCrap(gGeoManager->GetPath());
122 for (
int iii = 0; iii < NSUB; iii++)
123 if (iii == cave && path.EqualTo( cavePrefix )) {
125 caveAccu += thickness/radlen;
128 else if (iii != cave && path.BeginsWith( subs[iii] )) {
130 h[cave]->SetBinContent(i+1, h[cave]->GetBinContent(i+1) + caveAccu);
134 h[iii]->SetBinContent(i+1, h[iii]->GetBinContent(i+1) + thickness/radlen);
139 node = gGeoManager->Step();
140 assert(gGeoManager->IsEntering());
143 if (gGeoManager->IsOutside())
break;
147 THStack *hs =
new THStack(
"hs",
"EIC Detector Geometry: Radiation Length Scan");
148 for (
int i = 0; i < NSUB; i++) {
152 TCanvas*
c1 =
new TCanvas(
"c1",
"c1", 800, 600);
153 c1->SetFrameBorderSize(0);
157 hs->GetXaxis()->SetTitle(
"Pseudorapidity");
159 hs->GetXaxis()->SetTitle(
"Theta");
161 hs->GetXaxis()->SetLabelSize(0.03);
162 hs->GetYaxis()->SetTitle(
"radiation length, X / X0");
163 hs->GetYaxis()->SetLabelSize(0.03);
166 TLegend *legend=
new TLegend(0.38,0.88 - NSUB*.04,0.62,0.88);
167 legend->SetTextFont(72);
168 legend->SetTextSize(0.03);
169 for (
int i = 0; i < NSUB; i++) {
170 legend->AddEntry(h[ NSUB - i - 1 ],
dets[NSUB - i - 1].name,
"p");
174 c1->SaveAs(
"radlen.gif");