- // create the sensitive volumes,
-
- gMC->Gsvolu("S09G","BOX",kSensMaterial,dum,0);
- gMC->Gsvolu("S10G","BOX",kSensMaterial,dum,0);
-
- // create the vertical frame volume
-
- gMC->Gsvolu("S09V","BOX",kVframeMaterial,vFramepar,3);
- gMC->Gsvolu("S10V","BOX",kVframeMaterial,vFramepar,3);
-
- // create the horizontal frame volume
-
- gMC->Gsvolu("S09H","BOX",kHframeMaterial,hFramepar,3);
- gMC->Gsvolu("S10H","BOX",kHframeMaterial,hFramepar,3);
-
- // create the horizontal border volume
-
- gMC->Gsvolu("S09B","BOX",kBframeMaterial,bFramepar,3);
- gMC->Gsvolu("S10B","BOX",kBframeMaterial,bFramepar,3);
-
- index = 0;
- for (i = 0; i < kNslats5; i++){
- for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
-
- if (i == 0 && quadrant == 2) continue;
- if (i == 0 && quadrant == 4) continue;
-
- sprintf(idSlatCh9,"LE%d",ConvertSlatNum(i,quadrant,kNslats5-1));
- sprintf(idSlatCh10,"LF%d",ConvertSlatNum(i,quadrant,kNslats5-1));
- Float_t xvFrame = (slatLength5[i] - kVframeLength)/2.;
-
- // position the vertical frames
- if (i != 1) {
- GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
- GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
- GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
- GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
- } else { // no rounded spacer yet
- GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
- // GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
- GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
- // GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
- }
-
- // position the panels and the insulating material
- for (j = 0; j < kNPCB5[i]; j++){
- if (i == 1 && j == 0) continue;
- index++;
- Float_t xx = kSensLength * (-kNPCB5[i]/2.+j+.5);
-
- Float_t zPanel = spar[2] - panelpar[2];
- GetEnvelopes(8)->AddEnvelopeConstituent("S09C", idSlatCh9, 2*index-1,TGeoTranslation(xx,0.,zPanel));
- GetEnvelopes(8)->AddEnvelopeConstituent("S09C", idSlatCh9, 2*index,TGeoTranslation(xx,0.,-zPanel));
- GetEnvelopes(8)->AddEnvelopeConstituent("S09I", idSlatCh9, index,TGeoTranslation(xx,0.,0.));
- GetEnvelopes(9)->AddEnvelopeConstituent("S10C", idSlatCh10, 2*index-1,TGeoTranslation(xx,0.,zPanel));
- GetEnvelopes(9)->AddEnvelopeConstituent("S10C", idSlatCh10, 2*index,TGeoTranslation(xx,0.,-zPanel));
- GetEnvelopes(9)->AddEnvelopeConstituent("S10I", idSlatCh10, index,TGeoTranslation(xx,0.,0.));
- }
- }
- }
-
- // position the rohacell volume inside the panel volume
- gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY");
- gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY");
-
- // position the PCB volume inside the insulating material volume
- gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
- gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
- // position the horizontal frame volume inside the PCB volume
- gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
- gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
- // position the sensitive volume inside the horizontal frame volume
- gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
- gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
- // position the border volumes inside the PCB volume
- Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
- gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
- gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
- gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
- gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
-
- // // create the NULOC volume and position it in the horizontal frame
-
- gMC->Gsvolu("S09N","BOX",kNulocMaterial,nulocpar,3);
- gMC->Gsvolu("S10N","BOX",kNulocMaterial,nulocpar,3);
- index = 0;
- for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
- index++;
- gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
- gMC->Gspos("S09N",2*index ,"S09B", xx, 0., kBframeWidth/4., 0, "ONLY");
- gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
- gMC->Gspos("S10N",2*index ,"S10B", xx, 0., kBframeWidth/4., 0, "ONLY");
- }
-
- // // position the volumes approximating the circular section of the pipe
- Float_t yoffs = kSensHeight/2. - kYoverlap;
- Float_t epsilon = 0.001;
- Int_t ndiv = 10;
- Double_t divpar[3];
- Double_t dydiv = kSensHeight/ndiv;
- Double_t ydiv = yoffs -dydiv;
- Int_t imax = 0;
- // for (Int_t islat=0; islat<kNslats3; islat++) imax += kNPCB3[islat];
- imax = 1;
- Float_t rmin = 40.;
- Float_t shiftR = 0.;
- for (Int_t idiv = 0;idiv < ndiv; idiv++){
- ydiv += dydiv;
- Float_t xdiv = 0.;
- if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
- divpar[0] = (kPcbLength-xdiv-shiftR)/2.;
- divpar[1] = dydiv/2. - epsilon;
- divpar[2] = kSensWidth/2.;
- Float_t xvol = (kPcbLength+xdiv)/2.+ shiftR;
- Float_t yvol = ydiv + dydiv/2.;
-
- for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
- sprintf(idSlatCh9,"LE%d",ConvertSlatNum(1,quadrant,kNslats5-1));
- sprintf(idSlatCh10,"LF%d",ConvertSlatNum(1,quadrant,kNslats5-1));
-
- GetEnvelopes(8)->AddEnvelopeConstituentParam("S09G", idSlatCh9, quadrant*100+imax+4*idiv+1,
- TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
- GetEnvelopes(9)->AddEnvelopeConstituentParam("S10G", idSlatCh10, quadrant*100+imax+4*idiv+1,
- TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
- }
- }
- // cout << "Geometry for Station 5...... done" << endl;
+ // create the sensitive volumes,
+
+ gMC->Gsvolu("S09G","BOX",kSensMaterial,dum,0);
+ gMC->Gsvolu("S10G","BOX",kSensMaterial,dum,0);
+
+ // create the vertical frame volume
+
+ gMC->Gsvolu("S09V","BOX",kVframeMaterial,vFramepar,3);
+ gMC->Gsvolu("S10V","BOX",kVframeMaterial,vFramepar,3);
+
+ // create the horizontal frame volume
+
+ gMC->Gsvolu("S09H","BOX",kHframeMaterial,hFramepar,3);
+ gMC->Gsvolu("S10H","BOX",kHframeMaterial,hFramepar,3);
+
+ // create the horizontal border volume
+
+ gMC->Gsvolu("S09B","BOX",kBframeMaterial,bFramepar,3);
+ gMC->Gsvolu("S10B","BOX",kBframeMaterial,bFramepar,3);
+
+ index = 0;
+ for (i = 0; i < kNslats5; i++){
+ for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
+
+ if (i == 0 && quadrant == 2) continue;
+ if (i == 0 && quadrant == 4) continue;
+
+ sprintf(idSlatCh9,"LE%d",ConvertSlatNum(i,quadrant,kNslats5-1));
+ sprintf(idSlatCh10,"LF%d",ConvertSlatNum(i,quadrant,kNslats5-1));
+ Float_t xvFrame = (slatLength5[i] - kVframeLength)/2.; // ok
+
+ // position the vertical frames (spacers)
+ if (i != 1) {
+ GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+ GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+ GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+ GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+ } else { // no rounded spacer yet
+ GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+ // GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+ GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+ // GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+ }
+
+ // position the panels and the insulating material
+ for (j = 0; j < kNPCB5[i]; j++){
+ if (i == 1 && j == 0) continue;
+ index++;
+ Float_t xx = kSensLength * (-kNPCB5[i]/2.+j+.5);
+
+ Float_t zPanel = spar[2] - nomexbpar[2];
+ GetEnvelopes(8)->AddEnvelopeConstituent("S09X", idSlatCh9, 2*index-1,TGeoTranslation(xx,0.,zPanel));
+ GetEnvelopes(8)->AddEnvelopeConstituent("S09X", idSlatCh9, 2*index,TGeoTranslation(xx,0.,-zPanel));
+ GetEnvelopes(8)->AddEnvelopeConstituent("S09I", idSlatCh9, index,TGeoTranslation(xx,0.,0.));
+
+ GetEnvelopes(9)->AddEnvelopeConstituent("S10X", idSlatCh10, 2*index-1,TGeoTranslation(xx,0.,zPanel));
+ GetEnvelopes(9)->AddEnvelopeConstituent("S10X", idSlatCh10, 2*index,TGeoTranslation(xx,0.,-zPanel));
+ GetEnvelopes(9)->AddEnvelopeConstituent("S10I", idSlatCh10, index,TGeoTranslation(xx,0.,0.));
+ }
+ }
+ }
+
+ // position the nomex volume inside the panel volume
+ gMC->Gspos("S09N",1,"S09C",0.,0.,0.,0,"ONLY");
+ gMC->Gspos("S10N",1,"S10C",0.,0.,0.,0,"ONLY");
+
+ // position panel volume inside the bulk nomex material volume
+ gMC->Gspos("S09C",1,"S09X",0.,0.,kNomexBWidth/2.,0,"ONLY");
+ gMC->Gspos("S10C",1,"S10X",0.,0.,kNomexBWidth/2.,0,"ONLY");
+
+ // position the PCB volume inside the insulating material volume
+ gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
+ gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
+
+ // position the horizontal frame volume inside the PCB volume
+ gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
+ gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
+
+ // position the sensitive volume inside the horizontal frame volume
+ gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
+ gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
+
+ // position the border volumes inside the PCB volume
+ Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
+ gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
+ gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
+ gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
+ gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
+
+ // // create the NULOC volume and position it in the horizontal frame
+
+ gMC->Gsvolu("S09E","BOX",kNulocMaterial,nulocpar,3);
+ gMC->Gsvolu("S10E","BOX",kNulocMaterial,nulocpar,3);
+ index = 0;
+ for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
+ index++;
+ gMC->Gspos("S09E",2*index-1,"S09B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S09E",2*index ,"S09B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S10E",2*index-1,"S10B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
+ gMC->Gspos("S10E",2*index ,"S10B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
+ }
+