35 const Double_t xInnerDistStof = 279.6;
44 TGeoVolumeAssembly* subunitVol =
new TGeoVolumeAssembly(
"Stof_plates");
50 TGeoTrd1 *detShape[2];
51 TGeoVolume* detVol[2];
59 sprintf (nameShape,
"PlateShape%d",
i);
60 sprintf (nameVol,
"Stof_plate%d",
i);
62 detShape[
i] =
new TGeoTrd1(nameShape, kdY1, kdY2, kdX, kdZ);
63 detVol[
i] =
new TGeoVolume(nameVol,detShape[
i],gGeoMan->GetMedium(
"polyvinyltoluene"));
65 Int_t
sign = pow(-1,i);
68 Double_t xPos = xInnerDistStof/2.+kdX;
69 TGeoCombiTrans* transMat=
new TGeoCombiTrans(sign*xPos,0.,0.,
new TGeoRotation (rot));
71 transMat->SetName(nameShape);
72 transMat->RegisterYourself();
73 subunitVol->AddNode(detVol[i],i,transMat);
78 unitVol->AddNode(subunitVol,0,
new TGeoCombiTrans(0.,yMiddleStof,zDistStof+kdZ,
new TGeoRotation ()));
79 top->AddNode(unitVol,0,
new TGeoCombiTrans(0.,0.,0.,
new TGeoRotation ()));
106 TGeoBBox *CentShape[22];
107 TGeoBBox *BeamShape[22];
108 TGeoBBox *VertShape[46];
110 TGeoVolume* CentVol[22];
111 TGeoVolume* BeamVol[22];
112 TGeoVolume* VertVol[46];
117 TGeoVolumeAssembly*
SubunitVol =
new TGeoVolumeAssembly(
"Ftof_strips");
131 for(
int i=0;
i<22;
i++){
132 bx[
i]=-40+kBCentX*((2*
i)+1);
137 for(
int i=0;
i<22;
i++){
140 sprintf (name,
"Centshape%d",
i);
141 sprintf (name1,
"Ftof_Central_Strip%d",
i);
143 CentShape[
i] =
new TGeoBBox(name,kBCentX,kBCentY,kBCentZ);
144 CentVol[
i] =
new TGeoVolume(name1,CentShape[
i],gGeoMan->GetMedium(
"polyvinyltoluene"));
145 TGeoCombiTrans*
trc1=0;
146 if(i<9) trc1=
new TGeoCombiTrans(bx[i],0,0.,
new TGeoRotation ());
147 else if (i>12) trc1=
new TGeoCombiTrans(bx[i-2],0,0.,
new TGeoRotation ());
150 trc1->RegisterYourself();
151 SubunitVol->AddNode(CentVol[i],i,trc1);
155 sprintf (namB,
"Beamshape%d",
i);
156 sprintf (namB1,
"Ftof_Beam_Strip%02d",
i);
157 BeamShape[
i] =
new TGeoBBox(namB,kBBeamX,kBBeamY,kBBeamZ);
158 BeamVol[
i] =
new TGeoVolume(namB1,BeamShape[
i],gGeoMan->GetMedium(
"polyvinyltoluene"));
163 (i==9 ? (offset = -70+kBBeamY) : (offset = 70-kBBeamY));
164 TGeoCombiTrans*
trc1=
new TGeoCombiTrans(bx[9],offset,0.,
new TGeoRotation ());
167 trc1->RegisterYourself();
168 SubunitVol->AddNode(BeamVol[i],i,trc1);
173 (i==11 ? (offset = -70+kBBeamY) : (offset = 70-kBBeamY));
175 TGeoCombiTrans*
trc1=
new TGeoCombiTrans(bx[10],offset,0.,
new TGeoRotation ());
178 trc1->RegisterYourself();
179 SubunitVol->AddNode(BeamVol[i],i,trc1);
186 for(
int i=0;
i<24;
i++){
187 bvx[
i]=-280+kBVertX*((2*
i)+1);
190 for(
int i=0;
i<22;
i++){
192 bvx[
i+24]=60+kBVertX*((2*
i)+1);
195 for(
int i=0;
i<46;
i++){
198 sprintf (namV,
"VertShape%d",
i);
199 sprintf (namV1,
"Ftof_Vertical_Strip%d",
i);
201 VertShape[
i] =
new TGeoBBox(namV,kBVertX,kBVertY,kBVertZ);
202 VertVol[
i] =
new TGeoVolume(namV1,VertShape[
i],gGeoMan->GetMedium(
"polyvinyltoluene"));
203 TGeoCombiTrans*
trc1=
new TGeoCombiTrans(bvx[i],0,0.,
new TGeoRotation ());
206 trc1->RegisterYourself();
207 SubunitVol->AddNode(VertVol[i],i,trc1);
210 unitVol->AddNode(SubunitVol,0,
new TGeoCombiTrans(0.,0.,zDistFtofWall,
new TGeoRotation ()));
211 top->AddNode(unitVol,0,
new TGeoCombiTrans(0.,0.,0.,
new TGeoRotation ()));
225 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
228 gSystem->Load(
"libGeoBase");
229 gSystem->Load(
"libParBase");
230 gSystem->Load(
"libBase");
231 gSystem->Load(
"libPndData");
232 gSystem->Load(
"libPassive");
235 TFile*
fi =
new TFile(outfile,
"RECREATE");
237 FairGeoLoader*
geoLoad =
new FairGeoLoader(
"TGeo",
"FairGeoLoader");
238 FairGeoInterface *
geoFace = geoLoad->getGeoInterface();
239 geoFace->setMediaFile(
"../../geometry/media_pnd.geo");
240 geoFace->readMedia();
243 FairGeoMedia *
Media = geoFace->getMedia();
244 FairGeoBuilder *
geobuild=geoLoad->getGeoBuilder();
246 FairGeoMedium *MediumSci = Media->getMedium(
"polyvinyltoluene");
249 Int_t
nmed=geobuild->createMedium(MediumSci);
252 TGeoManager*
gGeoMan = (TGeoManager*)gROOT->FindObject(
"FAIRGeom");
254 TGeoVolume *
top =
new TGeoVolumeAssembly(
"Ftof");
256 gGeoMan->SetTopVolume(top);
259 TGeoVolume *merge_fstof =
new TGeoVolumeAssembly(
"FStof");
263 std::cout <<
"\nftof wall was created.\n";
266 std::cout <<
"stof side plates were created in dipole region.\n\n";
270 gGeoMan->CloseGeometry();
Bool_t create_ftofwall(Double_t zDistFtofWall, TGeoManager *gGeoMan, TGeoVolume *top, TGeoVolume *unitVol)
Bool_t create_stof(TGeoManager *gGeoMan, TGeoVolume *top, TGeoVolume *unitVol)
FairGeoBuilder * geobuild
int create_ftof_stof_rootgeo(Double_t zDistFtofWall=775)
FairGeoInterface * geoFace