/* $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 "AliMUONSegmentation.h"
#include "AliMUONGeometrySegmentation.h"
#include "AliMUONConstants.h"
-#include "AliMUONTriggerSegmentationV2.h"
+#include "AliMUONTriggerSegmentation.h"
#include "AliMpDEIterator.h"
-#include "AliMpSegFactory.h"
+#include "AliMpSegmentation.h"
#include "AliMpSlatSegmentation.h"
#include "AliMpSlat.h"
#include "AliMpSectorSegmentation.h"
#include <TPolyLine3D.h>
#include <TBox.h>
-
-
+/// \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()
{
- // to be re-written for new seg
-// Draw graphical representation of segmenatation
-// Attention: still experimental code
+/// \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");
//_____________________________________________________________________________
void AliMUONDisplay::DrawClusters()
{
-// Draw clusters for MUON chambers
+/// Draw clusters for MUON chambers
Int_t ndigits, digit;
TObjArray *points;
//_____________________________________________________________________________
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
+/// Draw a view of MUON clusters
+
AliInfo(" Draw View");
gPad->SetCursor(kWatch);
= pMUON->GetGeometryTransformer();
AliMUONSegmentation* segmentation = pMUON->GetSegmentation();
- AliMpSegFactory segFactory;
- // Mapping segmentation factory will be used only to create mapping
- // segmentations if not present in the DE segmentations
// Display MUON Chamber Geometry
char nodeName[7];
Int_t detElemId = it.CurrentDE();
AliMpSectorSegmentation * seg =
- (AliMpSectorSegmentation *) segmentation->GetMpSegmentation(detElemId, 0);
+ (AliMpSectorSegmentation *) AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, 0);
const AliMpSector * sector = seg->GetSector();
// get sector measurements
if ( segmentation->HasDE(detElemId) )
{
- const AliMpVSegmentation* seg = segmentation->GetMpSegmentation(detElemId, 0);
- if (!seg) {
- // Create mapping segmentation if old trigger segmentation
- // (not using mapping)
- seg = segFactory.CreateMpSegmentation(detElemId, 0);
- }
+ const AliMpVSegmentation* seg
+ = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, 0);
if (seg)
{
Float_t deltax = seg->Dimensions().X();
}
}
-// // Delete mapping segmentations created with factory
-// segFactory.DeleteSegmentations();
-
//add clusters to the pad
DrawClusters();
DrawHits();
//_____________________________________________________________________________
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;
AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
- AliMUONGeometrySegmentation* segmentation2 = 0x0;
-
GetMUONData()->SetTreeAddress("D");
TClonesArray *muonDigits = GetMUONData()->Digits(chamber-1);
// check if trigger is using new or old segmentation
Bool_t old = true;
AliMUONSegmentation* segmentation = pMUON->GetSegmentation();
- if ( segmentation->GetMpSegmentation(1100, cathode-1) ) old = false;
+ 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");
- segmentation2
- = pMUON->GetSegmentation()->GetModuleSegmentation(chamber-1, cathode-1);
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();
+ 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 (chamber > 10) { // trigger chamber
- Int_t sumCharge = 0;
+ Float_t sumCharge = 0;
for (Int_t icharge = 0; icharge < 10; icharge++) {
sumCharge = sumCharge+mdig->TrackCharge(icharge);
}
- Int_t testCharge = sumCharge-(Int_t(sumCharge/10))*10;
+ Float_t testCharge = sumCharge-(Int_t(sumCharge/10))*10;
if(sumCharge <= 10 || testCharge > 0) {
colorTrigger = color;
} else {
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;
Int_t ix=mdig->PadX();
Int_t iy=mdig->PadY();
Int_t detElemId=mdig->DetElemId();
- Int_t charge = mdig->Signal();
+ 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 =
- pMUON->GetSegmentation()->GetMpSegmentation(detElemId,cathode-1);
+ AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,cathode-1);
AliMpPad pad = seg->PadByIndices(AliMpIntPair(ix,iy),kTRUE);
if (chamber > 10) { // trigger chamber
- Int_t sumCharge = 0;
+ Float_t sumCharge = 0;
Int_t n = mdig->Ntracks();
for (Int_t icharge = 0; icharge < n; icharge++) {
sumCharge = sumCharge+mdig->TrackCharge(icharge);
}
- assert(sumCharge==mdig->Signal());
- Int_t testCharge = sumCharge-(Int_t(sumCharge/n))*n;
+ Float_t testCharge = sumCharge-(Int_t(sumCharge/n))*n;
if(sumCharge <= n || testCharge > 0) {
colorTrigger = color;
} else {
//___________________________________________
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;
//___________________________________________
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;
//_____________________________________________________________________________
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;
//_____________________________________________________________________________
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;
-}
-
-
-
-
-
-
-
-
-