/* $Id$ */
-//////////////////////////////////////////////////////////////////////////
-// //
-// AliDisplay //
-// //
-// Utility class to display ALICE outline, tracks, hits,.. //
-// //
-//////////////////////////////////////////////////////////////////////////
+/// \class AliMUONDisplay
+/// Create an event display object.
+/// A canvas named "edisplay" is created with a vertical size in pixels \n
+///
+/// A QUICK Overview of the Event Display functions \n
+/// =============================================== \n
+///
+/// The event display can ve invoked by executing the macro "display.C" \n
+/// A canvas like in the picture below will appear.
+///
+/// On the left side of the canvas, the following buttons appear:
+/// - *Next* to move to the next event
+/// - *Previous* to move to the previous event
+/// - *Pick* Select this option to be able to point on a track with the
+/// mouse. Once on the track, use the right button to select
+/// an action. For example, select SetMarkerAttributes to
+/// change the marker type/color/size for the track.
+/// - *Zoom* Select this option (default) if you want to zoom.
+/// To zoom, simply select the selected area with the left button.
+/// - *UnZoom* To revert to the previous picture size.
+///
+/// - slider R On the left side, the vertical slider can be used to
+/// set the default picture size.
+///
+/// When you are in Zoom mode, you can click on the black part of the canvas
+/// to select special options with the right mouse button.
+///
+/// When you are in pick mode, you can "Inspect" the object pointed by the mouse.
+/// When you are on a track, select the menu item "InspectParticle"
+/// to display the current particle attributes.
+///
+/// You can activate the Root browser by selecting the Inspect menu
+/// in the canvas tool bar menu. Then select "Start Browser"
+/// This will open a new canvas with the browser. At this point, you may want
+/// to display some histograms (from the Trees). Go to the "File" menu
+/// of the browser and click on "New canvas".
+/// In the browser, click on item "ROOT files" in the left pane.
+/// Click on galice.root.
+/// Click on TH
+/// Click on TPC for example
+/// Click on any variable (eg TPC.fX) to histogram the variable.
+///
+/// If you are lost, you can click on HELP in any Root canvas or browser.
+
+//Begin_Html
+/*
+<img src="gif/AliMUONDisplay.gif">
+*/
+//End_Html
+
+#include "AliMUONDisplay.h"
+#include "AliMUON.h"
+#include "AliMUONPoints.h"
+#include "AliMUONGlobalTrigger.h"
+#include "AliMUONHit.h"
+#include "AliMUONDigit.h"
+#include "AliMUONRawCluster.h"
+#include "AliMUONTrack.h"
+#include "AliMUONTrackParam.h"
+#include "AliMUONGeometryTransformer.h"
+#include "AliMUONSegmentation.h"
+#include "AliMUONGeometrySegmentation.h"
+#include "AliMUONConstants.h"
+#include "AliMUONTriggerSegmentation.h"
+
+#include "AliMpDEIterator.h"
+#include "AliMpSegmentation.h"
+#include "AliMpSlatSegmentation.h"
+#include "AliMpSlat.h"
+#include "AliMpSectorSegmentation.h"
+#include "AliMpSector.h"
+#include "AliMpTriggerSegmentation.h"
+#include "AliMpTrigger.h"
+#include "AliMpStationType.h"
+#include "AliMpDEManager.h"
+
+#include "AliMC.h"
+#include "AliLog.h"
+#include "AliRun.h"
+#include "AliHeader.h"
#include <TButton.h>
#include <TColor.h>
#include <TMarker3DBox.h>
#include <TParticle.h>
#include <TPolyLine3D.h>
+#include <TBox.h>
-#include "AliMUONDisplay.h"
-#include "AliRun.h"
-#include "AliMUON.h"
-#include "AliMUONPoints.h"
-#include "AliMUONGlobalTrigger.h"
-#include "AliHeader.h"
-
-#include "AliMUONHit.h"
-#include "AliMUONDigit.h"
-#include "AliMUONRawCluster.h"
-#include "AliMUONTrack.h"
-#include "AliMUONTrackParam.h"
-
-#include "AliMUONGeometrySegmentation.h"
-#include "AliSegmentation.h"
-#include "AliMUONChamber.h"
-#include "AliMUONConstants.h"
-#include "AliMC.h"
-#include "AliLog.h"
-// to manage the same zoom on both cathodes
-
-
-
+/// \cond CLASSIMP
ClassImp(AliMUONDisplay)
-
+/// \endcond
//_____________________________________________________________________________
AliMUONDisplay::AliMUONDisplay()
- : AliDisplay()
+ : AliDisplay(),
+ fEvent(0),
+ fChamber(0),
+ fCathode(0),
+ fDrawClusters(kTRUE),
+ fDrawCoG(kTRUE),
+ fDrawTracks(kFALSE),
+ fClustersCuts(0),
+ fColPad(0),
+ fPoints(0),
+ fPhits(0),
+ fRpoints(0),
+ fNextCathode(0),
+ fLoader(0),
+ fMUONData(0)
{
-// Constructor
- fPoints = 0;
- fPhits = 0;
- fRpoints = 0;
- fCanvas = 0;
- fNextCathode = kFALSE;
- fColPad = 0;
+/// Default constructor
}
//_____________________________________________________________________________
AliMUONDisplay::AliMUONDisplay(Int_t size, AliLoader * loader)
- : AliDisplay()
+ : AliDisplay(),
+ fEvent(0),
+ fChamber(1),
+ fCathode(1),
+ fDrawClusters(kTRUE),
+ fDrawCoG(kTRUE),
+ fDrawTracks(kFALSE),
+ fClustersCuts(0),
+ fColPad(0),
+ fPoints(0),
+ fPhits(0),
+ fRpoints(0),
+ fNextCathode(kFALSE),
+ fLoader(loader),
+ fMUONData(0)
+
{
-// Create an event display object.
-// A canvas named "edisplay" is created with a vertical size in pixels
-//
-// A QUICK Overview of the Event Display functions
-// ===============================================
-//
-// The event display can ve invoked by executing the macro "display.C"
-// A canvas like in the picture below will appear.
-//
-// On the left side of the canvas, the following buttons appear:
-// *Next* to move to the next event
-// *Previous* to move to the previous event
-
-// *Pick* Select this option to be able to point on a track with the
-// mouse. Once on the track, use the right button to select
-// an action. For example, select SetMarkerAttributes to
-// change the marker type/color/size for the track.
-// *Zoom* Select this option (default) if you want to zoom.
-// To zoom, simply select the selected area with the left button.
-// *UnZoom* To revert to the previous picture size.
-//
-// slider R On the left side, the vertical slider can be used to
-// set the default picture size.
-//
-// When you are in Zoom mode, you can click on the black part of the canvas
-// to select special options with the right mouse button.
-
-//
-// When you are in pick mode, you can "Inspect" the object pointed by the mouse.
-// When you are on a track, select the menu item "InspectParticle"
-// to display the current particle attributes.
-//
-// You can activate the Root browser by selecting the Inspect menu
-// in the canvas tool bar menu. Then select "Start Browser"
-// This will open a new canvas with the browser. At this point, you may want
-// to display some histograms (from the Trees). Go to the "File" menu
-// of the browser and click on "New canvas".
-// In the browser, click on item "ROOT files" in the left pane.
-// Click on galice.root.
-// Click on TH
-// Click on TPC for example
-// Click on any variable (eg TPC.fX) to histogram the variable.
-//
-// If you are lost, you can click on HELP in any Root canvas or browser.
-//Begin_Html
-/*
-<img src="gif/AliMUONDisplay.gif">
-*/
-//End_Html
-
+/// Standard constructor to create an event display object.
fPad = 0;
// Initialize display default parameters
SetRange(200,2000);
+
// Set front view by default
fTheta = 0;
fPhi = -90;
fPsi = 0;
- fChamber = 1;
- fCathode = 1;
- // fRzone = 1.e10;
- fDrawClusters = kTRUE;
- fDrawCoG = kTRUE;
- fDrawTracks = kFALSE;
fZoomMode = 1;
fZooms = 0;
- fClustersCuts = 0;
- fPoints = 0;
- fPhits = 0;
- fRpoints = 0;
+
// Create colors
CreateColors();
// Create display canvas
fTrigPad->SetEditable(kFALSE);
fButtons->SetEditable(kFALSE);
fCanvas->Update();
- fNextCathode = kFALSE;
- fLoader = loader;
+
// initialize container
if(fLoader)
fMUONData = new AliMUONData(fLoader,"MUON","MUON");
fMUONData =0x0;
}
-AliMUONDisplay::AliMUONDisplay(const AliMUONDisplay & display)
- : AliDisplay(display)
-{
-// Protected copy constructor
-
- AliFatal("Not implemented.");
-}
-
-
-
//_____________________________________________________________________________
AliMUONDisplay::~AliMUONDisplay()
{
+/// Destructor
+
// Delete space point structure
if (fPoints) fPoints->Delete();
delete fPoints;
//_____________________________________________________________________________
void AliMUONDisplay::Clear(Option_t *)
{
-// Delete graphics temporary objects
+/// Delete graphics temporary objects
}
//_____________________________________________________________________________
void AliMUONDisplay::DisplayButtons()
{
-// Create the user interface buttons
+/// Create the user interface buttons
fButtons = new TPad("buttons", "newpad",0,0.45,0.15,1);
//_____________________________________________________________________________
void AliMUONDisplay::CreateColors() const
{
-// Create the colors palette used to display clusters
+/// Create the colors palette used to display clusters
Int_t k,i;
Int_t color;
//_____________________________________________________________________________
void AliMUONDisplay::DisplayColorScale()
{
-// Display pulse height color scale
+/// Display pulse height color scale
+
Int_t i;
Int_t color;
Float_t xlow, ylow, xup, yup, hs;
//______________________________________________________________________________
Int_t AliMUONDisplay::DistancetoPrimitive(Int_t px, Int_t)
{
-// Compute distance from point px,py to objects in event
+/// Compute distance from point px,py to objects in event
gPad->SetCursor(kCross);
//_____________________________________________________________________________
void AliMUONDisplay::Draw(Option_t *)
{
-// Display current event
+/// Display current event
if (!fDrawTracks)
DrawChamber();
//_____________________________________________________________________________
void AliMUONDisplay::DrawChamber()
{
+/// Display current event
fDrawTracks = kFALSE;
fPad->cd();
//_____________________________________________________________________________
void AliMUONDisplay::DrawReco(Option_t *)
{
-// Display current event
+/// Display current event
fDrawTracks = kTRUE;
// print kinematics of generated particles
//_____________________________________________________________________________
void AliMUONDisplay::PrintKinematics()
{
+/// Print kinematic tree
+
AliRunLoader * runLoader;
TParticle *particle = new TParticle();
Int_t nPart;
delete particle;
}
+//_____________________________________________________________________________
void AliMUONDisplay::DrawSegmentation()
{
-// Draw graphical representation of segmenatation
-// Attention: still experimental code
- Int_t icat=1;
+/// \todo to be re-written for new seg
+/// Draw graphical representation of segmenatation
+/// Attention: still experimental code
+// Int_t icat=1;
- AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
- AliMUONChamber* iChamber;
+// AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
+// AliMUONChamber* iChamber;
- AliSegmentation* seg;
- iChamber = &(pMUON->Chamber(fChamber));
- seg=iChamber->SegmentationModel(icat);
+// AliSegmentation* seg;
+// iChamber = &(pMUON->Chamber(fChamber));
+// seg=iChamber->SegmentationModel(icat);
- Float_t zpos=iChamber->Z();
- Float_t r=iChamber->ROuter();
+// 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()
{
-// Draw clusters for MUON chambers
+/// Draw clusters for MUON chambers
Int_t ndigits, digit;
TObjArray *points;
marker->Draw();
}
pm->Draw();
- fClustersCuts +=pm->GetN();
+ fClustersCuts += pm->GetN();
}
}
//_____________________________________________________________________________
void AliMUONDisplay::DrawHits()
{
-// Draw hits for MUON chambers
+/// Draw hits for MUON chambers
LoadHits(fChamber);
//_____________________________________________________________________________
void AliMUONDisplay::DrawCoG()
{
-// Draw hits for MUON chambers
+/// Draw hits for MUON chambers
+
if (!fDrawCoG) return;
if (fChamber > 10) return;
LoadCoG(fChamber,fCathode);
//_____________________________________________________________________________
void AliMUONDisplay::DrawTracks()
{
-// Draw tracks
+/// Draw tracks
+
if (!fDrawTracks) return;
LoadTracks();
void AliMUONDisplay::DrawTitle(Option_t *option)
{
-// Draw the event title
+/// Draw the event title
Float_t xmin = gPad->GetX1();
Float_t xmax = gPad->GetX2();
//_____________________________________________________________________________
void AliMUONDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi)
{
-// Draw a view of MUON clusters
- AliInfo(" Draw View");
-
- gPad->SetCursor(kWatch);
- // gPad->SetFillColor(39);
- gPad->SetFillColor(1);
- gPad->Clear();
- // gPad->SetFillColor(39);
- gPad->SetFillColor(1);
-
+/// Draw a view of MUON clusters
- Int_t iret=0;
- TView *view = new TView(1);
-
- Float_t range = fRrange*fRangeSlider->GetMaximum();
- view->SetRange(-range,-range,-range,range, range, range);
- // zoom back to full scale only if DrawView not called from NextCathode
- if (!fNextCathode) {
- fZoomX0[0] = -1;
- fZoomY0[0] = -1;
- fZoomX1[0] = 1;
- fZoomY1[0] = 1;
- fZooms = 0;
+ AliInfo(" Draw View");
+
+ gPad->SetCursor(kWatch);
+ // gPad->SetFillColor(39);
+ gPad->SetFillColor(1);
+ gPad->Clear();
+ // gPad->SetFillColor(39);
+ gPad->SetFillColor(1);
+
+ Int_t iret=0;
+ TView *view = new TView(1);
+
+ Float_t range = fRrange*fRangeSlider->GetMaximum();
+ view->SetRange(-range,-range,-range,range, range, range);
+ // zoom back to full scale only if DrawView not called from NextCathode
+ if (!fNextCathode) {
+ fZoomX0[0] = -1;
+ fZoomY0[0] = -1;
+ fZoomX1[0] = 1;
+ fZoomY1[0] = 1;
+ fZooms = 0;
+ }
+
+ Float_t xg1, xg2, yg1, yg2, zg1, zg2;
+
+ // Recovering the chamber
+ AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
+
+ const AliMUONGeometryTransformer* kGeomTransformer
+ = pMUON->GetGeometryTransformer();
+
+ AliMUONSegmentation* segmentation = pMUON->GetSegmentation();
+
+ // Display MUON Chamber Geometry
+ char nodeName[7];
+ sprintf(nodeName,"MUON%d",100+fChamber);
+ printf(">>>> chamber is %d\n",fChamber);
+
+ if(fChamber < 5) {
+ AliMpDEIterator it;
+ for ( it.First(fChamber-1); ! it.IsDone(); it.Next() ) {
+
+ Int_t detElemId = it.CurrentDE();
+ AliMpSectorSegmentation * seg =
+ (AliMpSectorSegmentation *) AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, 0);
+ const AliMpSector * sector = seg->GetSector();
+
+ // get sector measurements
+ TVector2 position = sector->Position();
+ TVector2 dimension = sector->Dimensions(); // half length
+
+ Float_t xlocal1 = position.Px(); // FIXME: not really needed as it's 0 ?
+ Float_t ylocal1 = position.Py(); // FIXME: not really needed as it's 0 ?
+ Float_t xlocal2 = dimension.Px() * 2.;
+ Float_t ylocal2 = dimension.Px() * 2.;
+
+ kGeomTransformer->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1);
+ kGeomTransformer->Local2Global(detElemId, xlocal2, ylocal2, 0, xg2, yg2, zg2);
+
+ // drawing
+ TPolyLine3D* poly = new TPolyLine3D();
+ Int_t nPoint = 0;
+
+ poly->SetPoint(nPoint++, xg1, yg1, 0.);
+ for (Float_t d = 0; d < TMath::Pi()/2.; d+= 0.01) {
+ Float_t x = xg1 + xg2 * TMath::Cos(d);
+ Float_t y = yg1 + yg2 * TMath::Sin(d);
+ poly->SetPoint(nPoint++, x, y, 0.);
+ }
+ poly->SetPoint(nPoint++, xg1, yg1, 0.);
+
+ poly->SetLineColor(2);
+ poly->Draw("s");
}
-
-// Display MUON Chamber Geometry
- char nodeName[7];
- sprintf(nodeName,"MUON%d",100+fChamber);
- TNode *node1=gAlice->GetGeometry()->GetNode(nodeName);
- if (node1) node1->Draw("same");
-//add clusters to the pad
- DrawClusters();
- DrawHits();
- DrawCoG();
-// DrawSegmentation();
- // add itself to the list (must be last)
- AppendPad();
- view->SetView(phi, theta, psi, iret);
+ }
+
+ if (fChamber>4)
+ {
+ AliMpDEIterator it;
+ for ( it.First(fChamber-1); ! it.IsDone(); it.Next() )
+ {
+ Int_t detElemId = it.CurrentDE();
+ AliMpStationType stationType = AliMpDEManager::GetStationType(detElemId);
+
+ if ( segmentation->HasDE(detElemId) )
+ {
+ const AliMpVSegmentation* seg
+ = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, 0);
+ if (seg)
+ {
+ Float_t deltax = seg->Dimensions().X();
+ Float_t deltay = seg->Dimensions().Y();
+ 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( stationType == kStationTrigger ? 4 : 2);
+ box->Draw("s");
+
+ if ( stationType == kStation345 )
+ {
+ // 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");
+ }
+ }
+ }
+ }
+ }
+
+ //add clusters to the pad
+ DrawClusters();
+ DrawHits();
+ DrawCoG();
+ // DrawSegmentation();
+ // add itself to the list (must be last)
+ AppendPad();
+ view->SetView(phi, theta, psi, iret);
}
//_____________________________________________________________________________
void AliMUONDisplay::DrawGlobalView(Float_t theta, Float_t phi, Float_t psi)
{
-// Draw a view of muons chambers with tracks
+/// Draw a view of muons chambers with tracks
gPad->SetCursor(kWatch);
// gPad->SetFillColor(39);
//______________________________________________________________________________
void AliMUONDisplay::ExecuteEvent(Int_t event, Int_t px, Int_t py)
{
-// Execute action corresponding to the mouse event
+/// Execute action corresponding to the mouse event
static Float_t x0, y0, x1, y1;
//___________________________________________
void AliMUONDisplay::LoadDigits(Int_t chamber, Int_t cathode)
{
-// Read digits info and store x,y,z info in arrays fPoints
-// Loop on all detectors
+/// Read digits info and store x,y,z info in arrays fPoints.
+/// Loop on all detectors
if (chamber > 14) return;
fChamber = chamber;
ResetPoints();
AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
- AliMUONChamber* iChamber;
- AliSegmentation* segmentation = 0x0;
- AliMUONGeometrySegmentation* segmentation2 = 0x0;
GetMUONData()->SetTreeAddress("D");
gAlice->ResetDigits();
Int_t nent = 0;
- if (GetLoader()->TreeD()) {
- nent = (Int_t) GetLoader()->TreeD()->GetEntries();
- // gAlice->TreeD()->GetEvent(nent-2+cathode-1);
- GetMUONData()->GetCathode(cathode-1);
+ if (GetLoader()->TreeD()) {
+ nent = (Int_t) GetLoader()->TreeD()->GetEntries();
+ // gAlice->TreeD()->GetEvent(nent-2+cathode-1);
+ GetMUONData()->GetDigits();
}
- Int_t ndigits = muonDigits->GetEntriesFast();
+ Int_t ndigits = muonDigits->GetEntriesFast();
if (ndigits == 0) return;
if (fPoints == 0) fPoints = new TObjArray(ndigits);
- iChamber = &(pMUON->Chamber(chamber-1));
-
- if (pMUON->WhichSegmentation()==1)
- segmentation = iChamber->SegmentationModel(cathode);
- else
- segmentation2 = iChamber->SegmentationModel2(cathode);
-
- Float_t zpos = iChamber->Z();
+ Float_t zpos = AliMUONConstants::DefaultChamberZ(chamber-1);
AliMUONDigit *mdig;
AliMUONPoints *points = 0;
TMarker3DBox *marker = 0;
- //
- //loop over all digits and store their position
-
+
Int_t npoints = 1;
Float_t adcmax = 1024; // default
if (chamber<11) adcmax = 4096;
- for (Int_t digit = 0; digit < ndigits; digit++) {
- mdig = (AliMUONDigit*)muonDigits->UncheckedAt(digit);
- if (mdig->Cathode() != cathode-1) continue;
-
- //
- // First get all needed parameters
- //
- Int_t charge = mdig->Signal();
- Int_t index = Int_t(TMath::Log(charge)/(TMath::Log(adcmax)/22));
- Int_t color = 261+index;
- Int_t colorTrigger = 2;
- if (color > 282) color = 282;
-
- if (chamber > 10) { // trigger chamber
-
- Int_t sumCharge = 0;
- for (Int_t icharge = 0; icharge < 10; icharge++) {
- sumCharge = sumCharge+mdig->TrackCharge(icharge);
+// check if trigger is using new or old segmentation
+ Bool_t old = true;
+ AliMUONSegmentation* segmentation = pMUON->GetSegmentation();
+ const AliMUONVGeometryDESegmentation* kdeSegmentation
+ = segmentation->GetDESegmentation(1100, cathode-1);
+ if ( dynamic_cast<const AliMUONTriggerSegmentation*>(kdeSegmentation) ) old = false;
+
+ if ( old && chamber > 10) {
+ if (chamber > 10) printf(">>> old segmentation for trigger \n");
+ else printf(">>> old segmentation for tracking \n");
+
+ for (Int_t digit = 0; digit < ndigits; digit++) {
+ mdig = (AliMUONDigit*)muonDigits->UncheckedAt(digit);
+ if (mdig->Cathode() != cathode-1) continue;
+
+ //
+ // First get all needed parameters
+ //
+ Float_t charge = mdig->Signal();
+ Int_t index = Int_t(TMath::Log(charge)/(TMath::Log(adcmax)/22));
+ Int_t color = 261+index;
+ Int_t colorTrigger = 2;
+ if (color > 282) color = 282;
+
+ if (chamber > 10) { // trigger chamber
+
+ Float_t sumCharge = 0;
+ for (Int_t icharge = 0; icharge < 10; icharge++) {
+ sumCharge = sumCharge+mdig->TrackCharge(icharge);
+ }
+ Float_t testCharge = sumCharge-(Int_t(sumCharge/10))*10;
+ if(sumCharge <= 10 || testCharge > 0) {
+ colorTrigger = color;
+ } else {
+ colorTrigger = 5;
+ }
}
- Int_t testCharge = sumCharge-(Int_t(sumCharge/10))*10;
- if(sumCharge <= 10 || testCharge > 0) {
- colorTrigger = color;
- } else {
- colorTrigger = 5;
+
+ // get the center of the pad - add on x and y half of pad size
+ Float_t xpad, ypad, zpad;
+ Int_t isec;
+ Float_t dpx, dpy;
+
+ Int_t detElemId = mdig->DetElemId();
+ AliMUONGeometrySegmentation* segmentation2
+ = pMUON->GetSegmentation()->GetModuleSegmentationByDEId(detElemId, cathode-1);
+ 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;
+
+ // Then set the objects
+ points = new AliMUONPoints(npoints);
+ fPoints->AddAt(points,digit);
+ if (chamber > 10) {
+ points->SetMarkerColor(colorTrigger);
+ } else {
+ points->SetMarkerColor(color);
}
- }
-
- // get the center of the pad - add on x and y half of pad size
- Float_t xpad, ypad, zpad;
- Int_t isec;
- Float_t dpx, dpy;
-
- if (pMUON->WhichSegmentation()==1) {
- segmentation->GetPadC(mdig->PadX(), mdig->PadY(), xpad, ypad, zpad);
- isec = segmentation->Sector(mdig->PadX(), mdig->PadY());
- dpx = segmentation->Dpx(isec)/2;
- dpy = segmentation->Dpy(isec)/2;
- } else {
- 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;
- }
-//
-// segmentation->Dump();
+ points->SetMarkerStyle(21);
+ points->SetMarkerSize(0.5);
+ points->SetParticle(-1);
+ points->SetHitIndex(-1);
+ points->SetTrackIndex(-1);
+ points->SetDigitIndex(digit);
+ points->SetPoint(0,xpad,ypad,zpos);
+
+ Int_t lineColor = (zpad-zpos > 0) ? 2:3;
+ marker=new TMarker3DBox(xpad,ypad,zpos,dpx,dpy,0,0,0);
+
+
+ marker->SetLineColor(lineColor);
+ marker->SetFillStyle(1001);
+ marker->SetFillColor(color);
+ marker->SetRefObject((TObject*)points);
+ points->Set3DMarker(0, marker);
+ } // end loop on digits
- //
- // Then set the objects
- //
- points = new AliMUONPoints(npoints);
- fPoints->AddAt(points,digit);
- if (chamber > 10) {
- points->SetMarkerColor(colorTrigger);
- } else {
- points->SetMarkerColor(color);
- }
- points->SetMarkerStyle(21);
- points->SetMarkerSize(0.5);
- points->SetParticle(-1);
- points->SetHitIndex(-1);
- points->SetTrackIndex(-1);
- points->SetDigitIndex(digit);
- points->SetPoint(0,xpad,ypad,zpos);
+ } else {
+ if (chamber > 10) printf(">>> new segmentation for trigger \n");
+ else printf(">>> new segmentation for tracking \n");
- Int_t lineColor = (zpad-zpos > 0) ? 2:3;
- marker=new TMarker3DBox(xpad,ypad,zpos,dpx,dpy,0,0,0);
-
+ const AliMUONGeometryTransformer* kGeomTransformer
+ = pMUON->GetGeometryTransformer();
+
+ //loop over all digits and store their position
+ for (Int_t digit = 0; digit < ndigits; digit++) {
+ mdig = (AliMUONDigit*)muonDigits->UncheckedAt(digit);
+ if (mdig->Cathode() != cathode-1) continue;
- marker->SetLineColor(lineColor);
- marker->SetFillStyle(1001);
- marker->SetFillColor(color);
- marker->SetRefObject((TObject*)points);
- points->Set3DMarker(0, marker);
- }
+ // get all needed parameters
+ Int_t ix=mdig->PadX();
+ Int_t iy=mdig->PadY();
+ Int_t detElemId=mdig->DetElemId();
+ Float_t charge = mdig->Signal();
+ Int_t index = Int_t(TMath::Log(charge)/(TMath::Log(adcmax)/22));
+ Int_t color = 261+index;
+ Int_t colorTrigger = 2;
+ if (color > 282) color = 282;
+
+ const AliMpVSegmentation* seg =
+ AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,cathode-1);
+
+ AliMpPad pad = seg->PadByIndices(AliMpIntPair(ix,iy),kTRUE);
+
+ if (chamber > 10) { // trigger chamber
+ Float_t sumCharge = 0;
+ Int_t n = mdig->Ntracks();
+ for (Int_t icharge = 0; icharge < n; icharge++) {
+ sumCharge = sumCharge+mdig->TrackCharge(icharge);
+ }
+ Float_t testCharge = sumCharge-(Int_t(sumCharge/n))*n;
+ if(sumCharge <= n || testCharge > 0) {
+ colorTrigger = color;
+ } else {
+ colorTrigger = 5;
+ }
+ }
+
+ // get the pad position and dimensions
+ Float_t xlocal1 = pad.Position().X();
+ Float_t ylocal1 = pad.Position().Y();
+ Float_t xlocal2 = pad.Dimensions().X();
+ Float_t ylocal2 = pad.Dimensions().Y();
+
+ Float_t xg1, xg2, yg1, yg2, zg1;
+
+ kGeomTransformer->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1);
+ // (no transformation for pad dimensions)
+ xg2 = xlocal2;
+ yg2 = ylocal2;
+
+ // Then set the objects
+ points = new AliMUONPoints(npoints);
+ fPoints->AddAt(points,digit);
+ if (chamber > 10) {
+ points->SetMarkerColor(colorTrigger);
+ } else {
+ points->SetMarkerColor(color);
+ }
+ points->SetMarkerStyle(21);
+ points->SetMarkerSize(0.5);
+ points->SetParticle(-1);
+ points->SetHitIndex(-1);
+ points->SetTrackIndex(-1);
+ points->SetDigitIndex(digit);
+ points->SetPoint(0,xg1,yg1,zpos);
+
+ Int_t lineColor = (zg1-zpos > 0) ? 2:3;
+ marker=new TMarker3DBox(xg1,yg1,zpos,xg2,yg2,0,0,0);
+
+ marker->SetLineColor(lineColor);
+ marker->SetFillStyle(1001);
+ marker->SetFillColor(color);
+ marker->SetRefObject((TObject*)points);
+ points->Set3DMarker(0, marker);
+
+ } // end loop on digits
+ } // end of new segmentation
}
//___________________________________________
void AliMUONDisplay::LoadCoG(Int_t chamber, Int_t /*cathode*/)
{
-// Read raw clusters info and store x,y,z info in arrays fRpoints
-// Loop on all detectors
+/// Read raw clusters info and store x,y,z info in arrays fRpoints.
+/// Loop on all detectors
if (chamber > 10) return;
ResetRpoints();
- AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
- AliMUONChamber* iChamber;
-
GetMUONData()->SetTreeAddress("RC");
TClonesArray *muonRawClusters = GetMUONData()->RawClusters(chamber-1);
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;
//
//___________________________________________
void AliMUONDisplay::LoadTracks()
{
-// Load tracks
+/// Load tracks
+
AliMUONTrack* recTrack = 0;
AliMUONTrackParam* trackParam = 0;
TClonesArray * trackParamAtHit = 0;
}
+//___________________________________________
void AliMUONDisplay::PrintTrack(Int_t iRecTracks, AliMUONTrack *recTrack)
{
+/// Print reconstructed track
+
AliMUONTrackParam *trackParam;
Float_t vertex[3], momentum[3];
Float_t pYZ, bendingSlope, nonBendingSlope, chi2dof;
//___________________________________________
void AliMUONDisplay::LoadHits(Int_t chamber)
{
- // Read hits info and store x,y,z info in arrays fPhits
- // Loop on all detectors
+/// Read hits info and store x,y,z info in arrays fPhits.
+/// Loop on all detectors
if (chamber > 14) return;
Int_t track;
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");
//_____________________________________________________________________________
void AliMUONDisplay::Paint(Option_t *)
{
-// Paint miscellaneous items
+/// Paint miscellaneous items
}
//_____________________________________________________________________________
void AliMUONDisplay::SetPickMode()
{
-// Set parameters for pick mode.
-//
+/// Set parameters for pick mode.
+
fZoomMode = 0;
fArcButton->SetY1(fPickButton->GetYlowNDC()+0.5*fPickButton->GetHNDC());
//_____________________________________________________________________________
void AliMUONDisplay::SetZoomMode()
{
-// Set parameters for zoom mode
+/// Set parameters for zoom mode
+
fZoomMode = 1;
fArcButton->SetY1(fZoomButton->GetYlowNDC()+0.5*fZoomButton->GetHNDC());
//_____________________________________________________________________________
void AliMUONDisplay::NextChamber(Int_t delta)
{
- // to go from chamber to next chamber if delta = 1
- // or previous chamber otherwise
+/// To go from chamber to next chamber if delta = 1
+/// or previous chamber otherwise
if (delta == 1) {
if (fChamber < AliMUONConstants::NCh()) fChamber++;
} else {
//_____________________________________________________________________________
void AliMUONDisplay::NextCathode()
{
- // to switch to other cathode plane
+/// To switch to other cathode plane
+
if (!fPad) return;
fPad->Clear();
if (fCathode == 1) {
//_____________________________________________________________________________
void AliMUONDisplay::Trigger()
{
+/// Print global trigger output
AliMUONGlobalTrigger* globalTrig;
globalTrig = (AliMUONGlobalTrigger*)GetMUONData()->GlobalTrigger()->UncheckedAt(0);
if (globalTrig == 0) return;
- printf("===================================================\n");
- printf(" Global Trigger output Low pt High pt All\n");
-
- printf(" number of Single Plus :\t");
- printf("%i\t",globalTrig->SinglePlusLpt());
- printf("%i\t",globalTrig->SinglePlusHpt());
- printf("%i\t",globalTrig->SinglePlusApt());
- printf("\n");
-
- printf(" number of Single Minus :\t");
- printf("%i\t",globalTrig->SingleMinusLpt());
- printf("%i\t",globalTrig->SingleMinusHpt());
- printf("%i\t",globalTrig->SingleMinusApt());
- printf("\n");
-
- printf(" number of Single Undefined :\t");
- printf("%i\t",globalTrig->SingleUndefLpt());
- printf("%i\t",globalTrig->SingleUndefHpt());
- printf("%i\t",globalTrig->SingleUndefApt());
- printf("\n");
-
- printf(" number of UnlikeSign pair :\t");
- printf("%i\t",globalTrig->PairUnlikeLpt());
- printf("%i\t",globalTrig->PairUnlikeHpt());
- printf("%i\t",globalTrig->PairUnlikeApt());
- printf("\n");
-
- printf(" number of LikeSign pair :\t");
- printf("%i\t",globalTrig->PairLikeLpt());
- printf("%i\t",globalTrig->PairLikeHpt());
- printf("%i\t",globalTrig->PairLikeApt());
- printf("\n");
- printf("===================================================\n");
- printf("\n");
-
+ globalTrig->Print("full");
// // returns Trigger Decision for current event
// AliMUONTriggerDecision* decision= new AliMUONTriggerDecision(GetLoader(),1);
//_____________________________________________________________________________
void AliMUONDisplay::SetChamberAndCathode(Int_t chamber, Int_t cathode)
{
-// Set chamber and cathode number
+/// Set chamber and cathode number
+
fChamber = chamber;
fCathode = cathode;
DrawChamber();
}
+//_____________________________________________________________________________
void AliMUONDisplay::SetEvent(Int_t newevent)
{
-// Chose event
+/// Chose event
+
gAlice->GetEvent(newevent);
fEvent=newevent;
if (!gAlice->TreeD()) return;
//_____________________________________________________________________________
void AliMUONDisplay::SetRange(Float_t rrange, Float_t zrange)
{
-// Set view range along R and Z
+/// Set view range along R and Z
+
fRrange = rrange;
fZrange = zrange;
//_____________________________________________________________________________
void AliMUONDisplay::SetView(Float_t theta, Float_t phi, Float_t psi)
{
-// change viewing angles for current event
+/// Change viewing angles for current event
fPad->cd();
fPhi = phi;
//_____________________________________________________________________________
void AliMUONDisplay::ShowNextEvent(Int_t delta)
{
+/// Display (current event_number + delta)
+/// - delta = 1 shown next event
+/// - delta = -1 show previous event
+
AliRunLoader * runLoader;
if (fLoader)
runLoader = fLoader->GetRunLoader();
else
runLoader = 0x0;
-// Display (current event_number + delta)
-// delta = 1 shown next event
-// delta = -1 show previous event
if (delta) {
//runLoader->CleanDetectors();
//runLoader->CleanKinematics();
//______________________________________________________________________________
void AliMUONDisplay::UnZoom()
{
-// Unzoom
+/// Unzoom
+
if (fZooms <= 0) return;
fZooms--;
TPad *pad = (TPad*)gPad->GetPadSave();
//_____________________________________________________________________________
void AliMUONDisplay::ResetPoints()
{
- //
- // Reset array of points
- //
+/// Reset array of points
+
if (fPoints) {
fPoints->Delete();
delete fPoints;
//_____________________________________________________________________________
void AliMUONDisplay::ResetPhits()
{
- //
- // Reset array of points
- //
+/// Reset array of points
+
if (fPhits) {
fPhits->Delete();
delete fPhits;
//_____________________________________________________________________________
void AliMUONDisplay::ResetRpoints()
{
- //
- // Reset array of points
- //
+/// Reset array of points
+
if (fRpoints) {
fRpoints->Clear();
// delete fRpoints;
fRpoints = 0;
}
}
-
-AliMUONDisplay & AliMUONDisplay::operator = (const AliMUONDisplay & rhs)
-{
-// Protected assignement operator
-
- if (this == &rhs) return *this;
-
- AliFatal("Not implemented.");
-
- return *this;
-}
-
-
-
-
-
-
-
-
-