void CreateGeoComplex() { const Double_t kDx = 0.96; // in cm!! const Double_t kDy = 0.96; // in cm!! const Double_t kDz = 0.015; // in cm!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // Positions of the detector // Sensors displaced along z, laying on perpendicular xy plane, // there centered in (0,0) // 4 double sided sensors const Double_t kPos1 = 78.; // (cm) Box 1 const Double_t kPos2 = 90.; // (cm) Box 4 const Double_t kPos3 = 144.; // (cm) Box 2 const Double_t kPos4 = 156.; // (cm) Box 3 // positional corrections (displacement) of each sensor // these values are obtained by the software alignment procedure const Double_t offs1x = +0..; // box1 const Double_t offs1y = +0.; const Double_t offs2x = +0.; // box2 const Double_t offs2y = +0.; const Double_t offs3x = +0.; // box3 const Double_t offs3y = +0.; const Double_t offs4x = +0.; // box4 const Double_t offs4y = +0.; //################################################## //***********************************SENSORE********************************************* const Double_t dy =0.16;//3.2 mm const Double_t dx =0.1;//2 mm const Double_t dz =0.005; //100 micron //***********************************SENSORE PASSIVO**************************** const Double_t dy_p = 0.1; const Double_t dx_p = 0.16; const Double_t dz_p = 0.001; //20 micron const Double_t dz_r = 0.015; //300 micron spess chip //-----------------------------TRASLAZIONE DAL PUNTO 0 const Double_t z_board0 = 115.;// 2cm valore a caso di distanza tra origine e primo piano const Double_t z_board1 = z_board0+6.;//6 cm tra un piano e l'altro const Double_t z_board2 = z_board0+12.; const Double_t z_board3 = z_board0+18.; //################################################## gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C"); // Load this libraries gSystem->Load("libGeoBase"); gSystem->Load("libParBase"); gSystem->Load("libBase"); gSystem->Load("libPndData"); gSystem->Load("libPassive"); TString outfile= "Juelich3CompleteSetupCompact.root"; TFile* fi = new TFile(outfile,"RECREATE"); FairGeoLoader* geoLoad = new FairGeoLoader("TGeo","FairGeoLoader"); FairGeoInterface *geoFace = geoLoad->getGeoInterface(); geoFace->setMediaFile("/disk/user/bianco/pandaroot/32bit/DataAnalysis/trunk/geometry/media_pnd.geo"); geoFace->readMedia(); geoFace->print(); //################################################## FairGeoMedia *Media = geoFace->getMedia(); FairGeoBuilder *geobuild=geoLoad->getGeoBuilder(); FairGeoMedium *CbmMediumAir = Media->getMedium("air"); FairGeoMedium *CbmMediumSilicon = Media->getMedium("silicon"); Int_t nmed=geobuild->createMedium(CbmMediumAir); nmed=geobuild->createMedium(CbmMediumSilicon); TGeoManager* gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom"); TGeoVolume *top = new TGeoVolumeAssembly("TrackingStation"); gGeoMan->SetTopVolume(top); TGeoShape *BoxDouble1 = new TGeoBBox("StripActiveTD1", kDx, kDy, kDz); TGeoShape *BoxDouble2 = new TGeoBBox("StripActiveTD2", kDx, kDy, kDz); TGeoShape *BoxDouble3 = new TGeoBBox("StripActiveTD3", kDx, kDy, kDz); TGeoShape *BoxDouble4 = new TGeoBBox("StripActiveTD4", kDx, kDy, kDz); TGeoVolume* BoxVolDouble1 = new TGeoVolume("StripActiveTD1",BoxDouble1,gGeoMan->GetMedium("silicon")); TGeoVolume* BoxVolDouble2 = new TGeoVolume("StripActiveTD2",BoxDouble2,gGeoMan->GetMedium("silicon")); TGeoVolume* BoxVolDouble3 = new TGeoVolume("StripActiveTD3",BoxDouble3,gGeoMan->GetMedium("silicon")); TGeoVolume* BoxVolDouble4 = new TGeoVolume("StripActiveTD4",BoxDouble4,gGeoMan->GetMedium("silicon")); // pixels TGeoShape *Active = new TGeoBBox("Active", dx, dy, dz); TGeoShape *Passive = new TGeoBBox("Passive", dx_p,dy_p,dz_p); TGeoShape *Readout = new TGeoBBox("Readout", dx_p,dy_p,dz_r); TGeoVolume* Sensore = new TGeoVolume("PixelActive" ,Active ,gGeoMan->GetMedium("silicon")); TGeoVolume* Sensore_p = new TGeoVolume("PixelPassive",Passive ,gGeoMan->GetMedium("silicon")); TGeoVolume* Lettura = new TGeoVolume("Readout",Readout ,gGeoMan->GetMedium("silicon")); // transofrmations TGeoTranslation* trt1 = new TGeoTranslation(offs1x,offs1y,kPos1); TGeoTranslation* trt2 = new TGeoTranslation(offs2x,offs2y,kPos2); TGeoTranslation* trt3 = new TGeoTranslation(offs3x,offs3y,kPos3); TGeoTranslation* trt4 = new TGeoTranslation(offs4x,offs4y,kPos4); TGeoRotation* dummyrot = new TGeoRotation(); // TO COMBINE DIFFERENT TILTS TGeoCombiTrans* trc1= new TGeoCombiTrans(*trt1,*dummyrot); trc1->SetName("Sensor1"); trc1->RegisterYourself(); TGeoCombiTrans* trc2= new TGeoCombiTrans(*trt2,*dummyrot); trc2->SetName("Sensor2"); trc2->RegisterYourself(); TGeoCombiTrans* trc3= new TGeoCombiTrans(*trt3,*dummyrot); trc3->SetName("Sensor3"); trc3->RegisterYourself(); TGeoCombiTrans* trc4= new TGeoCombiTrans(*trt4,*dummyrot); trc4->SetName("Sensor4"); trc4->RegisterYourself(); // for pixels TGeoTranslation* tr_pas = new TGeoTranslation(0,0,-0.020); TGeoTranslation* tr_act = new TGeoTranslation(0,0,-0.014); TGeoTranslation* tr_rea = new TGeoTranslation(0,0,+0.006); TGeoRotation* rot_active = new TGeoRotation(); rot_active->SetAngles(0,0,90.); TGeoCombiTrans* tra_passive= new TGeoCombiTrans(*tr_pas,*dummyrot); TGeoCombiTrans* tra_active= new TGeoCombiTrans(*tr_act,*rot_active); TGeoCombiTrans* tra_rea= new TGeoCombiTrans(*tr_rea,*dummyrot); TGeoVolumeAssembly* sensore = new TGeoVolumeAssembly("Sensor"); sensore->AddNode(Sensore_p,2,tra_passive); sensore->AddNode(Sensore,1,tra_active); sensore->AddNode(Lettura,3,tra_rea); TGeoTranslation* tr_sens = new TGeoTranslation(0.,0.,0.); TGeoCombiTrans* trc_sens = new TGeoCombiTrans(*tr_sens,*dummyrot); TGeoVolumeAssembly* top0 = new TGeoVolumeAssembly("Board"); top0->AddNode(sensore,0,trc_sens); //traslation of the board assembly: sensors+readout+chip TGeoTranslation* tr_1 = new TGeoTranslation(0,+0,z_board0); TGeoCombiTrans* trc_1 = new TGeoCombiTrans(*tr_1,*dummyrot); TGeoTranslation* tr_2 = new TGeoTranslation(0,0,z_board1); TGeoCombiTrans* trc_2 = new TGeoCombiTrans(*tr_2,*dummyrot); TGeoTranslation* tr_3 = new TGeoTranslation(0,0,z_board2); TGeoCombiTrans* trc_3 = new TGeoCombiTrans(*tr_3,*dummyrot); TGeoTranslation* tr_4 = new TGeoTranslation(0,0,z_board3); TGeoCombiTrans* trc_4 = new TGeoCombiTrans(*tr_4,*dummyrot); TGeoVolume* top1 = new TGeoVolumeAssembly("Board_1"); top1->AddNode(top0,0,trc_1); TGeoVolume* top2 = new TGeoVolumeAssembly("Board_2"); top2->AddNode(top0,0,trc_2); TGeoVolume* top3 = new TGeoVolumeAssembly("Board_3"); top3->AddNode(top0,0,trc_3); TGeoVolume* top4 = new TGeoVolumeAssembly("Board_4"); top4->AddNode(top0,0,trc_4); TGeoVolume* setup = new TGeoVolumeAssembly("Setup_Pixel"); setup->AddNode(top1,0,new TGeoCombiTrans()); setup->AddNode(top2,0,new TGeoCombiTrans()); setup->AddNode(top3,0,new TGeoCombiTrans()); setup->AddNode(top4,0,new TGeoCombiTrans()); TGeoVolumeAssembly* SubunitVol = new TGeoVolumeAssembly("TTVol"); TGeoVolumeAssembly* SubunitDouble = new TGeoVolumeAssembly("TrDouble"); SubunitDouble->AddNode(BoxVolDouble1,0,trc1); SubunitDouble->AddNode(BoxVolDouble2,0,trc2); SubunitDouble->AddNode(BoxVolDouble3,0,trc3); SubunitDouble->AddNode(BoxVolDouble4,0,trc4); SubunitVol->AddNode(SubunitDouble,0,new TGeoCombiTrans()); SubunitVol->AddNode(setup,0,new TGeoCombiTrans()); top->AddNode(SubunitVol,0,new TGeoCombiTrans()); gGeoMan->CloseGeometry(); //gGeoMan->Export(outfile.Data()); top->Write(); fi->Close(); top->Draw("ogl"); gGeoManager->SetVisLevel(10); }