FairRoot/PandaRoot
PndMdtForward.cxx
Go to the documentation of this file.
1 
2 #include <iostream>
3 
4 #include "TClonesArray.h"
5 #include "TLorentzVector.h"
6 #include "TMath.h"
7 #include "TParticle.h"
8 #include "TGeoArb8.h"
9 #include "TGeoTrd2.h"
10 #include "TGeoCompositeShape.h"
11 #include "TGeoMatrix.h"
12 #include "TGeoManager.h"
13 #include "TVirtualMC.h"
14 
15 #include "FairVolume.h"
16 #include "FairGeoMedia.h"
17 #include "FairGeoInterface.h"
18 #include "FairGeoLoader.h"
19 #include "FairGeoBuilder.h"
20 #include "FairRuntimeDb.h"
21 #include "FairRun.h"
22 #include "FairModule.h"
23 
24 #include "PndDetectorList.h"
25 #include "PndStack.h"
26 #include "PndMdt.h"
27 #include "PndMdtForward.h"
28 
29 using namespace std;
30 
31 
33 {
34  TString vname = "Mdt";
35  vname = vname.Strip();
36  TGeoVolume* vcave = gGeoManager->FindVolumeFast(vname.Data());
37 
38  //General definitions
39  TGeoVolume* mdtfwd = new TGeoVolumeAssembly("MdtForward");
40 
41  FairGeoLoader*geoLoad = FairGeoLoader::Instance();
42  FairGeoInterface *geoFace = geoLoad->getGeoInterface();
43  FairGeoMedia *Media = geoFace->getMedia();
44  FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
45  FairGeoMedium *medmdtArCO2 = Media->getMedium("MDTMixture");
46  geobuild->createMedium(medmdtArCO2);
47  FairGeoMedium *medmdtFe = Media->getMedium("iron");
48  geobuild->createMedium(medmdtFe);
49  FairGeoMedium *medmdtVac = Media->getMedium("vacuum");
50  geobuild->createMedium(medmdtVac);
51 
52  //char fe[12], hl[12], ffe[12], gas[12], hgas[12], ggas[12]; //[R.K. 01/2017] unused variable?
53  Char_t buffer[255];
54  TGeoTranslation *frotfe[16];
55  TGeoTranslation *frotgas[17];
56  TGeoVolume *FeForward[16];
57  TGeoVolume *GasForward[17];
58 
62  Double_t fwd_holedx = (Double_t)PndMdt_FWD_Hole_DX;
63  Double_t fwd_holedy = (Double_t)PndMdt_FWD_Hole_DY;
65 
66  gGeoManager->MakeBox("fe", gGeoManager->GetMedium("iron"), fwd_dx/20., fwd_dy/20., fwd_fedz/20.);
67  gGeoManager->MakeBox("hl", gGeoManager->GetMedium("vacuum"), fwd_holedx/20., fwd_holedy/20., fwd_fedz/20.+1.);
68 
69  gGeoManager->MakeBox("gas", gGeoManager->GetMedium("MDTMixture"), fwd_dx/20., fwd_dy/20., fwd_thick/20.);
70  gGeoManager->MakeBox("hgas", gGeoManager->GetMedium("vacuum"), fwd_holedx/20., fwd_holedy/20., fwd_thick/20.+1.);
71 
72  TGeoTranslation *vv = new TGeoTranslation((15+1.8), 0, 0);
73  vv->SetName("vv");
74  vv->RegisterYourself();
75  TGeoCompositeShape *csfe = new TGeoCompositeShape("ffe", "(fe - (hl:vv))");
76  TGeoCompositeShape *csgas = new TGeoCompositeShape("ggas", "(gas - (hgas:vv))");
77 
78  // Fe layers
79  int yt=0, kk=0;
80  for (int nFeLayer=0; nFeLayer<16; nFeLayer++)
81  {
82  yt=(nFeLayer%4);
83  if(yt==0) kk++;
84  frotfe[nFeLayer] = new TGeoTranslation(kk*1.45, 0, 873+9*nFeLayer);
85  FeForward[nFeLayer] = new TGeoVolume(Form("FeForwardLayer%d",nFeLayer), csfe, gGeoManager->GetMedium("iron"));
86  frotfe[nFeLayer]->SetName(Form("frotfe%d",nFeLayer));
87  frotfe[nFeLayer]->RegisterYourself();
88 
89  mdtfwd->AddNode(FeForward[nFeLayer], nFeLayer, frotfe[nFeLayer]);
90  }
91  // end of Fe layers
92 
93  // // MDT gas layers
94  yt=0; kk=0;
95  for (int nLayer=0; nLayer<17; nLayer++)
96  {
97  sprintf(buffer,"MDT%is%il%ib%iw%i", 4, 0, nLayer, 0, 0);
98  yt=(nLayer%4);
99  if(yt==0) kk++;
100  if(nLayer!=0) {
101  frotgas[nLayer] = new TGeoTranslation(kk*1.45, 0, 876.1+ fwd_thick/20. +9*(nLayer-1));
102  GasForward[nLayer] = new TGeoVolume(buffer, csgas, gGeoManager->GetMedium("MDTMixture"));
103  }
104  else
105  {
106  frotgas[nLayer] = new TGeoTranslation(kk*1.45, 0, 869.9 - fwd_thick/20.);
107  GasForward[nLayer] = new TGeoVolume(buffer, csgas, gGeoManager->GetMedium("MDTMixture"));
108  }
109  frotgas[nLayer]->SetName(Form("frotgas%d",nLayer));
110  frotgas[nLayer]->RegisterYourself();
111  AddSensitiveVolume(GasForward[nLayer]);
112  mdtfwd->AddNode(GasForward[nLayer], nLayer, frotgas[nLayer]);
113  }
114  // end of MDT gas layers
115 
116  vcave->AddNode(mdtfwd,1);
117 
118  return;
119 }
120 
#define PndMdt_SVThickness
Definition: PndMdtForward.h:23
FairGeoLoader * geoLoad
FairGeoMedia * Media
#define PndMdt_FWD_Fe_DZ
Definition: PndMdtForward.h:11
#define PndMdt_FWD_DX
Definition: PndMdtForward.h:8
#define PndMdt_FWD_DY
Definition: PndMdtForward.h:9
TGeoManager * gGeoManager
#define PndMdt_FWD_Hole_DX
Definition: PndMdtForward.h:14
FairGeoBuilder * geobuild
Double_t
#define PndMdt_FWD_Hole_DY
Definition: PndMdtForward.h:15
void PndMdtForward()
Definition: PndMdt.h:20
ClassImp(PndAnaContFact)
FairGeoInterface * geoFace