X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=JETAN%2FAliJetDummyGeo.cxx;h=052cb2240064cd04a7b690273767f61d8d24a0af;hb=4b03f8d5415c5c5e211087d1637c8a0d1f0ace03;hp=960bc2ac485a64f0e2b16cc1de7fb883a8eeafa2;hpb=b5376bed9ddf3eba084282eefeac39af4d17eb10;p=u%2Fmrichter%2FAliRoot.git diff --git a/JETAN/AliJetDummyGeo.cxx b/JETAN/AliJetDummyGeo.cxx index 960bc2ac485..052cb224006 100644 --- a/JETAN/AliJetDummyGeo.cxx +++ b/JETAN/AliJetDummyGeo.cxx @@ -16,11 +16,14 @@ // // Temporarily added to define part of the EMCal geometry // necessary for the jet finder -// Author: Magali Estienne +// +// M. Estienne // Magali.Estienne@cern.ch // +#include #include +#include // --- Root header files --- #include @@ -29,47 +32,60 @@ #include // --- AliRoot header files --- +#include "AliLog.h" #include "AliJetDummyGeo.h" +#include "AliJetDummyShishKebabTrd1Module.h" ClassImp(AliJetDummyGeo) AliJetDummyGeo::AliJetDummyGeo(): - TObject(), - fArm1PhiMin(80.0), - fArm1PhiMax(200.0), - fArm1EtaMin(-0.7), - fArm1EtaMax(+0.7), - fNumberOfSuperModules(12), - fSteelFrontThick(0.0), - fIPDistance(428.0), - fZLength(), - fPhiGapForSM(2.), - fNPhi(12), - fNZ(24), - fPhiModuleSize(12.26 - fPhiGapForSM / Float_t(fNPhi)), - fEtaModuleSize(fPhiModuleSize), - fNPHIdiv(2), - fNETAdiv(2), - fNECLayers(77), - fECScintThick(0.16), - fECPbRadThickness(0.16), - fSampling(12.327), - fTrd1Angle(1.5), - fNCellsInModule(fNPHIdiv*fNETAdiv), - fNCellsInSupMod(fNCellsInModule*fNPhi*fNZ), - fNCells(fNCellsInSupMod*fNumberOfSuperModules-fNCellsInSupMod), - fLongModuleSize(fNECLayers*(fECScintThick + fECPbRadThickness)), - f2Trd1Dx2(fEtaModuleSize + 2.*fLongModuleSize*TMath::Tan(fTrd1Angle*TMath::DegToRad()/2.)), - fShellThickness(TMath::Sqrt(fLongModuleSize*fLongModuleSize + f2Trd1Dx2*f2Trd1Dx2)+fSteelFrontThick), - fEtaMaxOfTRD1(0.67064) // Value extracted from ShishKebab + fArm1EtaMin(-0.7), + fArm1EtaMax(+0.7), + fArm1PhiMin(80.0), + fArm1PhiMax(200.0), + fNumberOfSuperModules(12), + fSteelFrontThick(0.0), + fLateralSteelStrip(0.01), + fIPDistance(428.0), + fPhiGapForSM(2.), + fNPhi(12), + fNZ(24), + fPhiModuleSize(12.26 - fPhiGapForSM / Float_t(fNPhi)), + fEtaModuleSize(fPhiModuleSize), + fNPHIdiv(2), + fNETAdiv(2), + fPhiTileSize(fPhiModuleSize/Double_t(fNPHIdiv) - fLateralSteelStrip), + fEtaTileSize(fEtaModuleSize/Double_t(fNETAdiv) - fLateralSteelStrip), + fNECLayers(77), + fECScintThick(0.16), + fECPbRadThickness(0.16), + fSampling(12.327), + fTrd1Angle(1.5), + fNCellsInModule(fNPHIdiv*fNETAdiv), + fNCellsInSupMod(fNCellsInModule*fNPhi*fNZ), + fNCells(fNCellsInSupMod*fNumberOfSuperModules-fNCellsInSupMod), + fLongModuleSize(fNECLayers*(fECScintThick + fECPbRadThickness)), + f2Trd1Dx2(fEtaModuleSize + 2.*fLongModuleSize*TMath::Tan(fTrd1Angle*TMath::DegToRad()/2.)), + fShellThickness(TMath::Sqrt(fLongModuleSize*fLongModuleSize + f2Trd1Dx2*f2Trd1Dx2)+fSteelFrontThick), + fZLength(2.*ZFromEtaR(fIPDistance+fShellThickness,fArm1EtaMax)), + fEtaMaxOfTRD1(0.), + fPhiBoundariesOfSM(0), + fPhiCentersOfSM(0), + fCentersOfCellsEtaDir(0), + fCentersOfCellsXDir(0), + fCentersOfCellsPhiDir(0), + fEtaCentersOfCells(0), + fPhiCentersOfCells(0), + fShishKebabTrd1Modules(0), + fDebug(0) { // Constructor + // Local coordinates fParSM[0] = GetShellThickness()/2.; fParSM[1] = GetPhiModuleSize() * GetNPhi()/2.; fParSM[2] = 350./2.; - fZLength = 2.*ZFromEtaR(fIPDistance+fShellThickness,fArm1EtaMax); // Z coverage fEnvelop[0] = fIPDistance; // mother volume inner radius fEnvelop[1] = fIPDistance + fShellThickness; // mother volume outer r. fEnvelop[2] = 1.00001*fZLength; // add some padding for mother volume. @@ -80,7 +96,7 @@ AliJetDummyGeo::AliJetDummyGeo(): fPhiBoundariesOfSM[0] = TMath::PiOver2() - TMath::ATan2(fParSM[1] , fIPDistance); // 1th and 2th modules) fPhiBoundariesOfSM[1] = TMath::PiOver2() + TMath::ATan2(fParSM[1] , fIPDistance); fPhiCentersOfSM[0] = TMath::PiOver2(); - for(int i=1; i<=4; i++) { // from 2th ro 9th + for(Int_t i=1; i<=4; i++) { // from 2th ro 9th fPhiBoundariesOfSM[2*i] = fPhiBoundariesOfSM[0] + 20.*TMath::DegToRad()*i; fPhiBoundariesOfSM[2*i+1] = fPhiBoundariesOfSM[1] + 20.*TMath::DegToRad()*i; fPhiCentersOfSM[i] = fPhiCentersOfSM[0] + 20.*TMath::DegToRad()*i; @@ -89,19 +105,11 @@ AliJetDummyGeo::AliJetDummyGeo(): fPhiBoundariesOfSM[10] = fPhiBoundariesOfSM[11] - TMath::ATan2((fParSM[1]) , fIPDistance); fPhiCentersOfSM[5] = (fPhiBoundariesOfSM[10]+fPhiBoundariesOfSM[11])/2.; - // for(int i=0; i=360.) phiy -= 360.; TGeoRotation *geoRot1 = new TGeoRotation("geoRot1", 90.0, phi, 90.0, phiy, 180.0, 0.0); fMatrixOfSM[ind] = new TGeoCombiTrans(Form("EmcalSM%2.2i",ind), xpos,ypos,-zpos, geoRot1); } // for + CreateListOfTrd1Modules(); + + if(fDebug > 0){ + for(Int_t i=0; i<6; i++){ + cout << "fMatrixOfSM[" << i << "]: " << fMatrixOfSM[i] << endl; + } + cout << "fArm1EtaMin: " << fArm1EtaMin << endl; + cout << "fArm1EtaMax: " << fArm1EtaMax << endl; + cout << "fArm1PhiMin: " << fArm1PhiMin << endl; + cout << "fArm1PhiMax: " << fArm1PhiMax << endl; + cout << "fNumberOfSuperModules: " << fNumberOfSuperModules << endl; + cout << "fSteelFrontThick: " << fSteelFrontThick << endl; + cout << "fIPDistance: " << fIPDistance << endl; + cout << "fZLength: " << fZLength << endl; + cout << "fPhiGapForSM: " << fPhiGapForSM << endl; + cout << "fNPhi: " << fNPhi << endl; + cout << "fNZ: " << fNZ << endl; + cout << "fPhiModuleSize: " << fPhiModuleSize << endl; + cout << "fEtaModuleSize: " << fEtaModuleSize << endl; + cout << "fNPHIdiv: " << fNPHIdiv << endl; + cout << "fNETAdiv: " << fNETAdiv << endl; + cout << "fNECLayers: " << fNECLayers << endl; + cout << "fECScintThick: " << fECScintThick << endl; + cout << "fECPbRadThickness: " << fECPbRadThickness << endl; + cout << "fSampling: " << fSampling << endl; + cout << "fTrd1Angle: " << fTrd1Angle << endl; + cout << "fNCellsInModule: " << fNCellsInModule << endl; + cout << "fNCellsInSupMod: " << fNCellsInSupMod << endl; + cout << "fNCells: " << fNCells << endl; + cout << "fLongModuleSize: " << fLongModuleSize << endl; + cout << "f2Trd1Dx2: " << f2Trd1Dx2 << endl; + cout << "fShellThickness: " << fShellThickness << endl; + cout << "fEtaMaxOfTRD1: " << fEtaMaxOfTRD1 << endl; + } } AliJetDummyGeo::AliJetDummyGeo(const AliJetDummyGeo& geom): - TObject(), - fArm1PhiMin(geom.fArm1PhiMin), - fArm1PhiMax(geom.fArm1PhiMax), - fArm1EtaMin(geom.fArm1EtaMin), - fArm1EtaMax(geom.fArm1EtaMax), - fNumberOfSuperModules(geom.fNumberOfSuperModules), - fSteelFrontThick(geom.fSteelFrontThick), - fIPDistance(geom.fIPDistance), - fPhiGapForSM(geom.fPhiGapForSM), - fNPhi(geom.fNPhi), - fNZ(geom.fNZ), - fPhiModuleSize(geom.fPhiModuleSize), - fEtaModuleSize(geom.fEtaModuleSize), - fNPHIdiv(geom.fNPHIdiv), - fNETAdiv(geom.fNETAdiv), - fNECLayers(geom.fNECLayers), - fECScintThick(geom.fECScintThick), - fECPbRadThickness(geom.fECPbRadThickness), - fSampling(geom.fSampling), - fTrd1Angle(geom.fTrd1Angle), - fNCellsInModule(geom.fNCellsInModule), - fNCellsInSupMod(geom.fNCellsInSupMod), - fNCells(geom.fNCells), - fLongModuleSize(geom.fLongModuleSize), - f2Trd1Dx2(geom.f2Trd1Dx2), - fShellThickness(geom.fShellThickness), - fEtaMaxOfTRD1(geom.fEtaMaxOfTRD1) + TObject(geom), + fArm1EtaMin(geom.fArm1EtaMin), + fArm1EtaMax(geom.fArm1EtaMax), + fArm1PhiMin(geom.fArm1PhiMin), + fArm1PhiMax(geom.fArm1PhiMax), + fNumberOfSuperModules(geom.fNumberOfSuperModules), + fSteelFrontThick(geom.fSteelFrontThick), + fLateralSteelStrip(geom.fLateralSteelStrip), + fIPDistance(geom.fIPDistance), + fPhiGapForSM(geom.fPhiGapForSM), + fNPhi(geom.fNPhi), + fNZ(geom.fNZ), + fPhiModuleSize(geom.fPhiModuleSize), + fEtaModuleSize(geom.fEtaModuleSize), + fNPHIdiv(geom.fNPHIdiv), + fNETAdiv(geom.fNETAdiv), + fPhiTileSize(geom.fPhiTileSize), + fEtaTileSize(geom.fEtaTileSize), + fNECLayers(geom.fNECLayers), + fECScintThick(geom.fECScintThick), + fECPbRadThickness(geom.fECPbRadThickness), + fSampling(geom.fSampling), + fTrd1Angle(geom.fTrd1Angle), + fNCellsInModule(geom.fNCellsInModule), + fNCellsInSupMod(geom.fNCellsInSupMod), + fNCells(geom.fNCells), + fLongModuleSize(geom.fLongModuleSize), + f2Trd1Dx2(geom.f2Trd1Dx2), + fShellThickness(geom.fShellThickness), + fZLength(geom.fZLength), + fEtaMaxOfTRD1(geom.fEtaMaxOfTRD1), + fPhiBoundariesOfSM(geom.fPhiBoundariesOfSM), + fPhiCentersOfSM(geom.fPhiCentersOfSM), + fCentersOfCellsEtaDir(geom.fCentersOfCellsEtaDir), + fCentersOfCellsXDir(geom.fCentersOfCellsXDir), + fCentersOfCellsPhiDir(geom.fCentersOfCellsPhiDir), + fEtaCentersOfCells(geom.fEtaCentersOfCells), + fPhiCentersOfCells(geom.fPhiCentersOfCells), + fShishKebabTrd1Modules(geom.fShishKebabTrd1Modules), + fDebug(geom.fDebug) { // Constructor // Local coordinates @@ -162,13 +217,17 @@ AliJetDummyGeo::AliJetDummyGeo(const AliJetDummyGeo& geom): fParSM[1] = GetPhiModuleSize() * GetNPhi()/2.; fParSM[2] = 350./2.; + fEnvelop[0] = fIPDistance; // mother volume inner radius + fEnvelop[1] = fIPDistance + fShellThickness; // mother volume outer r. + fEnvelop[2] = 1.00001*fZLength; // add some padding for mother volume. + // SM phi boundaries - (0,1),(2,3) .. (10,11) - has the same boundaries; Nov 7, 2006 fPhiBoundariesOfSM.Set(fNumberOfSuperModules); fPhiCentersOfSM.Set(fNumberOfSuperModules/2); fPhiBoundariesOfSM[0] = TMath::PiOver2() - TMath::ATan2(fParSM[1] , fIPDistance); // 1th and 2th modules) fPhiBoundariesOfSM[1] = TMath::PiOver2() + TMath::ATan2(fParSM[1] , fIPDistance); fPhiCentersOfSM[0] = TMath::PiOver2(); - for(int i=1; i<=4; i++) { // from 2th ro 9th + for(Int_t i=1; i<=4; i++) { // from 2th ro 9th fPhiBoundariesOfSM[2*i] = fPhiBoundariesOfSM[0] + 20.*TMath::DegToRad()*i; fPhiBoundariesOfSM[2*i+1] = fPhiBoundariesOfSM[1] + 20.*TMath::DegToRad()*i; fPhiCentersOfSM[i] = fPhiCentersOfSM[0] + 20.*TMath::DegToRad()*i; @@ -177,19 +236,11 @@ AliJetDummyGeo::AliJetDummyGeo(const AliJetDummyGeo& geom): fPhiBoundariesOfSM[10] = fPhiBoundariesOfSM[11] - TMath::ATan2((fParSM[1]) , fIPDistance); fPhiCentersOfSM[5] = (fPhiBoundariesOfSM[10]+fPhiBoundariesOfSM[11])/2.; - // for(int i=0; i=360.) phiy -= 360.; TGeoRotation *geoRot1 = new TGeoRotation("geoRot1", 90.0, phi, 90.0, phiy, 180.0, 0.0); fMatrixOfSM[ind] = new TGeoCombiTrans(Form("EmcalSM%2.2i",ind), @@ -217,11 +268,15 @@ AliJetDummyGeo::AliJetDummyGeo(const AliJetDummyGeo& geom): } // for + CreateListOfTrd1Modules(); + } +//------------------------------------------------------------------------------------ AliJetDummyGeo::~AliJetDummyGeo() { // Destructor + // delete [] fMatrixOfSM; } //------------------------------------------------------------------------------------ @@ -237,7 +292,7 @@ void AliJetDummyGeo::EtaPhiFromIndex(Int_t absId, Float_t& eta, Float_t& phi) } //------------------------------------------------------------------------------------ -void AliJetDummyGeo::GetGlobal(const Double_t *loc, Double_t *glob, int ind) const +void AliJetDummyGeo::GetGlobal(const Double_t *loc, Double_t *glob, Int_t ind) const { // Figure out the global numbering of a given supermodule from the // local numbering @@ -250,11 +305,11 @@ void AliJetDummyGeo::GetGlobal(const Double_t *loc, Double_t *glob, int ind) con } //------------------------------------------------------------------------------------ -void AliJetDummyGeo::GetGlobal(Int_t absId , double glob[3]) const +void AliJetDummyGeo::GetGlobal(Int_t absId , Double_t glob[3]) const { // Alice numbering scheme - Jun 03, 2006 static Int_t nSupMod, nModule, nIphi, nIeta; - static double loc[3]; + static Double_t loc[3]; glob[0]=glob[1]=glob[2]=0.0; // bad case if(RelPosCellInSModule(absId, loc)) { @@ -298,7 +353,7 @@ Bool_t AliJetDummyGeo::RelPosCellInSModule(Int_t absId, Double_t &xr, Double_t & // Shift index taking into account the difference between standard SM // and SM of half size in phi direction - const Int_t kPhiIndexShift = fCentersOfCellsPhiDir.GetSize()/4; // Nov 22, 2006; was 6 for cas 2X2 + const Int_t phiIndexShift = fCentersOfCellsPhiDir.GetSize()/4; // Nov 22, 2006; was 6 for cas 2X2 static Int_t nSupMod, nModule, nIphi, nIeta, iphi, ieta; if(!CheckAbsCellId(absId)) return kFALSE; @@ -311,7 +366,7 @@ Bool_t AliJetDummyGeo::RelPosCellInSModule(Int_t absId, Double_t &xr, Double_t & if(nSupMod<10) { yr = fCentersOfCellsPhiDir.At(iphi); } else { - yr = fCentersOfCellsPhiDir.At(iphi + kPhiIndexShift); + yr = fCentersOfCellsPhiDir.At(iphi + phiIndexShift); } return kTRUE; @@ -360,7 +415,7 @@ Bool_t AliJetDummyGeo::GetCellIndex(Int_t absId,Int_t &nSupMod,Int_t &nModule,In } //------------------------------------------------------------------------------------ -void AliJetDummyGeo::GetCellPhiEtaIndexInSModule(Int_t nSupMod, Int_t nModule, Int_t nIphi, Int_t nIeta, int &iphi, int &ieta) const +void AliJetDummyGeo::GetCellPhiEtaIndexInSModule(Int_t nSupMod, Int_t nModule, Int_t nIphi, Int_t nIeta, Int_t &iphi, Int_t &ieta) const { // // Added nSupMod; Nov 25, 05 @@ -387,7 +442,7 @@ void AliJetDummyGeo::GetCellPhiEtaIndexInSModule(Int_t nSupMod, Int_t nModule, I //------------------------------------------------------------------------------------ -void AliJetDummyGeo::GetModulePhiEtaIndexInSModule(Int_t nSupMod, Int_t nModule, int &iphim, int &ietam) const +void AliJetDummyGeo::GetModulePhiEtaIndexInSModule(Int_t nSupMod, Int_t nModule, Int_t &iphim, Int_t &ietam) const { // added nSupMod; - 19-oct-05 ! // Alice numbering scheme - Jun 01,2006 @@ -544,6 +599,140 @@ Bool_t AliJetDummyGeo::GetPhiBoundariesOfSMGap(Int_t nPhiSec, Double_t &phiMin, return kTRUE; } +//------------------------------------------------------------------------------------ +void AliJetDummyGeo::CreateListOfTrd1Modules() +{ + // Generate the list of Trd1 modules + // which will make up the EMCAL + // geometry + printf("CreateListOfTrd1Modules() \n"); + + AliJetDummyShishKebabTrd1Module *mod=0, *mTmp=0; // current module + if(fShishKebabTrd1Modules == 0) { + fShishKebabTrd1Modules = new TList; + fShishKebabTrd1Modules->SetName("ListOfTRD1"); + for(Int_t iz=0; iz< GetNZ(); iz++) { + if(iz==0) { + mod = new AliJetDummyShishKebabTrd1Module(TMath::Pi()/2.,this); + } else { + mTmp = new AliJetDummyShishKebabTrd1Module(*mod); + mod = mTmp; + } + fShishKebabTrd1Modules->Add(mod); + } + } else { + printf(" Already exits : "); + } + mod = (AliJetDummyShishKebabTrd1Module*)fShishKebabTrd1Modules->At(fShishKebabTrd1Modules->GetSize()-1); + fEtaMaxOfTRD1 = mod->GetMaxEtaOfModule(0); + + // printf(" fShishKebabTrd1Modules has %i modules : max eta %5.4f \n", + // fShishKebabTrd1Modules->GetSize(),fEtaMaxOfTRD1); + + // Feb 20,2006; + // Jun 01, 2006 - ALICE numbering scheme + // define grid for cells in eta(z) and x directions in local coordinates system of SM + // Works just for 2x2 case only -- ?? start here + // + // + // Define grid for cells in phi(y) direction in local coordinates system of SM + // as for 2X2 as for 3X3 - Nov 8,2006 + // + + // printf(" Cells grid in phi directions : size %i\n", fCentersOfCellsPhiDir.GetSize()); + + Int_t ind=0; // this is phi index + Int_t ieta=0, nModule=0, iphiTemp; + Double_t xr, zr, theta, phi, eta, r, x,y; + xr = 0.; + zr = 0.; + + TVector3 vglob; + Double_t ytCenterModule=0.0, ytCenterCell=0.0; + + fCentersOfCellsPhiDir.Set(fNPhi*fNPHIdiv); + fPhiCentersOfCells.Set(fNPhi*fNPHIdiv); + + Double_t R0 = GetIPDistance() + GetLongModuleSize()/2.; + for(Int_t it=0; it1) AliInfo(Form(" Cells grid in eta directions : size %i\n", fCentersOfCellsEtaDir.GetSize())); + for(Int_t it=0; itGetCenterOfCellInLocalCoordinateofSM(ic, xr, zr); // case of 2X2 + GetCellPhiEtaIndexInSModule(0, nModule, 0, ic, iphiTemp, ieta); + } if(fNPHIdiv==3) { + trd1->GetCenterOfCellInLocalCoordinateofSM3X3(ic, xr, zr); // case of 3X3 + GetCellPhiEtaIndexInSModule(0, nModule, 0, ic, iphiTemp, ieta); + } if(fNPHIdiv==1) { + trd1->GetCenterOfCellInLocalCoordinateofSM1X1(xr, zr); // case of 1X1 + GetCellPhiEtaIndexInSModule(0, nModule, 0, ic, iphiTemp, ieta); + } + fCentersOfCellsXDir.AddAt(Float_t(xr) - fParSM[0],ieta); + fCentersOfCellsEtaDir.AddAt(Float_t(zr) - fParSM[2],ieta); + // Define grid on eta direction for each bin in phi + for(Int_t iphi=0; iphiGetRadius(); + y = fCentersOfCellsPhiDir[iphi]; + r = TMath::Sqrt(x*x + y*y + zr*zr); + theta = TMath::ACos(zr/r); + eta = AliJetDummyShishKebabTrd1Module::ThetaToEta(theta); + // ind = ieta*fCentersOfCellsPhiDir.GetSize() + iphi; + ind = iphi*fCentersOfCellsEtaDir.GetSize() + ieta; + fEtaCentersOfCells.AddAt(eta, ind); + } + //printf(" ieta %i : xr + trd1->GetRadius() %f : zr %f : eta %f \n", ieta, xr + trd1->GetRadius(), zr, eta); + } + } + + if(fDebug>1){ + for(Int_t i=0; i=0 && netaGetSize()) { + trd1 = (AliJetDummyShishKebabTrd1Module*)fShishKebabTrd1Modules->At(neta); + } else trd1 = 0; + return trd1; +} + //------------------------------------------------------------------------------------ void AliJetDummyGeo::GetTransformationForSM() { @@ -555,7 +744,7 @@ void AliJetDummyGeo::GetTransformationForSM() static Bool_t transInit=kFALSE; if(transInit) return; - int i=0; + Int_t i=0; if(gGeoManager == 0) { Info("CreateTransformationForSM() "," Load geometry : TGeoManager::Import()"); assert(0); @@ -577,12 +766,12 @@ void AliJetDummyGeo::GetTransformationForSM() GetNameOfEMCALEnvelope()); assert(0); } - printf(" i %i : EMCAL Envelope is %s : #SM %i \n", i, xen1->GetName(), xen1->GetNdaughters()); + AliInfo(Form(" i %i : EMCAL Envelope is %s : #SM %i \n", i, xen1->GetName(), xen1->GetNdaughters())); for(i=0; iGetNdaughters(); i++) { TGeoNodeMatrix *sm = (TGeoNodeMatrix*)xen1->GetDaughter(i); fMatrixOfSM[i] = sm->GetMatrix(); } - printf("transInit %d: ", transInit); + AliInfo(Form("transInit %d: ", transInit)); transInit = kTRUE; }