10#include "FairGeoVolume.h"
11#include "FairGeoNode.h"
12#include "FairRootManager.h"
13#include "FairGeoLoader.h"
14#include "FairGeoInterface.h"
15#include "FairGeoMedia.h"
16#include "FairGeoBuilder.h"
18#include "FairRuntimeDb.h"
22#include "TClonesArray.h"
23#include "TVirtualMC.h"
24#include "TGeoManager.h"
26#include "TGeoCompositeShape.h"
28#include "TGeoMaterial.h"
29#include "TGeoMedium.h"
37 : FairDetector(
"strawtubes", kTRUE,
kVETO),
45 fstrawtubesPointCollection(new TClonesArray(
"strawtubesPoint"))
79 fstrawtubesPointCollection(new TClonesArray(
"strawtubesPoint"))
93 FairDetector::Initialize();
101 static FairGeoLoader *geoLoad=FairGeoLoader::Instance();
102 static FairGeoInterface *geoFace=geoLoad->getGeoInterface();
103 static FairGeoMedia *media=geoFace->getMedia();
104 static FairGeoBuilder *geoBuild=geoLoad->getGeoBuilder();
106 FairGeoMedium *ShipMedium=media->getMedium(name);
110 Fatal(
"InitMedium",
"Material %s not defined in media file.", name);
113 TGeoMedium* medium=gGeoManager->GetMedium(name);
115 return ShipMedium->getMediumIndex();
117 return geoBuild->createMedium(ShipMedium);
125 if (
gMC->IsTrackEntering() ) {
137 if (
gMC->IsTrackExiting() ||
138 gMC->IsTrackStop() ||
139 gMC->IsTrackDisappeared() ) {
140 fTrackID =
gMC->GetStack()->GetCurrentTrackNumber();
142 if (
fELoss == 0. ) {
return kFALSE; }
148 std::cout <<
"+add straw point"<<std::endl;
173 FairRootManager::Instance()->Register(
"strawtubesPoint",
"strawtubes",
182 else {
return NULL; }
272 std::cout <<
"start straw geo"<<std::endl;
273 TGeoVolume *
top = gGeoManager->GetTopVolume();
275 TGeoMedium *air = gGeoManager->GetMedium(
"air");
277 TGeoMedium *Se = gGeoManager->GetMedium(
"ShipSens");
279 TGeoMedium *Al = gGeoManager->GetMedium(
"aluminium");
281 TGeoMedium *mylar = gGeoManager->GetMedium(
"mylar");
283 TGeoMedium *sttmix9010_2bar = gGeoManager->GetMedium(
"STTmix9010_2bar");
285 TGeoMedium *tungsten = gGeoManager->GetMedium(
"tungsten");
287 TGeoMedium *med = gGeoManager->GetMedium(
"vacuum");
292 Double_t framewidth = 40.;
302 Int_t nel,numed,isvol,ifield;
303 Double_t radl, absl, TStationz;
313 TGeoCompositeShape *detcomp1 =
new TGeoCompositeShape(
"detcomp1",
"detbox1-detbox2");
315 TGeoVolume *vetovac =
new TGeoVolume(
"Veto", vetovacbox, med);
318 top->AddNode(vetovac, 1,
new TGeoTranslation(0, 0,
fT0z));
324 TString nmveto =
"Veto";
326 for (Int_t vnb=0; vnb<2; vnb++) {
335 nmview = nmveto+
"_x";
339 nmview = nmveto+
"_u";
343 nmview = nmveto+
"_x";
346 TGeoVolume *viewframe =
new TGeoVolume(nmview, detcomp1, Al);
350 r5.SetAngles(angle,0,0);
351 TGeoCombiTrans c5(t5, r5);
352 TGeoHMatrix *h5 =
new TGeoHMatrix(c5);
353 vetovac->AddNode(viewframe, 4*10000000+vnb*1000000,h5);
356 viewframe->SetLineColor(kRed);
360 for (Int_t pnb=0; pnb<2; pnb++) {
362 TString nmplane = nmview+
"_plane_"; nmplane += pnb;
365 TGeoVolume *planebox =
new TGeoVolume(nmplane, plane, med);
368 viewframe->AddNode(planebox, 4*10000000+vnb*1000000+pnb*100000,
new TGeoTranslation(0, 0,(pnb-1./2.)*
fDeltaz_plane12));
369 planebox->SetVisibility(kFALSE);
444 for (Int_t statnb=0;statnb<4;statnb++) {
446 TString nmstation =
"Tr"; nmstation += statnb;
465 TGeoVolume *vac =
new TGeoVolume(nmstation, vacbox, med);
468 top->AddNode(vac, 5,
new TGeoTranslation(0, 0, TStationz));
470 for (Int_t vnb=0; vnb<4; vnb++) {
480 nmview = nmstation+
"_x1";
484 nmview = nmstation+
"_u";
488 nmview = nmstation+
"_v";
492 nmview = nmstation+
"_x2";
496 nmview = nmstation+
"_x1";
499 TGeoVolume *viewframe =
new TGeoVolume(nmview, detcomp1, Al);
503 r5.SetAngles(angle,0,0);
504 TGeoCombiTrans c5(t5, r5);
505 TGeoHMatrix *h5 =
new TGeoHMatrix(c5);
506 vac->AddNode(viewframe, statnb*10000000+vnb*1000000,h5);
509 viewframe->SetLineColor(kRed);
515 TGeoTube *straw_tube =
new TGeoTube(
"_straw_",rmin,rmax,
fStraw_length-4.*eps);
516 TGeoVolume *
straw =
new TGeoVolume(
"_straw_",straw_tube, mylar);
517 straw->SetLineColor(4);
519 AddSensitiveVolume(straw);
524 TGeoTube *gas_tube =
new TGeoTube(
"_gas_",rmin,rmax,
fStraw_length-6.*eps);
525 TGeoVolume *gas =
new TGeoVolume(
"_gas_",gas_tube, sttmix9010_2bar);
526 gas->SetLineColor(5);
532 TGeoTube *wire_tube =
new TGeoTube(
"wire",rmin,rmax,
fStraw_length-8.*eps);
533 TGeoVolume *wire =
new TGeoVolume(
"_wire_",wire_tube, tungsten);
534 wire->SetLineColor(6);
537 for (Int_t pnb=0; pnb<2; pnb++) {
539 TString nmplane = nmview+
"_plane_"; nmplane += pnb;
542 TGeoVolume *planebox =
new TGeoVolume(nmplane, plane, med);
545 viewframe->AddNode(planebox, statnb*10000000+vnb*1000000+pnb*100000,
new TGeoTranslation(0, 0,(pnb-1./2.)*
fDeltaz_plane12));
550 for (Int_t lnb=0; lnb<2; lnb++) {
551 TString nmlayer = nmplane+
"_layer_"; nmlayer += lnb;
554 TGeoVolume *layerbox =
new TGeoVolume(nmlayer, layer, med);
556 planebox->AddNode(layerbox, statnb*10000000+vnb*1000000+pnb*100000+lnb*10000,
new TGeoTranslation(0,0,(lnb-1./2.)*
fDeltaz_layer12));
569 r6s.SetAngles(0,90,0);
570 TGeoCombiTrans c6s(t6s, r6s);
571 TGeoHMatrix *h6s =
new TGeoHMatrix(c6s);
574 layerbox->AddNode(straw,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+1000+snb,h6s);
575 layerbox->AddNode(gas,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+2000+snb,h6s);
576 layerbox->AddNode(wire,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+3000+snb,h6s);
589 std::cout <<
"end straw geo"<<std::endl;
593 TVector3 pos, TVector3 mom,
594 Double_t time, Double_t length,
598 Int_t size = clref.GetEntriesFast();
599 cout <<
"strawtubes hit called pos.z="<<
pos.z()<<
" detID= "<<detID<<endl;
601 time, length, eLoss);
Double_t fT2z
z-position of tracking station 1
Int_t fVolumeID
track index
virtual void EndOfEvent()
strawtubesPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode, Double_t dist2Wire)
void SetDeltazPlane(Double_t deltazplane)
void SetZpositions(Double_t z0, Double_t z1, Double_t z2, Double_t z3, Double_t z4)
void SetVacBox_x(Double_t vacbox_x)
TLorentzVector fMom
position at entrance
Double_t fDeltaz_view
Material of the view frame.
TLorentzVector fPos
volume id
Int_t fStraws_per_layer
Offset (x) between straws of plane1&2.
TClonesArray * fstrawtubesPointCollection
spatial resolution
Double_t fInner_Straw_diameter
strawlength for veto station
void SetInnerStrawDiameter(Double_t innerstrawdiameter)
Double_t fDeltaz_plane12
Distance (z) between layer 1&2.
virtual void Initialize()
void SetStrawsPerLayer(Int_t strawsperlayer)
Double_t fOffset_layer12
Distance (z) between plane 1&2.
void SetStereoAngle(Int_t stereoangle)
virtual TClonesArray * GetCollection(Int_t iColl) const
Int_t InitMedium(const char *name)
Double_t fStraw_length
z-position of tracking station 4
Double_t fT3z
z-position of tracking station 2
void SetStrawLength(Double_t strawlength)
Double_t fT1z
z-position of veto station
Double_t fStraw_pitch
Outer Straw diameter.
Double_t fDeltaz_layer12
Distance (x) between straws in one layer.
Double_t fOffset_plane12
Offset (x) between straws of layer2&1.
Double_t fTime
momentum at entrance
void SetOuterStrawDiameter(Double_t outerstrawdiameter)
void SetWireThickness(Double_t wirethickness)
void SetStrawPitch(Double_t strawpitch, Double_t layer_offset, Double_t plane_offset)
void SetDeltazLayer(Double_t deltazlayer)
virtual Bool_t ProcessHits(FairVolume *v=0)
Double_t fVacBox_x
Distance (z) between views.
void SetDeltazView(Double_t deltazview)
Double_t fVacBox_y
x size of station vacuumbox
Double_t fView_angle
Number of straws in one layer.
Double_t fOuter_Straw_diameter
Inner Straw diameter.
void SetVacBox_y(Double_t vacbox_y)
Double_t fT4z
z-position of tracking station 3
ClassImp(ecalContFact) ecalContFact
real(dp), parameter, public eps