Skip to content

Commit

Permalink
Changes in ITS and steering code to support parallel world misalignment
Browse files Browse the repository at this point in the history
  • Loading branch information
agheata committed Jan 9, 2015
1 parent 1e87bf9 commit ef2f741
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
73 changes: 73 additions & 0 deletions ITS/ITSsim/AliITS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ the AliITS class.
#include <TTree.h>
#include <TVirtualMC.h>
#include <TArrayI.h>
#include <TGeoManager.h>
#include <TGeoParallelWorld.h>
#include "AliDetector.h"
#include "AliITS.h"
#include "AliITSDetTypeSim.h"
Expand Down Expand Up @@ -1401,6 +1403,77 @@ void AliITS::UpdateInternalGeometry(){
AliITSInitGeometry initgeom;
AliITSgeom* geom = initgeom.CreateAliITSgeom(version);
SetITSgeom(geom);
// Add volumes in Parallel World
TGeoParallelWorld *pw = gGeoManager->GetParallelWorld();

if (pw && !pw->IsClosed()) {
// Int_t nPN = gGeoManager->GetListOfPhysicalNodes()->GetEntries();
for (Int_t i=0; i<6; ++i) printf("sens %d: %s\n", i,fIdName[i].Data());
TGeoIterator next(gGeoManager->GetTopVolume());
TString path;
TGeoNode *node;
while ((node=next())) {
next.GetPath(path);
if (path.Contains(fIdName[0].Data())
|| path.Contains(fIdName[1].Data())
|| path.Contains(fIdName[2].Data())
|| path.Contains(fIdName[3].Data())
|| path.Contains(fIdName[4].Data())
|| path.Contains(fIdName[5].Data())
)
{
// printf("PW: adding %s\n", path.Data());
pw->AddNode(path);
}
}
// Now declare the list of overlapping volumes. Note that these can be
// automatically detected by the end of a simulation using PW without
// any overlaps defined. In this case the found overlaps can be printed
// using TGeoParallelWorld::PrintDetectedOverlaps
pw->AddOverlap("ITSSPDbus");
pw->AddOverlap("ITSSPDladderGlue");
pw->AddOverlap("ITSSPDpt1000");
pw->AddOverlap("ITSSPDgFoilKapL");
pw->AddOverlap("ITSSPDgFoilGlueL");
pw->AddOverlap("ITSSPDgFoilAluL");
pw->AddOverlap("ITSSPDCarbonFiberSupportSectorA0");
pw->AddOverlap("ITSSPDGrease");
pw->AddOverlap("ITSSPDgFoilKapR");
pw->AddOverlap("ITSSPDgFoilGlueR");
pw->AddOverlap("ITSSPDgFoilAluR");
pw->AddOverlap("ITSSPDCoolingTubeTA0");
pw->AddOverlap("ITSSPDCoolingTubeFluidTA1");
pw->AddOverlap("ITSSPDresistor");
pw->AddOverlap("ITSSPDclip");
pw->AddOverlap("ITSSPDcapacitor");
pw->AddOverlap("ITSsddBaseThermalBridge");
pw->AddOverlap("ITSsddHybridVol");
pw->AddOverlap("ITSsddHybridThBridge");
pw->AddOverlap("vScreenAl");
pw->AddOverlap("vScreenUpGlue");
pw->AddOverlap("vLowUpGlueBar1");
pw->AddOverlap("vLowAlBar1");
pw->AddOverlap("vLowUpGlueBar2");
pw->AddOverlap("vLowAlBar2");
pw->AddOverlap("vCableSegLay");
pw->AddOverlap("lowFLpieceA4");
pw->AddOverlap("lowFLpieceB4");
pw->AddOverlap("lowFLpieceA5");
pw->AddOverlap("lowFLpieceB5");
pw->AddOverlap("lowFLpieceA6");
pw->AddOverlap("lowFLpieceB6");
pw->AddOverlap("pascalCC1");
pw->AddOverlap("ambraCC1");
pw->AddOverlap("pascalCC2");
pw->AddOverlap("pascalCC3");
pw->AddOverlap("ccLayerB0");
pw->AddOverlap("ccLayerB1");
pw->AddOverlap("ccLayerB3");
pw->AddOverlap("ITSsddSMDend");
pw->AddOverlap("ITSsddCFSideBeamVol");
pw->AddOverlap("ITSsddSegment");
pw->AddOverlap("ITSsddAlFoilHybSide");
}
}
//______________________________________________________________________
AliTriggerDetector* AliITS::CreateTriggerDetector() const {
Expand Down
9 changes: 9 additions & 0 deletions STEER/STEER/AliSimulation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
#include <TFile.h>
#include <TGeoGlobalMagField.h>
#include <TGeoManager.h>
#include <TGeoParallelWorld.h>
#include <TObjString.h>
#include <TROOT.h>
#include <TSystem.h>
Expand Down Expand Up @@ -588,6 +589,9 @@ Bool_t AliSimulation::MisalignGeometry(AliRunLoader *runLoader)
}
}

// Create Parallel World
TGeoParallelWorld *pw = gGeoManager->CreateParallelWorld("Alice Parallel World");

// Update the internal geometry of modules (ITS needs it)
TString detStr = fLoadAlObjsListOfDets;
TObjArray* detArray = runLoader->GetAliRun()->Detectors();
Expand All @@ -600,6 +604,11 @@ Bool_t AliSimulation::MisalignGeometry(AliRunLoader *runLoader)
}
} // end loop over detectors

// Close the Parallel World
pw->CloseGeometry();
gGeoManager->SetUseParallelWorldNav(kTRUE);
//Export misaligned geometry
// gGeoManager->Export("misaligned.root");

if (delRunLoader) delete runLoader;

Expand Down

0 comments on commit ef2f741

Please sign in to comment.