103 static FairGeoLoader *geoLoad=FairGeoLoader::Instance();
104 static FairGeoInterface *geoFace=geoLoad->getGeoInterface();
105 static FairGeoMedia *media=geoFace->getMedia();
106 static FairGeoBuilder *geoBuild=geoLoad->getGeoBuilder();
108 FairGeoMedium *ShipMedium=media->getMedium(name);
112 Fatal(
"InitMedium",
"Material %s not defined in media file.", name);
115 TGeoMedium* medium=gGeoManager->GetMedium(name);
117 return ShipMedium->getMediumIndex();
118 return geoBuild->createMedium(ShipMedium);
124 Int_t NTransverse = (detID - NWall*1E4)/1E3;
125 switch (NTransverse){
147 NPlate = detID - NWall*1E4 - NTransverse*1E3;
154 Int_t NWall, NRow, NColumn, NPlate;
157 TString emulsionpath = TString::Format(
"/cave_1/Detector_0/volTarget_1/Wall_%i/Row_%i/Brick_%i/Emulsion_%i",NWall-1,NRow-1,NColumn-1,NPlate -1);
196 TGeoVolume *top=gGeoManager->FindVolumeFast(
"Detector");
197 if(!top) LOG(ERROR) <<
"no Detector volume found " ;
198 gGeoManager->SetVisLevel(10);
204 TGeoMedium *vacuum =gGeoManager->GetMedium(
"vacuum");
207 TGeoMedium *air =gGeoManager->GetMedium(
"air");
210 TGeoMedium *Al = gGeoManager->GetMedium(
"Aluminum");
213 TGeoMedium *PBase =gGeoManager->GetMedium(
"PlasticBase");
216 TGeoMedium *NEmu =gGeoManager->GetMedium(
"NuclearEmulsion");
218 TGeoMaterial *NEmuMat = NEmu->GetMaterial();
219 TGeoMaterial *PBaseMat = PBase->GetMaterial();
221 TGeoMixture * emufilmmixture =
new TGeoMixture(
"EmulsionFilmMixture", 2.00);
224 emufilmmixture->AddElement(NEmuMat,frac_emu);
225 emufilmmixture->AddElement(PBaseMat,1. - frac_emu);
227 TGeoMedium *Emufilm =
new TGeoMedium(
"EmulsionFilm",100,emufilmmixture);
230 TGeoMedium *tungsten = gGeoManager->GetMedium(
"tungstensifon");
240 TGeoVolumeAssembly *volTarget =
new TGeoVolumeAssembly(
"volTarget");
250 TGeoTranslation * Wallborderpos =
new TGeoTranslation(
"Walborderpos",0,0,
WallZBorder_offset);
251 Wallborderpos->RegisterYourself();
253 TGeoCompositeShape *Wallborder =
new TGeoCompositeShape(
"wallborder",
"walltot - (wallint:Walborderpos)");
254 TGeoVolume *volWallborder =
new TGeoVolume(
"volWallborder", Wallborder, Al);
255 volWallborder->SetLineColor(kGray);
257 TGeoVolume *volWall =
new TGeoVolume(
"Wall",Wallint,air);
261 TGeoVolume *volRow =
new TGeoVolume(
"Row",Row,air);
265 TGeoVolume *volBrick =
new TGeoVolume(
"Brick",Brick,air);
266 volBrick->SetLineColor(kCyan);
267 volBrick->SetTransparency(1);
270 TGeoVolume *volPassive =
new TGeoVolume(
"volPassive",Passive,tungsten);
271 volPassive->SetTransparency(1);
272 volPassive->SetLineColor(kGray);
274 for(Int_t n=0; n<NPlates; n++)
280 TGeoVolume *volEmulsionFilm =
new TGeoVolume(
"Emulsion",EmulsionFilm,Emufilm);
281 volEmulsionFilm->SetLineColor(kBlue);
282 LOG(INFO) <<
"EmulsionDet : Passive option (0: all active, 1: all passive) set to " <<
fPassiveOption ;
284 for(Int_t n=0; n<NPlates+1; n++)
289 volBrick->SetVisibility(kTRUE);
296 top->AddNode(volTarget,1,
new TGeoTranslation(0,0,0));
302 for(
int l = 0; l <
fNWall; l++)
312 for(
int k= 0; k<
fNRow; k++)
314 volWall->AddNode(volRow,k,
new TGeoTranslation(0, d_cl_y +
BrickY/2,0));
322 for(
int j= 0; j <
fNCol; j++)
324 volRow->AddNode(volBrick,j,
new TGeoTranslation(d_cl_x+
BrickX/2, 0, 0));
337 if ( gMC->IsTrackEntering() ) {
339 fTime = gMC->TrackTime() * 1.0e09;
341 gMC->TrackPosition(
fPos);
342 gMC->TrackMomentum(
fMom);
348 if ( gMC->IsTrackExiting() ||
349 gMC->IsTrackStop() ||
350 gMC->IsTrackDisappeared() ) {
351 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
356 Int_t MaxLevel = gGeoManager->GetLevel();
357 const Int_t MaxL = MaxLevel;
366 name = gMC->CurrentVolName();
370 Int_t NWall = -2, NColumn =-2, NRow =-2;
372 for(Int_t i = 0; i <= MaxL;i++)
374 gMC->CurrentVolOffID(i, motherV[i]);
375 const char *mumname = gMC->CurrentVolOffName(i);
377 if(strcmp(mumname,
"Brick") == 0) NColumn = (1-motherV[i]);
378 if(strcmp(mumname,
"Row") == 0) NRow = motherV[i];
379 if(strcmp(mumname,
"Wall") == 0) NWall = motherV[i];
383 detID = (NWall+1)*1E4+(NRow*2+NColumn+1)*1E3+(NPlate+1);
387 TParticle* p=gMC->GetStack()->GetCurrentTrack();
388 Int_t pdgCode = p->GetPdgCode();
389 if (pdgCode == 22) {
return kFALSE; }
392 gMC->TrackPosition(Pos);
393 Double_t xmean = (
fPos.X()+Pos.X())/2. ;
394 Double_t ymean = (
fPos.Y()+Pos.Y())/2. ;
395 Double_t zmean = (
fPos.Z()+Pos.Z())/2. ;
398 gMC->TrackMomentum(Mom);
401 fELoss,pdgCode,TVector3(Pos.X(), Pos.Y(), Pos.Z()),TVector3(Mom.Px(), Mom.Py(), Mom.Pz()) );
445 TVector3 pos, TVector3 mom,
446 Double_t time, Double_t length,
447 Double_t eLoss, Int_t pdgCode,TVector3 Lpos, TVector3 Lmom)
450 Int_t size = clref.GetEntriesFast();
452 time, length, eLoss, pdgCode,Lpos,Lmom);
EmulsionDetPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgcode, TVector3 Lpos, TVector3 Lmom)