/** CbmMuchSectorRadial.cxx *@author E.Kryshen *@since 6.02.12 *@version 1.0 ** ** This class describes the digitization scheme for a ring of pads ** **/ #include "CbmMuchSectorRadial.h" #include "CbmMuchGeoScheme.h" #include "CbmMuchPad.h" #include "CbmMuchPadRadial.h" #include "CbmMuchModuleGemRadial.h" #include "TCrown.h" #include "TMath.h" // ----- Default constructor ------------------------------------------- CbmMuchSectorRadial::CbmMuchSectorRadial() : CbmMuchSector(), fR1(0.), fR2(0.), fPhi1(0.), fPhi2(0.), fPadDphi(0.) { } // ------------------------------------------------------------------------- // ----- Standard constructor -------------------------------------------- CbmMuchSectorRadial::CbmMuchSectorRadial(Int_t detId, Int_t secId, Double_t r1, Double_t r2, Double_t phi1, Double_t phi2) : CbmMuchSector(detId,secId,0), fR1(r1), fR2(r2), fPhi1(0.), fPhi2(0.), fPadDphi((r2-r1)/r1) { if (phi2TMath::Pi() && phifPhi2) return -1; return TMath::Floor((phi-fPhi1)/fPadDphi); } // ------------------------------------------------------------------------- // ----- Public method GetChannel -------------------------------------- CbmMuchPadRadial* CbmMuchSectorRadial::GetPadByPhi(Double_t phi) { Int_t i = GetPadIndexByPhi(phi); // printf("i=%i\n",i); if (i==-1) return NULL; return (CbmMuchPadRadial*) GetPadByChannelIndex(i); } // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- void CbmMuchSectorRadial::AddPads(){ for(Int_t iChannel = 0; iChannel < fNChannels; iChannel++){ Long64_t channelId = CbmMuchModuleGem::GetChannelId(fSectorId,iChannel); Double_t r1,r2,phi1,phi2; r1 = fR1; r2 = fR2; phi1 = fPhi1+iChannel*fPadDphi; phi2 = phi1+fPadDphi; CbmMuchPad* pad = new CbmMuchPadRadial(fDetectorId,channelId,r1,r2,phi1,phi2); fPads.push_back(pad); } } // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- void CbmMuchSectorRadial::DrawPads(){ for(Int_t iChannel = 0; iChannel < fNChannels; iChannel++){ CbmMuchPadRadial* pad = (CbmMuchPadRadial*) fPads[iChannel]; pad->DrawPad(); // pad->Draw(); } } // ------------------------------------------------------------------------- ClassImp(CbmMuchSectorRadial)