#include <TGeometry.h>
#include <TMarker3DBox.h>
#include <TParticle.h>
+#include <TPolyLine3D.h>
#include "AliMUONDisplay.h"
#include "AliRun.h"
#include "AliMUONTrack.h"
#include "AliMUONTrackParam.h"
-#include "AliSegmentation.h"
-#include "AliMUONResponse.h"
+#include "AliMUONGeometrySegmentation.h"
#include "AliMUONChamber.h"
#include "AliMUONConstants.h"
#include "AliMC.h"
text->SetTextSize(0.2);
text->SetTextAlign(22);
- AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
- AliMUONChamber *iChamber = &(pMUON->Chamber(fChamber-1));
- AliMUONResponse * response=iChamber->ResponseModel();
- Int_t adcmax=1024;
- if (response) adcmax = (Int_t) response->MaxAdc();
+
+ Int_t adcmax=4096; // default 12 bits ADC
+
TBox *box;
void AliMUONDisplay::DrawSegmentation()
{
+ // to be re-written for new seg
// Draw graphical representation of segmenatation
// Attention: still experimental code
- Int_t icat=1;
+// Int_t icat=1;
- AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
- AliMUONChamber* iChamber;
- AliSegmentation* seg;
- iChamber = &(pMUON->Chamber(fChamber));
- seg=iChamber->SegmentationModel(icat);
- Float_t zpos=iChamber->Z();
- Float_t r=iChamber->ROuter();
+// AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
+// AliMUONChamber* iChamber;
+
+// AliSegmentation* seg;
+// iChamber = &(pMUON->Chamber(fChamber));
+// seg=iChamber->SegmentationModel(icat);
+
+// Float_t zpos=iChamber->Z();
+// Float_t r=iChamber->ROuter();
- TMarker3DBox *marker;
- if (icat == 1) {
- for (Int_t j=0; j<seg->Npy(); j++) {
- Float_t y0;
- y0=j*seg->Dpy()-seg->Dpy()/2.;
- for (seg->FirstPad(0.,y0,0,300,0.);
- seg->MorePads();
- seg->NextPad())
- {
- if (seg->ISector()==0) continue;
- Float_t x,y,z;
- seg->GetPadC(seg->Ix(), seg->Iy(), x, y, z);
- Float_t dpx=seg->Dpx(seg->ISector())/2;
- Float_t dpy=seg->Dpy(seg->ISector())/2;
- marker=new TMarker3DBox(x,y,zpos,dpx,dpy,0,0,0);
- marker->SetLineColor(seg->ISector()+1);
- marker->SetFillStyle(1001);
- marker->SetFillColor(0);
- marker->Draw();
- }
- }
- } else {
- for (Int_t j=0; j<250; j++) {
- Float_t x0=j*seg->Dpx();
- Float_t y0=TMath::Sqrt(r*r-x0*x0);
+// TMarker3DBox *marker;
+// if (icat == 1) {
+// for (Int_t j=0; j<seg->Npy(); j++) {
+// Float_t y0;
+// y0=j*seg->Dpy()-seg->Dpy()/2.;
+// for (seg->FirstPad(0.,y0,0,300,0.);
+// seg->MorePads();
+// seg->NextPad())
+// {
+// if (seg->ISector()==0) continue;
+// Float_t x,y,z;
+// seg->GetPadC(seg->Ix(), seg->Iy(), x, y, z);
+// Float_t dpx=seg->Dpx(seg->ISector())/2;
+// Float_t dpy=seg->Dpy(seg->ISector())/2;
+// marker=new TMarker3DBox(x,y,zpos,dpx,dpy,0,0,0);
+// marker->SetLineColor(seg->ISector()+1);
+// marker->SetFillStyle(1001);
+// marker->SetFillColor(0);
+// marker->Draw();
+// }
+// }
+// } else {
+// for (Int_t j=0; j<250; j++) {
+// Float_t x0=j*seg->Dpx();
+// Float_t y0=TMath::Sqrt(r*r-x0*x0);
- for (seg->FirstPad(x0,0,0,0,y0);
- seg->MorePads();
- seg->NextPad())
- {
- if (seg->ISector()==0) continue;
+// for (seg->FirstPad(x0,0,0,0,y0);
+// seg->MorePads();
+// seg->NextPad())
+// {
+// if (seg->ISector()==0) continue;
- Float_t x,y,z;
- seg->GetPadC(seg->Ix(), seg->Iy(), x, y, z);
- Float_t dpx=seg->Dpx(seg->ISector())/2;
- Float_t dpy=seg->Dpy(seg->ISector())/2;
- marker=new TMarker3DBox(x,y,zpos,dpx,dpy,0,0,0);
- marker->SetLineColor(seg->ISector()+1);
- marker->SetFillStyle(1001);
- marker->SetFillColor(0);
- marker->Draw();
- }
- }
- }
-}
+// Float_t x,y,z;
+// seg->GetPadC(seg->Ix(), seg->Iy(), x, y, z);
+// Float_t dpx=seg->Dpx(seg->ISector())/2;
+// Float_t dpy=seg->Dpy(seg->ISector())/2;
+// marker=new TMarker3DBox(x,y,zpos,dpx,dpy,0,0,0);
+// marker->SetLineColor(seg->ISector()+1);
+// marker->SetFillStyle(1001);
+// marker->SetFillColor(0);
+// marker->Draw();
+// }
+// }
+// }
+ }
//_____________________________________________________________________________
void AliMUONDisplay::DrawClusters()
void AliMUONDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi)
{
// Draw a view of MUON clusters
- printf("\n Draw View\n");
+ AliInfo(" Draw View");
gPad->SetCursor(kWatch);
// gPad->SetFillColor(39);
AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
AliMUONChamber* iChamber;
- AliSegmentation* segmentation;
- AliMUONResponse* response;
-
+ AliMUONGeometrySegmentation* segmentation2 = 0x0;
+
GetMUONData()->SetTreeAddress("D");
TClonesArray *muonDigits = GetMUONData()->Digits(chamber-1);
if (GetLoader()->TreeD()) {
nent = (Int_t) GetLoader()->TreeD()->GetEntries();
// gAlice->TreeD()->GetEvent(nent-2+cathode-1);
- GetMUONData()->GetCathode(cathode-1);
+ GetMUONData()->GetDigits();
}
Int_t ndigits = muonDigits->GetEntriesFast();
iChamber = &(pMUON->Chamber(chamber-1));
- segmentation = iChamber->SegmentationModel(cathode);
- response = iChamber->ResponseModel();
+ segmentation2 = iChamber->SegmentationModel2(cathode);
+
Float_t zpos = iChamber->Z();
AliMUONDigit *mdig;
//loop over all digits and store their position
Int_t npoints = 1;
- Float_t adcmax = 1024;
- if (response&&chamber<11) adcmax = response->MaxAdc();
+ Float_t adcmax = 1024; // default
+ if (chamber<11) adcmax = 4096;
for (Int_t digit = 0; digit < ndigits; digit++) {
mdig = (AliMUONDigit*)muonDigits->UncheckedAt(digit);
// get the center of the pad - add on x and y half of pad size
Float_t xpad, ypad, zpad;
- segmentation->GetPadC(mdig->PadX(), mdig->PadY(), xpad, ypad, zpad);
+ Int_t isec;
+ Float_t dpx, dpy;
+
+ Int_t detElemId = mdig->DetElemId();
+ segmentation2->GetPadC(detElemId, mdig->PadX(), mdig->PadY(), xpad, ypad, zpad);
+ isec = segmentation2->Sector(detElemId, mdig->PadX(), mdig->PadY());
+ dpx = segmentation2->Dpx(detElemId, isec)/2;
+ dpy = segmentation2->Dpy(detElemId, isec)/2;
- Int_t isec = segmentation->Sector(mdig->PadX(), mdig->PadY());
- Float_t dpx = segmentation->Dpx(isec)/2;
- Float_t dpy = segmentation->Dpy(isec)/2;
//
// segmentation->Dump();