From: masera Date: Wed, 5 Mar 2008 18:05:25 +0000 (+0000) Subject: Added option TGeo in the constructor in order to initialize some parameters directly... X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=c9649d1e2ba81396636d91d027afc0ba1bb2ad05;p=u%2Fmrichter%2FAliRoot.git Added option TGeo in the constructor in order to initialize some parameters directly from the geometry --- diff --git a/ITS/AliITSsegmentation.h b/ITS/AliITSsegmentation.h index c23f70553af..f6beaa7529e 100644 --- a/ITS/AliITSsegmentation.h +++ b/ITS/AliITSsegmentation.h @@ -5,7 +5,7 @@ #include "AliLog.h" #include "AliITSgeom.h" -/* $Id:$ */ +/* $Id$ */ //---------------------------------------------- // - @@ -113,7 +113,7 @@ public TObject { //SDD: Drift distance of the 1/2detector (x axis)-microns //SSD: Full length of the detector (x axis)- microns Float_t fDz; //SPD: Full length of the detector (z axis)- microns - //SDD: Length of half-detector (z axis) - microns + //SDD: Full Length of the detector (z axis) - microns //SSD: Full width of the detector (z axis)- microns Float_t fDy; //SPD: Full thickness of the detector (y axis) -um //SDD: Full thickness of the detector (y axis) - microns diff --git a/ITS/AliITSsegmentationSDD.cxx b/ITS/AliITSsegmentationSDD.cxx index 553b68e67c5..dda7b9e3020 100644 --- a/ITS/AliITSsegmentationSDD.cxx +++ b/ITS/AliITSsegmentationSDD.cxx @@ -14,7 +14,9 @@ **************************************************************************/ #include #include - +#include +#include +#include #include "AliITSsegmentationSDD.h" #include "AliITSgeomSDD.h" #include "AliITSresponseSDD.h" @@ -44,7 +46,7 @@ // Z // ///////////////////////////////////////////////////////////////////////////// -/* $Id:$ */ +/* $Id$ */ const Float_t AliITSsegmentationSDD::fgkDxDefault = 35085.; const Float_t AliITSsegmentationSDD::fgkDzDefault = 75264.; @@ -71,7 +73,7 @@ fSetDriftSpeed(0){ InitFromGeom(geom); } //______________________________________________________________________ -AliITSsegmentationSDD::AliITSsegmentationSDD() : AliITSsegmentation(), +AliITSsegmentationSDD::AliITSsegmentationSDD(Option_t *opt) : AliITSsegmentation(), fNsamples(0), fNanodes(0), fPitch(0), @@ -80,6 +82,21 @@ fDriftSpeed(0), fSetDriftSpeed(0){ // Default constructor Init(); + if(strstr(opt,"TGeo")){ + if(!gGeoManager){ + AliError("Geometry is not initialized\n"); + return; + } + TGeoVolume *v=NULL; + v = gGeoManager->GetVolume("ITSsddSensitivL3"); + if(!v){ + AliWarning("TGeo volume ITSsddSensitivL3 not found (hint: use v11Hybrid geometry)\n Using hardwired default values"); + } + else { + TGeoBBox *s=(TGeoBBox*)v->GetShape(); + SetDetSize(s->GetDX()*10000.,s->GetDZ()*20000.,s->GetDY()*20000.); + } + } } //______________________________________________________________________ diff --git a/ITS/AliITSsegmentationSDD.h b/ITS/AliITSsegmentationSDD.h index 6d52b351c5d..9b51ebfe5b4 100644 --- a/ITS/AliITSsegmentationSDD.h +++ b/ITS/AliITSsegmentationSDD.h @@ -13,7 +13,7 @@ public AliITSsegmentation { public: - AliITSsegmentationSDD(); + AliITSsegmentationSDD(Option_t *opt=""); AliITSsegmentationSDD(const AliITSsegmentationSDD &source); AliITSsegmentationSDD& operator=(const AliITSsegmentationSDD &source); AliITSsegmentationSDD(AliITSgeom *gm); diff --git a/ITS/AliITSsegmentationSPD.cxx b/ITS/AliITSsegmentationSPD.cxx index 2a92057c636..2956ffef1f9 100644 --- a/ITS/AliITSsegmentationSPD.cxx +++ b/ITS/AliITSsegmentationSPD.cxx @@ -13,6 +13,9 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +#include +#include +#include #include "AliITSsegmentationSPD.h" //#include "AliITSgeom.h" ////////////////////////////////////////////////////// @@ -23,7 +26,7 @@ ClassImp(AliITSsegmentationSPD) //_____________________________________________________________________________ - AliITSsegmentationSPD::AliITSsegmentationSPD(): AliITSsegmentation(), + AliITSsegmentationSPD::AliITSsegmentationSPD(Option_t *opt): AliITSsegmentation(), fNpx(0), fNpz(0){ // Default constructor @@ -31,6 +34,35 @@ fNpz(0){ fCellSizeX[k] = 0.; fCellSizeZ[k] = 0.; } + + if(strstr(opt,"TGeo")){ + if(!gGeoManager){ + AliError("Geometry is not initialized\n"); + return; + } + TGeoVolume *v=NULL; + v = gGeoManager->GetVolume("ITSSPDlay1-sensor"); + if(!v){ + AliWarning("TGeo volume ITSSPDlay1-sensor not found (hint: use v11Hybrid geometry)\n Using hardwired default values"); + SetDetSize(12800,69600,200); + } + else { + TGeoBBox *s=(TGeoBBox*)v->GetShape(); + SetDetSize(s->GetDX()*20000.,s->GetDZ()*20000.,s->GetDY()*20000.); + } + Float_t bx[256],bz[280]; + Int_t i; + SetNPads(256,160); // Number of Bins in x and z + for(i=000;i<256;i++) bx[i] = 50.0; // in x all are 50 microns. + for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below + for(i=160;i<280;i++) bz[i] = 0.0; // Outside of detector. + bz[ 31] = bz[ 32] = 625.0; // first chip boundry + bz[ 63] = bz[ 64] = 625.0; // first chip boundry + bz[ 95] = bz[ 96] = 625.0; // first chip boundry + bz[127] = bz[128] = 625.0; // first chip boundry + bz[160] = 425.0; // Set so that there is no zero pixel size for fNz. + SetBinSize(bx,bz); // Based on AliITSgeomSPD for now. + } } //_____________________________________________________________________________ diff --git a/ITS/AliITSsegmentationSPD.h b/ITS/AliITSsegmentationSPD.h index e51bf915f21..8decc2a4cc0 100644 --- a/ITS/AliITSsegmentationSPD.h +++ b/ITS/AliITSsegmentationSPD.h @@ -12,7 +12,7 @@ class AliITSsegmentationSPD : public AliITSsegmentation { public: - AliITSsegmentationSPD(); + AliITSsegmentationSPD(Option_t *opt="" ); AliITSsegmentationSPD(AliITSgeom *gm); AliITSsegmentationSPD(const AliITSsegmentationSPD &source); virtual ~AliITSsegmentationSPD(){} diff --git a/ITS/AliITSsegmentationSSD.cxx b/ITS/AliITSsegmentationSSD.cxx index 5ca62512dd4..f935225f3e8 100644 --- a/ITS/AliITSsegmentationSSD.cxx +++ b/ITS/AliITSsegmentationSSD.cxx @@ -17,6 +17,9 @@ #include #include +#include +#include +#include #include "AliITSsegmentationSSD.h" ////////////////////////////////////////////////////// @@ -31,7 +34,7 @@ const Float_t AliITSsegmentationSSD::fgkPitchDefault = 95.; const Int_t AliITSsegmentationSSD::fgkNstripsDefault = 768; ClassImp(AliITSsegmentationSSD) -AliITSsegmentationSSD::AliITSsegmentationSSD(): AliITSsegmentation(), +AliITSsegmentationSSD::AliITSsegmentationSSD(Option_t *opt): AliITSsegmentation(), fNstrips(0), fStereoP(0), fStereoN(0), @@ -42,6 +45,25 @@ fStereoPl6(0), fStereoNl6(0), fLayer(0){ // default constructor + SetDetSize(fgkDxDefault,fgkDzDefault,fgkDyDefault); + SetPadSize(fgkPitchDefault,0.); + SetNPads(fgkNstripsDefault,0); + SetAngles(); + if(strstr(opt,"TGeo")){ + if(!gGeoManager){ + AliError("Geometry is not initialized\n"); + return; + } + TGeoVolume *v=NULL; + v = gGeoManager->GetVolume("ITSssdSensitivL5"); + if(!v){ + AliWarning("TGeo volumeITSssdSensitivL5 not found (hint: use v11Hybrid geometry)\n Using hardwired default values"); + } + else { + TGeoBBox *s=(TGeoBBox*)v->GetShape(); + SetDetSize(s->GetDX()*20000.,s->GetDZ()*20000.,s->GetDY()*20000.); + } + } } //---------------------------------------------------------------------- AliITSsegmentationSSD::AliITSsegmentationSSD(AliITSgeom *geom): @@ -56,12 +78,10 @@ fStereoPl6(0), fStereoNl6(0), fLayer(0){ // constuctor - fCorr = 0; SetDetSize(fgkDxDefault,fgkDzDefault,fgkDyDefault); SetPadSize(fgkPitchDefault,0.); SetNPads(fgkNstripsDefault,0); SetAngles(); - fLayer = 0; } //______________________________________________________________________ void AliITSsegmentationSSD::Copy(TObject &obj) const { diff --git a/ITS/AliITSsegmentationSSD.h b/ITS/AliITSsegmentationSSD.h index 74332009f5c..4329fbf9a81 100644 --- a/ITS/AliITSsegmentationSSD.h +++ b/ITS/AliITSsegmentationSSD.h @@ -9,7 +9,7 @@ class AliITSsegmentationSSD : public AliITSsegmentation { public: - AliITSsegmentationSSD(); + AliITSsegmentationSSD(Option_t *opt=""); AliITSsegmentationSSD(AliITSgeom *gm); AliITSsegmentationSSD(const AliITSsegmentationSSD &source); virtual ~AliITSsegmentationSSD(){}