From b7ef3c96908ee0eb49aa416c930f6c6c711fe7a0 Mon Sep 17 00:00:00 2001 From: ivana Date: Tue, 22 Nov 2005 14:03:15 +0000 Subject: [PATCH] Updated with refactoring of geometry & segmentation classes; --- MUON/AliMUONChamberTrigger.cxx | 21 ++-- MUON/AliMUONChamberTrigger.h | 10 +- MUON/AliMUONClusterInput.cxx | 22 ++-- MUON/AliMUONCommonGeometryBuilder.cxx | 2 +- MUON/AliMUONDigitizer.cxx | 20 ++-- MUON/AliMUONDisplay.cxx | 140 +++++++++++------------ MUON/AliMUONSlatGeometryBuilder.cxx | 105 ++++++++--------- MUON/AliMUONSt12QuadrantSegmentation.cxx | 27 +++-- MUON/AliMUONSt12QuadrantSegmentation.h | 2 +- MUON/AliMUONSt1GeometryBuilder.cxx | 111 ++++++++---------- MUON/AliMUONSt1GeometryBuilderV2.cxx | 18 +-- MUON/AliMUONSt1Response.cxx | 26 +++-- MUON/AliMUONSt1Response.h | 6 +- MUON/AliMUONSt2GeometryBuilder.cxx | 34 +++--- MUON/AliMUONSt2GeometryBuilderV2.cxx | 18 +-- MUON/AliMUONSt345SlatSegmentation.h | 1 + MUON/AliMUONSt345SlatSegmentationV2.cxx | 11 ++ MUON/AliMUONSt345SlatSegmentationV2.h | 2 + MUON/AliMUONTriggerCircuit.cxx | 16 ++- MUON/AliMUONTriggerGeometryBuilder.cxx | 56 +++------ MUON/AliMUONTriggerSegmentation.h | 1 + MUON/AliMUONTriggerSegmentationV2.cxx | 10 ++ MUON/AliMUONTriggerSegmentationV2.h | 1 + MUON/AliMUONv1.cxx | 105 ++++++++--------- MUON/AliMUONv1.h | 2 - 25 files changed, 373 insertions(+), 394 deletions(-) diff --git a/MUON/AliMUONChamberTrigger.cxx b/MUON/AliMUONChamberTrigger.cxx index 79b0bc40666..9fda4f758f1 100644 --- a/MUON/AliMUONChamberTrigger.cxx +++ b/MUON/AliMUONChamberTrigger.cxx @@ -18,8 +18,10 @@ #include "AliMUONChamberTrigger.h" #include "AliMUONResponseTrigger.h" #include "AliMUONHit.h" +#include "AliMUON.h" +#include "AliMUONSegmentation.h" #include "AliMUONGeometrySegmentation.h" -#include "AliMUONGeometryModule.h" +#include "AliMUONGeometryTransformer.h" #include "AliLog.h" ClassImp(AliMUONChamberTrigger) @@ -27,14 +29,17 @@ ClassImp(AliMUONChamberTrigger) //------------------------------------------- AliMUONChamberTrigger::AliMUONChamberTrigger() - : AliMUONChamber() + : AliMUONChamber(), + fkGeomTransformer(0) { // Default constructor } -AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id) - : AliMUONChamber(id) +AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id, + const AliMUONGeometryTransformer* kGeometryTransformer) + : AliMUONChamber(id), + fkGeomTransformer(kGeometryTransformer) { // Constructor using chamber id } @@ -65,8 +70,10 @@ void AliMUONChamberTrigger::DisIntegration(AliMUONHit* hit, Float_t qp; nnew=0; for (Int_t i = 1; i <= 2; i++) { - AliMUONGeometrySegmentation * segmentation= - (AliMUONGeometrySegmentation*) (*fSegmentation2)[i-1]; + + AliMUONGeometrySegmentation* segmentation= + fMUON->GetSegmentation()->GetModuleSegmentation(fId, i-1); + // Find the module & strip Id. which has fired Int_t ix(-1); @@ -77,7 +84,7 @@ void AliMUONChamberTrigger::DisIntegration(AliMUONHit* hit, if ( ix<0 || iy<0 ) { Float_t lx,ly,lz; - GetGeometry()->Global2Local(id,xhit,yhit,0,lx,ly,lz); + fkGeomTransformer->Global2Local(id,xhit,yhit,0,lx,ly,lz); AliWarning(Form("AliMUONChamberTrigger hit w/o strip %i-%d %e %e " "local %e %e %e ix,iy=%d,%d\n",id,i-1,xhit,yhit,lx,ly,lz,ix,iy)); } else diff --git a/MUON/AliMUONChamberTrigger.h b/MUON/AliMUONChamberTrigger.h index ac410c73ee1..6c4e30d7a43 100644 --- a/MUON/AliMUONChamberTrigger.h +++ b/MUON/AliMUONChamberTrigger.h @@ -11,6 +11,8 @@ /// \class AliMUONChamberTrigger /// \brief Muon trigger chamber class +#include + #include "AliMUONChamber.h" @@ -18,19 +20,23 @@ class AliMUONClusterFinder; class AliMUONSegmentationTrigger; class AliMUONResponseTrigger; class AliMUONResponseTriggerV1; +class AliMUONGeometryTransformer; class AliMUONHit; class AliMUONChamberTrigger : public AliMUONChamber { public: AliMUONChamberTrigger(); - AliMUONChamberTrigger(Int_t id); + AliMUONChamberTrigger(Int_t id, const AliMUONGeometryTransformer* kGeometry); virtual ~AliMUONChamberTrigger(){} // Cluster formation method (charge disintegration) virtual void DisIntegration(AliMUONHit* hit, - Int_t& nnew, Float_t newclust[6][500]); + Int_t& nnew, Float_t newclust[6][500]); + + protected: + const AliMUONGeometryTransformer* fkGeomTransformer;// geometry transformations ClassDef(AliMUONChamberTrigger,1) // Muon trigger chamber class }; diff --git a/MUON/AliMUONClusterInput.cxx b/MUON/AliMUONClusterInput.cxx index 9b29c342a03..7ce5ac175da 100644 --- a/MUON/AliMUONClusterInput.cxx +++ b/MUON/AliMUONClusterInput.cxx @@ -20,7 +20,7 @@ #include "AliRun.h" #include "AliMUON.h" -#include "AliMUONChamber.h" +#include "AliMUONSegmentation.h" #include "AliMUONConstants.h" #include "AliMUONClusterInput.h" #include "AliMUONMathieson.h" @@ -82,16 +82,15 @@ void AliMUONClusterInput::SetDigits(Int_t chamber, Int_t idDE, TClonesArray* dig fNDigits[0] = dig1->GetEntriesFast(); fNDigits[1] = dig2->GetEntriesFast(); + fgMathieson = new AliMUONMathieson(); + AliMUON *pMUON; - AliMUONChamber* iChamber; + AliMUONSegmentation* pSegmentation; pMUON = (AliMUON*) gAlice->GetModule("MUON"); - iChamber = &(pMUON->Chamber(chamber)); - - fgMathieson = new AliMUONMathieson(); - - fSegmentation2[0]=iChamber->SegmentationModel2(1); - fSegmentation2[1]=iChamber->SegmentationModel2(2); + pSegmentation = pMUON->GetSegmentation(); + fSegmentation2[0]= pSegmentation->GetModuleSegmentation(chamber, 0); + fSegmentation2[1]= pSegmentation->GetModuleSegmentation(chamber, 1); fNseg = 2; if (chamber < AliMUONConstants::NTrackingCh()) { @@ -118,12 +117,11 @@ void AliMUONClusterInput::SetDigits(Int_t chamber, Int_t idDE, TClonesArray* dig fDigits[0] = dig; AliMUON *pMUON; - AliMUONChamber* iChamber; + AliMUONSegmentation* pSegmentation; pMUON = (AliMUON*) gAlice->GetModule("MUON"); - iChamber = &(pMUON->Chamber(chamber)); - - fSegmentation2[0]=iChamber->SegmentationModel2(1); + pSegmentation = pMUON->GetSegmentation(); + fSegmentation2[0]= pSegmentation->GetModuleSegmentation(chamber, 0); fNseg=1; } diff --git a/MUON/AliMUONCommonGeometryBuilder.cxx b/MUON/AliMUONCommonGeometryBuilder.cxx index 76ceb152882..9b05ba18c8d 100644 --- a/MUON/AliMUONCommonGeometryBuilder.cxx +++ b/MUON/AliMUONCommonGeometryBuilder.cxx @@ -34,7 +34,7 @@ ClassImp(AliMUONCommonGeometryBuilder) //______________________________________________________________________________//___________________________________________ AliMUONCommonGeometryBuilder::AliMUONCommonGeometryBuilder(AliMUON* muon) - : AliMUONVGeometryBuilder("", 0), + : AliMUONVGeometryBuilder(-1), fMUON(muon) { /// Standars constructor diff --git a/MUON/AliMUONDigitizer.cxx b/MUON/AliMUONDigitizer.cxx index 95d24d58f94..9ff58252882 100644 --- a/MUON/AliMUONDigitizer.cxx +++ b/MUON/AliMUONDigitizer.cxx @@ -23,7 +23,7 @@ #include "AliMUONDigitizer.h" #include "AliMUONConstants.h" -#include "AliMUONChamber.h" +#include "AliMUONSegmentation.h" #include "AliMUONHitMapA1.h" #include "AliMUON.h" #include "AliMUONLoader.h" @@ -31,6 +31,7 @@ #include "AliMUONTransientDigit.h" #include "AliMUONTriggerDecision.h" #include "AliLog.h" +#include "AliMUONGeometryTransformer.h" #include "AliMUONGeometryModule.h" #include "AliMUONGeometryStore.h" @@ -493,13 +494,18 @@ void AliMUONDigitizer::InitArrays() AliDebug(4,Form( "Creating hit map for chamber %d, cathode 1.", i+1)); - AliMUONChamber* chamber = &(fMUON->Chamber(i)); - AliMUONGeometrySegmentation* c1Segmentation = chamber->SegmentationModel2(1); // Cathode plane 1 + AliMUONSegmentation* segmentation = fMUON->GetSegmentation(); + AliMUONGeometrySegmentation* c1Segmentation + = segmentation->GetModuleSegmentation(i, 0); // Cathode plane 1 AliDebug(4,Form( "Creating hit map for chamber %d, cathode 2.", i+1)); - AliMUONGeometrySegmentation* c2Segmentation = chamber->SegmentationModel2(2); // Cathode plane 2 - - AliMUONGeometryModule* geometry = fMUON->Chamber(i).GetGeometry(); - AliMUONGeometryStore* detElements = geometry->GetDetElementStore(); + AliMUONGeometrySegmentation* c2Segmentation + = segmentation->GetModuleSegmentation(i, 1); // Cathode plane 2 + + const AliMUONGeometryTransformer* kGeometryTransformer + = fMUON->GetGeometryTransformer(); + + AliMUONGeometryStore* detElements + = kGeometryTransformer->GetModuleTransformer(i)->GetDetElementStore(); // Loop over detection elements diff --git a/MUON/AliMUONDisplay.cxx b/MUON/AliMUONDisplay.cxx index e16b5f31fd3..974b2ba4844 100644 --- a/MUON/AliMUONDisplay.cxx +++ b/MUON/AliMUONDisplay.cxx @@ -55,7 +55,7 @@ #include "AliMUONTrack.h" #include "AliMUONTrackParam.h" -#include "AliMUONSegmentationManager.h" +#include "AliMUONGeometryTransformer.h" #include "AliMUONGeometryModule.h" #include "AliMpSlatSegmentation.h" #include "AliMpSlat.h" @@ -65,8 +65,8 @@ #include "AliMpTriggerSegmentation.h" #include "AliMpTrigger.h" +#include "AliMUONSegmentation.h" #include "AliMUONGeometrySegmentation.h" -#include "AliMUONChamber.h" #include "AliMUONConstants.h" #include "AliMC.h" #include "AliLog.h" @@ -789,8 +789,11 @@ void AliMUONDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi) // Recovering the chamber AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); - AliMUONChamber* iChamber; - iChamber = &(pMUON->Chamber(fChamber-1)); + + const AliMUONGeometryTransformer* kGeomTransformer + = pMUON->GetGeometryTransformer(); + + AliMUONSegmentation* segmentation = pMUON->GetSegmentation(); // Display MUON Chamber Geometry char nodeName[7]; @@ -801,10 +804,9 @@ void AliMUONDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi) for(Int_t id = 0; id < 4; id++) { Int_t detElemId = fChamber*100+id; - // if ( AliMUONSegmentationManager::IsValidDetElemId(detElemId) ) { - AliMpSectorSegmentation* seg = - (AliMpSectorSegmentation *) AliMUONSegmentationManager::Segmentation(detElemId, kBendingPlane); - const AliMpSector* sector = seg->GetSector(); + AliMpSectorSegmentation * seg = + (AliMpSectorSegmentation *) segmentation->GetMpSegmentation(detElemId, 0); + const AliMpSector * sector = seg->GetSector(); // get sector measurements TVector2 position = sector->Position(); @@ -815,8 +817,8 @@ void AliMUONDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi) Float_t xlocal2 = dimension.Px() * 2.; Float_t ylocal2 = dimension.Px() * 2.; - iChamber->GetGeometry()->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1); - iChamber->GetGeometry()->Local2Global(detElemId, xlocal2, ylocal2, 0, xg2, yg2, zg2); + kGeomTransformer->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1); + kGeomTransformer->Local2Global(detElemId, xlocal2, ylocal2, 0, xg2, yg2, zg2); // drawing TPolyLine3D* poly = new TPolyLine3D(); @@ -842,47 +844,49 @@ void AliMUONDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi) Int_t id=0; for(id=0; id<26; id++) { Int_t detElemId = fChamber*100+id; - if ( AliMUONSegmentationManager::IsValidDetElemId(detElemId) ) { + if ( segmentation->HasDE(detElemId) ) { AliMpSlatSegmentation * seg = - (AliMpSlatSegmentation *) AliMUONSegmentationManager::Segmentation(detElemId, kBendingPlane); - const AliMpSlat* slat = seg->Slat(); - Float_t deltax = slat->DX(); - Float_t deltay = slat->DY(); - Float_t xlocal1 = -deltax; - Float_t ylocal1 = -deltay; - Float_t xlocal2 = +deltax; - Float_t ylocal2 = +deltay; - iChamber->GetGeometry()->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1); - iChamber->GetGeometry()->Local2Global(detElemId, xlocal2, ylocal2, 0, xg2, yg2, zg2); - - // drawing slat active volumes - Float_t xCenter = (xg1 + xg2)/2.; - Float_t yCenter = (yg1 + yg2)/2.; - - TMarker3DBox* box = new TMarker3DBox(xCenter,yCenter,0,xlocal1,ylocal2,0,0,0); - - box->SetFillStyle(0); - box->SetLineColor(2); - box->Draw("s"); + (AliMpSlatSegmentation *) segmentation->GetMpSegmentation(detElemId, 0); + if (seg) { + const AliMpSlat* slat = seg->Slat(); + Float_t deltax = slat->DX(); + Float_t deltay = slat->DY(); + Float_t xlocal1 = -deltax; + Float_t ylocal1 = -deltay; + Float_t xlocal2 = +deltax; + Float_t ylocal2 = +deltay; + kGeomTransformer->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1); + kGeomTransformer->Local2Global(detElemId, xlocal2, ylocal2, 0, xg2, yg2, zg2); + + // drawing slat active volumes + Float_t xCenter = (xg1 + xg2)/2.; + Float_t yCenter = (yg1 + yg2)/2.; + + TMarker3DBox* box = new TMarker3DBox(xCenter,yCenter,0,xlocal1,ylocal2,0,0,0); + + box->SetFillStyle(0); + box->SetLineColor(2); + box->Draw("s"); + + // drawing inner circle + disc + TPolyLine3D* poly = new TPolyLine3D(); + TPolyLine3D* poly1 = new TPolyLine3D(); + + Int_t nPoint = 0; + Int_t nPoint1 = 0; + for (Float_t d = 0; d < 6.24; d+= 0.005) { + Double_t x = AliMUONConstants::Dmin((fChamber-1)/2) * TMath::Cos(d)/2.; + Double_t y = AliMUONConstants::Dmin((fChamber-1)/2) * TMath::Sin(d)/2.; + if (nPoint % 2 == 0) poly->SetPoint(nPoint++, 0., 0., 0.); + poly->SetPoint(nPoint++, x, y, 0.); + poly1->SetPoint(nPoint1++, x, y, 0.); - // drawing inner circle + disc - TPolyLine3D* poly = new TPolyLine3D(); - TPolyLine3D* poly1 = new TPolyLine3D(); - - Int_t nPoint = 0; - Int_t nPoint1 = 0; - for (Float_t d = 0; d < 6.24; d+= 0.005) { - Double_t x = AliMUONConstants::Dmin((fChamber-1)/2) * TMath::Cos(d)/2.; - Double_t y = AliMUONConstants::Dmin((fChamber-1)/2) * TMath::Sin(d)/2.; - if (nPoint % 2 == 0) poly->SetPoint(nPoint++, 0., 0., 0.); - poly->SetPoint(nPoint++, x, y, 0.); - poly1->SetPoint(nPoint1++, x, y, 0.); - - } - poly->SetLineColor(1); - poly->Draw("s"); - poly1->SetLineColor(2); - poly1->Draw("s"); + } + poly->SetLineColor(1); + poly->Draw("s"); + poly1->SetLineColor(2); + poly1->Draw("s"); + } } } } @@ -892,11 +896,9 @@ void AliMUONDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi) Int_t id=0; for(id=0; id<18; id++) { Int_t detElemId = fChamber*100+id; - if ( AliMUONSegmentationManager::IsValidDetElemId(detElemId) ) { -// AliMpSlatSegmentation * seg = -// (AliMpSlatSegmentation *) AliMUONSegmentationManager::Segmentation(detElemId, kBendingPlane); - AliMpTriggerSegmentation * seg = - (AliMpTriggerSegmentation *) AliMUONSegmentationManager::Segmentation(detElemId, kBendingPlane); + AliMpTriggerSegmentation * seg + = (AliMpTriggerSegmentation *) segmentation->GetMpSegmentation(detElemId, 0); + if (seg) { const AliMpTrigger* slat = seg->Slat(); Float_t deltax = slat->DX(); Float_t deltay = slat->DY(); @@ -904,8 +906,9 @@ void AliMUONDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi) Float_t ylocal1 = -deltay; Float_t xlocal2 = +deltax; Float_t ylocal2 = +deltay; - iChamber->GetGeometry()->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1); - iChamber->GetGeometry()->Local2Global(detElemId, xlocal2, ylocal2, 0, xg2, yg2, zg2); + + kGeomTransformer->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1); + kGeomTransformer->Local2Global(detElemId, xlocal2, ylocal2, 0, xg2, yg2, zg2); // drawing slat active volumes Float_t xCenter = (xg1 + xg2)/2.; @@ -916,8 +919,7 @@ void AliMUONDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi) box->SetFillStyle(0); box->SetLineColor(4); box->Draw("s"); - - } + } } } //add clusters to the pad @@ -1061,7 +1063,6 @@ void AliMUONDisplay::LoadDigits(Int_t chamber, Int_t cathode) ResetPoints(); AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); - AliMUONChamber* iChamber; AliMUONGeometrySegmentation* segmentation2 = 0x0; GetMUONData()->SetTreeAddress("D"); @@ -1082,11 +1083,11 @@ void AliMUONDisplay::LoadDigits(Int_t chamber, Int_t cathode) if (ndigits == 0) return; if (fPoints == 0) fPoints = new TObjArray(ndigits); - iChamber = &(pMUON->Chamber(chamber-1)); + //segmentation2 = iChamber->SegmentationModel2(cathode); + segmentation2 + = pMUON->GetSegmentation()->GetModuleSegmentation(chamber-1, cathode-1); - segmentation2 = iChamber->SegmentationModel2(cathode); - - Float_t zpos = iChamber->Z(); + Float_t zpos = AliMUONConstants::DefaultChamberZ(chamber-1); AliMUONDigit *mdig; AliMUONPoints *points = 0; @@ -1177,9 +1178,6 @@ void AliMUONDisplay::LoadCoG(Int_t chamber, Int_t /*cathode*/) ResetRpoints(); - AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); - AliMUONChamber* iChamber; - GetMUONData()->SetTreeAddress("RC"); TClonesArray *muonRawClusters = GetMUONData()->RawClusters(chamber-1); @@ -1195,8 +1193,7 @@ void AliMUONDisplay::LoadCoG(Int_t chamber, Int_t /*cathode*/) if (nrawcl == 0) return; if (fRpoints == 0) fRpoints = new TObjArray(nrawcl); - iChamber = &(pMUON->Chamber(chamber-1)); - Float_t zpos=iChamber->Z(); + Float_t zpos = AliMUONConstants::DefaultChamberZ(chamber-1); AliMUONRawCluster *mRaw; AliMUONPoints *points = 0; // @@ -1321,12 +1318,7 @@ void AliMUONDisplay::LoadHits(Int_t chamber) ResetPhits(); - AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); - AliMUONChamber* iChamber; - - iChamber = &(pMUON->Chamber(chamber-1)); - Float_t zpos=iChamber->Z(); - + Float_t zpos=AliMUONConstants::DefaultChamberZ(chamber-1); if (GetMUONData()->TreeH()) { GetMUONData()->SetTreeAddress("H"); diff --git a/MUON/AliMUONSlatGeometryBuilder.cxx b/MUON/AliMUONSlatGeometryBuilder.cxx index 408e94bcff9..1978d46850c 100644 --- a/MUON/AliMUONSlatGeometryBuilder.cxx +++ b/MUON/AliMUONSlatGeometryBuilder.cxx @@ -41,7 +41,7 @@ #include "AliMUONSlatGeometryBuilder.h" #include "AliMUON.h" -#include "AliMUONChamber.h" +#include "AliMUONConstants.h" #include "AliMUONGeometryModule.h" #include "AliMUONGeometryEnvelopeStore.h" #include "AliMUONConstants.h" @@ -51,13 +51,7 @@ ClassImp(AliMUONSlatGeometryBuilder) //______________________________________________________________________________ AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(AliMUON* muon) - : AliMUONVGeometryBuilder("slat.dat", - muon->Chamber(4).GetGeometry(), - muon->Chamber(5).GetGeometry(), - muon->Chamber(6).GetGeometry(), - muon->Chamber(7).GetGeometry(), - muon->Chamber(8).GetGeometry(), - muon->Chamber(9).GetGeometry()), + : AliMUONVGeometryBuilder(4, 5, 6, 7, 8, 9), fMUON(muon) { // Standard constructor @@ -248,13 +242,13 @@ void AliMUONSlatGeometryBuilder::CreateGeometry() iChamber1 = iChamber; iChamber2 = &fMUON->Chamber(5); - //iChamber1->GetGeometry()->SetDebug(kTRUE); - //iChamber2->GetGeometry()->SetDebug(kTRUE); + //GetGeometry(4)->SetDebug(kTRUE); + //GetGeometry(5)->SetDebug(kTRUE); if (gAlice->GetModule("DIPO")) { // if DIPO is preset, the whole station will be placed in DDIP volume - iChamber1->GetGeometry()->SetMotherVolume("DDIP"); - iChamber2->GetGeometry()->SetMotherVolume("DDIP"); + GetGeometry(4)->SetMotherVolume("DDIP"); + GetGeometry(5)->SetMotherVolume("DDIP"); } if (!gAlice->GetModule("DIPO")) { @@ -264,14 +258,15 @@ void AliMUONSlatGeometryBuilder::CreateGeometry() Float_t dframepIn = kRframeHeight; Float_t dframepOut= kVframeLength + 37.0; // Additional 37 cm gap is needed to wrap the corners of the slats Float_t tpar[3]; - Double_t dstation = ( (-iChamber2->Z()) - (-iChamber1->Z()) ) /2.1; - tpar[0] = iChamber1->RInner()-dframepIn; - tpar[1] = (iChamber1->ROuter()+dframepOut); + Double_t dstation = ( (-AliMUONConstants::DefaultChamberZ(5)) - + (-AliMUONConstants::DefaultChamberZ(4)) ) /2.1; + tpar[0] = AliMUONConstants::Rmin(2)-dframepIn; + tpar[1] = AliMUONConstants::Rmax(2)+dframepOut; tpar[2] = dstation; gMC->Gsvolu("CH05", "TUBE", idAir, tpar, 3); gMC->Gsvolu("CH06", "TUBE", idAir, tpar, 3); - iChamber1->GetGeometry()->SetVolume("CH05"); - iChamber2->GetGeometry()->SetVolume("CH06"); + GetGeometry(4)->SetVolume("CH05"); + GetGeometry(5)->SetVolume("CH06"); } // volumes for slat geometry (xx=5,..,10 chamber id): // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes @@ -568,7 +563,7 @@ void AliMUONSlatGeometryBuilder::CreateGeometry() Double_t divpar[3]; Double_t dydiv = kSensHeight/ndiv; Double_t ydiv = (kSensHeight - dydiv)/2.; - Double_t rmin = iChamber1->RInner();// Same radius for both chamber in St3 + Double_t rmin = AliMUONConstants::Rmin(2);// Same radius for both chamber in St3 Double_t xdiv = 0.; Float_t xvol; Float_t yvol; @@ -601,7 +596,7 @@ void AliMUONSlatGeometryBuilder::CreateGeometry() // 9 box volumes are used to define the PCB closed to the beam pipe of the slat 122000SR1 of chamber 5 and 6 of St3 // Accordingly to plan PQ-LAT-SR1 of CEA-DSM-DAPNIA-SIS/BE ph HARDY 8-Oct-2002 // Rmin = 31.5 cm - rmin = iChamber1->RInner(); // Same radius for both chamber in St3 + rmin = AliMUONConstants::Rmin(2); // Same radius for both chamber in St3 ndiv = 9; dydiv = kSensHeight/ndiv; // Vertical size of the box volume approximating the rounded PCB ydiv = -kSensHeight/2 + dydiv/2.; // Initializing vertical position of the volume from bottom @@ -663,14 +658,15 @@ void AliMUONSlatGeometryBuilder::CreateGeometry() Float_t dframepIn = kRframeHeight; Float_t dframepOut= kVframeLength + 40.0; // Additional 30 cm gap is needed to wrap the corners of the slats Float_t tpar[3]; - Double_t dstation = ( (-iChamber2->Z()) - (-iChamber1->Z()) ) /2.1; - tpar[0] = iChamber1->RInner()-dframepIn; - tpar[1] = (iChamber1->ROuter()+dframepOut); + Double_t dstation = ( (-AliMUONConstants::DefaultChamberZ(7)) - + (-AliMUONConstants::DefaultChamberZ(6)) ) /2.1; + tpar[0] = AliMUONConstants::Rmin(3)-dframepIn; + tpar[1] = AliMUONConstants::Rmax(3)+dframepOut; tpar[2] = dstation; gMC->Gsvolu("CH07", "TUBE", idAir, tpar, 3); gMC->Gsvolu("CH08", "TUBE", idAir, tpar, 3); - iChamber1->GetGeometry()->SetVolume("CH07"); - iChamber2->GetGeometry()->SetVolume("CH08"); + GetGeometry(6)->SetVolume("CH07"); + GetGeometry(7)->SetVolume("CH08"); // create and position the slat (mother) volumes @@ -880,7 +876,7 @@ void AliMUONSlatGeometryBuilder::CreateGeometry() Double_t divpar[3]; Double_t dydiv = kSensHeight/ndiv; Double_t ydiv = (kSensHeight - dydiv)/2.; - Float_t rmin = iChamber1->RInner(); // Same radius for both chamber of St4 + Float_t rmin = AliMUONConstants::Rmin(3); // Same radius for both chamber of St4 Float_t xdiv = 0.; Float_t xvol; Float_t yvol; @@ -937,14 +933,15 @@ void AliMUONSlatGeometryBuilder::CreateGeometry() Float_t dframepIn = kRframeHeight; Float_t dframepOut= kVframeLength + 40.0; // Additional 40 cm gap is needed to wrap the corners of the slats Float_t tpar[3]; - Double_t dstation = ( (-iChamber2->Z()) - (-iChamber1->Z()) ) /2.3; - tpar[0] = iChamber1->RInner()-dframepIn; - tpar[1] = (iChamber1->ROuter()+dframepOut); + Double_t dstation = ( (-AliMUONConstants::DefaultChamberZ(9)) - + (-AliMUONConstants::DefaultChamberZ(8)) ) /2.3; + tpar[0] = AliMUONConstants::Rmin(4)-dframepIn; + tpar[1] = AliMUONConstants::Rmax(4)+dframepOut; tpar[2] = dstation; gMC->Gsvolu("CH09", "TUBE", idAir, tpar, 3); gMC->Gsvolu("CH10", "TUBE", idAir, tpar, 3); - iChamber1->GetGeometry()->SetVolume("CH09"); - iChamber2->GetGeometry()->SetVolume("CH10"); + GetGeometry(8)->SetVolume("CH09"); + GetGeometry(9)->SetVolume("CH10"); // create and position the slat (mother) volumes @@ -1155,7 +1152,7 @@ void AliMUONSlatGeometryBuilder::CreateGeometry() Double_t divpar[3]; Double_t dydiv = kSensHeight/ndiv; Double_t ydiv = (kSensHeight - dydiv)/2.; - Float_t rmin = iChamber1->RInner(); + Float_t rmin = AliMUONConstants::Rmin(4); Float_t xdiv = 0.; Float_t xvol; Float_t yvol; @@ -1192,35 +1189,23 @@ void AliMUONSlatGeometryBuilder::SetTransformations() // Defines the transformations for the station2 chambers. // --- - AliMUONChamber* iChamber1 = &fMUON->Chamber(4); - Double_t zpos1 = - iChamber1->Z(); - iChamber1->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos1)); - - AliMUONChamber* iChamber2 = &fMUON->Chamber(5); - Double_t zpos2 = - iChamber2->Z(); - iChamber2->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos2)); - - iChamber1 = &fMUON->Chamber(6); - zpos1 = - iChamber1->Z(); - iChamber1->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos1)); - - iChamber2 = &fMUON->Chamber(7); - zpos2 = - iChamber2->Z(); - iChamber2->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos2)); - - iChamber1 = &fMUON->Chamber(8); - zpos1 = - iChamber1->Z(); - iChamber1->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos1)); - - iChamber2 = &fMUON->Chamber(9); - zpos2 = - iChamber2->Z(); - iChamber2->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos2)); + Double_t zpos1= - AliMUONConstants::DefaultChamberZ(4); + SetTranslation(4, TGeoTranslation(0., 0., zpos1)); + + zpos1= - AliMUONConstants::DefaultChamberZ(5); + SetTranslation(5, TGeoTranslation(0., 0., zpos1)); + + zpos1 = - AliMUONConstants::DefaultChamberZ(6); + SetTranslation(6, TGeoTranslation(0., 0., zpos1)); + + zpos1 = - AliMUONConstants::DefaultChamberZ(7); + SetTranslation(7, TGeoTranslation(0., 0., zpos1)); + + zpos1 = - AliMUONConstants::DefaultChamberZ(8); + SetTranslation(8, TGeoTranslation(0., 0., zpos1)); + + zpos1 = - AliMUONConstants::DefaultChamberZ(9); + SetTranslation(9, TGeoTranslation(0., 0., zpos1)); } diff --git a/MUON/AliMUONSt12QuadrantSegmentation.cxx b/MUON/AliMUONSt12QuadrantSegmentation.cxx index aef803e4fda..69d67d31306 100644 --- a/MUON/AliMUONSt12QuadrantSegmentation.cxx +++ b/MUON/AliMUONSt12QuadrantSegmentation.cxx @@ -26,6 +26,9 @@ #include #include #include +#include + +#include "AliLog.h" #include "AliMpPad.h" #include "AliMpArea.h" @@ -33,15 +36,11 @@ #include "AliMpSector.h" #include "AliMpVPadIterator.h" #include "AliMpSectorSegmentation.h" - -#include "AliMUONSt12QuadrantSegmentation.h" -#include "AliRun.h" -#include "AliMUON.h" -#include "AliMUONChamber.h" -#include "AliLog.h" #include "AliMpFiles.h" #include "AliMpNeighboursPadIterator.h" -#include + +#include "AliMUONSt12QuadrantSegmentation.h" +#include "AliMUONConstants.h" ClassImp(AliMUONSt12QuadrantSegmentation) @@ -85,6 +84,8 @@ AliMUONSt12QuadrantSegmentation::AliMUONSt12QuadrantSegmentation( fCorrA->AddAt(0,0); fCorrA->AddAt(0,1); fCorrA->AddAt(0,2); + + AliDebug(1, Form("ctor this = %p", this) ); } //______________________________________________________________________________ @@ -115,6 +116,8 @@ AliMUONSt12QuadrantSegmentation::AliMUONSt12QuadrantSegmentation() fYt(0.), fCorrA(0) { // Default Constructor + + AliDebug(1, Form("default (empty) ctor this = %p", this)); } //______________________________________________________________________________ @@ -129,6 +132,8 @@ AliMUONSt12QuadrantSegmentation::AliMUONSt12QuadrantSegmentation(const AliMUONSt AliMUONSt12QuadrantSegmentation::~AliMUONSt12QuadrantSegmentation() { // Destructor + AliDebug(1, Form("dtor this = %p", this)); + delete fSector; delete fSectorSegmentation; delete fSectorIterator; @@ -252,7 +257,7 @@ AliMUONGeometryDirection AliMUONSt12QuadrantSegmentation::GetDirection() } //______________________________________________________________________________ -const AliMpSectorSegmentation* +const AliMpVSegmentation* AliMUONSt12QuadrantSegmentation::GetMpSegmentation() const { // Returns the mapping segmentation @@ -334,10 +339,8 @@ void AliMUONSt12QuadrantSegmentation::Init(Int_t chamber) // find Npx, Npy and save this info // reference to chamber - AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); - fChamber = &(pMUON->Chamber(chamber)); - fRmin=fChamber->RInner(); - fRmax=fChamber->ROuter(); + fRmin=AliMUONConstants::Rmin(0); + fRmax=AliMUONConstants::Rmax(0); fZ = 0; fId=chamber; } diff --git a/MUON/AliMUONSt12QuadrantSegmentation.h b/MUON/AliMUONSt12QuadrantSegmentation.h index 35f506ed027..2ce51621e31 100644 --- a/MUON/AliMUONSt12QuadrantSegmentation.h +++ b/MUON/AliMUONSt12QuadrantSegmentation.h @@ -64,7 +64,7 @@ class AliMUONSt12QuadrantSegmentation : public AliMUONVGeometryDESegmentation virtual AliMUONGeometryDirection GetDirection(); // Returns the direction with a constant pad size // Access to mapping - virtual const AliMpSectorSegmentation* GetMpSegmentation() const; + virtual const AliMpVSegmentation* GetMpSegmentation() const; // Transform from pad (wire) to real coordinates and vice versa // diff --git a/MUON/AliMUONSt1GeometryBuilder.cxx b/MUON/AliMUONSt1GeometryBuilder.cxx index 832e4d464b2..edc2c61e347 100644 --- a/MUON/AliMUONSt1GeometryBuilder.cxx +++ b/MUON/AliMUONSt1GeometryBuilder.cxx @@ -29,7 +29,7 @@ #include "AliMUONSt1GeometryBuilder.h" #include "AliMUON.h" -#include "AliMUONChamber.h" +#include "AliMUONConstants.h" #include "AliMUONGeometryModule.h" #include "AliMUONGeometryEnvelopeStore.h" @@ -37,9 +37,7 @@ ClassImp(AliMUONSt1GeometryBuilder) //______________________________________________________________________________ AliMUONSt1GeometryBuilder::AliMUONSt1GeometryBuilder(AliMUON* muon) - : AliMUONVGeometryBuilder("st1.dat", - muon->Chamber(0).GetGeometry(), - muon->Chamber(1).GetGeometry()), + : AliMUONVGeometryBuilder(0, 1), fMUON(muon) { // Standard constructor @@ -117,25 +115,19 @@ void AliMUONSt1GeometryBuilder::CreateGeometry() Int_t irot2; fMUON->AliMatrix(irot2, 90., 90., 90., 180., 0., 0.); - AliMUONChamber* iChamber1 = &fMUON->Chamber(0); - AliMUONChamber* iChamber2 = &fMUON->Chamber(1); - AliMUONChamber* iChamber = iChamber1; - // DGas decreased from standard one (0.5) - iChamber->SetDGas(0.4); - iChamber2->SetDGas(0.4); + const Float_t kDGas = 0.4; // DAlu increased from standard one (3% of X0), // because more electronics with smaller pads - iChamber->SetDAlu(3.5 * 8.9 / 100.); - iChamber2->SetDAlu(3.5 * 8.9 / 100.); + const Float_t kDAlu = 3.5 * 8.9 / 100.; // Half of the total thickness of frame crosses (including DAlu) // for each chamber in stations 1 and 2: // 3% of X0 of composite material, // but taken as Aluminium here, with same thickness in number of X0 Float_t dframez = 3. * 8.9 / 100; - Float_t zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; + Float_t zfpos=-(kDGas+dframez+kDAlu)/2; // The same parameters are defined in builder for station 2 // Mother volume @@ -149,9 +141,10 @@ void AliMUONSt1GeometryBuilder::CreateGeometry() // The same parameters are defined in builder for station 2 Float_t tpar[3]; - Float_t dstation = (-iChamber2->Z()) - (-iChamber1->Z()); - tpar[0] = iChamber->RInner()-dframep; - tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi); + Float_t dstation = (-AliMUONConstants::DefaultChamberZ(1)) - + (-AliMUONConstants::DefaultChamberZ(0)); + tpar[0] = AliMUONConstants::Rmin(0)-dframep; + tpar[1] = (AliMUONConstants::Rmax(0)+dframep)/TMath::Cos(phi); tpar[2] = dstation/5; gMC->Gsvolu("S01M", "TUBE", idAir, tpar, 3); @@ -172,7 +165,7 @@ void AliMUONSt1GeometryBuilder::CreateGeometry() // pgpar[2] = 12.; // pgpar[3] = 2; // pgpar[4] = -dframez/2; -// pgpar[5] = iChamber->ROuter(); +// pgpar[5] = AliMUONConstants::Rmax(0); // pgpar[6] = pgpar[5]+dframep1; // pgpar[7] = +dframez/2; // pgpar[8] = pgpar[5]; @@ -185,8 +178,8 @@ void AliMUONSt1GeometryBuilder::CreateGeometry() // gMC->Gspos("S02O",2,"S02M", 0.,0.,+zfpos, 0,"ONLY"); // // // // Inner frame -// tpar[0]= iChamber->RInner()-dframep1; -// tpar[1]= iChamber->RInner(); +// tpar[0]= AliMUONConstants::Rmin(0)-dframep1; +// tpar[1]= AliMUONConstants::Rmin(0); // tpar[2]= dframez/2; // gMC->Gsvolu("S01I", "TUBE", idAlu1, tpar, 3); // gMC->Gsvolu("S02I", "TUBE", idAlu1, tpar, 3); @@ -201,64 +194,64 @@ void AliMUONSt1GeometryBuilder::CreateGeometry() // outside gas // security for inside mother volume Float_t bpar[3]; - bpar[0] = (iChamber->ROuter() - iChamber->RInner()) + bpar[0] = (AliMUONConstants::Rmax(0) - AliMUONConstants::Rmin(0)) * TMath::Cos(TMath::ASin(dframep1 / - (iChamber->ROuter() - iChamber->RInner()))) + (AliMUONConstants::Rmax(0) - AliMUONConstants::Rmin(0)))) / 2.0; bpar[1] = dframep1/2; // total thickness will be (4 * bpar[2]) for each chamber, // which has to be equal to (2 * dframez) - DAlu - bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0; + bpar[2] = (2.0 * dframez - kDAlu) / 4.0; gMC->Gsvolu("S01B", "BOX", idAlu1, bpar, 3); gMC->Gsvolu("S02B", "BOX", idAlu1, bpar, 3); - gMC->Gspos("S01B",1,"S01M", +iChamber->RInner()+bpar[0] , 0,-zfpos, + gMC->Gspos("S01B",1,"S01M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,-zfpos, irot1,"ONLY"); - gMC->Gspos("S01B",2,"S01M", -iChamber->RInner()-bpar[0] , 0,-zfpos, + gMC->Gspos("S01B",2,"S01M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,-zfpos, irot1,"ONLY"); - gMC->Gspos("S01B",3,"S01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos, + gMC->Gspos("S01B",3,"S01M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,-zfpos, irot2,"ONLY"); - gMC->Gspos("S01B",4,"S01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos, + gMC->Gspos("S01B",4,"S01M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,-zfpos, irot2,"ONLY"); - gMC->Gspos("S01B",5,"S01M", +iChamber->RInner()+bpar[0] , 0,+zfpos, + gMC->Gspos("S01B",5,"S01M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,+zfpos, irot1,"ONLY"); - gMC->Gspos("S01B",6,"S01M", -iChamber->RInner()-bpar[0] , 0,+zfpos, + gMC->Gspos("S01B",6,"S01M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,+zfpos, irot1,"ONLY"); - gMC->Gspos("S01B",7,"S01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos, + gMC->Gspos("S01B",7,"S01M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,+zfpos, irot2,"ONLY"); - gMC->Gspos("S01B",8,"S01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos, + gMC->Gspos("S01B",8,"S01M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,+zfpos, irot2,"ONLY"); - gMC->Gspos("S02B",1,"S02M", +iChamber->RInner()+bpar[0] , 0,-zfpos, + gMC->Gspos("S02B",1,"S02M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,-zfpos, irot1,"ONLY"); - gMC->Gspos("S02B",2,"S02M", -iChamber->RInner()-bpar[0] , 0,-zfpos, + gMC->Gspos("S02B",2,"S02M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,-zfpos, irot1,"ONLY"); - gMC->Gspos("S02B",3,"S02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos, + gMC->Gspos("S02B",3,"S02M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,-zfpos, irot2,"ONLY"); - gMC->Gspos("S02B",4,"S02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos, + gMC->Gspos("S02B",4,"S02M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,-zfpos, irot2,"ONLY"); - gMC->Gspos("S02B",5,"S02M", +iChamber->RInner()+bpar[0] , 0,+zfpos, + gMC->Gspos("S02B",5,"S02M", +AliMUONConstants::Rmin(0)+bpar[0] , 0,+zfpos, irot1,"ONLY"); - gMC->Gspos("S02B",6,"S02M", -iChamber->RInner()-bpar[0] , 0,+zfpos, + gMC->Gspos("S02B",6,"S02M", -AliMUONConstants::Rmin(0)-bpar[0] , 0,+zfpos, irot1,"ONLY"); - gMC->Gspos("S02B",7,"S02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos, + gMC->Gspos("S02B",7,"S02M", 0, +AliMUONConstants::Rmin(0)+bpar[0] ,+zfpos, irot2,"ONLY"); - gMC->Gspos("S02B",8,"S02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos, + gMC->Gspos("S02B",8,"S02M", 0, -AliMUONConstants::Rmin(0)-bpar[0] ,+zfpos, irot2,"ONLY"); } // // Chamber Material represented by Alu sheet - tpar[0]= iChamber->RInner(); - tpar[1]= iChamber->ROuter(); - tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2; + tpar[0]= AliMUONConstants::Rmin(0); + tpar[1]= AliMUONConstants::Rmax(0); + tpar[2] = (kDGas+kDAlu)/2; gMC->Gsvolu("S01A", "TUBE", idAlu2, tpar, 3); gMC->Gsvolu("S02A", "TUBE",idAlu2, tpar, 3); gMC->Gspos("S01A", 1, "S01M", 0., 0., 0., 0, "ONLY"); gMC->Gspos("S02A", 1, "S02M", 0., 0., 0., 0, "ONLY"); // // Sensitive volumes - // tpar[2] = iChamber->DGas(); - tpar[2] = iChamber->DGas()/2; + // tpar[2] = kDGas; + tpar[2] = kDGas/2; gMC->Gsvolu("S01G", "TUBE", idGas, tpar, 3); gMC->Gsvolu("S02G", "TUBE", idGas, tpar, 3); gMC->Gspos("S01G", 1, "S01A", 0., 0., 0., 0, "ONLY"); @@ -268,29 +261,29 @@ void AliMUONSt1GeometryBuilder::CreateGeometry() // NONE: chambers are sensitive everywhere // if (frameCrosses) { -// dr = (iChamber->ROuter() - iChamber->RInner()); +// dr = (AliMUONConstants::Rmax(0) - AliMUONConstants::Rmin(0)); // bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2; // bpar[1] = dframep1/2; -// bpar[2] = iChamber->DGas()/2; +// bpar[2] = kDGas/2; // gMC->Gsvolu("S01F", "BOX", idAlu1, bpar, 3); // gMC->Gsvolu("S02F", "BOX", idAlu1, bpar, 3); -// gMC->Gspos("S01F",1,"S01G", +iChamber->RInner()+bpar[0] , 0, 0, +// gMC->Gspos("S01F",1,"S01G", +AliMUONConstants::Rmin(0)+bpar[0] , 0, 0, // irot1,"ONLY"); -// gMC->Gspos("S01F",2,"S01G", -iChamber->RInner()-bpar[0] , 0, 0, +// gMC->Gspos("S01F",2,"S01G", -AliMUONConstants::Rmin(0)-bpar[0] , 0, 0, // irot1,"ONLY"); -// gMC->Gspos("S01F",3,"S01G", 0, +iChamber->RInner()+bpar[0] , 0, +// gMC->Gspos("S01F",3,"S01G", 0, +AliMUONConstants::Rmin(0)+bpar[0] , 0, // irot2,"ONLY"); -// gMC->Gspos("S01F",4,"S01G", 0, -iChamber->RInner()-bpar[0] , 0, +// gMC->Gspos("S01F",4,"S01G", 0, -AliMUONConstants::Rmin(0)-bpar[0] , 0, // irot2,"ONLY"); -// gMC->Gspos("S02F",1,"S02G", +iChamber->RInner()+bpar[0] , 0, 0, +// gMC->Gspos("S02F",1,"S02G", +AliMUONConstants::Rmin(0)+bpar[0] , 0, 0, // irot1,"ONLY"); -// gMC->Gspos("S02F",2,"S02G", -iChamber->RInner()-bpar[0] , 0, 0, +// gMC->Gspos("S02F",2,"S02G", -AliMUONConstants::Rmin(0)-bpar[0] , 0, 0, // irot1,"ONLY"); -// gMC->Gspos("S02F",3,"S02G", 0, +iChamber->RInner()+bpar[0] , 0, +// gMC->Gspos("S02F",3,"S02G", 0, +AliMUONConstants::Rmin(0)+bpar[0] , 0, // irot2,"ONLY"); -// gMC->Gspos("S02F",4,"S02G", 0, -iChamber->RInner()-bpar[0] , 0, +// gMC->Gspos("S02F",4,"S02G", 0, -AliMUONConstants::Rmin(0)-bpar[0] , 0, // irot2,"ONLY"); // } } @@ -301,15 +294,11 @@ void AliMUONSt1GeometryBuilder::SetTransformations() // Defines the transformations for the station2 chambers. // --- - AliMUONChamber* iChamber1 = &fMUON->Chamber(0); - Double_t zpos1= - iChamber1->Z(); - iChamber1->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos1)); + Double_t zpos1= - AliMUONConstants::DefaultChamberZ(0); + SetTranslation(0, TGeoTranslation(0., 0., zpos1)); - AliMUONChamber* iChamber2 = &fMUON->Chamber(1); - Double_t zpos2 = - iChamber2->Z(); - iChamber2->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos2)); + Double_t zpos2 = - AliMUONConstants::DefaultChamberZ(1); + SetTranslation(0, TGeoTranslation(0., 0., zpos2)); } //______________________________________________________________________________ diff --git a/MUON/AliMUONSt1GeometryBuilderV2.cxx b/MUON/AliMUONSt1GeometryBuilderV2.cxx index 12b89b9ef4f..63ca64d6d5b 100644 --- a/MUON/AliMUONSt1GeometryBuilderV2.cxx +++ b/MUON/AliMUONSt1GeometryBuilderV2.cxx @@ -54,7 +54,7 @@ #include "AliMUONSt1GeometryBuilderV2.h" #include "AliMUONSt1SpecialMotif.h" #include "AliMUON.h" -#include "AliMUONChamber.h" +#include "AliMUONConstants.h" #include "AliMUONGeometryModule.h" #include "AliMUONGeometryEnvelopeStore.h" @@ -120,9 +120,7 @@ const Int_t AliMUONSt1GeometryBuilderV2::fgkDaughterCopyNoOffset=1000; //______________________________________________________________________________ AliMUONSt1GeometryBuilderV2::AliMUONSt1GeometryBuilderV2(AliMUON* muon) - : AliMUONVGeometryBuilder("st1V2.dat", - muon->Chamber(0).GetGeometry(), - muon->Chamber(1).GetGeometry()), + : AliMUONVGeometryBuilder(0, 1), fMUON(muon) { // set path to mapping data files @@ -2578,15 +2576,11 @@ void AliMUONSt1GeometryBuilderV2::SetTransformations() // Defines the transformations for the station2 chambers. // --- - AliMUONChamber* iChamber1 = &fMUON->Chamber(0); - Double_t zpos1 = - iChamber1->Z(); - iChamber1->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos1)); + Double_t zpos1 = - AliMUONConstants::DefaultChamberZ(0); + SetTranslation(0, TGeoTranslation(0., 0., zpos1)); - AliMUONChamber* iChamber2 = &fMUON->Chamber(1); - Double_t zpos2 = - iChamber2->Z(); - iChamber2->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos2)); + Double_t zpos2 = - AliMUONConstants::DefaultChamberZ(1); + SetTranslation(1, TGeoTranslation(0., 0., zpos2)); } //______________________________________________________________________________ diff --git a/MUON/AliMUONSt1Response.cxx b/MUON/AliMUONSt1Response.cxx index fc2464c7743..afd4d8a0ac8 100644 --- a/MUON/AliMUONSt1Response.cxx +++ b/MUON/AliMUONSt1Response.cxx @@ -44,9 +44,11 @@ #include "AliMUONSt1IniReader.h" #include "AliMUONSt1Decoder.h" #include "AliMUONTransientDigit.h" +#include "AliMUONSegmentation.h" #include "AliMUONGeometrySegmentation.h" #include "AliMUONSt12QuadrantSegmentation.h" -#include "AliMUONChamber.h" +#include "AliMUON.h" +#include "AliRun.h" #include "AliLog.h" ClassImp(AliMUONSt1Response) @@ -82,13 +84,13 @@ const TString AliMUONSt1Response::fgkNofSigmaName ="nofSigma"; //__________________________________________________________________________ -AliMUONSt1Response::AliMUONSt1Response(AliMUONChamber* chamber) +AliMUONSt1Response::AliMUONSt1Response(Int_t chamberId) : AliMUONResponseV0(), fReadFiles(kTRUE), fCountNofCalls(0), fCountUnknownZone(0), fCountUnknownIndices(0), - fChamber(chamber), + fChamberId(chamberId), fParams(), fRegions(), fTrashList() @@ -120,7 +122,7 @@ AliMUONSt1Response::AliMUONSt1Response() fCountNofCalls(0), fCountUnknownZone(0), fCountUnknownIndices(0), - fChamber(0), + fChamberId(0), fParams(), fRegions(), fTrashList() @@ -191,10 +193,14 @@ AliMUONSt1Response::GetGeometrySegmentation(Int_t cathod) { // Get geometry segmentation for given cathod plane - if (!fChamber->SegmentationModel2(cathod)) + AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON"); + AliMUONGeometrySegmentation* segmentation + = muon->GetSegmentation()->GetModuleSegmentation(fChamberId, cathod-1); + + if (!segmentation) AliFatal(Form("Geometry segmentation for cathod %d not defined.", cathod)); - return fChamber->SegmentationModel2(cathod); + return segmentation; } //__________________________________________________________________________ @@ -211,10 +217,8 @@ AliMUONSt1Response::GetMpSegmentation(Int_t detElemId, Int_t cathod) detElemId)); } - const AliMUONSt12QuadrantSegmentation* quadrantSegmentation - = static_cast(deSegmentation); - - return quadrantSegmentation->GetMpSegmentation(); + return (const AliMpSectorSegmentation*)deSegmentation->GetMpSegmentation(); + // check if we need AliMpSectorSegmentation } @@ -512,7 +516,7 @@ void AliMUONSt1Response::ReadFiles() Int_t i; TString path = fgkTopDir + fgkDataDir ; - TString configFileName = path + fgkConfigBaseName + Form("%d.ini",fChamber); + TString configFileName = path + fgkConfigBaseName + Form("%d.ini",fChamberId); if (gSystem->AccessPathName(configFileName,kReadPermission)){ // no configChamberI.ini file exists SetIniFileName(0,fgkStandardIniFileName); diff --git a/MUON/AliMUONSt1Response.h b/MUON/AliMUONSt1Response.h index 57899388c9e..f02bca4499d 100644 --- a/MUON/AliMUONSt1Response.h +++ b/MUON/AliMUONSt1Response.h @@ -37,12 +37,12 @@ class AliMpSector; class TArrayF; class TObjArray; class AliMUONSt1ResponseParameter; -class AliMUONChamber; +//class AliMUONChamber; class AliMUONSt1Response : public AliMUONResponseV0 { public: - AliMUONSt1Response(AliMUONChamber* chamber); + AliMUONSt1Response(Int_t chamberId); AliMUONSt1Response(); virtual ~AliMUONSt1Response(); @@ -123,7 +123,7 @@ class AliMUONSt1Response : public AliMUONResponseV0 Int_t fCountUnknownZone; // ntimes the DigitResponse was called in an unknown zone Int_t fCountUnknownIndices; // ntimes the DigitResponse was called with unknown indices - AliMUONChamber* fChamber; // The MUON chamber + Int_t fChamberId; // The MUON chamber Id ParamsMap fParams; //! internal parameter list ListMap fRegions; //! internal list of regions diff --git a/MUON/AliMUONSt2GeometryBuilder.cxx b/MUON/AliMUONSt2GeometryBuilder.cxx index e3d2b2b2bbd..fba86b7d7ad 100644 --- a/MUON/AliMUONSt2GeometryBuilder.cxx +++ b/MUON/AliMUONSt2GeometryBuilder.cxx @@ -28,7 +28,7 @@ #include "AliMUONSt2GeometryBuilder.h" #include "AliMUON.h" -#include "AliMUONChamber.h" +#include "AliMUONConstants.h" #include "AliMUONGeometryModule.h" #include "AliMUONGeometryEnvelopeStore.h" @@ -36,9 +36,7 @@ ClassImp(AliMUONSt2GeometryBuilder) //______________________________________________________________________________ AliMUONSt2GeometryBuilder::AliMUONSt2GeometryBuilder(AliMUON* muon) - : AliMUONVGeometryBuilder("st2.dat", - muon->Chamber(2).GetGeometry(), - muon->Chamber(3).GetGeometry()), + : AliMUONVGeometryBuilder(2, 3), fMUON(muon) { // Standard constructor @@ -117,10 +115,6 @@ void AliMUONSt2GeometryBuilder::CreateGeometry() Int_t irot2; fMUON->AliMatrix(irot2, 90., 90., 90., 180., 0., 0.); - AliMUONChamber* iChamber = &fMUON->Chamber(2); - // AliMUONChamber* iChamber1 = iChamber; - // AliMUONChamber* iChamber2 = &fMUON->Chamber(3); - // Half of the total thickness of frame crosses (including DAlu) // for each chamber in stations 1 and 2: // 3% of X0 of composite material, @@ -129,6 +123,12 @@ void AliMUONSt2GeometryBuilder::CreateGeometry() // DGas and DAlu not changed from standard values // Double_t zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // The same parameters are defined in builder for station 1 + + // sensitive gas gap + const Float_t kDGas = 0.5; + + // 3% radiation length of aluminum (X0=8.9 cm) + // const Float_t kDAlu = 3.5 * 8.9 / 100.; // Mother volume // Outer excess and inner recess for mother volume radius @@ -145,9 +145,9 @@ void AliMUONSt2GeometryBuilder::CreateGeometry() Float_t posx, posy, posz; // Chamber Material represented by Alu sheet - tpar[0]= iChamber->RInner(); - tpar[1]= iChamber->ROuter(); - tpar[2] = (iChamber->DGas())/2; + tpar[0]= AliMUONConstants::Rmin(1); + tpar[1]= AliMUONConstants::Rmax(1); + tpar[2] = kDGas/2; tpar[3] = 0.; tpar[4] = 90.; @@ -214,15 +214,11 @@ void AliMUONSt2GeometryBuilder::SetTransformations() // Defines the transformations for the station2 chambers. // --- - AliMUONChamber* iChamber1 = &fMUON->Chamber(2); - Double_t zpos1 = - iChamber1->Z(); - iChamber1->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos1)); + Double_t zpos1 = - AliMUONConstants::DefaultChamberZ(2); + SetTranslation(2, TGeoTranslation(0., 0., zpos1)); - AliMUONChamber* iChamber2 = &fMUON->Chamber(3); - Double_t zpos2 = - iChamber2->Z(); - iChamber2->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos2)); + Double_t zpos2 = - AliMUONConstants::DefaultChamberZ(3); + SetTranslation(3, TGeoTranslation(0., 0., zpos2)); } //______________________________________________________________________________ diff --git a/MUON/AliMUONSt2GeometryBuilderV2.cxx b/MUON/AliMUONSt2GeometryBuilderV2.cxx index dd41511505b..2567e84db5b 100644 --- a/MUON/AliMUONSt2GeometryBuilderV2.cxx +++ b/MUON/AliMUONSt2GeometryBuilderV2.cxx @@ -33,7 +33,7 @@ #include "AliMUONSt2GeometryBuilderV2.h" #include "AliMUON.h" -#include "AliMUONChamber.h" +#include "AliMUONConstants.h" #include "AliMUONGeometryModule.h" #include "AliMUONGeometryEnvelopeStore.h" #include "AliMUONConstants.h" @@ -43,9 +43,7 @@ ClassImp(AliMUONSt2GeometryBuilderV2) //______________________________________________________________________________ AliMUONSt2GeometryBuilderV2::AliMUONSt2GeometryBuilderV2(AliMUON* muon) - : AliMUONVGeometryBuilder("st2V2.dat", - muon->Chamber(2).GetGeometry(), - muon->Chamber(3).GetGeometry()), + : AliMUONVGeometryBuilder(2, 3), fMUON(muon) { // Standard constructor @@ -1458,15 +1456,11 @@ void AliMUONSt2GeometryBuilderV2::SetTransformations() // Defines the transformations for the station2 chambers. // --- - AliMUONChamber* iChamber1 = &fMUON->Chamber(2); - Double_t zpos1 = - iChamber1->Z(); - iChamber1->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos1)); + Double_t zpos1 = - AliMUONConstants::DefaultChamberZ(2); + SetTranslation(2, TGeoTranslation(0., 0., zpos1)); - AliMUONChamber* iChamber2 = &fMUON->Chamber(3); - Double_t zpos2 = - iChamber2->Z(); - iChamber2->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos2)); + Double_t zpos2 = - AliMUONConstants::DefaultChamberZ(3); + SetTranslation(3, TGeoTranslation(0., 0., zpos2)); } //______________________________________________________________________________ diff --git a/MUON/AliMUONSt345SlatSegmentation.h b/MUON/AliMUONSt345SlatSegmentation.h index 40e22722457..d9113bbbf45 100644 --- a/MUON/AliMUONSt345SlatSegmentation.h +++ b/MUON/AliMUONSt345SlatSegmentation.h @@ -42,6 +42,7 @@ class AliMUONSt345SlatSegmentation : public AliMUONVGeometryDESegmentation virtual Bool_t HasPad(Float_t /*x*/, Float_t /*y*/, Float_t /*z*/) { return true; } virtual Bool_t HasPad(Int_t ix, Int_t iy); virtual AliMUONGeometryDirection GetDirection() { return kDirUndefined; } + virtual const AliMpVSegmentation* GetMpSegmentation() const { return 0; } virtual Float_t GetAnod(Float_t xhit) const; // Anod wire coordinate closest to xhit virtual void GetPadI(Float_t x ,Float_t y ,Int_t &ix,Int_t &iy); // Transform from pad to real coordinates diff --git a/MUON/AliMUONSt345SlatSegmentationV2.cxx b/MUON/AliMUONSt345SlatSegmentationV2.cxx index 5a6c8006bfd..d634b3c4074 100644 --- a/MUON/AliMUONSt345SlatSegmentationV2.cxx +++ b/MUON/AliMUONSt345SlatSegmentationV2.cxx @@ -233,6 +233,17 @@ AliMUONSt345SlatSegmentationV2::GetDirection() return kDirUndefined; } +//______________________________________________________________________________ +const AliMpVSegmentation* +AliMUONSt345SlatSegmentationV2::GetMpSegmentation() const +{ +// Returns the mapping segmentation +// (provides access to electronics info) + + return fSlatSegmentation; +} + + //_____________________________________________________________________________ void AliMUONSt345SlatSegmentationV2::GetNParallelAndOffset(Int_t,Int_t,Int_t*,Int_t*) diff --git a/MUON/AliMUONSt345SlatSegmentationV2.h b/MUON/AliMUONSt345SlatSegmentationV2.h index 7a68a2daf32..741f1ba1be2 100644 --- a/MUON/AliMUONSt345SlatSegmentationV2.h +++ b/MUON/AliMUONSt345SlatSegmentationV2.h @@ -97,6 +97,8 @@ class AliMUONSt345SlatSegmentationV2 : public AliMUONVGeometryDESegmentation AliMUONGeometryDirection GetDirection();// { return kDirUndefined; } + const AliMpVSegmentation* GetMpSegmentation() const; + /// to be deprecated. Use the one below w/o z instead. void GetPadC(Int_t ix, Int_t iy, Float_t& x, Float_t& y, Float_t& z); diff --git a/MUON/AliMUONTriggerCircuit.cxx b/MUON/AliMUONTriggerCircuit.cxx index 68aa47d75fa..65dd019696b 100644 --- a/MUON/AliMUONTriggerCircuit.cxx +++ b/MUON/AliMUONTriggerCircuit.cxx @@ -22,7 +22,7 @@ #include "AliMUON.h" #include "AliMUONTriggerConstants.h" #include "AliMUONGeometrySegmentation.h" -#include "AliMUONChamber.h" +#include "AliMUONSegmentation.h" #include "AliMUONConstants.h" #include "AliLog.h" @@ -316,14 +316,13 @@ void AliMUONTriggerCircuit::LoadYPos2(){ Int_t istrip, idDE; AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); - AliMUONChamber* iChamber; AliMUONGeometrySegmentation* segmentation; // first plane (11) chamber=11; cathode=1; - iChamber = &(pMUON->Chamber(chamber-1)); - segmentation=iChamber->SegmentationModel2(cathode); + segmentation + = pMUON->GetSegmentation()->GetModuleSegmentation(chamber-1, cathode-1); if (!segmentation) { AliWarning("Segmentation not defined."); @@ -346,8 +345,8 @@ void AliMUONTriggerCircuit::LoadYPos2(){ // second plane (21) chamber=13; cathode=1; - iChamber = &(pMUON->Chamber(chamber-1)); - segmentation=iChamber->SegmentationModel2(cathode); + segmentation + = pMUON->GetSegmentation()->GetModuleSegmentation(chamber-1, cathode-1); for (istrip=0; istrip<32; istrip++) { code=fXcode[2][istrip]; // decode current strip @@ -381,10 +380,9 @@ void AliMUONTriggerCircuit::LoadXPos2(){ Int_t chamber=11; Int_t cathode=2; AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); - AliMUONChamber* iChamber; AliMUONGeometrySegmentation* segmentation; - iChamber = &(pMUON->Chamber(chamber-1)); - segmentation=iChamber->SegmentationModel2(cathode); + segmentation + = pMUON->GetSegmentation()->GetModuleSegmentation(chamber-1, cathode-1); if (!segmentation) { AliWarning("Segmentation not defined."); diff --git a/MUON/AliMUONTriggerGeometryBuilder.cxx b/MUON/AliMUONTriggerGeometryBuilder.cxx index 8e011387549..e073536db7b 100644 --- a/MUON/AliMUONTriggerGeometryBuilder.cxx +++ b/MUON/AliMUONTriggerGeometryBuilder.cxx @@ -28,7 +28,7 @@ #include "AliMUONTriggerGeometryBuilder.h" #include "AliMUON.h" -#include "AliMUONChamber.h" +#include "AliMUONConstants.h" #include "AliMUONGeometryModule.h" #include "AliMUONGeometryEnvelopeStore.h" @@ -36,11 +36,7 @@ ClassImp(AliMUONTriggerGeometryBuilder) //______________________________________________________________________________ AliMUONTriggerGeometryBuilder::AliMUONTriggerGeometryBuilder(AliMUON* muon) - : AliMUONVGeometryBuilder("trigger.dat", - muon->Chamber(10).GetGeometry(), - muon->Chamber(11).GetGeometry(), - muon->Chamber(12).GetGeometry(), - muon->Chamber(13).GetGeometry()), + : AliMUONVGeometryBuilder(10, 11, 12, 13), fMUON(muon) { // Standard constructor @@ -128,12 +124,9 @@ void AliMUONTriggerGeometryBuilder::CreateGeometry() const Float_t kZm=-3.6; const Float_t kZp=+3.6; - AliMUONChamber *iChamber, *iChamber1, *iChamber2; - iChamber1 = &fMUON->Chamber(10); - Float_t zpos1= iChamber1->Z(); - iChamber2 = &fMUON->Chamber(11); - - Double_t dstation = ( ( - iChamber2->Z()) - ( - iChamber1->Z()) ) /2.1; + Float_t zpos1= AliMUONConstants::DefaultChamberZ(10); + Double_t dstation = ( ( - AliMUONConstants::DefaultChamberZ(11)) - + ( - AliMUONConstants::DefaultChamberZ(10)) ) /2.1; Float_t par[3]; par[2] = dstation; @@ -149,14 +142,13 @@ void AliMUONTriggerGeometryBuilder::CreateGeometry() Int_t iVolNum=1; // counter Volume Number icount = Int_t(iplane<<0)+Int_t(istation<<1); - iChamber = &fMUON->Chamber(10+icount); - par[0] = iChamber->RInner(); - par[1] = iChamber->ROuter(); + par[0] = AliMUONConstants::Rmin(5+istation); + par[1] = AliMUONConstants::Rmax(5+istation); Char_t volName[6]; sprintf(volName,"%s%d", "SC",11+icount); gMC->Gsvolu(volName,"TUBE", idAir, par, 3); - iChamber->GetGeometry()->SetVolume(volName); - Float_t zpos = iChamber->Z(); + GetGeometry(10+icount)->SetVolume(volName); + Float_t zpos = AliMUONConstants::DefaultChamberZ(10+icount); /* removed 03/18/05 // Flange between beam shielding and RPC @@ -341,28 +333,18 @@ void AliMUONTriggerGeometryBuilder::SetTransformations() { // Defines the transformations for the trigger chambers. // --- - Double_t zpos1, zpos2; - AliMUONChamber *iChamber1, *iChamber2; - iChamber1 = &fMUON->Chamber(10); - zpos1= iChamber1->Z(); - iChamber1->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos1)); + Double_t zpos1= AliMUONConstants::DefaultChamberZ(10); + SetTranslation(10, TGeoTranslation(0., 0., zpos1)); - iChamber2 = &fMUON->Chamber(11); - zpos2 = iChamber2->Z(); - iChamber2->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos2)); - - iChamber1 = &fMUON->Chamber(12); - zpos1 = iChamber1->Z(); - iChamber1->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos1)); - - iChamber2 = &fMUON->Chamber(13); - zpos2 = iChamber2->Z(); - iChamber2->GetGeometry() - ->SetTranslation(TGeoTranslation(0., 0., zpos2)); + zpos1= AliMUONConstants::DefaultChamberZ(11); + SetTranslation(11, TGeoTranslation(0., 0., zpos1)); + + zpos1= AliMUONConstants::DefaultChamberZ(12); + SetTranslation(12, TGeoTranslation(0., 0., zpos1)); + + zpos1= AliMUONConstants::DefaultChamberZ(13); + SetTranslation(13, TGeoTranslation(0., 0., zpos1)); } diff --git a/MUON/AliMUONTriggerSegmentation.h b/MUON/AliMUONTriggerSegmentation.h index 89c89a9fd4b..7f338471ecc 100644 --- a/MUON/AliMUONTriggerSegmentation.h +++ b/MUON/AliMUONTriggerSegmentation.h @@ -30,6 +30,7 @@ class AliMUONTriggerSegmentation : public AliMUONVGeometryDESegmentation virtual Bool_t HasPad(Float_t /*x*/, Float_t /*y*/, Float_t /*z*/) { return true; } virtual Bool_t HasPad(Int_t ix, Int_t iy); virtual AliMUONGeometryDirection GetDirection() { return kDirUndefined; } + virtual const AliMpVSegmentation* GetMpSegmentation() const { return 0; } virtual Float_t GetAnod(Float_t /*xhit*/) const {return 0; } // Anod wire coordinate closest to xhit virtual void GetPadI(Float_t x ,Float_t y ,Int_t &ix,Int_t &iy); // Transform from pad to real coordinates diff --git a/MUON/AliMUONTriggerSegmentationV2.cxx b/MUON/AliMUONTriggerSegmentationV2.cxx index 1c1f25957ee..f050ee6570a 100644 --- a/MUON/AliMUONTriggerSegmentationV2.cxx +++ b/MUON/AliMUONTriggerSegmentationV2.cxx @@ -199,6 +199,16 @@ AliMUONTriggerSegmentationV2::GetDirection() return kDirUndefined; } +//______________________________________________________________________________ +const AliMpVSegmentation* +AliMUONTriggerSegmentationV2::GetMpSegmentation() const +{ +// Returns the mapping segmentation +// (provides access to electronics info) + + return fSlatSegmentation; +} + //_____________________________________________________________________________ void AliMUONTriggerSegmentationV2::GetNParallelAndOffset(Int_t,Int_t,Int_t*,Int_t*) diff --git a/MUON/AliMUONTriggerSegmentationV2.h b/MUON/AliMUONTriggerSegmentationV2.h index e5d6780f205..c1ac5f37fd2 100644 --- a/MUON/AliMUONTriggerSegmentationV2.h +++ b/MUON/AliMUONTriggerSegmentationV2.h @@ -54,6 +54,7 @@ class AliMUONTriggerSegmentationV2 : public AliMUONVGeometryDESegmentation virtual Bool_t HasPad(Int_t ix, Int_t iy); virtual AliMUONGeometryDirection GetDirection(); + virtual const AliMpVSegmentation* GetMpSegmentation() const; virtual Float_t GetAnod(Float_t /*xhit*/) const; diff --git a/MUON/AliMUONv1.cxx b/MUON/AliMUONv1.cxx index e366f8340bc..9e34bc36eba 100644 --- a/MUON/AliMUONv1.cxx +++ b/MUON/AliMUONv1.cxx @@ -28,14 +28,17 @@ #include "AliMUONv1.h" #include "AliConst.h" -#include "AliMUONChamber.h" #include "AliMUONConstants.h" -#include "AliMUONFactoryV4.h" -#include "AliMUONFactoryV3.h" -#include "AliMUONFactoryV2.h" +#include "AliMUONSegFactoryV4.h" +#include "AliMUONSegFactoryV3.h" +#include "AliMUONSegFactoryV2.h" +#include "AliMUONResponseFactory.h" +#include "AliMUONSegmentation.h" #include "AliMUONHit.h" #include "AliMUONTriggerCircuit.h" #include "AliMUONGeometryBuilder.h" +#include "AliMUONGeometry.h" +#include "AliMUONGeometryTransformer.h" #include "AliMUONGeometryModule.h" #include "AliMUONGeometrySVMap.h" #include "AliMUONGeometryDetElement.h" @@ -61,8 +64,7 @@ AliMUONv1::AliMUONv1() fTrackPosition(), fElossRatio(0x0), fAngleEffect10(0x0), - fAngleEffectNorma(0x0), - fFactory(0x0) + fAngleEffectNorma(0x0) { // Default constructor AliDebug(1,Form("default (empty) ctor this=%p",this)); @@ -81,8 +83,7 @@ AliMUONv1::AliMUONv1(const char *name, const char *title) fTrackPosition(), fElossRatio(0x0), fAngleEffect10(0x0), - fAngleEffectNorma(0x0), - fFactory(0x0) + fAngleEffectNorma(0x0) { // Standard onstructor @@ -137,7 +138,6 @@ AliMUONv1::~AliMUONv1() delete fElossRatio; delete fAngleEffect10; delete fAngleEffectNorma; - delete fFactory; } //_____________________________________________________________________________ @@ -177,48 +177,51 @@ void AliMUONv1::CreateMaterials() void AliMUONv1::Init() { AliDebug(1,"Start Init for version 1 - CPC chamber type"); - Int_t i; // // Initialize geometry // fGeometryBuilder->InitGeometry(); AliDebug(1,"Finished Init for version 1 - CPC chamber type"); - + + std::string ftype(GetTitle()); - - if ( ftype == "default" || ftype == "AliMUONFactoryV2") - { - fFactory = new AliMUONFactoryV2("New MUON Factory"); - (static_cast(fFactory))->Build(this,"default"); - } - else if ( ftype == "AliMUONFactoryV3" ) - { - fFactory = new AliMUONFactoryV3("New MUON Factory"); - (static_cast(fFactory))->Build(this,"default"); - } - else if ( ftype == "AliMUONFactoryV4" ) - { - fFactory = new AliMUONFactoryV4("New MUON Factory (w/ Trigger)"); - (static_cast(fFactory))->Build(this,"default"); + + // Build segmentation + // using geometry parametrisation + // + if ( ftype == "default" || ftype == "FactoryV2") { + AliMUONSegFactoryV2 segFactory("default"); + segFactory.Build(GetGeometryTransformer()); + fSegmentation = segFactory.GetSegmentation(); + } + else if ( ftype == "FactoryV3" ) { + AliMUONSegFactoryV3 segFactory("default"); + segFactory.Build(GetGeometryTransformer()); + fSegmentation = segFactory.GetSegmentation(); } - else - { - AliFatal(Form("Wrong factory type : %s",ftype.c_str())); - } - + else if ( ftype == "FactoryV4" ) { + AliMUONSegFactoryV4 segFactory("default"); + segFactory.Build(GetGeometryTransformer()); + fSegmentation = segFactory.GetSegmentation(); + } + else { + AliFatal(Form("Wrong factory type : %s",ftype.c_str())); + } + + // Build response // + AliMUONResponseFactory respFactory("default"); + respFactory.Build(this); + + // Initialize segmentation // - - for (i=0; iInit(2);// new segmentation - - - // trigger circuit - // cp - for (i=0; iInit(); + + // Initialize trigger circuits + // + for (Int_t i=0; iAt(i)); c->Init(i); // c->Print(); @@ -234,12 +237,10 @@ Int_t AliMUONv1::GetChamberId(Int_t volId) const // if not sensitive volume - return 0. // --- -/* - for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++) - if (volId==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()) return i; -*/ - for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++) - if ( ((AliMUONChamber*)(*fChambers)[i-1])->IsSensId(volId) ) return i; + for (Int_t i = 0; i < AliMUONConstants::NCh(); i++) { + if ( GetGeometry()->GetModule(i)->IsSensitiveVolume(volId) ) + return i+1; + } return 0; } @@ -387,11 +388,11 @@ void AliMUONv1::StepManager() } // Detection elements ids - AliMUONGeometryModule* geometry - = Chamber(iChamber-1).GetGeometry(); + const AliMUONGeometryModule* kGeometryModule + = GetGeometry()->GetModule(iChamber-1); AliMUONGeometryDetElement* detElement - = geometry->FindBySensitiveVolume(CurrentVolumePath()); + = kGeometryModule->FindBySensitiveVolume(CurrentVolumePath()); Int_t detElemId = 0; if (detElement) detElemId = detElement->GetUniqueID(); @@ -547,11 +548,11 @@ void AliMUONv1::StepManager2() } // Detection elements ids - AliMUONGeometryModule* geometry - = Chamber(iChamber-1).GetGeometry(); + const AliMUONGeometryModule* kGeometryModule + = GetGeometry()->GetModule(iChamber-1); AliMUONGeometryDetElement* detElement - = geometry->FindBySensitiveVolume(CurrentVolumePath()); + = kGeometryModule->FindBySensitiveVolume(CurrentVolumePath()); Int_t detElemId = 0; if (detElement) detElemId = detElement->GetUniqueID(); diff --git a/MUON/AliMUONv1.h b/MUON/AliMUONv1.h index 1d4210d24cd..5377fcf2900 100644 --- a/MUON/AliMUONv1.h +++ b/MUON/AliMUONv1.h @@ -67,8 +67,6 @@ class AliMUONv1 : public AliMUON TF1 * fElossRatio; // Ratio of particle mean eloss with respect MIP's TF1 * fAngleEffect10; // Angle effect in tracking chambers at theta =10 degres as a function of ElossRatio (Khalil BOUDJEMLINE sep 2003 Ph.D Thesis) (in micrometers) TF1 * fAngleEffectNorma;// Angle effect: Normalisation form theta=10 degres to theta between 0 and 10 (Khalil BOUDJEMLINE sep 2003 Ph.D Thesis) - - TObject* fFactory; //! to build segmentation (temporary, should not be needed with new segmentation scheme and its manager) ClassDef(AliMUONv1,4) // MUON Detector class Version 1 }; -- 2.43.0