From 178a256c5111efa9ad0ade446e909ac3fe85bdb1 Mon Sep 17 00:00:00 2001 From: cvetan Date: Fri, 17 Mar 2006 15:51:20 +0000 Subject: [PATCH] ApplyDisplacements method renamed to ApplyAlignObjsToGeom. Automatic check of overlaps after the application of the alignment objects (R.Grosso) --- STEER/AliRun.cxx | 9 ++++++++- STEER/AliRun.h | 2 +- STEER/AliSimulation.cxx | 14 +++++++------- STEER/AliSimulation.h | 6 +++--- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/STEER/AliRun.cxx b/STEER/AliRun.cxx index a92be230e4d..ddd0042009a 100644 --- a/STEER/AliRun.cxx +++ b/STEER/AliRun.cxx @@ -49,6 +49,7 @@ #include #include #include +#include // #include "AliLog.h" #include "AliDetector.h" @@ -959,7 +960,7 @@ void AliRun::AddModule(AliModule* mod) } //_____________________________________________________________________________ -Bool_t AliRun::ApplyDisplacements(TClonesArray* AlObjArray) +Bool_t AliRun::ApplyAlignObjsToGeom(TClonesArray* AlObjArray) { // Read collection of alignment objects (AliAlignObj derived) saved // in the TClonesArray ClArrayName and apply them to the geometry @@ -974,6 +975,12 @@ Bool_t AliRun::ApplyDisplacements(TClonesArray* AlObjArray) return kFALSE; } + gGeoManager->CheckOverlaps(50); + TObjArray* ovexlist = gGeoManager->GetListOfOverlaps(); + if(ovexlist->GetEntriesFast()){ + AliErrorClass("The application of alignment objects to the geometry caused huge overlaps/extrusions!"); + } + return kTRUE; } diff --git a/STEER/AliRun.h b/STEER/AliRun.h index e5ccc59139b..b62c249375b 100644 --- a/STEER/AliRun.h +++ b/STEER/AliRun.h @@ -141,7 +141,7 @@ public: // Method to introduce the detector misliagnment // It is called by AliSimulation - static Bool_t ApplyDisplacements(TClonesArray* AlObjArray); + static Bool_t ApplyAlignObjsToGeom(TClonesArray* AlObjArray); protected: virtual void Tree2Tree(Option_t *option, const char *detector=0); diff --git a/STEER/AliSimulation.cxx b/STEER/AliSimulation.cxx index 15b4a4f5729..898db856c31 100644 --- a/STEER/AliSimulation.cxx +++ b/STEER/AliSimulation.cxx @@ -269,7 +269,7 @@ void AliSimulation::SetEventsPerFile(const char* detector, const char* type, } //_____________________________________________________________________________ -Bool_t AliSimulation::ApplyDisplacements(const char* fileName, const char* clArrayName) +Bool_t AliSimulation::ApplyAlignObjsToGeom(const char* fileName, const char* clArrayName) { // read collection of alignment objects (AliAlignObj derived) saved // in the TClonesArray ClArrayName in the file fileName and apply @@ -289,12 +289,12 @@ Bool_t AliSimulation::ApplyDisplacements(const char* fileName, const char* clArr return kFALSE; } - return gAlice->ApplyDisplacements(alObjArray); + return gAlice->ApplyAlignObjsToGeom(alObjArray); } //_____________________________________________________________________________ -Bool_t AliSimulation::ApplyDisplacements(AliCDBParam* param, AliCDBId& Id) +Bool_t AliSimulation::ApplyAlignObjsToGeom(AliCDBParam* param, AliCDBId& Id) { // read collection of alignment objects (AliAlignObj derived) saved // in the TClonesArray ClArrayName in the AliCDBEntry identified by @@ -306,12 +306,12 @@ Bool_t AliSimulation::ApplyDisplacements(AliCDBParam* param, AliCDBId& Id) AliCDBEntry* entry = storage->Get(Id); TClonesArray* AlObjArray = ((TClonesArray*) entry->GetObject()); - return gAlice->ApplyDisplacements(AlObjArray); + return gAlice->ApplyAlignObjsToGeom(AlObjArray); } //_____________________________________________________________________________ -Bool_t AliSimulation::ApplyDisplacements(const char* uri, const char* path, Int_t runnum, Int_t version, Int_t sversion) +Bool_t AliSimulation::ApplyAlignObjsToGeom(const char* uri, const char* path, Int_t runnum, Int_t version, Int_t sversion) { // read collection of alignment objects (AliAlignObj derived) saved // in the TClonesArray ClArrayName in the AliCDBEntry identified by @@ -322,7 +322,7 @@ Bool_t AliSimulation::ApplyDisplacements(const char* uri, const char* path, Int_ AliCDBParam* param = AliCDBManager::Instance()->CreateParameter(uri); AliCDBId id(path, runnum, runnum, version, sversion); - return ApplyDisplacements(param, id); + return ApplyAlignObjsToGeom(param, id); } @@ -511,7 +511,7 @@ Bool_t AliSimulation::RunSimulation(Int_t nEvents) // to the present TGeo geometry if (fAlignObjArray) { if (gGeoManager && gGeoManager->IsClosed()) { - if (gAlice->ApplyDisplacements(fAlignObjArray) == kFALSE) { + if (gAlice->ApplyAlignObjsToGeom(fAlignObjArray) == kFALSE) { AliError("The application of misalignment failed! Restart aliroot and try again. "); return kFALSE; } diff --git a/STEER/AliSimulation.h b/STEER/AliSimulation.h index 7e4e6d22815..0a0f303242e 100644 --- a/STEER/AliSimulation.h +++ b/STEER/AliSimulation.h @@ -56,11 +56,11 @@ public: {fWriteRawData = detectors; fRawDataFileName = fileName; fDeleteIntermediateFiles = deleteIntermediateFiles;}; - static Bool_t ApplyDisplacements(const char* fileName, + static Bool_t ApplyAlignObjsToGeom(const char* fileName, const char* clArrayName); - static Bool_t ApplyDisplacements(AliCDBParam* param, + static Bool_t ApplyAlignObjsToGeom(AliCDBParam* param, AliCDBId& Id); - static Bool_t ApplyDisplacements(const char* uri, const char* path, + static Bool_t ApplyAlignObjsToGeom(const char* uri, const char* path, Int_t runnum, Int_t version, Int_t sversion); void SetAlignObjArray(TClonesArray *array) -- 2.39.3