// ------------------------------------------------------------------------- // ----- Kratta source file ----- // ----- Created 26.01.2012 by S.Kupny ----- // ----- based on class R3BChimera ----- // ------------------------------------------------------------------------- #include #include #include #include #include "FairGeoInterface.h" #include "FairGeoLoader.h" #include "FairGeoNode.h" #include "FairGeoRootBuilder.h" #include "FairRootManager.h" #include "FairStack.h" #include "FairRuntimeDb.h" #include "FairRun.h" #include "FairVolume.h" #include "FairGeoMedia.h" #include "TClonesArray.h" #include "TGeoMCGeometry.h" #include "TParticle.h" #include "TVirtualMC.h" #include "TObjArray.h" #include "TGeoVoxelFinder.h" #include "TGeoMatrix.h" // includes for modeling #include "TGeoManager.h" #include "TParticle.h" #include "TVirtualMC.h" #include "TGeoMatrix.h" #include "TGeoMaterial.h" #include "TGeoMedium.h" #include "TGeoBBox.h" #include "TGeoPara.h" #include "TGeoPgon.h" #include "TGeoSphere.h" #include "TGeoArb8.h" #include "TGeoCone.h" #include "TGeoBoolNode.h" #include "TGeoCompositeShape.h" #include "KrattaGeo.h" #include "KrattaPoint.h" #include "KrattaGeoPar.h" #include "Kratta.h" using namespace std; using std::cout; using std::cerr; using std::endl; // ----- Default constructor ------------------------------------------- Kratta::Kratta() : R3BDetector("Kratta", kTRUE, kTOF) { ResetParameters(); fKrakowCollection = new TClonesArray("KrattaPoint"); fPosIndex = 0; kGeoSaved = kFALSE; flGeoPar = new TList(); flGeoPar->SetName( GetName()); fVerboseLevel = 1; fCutE=1.0e-03; // 1 MeV default fGeoDistanceFromTargetToFirstCrystal = 40.2; // cm fGeoModuleAngle = 5.257; // deg fGeoColumnAngle = 6.00; // deg } // ------------------------------------------------------------------------- // ----- Standard constructor ------------------------------------------ Kratta::Kratta(const char* name, Bool_t active) : R3BDetector(name, active, kTOF) { ResetParameters(); fKrakowCollection = new TClonesArray("KrattaPoint"); fPosIndex = 0; kGeoSaved = kFALSE; flGeoPar = new TList(); flGeoPar->SetName( GetName()); fVerboseLevel = 1; fCutE=1.0e-03; // 1MeV default fGeoDistanceFromTargetToFirstCrystal = 40.2; // cm fGeoModuleAngle = 5.257; // deg fGeoColumnAngle = 6.00; // deg } // ------------------------------------------------------------------------- // ----- Destructor ---------------------------------------------------- Kratta::~Kratta() { if ( flGeoPar ) delete flGeoPar; if (fKrakowCollection) { fKrakowCollection->Delete(); delete fKrakowCollection; } } // ------------------------------------------------------------------------- void Kratta::Initialize() { FairDetector::Initialize(); cout << endl; cout << "-I- Kratta: initialisation" << endl; //cout << "-I- Kratta: Sci. Vol. (McId) " << gMC->VolId("TOFLog")<< endl; // Check me // Initialise variables from Birk law Double_t dP = 1. ; // Set constants for Birk's Law implentation fBirkC0 = 1.; fBirkC1 = 0.0023/dP; fBirkC2 = 0./(dP * dP); fBirkCS0 = 1.; //fBirkCS1 = 1.2/dP; //fBirkCS1 = 0.033/dP;//2 0.013 0.023 ///The first simulation done with value 0.033/dP. fBirkCS1 = 0.013/dP; /// See Simone Santoro e-mail from 2012-09-15. fBirkCS2 = 0./(dP * dP); } void Kratta::SetSpecialPhysicsCuts() { } // ----- Public method ProcessHits -------------------------------------- Bool_t Kratta::ProcessHits(FairVolume* vol) { // Simple Det PLane // cout << "WE ARE IN ProcessHits " << endl; if ( gMC->IsTrackEntering() ) { fELoss = 0.; fLightYield = 0.; fSlow = 0.; fTime = gMC->TrackTime() * 1.0e09; fLength = gMC->TrackLength(); gMC->TrackPosition(fPosIn); gMC->TrackMomentum(fMomIn); } // Sum energy loss for all steps in the active volume fELoss += gMC->Edep(); ///Calculate light components (fast and slow): Double_t lightYield = gMC->Edep() ; Double_t slow = gMC->Edep() ;//2 if (gMC->TrackCharge()!=0) { Double_t birkC1Mod = 0; /// Apply correction for higher charge states if ( fBirkC0 == 1) { if ( TMath::Abs(gMC->TrackCharge()) >= 2 ) birkC1Mod = fBirkC1*1.; else birkC1Mod = fBirkC1; } if ( gMC->TrackCharge() < 0 ) birkC1Mod=0; Double_t birkCS1Mod = 0; /// Apply correction for higher charge states if (fBirkCS0 == 1) { if ( TMath::Abs( gMC->TrackCharge() ) >= 2) birkCS1Mod = fBirkCS1*1.; else birkCS1Mod = fBirkCS1; } if ( gMC->TrackCharge() < 0 ) birkCS1Mod = 0; //2 Double_t dedxcm = 0.; Double_t lightYieldxcm = 0.; if ( gMC->TrackStep() > 0 ) { dedxcm = 1000. * gMC->Edep()/( gMC->TrackStep()*4.51 ); lightYield = lightYield / (1.+ birkC1Mod*dedxcm + fBirkC2*dedxcm*dedxcm ); //1 Double_t slow = lightYield ; fLightYield = fLightYield + lightYield; //1 lightYieldxcm = lightYield / ( gMC->TrackStep() ); //1 slow = slow / ( 1. + birkCS1Mod*lightYieldxcm + fBirkCS2*lightYieldxcm*lightYieldxcm ); slow = slow / (1. + birkCS1Mod*dedxcm + fBirkCS2*dedxcm*dedxcm);//2 fSlow = fSlow + slow; } } ///End of Calculation light components (fast and slow) /// Set additional parameters at exit of active volume. Create R3BChimeraPoint. if ( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared() ) { fTrackID = gMC->GetStack()->GetCurrentTrackNumber(); fVolumeID = vol->getMCid(); gMC->TrackPosition(fPosOut); gMC->TrackMomentum(fMomOut); if (fELoss == 0. ) return kFALSE; if (gMC->IsTrackExiting()) { const Double_t* oldpos; const Double_t* olddirection; Double_t newpos[3]; Double_t newdirection[3]; Double_t safety; gGeoManager->FindNode(fPosOut.X(),fPosOut.Y(),fPosOut.Z()); oldpos = gGeoManager->GetCurrentPoint(); olddirection = gGeoManager->GetCurrentDirection(); // cout << "1st direction: " << olddirection[0] << "," << olddirection[1] << "," << olddirection[2] << endl; for (Int_t i=0; i<3; i++){ newdirection[i] = -1*olddirection[i]; } gGeoManager->SetCurrentDirection(newdirection); // TGeoNode *bla = gGeoManager->FindNextBoundary(2); safety = gGeoManager->GetSafeDistance(); gGeoManager->SetCurrentDirection(-newdirection[0],-newdirection[1],-newdirection[2]); for (Int_t i=0; i<3; i++){ newpos[i] = oldpos[i] - (3*safety*olddirection[i]); } if ( fPosIn.Z() < 30. && newpos[2] > 30.02 ) { cerr << "2nd direction: " << olddirection[0] << "," << olddirection[1] << "," << olddirection[2] << " with safety = " << safety << endl; cerr << "oldpos = " << oldpos[0] << "," << oldpos[1] << "," << oldpos[2] << endl; cerr << "newpos = " << newpos[0] << "," << newpos[1] << "," << newpos[2] << endl; } fPosOut.SetX(newpos[0]); fPosOut.SetY(newpos[1]); fPosOut.SetZ(newpos[2]); } AddHit(fTrackID, fVolumeID, TVector3(fPosIn.X(), fPosIn.Y(), fPosIn.Z()), TVector3(fPosOut.X(), fPosOut.Y(), fPosOut.Z()), TVector3(fMomIn.Px(), fMomIn.Py(), fMomIn.Pz()), TVector3(fMomOut.Px(), fMomOut.Py(), fMomOut.Pz()), fTime, fLength, fELoss, fLightYield, fSlow); // Increment number of ChimeraPoints for this track FairStack* stack = (FairStack*) gMC->GetStack(); stack->AddPoint(kTOF); ResetParameters(); } return kTRUE; } // ---------------------------------------------------------------------------- //void Kratta::SaveGeoParams(){ // // cout << " -I Save STS geo params " << endl; // // TFolder *mf = (TFolder*) gDirectory->FindObjectAny("cbmroot"); // cout << " mf: " << mf << endl; // TFolder *stsf = NULL; // if (mf ) stsf = (TFolder*) mf->FindObjectAny(GetName()); // cout << " stsf: " << stsf << endl; // if (stsf) stsf->Add( flGeoPar0 ) ; // FairRootManager::Instance()->WriteFolder(); // mf->Write("cbmroot",TObject::kWriteDelete); //} // ----- Public method EndOfEvent ----------------------------------------- void Kratta::BeginEvent() { // if (! kGeoSaved ) { // SaveGeoParams(); // cout << "-I STS gGeoManageretry parameters saved " << endl; // kGeoSaved = kTRUE; // } } // ----- Public method EndOfEvent ----------------------------------------- void Kratta::EndOfEvent() { if (fVerboseLevel) Print(); fKrakowCollection->Clear(); ResetParameters(); } // ---------------------------------------------------------------------------- // ----- Public method Register ------------------------------------------- void Kratta::Register() { FairRootManager::Instance()->Register("KrakowPoint", GetName(), fKrakowCollection, kTRUE); } // ---------------------------------------------------------------------------- // ----- Public method GetCollection -------------------------------------- TClonesArray* Kratta::GetCollection(Int_t iColl) const { if (iColl == 0) return fKrakowCollection; else return NULL; } // ---------------------------------------------------------------------------- // ----- Public method Print ---------------------------------------------- void Kratta::Print() const { Int_t nHits = fKrakowCollection->GetEntriesFast(); cout << "-I- Kratta: " << nHits << " points registered in this event." << endl; } // ---------------------------------------------------------------------------- // ----- Public method Reset ---------------------------------------------- void Kratta::Reset() { fKrakowCollection->Clear(); ResetParameters(); } // ---------------------------------------------------------------------------- // ----- Public method CopyClones ----------------------------------------- void Kratta::CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset) { Int_t nEntries = cl1->GetEntriesFast(); cout << "-I- Kratta: " << nEntries << " entries to add." << endl; TClonesArray& clref = *cl2; KrattaPoint* oldpoint = NULL; for (Int_t i=0; iAt(i); Int_t index = oldpoint->GetTrackID() + offset; oldpoint->SetTrackID(index); new (clref[fPosIndex]) KrattaPoint(*oldpoint); fPosIndex++; } cout << " -I- Kratta: " << cl2->GetEntriesFast() << " merged entries." << endl; } // ----- Private method AddHit -------------------------------------------- KrattaPoint* Kratta::AddHit(Int_t trackID, Int_t detID, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut, Double_t time, Double_t length, Double_t eLoss, Double_t lightYield, Double_t slow) { TClonesArray& clref = *fKrakowCollection; Int_t size = clref.GetEntriesFast(); if (fVerboseLevel>1) cout << "-I- Kratta: Adding Point at (" << posIn.X() << ", " << posIn.Y() << ", " << posIn.Z() << ") cm, detector " << detID << ", track " << trackID << ", energy loss " << eLoss*1e06 << " keV" << endl; return new(clref[size]) KrattaPoint(trackID, detID, posIn, posOut, momIn, momOut, time, length, eLoss, lightYield, slow); } // ----- Public method ConstructGeometry ---------------------------------- void Kratta::ConstructGeometry() { TString fileName=GetGeometryFileName(); //TString fileName = "/home/sebastian/Projects/ProgramyAktualnieRozwijane/DetectorGeometry/gGeoManageracros/gGeoManageretryKRATTA_module.root"; if (fileName.EndsWith(".geo")) { ConstructASCIIGeometry(); } else if(fileName.EndsWith(".root")) { ConstructRootGeometry(); } else { std::cout<< "Geometry format not supported " < GetVisLevel( ) << endl; } void Kratta::ConstructRootGeometry() { /* cout << "KRATTA Geometry - construction detector gGeoManageretry from root file" << endl; TGeoVolume *Cave=NULL; if (gGeoManager) { Cave = gGeoManager->GetTopVolume(); }else{ cout << "-I- no TGEO defined ! " << endl; } TGeoVolume *cell = new TGeoVolumeAssembly("KRATTA"); // Rotation (Unity) TGeoRotation *pRot = new TGeoRotation(); pRot->RotateY(180.0); Cave->AddNode(cell,0, GetGlobalPosition( new TGeoCombiTrans("",0.,0.,0.,pRot) ) ); TFile *f=new TFile(GetGeometryFileName().Data()); TGeoVolume *krakTop=(TGeoVolume *)f->Get("WorldKRATTA"); //*** TGeoNode* n = krakTop->GetNode(0); TGeoVoxelFinder *voxels = krakTop->GetVoxels(); if (voxels) voxels->SetNeedRebuild(); TGeoMatrix *M = n->GetMatrix(); M->SetDefaultName(); gGeoManager->GetListOfMatrices()->Remove(M); TGeoHMatrix *global = gGeoManager->GetHMatrix(); gGeoManager->GetListOfMatrices()->Remove(global); //Remove the Identity matrix ExpandNode(krakTop,cell); */ } /* ///SSSSSSSKKKKKKK COMMON CODE PART.BEGINING TGeoVolume * Kratta::CreateCover (TGeoManager * gGeoManager, TGeoMedium * A_medForCover ) { /// Shapes for cover and cuts in this cover /// 0. Cover Double_t dCoverLength = 31.38; Double_t dCoverFrontEdge = 3.70; Double_t dCoverBackEdge = 6.58; Double_t P000 = 0. ; ///Polozenie poczatku detektora - Punkt (0,0,0) - skladowa z. Double_t dssp = 0.5; // Scale for Shape definitions Double_t epsilon = 0.01; //a small value TGeoArb8 *cover = new TGeoArb8("cover", dCoverLength * dssp ); cover ->SetVertex(0, dCoverFrontEdge * dssp, dCoverFrontEdge * dssp ); cover ->SetVertex(1, dCoverFrontEdge * dssp, - dCoverFrontEdge * dssp ); cover ->SetVertex(2, - dCoverFrontEdge * dssp, - dCoverFrontEdge * dssp ); cover ->SetVertex(3, - dCoverFrontEdge * dssp, dCoverFrontEdge * dssp); cover ->SetVertex(4, dCoverBackEdge * dssp, dCoverBackEdge * dssp ); cover ->SetVertex(5, dCoverBackEdge * dssp, - dCoverBackEdge * dssp ); cover ->SetVertex(6, - dCoverBackEdge * dssp, - dCoverBackEdge * dssp ); cover ->SetVertex(7, - dCoverBackEdge * dssp, dCoverBackEdge * dssp); TGeoTranslation *tCover = new TGeoTranslation("tCover", 0, 0, dCoverLength/2. ); tCover->RegisterYourself(); /// 1. Cut cA Double_t dcAlength = dCoverLength; Double_t dcAWidth = 2.88; Double_t dcALocation = P000 - epsilon; TGeoBBox *cA = new TGeoBBox("cA", dcAWidth * dssp, dcAWidth * dssp, dcAlength * dssp); TGeoTranslation *tcA = new TGeoTranslation("tcA", 0, 0, dcALocation + dCoverLength/2. ); tcA->RegisterYourself(); /// 2. Cut cB - Photodiode Double_t dcBLength = 0.32; Double_t dcBWidth = 3.39; Double_t dcBLocation_a = P000 + 0.74; Double_t dcBLocation_b = dcBLocation_a + dcBLength + 0.3 ; TGeoBBox *cB = new TGeoBBox("cB", dcBWidth * dssp, dcBWidth * dssp, dcBLength * dssp); TGeoTranslation *tcBa = new TGeoTranslation("tcBa", 0, 0, dcBLocation_a + dcBLength/2. ); tcBa->RegisterYourself(); TGeoTranslation *tcBb = new TGeoTranslation("tcBb", 0, 0, dcBLocation_b + dcBLength/2. ); tcBb->RegisterYourself(); /// 3. Cut cC - Crystal Double_t dcCLength = 2.55; Double_t dcCFrontEdge = 2.88; Double_t dcCBackEdge = 3.04; TGeoArb8 *cC = new TGeoArb8("cC", dcCLength * dssp ); cC ->SetVertex(0, dcCFrontEdge * dssp, dcCFrontEdge * dssp ); cC ->SetVertex(1, dcCFrontEdge * dssp, - dcCFrontEdge * dssp ); cC ->SetVertex(2, - dcCFrontEdge * dssp, - dcCFrontEdge * dssp ); cC ->SetVertex(3, - dcCFrontEdge * dssp, dcCFrontEdge * dssp); cC ->SetVertex(4, dcCBackEdge * dssp, dcCBackEdge * dssp ); cC ->SetVertex(5, dcCBackEdge * dssp, - dcCBackEdge * dssp ); cC ->SetVertex(6, - dcCBackEdge * dssp, - dcCBackEdge * dssp ); cC ->SetVertex(7, - dcCBackEdge * dssp, dcCBackEdge * dssp); Double_t dcCLocation = dcBLocation_b + dcBLength; TGeoTranslation *tcC = new TGeoTranslation("tcC", 0, 0, dcCLocation + dcCLength/2. ); tcC->RegisterYourself(); /// 4. Cut cD - Crystal Double_t dcDLength = 12.55; Double_t dcDFrontEdge = 3.39; Double_t dcDBackEdge = 3.97; TGeoArb8 *cD = new TGeoArb8("cD", dcDLength * dssp ); cD ->SetVertex(0, dcDFrontEdge * dssp, dcDFrontEdge * dssp ); cD ->SetVertex(1, dcDFrontEdge * dssp, - dcDFrontEdge * dssp ); cD ->SetVertex(2, - dcDFrontEdge * dssp, - dcDFrontEdge * dssp ); cD ->SetVertex(3, - dcDFrontEdge * dssp, dcDFrontEdge * dssp); cD ->SetVertex(4, dcDBackEdge * dssp, dcDBackEdge * dssp ); cD ->SetVertex(5, dcDBackEdge * dssp, - dcDBackEdge * dssp ); cD ->SetVertex(6, - dcDBackEdge * dssp, - dcDBackEdge * dssp ); cD ->SetVertex(7, - dcDBackEdge * dssp, dcDBackEdge * dssp); Double_t dcDLocation = dcCLocation + dcCLength; TGeoTranslation *tcD = new TGeoTranslation("tcD", 0, 0, dcDLocation + dcDLength/2.); tcD -> RegisterYourself(); /// 5. Cut cE Double_t dcElength = 0.2; Double_t dcEWidth = 4.23; Double_t dcELocation = dcDLocation + dcDLength + 0.32; TGeoBBox *cE = new TGeoBBox("cE", dcEWidth * dssp, dcEWidth * dssp, dcElength * dssp); TGeoTranslation *tcE = new TGeoTranslation("tcE", 0, 0, dcELocation + dcElength/2. ); tcE->RegisterYourself(); /// 6. Cut cF Double_t dcFlength = 1.95; Double_t dcFWidth = 3.97; Double_t dcFLocation = dcDLocation + dcDLength ; TGeoBBox *cF = new TGeoBBox("cF", dcFWidth * dssp, dcFWidth * dssp, dcFlength * dssp + epsilon); /// Look: Here is a small extension to provide cuts overlapping. TGeoTranslation *tcF = new TGeoTranslation("tcF", 0, 0, dcFLocation + dcFlength/2. - epsilon); tcF->RegisterYourself(); /// 7. Cut cG Double_t dcGlength = 1.0; Double_t dcGWidth = 4.23; Double_t dcGLocation = dcFLocation + dcFlength; TGeoBBox *cG = new TGeoBBox("cG", dcGWidth * dssp, dcGWidth * dssp, (dcGlength )* dssp + epsilon); /// Look: Here is a small extension to provide cuts overlapping. TGeoTranslation *tcG = new TGeoTranslation("tcG", 0, 0, dcGLocation + dcGlength/2. - epsilon ); tcG->RegisterYourself(); /// 8. Cut cH Double_t dcHlength = 11.65 + epsilon; /// Look: Here is a small extension to provide cuts overlapping. Double_t dcHWidth = 4.63; Double_t dcHLocation = dcGLocation + dcGlength - epsilon/2.; TGeoBBox *cH = new TGeoBBox("cH", dcHWidth * dssp, dcHWidth * dssp, dcHlength * dssp); TGeoTranslation *tcH = new TGeoTranslation("tcH", 0, 0, dcHLocation + dcHlength/2.); tcH->RegisterYourself(); TGeoCompositeShape *cc = new TGeoCompositeShape( "cc", "( (((((( cB:tcBa + cB:tcBb) + cC:tcC ) + cD:tcD ) + cE:tcE ) + cF:tcF ) + cG:tcG ) + cH:tcH ) + cA:tcA" ); TGeoCompositeShape *cs = new TGeoCompositeShape( "cs", " (cover:tCover - cc)" ); /// IV Create volume TGeoVolume * geoCover = new TGeoVolume("COMP",cs, A_medForCover); geoCover->SetLineColor(30); return geoCover; } TGeoVolume * Kratta::CreatePhotodiodeWithFrame (TGeoManager * gGeoManager, TGeoMedium * A_mediumForPhotodiode, TGeoMedium * A_mediumForFrame, TGeoMedium * A_mediumForEmptySpace ) { Double_t dssp = 0.5; // Scale for Shape definitions ///--- define the dimensions Double_t dPhotodiodeThickness = 0.05; ///[cm] Double_t dPhotodiodeEdge = 3.0; /// Photodiode crystal TGeoBBox *geoPhotodiodeCrystalShape = new TGeoBBox("Ph", dPhotodiodeEdge * dssp, dPhotodiodeEdge * dssp, dPhotodiodeThickness * dssp); TGeoVolume * geoPhotodiodeCrystal = new TGeoVolume("geoPhotodiodeCrystalShape", geoPhotodiodeCrystalShape, A_mediumForPhotodiode ); geoPhotodiodeCrystal->SetLineColor(47); ///FRAME 1 Double_t dPhotodiodeFrame1Edge = 3.38; Double_t dWindowFrame1 = 2.8; Double_t dPhotodiodeFrame1ZThickness = 0.15; Double_t dPhotodiodeFrame1YThickness = (dPhotodiodeFrame1Edge - dWindowFrame1)/2.; Double_t dPhotodiodeFrame1DistanceFromCenter = (dPhotodiodeFrame1Edge - dPhotodiodeFrame1YThickness) * dssp; /// Rotation for set TGeoTranslation *tf11 = new TGeoTranslation ( "tf1_1", 0, dPhotodiodeFrame1DistanceFromCenter, 0); TGeoTranslation *tf12 = new TGeoTranslation ( "tf1_2", 0, -dPhotodiodeFrame1DistanceFromCenter, 0); TGeoCombiTrans *ctf11 = new TGeoCombiTrans ( "ctf1_1", dPhotodiodeFrame1DistanceFromCenter,0,0, new TGeoRotation ( "rf1_1", 90, 0, 0 ) ); TGeoCombiTrans *ctf12 = new TGeoCombiTrans ( "ctf1_2", -dPhotodiodeFrame1DistanceFromCenter,0,0, new TGeoRotation ( "rf1_2" ,90, 0, 0 ) ); tf11->RegisterYourself(); tf12->RegisterYourself(); ctf11->RegisterYourself(); ctf12->RegisterYourself(); /// Frame for photodiode TGeoBBox *geoFrame1Edge = new TGeoBBox("E1", dPhotodiodeFrame1Edge * dssp, dPhotodiodeFrame1YThickness * dssp, dPhotodiodeFrame1ZThickness * dssp); TGeoCompositeShape *geoFrame1Shape = new TGeoCompositeShape( "geoFrame1Shape", "(E1:tf1_1+E1:tf1_2)+(E1:ctf1_1+E1:ctf1_2)" ); //TGeoCompositeShape *geoFrame1Shape = new TGeoCompositeShape( "geoFrame1Shape", "(E1:tf1_1+E1:tf1_2)" ); TGeoVolume * geoPhotodiodeFrame1 = new TGeoVolume("geoPhotodiodeFrame1", geoFrame1Shape, A_mediumForFrame ); geoPhotodiodeFrame1->SetLineColor(41); ///FRAME 2 Double_t dPhotodiodeFrame2Edge = 3.38; Double_t dWindowFrame2 = 3.0; Double_t dPhotodiodeFrame2ZThickness = 0.15; Double_t dPhotodiodeFrame2YThickness = (dPhotodiodeFrame2Edge - dWindowFrame2)/2.; Double_t dPhotodiodeFrame2DistanceFromCenter = (dPhotodiodeFrame2Edge - dPhotodiodeFrame2YThickness) * dssp; /// Rotation for set TGeoTranslation *tf21 = new TGeoTranslation ( "tf2_1", 0, dPhotodiodeFrame2DistanceFromCenter, 0); TGeoTranslation *tf22 = new TGeoTranslation ( "tf2_2", 0, -dPhotodiodeFrame2DistanceFromCenter, 0); TGeoCombiTrans *ctf21 = new TGeoCombiTrans ( "ctf2_1", dPhotodiodeFrame2DistanceFromCenter,0,0, new TGeoRotation ( "rf2_1", 90, 0, 0 ) ); TGeoCombiTrans *ctf22 = new TGeoCombiTrans ( "ctf2_2", -dPhotodiodeFrame2DistanceFromCenter,0,0, new TGeoRotation ( "rf2_2" ,90, 0, 0 ) ); tf21->RegisterYourself(); tf22->RegisterYourself(); ctf21->RegisterYourself(); ctf22->RegisterYourself(); /// Frame for photodiode TGeoBBox *geoFrame2Edge = new TGeoBBox("E2", dPhotodiodeFrame2Edge * dssp, dPhotodiodeFrame2YThickness * dssp, dPhotodiodeFrame2ZThickness * dssp); TGeoCompositeShape *geoFrame2Shape = new TGeoCompositeShape( "geoFrame2Shape", "(E2:tf2_1+E2:tf2_2)+(E2:ctf2_1+E2:ctf2_2)" ); TGeoVolume * geoPhotodiodeFrame2 = new TGeoVolume("geoPhotodiodeFrame2", geoFrame2Shape, A_mediumForFrame ); geoPhotodiodeFrame2->SetLineColor(41); /// Photodiode with frame TGeoVolume *geoPhotodiodeInFrame = gGeoManager->MakeBox("geoPhotodiodeInFrame", A_mediumForEmptySpace, 25, 25, 5); //geoPhotodiodeInFrame-> SetVisibility(kFALSE); geoPhotodiodeInFrame->AddNode ( geoPhotodiodeCrystal, 1, new TGeoTranslation(0, 0, dPhotodiodeFrame1ZThickness + dPhotodiodeThickness * dssp ) ); geoPhotodiodeInFrame->AddNode ( geoPhotodiodeFrame1, 2, new TGeoTranslation(0, 0, dPhotodiodeFrame1ZThickness * dssp ) ); geoPhotodiodeInFrame->AddNode ( geoPhotodiodeFrame2, 1, new TGeoTranslation(0, 0, dPhotodiodeFrame1ZThickness + dPhotodiodeFrame2ZThickness* dssp ) ); return geoPhotodiodeInFrame; } TGeoVolume * Kratta::CreatePhotodiodeThridWithFrame (TGeoManager * gGeoManager, TGeoMedium * A_mediumForPhotodiode, TGeoMedium * A_mediumForFrame, TGeoMedium * A_mediumForEmptySpace ) { Double_t dssp = 0.5; // Scale for Shape definitions ///--- define the dimensions Double_t dPhotodiodeThickness = 0.05; ///[cm] Double_t dPhotodiodeEdge = 3.0; /// Photodiode crystal TGeoBBox *geoPhotodiodeCrystalShape = new TGeoBBox("Ph3", dPhotodiodeEdge * dssp, dPhotodiodeEdge * dssp, dPhotodiodeThickness * dssp); TGeoVolume * geoPhotodiodeCrystal = new TGeoVolume("geoPhotodiodeThridCrystalShape", geoPhotodiodeCrystalShape, A_mediumForPhotodiode ); geoPhotodiodeCrystal->SetLineColor(47); ///FRAME 1 Double_t dPhotodiodeFrame1Edge = 3.90; ///3.97 - Tyle wynosi wciecie w polozeniu 16.8 + epsilon, ale jezeli przesuniemy troche w kierunku przodu, wejsciemy w sciecie stozkowe, stad zmniejszenie rozmiaru o 0.7mm Double_t dWindowFrame1 = 2.8; Double_t dPhotodiodeFrame1ZThickness = 0.15; Double_t dPhotodiodeFrame1YThickness = (dPhotodiodeFrame1Edge - dWindowFrame1)/2.; Double_t dPhotodiodeFrame1DistanceFromCenter = (dPhotodiodeFrame1Edge - dPhotodiodeFrame1YThickness) * dssp; /// Rotation for set TGeoTranslation *tf11 = new TGeoTranslation ( "tf1_13", 0, dPhotodiodeFrame1DistanceFromCenter, 0); TGeoTranslation *tf12 = new TGeoTranslation ( "tf1_23", 0, -dPhotodiodeFrame1DistanceFromCenter, 0); TGeoCombiTrans *ctf11 = new TGeoCombiTrans ( "ctf1_13", dPhotodiodeFrame1DistanceFromCenter,0,0, new TGeoRotation ( "rf1_13", 90, 0, 0 ) ); TGeoCombiTrans *ctf12 = new TGeoCombiTrans ( "ctf1_23", -dPhotodiodeFrame1DistanceFromCenter,0,0, new TGeoRotation ( "rf1_23" ,90, 0, 0 ) ); tf11->RegisterYourself(); tf12->RegisterYourself(); ctf11->RegisterYourself(); ctf12->RegisterYourself(); /// Frame for photodiode TGeoBBox *geoFrame1Edge = new TGeoBBox("E13", dPhotodiodeFrame1Edge * dssp, dPhotodiodeFrame1YThickness * dssp, dPhotodiodeFrame1ZThickness * dssp); TGeoCompositeShape *geoFrame1Shape = new TGeoCompositeShape( "geoFrame1ShapeThrid3", "(E13:tf1_13+E13:tf1_23)+(E13:ctf1_13+E13:ctf1_23)" ); //TGeoCompositeShape *geoFrame1Shape = new TGeoCompositeShape( "geoFrame1Shape", "(E1:tf1_1+E1:tf1_2)" ); TGeoVolume * geoPhotodiodeFrame1 = new TGeoVolume("geoPhotodiodeThridFrame1", geoFrame1Shape, A_mediumForFrame ); geoPhotodiodeFrame1->SetLineColor(41); ///FRAME 2 Double_t dPhotodiodeFrame2Edge = 3.90; ///3.97 - Tyle wynosi wciecie w polozeniu 16.8 + epsilon, ale jezeli przesuniemy troche w kierunku przodu, wejsciemy w sciecie stozkowe, stad zmniejszenie rozmiaru o 0.7mm Double_t dWindowFrame2 = 3.0; Double_t dPhotodiodeFrame2ZThickness = 0.15; Double_t dPhotodiodeFrame2YThickness = (dPhotodiodeFrame2Edge - dWindowFrame2)/2.; Double_t dPhotodiodeFrame2DistanceFromCenter = (dPhotodiodeFrame2Edge - dPhotodiodeFrame2YThickness) * dssp; /// Rotation for set TGeoTranslation *tf21 = new TGeoTranslation ( "tf2_13", 0, dPhotodiodeFrame2DistanceFromCenter, 0); TGeoTranslation *tf22 = new TGeoTranslation ( "tf2_23", 0, -dPhotodiodeFrame2DistanceFromCenter, 0); TGeoCombiTrans *ctf21 = new TGeoCombiTrans ( "ctf2_13", dPhotodiodeFrame2DistanceFromCenter,0,0, new TGeoRotation ( "rf2_1", 90, 0, 0 ) ); TGeoCombiTrans *ctf22 = new TGeoCombiTrans ( "ctf2_23", -dPhotodiodeFrame2DistanceFromCenter,0,0, new TGeoRotation ( "rf2_2" ,90, 0, 0 ) ); tf21->RegisterYourself(); tf22->RegisterYourself(); ctf21->RegisterYourself(); ctf22->RegisterYourself(); /// Frame for photodiode TGeoBBox *geoFrame2Edge = new TGeoBBox("E23", dPhotodiodeFrame2Edge * dssp, dPhotodiodeFrame2YThickness * dssp, dPhotodiodeFrame2ZThickness * dssp); TGeoCompositeShape *geoFrame2Shape = new TGeoCompositeShape( "geoFrame2ShapeThrid", "(E23:tf2_13+E23:tf2_23)+(E23:ctf2_13+E23:ctf2_23)" ); // TGeoCompositeShape *geoFrame2Shape = new TGeoCompositeShape( "geoFrame1Shape", "(E2:tf2_1+E2:tf2_2)" ); TGeoVolume * geoPhotodiodeFrame2 = new TGeoVolume("geoPhotodiodeThridFrame2", geoFrame2Shape, A_mediumForFrame ); geoPhotodiodeFrame2->SetLineColor(41); /// Photodiode with frame TGeoVolume *geoPhotodiodeThridInFrame = gGeoManager->MakeBox("geoPhotodiodeThridInFrame", A_mediumForEmptySpace, 25, 25, 5); //geoPhotodiodeInFrame-> SetVisibility(kFALSE); geoPhotodiodeThridInFrame->AddNode ( geoPhotodiodeCrystal, 1, new TGeoTranslation(0, 0, dPhotodiodeFrame2ZThickness - dPhotodiodeThickness * dssp ) ); geoPhotodiodeThridInFrame->AddNode ( geoPhotodiodeFrame1, 1, new TGeoTranslation(0, 0, dPhotodiodeFrame2ZThickness + dPhotodiodeFrame1ZThickness* dssp ) ); geoPhotodiodeThridInFrame->AddNode ( geoPhotodiodeFrame2, 2, new TGeoTranslation(0, 0, dPhotodiodeFrame2ZThickness * dssp ) ); return geoPhotodiodeThridInFrame; } TGeoVolume * Kratta::CreateCrystalThin (TGeoManager * gGeoManager, TGeoMedium * A_mediumForCrystal, TGeoMedium * A_mediumForReflexFoil, TGeoMedium * A_mediumForMylarFoil, TGeoMedium * A_mediumInEmptySpace ) { Double_t dssp = 0.5; // Scale for Shape definitions Double_t dCrystThin_length = 2.5; Double_t dCrystThin_edge_short = 2.8; Double_t dCrystThin_edge_long = 2.967; Double_t dCrystFoilThickness = 0.0065; // 65 um Double_t dMylarThickness = 0.006; Double_t dMylarEdge = 2.800; Double_t cutBoxEdge = dCrystThin_edge_short + dCrystFoilThickness + 0.1; //Must be larger than dCrystThin_edge_short + dCrystFoilThickness /// Crystal shape TGeoArb8 *geoCrystThinShape = new TGeoArb8 ("CThin", dCrystThin_length * dssp ); geoCrystThinShape -> SetVertex(0, dCrystThin_edge_short * dssp , dCrystThin_edge_short * dssp ); geoCrystThinShape -> SetVertex(1, dCrystThin_edge_short * dssp , - dCrystThin_edge_short * dssp ); geoCrystThinShape -> SetVertex(2, - dCrystThin_edge_short * dssp , - dCrystThin_edge_short * dssp ); geoCrystThinShape -> SetVertex(3, - dCrystThin_edge_short * dssp , dCrystThin_edge_short * dssp ); geoCrystThinShape -> SetVertex(4, dCrystThin_edge_long * dssp , dCrystThin_edge_long * dssp ); geoCrystThinShape -> SetVertex(5, dCrystThin_edge_long * dssp , - dCrystThin_edge_long * dssp ); geoCrystThinShape -> SetVertex(6, - dCrystThin_edge_long * dssp , - dCrystThin_edge_long * dssp ); geoCrystThinShape -> SetVertex(7, - dCrystThin_edge_long * dssp , dCrystThin_edge_long * dssp ); /// Cover foil shape TGeoArb8 *geoCrystThinFoilShape = new TGeoArb8 ("FThin", dCrystThin_length * dssp + dCrystFoilThickness ); geoCrystThinFoilShape -> SetVertex(0, ( dCrystThin_edge_short * dssp + dCrystFoilThickness ), ( dCrystThin_edge_short * dssp + dCrystFoilThickness ) ); geoCrystThinFoilShape -> SetVertex(1, ( dCrystThin_edge_short * dssp + dCrystFoilThickness ), - ( dCrystThin_edge_short * dssp + dCrystFoilThickness ) ); geoCrystThinFoilShape -> SetVertex(2, - ( dCrystThin_edge_short * dssp + dCrystFoilThickness ), - ( dCrystThin_edge_short * dssp + dCrystFoilThickness ) ); geoCrystThinFoilShape -> SetVertex(3, - ( dCrystThin_edge_short * dssp + dCrystFoilThickness ), ( dCrystThin_edge_short * dssp + dCrystFoilThickness ) ); geoCrystThinFoilShape -> SetVertex(4, ( dCrystThin_edge_long * dssp + dCrystFoilThickness ), ( dCrystThin_edge_long * dssp + dCrystFoilThickness ) ); geoCrystThinFoilShape -> SetVertex(5, ( dCrystThin_edge_long * dssp + dCrystFoilThickness ), - ( dCrystThin_edge_long * dssp + dCrystFoilThickness ) ); geoCrystThinFoilShape -> SetVertex(6, - ( dCrystThin_edge_long * dssp + dCrystFoilThickness ), - ( dCrystThin_edge_long * dssp + dCrystFoilThickness ) ); geoCrystThinFoilShape -> SetVertex(7, - ( dCrystThin_edge_long * dssp + dCrystFoilThickness ), ( dCrystThin_edge_long * dssp + dCrystFoilThickness ) ); /// Cut plane - to uncover one side of the crystal TGeoBBox *cutPlaneShape = new TGeoBBox ( "cP1", cutBoxEdge * dssp, cutBoxEdge * dssp, cutBoxEdge * dssp); TGeoTranslation *tCutBox = new TGeoTranslation ( "tcP1", 0, 0, - ( dCrystThin_length + cutBoxEdge) * dssp ); tCutBox -> RegisterYourself(); /// Mylar shape and object TGeoBBox *geoMylarShape = new TGeoBBox ( "geoMylarFoilShape", dMylarEdge * dssp, dMylarEdge * dssp, dMylarThickness * dssp); TGeoVolume *geoMylar = new TGeoVolume ( "geoMylarFoilVolume", geoMylarShape, A_mediumForMylarFoil ); geoMylar -> SetLineColor(4); /// Cover foil - object TGeoCompositeShape *geoFoilShape= new TGeoCompositeShape ( "s1", "(FThin - CThin) - cP1:tcP1"); TGeoVolume *geoCoverThin = new TGeoVolume ("geoCoverThin", geoFoilShape, A_mediumForReflexFoil); geoCoverThin-> SetLineColor(38); /// Crystal - object TGeoVolume *geoCrystalThin = new TGeoVolume("geoCrystalThin", geoCrystThinShape, A_mediumForCrystal); geoCrystalThin -> SetLineColor(41); TGeoVolume *geoVolume = gGeoManager->MakeBox("geoCrystalThinVolume", A_mediumInEmptySpace , 25., 25., 25.); geoVolume -> AddNode( geoCrystalThin, 1, new TGeoTranslation(0, 0, dCrystThin_length * dssp + dMylarThickness ) ); geoVolume -> AddNode( geoCoverThin, 2, new TGeoTranslation(0, 0, dCrystThin_length * dssp + dMylarThickness ) ); geoVolume -> AddNode( geoMylar, 3, new TGeoTranslation(0, 0, dMylarThickness * dssp ) ); return geoVolume; } TGeoVolume * Kratta::CreateCrystalThick (TGeoManager * gGeoManager, TGeoMedium * A_mediumForCrystal, TGeoMedium * A_mediumForReflexFoil, TGeoMedium * A_mediumForMylarFoil, TGeoMedium * A_mediumInEmptySpace ) { Double_t dssp = 0.5; // Scale for Shape definitions Double_t dCrystThick_length = 12.500; Double_t dCrystThick_edge_short = 3.277; Double_t dCrystThick_edge_long = 3.850; Double_t dCrystFoilThickness = 0.0065; Double_t dMylarThickness = 0.006; Double_t dMylarEdge = 2.800; Double_t cutBoxEdge = dMylarEdge; //Must be equal like the window for photodiode and hence Mylar foil. ///Thick crystal shape TGeoArb8 *geoCrystThickShape = new TGeoArb8("CThick", dCrystThick_length * dssp ); geoCrystThickShape -> SetVertex(0, dCrystThick_edge_short * dssp , dCrystThick_edge_short * dssp ); geoCrystThickShape -> SetVertex(1, dCrystThick_edge_short * dssp , - dCrystThick_edge_short * dssp ); geoCrystThickShape -> SetVertex(2, - dCrystThick_edge_short * dssp , - dCrystThick_edge_short * dssp ); geoCrystThickShape -> SetVertex(3, - dCrystThick_edge_short * dssp , dCrystThick_edge_short * dssp ); geoCrystThickShape -> SetVertex(4, dCrystThick_edge_long * dssp , dCrystThick_edge_long * dssp ); geoCrystThickShape -> SetVertex(5, dCrystThick_edge_long * dssp , - dCrystThick_edge_long * dssp ); geoCrystThickShape -> SetVertex(6, - dCrystThick_edge_long * dssp , - dCrystThick_edge_long * dssp ); geoCrystThickShape -> SetVertex(7, - dCrystThick_edge_long * dssp , dCrystThick_edge_long * dssp ); TGeoArb8 *geoCrystThickFoilShape = new TGeoArb8 ("FThick", dCrystThick_length * dssp + dCrystFoilThickness ); geoCrystThickFoilShape -> SetVertex(0, ( dCrystThick_edge_short * dssp + dCrystFoilThickness ), ( dCrystThick_edge_short * dssp + dCrystFoilThickness ) ); geoCrystThickFoilShape -> SetVertex(1, ( dCrystThick_edge_short * dssp + dCrystFoilThickness ), - ( dCrystThick_edge_short * dssp + dCrystFoilThickness ) ); geoCrystThickFoilShape -> SetVertex(2, - ( dCrystThick_edge_short * dssp + dCrystFoilThickness ), - ( dCrystThick_edge_short * dssp + dCrystFoilThickness ) ); geoCrystThickFoilShape -> SetVertex(3, - ( dCrystThick_edge_short * dssp + dCrystFoilThickness ), ( dCrystThick_edge_short * dssp + dCrystFoilThickness ) ); geoCrystThickFoilShape -> SetVertex(4, ( dCrystThick_edge_long * dssp + dCrystFoilThickness ), ( dCrystThick_edge_long * dssp + dCrystFoilThickness ) ); geoCrystThickFoilShape -> SetVertex(5, ( dCrystThick_edge_long * dssp + dCrystFoilThickness ), - ( dCrystThick_edge_long * dssp + dCrystFoilThickness ) ); geoCrystThickFoilShape -> SetVertex(6, - ( dCrystThick_edge_long * dssp + dCrystFoilThickness ), - ( dCrystThick_edge_long * dssp + dCrystFoilThickness ) ); geoCrystThickFoilShape -> SetVertex(7, - ( dCrystThick_edge_long * dssp + dCrystFoilThickness ), ( dCrystThick_edge_long * dssp + dCrystFoilThickness ) ); /// Cut plane - to uncover one side of the crystal TGeoBBox *cutPlane = new TGeoBBox("cP2", cutBoxEdge * dssp, cutBoxEdge * dssp, cutBoxEdge * dssp); TGeoTranslation *tCutBox = new TGeoTranslation ( "tcP2", 0, 0, ( dCrystThick_length + cutBoxEdge) * dssp ); tCutBox -> RegisterYourself(); /// Mylar shape and object TGeoBBox *geoMylarShape = new TGeoBBox ( "geoMylarShape", dMylarEdge * dssp, dMylarEdge * dssp, dMylarThickness * dssp); TGeoVolume *geoMylar = new TGeoVolume ( "geoMylar", geoMylarShape, A_mediumForMylarFoil ); geoMylar -> SetLineColor(4); /// Cover foil - object TGeoCompositeShape *coverThickShape = new TGeoCompositeShape( "coverThickShape", "(FThick - CThick) - cP2:tcP2"); TGeoVolume *geoCoverFoil = new TGeoVolume("geoCoverFoil", coverThickShape, A_mediumForReflexFoil); geoCoverFoil -> SetLineColor(38); /// Crystal - object TGeoVolume *geoCrystalThick = new TGeoVolume ( "geoCrystThick", geoCrystThickShape, A_mediumForCrystal); geoCrystalThick -> SetLineColor(41); AddSensitiveVolume( geoCrystalThick ); cout << " ******************* ################# WE CREATED CRYSTAL THICK" << endl; TGeoVolume *geoVolume = gGeoManager->MakeBox("geoCrystalThickVolume", A_mediumInEmptySpace, 25., 25., 25.); geoVolume -> AddNode ( geoCrystalThick, 1, new TGeoTranslation (0, 0, dCrystThick_length * dssp + dCrystFoilThickness )); geoVolume -> AddNode ( geoCoverFoil, 2, new TGeoTranslation (0, 0, dCrystThick_length * dssp + dCrystFoilThickness )); geoVolume -> AddNode ( geoMylar, 3, new TGeoTranslation (0, 0, dCrystThick_length + dCrystFoilThickness + dMylarThickness * dssp ) ); return geoVolume; } TGeoVolume * Kratta::CreatePartitionWall (TGeoManager * gGeoManager, TGeoMedium * A_medium, TGeoMedium * A_mediumInEmptySpace ) { Double_t dHeight = 4.23; Double_t dWidth = 4.23; Double_t dThickness = 1.0; Double_t dRadius = 2.0; Double_t dssp = 0.5; // Scale for Shape definitions /// make shape components TGeoBBox *sbox = new TGeoBBox("B",dHeight * dssp, dWidth * dssp, dThickness * dssp); TGeoTube *stub = new TGeoTube("T",0, dRadius * dssp, dThickness * dssp + 0.1 ); /// create a composite TGeoCompositeShape *cs = new TGeoCompositeShape( "cs", "(B-T)" ); TGeoVolume * geoPartitionWall = new TGeoVolume("COMP",cs, A_medium); geoPartitionWall->SetLineColor(30); TGeoVolume *geoVolume = gGeoManager->MakeBox("geoCrystalThickVolume", A_mediumInEmptySpace, 25., 25., 25.); geoVolume -> AddNode ( geoPartitionWall, 1, new TGeoTranslation (0, 0, dThickness * dssp )); return geoVolume; } TGeoVolume * Kratta::CreateCooperFrontface ( TGeoManager * gGeoManager, TGeoMedium * A_medMaterial , TGeoMedium * A_mediumInEmptySpace ) { Double_t dWidth = 2.88; Double_t dThickness = 0.01; Double_t dssp = 0.5; // Scale for Shape definitions TGeoVolume *geoCooperFrontface = gGeoManager->MakeBox("COMP_Cu", A_medMaterial, dWidth * dssp, dWidth * dssp, dThickness * dssp); geoCooperFrontface->SetLineColor(22); TGeoVolume *geoVolume = gGeoManager -> MakeBox ("geoVolume", A_mediumInEmptySpace, 25., 25., 25.); geoVolume -> AddNode ( geoCooperFrontface , 1, new TGeoTranslation (0, 0, dThickness * dssp )); return geoVolume; } TGeoVolume * Kratta::CreateDistanceWall ( TGeoManager * gGeoManager, TGeoMedium * A_medMaterial , TGeoMedium * A_mediumInEmptySpace ) { Double_t dWidth = 4.23; Double_t dThickness = 0.09; Double_t dssp = 0.5; // Scale for Shape definitions TGeoVolume *geoDistanceWall = gGeoManager -> MakeBox("geoDistanceWall", A_medMaterial, dWidth * dssp, dWidth * dssp, dThickness * dssp); geoDistanceWall -> SetLineColor( 31 ); TGeoVolume *geoVolume = gGeoManager -> MakeBox ("geoVolume", A_mediumInEmptySpace, 25., 25., 25.); geoVolume -> AddNode ( geoDistanceWall , 1, new TGeoTranslation (0, 0, dThickness * dssp )); return geoVolume;; } TGeoVolume * Kratta::CreateBackWall ( TGeoManager * gGeoManager, TGeoMedium * A_medMaterial , TGeoMedium * A_mediumInEmptySpace ) { Double_t dWidth = 6.58; Double_t dThickness = 0.2; Double_t dssp = 0.5; // Scale for Shape definitions TGeoVolume *geoBackWall = gGeoManager -> MakeBox("geoBackWall", A_medMaterial, dWidth * dssp, dWidth * dssp, dThickness * dssp); geoBackWall -> SetLineColor( 31 ); TGeoVolume *geoVolume = gGeoManager -> MakeBox ("geoVolume", A_mediumInEmptySpace, 25., 25., 25.); geoVolume -> AddNode ( geoBackWall , 1, new TGeoTranslation (0, 0, dThickness * dssp )); return geoVolume; } TGeoVolume * Kratta::CreateDetector (TGeoManager * gGeoManager ) { cout << " < GEOMETRY KRATTA >" << endl; // Material definition Double_t w = 0.0; Double_t a = 0.0; Double_t z = 0.0; Double_t density = 0.0; Double_t radl = 0.0; Double_t absl = 0.0; Double_t nel = 0.0; Double_t numed = 0.0; ///--- define some materials // Vacuum //TGeoMaterial *matVacuum = new TGeoMaterial("Vacuum", 0,0,0); //TGeoMedium *medVacuum = new TGeoMedium("Vacuum", 1, matVacuum); // Air TGeoMedium * pKrattaMedAir = NULL; if ( gGeoManager -> GetMedium ( "Air" ) ){ pKrattaMedAir = gGeoManager -> GetMedium("Air"); } else{ nel = 2; density = 0.001290; TGeoMixture *pKrattaMatAir = new TGeoMixture("Air", nel,density); a = 14.006740; z = 7.000000; w = 0.700000; // N pKrattaMatAir -> DefineElement(0,a,z,w); a = 15.999400; z = 8.000000; w = 0.300000; // O pKrattaMatAir -> DefineElement(1,a,z,w); pKrattaMatAir -> SetIndex(1); // Medium: Air numed = 1; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedAir = new TGeoMedium("Air", numed, pKrattaMatAir, par); } // Iron TGeoMedium * pKrattaMedFe = NULL; if ( gGeoManager -> GetMedium( "Iron" ) ){ pKrattaMedFe = gGeoManager -> GetMedium( "Iron" ); } else{ w = 0.; a = 55.850000; z = 26.000000; density = 7.870000; radl = 1.757717; absl = 169.994418; TGeoMaterial* pKrattaMatFe = new TGeoMaterial( "Iron", a, z, density, radl, absl ); pKrattaMatFe -> SetIndex( 701 ); numed = 23; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedFe = new TGeoMedium ( "Iron", numed, pKrattaMatFe, par); } // Aluminium TGeoMedium * pKrattaMedAl = NULL; if (gGeoManager -> GetMedium("Aluminium") ){ pKrattaMedAl = gGeoManager -> GetMedium ( "Aluminium" ); } else{ w = 0.; a = 26.980000; z = 13.000000; density = 2.7000000; radl = 8.875105; absl = 388.793113; TGeoMaterial* pKrattaMatAl = new TGeoMaterial( "Aluminium", a, z, density, radl, absl ); Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedAl = new TGeoMedium ( "Aluminium", numed, pKrattaMatAl, par ); } // BC408 (BC408 plastic medium) TGeoMedium * pKrattaMedBC408 = NULL; if (gGeoManager -> GetMedium( "BC408" ) ){ pKrattaMedBC408 = gGeoManager -> GetMedium( "BC408" ); } else{ nel = 2; density = 1.032000; TGeoMixture *pKrattaMatBC408 = new TGeoMixture( "BC408", nel, density ); a = 1.007940; z = 1.000000; w = 0.520000; // H pKrattaMatBC408 -> DefineElement(0,a,z,w); a = 12.010700; z = 6.000000; w = 0.480000; // C pKrattaMatBC408 -> DefineElement(1,a,z,w); pKrattaMatBC408 -> SetIndex(36); numed = 36; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedBC408 = new TGeoMedium("BC408", numed, pKrattaMatBC408, par); } // Concrete TGeoMedium *pKrattaMedConcrete = NULL; if (gGeoManager -> GetMedium( "Concrete" ) ){ pKrattaMedConcrete = gGeoManager -> GetMedium( "Concrete" ); } else{ nel=6; density = 2.5; TGeoMixture *pKrattaMatConcrete = new TGeoMixture ( "Concrete", nel, density ); a = 15.999400; z = 8.000000; w = 0.530000; // O pKrattaMatConcrete->DefineElement(0,a,z,w); a = 22.990000; z = 11.000000; w = 0.150E-01; // Na pKrattaMatConcrete->DefineElement(1,a,z,w); a = 26.980000; z = 13.000000; w = 0.420E-01; // Al pKrattaMatConcrete->DefineElement(2,a,z,w); a = 28.090000; z = 14.000000; w = 0.330000; // Si pKrattaMatConcrete->DefineElement(3,a,z,w); a = 40.078000; z = 20.000000; w = 0.630E-01; // O pKrattaMatConcrete->DefineElement(4,a,z,w); a = 55.850000; z = 26.000000; w = 0.200E-01; // O pKrattaMatConcrete->DefineElement(5,a,z,w); pKrattaMatConcrete->SetIndex(443); numed=443; Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedConcrete = new TGeoMedium("Concrete", numed, pKrattaMatConcrete); } // CsI TGeoMedium * pKrattaMedCsI = NULL; if ( gGeoManager -> GetMedium( "CsI" ) ){ pKrattaMedCsI = gGeoManager -> GetMedium( "CsI" ); }else{ nel = 2; density = 4.510000; TGeoMixture * pKrattaMatCsI = new TGeoMixture("CsIn", nel,density); a = 132.905450; z = 55.000000; w = 0.511549; // CS pKrattaMatCsI ->DefineElement(0,a,z,w); a = 126.904470; z = 53.000000; w = 0.488451; // I pKrattaMatCsI ->DefineElement(1,a,z,w); pKrattaMatCsI ->SetIndex(601); Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedCsI = new TGeoMedium( "CsIn", 2, pKrattaMatCsI, par); } // Silicon TGeoMedium * pKrattaMedSilicon = NULL; if ( gGeoManager -> GetMedium( "Silicon" ) ){ pKrattaMedSilicon = gGeoManager -> GetMedium( "Silicon" ); }else{ a = 28.090000; z = 14.000000; density = 2.330000; radl = 9.351106; absl = 456.628489; TGeoMaterial* pKrattaMatSilicon = new TGeoMaterial( "Silicon", a, z, density, radl, absl ); pKrattaMatSilicon -> SetIndex(21); Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin numed = 21; // medium number pKrattaMedSilicon = new TGeoMedium("Silicon", numed, pKrattaMatSilicon, par); } // Mylar TGeoMedium * pKrattaMedMylar = NULL; if ( gGeoManager -> GetMedium( "Mylar" ) ){ pKrattaMedMylar = gGeoManager -> GetMedium( "Mylar" ); }else{ a = 20.090000; z = 10.000000; density = 5.00000; radl = 5.0; absl = 400.0; TGeoMaterial* pKrattaMatMylar = new TGeoMaterial( "Mylar", a, z, density, radl, absl ); pKrattaMatMylar -> SetIndex(22); Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin numed = 22; // medium number pKrattaMedMylar = new TGeoMedium("Mylar", numed, pKrattaMatMylar, par); } TGeoMedium *medIron = pKrattaMedFe; TGeoMedium *medSilicon = pKrattaMedSilicon; TGeoMedium *medFrame = pKrattaMedBC408; TGeoMedium *medCrystal = pKrattaMedCsI; TGeoMedium *medFoil = pKrattaMedAl; TGeoMedium *medMylar = pKrattaMedMylar; TGeoMedium *medAl = pKrattaMedAl; TGeoMedium *medInEmptySpace = pKrattaMedAir; Double_t worldx = 50.; Double_t worldy = 50.; Double_t worldz = 50.; TGeoVolume * WorldKRATTA = gGeoManager->MakeBox("WorldKRATTA", medInEmptySpace, worldx, worldy, worldz); WorldKRATTA -> SetVisibility(kFALSE); TGeoVolume *geoModule = gGeoManager->MakeBox("geoModule", medInEmptySpace, 50., 50., 50.); geoModule -> AddNode( CreateCover ( gGeoManager, medIron ) , 1 ); Double_t dLocation_P1 = 0.74; Double_t dLocation_P2 = 1.36; geoModule -> AddNodeOverlap( CreatePhotodiodeWithFrame( gGeoManager , medSilicon, medFrame, medInEmptySpace ), 2, new TGeoTranslation(0, 0, dLocation_P1 )); geoModule -> AddNodeOverlap( CreatePhotodiodeWithFrame( gGeoManager , medSilicon, medFrame, medInEmptySpace ), 3, new TGeoTranslation(0, 0, dLocation_P2 )); Double_t dCrystalThinLocation = 1.68; Double_t dCrystalThickLocation = 4.23; Double_t dSpaceBetweenCrystals = 0.02; //Taking in account cover foil and Mylar //todo: make sure if correct geoModule -> AddNodeOverlap( CreateCrystalThin ( gGeoManager, medCrystal, medFoil, medMylar, medInEmptySpace ), 4, new TGeoTranslation ( 0, 0, dCrystalThinLocation ) ) ; geoModule -> AddNodeOverlap( CreateCrystalThick ( gGeoManager, medCrystal, medFoil, medMylar, medInEmptySpace ), 5, new TGeoTranslation (0, 0, dCrystalThickLocation + dSpaceBetweenCrystals ) ); Double_t dCorrection_for_P3_photodiodeLocation = -0.039; ///Derived experimentally. Calculate better to get the proper distance (0) from thick crystal. Double_t dLocation_P3 = 16.78 + dSpaceBetweenCrystals + dCorrection_for_P3_photodiodeLocation; geoModule -> AddNodeOverlap( CreatePhotodiodeThridWithFrame( gGeoManager , medSilicon, medFrame, medInEmptySpace ), 6, new TGeoTranslation ( 0, 0, dLocation_P3 ) ); Double_t dCooperFrontfaceLocation = 0; geoModule -> AddNodeOverlap( CreateCooperFrontface ( gGeoManager, medIron, medInEmptySpace ), 7 , new TGeoTranslation(0, 0, dCooperFrontfaceLocation )); Double_t dPartitionalWallLocation = 18.73; geoModule -> AddNodeOverlap( CreatePartitionWall ( gGeoManager, medIron, medInEmptySpace ), 8 , new TGeoTranslation(0, 0, dPartitionalWallLocation )); Double_t dDistanceWallLocation = 17.1 + 0.055; ///Default position in between 17.1 and 17.3 cm. Distance wall thickness = 0.09 cm. geoModule -> AddNodeOverlap( CreateDistanceWall ( gGeoManager, medAl, medInEmptySpace ), 9 , new TGeoTranslation(0, 0, dDistanceWallLocation )); Double_t dBackWallLocation = 31.38; geoModule -> AddNodeOverlap( CreateBackWall ( gGeoManager, medIron, medInEmptySpace ), 10 , new TGeoTranslation(0, 0, dBackWallLocation )); /// DETECTOR /// /// Hodoscop building /// One module away from target TGeoVolume *geoModuleFarAway = gGeoManager->MakeBox( "geoModuleFarAway", medInEmptySpace, 50., 50., 50.); geoModuleFarAway -> AddNodeOverlap( geoModule, 1, new TGeoTranslation(0, 0, fGeoDistanceFromTargetToFirstCrystal )); /// Column of detectors 5 modules TGeoVolume *geoColumnOfModules = gGeoManager->MakeBox("geoColumnOfModules", medInEmptySpace, 50., 50., 50.); geoColumnOfModules->AddNodeOverlap( geoModuleFarAway, 1, new TGeoRotation( "rot_m0", 0, 0.5 * fGeoModuleAngle, 0)); /// 1/2 of the angle "ang" to setup edge of module in XZ plane. geoColumnOfModules->AddNodeOverlap( geoModuleFarAway, 2, new TGeoRotation( "rot_m1", 0, 1.5 * fGeoModuleAngle, 0)); geoColumnOfModules->AddNodeOverlap( geoModuleFarAway, 3, new TGeoRotation( "rot_m2", 0, 2.5 * fGeoModuleAngle, 0)); geoColumnOfModules->AddNodeOverlap( geoModuleFarAway, 4, new TGeoRotation( "rot_m3", 0, 3.5 * fGeoModuleAngle, 0)); geoColumnOfModules->AddNodeOverlap( geoModuleFarAway, 5, new TGeoRotation( "rot_m4", 0, 4.5 * fGeoModuleAngle, 0)); /// Detector 35 modules TGeoVolume *geoDetector = gGeoManager->MakeBox("geoDetector", medInEmptySpace, 50., 50., 50.); geoDetector->AddNodeOverlap( geoColumnOfModules, 1, new TGeoRotation( "rot_c0", 0 * fGeoColumnAngle, -90, 0 )); geoDetector->AddNodeOverlap( geoColumnOfModules, 2, new TGeoRotation( "rot_c1", 1 * fGeoColumnAngle, -90, 0 )); geoDetector->AddNodeOverlap( geoColumnOfModules, 3, new TGeoRotation( "rot_c2", 2 * fGeoColumnAngle, -90, 0 )); geoDetector->AddNodeOverlap( geoColumnOfModules, 4, new TGeoRotation( "rot_c3", 3 * fGeoColumnAngle, -90, 0 )); geoDetector->AddNodeOverlap( geoColumnOfModules, 5, new TGeoRotation( "rot_c4", 4 * fGeoColumnAngle, -90, 0 )); geoDetector->AddNodeOverlap( geoColumnOfModules, 6, new TGeoRotation( "rot_c5", 5 * fGeoColumnAngle, -90, 0 )); geoDetector->AddNodeOverlap( geoColumnOfModules, 7, new TGeoRotation( "rot_c6", 6 * fGeoColumnAngle, -90, 0 )); TGeoVolume *geoDetectorAtDefaultPosition = gGeoManager->MakeBox("geoDetectorAtDefaultPosition", medInEmptySpace, 50., 50., 50.); ///For centering Z axis in the detector. In deg. ///NOTE: angleBetweenSideAndCenterModule is fenomenologically determined value. /// TODO: It has to be calculated analytically in function of: angleBetweenSideAndCenterModule = f(fGeoModuleAngle, fGeoColumnAngle, ...). Double_t angleBetweenSideAndCenterModule = 18.0 ;// 18.0; TGeoRotation * rotToSetInDefaultPosition = new TGeoRotation( "rotToSetInDefaultPosition", 0, -90, 180 - angleBetweenSideAndCenterModule ); TGeoCombiTrans * combiTranslToDefaultPosition = new TGeoCombiTrans( 0.0 , 0.0, - fGeoDistanceFromTargetToFirstCrystal, rotToSetInDefaultPosition ); //TGeoCombiTrans * combiTranslToDefaultPosition = new TGeoCombiTrans( 0.0 , 0.0, 0.0, rotToSetInDefaultPosition ); geoDetectorAtDefaultPosition -> AddNodeOverlap( geoDetector, 1, combiTranslToDefaultPosition ); return geoDetectorAtDefaultPosition; } TGeoVolume * Kratta::CreateSupport (TGeoManager * gGeoManager, TGeoMedium * A_medForSupport, TGeoMedium * A_medForEmptySpace ) { /// ////////////////// Double_t dssp = 0.5; // Scale for Shape definitions Double_t P0 = 0.0; /// Plane A Double_t shapePlaneAx = 40.0; Double_t shapePlaneAy = 40.0; Double_t shapePlaneAHeight = 2.0; Double_t LocationPlaneA = 0.0; TGeoBBox * shapePlaneBottom = new TGeoBBox("shapePlaneA", shapePlaneAx * dssp, shapePlaneAy * dssp, shapePlaneAHeight * dssp ); TGeoVolume * geoPlaneA = new TGeoVolume("geoPlaneA", shapePlaneBottom, A_medForSupport ); ///Telescope A Double_t shapeTelescopeARmin = 3.0; Double_t shapeTelescopeARmax = 4.0; Double_t shapeTelescopeAHeight = 170.0; Double_t LocationTelescopeA = P0 + LocationPlaneA + shapePlaneAHeight; TGeoTube *shapeTelescopeA = new TGeoTube(shapeTelescopeARmin,shapeTelescopeARmax, shapeTelescopeAHeight * dssp); TGeoVolume * geoTelescopeA[4]; geoTelescopeA[0] = new TGeoVolume("geoTelescopeA", shapeTelescopeA, A_medForSupport ); geoTelescopeA[1] = new TGeoVolume("geoTelescopeA", shapeTelescopeA, A_medForSupport ); geoTelescopeA[2] = new TGeoVolume("geoTelescopeA", shapeTelescopeA, A_medForSupport ); geoTelescopeA[3] = new TGeoVolume("geoTelescopeA", shapeTelescopeA, A_medForSupport ); /// Plane B /// cut in Plane B for Telescopes B Double_t cutTelescopeBRmin = 0.0; Double_t cutTelescopeBRmax = shapeTelescopeARmin; /// Dziura na wielkosc promienia wewnetrznego teleskopu A (chodzi o to, by zmiescil sie promien teleskopu B) Double_t epsilon = 0.03; //a small value TGeoTube *cInPlaneB = new TGeoTube("cB", cutTelescopeBRmin, cutTelescopeBRmax, shapeTelescopeAHeight * dssp + epsilon); /// Look: Here is a small extension to provide cuts overlapping. TGeoTranslation *tc0 = new TGeoTranslation("tc0", 13, 16, 0); tc0->RegisterYourself(); TGeoTranslation *tc1 = new TGeoTranslation("tc1", 17, -10, 0); tc1->RegisterYourself(); TGeoTranslation *tc2 = new TGeoTranslation("tc2", -17, -10, 0); tc2->RegisterYourself(); TGeoTranslation *tc3 = new TGeoTranslation("tc3", -13, 16, 0); tc3->RegisterYourself(); TGeoCompositeShape *csPlaneCuts = new TGeoCompositeShape( "cCuts", " (((cB:tc0+cB:tc1)+cB:tc2)+cB:tc3)" ); TGeoCompositeShape *csPlaneB = new TGeoCompositeShape( "csPlaneB", "shapePlaneA-cCuts" ); Double_t LocationPlaneB = LocationTelescopeA + shapeTelescopeAHeight ; TGeoVolume * geoPlaneB = new TGeoVolume("geoPlaneB", csPlaneB, A_medForSupport ); /// Support Bottom TGeoVolume *geoSupportBottom = gGeoManager->MakeBox ("geoSupportBottom", A_medForEmptySpace, 100., 100., 200.); geoSupportBottom -> AddNode( geoPlaneA, 1, new TGeoTranslation ( 0 , 0, LocationPlaneA + shapePlaneAHeight * dssp ) ); geoSupportBottom -> AddNode( geoTelescopeA[0], 2, new TGeoTranslation ( 13, 16, LocationTelescopeA + shapeTelescopeAHeight * dssp ) ); geoSupportBottom -> AddNode( geoTelescopeA[1], 3, new TGeoTranslation ( 17, -10, LocationTelescopeA + shapeTelescopeAHeight * dssp ) ); geoSupportBottom -> AddNode( geoTelescopeA[2], 4, new TGeoTranslation ( -17, -10, LocationTelescopeA + shapeTelescopeAHeight * dssp ) ); geoSupportBottom -> AddNode( geoTelescopeA[3], 5, new TGeoTranslation ( -13, 16, LocationTelescopeA + shapeTelescopeAHeight * dssp ) ); //geoSupportBottom -> AddNode( geoPlaneB, 6, new TGeoTranslation ( 0 , 0, LocationPlaneB + shapePlaneAHeight * dssp ) ); /// Support Upper. Ustawiamy w kierunku z-tow ujemnych: Double_t SupportUpperPoint0 = 0.0; Double_t shapePlaneCx = 40.0; Double_t shapePlaneCy = 40.0; Double_t shapePlaneCHeight = 2.0; Double_t LocationPlaneD = SupportUpperPoint0; Double_t LocationPlaneC = LocationPlaneD - shapePlaneCHeight; Double_t shapePlaneCaxialLength = 31.5; TGeoTubeSeg * shapePlaneC = new TGeoTubeSeg ( 40 ,40 + shapePlaneCaxialLength , shapePlaneCHeight * dssp , -21, 21 ); TGeoVolume * geoPlaneC = new TGeoVolume("shapePlaneC", shapePlaneC, A_medForSupport ); TGeoVolume * geoPlaneD = new TGeoVolume("geoPlaneD", shapePlaneC, A_medForSupport ); ///Telescope B Double_t shapeTelescopeBRmin = 1.0; Double_t shapeTelescopeBRmax = 2.0; Double_t shapeTelescopeBHeight = 50.0; Double_t LocationTelescopeB = LocationPlaneD - shapePlaneCHeight - shapePlaneCHeight; TGeoTube *shapeTelescopeB = new TGeoTube(shapeTelescopeBRmin,shapeTelescopeBRmax, shapeTelescopeBHeight * dssp); TGeoVolume * geoTelescopeB[4]; geoTelescopeB[0] = new TGeoVolume("geoTelescopeB", shapeTelescopeB, A_medForSupport ); geoTelescopeB[1] = new TGeoVolume("geoTelescopeB", shapeTelescopeB, A_medForSupport ); geoTelescopeB[2] = new TGeoVolume("geoTelescopeB", shapeTelescopeB, A_medForSupport ); geoTelescopeB[3] = new TGeoVolume("geoTelescopeB", shapeTelescopeB, A_medForSupport ); TGeoVolume *geoSupportUpper = gGeoManager->MakeBox ("geoSupportUpper", A_medForEmptySpace, 50., 50., 100.); geoSupportUpper-> SetVisibility(kFALSE); geoSupportUpper -> AddNode( geoPlaneD, 1, new TGeoCombiTrans ("support", 0, 40 + (31.5)/2., LocationPlaneD - shapePlaneCHeight* dssp, new TGeoRotation("r1",-90,0,0)) ); geoSupportUpper -> AddNode( geoPlaneC, 1, new TGeoCombiTrans ("support", 0, 40 + (31.5)/2.,LocationPlaneC - shapePlaneCHeight* dssp, new TGeoRotation("r1",-90,0,0)) ); geoSupportUpper -> AddNode( geoTelescopeB[0], 2, new TGeoTranslation ( 13, 16, LocationTelescopeB - shapeTelescopeBHeight * dssp ) ); geoSupportUpper -> AddNode( geoTelescopeB[1], 3, new TGeoTranslation ( 17, -10, LocationTelescopeB - shapeTelescopeBHeight * dssp ) ); geoSupportUpper -> AddNode( geoTelescopeB[2], 4, new TGeoTranslation ( -17, -10, LocationTelescopeB - shapeTelescopeBHeight * dssp ) ); geoSupportUpper -> AddNode( geoTelescopeB[3], 5, new TGeoTranslation ( -13, 16, LocationTelescopeB - shapeTelescopeBHeight * dssp ) ); /// Support TGeoVolume *geoSupport = gGeoManager->MakeBox ("geoSupport", A_medForEmptySpace, 100., 100., 250.); Double_t geoSupportBottomDistanceBetweenXZPlaneAndGroundInCave = 200.0; geoSupport -> AddNodeOverlap( geoSupportUpper, 1 ); ///This should not be moved geoSupport -> AddNodeOverlap( geoSupportBottom, 2, new TGeoTranslation ( 0, 0 , - geoSupportBottomDistanceBetweenXZPlaneAndGroundInCave) ); //geoSupport->SetLineColor(38); return geoSupport; } TGeoVolume * Kratta::CreateSupport (TGeoManager * gGeoManager ) { ///--- define some materials cout << " < GEOMETRY KRATTA STAND >" << endl; // Material definition Double_t w = 0.0; Double_t a = 0.0; Double_t z = 0.0; Double_t density = 0.0; Double_t radl = 0.0; Double_t absl = 0.0; Double_t nel = 0.0; Double_t numed = 0.0; ///--- define some materials // Vacuum //TGeoMaterial *matVacuum = new TGeoMaterial("Vacuum", 0,0,0); //TGeoMedium *medVacuum = new TGeoMedium("Vacuum", 1, matVacuum); // Air TGeoMedium * pKrattaMedAir = NULL; if ( gGeoManager -> GetMedium ( "Air" ) ){ pKrattaMedAir = gGeoManager -> GetMedium("Air"); } else{ nel = 2; density = 0.001290; TGeoMixture *pKrattaMatAir = new TGeoMixture("Air", nel,density); a = 14.006740; z = 7.000000; w = 0.700000; // N pKrattaMatAir -> DefineElement(0,a,z,w); a = 15.999400; z = 8.000000; w = 0.300000; // O pKrattaMatAir -> DefineElement(1,a,z,w); pKrattaMatAir -> SetIndex(1); // Medium: Air numed = 1; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedAir = new TGeoMedium("Air", numed, pKrattaMatAir, par); } // Iron TGeoMedium * pKrattaMedFe = NULL; if ( gGeoManager -> GetMedium( "Iron" ) ){ pKrattaMedFe = gGeoManager -> GetMedium( "Iron" ); } else{ w = 0.; a = 55.850000; z = 26.000000; density = 7.870000; radl = 1.757717; absl = 169.994418; TGeoMaterial* pKrattaMatFe = new TGeoMaterial( "Iron", a, z, density, radl, absl ); pKrattaMatFe -> SetIndex( 701 ); numed = 23; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedFe = new TGeoMedium ( "Iron", numed, pKrattaMatFe, par); } TGeoMedium * medInEmptySpace = pKrattaMedAir; /// Volume with support at default position; i.e. P(0,0,0) in centered in front of the top plane. TGeoVolume *geoSupportAdDefaultPosition = gGeoManager->MakeBox("geoSupportAdDefaultPosition", medInEmptySpace, 150., 250., 150.); Double_t shapePlaneCaxialLength = 31.5; geoSupportAdDefaultPosition -> AddNode( CreateSupport ( gGeoManager, pKrattaMedFe, medInEmptySpace ), 1, new TGeoCombiTrans ("support", 0, 0, shapePlaneCaxialLength/2., new TGeoRotation("r1",0,-90,0)) ); return geoSupportAdDefaultPosition; } void Kratta::ConstructMechGeometryOld() { TGeoVolume *Cave = NULL; if (gGeoManager) { Cave = gGeoManager -> GetTopVolume(); gGeoManager -> SetVisLevel ( 10); }else { cout << "-I- no TGEO defined ! " << endl; } TGeoRotation *zeroRotation= new TGeoRotation("zeroRotation", 0, 0, 0 ); TGeoCombiTrans *t0 = new TGeoCombiTrans( 0.0 , 0.0, 0.0, zeroRotation); ///Cave -> AddNodeOverlap( CreateDetector ( gGeoManager ), 1, GetGlobalPosition ( t0 ) ); /// Cave -> AddNodeOverlap( CreateSupport ( gGeoManager ), 1, GetGlobalPosition ( t0 ) ); Cave->AddNode( CreateDetector ( gGeoManager ), 1, GetGlobalPosition ( t0 ) ); Cave->AddNode( CreateSupport ( gGeoManager ), 1, GetGlobalPosition ( t0 ) ); } ///SSSSSSSKKKKKKK COMMON CODE PART.END /// Information concerining code updating from external macro: /// 1. Replace the code /// 2. Add (in asyeosroot) or remove(in macro) line: AddSensitiveVolume( geoCrystalThick ); (for all active materials i.e Crystals - arund line 833) /// 3. Note: In macro function ConstructMechGeometry is replaced by function display (take a look for differences in both functions) */ ///New flat version (2012-08-27) void Kratta::ConstructMechGeometry() { TGeoVolume *Cave = NULL; if (gGeoManager) { Cave = gGeoManager -> GetTopVolume(); //gGeoManager -> SetVisLevel ( 10); }else { cout << "-I- no TGEO defined ! " << endl; } ///--- define some materials // Material definition Double_t w = 0.0; Double_t a = 0.0; Double_t z = 0.0; Double_t density = 0.0; Double_t radl = 0.0; Double_t absl = 0.0; Double_t nel = 0.0; Double_t numed = 0.0; // Vacuum //TGeoMaterial *matVacuum = new TGeoMaterial("Vacuum", 0,0,0); //TGeoMedium *medVacuum = new TGeoMedium("Vacuum", 1, matVacuum); // Air TGeoMedium * pKrattaMedAir = NULL; if ( gGeoManager -> GetMedium ( "Air" ) ){ pKrattaMedAir = gGeoManager -> GetMedium("Air"); } else{ nel = 2; density = 0.001290; TGeoMixture *pKrattaMatAir = new TGeoMixture("Air", nel,density); a = 14.006740; z = 7.000000; w = 0.700000; // N pKrattaMatAir -> DefineElement(0,a,z,w); a = 15.999400; z = 8.000000; w = 0.300000; // O pKrattaMatAir -> DefineElement(1,a,z,w); pKrattaMatAir -> SetIndex(1); // Medium: Air numed = 1; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedAir = new TGeoMedium("Air", numed, pKrattaMatAir, par); } // Iron TGeoMedium * pKrattaMedFe = NULL; if ( gGeoManager -> GetMedium( "Iron" ) ){ pKrattaMedFe = gGeoManager -> GetMedium( "Iron" ); } else{ w = 0.; a = 55.850000; z = 26.000000; density = 7.870000; radl = 1.757717; absl = 169.994418; TGeoMaterial* pKrattaMatFe = new TGeoMaterial( "Iron", a, z, density, radl, absl ); pKrattaMatFe -> SetIndex( 701 ); numed = 23; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedFe = new TGeoMedium ( "Iron", numed, pKrattaMatFe, par); } // Aluminium TGeoMedium * pKrattaMedAl = NULL; if (gGeoManager -> GetMedium("Aluminium") ){ pKrattaMedAl = gGeoManager -> GetMedium ( "Aluminium" ); } else{ w = 0.; a = 26.980000; z = 13.000000; density = 2.7000000; radl = 8.875105; absl = 388.793113; TGeoMaterial* pKrattaMatAl = new TGeoMaterial( "Aluminium", a, z, density, radl, absl ); Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedAl = new TGeoMedium ( "Aluminium", numed, pKrattaMatAl, par ); } // Cooper ///TODO: Parameters need to be verified TGeoMedium * pKrattaMedCu = NULL; if ( gGeoManager -> GetMedium( "Copper" ) ){ pKrattaMedCu = gGeoManager -> GetMedium( "Copper" ); } else{ w = 0.; a = 63.546000; z = 29.000000; density = 8.9600000; radl = 1.439930; absl = 169.994418; ///TODO: Parameters need to be set. Now is equal like for Fe. /// Absorption length in cm. This parameter is ignored by GEANT, but it has been kept in the calling sequence for backward compatibility; see: http://hep-www.colorado.edu/~nlc/GEANT_Duckwitz/geant/defmate.html TGeoMaterial* pKrattaMatCu = new TGeoMaterial( "Copper", a, z, density, radl, absl ); pKrattaMatCu -> SetIndex( 702 ); ///TODO: Parameters need to be set numed = 230; // medium number ///TODO: Parameters need to be set Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedCu = new TGeoMedium ( "Copper", numed, pKrattaMatCu, par); } // BC408 (BC408 plastic medium) TGeoMedium * pKrattaMedBC408 = NULL; if (gGeoManager -> GetMedium( "BC408" ) ){ pKrattaMedBC408 = gGeoManager -> GetMedium( "BC408" ); } else{ nel = 2; density = 1.032000; TGeoMixture *pKrattaMatBC408 = new TGeoMixture( "BC408", nel, density ); a = 1.007940; z = 1.000000; w = 0.520000; // H pKrattaMatBC408 -> DefineElement(0,a,z,w); a = 12.010700; z = 6.000000; w = 0.480000; // C pKrattaMatBC408 -> DefineElement(1,a,z,w); pKrattaMatBC408 -> SetIndex(36); numed = 36; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedBC408 = new TGeoMedium("BC408", numed, pKrattaMatBC408, par); } // Concrete TGeoMedium *pKrattaMedConcrete = NULL; if (gGeoManager -> GetMedium( "Concrete" ) ){ pKrattaMedConcrete = gGeoManager -> GetMedium( "Concrete" ); } else{ nel=6; density = 2.5; TGeoMixture *pKrattaMatConcrete = new TGeoMixture ( "Concrete", nel, density ); a = 15.999400; z = 8.000000; w = 0.530000; // O pKrattaMatConcrete->DefineElement(0,a,z,w); a = 22.990000; z = 11.000000; w = 0.150E-01; // Na pKrattaMatConcrete->DefineElement(1,a,z,w); a = 26.980000; z = 13.000000; w = 0.420E-01; // Al pKrattaMatConcrete->DefineElement(2,a,z,w); a = 28.090000; z = 14.000000; w = 0.330000; // Si pKrattaMatConcrete->DefineElement(3,a,z,w); a = 40.078000; z = 20.000000; w = 0.630E-01; // O pKrattaMatConcrete->DefineElement(4,a,z,w); a = 55.850000; z = 26.000000; w = 0.200E-01; // O pKrattaMatConcrete->DefineElement(5,a,z,w); pKrattaMatConcrete->SetIndex(443); numed=443; Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedConcrete = new TGeoMedium("Concrete", numed, pKrattaMatConcrete); } // CsI TGeoMedium * pKrattaMedCsI = NULL; if ( gGeoManager -> GetMedium( "CsI(Tl)" ) ){ pKrattaMedCsI = gGeoManager -> GetMedium( "CsI(Tl)" ); }else{ nel = 3; density = 4.510000; TGeoMixture * pKrattaMatCsI = new TGeoMixture("CsI(Tl)", nel,density); a = 132.905450; z = 55.000000; w = 0.51034; // CS, Without taking into account Thallium: 0.51155, difference: 0.24% pKrattaMatCsI ->DefineElement(0,a,z,w); a = 126.904470; z = 53.000000; w = 0.48730; // I, Without taking into account Thallium: 0.48845, difference: 0.24% pKrattaMatCsI ->DefineElement(1,a,z,w); a = 204.383300; z = 81.000000; w = 0.00236; // Tl, Abunadnce: 1500 ppm pKrattaMatCsI ->DefineElement(3,a,z,w); pKrattaMatCsI ->SetIndex(601); Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pKrattaMedCsI = new TGeoMedium( "CsIn(Tl)", 2, pKrattaMatCsI, par); } // Silicon TGeoMedium * pKrattaMedSilicon = NULL; if ( gGeoManager -> GetMedium( "Silicon" ) ){ pKrattaMedSilicon = gGeoManager -> GetMedium( "Silicon" ); }else{ a = 28.090000; z = 14.000000; density = 2.330000; radl = 9.351106; absl = 456.628489; TGeoMaterial* pKrattaMatSilicon = new TGeoMaterial( "Silicon", a, z, density, radl, absl ); pKrattaMatSilicon -> SetIndex(21); Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin numed = 21; // medium number pKrattaMedSilicon = new TGeoMedium("Silicon", numed, pKrattaMatSilicon, par); } // Mylar TGeoMedium * pKrattaMedMylar = NULL; if ( gGeoManager -> GetMedium( "Mylar" ) ){ pKrattaMedMylar = gGeoManager -> GetMedium( "Mylar" ); }else{ a = 20.090000; z = 10.000000; density = 5.00000; radl = 5.0; absl = 400.0; TGeoMaterial* pKrattaMatMylar = new TGeoMaterial( "Mylar", a, z, density, radl, absl ); pKrattaMatMylar -> SetIndex(22); Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin numed = 22; // medium number pKrattaMedMylar = new TGeoMedium("Mylar", numed, pKrattaMatMylar, par); } TGeoMedium *medIron = pKrattaMedFe; TGeoMedium *medSilicon = pKrattaMedSilicon; TGeoMedium *medFrame = pKrattaMedBC408; TGeoMedium *medCrystal = pKrattaMedCsI; TGeoMedium *medFoil = pKrattaMedAl; TGeoMedium *medMylar = pKrattaMedMylar; TGeoMedium *medAl = pKrattaMedAl; TGeoMedium *medCu = pKrattaMedCu; /* if(i==0) { if(useCsI) { TGeoVolume *modwheel1_box = gGeoManager->MakeTrap("ModWheel1",pMed9, wheel_dz ,wheel_theta,wheel_phi, wheel_dy1,wheel_dx1 ,wheel_dx2,wheel_alp1, wheel_dy2,wheel_dx3 ,wheel_dx4,wheel_alp2); //1 m3 modwheel1_box->SetVisLeaves(kTRUE); AddSensitiveVolume(modwheel1_box); for(ii=0;iiSetAngles(ii*dephi/degtorad, -thetamean_deg, 0.); modwheelPos_x=(dist[i]+halfthick)*sin(thetamean)*sin(ii*dephi); modwheelPos_y=(dist[i]+halfthick)*sin(thetamean)*cos(ii*dephi); // cout<<"gino "<AddNode(modwheel1_box , 1000+ii,rotwheelcomb1); // if(ii==0)Cave->AddNode(modwheel1_box , 1000+ii,rotwheelcomb1); // if(ii==2)Cave->AddNode(modwheel1_box , 1000+ii,rotwheelcomb1); // if(ii==4)Cave->AddNode(modwheel1_box , 1000+ii,rotwheelcomb1); } } } */ TGeoMaterial *matVacuum = new TGeoMaterial("Vacuum", 0,0,0); TGeoMedium *Vacuum = new TGeoMedium("Vacuum",1, matVacuum); Double_t dssp = 0.5; // Scale for Shape definitions Double_t dCrystFoilThickness = 0.0065; // 65 um Double_t dMylarThickness = 0.006; Double_t dMylarEdge = 2.800; Double_t worldx = 110.; Double_t worldy = 50.; Double_t worldz = 5.; TGeoVolume *topKratta = gGeoManager->MakeBox("TOP", Vacuum, 270., 270., 270.); topKratta->SetVisibility ( kFALSE ); // topKratta -> SetVisLeaves ( kTRUE ); TGeoVolume *moduleKratta = gGeoManager->MakeBox("moduleKratta", Vacuum, 20., 20., 40.); moduleKratta->SetVisibility ( kFALSE ); //moduleKratta -> SetVisLeaves ( kTRUE ); TGeoVolume *geoModuleFarAway = gGeoManager->MakeBox( "geoModuleFarAway", Vacuum, 25., 25., 100.); geoModuleFarAway->SetVisibility ( kFALSE ); //geoModuleFarAway -> SetVisLeaves ( kTRUE ); TGeoVolume *columnKratta = gGeoManager->MakeBox("moduleKratta", Vacuum, 100., 100., 110.); columnKratta->SetVisibility ( kFALSE ); // columnKratta -> SetVisLeaves ( kTRUE ); TGeoVolume *detectorKratta = gGeoManager->MakeBox("detectorKratta", Vacuum, 150., 150., 150.); detectorKratta->SetVisibility ( kFALSE ); detectorKratta -> SetVisLeaves ( kTRUE ); Bool_t Add_CsIThinCrystal = kTRUE; Bool_t Add_CsIThikCrystal = kTRUE; Bool_t Add_SiPhot0 = kTRUE; Bool_t Add_SiPhot1 = kTRUE; Bool_t Add_SiPhot2 = kTRUE; Bool_t Add_CuFrontWall = kFALSE; Bool_t Add_BackWall = kFALSE; Bool_t Add_DistanceWall = kFALSE; Bool_t Add_PartitionalWall = kFALSE; Bool_t Add_Frame = kFALSE; /// Position Double_t dPos_CuFrontWall = 0.00;///[cm] Double_t dPos_SiPhot0 = 0.74; Double_t dPos_SiPhot1 = 1.36; Double_t dPos_CsIThinCrystal = 1.68; Double_t dPos_CsIThikCrystal = 4.23; Double_t dPos_SiPhot2 = 16.78; Double_t dPos_DistanceWall = 17.10; Double_t dPos_PartitionalWall = 18.73; Double_t dPos_BackWall = 31.38; Double_t dPos_Frame = 0.0; Double_t dPos_Default = 0.0; ///[cm] dPos_CuFrontWall += dPos_Default; dPos_SiPhot0 += dPos_Default; dPos_DistanceWall += dPos_Default; dPos_SiPhot1 += dPos_Default; dPos_CsIThinCrystal += dPos_Default; dPos_CsIThikCrystal += dPos_Default; dPos_SiPhot2 += dPos_Default; dPos_PartitionalWall += dPos_Default; dPos_BackWall += dPos_Default; dPos_Frame += dPos_Default; ///Photodiode 0 if ( Add_SiPhot0 ) { /// dimensions Double_t dPhotodiodeThickness = 0.05; ///[cm] Double_t dPhotodiodeEdge = 3.0; TGeoBBox *geoPhotodiodeCrystalShape = new TGeoBBox("Ph", dPhotodiodeEdge * dssp, dPhotodiodeEdge * dssp, dPhotodiodeThickness * dssp); TGeoVolume * geoPhotodiodeCrystal = new TGeoVolume("geoPhotodiodeCrystalShape0", geoPhotodiodeCrystalShape, medSilicon ); geoPhotodiodeCrystal -> SetVisLeaves( kTRUE ); AddSensitiveVolume ( geoPhotodiodeCrystal ); TGeoTranslation * tf_Photodiode0 = new TGeoTranslation ( "tf_Photodiode0", 0, 0, dPos_SiPhot0 + dPhotodiodeThickness * dssp ); moduleKratta->AddNode ( geoPhotodiodeCrystal , 1, tf_Photodiode0 ); } ///Photodiode 1 if ( Add_SiPhot1 ) { /// dimensions Double_t dPhotodiodeThickness = 0.05; ///[cm] Double_t dPhotodiodeEdge = 3.0; TGeoBBox *geoPhotodiodeCrystalShape = new TGeoBBox("Ph", dPhotodiodeEdge * dssp, dPhotodiodeEdge * dssp, dPhotodiodeThickness * dssp); TGeoVolume * geoPhotodiodeCrystal = new TGeoVolume("geoPhotodiodeCrystalShape1", geoPhotodiodeCrystalShape, medSilicon ); geoPhotodiodeCrystal -> SetVisLeaves( kTRUE ); AddSensitiveVolume( geoPhotodiodeCrystal ); TGeoTranslation * tf_Photodiode1 = new TGeoTranslation ( "tf_Photodiode1", 0, 0, dPos_SiPhot1 + dPhotodiodeThickness * dssp ) ; moduleKratta->AddNode ( geoPhotodiodeCrystal , 2, tf_Photodiode1 ); } ///Photodiode 2 if ( Add_SiPhot2 ) { /// dimensions Double_t dPhotodiodeThickness = 0.05; ///[cm] Double_t dPhotodiodeEdge = 3.0; TGeoBBox *geoPhotodiodeCrystalShape = new TGeoBBox("Ph", dPhotodiodeEdge * dssp, dPhotodiodeEdge * dssp, dPhotodiodeThickness * dssp); TGeoVolume * geoPhotodiodeCrystal = new TGeoVolume("geoPhotodiodeCrystalShape2", geoPhotodiodeCrystalShape, medSilicon ); geoPhotodiodeCrystal -> SetVisLeaves( kTRUE ); AddSensitiveVolume( geoPhotodiodeCrystal ); TGeoTranslation * tf_Photodiode2 = new TGeoTranslation ( "tf_Photodiode2", 0, 0, dPos_SiPhot2 + dPhotodiodeThickness* dssp ) ; moduleKratta->AddNode ( geoPhotodiodeCrystal , 3, tf_Photodiode2 ); } /// Thin crystal if( Add_CsIThinCrystal ) { Double_t dCrystThin_length = 2.5; Double_t dCrystThin_edge_short = 2.8; Double_t dCrystThin_edge_long = 2.967; Double_t cutBoxEdge = dCrystThin_edge_short + dCrystFoilThickness + 0.1; //Must be larger than dCrystThin_edge_short + dCrystFoilThickness /// Crystal shape TGeoArb8 *geoCrystThinShape = new TGeoArb8 ("CThin", dCrystThin_length * dssp ); geoCrystThinShape -> SetVertex(0, dCrystThin_edge_short * dssp , dCrystThin_edge_short * dssp ); geoCrystThinShape -> SetVertex(1, dCrystThin_edge_short * dssp , - dCrystThin_edge_short * dssp ); geoCrystThinShape -> SetVertex(2, - dCrystThin_edge_short * dssp , - dCrystThin_edge_short * dssp ); geoCrystThinShape -> SetVertex(3, - dCrystThin_edge_short * dssp , dCrystThin_edge_short * dssp ); geoCrystThinShape -> SetVertex(4, dCrystThin_edge_long * dssp , dCrystThin_edge_long * dssp ); geoCrystThinShape -> SetVertex(5, dCrystThin_edge_long * dssp , - dCrystThin_edge_long * dssp ); geoCrystThinShape -> SetVertex(6, - dCrystThin_edge_long * dssp , - dCrystThin_edge_long * dssp ); geoCrystThinShape -> SetVertex(7, - dCrystThin_edge_long * dssp , dCrystThin_edge_long * dssp ); /// Cover foil shape //TGeoArb8 *geoCrystThinFoilShape = new TGeoArb8 ("FThin", dCrystThin_length * dssp + dCrystFoilThickness ); //geoCrystThinFoilShape -> SetVertex(0, ( dCrystThin_edge_short * dssp + dCrystFoilThickness ), ( dCrystThin_edge_short * dssp + dCrystFoilThickness ) ); //geoCrystThinFoilShape -> SetVertex(1, ( dCrystThin_edge_short * dssp + dCrystFoilThickness ), - ( dCrystThin_edge_short * dssp + dCrystFoilThickness ) ); //geoCrystThinFoilShape -> SetVertex(2, - ( dCrystThin_edge_short * dssp + dCrystFoilThickness ), - ( dCrystThin_edge_short * dssp + dCrystFoilThickness ) ); //geoCrystThinFoilShape -> SetVertex(3, - ( dCrystThin_edge_short * dssp + dCrystFoilThickness ), ( dCrystThin_edge_short * dssp + dCrystFoilThickness ) ); //geoCrystThinFoilShape -> SetVertex(4, ( dCrystThin_edge_long * dssp + dCrystFoilThickness ), ( dCrystThin_edge_long * dssp + dCrystFoilThickness ) ); //geoCrystThinFoilShape -> SetVertex(5, ( dCrystThin_edge_long * dssp + dCrystFoilThickness ), - ( dCrystThin_edge_long * dssp + dCrystFoilThickness ) ); //geoCrystThinFoilShape -> SetVertex(6, - ( dCrystThin_edge_long * dssp + dCrystFoilThickness ), - ( dCrystThin_edge_long * dssp + dCrystFoilThickness ) ); //geoCrystThinFoilShape -> SetVertex(7, - ( dCrystThin_edge_long * dssp + dCrystFoilThickness ), ( dCrystThin_edge_long * dssp + dCrystFoilThickness ) ); TGeoVolume *geoCrystalThin = new TGeoVolume("geoCrystalThin", geoCrystThinShape, medCrystal); geoCrystalThin -> SetVisLeaves(kTRUE); AddSensitiveVolume( geoCrystalThin ); TGeoTranslation * tfTest = new TGeoTranslation ( "tfTest", 0, 0, dPos_CsIThinCrystal + dCrystThin_length * dssp); moduleKratta->AddNode( geoCrystalThin , 1, tfTest); } /// Thick crystal if ( Add_CsIThikCrystal ) { Double_t dCrystThick_length = 12.500; Double_t dCrystThick_edge_short = 3.277; Double_t dCrystThick_edge_long = 3.850; //Double_t dCrystFoilThickness = 0.0065; //Double_t dMylarThickness = 0.006; //Double_t dMylarEdge = 2.800; //Double_t cutBoxEdge = dMylarEdge; //Must be equal like the window for photodiode and hence Mylar foil. ///Thick crystal shape TGeoArb8 *geoCrystThickShape = new TGeoArb8("CThick", dCrystThick_length * dssp ); geoCrystThickShape -> SetVertex(0, dCrystThick_edge_short * dssp , dCrystThick_edge_short * dssp ); geoCrystThickShape -> SetVertex(1, dCrystThick_edge_short * dssp , - dCrystThick_edge_short * dssp ); geoCrystThickShape -> SetVertex(2, - dCrystThick_edge_short * dssp , - dCrystThick_edge_short * dssp ); geoCrystThickShape -> SetVertex(3, - dCrystThick_edge_short * dssp , dCrystThick_edge_short * dssp ); geoCrystThickShape -> SetVertex(4, dCrystThick_edge_long * dssp , dCrystThick_edge_long * dssp ); geoCrystThickShape -> SetVertex(5, dCrystThick_edge_long * dssp , - dCrystThick_edge_long * dssp ); geoCrystThickShape -> SetVertex(6, - dCrystThick_edge_long * dssp , - dCrystThick_edge_long * dssp ); geoCrystThickShape -> SetVertex(7, - dCrystThick_edge_long * dssp , dCrystThick_edge_long * dssp ); //TGeoArb8 *geoCrystThickFoilShape = new TGeoArb8 ("FThick", dCrystThick_length * dssp + dCrystFoilThickness ); //geoCrystThickFoilShape -> SetVertex(0, ( dCrystThick_edge_short * dssp + dCrystFoilThickness ), ( dCrystThick_edge_short * dssp + dCrystFoilThickness ) ); //geoCrystThickFoilShape -> SetVertex(1, ( dCrystThick_edge_short * dssp + dCrystFoilThickness ), - ( dCrystThick_edge_short * dssp + dCrystFoilThickness ) ); //geoCrystThickFoilShape -> SetVertex(2, - ( dCrystThick_edge_short * dssp + dCrystFoilThickness ), - ( dCrystThick_edge_short * dssp + dCrystFoilThickness ) ); //geoCrystThickFoilShape -> SetVertex(3, - ( dCrystThick_edge_short * dssp + dCrystFoilThickness ), ( dCrystThick_edge_short * dssp + dCrystFoilThickness ) ); //geoCrystThickFoilShape -> SetVertex(4, ( dCrystThick_edge_long * dssp + dCrystFoilThickness ), ( dCrystThick_edge_long * dssp + dCrystFoilThickness ) ); //geoCrystThickFoilShape -> SetVertex(5, ( dCrystThick_edge_long * dssp + dCrystFoilThickness ), - ( dCrystThick_edge_long * dssp + dCrystFoilThickness ) ); //geoCrystThickFoilShape -> SetVertex(6, - ( dCrystThick_edge_long * dssp + dCrystFoilThickness ), - ( dCrystThick_edge_long * dssp + dCrystFoilThickness ) ); //geoCrystThickFoilShape -> SetVertex(7, - ( dCrystThick_edge_long * dssp + dCrystFoilThickness ), ( dCrystThick_edge_long * dssp + dCrystFoilThickness ) ); /// Cut plane - to uncover one side of the crystal //TGeoBBox *cutPlane = new TGeoBBox("cP2", cutBoxEdge * dssp, cutBoxEdge * dssp, cutBoxEdge * dssp); //TGeoTranslation *tCutBox = new TGeoTranslation ( "tcP2", 0, 0, ( dCrystThick_length + cutBoxEdge) * dssp ); //tCutBox -> RegisterYourself(); /// Mylar shape and object //TGeoBBox *geoMylarShape = new TGeoBBox ( "geoMylarShape", dMylarEdge * dssp, dMylarEdge * dssp, dMylarThickness * dssp); //TGeoVolume *geoMylar = new TGeoVolume ( "geoMylar", geoMylarShape, A_mediumForMylarFoil ); //geoMylar -> SetLineColor(4); /// Cover foil - object //TGeoCompositeShape *coverThickShape = new TGeoCompositeShape( "coverThickShape", "(FThick - CThick) - cP2:tcP2"); //TGeoVolume *geoCoverFoil = new TGeoVolume("geoCoverFoil", coverThickShape, A_mediumForReflexFoil); //geoCoverFoil -> SetLineColor(38); /// Crystal - object TGeoVolume *geoCrystalThick = new TGeoVolume ( "geoCrystThick", geoCrystThickShape, medCrystal); //geoCrystalThick -> SetLineColor(41); //AddSensitiveVolume( geoCrystalThick ); geoCrystalThick -> SetVisLeaves(kTRUE); AddSensitiveVolume ( geoCrystalThick ); TGeoTranslation * tf_crystThick_Test = new TGeoTranslation ( "tf_crystThick_Test", 0, 0, dPos_CsIThikCrystal + dCrystThick_length * dssp); moduleKratta->AddNode( geoCrystalThick , 1, tf_crystThick_Test); //TGeoVolume *geoVolume = geom->MakeBox("geoCrystalThickVolume", A_mediumInEmptySpace, 25., 25., 25.); //geoVolume -> AddNode ( geoCrystalThick, 1, new TGeoTranslation (0, 0, dCrystThick_length * dssp + dCrystFoilThickness )); //geoVolume -> AddNode ( geoCoverFoil, 2, new TGeoTranslation (0, 0, dCrystThick_length * dssp + dCrystFoilThickness )); //geoVolume -> AddNode ( geoMylar, 3, new TGeoTranslation (0, 0, dCrystThick_length + dCrystFoilThickness + dMylarThickness * dssp ) ); } if ( Add_CuFrontWall ) { Double_t dWidth = 2.88; Double_t dThickness = 0.01; TGeoVolume *geoCooperFrontface = gGeoManager->MakeBox("COMP_Cu", medCu, dWidth * dssp, dWidth * dssp, dThickness * dssp); TGeoTranslation * tf_cooperFrontface = new TGeoTranslation ( "tf_cooperFrontface", 0, 0, dPos_CuFrontWall + dThickness * dssp ); moduleKratta -> AddNode ( geoCooperFrontface , 1, tf_cooperFrontface ); } if ( Add_DistanceWall ) { Double_t dWidth = 4.23; Double_t dThickness = 0.09; TGeoVolume *geoDistanceWall = gGeoManager -> MakeBox("geoDistanceWall", medAl, dWidth * dssp, dWidth * dssp, dThickness * dssp); geoDistanceWall -> SetVisLeaves ( kTRUE ); TGeoTranslation * tf_distanceWall = new TGeoTranslation ( "tf_distanceWall", 0, 0, dPos_DistanceWall + dThickness * dssp ); moduleKratta -> AddNode ( geoDistanceWall , 1, tf_distanceWall ); } if ( Add_PartitionalWall ) { Double_t dHeight = 4.23; Double_t dWidth = 4.23; Double_t dThickness = 1.0; Double_t dRadius = 2.0; /// make shape components TGeoBBox *sbox = new TGeoBBox("B",dHeight * dssp, dWidth * dssp, dThickness * dssp); TGeoTube *stub = new TGeoTube("T",0, dRadius * dssp, dThickness * dssp + 0.1 ); /// create a composite TGeoCompositeShape *cs = new TGeoCompositeShape( "cs", "(B-T)" ); TGeoVolume * geoPartitionWall = new TGeoVolume("COMP",cs, medAl ); geoPartitionWall -> SetVisLeaves ( kTRUE ); TGeoTranslation * tf_partitionWall = new TGeoTranslation ( "tf_partitionWall", 0, 0, dPos_PartitionalWall + dThickness * dssp ); moduleKratta -> AddNode ( geoPartitionWall, 1, tf_partitionWall ); } if ( Add_BackWall ) { Double_t dWidth = 6.58; Double_t dThickness = 0.2; TGeoVolume *geoBackWall = gGeoManager -> MakeBox("geoBackWall", medAl , dWidth * dssp, dWidth * dssp, dThickness * dssp); //geoBackWall -> SetLineColor( 31 ); geoBackWall -> SetVisLeaves ( kTRUE ); TGeoTranslation * tf_backWall = new TGeoTranslation ( "tf_backWall", 0, 0, dPos_BackWall + dThickness * dssp ); moduleKratta -> AddNode ( geoBackWall , 1, tf_backWall ); } if ( Add_Frame ) { /// Shapes for cover and cuts in this cover /// 0. Cover Double_t dCoverLength = 31.38; Double_t dCoverFrontEdge = 3.70; Double_t dCoverBackEdge = 6.58; Double_t P000 = 0. ; ///Polozenie poczatku detektora - Punkt (0,0,0) - skladowa z. Double_t epsilon = 0.01; //a small value TGeoArb8 *cover = new TGeoArb8("cover", dCoverLength * dssp ); cover ->SetVertex(0, dCoverFrontEdge * dssp, dCoverFrontEdge * dssp ); cover ->SetVertex(1, dCoverFrontEdge * dssp, - dCoverFrontEdge * dssp ); cover ->SetVertex(2, - dCoverFrontEdge * dssp, - dCoverFrontEdge * dssp ); cover ->SetVertex(3, - dCoverFrontEdge * dssp, dCoverFrontEdge * dssp); cover ->SetVertex(4, dCoverBackEdge * dssp, dCoverBackEdge * dssp ); cover ->SetVertex(5, dCoverBackEdge * dssp, - dCoverBackEdge * dssp ); cover ->SetVertex(6, - dCoverBackEdge * dssp, - dCoverBackEdge * dssp ); cover ->SetVertex(7, - dCoverBackEdge * dssp, dCoverBackEdge * dssp); TGeoTranslation *tCover = new TGeoTranslation("tCover", 0, 0, dCoverLength/2. ); tCover->RegisterYourself(); /// 1. Cut cA Double_t dcAlength = dCoverLength; Double_t dcAWidth = 2.88; Double_t dcALocation = P000 - epsilon; TGeoBBox *cA = new TGeoBBox("cA", dcAWidth * dssp, dcAWidth * dssp, dcAlength * dssp); TGeoTranslation *tcA = new TGeoTranslation("tcA", 0, 0, dcALocation + dCoverLength/2. ); tcA->RegisterYourself(); /// 2. Cut cB - Photodiode Double_t dcBLength = 0.32; Double_t dcBWidth = 3.39; Double_t dcBLocation_a = P000 + 0.74; Double_t dcBLocation_b = dcBLocation_a + dcBLength + 0.3 ; TGeoBBox *cB = new TGeoBBox("cB", dcBWidth * dssp, dcBWidth * dssp, dcBLength * dssp); TGeoTranslation *tcBa = new TGeoTranslation("tcBa", 0, 0, dcBLocation_a + dcBLength/2. ); tcBa->RegisterYourself(); TGeoTranslation *tcBb = new TGeoTranslation("tcBb", 0, 0, dcBLocation_b + dcBLength/2. ); tcBb->RegisterYourself(); /// 3. Cut cC - Crystal Double_t dcCLength = 2.55; Double_t dcCFrontEdge = 2.88; Double_t dcCBackEdge = 3.04; TGeoArb8 *cC = new TGeoArb8("cC", dcCLength * dssp ); cC ->SetVertex(0, dcCFrontEdge * dssp, dcCFrontEdge * dssp ); cC ->SetVertex(1, dcCFrontEdge * dssp, - dcCFrontEdge * dssp ); cC ->SetVertex(2, - dcCFrontEdge * dssp, - dcCFrontEdge * dssp ); cC ->SetVertex(3, - dcCFrontEdge * dssp, dcCFrontEdge * dssp); cC ->SetVertex(4, dcCBackEdge * dssp, dcCBackEdge * dssp ); cC ->SetVertex(5, dcCBackEdge * dssp, - dcCBackEdge * dssp ); cC ->SetVertex(6, - dcCBackEdge * dssp, - dcCBackEdge * dssp ); cC ->SetVertex(7, - dcCBackEdge * dssp, dcCBackEdge * dssp); Double_t dcCLocation = dcBLocation_b + dcBLength; TGeoTranslation *tcC = new TGeoTranslation("tcC", 0, 0, dcCLocation + dcCLength/2. ); tcC->RegisterYourself(); /// 4. Cut cD - Crystal Double_t dcDLength = 12.55; Double_t dcDFrontEdge = 3.39; Double_t dcDBackEdge = 3.97; TGeoArb8 *cD = new TGeoArb8("cD", dcDLength * dssp ); cD ->SetVertex(0, dcDFrontEdge * dssp, dcDFrontEdge * dssp ); cD ->SetVertex(1, dcDFrontEdge * dssp, - dcDFrontEdge * dssp ); cD ->SetVertex(2, - dcDFrontEdge * dssp, - dcDFrontEdge * dssp ); cD ->SetVertex(3, - dcDFrontEdge * dssp, dcDFrontEdge * dssp); cD ->SetVertex(4, dcDBackEdge * dssp, dcDBackEdge * dssp ); cD ->SetVertex(5, dcDBackEdge * dssp, - dcDBackEdge * dssp ); cD ->SetVertex(6, - dcDBackEdge * dssp, - dcDBackEdge * dssp ); cD ->SetVertex(7, - dcDBackEdge * dssp, dcDBackEdge * dssp); Double_t dcDLocation = dcCLocation + dcCLength; TGeoTranslation *tcD = new TGeoTranslation("tcD", 0, 0, dcDLocation + dcDLength/2.); tcD -> RegisterYourself(); /// 5. Cut cE Double_t dcElength = 0.2; Double_t dcEWidth = 4.23; Double_t dcELocation = dcDLocation + dcDLength + 0.32; TGeoBBox *cE = new TGeoBBox("cE", dcEWidth * dssp, dcEWidth * dssp, dcElength * dssp); TGeoTranslation *tcE = new TGeoTranslation("tcE", 0, 0, dcELocation + dcElength/2. ); tcE->RegisterYourself(); /// 6. Cut cF Double_t dcFlength = 1.95; Double_t dcFWidth = 3.97; Double_t dcFLocation = dcDLocation + dcDLength ; TGeoBBox *cF = new TGeoBBox("cF", dcFWidth * dssp, dcFWidth * dssp, dcFlength * dssp + epsilon); /// Look: Here is a small extension to provide cuts overlapping. TGeoTranslation *tcF = new TGeoTranslation("tcF", 0, 0, dcFLocation + dcFlength/2. - epsilon); tcF->RegisterYourself(); /// 7. Cut cG Double_t dcGlength = 1.0; Double_t dcGWidth = 4.23; Double_t dcGLocation = dcFLocation + dcFlength; TGeoBBox *cG = new TGeoBBox("cG", dcGWidth * dssp, dcGWidth * dssp, (dcGlength )* dssp + epsilon); /// Look: Here is a small extension to provide cuts overlapping. TGeoTranslation *tcG = new TGeoTranslation("tcG", 0, 0, dcGLocation + dcGlength/2. - epsilon ); tcG->RegisterYourself(); /// 8. Cut cH Double_t dcHlength = 11.65 + epsilon; /// Look: Here is a small extension to provide cuts overlapping. Double_t dcHWidth = 4.63; Double_t dcHLocation = dcGLocation + dcGlength - epsilon/2.; TGeoBBox *cH = new TGeoBBox("cH", dcHWidth * dssp, dcHWidth * dssp, dcHlength * dssp); TGeoTranslation *tcH = new TGeoTranslation("tcH", 0, 0, dcHLocation + dcHlength/2.); tcH->RegisterYourself(); TGeoCompositeShape *cc = new TGeoCompositeShape( "cc", "( (((((( cB:tcBa + cB:tcBb) + cC:tcC ) + cD:tcD ) + cE:tcE ) + cF:tcF ) + cG:tcG ) + cH:tcH ) + cA:tcA" ); TGeoCompositeShape *cs = new TGeoCompositeShape( "cs", " (cover:tCover - cc)" ); /// IV Create volume TGeoVolume * geoCover = new TGeoVolume("geoCover",cs , medAl ); geoCover -> SetVisLeaves ( kTRUE ); TGeoTranslation * tf_cover = new TGeoTranslation ( "tf_cover", 0, 0, dPos_Frame );// + dCoverLength * dssp ); //cout << "[KRATTA Geo]: Cover location = " << dPos_Frame << endl; moduleKratta -> AddNode ( geoCover , 1, tf_cover ); } ///Detektor jest ustawiony prawie dobrze (male szpary do usuniecia - przy przesunieciu do farAway) ///Ale wtedy detektor staje sie niewidoczny dla czastek. geoModuleFarAway -> AddNode (moduleKratta, 1, new TGeoTranslation("tf_mfaway", 0, 0, fGeoDistanceFromTargetToFirstCrystal) );///TODO REmove that. Zobacz, jak liczysz odleglosc od tarczy: do diody, czy do sciany przedniej for ( int colii = 0; colii <5; colii++) { //columnKratta-> AddNode ( geoModuleFarAway, colii, new TGeoCombiTrans ( Form( "ctr_m%d", colii),0, 0, fGeoDistanceFromTargetToFirstCrystal, new TGeoRotation( Form("rot_m%d", colii ), 0, (colii+ 0.5)* fGeoModuleAngle, 0))); columnKratta-> AddNode ( geoModuleFarAway, colii + 1, new TGeoRotation( Form( "ctr_m%d", colii), 0, (colii+0.5) * fGeoModuleAngle, 0)); } for ( int colii = 0; colii <7; colii++) { //columnKratta-> AddNode ( geoModuleFarAway, colii, new TGeoCombiTrans ( Form( "ctr_m%d", colii),0, 0, fGeoDistanceFromTargetToFirstCrystal, new TGeoRotation( Form("rot_m%d", colii ), 0, (colii+ 0.5)* fGeoModuleAngle, 0))); detectorKratta-> AddNode ( columnKratta, colii + 1, new TGeoRotation( Form( "ctr2_m%d", colii), colii * fGeoColumnAngle, -90, 0 )); } //columnKratta-> AddNode ( moduleKratta, 1, new TGeoCombiTrans( "ctr_m1", 0, 0.5 * fGeoModuleAngle, 0)); /// 1/2 of the angle "ang" to setup edge of module in XZ plane. //columnKratta-> AddNode ( moduleKratta, 2, new TGeoCombiTrans( "ctr_m2", 0, 1.5 * fGeoModuleAngle, 0)); //columnKratta-> AddNode ( moduleKratta, 3, new TGeoCombiTrans( "ctr_m3", 0, 2.5 * fGeoModuleAngle, 0)); //columnKratta-> AddNode ( moduleKratta, 4, new TGeoCombiTrans( "ctr_m4", 0, 3.5 * fGeoModuleAngle, 0)); //columnKratta-> AddNode ( moduleKratta, 5, new TGeoCombiTrans( "ctr_m5", 0, 4.5 * fGeoModuleAngle, 0)); ///For centering Z axis in the detector. In deg. ///NOTE: angleBetweenSideAndCenterModule is fenomenologically determined value. /// TODO: It has to be calculated analytically in function of: angleBetweenSideAndCenterModule = f(fGeoModuleAngle, fGeoColumnAngle, ...). Double_t angleBetweenSideAndCenterModule = 18.0 ;// 18.0; TGeoRotation * rotToSetInDefaultPosition = new TGeoRotation( "rotToSetInDefaultPosition", 0, -90, 180 - angleBetweenSideAndCenterModule ); TGeoCombiTrans * combiTranslToDefaultPosition = new TGeoCombiTrans( 0.0 , 0.0, - fGeoDistanceFromTargetToFirstCrystal, rotToSetInDefaultPosition ); //TGeoCombiTrans * combiTranslToDefaultPosition = new TGeoCombiTrans( 0.0 , 0.0, 0.0, rotToSetInDefaultPosition ); // topKratta -> AddNode ( detectorKratta, 1, combiTranslToDefaultPosition); // geoModuleFarAway -> AddNode( moduleKratta, 1 ); //geoModuleFarAway -> AddNode( moduleKratta, 2, new TGeoTranslation("tf_mfaway", 0, 0, 40) ); //geoModuleFarAway -> AddNode( moduleKratta, 3, new TGeoTranslation("tf_mfaway", 0, 0, 75) ); //topKratta -> AddNode( geoModuleFarAway, 1 ); TGeoRotation *zeroRotation= new TGeoRotation("zeroRotation", 0, 0, 0 ); TGeoCombiTrans *t0 = new TGeoCombiTrans( 0.0 , 0.0, 0.0, zeroRotation); //TGeoCombiTrans *t0 = new TGeoCombiTrans( 0.0 , 0.0, -fGeoDistanceFromTargetToFirstCrystal, rotToSetInDefaultPosition); //Cave->AddNode( detectorKratta, 1, GetGlobalPosition ( t0 ) ); Cave->AddNode( moduleKratta, 1, GetGlobalPosition ( t0 ) ); Cave->AddNode( moduleKratta, 2, new TGeoTranslation ( "testTranslation", 0, 0, 17 ) ); //gGeoManager->SetVisLevel(6); /* ///Checking influence of volume nesting: TGeoVolume *geoTestingVolume1 = gGeoManager->MakeBox( "geoTestingVolume1", Vacuum, 20., 20., 70.); TGeoVolume *geoTestingVolume2 = gGeoManager->MakeBox( "geoTestingVolume2", Vacuum, 20., 20., 70.); TGeoVolume *geoTestingVolume3 = gGeoManager->MakeBox( "geoTestingVolume3", Vacuum, 20., 20., 70.); TGeoVolume *geoTestingVolume4 = gGeoManager->MakeBox( "geoTestingVolume4", Vacuum, 20., 20., 70.); TGeoVolume *geoTestingVolume5 = gGeoManager->MakeBox( "geoTestingVolume5", Vacuum, 20., 20., 70.); geoTestingVolume1->AddNode( moduleKratta, 1 ); geoTestingVolume1->AddNode( moduleKratta, 2, new TGeoTranslation ( "testTranslation", 0, 0, 17 ) ); geoTestingVolume2->AddNode( geoTestingVolume1, 1 ); geoTestingVolume3->AddNode( geoTestingVolume2, 1 ); geoTestingVolume4->AddNode( geoTestingVolume3, 1 ); geoTestingVolume5->AddNode( geoTestingVolume4, 1 ); Cave->AddNode( geoTestingVolume1, 1, GetGlobalPosition ( t0 ) ); */ gGeoManager->SetVisLevel(6); cout << "KKKKKKKKRAAAAAAAAAAAAATTTTTTTTTTTTTTTTAAAAAAAAAAAAAA" << endl; } ClassImp(Kratta)