From Stefano:
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Aug 2010 10:08:57 +0000 (10:08 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Aug 2010 10:08:57 +0000 (10:08 +0000)
1) Moved beam info code to a new class AliEveBeamsInfo.

2) New features in AliEveLego: histograms for the 5 species; event
   control for all events, allowing collision candidates selection
   also for MC.

EVE/EveBase/AliEveBeamsInfo.cxx [new file with mode: 0644]
EVE/EveBase/AliEveBeamsInfo.h [new file with mode: 0644]
EVE/EveBase/AliEveBeamsInfoEditor.cxx [new file with mode: 0644]
EVE/EveBase/AliEveBeamsInfoEditor.h [new file with mode: 0644]
EVE/EveBase/AliEveLego.cxx
EVE/EveBase/AliEveLego.h
EVE/EveBase/AliEveLegoEditor.cxx
EVE/EveBase/AliEveLegoEditor.h
EVE/EveBase/EveBaseLinkDef.h
EVE/macros/visscan_init.C

diff --git a/EVE/EveBase/AliEveBeamsInfo.cxx b/EVE/EveBase/AliEveBeamsInfo.cxx
new file mode 100644 (file)
index 0000000..4125d28
--- /dev/null
@@ -0,0 +1,214 @@
+// $Id$
+// Author: Stefano Carrazza 2010
+
+/**************************************************************************
+ * Copyright(c) 1998-2009, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#include "AliEveBeamsInfo.h"
+#include "AliPhysicsSelection.h"
+#include "AliESDEvent.h"
+#include "AliEveEventManager.h"
+#include "AliEveEventSelector.h"
+#include "AliEveMultiView.h"
+
+#include "TEveWindow.h"
+#include "TEveManager.h"
+#include "TEveBrowser.h"
+#include "TEveViewer.h"
+#include "TEveScene.h"
+#include "TGLOverlayButton.h"
+
+
+//______________________________________________________________________________
+// This class provides the triggers information about beams.
+//
+
+ClassImp(AliEveBeamsInfo)
+
+//______________________________________________________________________________
+AliEveBeamsInfo::AliEveBeamsInfo(const char* name) :
+  TEveElementList(name),
+  fEsd(0),
+  fShowEventsInfo(kTRUE),
+  fPhysicsSelection(0),
+  fCollisionCandidate(0),
+  fBeam1(0),
+  fBeam2(0),
+  fAl(0),
+  fHisto2dv(0),
+  fEventSelector(0)
+{
+  // Constructor.
+  gEve->AddToListTree(this,0);
+
+  // get current ESD event
+  fEsd = AliEveEventManager::AssertESD();
+  fAl = AliEveMultiView::Instance();  
+  fEventSelector = AliEveEventManager::GetMaster()->GetEventSelector();
+
+  // AliPhysicsSelection
+  fPhysicsSelection = new AliPhysicsSelection();
+  fPhysicsSelection->SetAnalyzeMC(kFALSE);
+  fPhysicsSelection->Initialize(fEsd->GetRunNumber());
+
+  // loading physics selection and triggers buttons
+  fCollisionCandidate = new TGLOverlayButton(0, "", 10.0, -10.0, 190.0, 20.0);
+  fCollisionCandidate->SetAlphaValues(1.5,1.5);
+  fBeam1 = new TGLOverlayButton(0, "", 10.0, -30.0, 190.0, 20.0);
+  fBeam1->SetAlphaValues(1.5,1.5);
+  fBeam2 = new TGLOverlayButton(0, "", 10.0, -50.0, 190.0, 20.0);
+  fBeam2->SetAlphaValues(1.5,1.5);
+
+  // show beams info
+  ShowBeamsInfo(fShowEventsInfo, kFALSE);
+
+}
+
+//______________________________________________________________________________
+AliEveBeamsInfo::~AliEveBeamsInfo()
+{
+  // deleting variables
+  delete fEsd;
+  delete fPhysicsSelection;
+  delete fCollisionCandidate;
+  delete fBeam1;
+  delete fBeam2;
+  delete fAl;
+  delete fHisto2dv;
+
+}
+
+void AliEveBeamsInfo::ShowBeamsInfo(Bool_t show, Bool_t updateonly)
+{
+  // Collision candidate
+  fHisto2dv = (TEveViewer*) gEve->GetViewers()->FindChild("2D Lego Viewer");
+
+  if (show == 0)
+  {
+
+    gEve->GetDefaultGLViewer()->RemoveOverlayElement(fCollisionCandidate);
+    fAl->Get3DView()->GetGLViewer()->RemoveOverlayElement(fCollisionCandidate);
+    if(fHisto2dv)
+      fHisto2dv->GetGLViewer()->RemoveOverlayElement(fCollisionCandidate);
+
+    gEve->GetDefaultGLViewer()->RemoveOverlayElement(fBeam1);
+    fAl->Get3DView()->GetGLViewer()->RemoveOverlayElement(fBeam1);
+    if(fHisto2dv)
+      fHisto2dv->GetGLViewer()->RemoveOverlayElement(fBeam1);
+
+    gEve->GetDefaultGLViewer()->RemoveOverlayElement(fBeam2);
+    fAl->Get3DView()->GetGLViewer()->RemoveOverlayElement(fBeam2);
+    if(fHisto2dv)
+      fHisto2dv->GetGLViewer()->RemoveOverlayElement(fBeam2);
+
+  } else {
+
+  if (updateonly == kFALSE) {
+    gEve->GetDefaultGLViewer()->AddOverlayElement(fCollisionCandidate);
+    fAl->Get3DView()->GetGLViewer()->AddOverlayElement(fCollisionCandidate);
+    if(fHisto2dv)
+      fHisto2dv->GetGLViewer()->AddOverlayElement(fCollisionCandidate);
+  }
+
+  Bool_t ev = fPhysicsSelection->IsCollisionCandidate(fEsd);
+
+  if (ev == 1)
+  {
+     fCollisionCandidate->SetText("Collision candidate: YES");
+  } else {
+     fCollisionCandidate->SetText("Collision candidate: NO ");
+  }
+
+  // Beam 1 & 2 setup: method 1
+  if (updateonly == kFALSE) {
+     gEve->GetDefaultGLViewer()->AddOverlayElement(fBeam1);
+     fAl->Get3DView()->GetGLViewer()->AddOverlayElement(fBeam1);
+     if(fHisto2dv)
+      fHisto2dv->GetGLViewer()->AddOverlayElement(fBeam1);
+
+     gEve->GetDefaultGLViewer()->AddOverlayElement(fBeam2);
+     fAl->Get3DView()->GetGLViewer()->AddOverlayElement(fBeam2);
+     if(fHisto2dv)
+      fHisto2dv->GetGLViewer()->AddOverlayElement(fBeam2);
+  }
+
+  Bool_t b1  = fEsd->IsTriggerClassFired("CINT1A-ABCE-NOPF-ALL");
+  Bool_t b2  = fEsd->IsTriggerClassFired("CINT1C-ABCE-NOPF-ALL");
+  Bool_t b12 = fEsd->IsTriggerClassFired("CINT1B-ABCE-NOPF-ALL");
+
+  if (b1 == 1 || b12 == 1)
+  {
+     fBeam1->SetText("Beam 1: YES");
+     fBeam1->SetBackColor(0x00ff00);
+  } else {
+     fBeam1->SetText("Beam 1: NO");
+     fBeam1->SetBackColor(0xff0000);
+  }
+
+  if (b2 == 1 || b12 == 1)
+  {
+     fBeam2->SetText("Beam 2: YES");
+     fBeam2->SetBackColor(0x00ff00);
+  } else {
+     fBeam2->SetText("Beam 2: NO");
+     fBeam2->SetBackColor(0xff0000);
+  }
+}
+
+gEve->Redraw3D(kTRUE);
+
+}
+
+//______________________________________________________________________________
+void AliEveBeamsInfo::Update()
+{
+  // update beams information for current event
+  ShowBeamsInfo(fShowEventsInfo, kTRUE);
+}
+
+//______________________________________________________________________________
+void AliEveBeamsInfo::ShowEventSelection()
+{
+  // activate/deactivate info box
+  if (fShowEventsInfo == 0)
+  {
+    fShowEventsInfo = 1;
+  } else {
+    fShowEventsInfo = 0;
+  }
+
+  ShowBeamsInfo(fShowEventsInfo);
+}
+
+//______________________________________________________________________________
+void AliEveBeamsInfo::SelectEventSelection(Int_t id)
+{
+  // show trigger information
+  if (id == 0)
+  {
+     fEventSelector->SetSelectOnTriggerType(kFALSE);
+  } else {
+     if (id == 1) fEventSelector->SetTriggerType("CINT1A-ABCE-NOPF-ALL");
+     if (id == 2) fEventSelector->SetTriggerType("CINT1C-ABCE-NOPF-ALL");
+     if (id == 3) fEventSelector->SetTriggerType("CINT1B-ABCE-NOPF-ALL");
+     fEventSelector->SetSelectOnTriggerType(kTRUE);
+  }
+}
+
+//______________________________________________________________________________
+void AliEveBeamsInfo::ShowPrevEvent()
+{
+  // go to the previous event
+  AliEveEventManager::GetMaster()->PrevEvent();
+}
+
+//______________________________________________________________________________
+void AliEveBeamsInfo::ShowNextEvent()
+{
+  AliEveEventManager::GetMaster()->NextEvent();
+}
+
+/******************************************************************************/
diff --git a/EVE/EveBase/AliEveBeamsInfo.h b/EVE/EveBase/AliEveBeamsInfo.h
new file mode 100644 (file)
index 0000000..1e6a57d
--- /dev/null
@@ -0,0 +1,61 @@
+// $Id$
+// Author: Stefano Carrazza 2010
+
+/**************************************************************************
+ * Copyright(c) 1998-2009, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#ifndef ALIEVEBEAMSINFO_H
+#define ALIEVEBEAMSINFO_H
+
+#include "TEveElement.h"
+
+class AliESDEvent;
+class AliPhysicsSelection;
+class AliEveEventSelector;
+class AliEveMultiView;
+
+class TGLOverlayButton;
+class TEveViewer;
+
+
+//______________________________________________________________________________
+// Display beams and triggers information on gl-viewers.
+//
+
+class AliEveBeamsInfo : public TEveElementList
+{
+public:
+  AliEveBeamsInfo(const char* name="AliEveBeamsInfo");
+  virtual ~AliEveBeamsInfo();
+
+  // Set Methods
+  void ShowEventSelection();
+
+  // Functions
+  void ShowBeamsInfo(Bool_t show, Bool_t updateonly = kFALSE);
+  void Update();
+  void SelectEventSelection(Int_t id);
+  void ShowPrevEvent();
+  void ShowNextEvent();
+
+private:
+  AliESDEvent *fEsd;                      // esd event
+  Bool_t fShowEventsInfo;                 // determine if show events info
+  AliPhysicsSelection *fPhysicsSelection; // physics selection object
+  TGLOverlayButton *fCollisionCandidate;  // AliPhysicsSelection button output
+  TGLOverlayButton *fBeam1;               // beam 1 information
+  TGLOverlayButton *fBeam2;               // beam 2 information
+  AliEveMultiView  *fAl;                  // multiview instance
+  TEveViewer *fHisto2dv;                  // 2D lego view
+  AliEveEventSelector *fEventSelector;    // current event selector
+
+  AliEveBeamsInfo(const AliEveBeamsInfo&);            // Not implemented
+  AliEveBeamsInfo& operator=(const AliEveBeamsInfo&); // Not implemented
+
+  ClassDef(AliEveBeamsInfo, 0); // Short description.
+};
+
+#endif
diff --git a/EVE/EveBase/AliEveBeamsInfoEditor.cxx b/EVE/EveBase/AliEveBeamsInfoEditor.cxx
new file mode 100644 (file)
index 0000000..4c9edd5
--- /dev/null
@@ -0,0 +1,115 @@
+// $Id$
+// Author: Stefano Carrazza 2010
+
+/**************************************************************************
+ * Copyright(c) 1998-2009, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#include "AliEveBeamsInfoEditor.h"
+#include "AliEveBeamsInfo.h"
+
+#include "TVirtualPad.h"
+#include "TColor.h"
+
+// Cleanup these includes:
+#include "TGLabel.h"
+#include "TGButton.h"
+#include "TGNumberEntry.h"
+#include "TGColorSelect.h"
+#include "TGDoubleSlider.h"
+#include "TGString.h"
+#include "TGComboBox.h"
+#include "TGFrame.h"
+
+
+//______________________________________________________________________________
+// GUI editor for AliEveBeamsInfo.
+//
+
+ClassImp(AliEveBeamsInfoEditor)
+
+//______________________________________________________________________________
+AliEveBeamsInfoEditor::AliEveBeamsInfoEditor(const TGWindow *p, Int_t width, Int_t height,
+             UInt_t options, Pixel_t back) :
+  TGedFrame(p, width, height, options | kVerticalFrame, back),
+  fM(0),
+  fEventSelection(0),
+  fShowEvents(0),
+  fSelect(0),
+  fButtonPrev(0),
+  fButtonNext(0)
+{
+  // Constructor.
+  MakeTitle("AliEveBeamsInfo");
+
+  // Events selection
+  fEventSelection = new TGGroupFrame(this, "Event selection:", kHorizontalFrame);
+
+  fShowEvents = new TGCheckButton(fEventSelection, new TGHotString("&Show info "));
+  fShowEvents->SetState(kButtonDown);
+  fShowEvents->Connect("Clicked()", "AliEveBeamsInfoEditor", this, "ShowEventSelection()");
+  fEventSelection->AddFrame(fShowEvents, new TGLayoutHints(kLHintsLeft | kLHintsTop));
+
+  fSelect = new TGComboBox(fEventSelection,-1,kHorizontalFrame | kSunkenFrame | kDoubleBorder | kOwnBackground);
+  fSelect->AddEntry("All events",0);
+  fSelect->AddEntry("Beam 1",1);
+  fSelect->AddEntry("Beam 2",2);
+  fSelect->AddEntry("Beams 1 & 2",3);
+  fSelect->Resize(102,22);
+  fSelect->Select(0);
+  fEventSelection->AddFrame(fSelect, new TGLayoutHints(kLHintsRight | kLHintsExpandX));
+
+  fSelect->Connect("Selected(Int_t)", "AliEveBeamsInfoEditor", this, "SelectEventSelection(Int_t)");
+
+  AddFrame(fEventSelection, new TGLayoutHints(kLHintsExpandX));
+
+  //**********
+
+  TGHorizontalFrame *h = new TGHorizontalFrame(this);
+
+  fButtonPrev = new TGTextButton(h, "Previous event");
+  h->AddFrame(fButtonPrev, new TGLayoutHints(kLHintsLeft | kLHintsCenterY | kLHintsExpandX));
+  fButtonPrev->Connect("Clicked()", "AliEveBeamsInfoEditor", this, "ShowPrevEvent()");
+
+  fButtonNext = new TGTextButton(h, "Next event");
+  h->AddFrame( fButtonNext, new TGLayoutHints(kLHintsRight | kLHintsNormal | kLHintsExpandX));
+  fButtonNext->Connect("Clicked()", "AliEveBeamsInfoEditor", this, "ShowNextEvent()");
+
+  AddFrame(h, new TGLayoutHints(kLHintsExpandX | kLHintsCenterY));
+
+}
+
+//______________________________________________________________________________
+void AliEveBeamsInfoEditor::SetModel(TObject* obj)
+{
+  // Set model object.
+  fM = dynamic_cast<AliEveBeamsInfo*>(obj);
+}
+
+//______________________________________________________________________________
+void AliEveBeamsInfoEditor::ShowEventSelection()
+{
+   fM->ShowEventSelection();
+}
+
+//______________________________________________________________________________
+void AliEveBeamsInfoEditor::SelectEventSelection(Int_t id)
+{
+   fM->SelectEventSelection(id);
+}
+
+//______________________________________________________________________________
+void AliEveBeamsInfoEditor::ShowPrevEvent()
+{
+  fM->ShowPrevEvent();
+}
+
+//______________________________________________________________________________
+void AliEveBeamsInfoEditor::ShowNextEvent()
+{
+  fM->ShowNextEvent();
+}
+
+/******************************************************************************/
diff --git a/EVE/EveBase/AliEveBeamsInfoEditor.h b/EVE/EveBase/AliEveBeamsInfoEditor.h
new file mode 100644 (file)
index 0000000..fef520d
--- /dev/null
@@ -0,0 +1,60 @@
+// $Id$
+// Author: Stefano Carrazza 2010
+
+/**************************************************************************
+ * Copyright(c) 1998-2009, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#ifndef ALIEVEBEAMSINFOEDITOR_H
+#define ALIEVEBEAMSINFOEDITOR_H
+
+#include "TGedFrame.h"
+
+class TGButton;
+class TGCheckButton;
+class TGNumberEntry;
+class TGColorSelect;
+class TGGroupFrame;
+class TGComboBox;
+class TGTextButton;
+
+class AliEveBeamsInfo;
+
+//______________________________________________________________________________
+// Short description of AliEveBeamsInfoEditor
+//
+
+class AliEveBeamsInfoEditor : public TGedFrame
+{
+public:
+   AliEveBeamsInfoEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30,
+         UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground());
+   virtual ~AliEveBeamsInfoEditor() {}
+
+   virtual void SetModel(TObject* obj);
+
+   // Declare callback/slot methods
+   void ShowEventSelection();
+   void SelectEventSelection(Int_t id);
+   void ShowPrevEvent();
+   void ShowNextEvent();
+
+protected:
+   AliEveBeamsInfo            *fM; // Model object.
+
+private:
+   TGGroupFrame  *fEventSelection;  // event selection group box
+   TGCheckButton *fShowEvents;      // display information checkbox
+   TGComboBox    *fSelect;          // combo box display
+   TGTextButton  *fButtonPrev;      // previous event selection
+   TGTextButton  *fButtonNext;      // next event selection
+
+   AliEveBeamsInfoEditor(const AliEveBeamsInfoEditor&);            // Not implemented
+   AliEveBeamsInfoEditor& operator=(const AliEveBeamsInfoEditor&); // Not implemented
+
+   ClassDef(AliEveBeamsInfoEditor, 0); // GUI editor for AliEveBeamsInfo.
+};
+
+#endif
index 2bf3391c973daa1e199d1a2164533ee0a6535b82..cb7aceca195b0988d5ec93014530b30ef1c826d5 100644 (file)
@@ -12,7 +12,6 @@
 #include "AliEveEventManager.h"
 #include "AliEveMultiView.h"
 #include "AliPhysicsSelection.h"
-#include "AliEveEventSelector.h"
 
 #include "TH2F.h"
 #include "TMath.h"
@@ -30,7 +29,6 @@
 #include "TEveProjectionManager.h"
 #include "TEveProjectionAxes.h"
 #include "TGLWidget.h"
-#include "TGLOverlayButton.h"
 #include "TStopwatch.h"
 
 //______________________________________________________________________________
@@ -43,11 +41,12 @@ Double_t kPi = TMath::Pi();
 //______________________________________________________________________________
 AliEveLego::AliEveLego(const char* name) :
   TEveElementList(name),
-  fChargeId(1),
+  fIsMC(kFALSE),
+  fCollisionCandidatesOnly(kFALSE),
+  fParticleTypeId(0),
+  fParticleTypeIdAE(0),
   fTracksId(1),
-  fEventsId(1),
   fMaxPt(10000),
-  fChargeIdAE(0),
   fTracksIdAE(0),
   fMaxPtAE(10000),
   fEsd(0),
@@ -56,6 +55,16 @@ AliEveLego::AliEveLego(const char* name) :
   fHistoposAllEvents(0),
   fHistoneg(0),
   fHistonegAllEvents(0),
+  fHistoElectrons(0),
+  fHistoElectronsAllEvents(0),
+  fHistoMuons(0),
+  fHistoMuonsAllEvents(0),
+  fHistoPions(0),
+  fHistoPionsAllEvents(0),
+  fHistoKaons(0),
+  fHistoKaonsAllEvents(0),
+  fHistoProtons(0),
+  fHistoProtonsAllEvents(0),
   fData(0),
   fDataAllEvents(0),
   fLego(0),
@@ -77,12 +86,7 @@ AliEveLego::AliEveLego(const char* name) :
   fAl(0),
   fHisto2dLegoOverlay(0),
   fHisto2dAllEventsLegoOverlay(0),
-  fHisto2dAllEventsSlot(0),
-  fEventSelector(0),
-  fShowEventsInfo(0),
-  fGButton(0),
-  fB1(0),
-  fB2(0)
+  fHisto2dAllEventsSlot(0)
 {
   // Constructor.
   gEve->AddToListTree(this,0);
@@ -90,22 +94,64 @@ AliEveLego::AliEveLego(const char* name) :
   // Get Current ESD event
   fEsd = AliEveEventManager::AssertESD();
 
+  // Particles types per default
+  fParticleTypeId = new Bool_t[7];
+  fParticleTypeIdAE = new Bool_t[7];
+
+  for (Int_t s = 0; s < 7; s++)
+  {
+    if (s > 1){
+      fParticleTypeId[s] = kFALSE;
+      fParticleTypeIdAE[s] = kFALSE;
+    } else {
+      fParticleTypeId[s] = kTRUE;
+      fParticleTypeIdAE[s] = kTRUE;
+    }
+  }
+
   fPhysicsSelection = new AliPhysicsSelection();
   fPhysicsSelection->Initialize(fEsd->GetRunNumber());
 
-  fEventSelector = AliEveEventManager::GetMaster()->GetEventSelector();
-
-  fHistopos = new TH2F("histopos","Histo 2d positive", 100, -1.5, 1.5, 80, -kPi, kPi);
-  fHistoneg = new TH2F("histoneg","Histo 2d negative", 100, -1.5, 1.5, 80, -kPi, kPi);
+  fHistopos       = new TH2F("histopos","Histo 2d positive", 100, -1.5, 1.5, 80, -kPi, kPi);
+  fHistoneg       = new TH2F("histoneg","Histo 2d negative", 100, -1.5, 1.5, 80, -kPi, kPi);
+  fHistoElectrons = new TH2F("histoele","Histo 2d electron", 100, -1.5, 1.5, 80, -kPi, kPi);
+  fHistoMuons     = new TH2F("histomuo","Histo 2d muons   ", 100, -1.5, 1.5, 80, -kPi, kPi);
+  fHistoPions     = new TH2F("histopio","Histo 2d pions   ", 100, -1.5, 1.5, 80, -kPi, kPi);
+  fHistoKaons     = new TH2F("histokao","Histo 2d kaons   ", 100, -1.5, 1.5, 80, -kPi, kPi);
+  fHistoProtons   = new TH2F("histopro","Histo 2d protons ", 100, -1.5, 1.5, 80, -kPi, kPi);
 
   fHistopos->SetDirectory(0);
   fHistoneg->SetDirectory(0);
+  fHistoElectrons->SetDirectory(0);
+  fHistoMuons->SetDirectory(0);
+  fHistoPions->SetDirectory(0);
+  fHistoKaons->SetDirectory(0);
+  fHistoProtons->SetDirectory(0);
+
+  // colors from get_pdg_color() in /alice-macros/kine_tracks.C
+  static Color_t fElectro = 5;
+  static Color_t fMuon = 30;
+  static Color_t fPion = 3;
+  static Color_t fKaon = 38;
+  static Color_t fProton = 10;
 
   fData = new TEveCaloDataHist();
+
   fData->AddHistogram(fHistoneg);
   fData->RefSliceInfo(0).Setup("NegCg:", 0, kBlue);
   fData->AddHistogram(fHistopos);
   fData->RefSliceInfo(1).Setup("PosCg:", 0, kRed);
+  fData->AddHistogram(fHistoElectrons);
+  fData->RefSliceInfo(2).Setup("Electrons:", 0, fElectro);
+  fData->AddHistogram(fHistoMuons);
+  fData->RefSliceInfo(3).Setup("Muons:", 0, fMuon);
+  fData->AddHistogram(fHistoPions);
+  fData->RefSliceInfo(4).Setup("Pions:", 0, fPion);
+  fData->AddHistogram(fHistoKaons);
+  fData->RefSliceInfo(5).Setup("Kaons:", 0, fKaon);
+  fData->AddHistogram(fHistoProtons);
+  fData->RefSliceInfo(6).Setup("Protons:", 0, fProton);
+
   fData->GetEtaBins()->SetTitleFont(120);
   fData->GetEtaBins()->SetTitle("h");
   fData->GetPhiBins()->SetTitleFont(120);
@@ -124,14 +170,6 @@ AliEveLego::AliEveLego(const char* name) :
   fAl->ImportEventRPhi(fCalo3d);
   fAl->ImportEventRhoZ(fCalo3d);
 
-  // glbutton
-  fGButton = new TGLOverlayButton(0, "", 10.0, -10.0, 190.0, 20.0);
-  fGButton->SetAlphaValues(1.5,1.5);
-  fB1 = new TGLOverlayButton(0, "", 10.0, -30.0, 190.0, 20.0);
-  fB1->SetAlphaValues(1.5,1.5);
-  fB2 = new TGLOverlayButton(0, "", 10.0, -50.0, 190.0, 20.0);
-  fB2->SetAlphaValues(1.5,1.5);
-
   // Update
   Update();
 }
@@ -146,6 +184,19 @@ AliEveLego::~AliEveLego()
    delete fHistoposAllEvents;
    delete fHistoneg;
    delete fHistonegAllEvents;
+   delete fHistoElectrons;
+   delete fHistoElectronsAllEvents;
+   delete fHistoMuons;
+   delete fHistoMuonsAllEvents;
+   delete fHistoPions;
+   delete fHistoPionsAllEvents;
+   delete fHistoKaons;
+   delete fHistoKaonsAllEvents;
+   delete fHistoProtons;
+   delete fHistoProtonsAllEvents;
+
+   delete[] fParticleTypeId;
+   delete[] fParticleTypeIdAE;
 
    delete fData;
    delete fDataAllEvents;
@@ -172,10 +223,6 @@ AliEveLego::~AliEveLego()
    delete fHisto2dAllEventsLegoOverlay;
    delete fHisto2dAllEventsSlot;
 
-   delete fEventSelector;
-   delete fGButton;
-   delete fB1;
-   delete fB2;
 }
 
 namespace
@@ -198,21 +245,39 @@ TEveCaloDataHist* AliEveLego::LoadData()
    // Load data from ESD tree
    fHistopos->Reset();
    fHistoneg->Reset();
+   fHistoElectrons->Reset();
+   fHistoMuons->Reset();
+   fHistoPions->Reset();
+   fHistoKaons->Reset();
+   fHistoProtons->Reset();
 
    // Getting current tracks, filling histograms
    for (int n = 0; n < fEsd->GetNumberOfTracks(); ++n) {
 
-      if (fEsd->GetTrack(n)->GetSign() > 0) {
-         fHistopos->Fill(fEsd->GetTrack(n)->Eta(),
-                         getphi(fEsd->GetTrack(n)->Phi()),
-                         fabs(fEsd->GetTrack(n)->Pt()));
-      }
+     AliESDtrack *track = fEsd->GetTrack(n);
+     const Double_t sign = fEsd->GetTrack(n)->GetSign();
+     const Int_t prob = GetParticleType(track);     
 
-      if (fEsd->GetTrack(n)->GetSign() < 0) {
-         fHistoneg->Fill(fEsd->GetTrack(n)->Eta(),
-                         getphi(fEsd->GetTrack(n)->Phi()),
-                         fabs(fEsd->GetTrack(n)->Pt()));
-      }
+      if (sign > 0)
+        fHistopos->Fill(track->Eta(), getphi(track->Phi()), fabs(track->Pt()));
+
+      if (sign < 0)
+        fHistoneg->Fill(track->Eta(), getphi(track->Phi()), fabs(track->Pt()));
+
+      if (prob == 0)
+        fHistoElectrons->Fill(track->Eta(), getphi(track->Phi()), fabs(track->Pt()));
+
+      if (prob == 1)
+        fHistoMuons->Fill(track->Eta(), getphi(track->Phi()), fabs(track->Pt()));
+
+      if (prob == 2)
+        fHistoPions->Fill(track->Eta(), getphi(track->Phi()), fabs(track->Pt()));
+
+      if (prob == 3)
+        fHistoKaons->Fill(track->Eta(), getphi(track->Phi()), fabs(track->Pt()));
+
+      if (prob == 4)
+        fHistoProtons->Fill(track->Eta(), getphi(track->Phi()), fabs(track->Pt()));
    }
 
    fData->DataChanged();
@@ -228,25 +293,54 @@ TEveCaloDataHist* AliEveLego::LoadAllData()
    // load data from all events ESD
    fHistoposAllEvents->Reset();
    fHistonegAllEvents->Reset();
+   fHistoElectronsAllEvents->Reset();
+   fHistoMuonsAllEvents->Reset();
+   fHistoPionsAllEvents->Reset();
+   fHistoKaonsAllEvents->Reset();
+   fHistoProtonsAllEvents->Reset();
 
    TTree* t = AliEveEventManager::GetMaster()->GetESDTree();
 
    // Getting current tracks for each event, filling histograms
+   Int_t fAcceptedEvents = 0;
    for (int event = 0; event < t->GetEntries(); event++) {
       t->GetEntry(event);
-         for (int n = 0; n < fEsd->GetNumberOfTracks(); ++n) {
-
-            if (fEsd->GetTrack(n)->GetSign() > 0) {
-               fHistoposAllEvents->Fill(fEsd->GetTrack(n)->Eta(),
-                                          getphi(fEsd->GetTrack(n)->Phi()),
-                                          fabs(fEsd->GetTrack(n)->Pt()));
-            } else {
-               fHistonegAllEvents->Fill(fEsd->GetTrack(n)->Eta(),
-                                          getphi(fEsd->GetTrack(n)->Phi()),
-                                          fabs(fEsd->GetTrack(n)->Pt()));
-            }
+
+      if (fCollisionCandidatesOnly == kTRUE)
+        if (fPhysicsSelection->IsCollisionCandidate(fEsd) == kFALSE) continue;
+
+      fAcceptedEvents++;
+
+      for (int n = 0; n < fEsd->GetNumberOfTracks(); ++n) {
+
+           AliESDtrack *track = fEsd->GetTrack(n);
+           const Double_t sign = track->GetSign();
+           const Int_t prob = GetParticleType(track);
+
+            if (sign > 0)
+              fHistoposAllEvents->Fill(track->Eta(), getphi(track->Phi()), fabs(track->Pt()));
+
+            if (sign < 0)
+              fHistonegAllEvents->Fill(track->Eta(), getphi(track->Phi()), fabs(track->Pt()));
+
+            if (prob == 0)
+              fHistoElectronsAllEvents->Fill(track->Eta(), getphi(track->Phi()), fabs(track->Pt()));
+
+            if (prob == 1)
+              fHistoMuonsAllEvents->Fill(track->Eta(), getphi(track->Phi()), fabs(track->Pt()));
+
+            if (prob == 2)
+              fHistoPionsAllEvents->Fill(track->Eta(), getphi(track->Phi()), fabs(track->Pt()));
+
+            if (prob == 3)
+              fHistoKaonsAllEvents->Fill(track->Eta(), getphi(track->Phi()), fabs(track->Pt()));
+
+            if (prob == 4)
+              fHistoProtonsAllEvents->Fill(track->Eta(), getphi(track->Phi()), fabs(track->Pt()));
          }
    }
+   t->GetEntry(0);
+   printf("Number of events loaded: %i, with AliPhysicsSelection: %i\n",fAcceptedEvents,fCollisionCandidatesOnly);
 
    fDataAllEvents->DataChanged();
 
@@ -261,18 +355,40 @@ TEveCaloDataHist* AliEveLego::FilterData()
    {
       fHistopos->Reset();
       fHistoneg->Reset();
+      fHistoElectrons->Reset();
+      fHistoMuons->Reset();
+      fHistoPions->Reset();
+      fHistoKaons->Reset();
+      fHistoProtons->Reset();
 
       const AliESDVertex *pv  = fEsd->GetPrimaryVertex();
 
       for (Int_t n = 0; n < pv->GetNIndices(); n++ )
       {
          AliESDtrack *at = fEsd->GetTrack(pv->GetIndices()[n]);
-         if (at->GetSign() > 0) {
-            fHistopos->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
-         }
-         if (at->GetSign() < 0) {
-            fHistoneg->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
-         }
+         const Double_t sign = at->GetSign();
+         const Int_t prob = GetParticleType(at);
+
+         if (sign > 0)
+           fHistopos->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
+
+         if (sign < 0)
+           fHistoneg->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
+
+         if (prob == 0)
+           fHistoElectrons->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
+
+         if (prob == 1)
+           fHistoMuons->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
+
+         if (prob == 2)
+           fHistoPions->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
+
+         if (prob == 3)
+           fHistoKaons->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
+
+         if (prob == 4)
+           fHistoProtons->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
       }
    }
 
@@ -282,30 +398,45 @@ TEveCaloDataHist* AliEveLego::FilterData()
    if (GetPtMax() >= fMaxPt){
       for (Int_t binx = 1; binx <= 100; binx++) {
          for (Int_t biny = 1; biny <= 80; biny++) {
-            if (fHistopos->GetBinContent(binx, biny) >= fMaxPt)
-            {
-               fHistopos->SetBinContent(binx, biny, fMaxPt);
-            }
-            if (fHistoneg->GetBinContent(binx, biny) >= fMaxPt)
-            {
-               fHistoneg->SetBinContent(binx, biny, fMaxPt);
-            }           
+
+           if (fHistopos->GetBinContent(binx, biny) >= fMaxPt)
+             fHistopos->SetBinContent(binx, biny, fMaxPt);
+
+           if (fHistoneg->GetBinContent(binx, biny) >= fMaxPt)
+             fHistoneg->SetBinContent(binx, biny, fMaxPt);
+
+           if (fHistoElectrons->GetBinContent(binx, biny) >= fMaxPt)
+             fHistoElectrons->SetBinContent(binx, biny, fMaxPt);
+
+           if (fHistoMuons->GetBinContent(binx, biny) >= fMaxPt)
+             fHistoMuons->SetBinContent(binx, biny, fMaxPt);
+
+           if (fHistoPions->GetBinContent(binx, biny) >= fMaxPt)
+             fHistoPions->SetBinContent(binx, biny, fMaxPt);
+
+           if (fHistoKaons->GetBinContent(binx, biny) >= fMaxPt)
+             fHistoKaons->SetBinContent(binx, biny, fMaxPt);
+
+           if (fHistoProtons->GetBinContent(binx, biny) >= fMaxPt)
+             fHistoProtons->SetBinContent(binx, biny, fMaxPt);
          }
       }
    }
 
-   // Positive only
-   if ( fChargeId == 2 ) fHistoneg->Reset();
-
-   // Negative only
-   if ( fChargeId == 3 ) fHistopos->Reset();
+   // Particle type filter
+   if ( fParticleTypeId[0] == kFALSE) fHistopos->Reset();
+   if ( fParticleTypeId[1] == kFALSE) fHistoneg->Reset();
+   if ( fParticleTypeId[2] == kFALSE) fHistoElectrons->Reset();
+   if ( fParticleTypeId[3] == kFALSE) fHistoMuons->Reset();
+   if ( fParticleTypeId[4] == kFALSE) fHistoPions->Reset();
+   if ( fParticleTypeId[5] == kFALSE) fHistoKaons->Reset();
+   if ( fParticleTypeId[6] == kFALSE) fHistoProtons->Reset();
 
    fData->DataChanged();
 
    return fData;
 }
 
-
 //______________________________________________________________________________
 TEveCaloDataHist* AliEveLego::FilterAllData()
 {
@@ -314,31 +445,62 @@ TEveCaloDataHist* AliEveLego::FilterAllData()
    {
       fHistoposAllEvents->Reset();
       fHistonegAllEvents->Reset();
+      fHistoElectronsAllEvents->Reset();
+      fHistoMuonsAllEvents->Reset();
+      fHistoPionsAllEvents->Reset();
+      fHistoKaonsAllEvents->Reset();
+      fHistoProtonsAllEvents->Reset();
 
       TTree* t = AliEveEventManager::GetMaster()->GetESDTree();
 
       // Getting current tracks for each event, filling histograms
+      Int_t fAcceptedEvents = 0;
       for (int event = 0; event < t->GetEntries(); event++) {
 
-         t->GetEntry(event);
+        t->GetEntry(event);
+        const AliESDVertex *pv  = fEsd->GetPrimaryVertex();
 
-      const AliESDVertex *pv  = fEsd->GetPrimaryVertex();
+        if (fCollisionCandidatesOnly == kTRUE)
+          if (fPhysicsSelection->IsCollisionCandidate(fEsd) == kFALSE) continue;
 
-      for (Int_t n = 0; n < pv->GetNIndices(); n++ )
-      {
-         AliESDtrack *at = fEsd->GetTrack(pv->GetIndices()[n]);
+        fAcceptedEvents++;
 
-         if (at->GetSign() > 0) {
+        for (Int_t n = 0; n < pv->GetNIndices(); n++ )
+        {
+          AliESDtrack *at = fEsd->GetTrack(pv->GetIndices()[n]);
+          const Double_t sign = at->GetSign();
+          const Int_t prob = GetParticleType(at);
+
+          if (sign > 0)
             fHistoposAllEvents->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
-         }
-         if (at->GetSign() < 0) {
+
+          if (sign < 0)
             fHistonegAllEvents->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
-         }
-      }
+
+          if (prob == 0)
+            fHistoElectronsAllEvents->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
+
+          if (prob == 1)
+            fHistoMuonsAllEvents->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
+
+          if (prob == 2)
+            fHistoPionsAllEvents->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
+
+          if (prob == 3)
+            fHistoKaonsAllEvents->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
+
+          if (prob == 4)
+            fHistoProtonsAllEvents->Fill(at->Eta(), getphi(at->Phi()), fabs(at->Pt()));
+        }
       }
+      t->GetEntry(0);
+      printf("Number of events loaded: %i, with AliPhysicsSelection: %i\n",fAcceptedEvents,fCollisionCandidatesOnly);
+
    } else {
+
       LoadAllData();
-   }
+
+    }
    
    fDataAllEvents->DataChanged();
 
@@ -346,23 +508,39 @@ TEveCaloDataHist* AliEveLego::FilterAllData()
    if (GetPtMaxAE() >= fMaxPtAE){
       for (Int_t binx = 1; binx <= 100; binx++) {
          for (Int_t biny = 1; biny <= 80; biny++) {
-            if (fHistoposAllEvents->GetBinContent(binx, biny) >= fMaxPtAE)
-            {
-               fHistoposAllEvents->SetBinContent(binx, biny, fMaxPtAE);
-            }
-            if (fHistonegAllEvents->GetBinContent(binx, biny) >= fMaxPtAE)
-            {
-               fHistonegAllEvents->SetBinContent(binx, biny, fMaxPtAE);
-            }           
+
+            if (fHistoposAllEvents->GetBinContent(binx, biny) >= fMaxPtAE)            
+              fHistoposAllEvents->SetBinContent(binx, biny, fMaxPtAE);
+
+            if (fHistonegAllEvents->GetBinContent(binx, biny) >= fMaxPtAE)            
+              fHistonegAllEvents->SetBinContent(binx, biny, fMaxPtAE);
+
+            if (fHistoElectronsAllEvents->GetBinContent(binx, biny) >= fMaxPt)
+              fHistoElectronsAllEvents->SetBinContent(binx, biny, fMaxPt);
+
+            if (fHistoMuonsAllEvents->GetBinContent(binx, biny) >= fMaxPt)
+              fHistoMuonsAllEvents->SetBinContent(binx, biny, fMaxPt);
+
+            if (fHistoPionsAllEvents->GetBinContent(binx, biny) >= fMaxPt)
+              fHistoPionsAllEvents->SetBinContent(binx, biny, fMaxPt);
+
+            if (fHistoKaonsAllEvents->GetBinContent(binx, biny) >= fMaxPt)
+              fHistoKaonsAllEvents->SetBinContent(binx, biny, fMaxPt);
+
+            if (fHistoProtonsAllEvents->GetBinContent(binx, biny) >= fMaxPt)
+              fHistoProtonsAllEvents->SetBinContent(binx, biny, fMaxPt);
          }
       }
    }
 
    // Positive only
-   if ( fChargeIdAE == 2 ) fHistonegAllEvents->Reset();
-
-   // Negative only
-   if ( fChargeIdAE == 3 ) fHistoposAllEvents->Reset();
+   if ( fParticleTypeIdAE[0] == kFALSE ) fHistoposAllEvents->Reset();
+   if ( fParticleTypeIdAE[1] == kFALSE ) fHistonegAllEvents->Reset();
+   if ( fParticleTypeIdAE[2] == kFALSE ) fHistoElectronsAllEvents->Reset();
+   if ( fParticleTypeIdAE[3] == kFALSE ) fHistoMuonsAllEvents->Reset();
+   if ( fParticleTypeIdAE[4] == kFALSE ) fHistoPionsAllEvents->Reset();
+   if ( fParticleTypeIdAE[5] == kFALSE ) fHistoKaonsAllEvents->Reset();
+   if ( fParticleTypeIdAE[6] == kFALSE ) fHistoProtonsAllEvents->Reset();
 
    fDataAllEvents->DataChanged();
 
@@ -383,9 +561,6 @@ void AliEveLego::Update()
    // Create 3d view
    Create3DView();
 
-   // Show information about event;
-   ShowEventSeletion(fShowEventsInfo, kTRUE);
-
    // Update the viewers
    gEve->Redraw3D(kTRUE);
 }
@@ -562,15 +737,48 @@ TEveCaloDataHist* AliEveLego::LoadAllEvents()
                                  100,-1.5,1.5,80,-kPi,kPi);
       fHistonegAllEvents = new TH2F("fHistonegAllEvents","Histo 2d negative",
                                  100,-1.5,1.5,80,-kPi,kPi);
+      fHistoElectronsAllEvents = new TH2F("fHistoElectronsAllEvents","Histo 2d electrons",
+                                       100,-1.5,1.5,80,-kPi,kPi);
+      fHistoMuonsAllEvents = new TH2F("fHistoMuonsAllEvents","Histo 2d muons",
+                                       100,-1.5,1.5,80,-kPi,kPi);
+      fHistoPionsAllEvents = new TH2F("fHistoPionsAllEvents","Histo 2d pions",
+                                       100,-1.5,1.5,80,-kPi,kPi);
+      fHistoKaonsAllEvents = new TH2F("fHistoKaonsAllEvents","Histo 2d kaons",
+                                       100,-1.5,1.5,80,-kPi,kPi);
+      fHistoProtonsAllEvents = new TH2F("fHistoProtonsAllEvents","Histo 2d protons",
+                                       100,-1.5,1.5,80,-kPi,kPi);
 
       fHistoposAllEvents->SetDirectory(0);
       fHistonegAllEvents->SetDirectory(0);
+      fHistoElectronsAllEvents->SetDirectory(0);
+      fHistoMuonsAllEvents->SetDirectory(0);
+      fHistoPionsAllEvents->SetDirectory(0);
+      fHistoKaonsAllEvents->SetDirectory(0);
+      fHistoProtonsAllEvents->SetDirectory(0);
+
+      // colors from get_pdg_color() in /alice-macros/kine_tracks.C
+      static Color_t fElectro = 5;
+      static Color_t fMuon = 30;
+      static Color_t fPion = 3;
+      static Color_t fKaon = 38;
+      static Color_t fProton = 10;
 
       fDataAllEvents = new TEveCaloDataHist();
       fDataAllEvents->AddHistogram(fHistonegAllEvents);
       fDataAllEvents->RefSliceInfo(0).Setup("NegCg:", 0, kBlue);
       fDataAllEvents->AddHistogram(fHistoposAllEvents);
       fDataAllEvents->RefSliceInfo(1).Setup("PosCg:", 0, kRed);
+      fDataAllEvents->AddHistogram(fHistoElectronsAllEvents);
+      fDataAllEvents->RefSliceInfo(2).Setup("Electrons:", 0, fElectro);
+      fDataAllEvents->AddHistogram(fHistoMuonsAllEvents);
+      fDataAllEvents->RefSliceInfo(3).Setup("Muons:", 0, fMuon);
+      fDataAllEvents->AddHistogram(fHistoPionsAllEvents);
+      fDataAllEvents->RefSliceInfo(4).Setup("Pions:", 0, fPion);
+      fDataAllEvents->AddHistogram(fHistoKaonsAllEvents);
+      fDataAllEvents->RefSliceInfo(5).Setup("Kaons:", 0, fKaon);
+      fDataAllEvents->AddHistogram(fHistoProtonsAllEvents);
+      fDataAllEvents->RefSliceInfo(6).Setup("Protons:", 0, fProton);
+
       fDataAllEvents->GetEtaBins()->SetTitleFont(120);
       fDataAllEvents->GetEtaBins()->SetTitle("h");
       fDataAllEvents->GetPhiBins()->SetTitleFont(120);
@@ -601,7 +809,7 @@ TEveCaloDataHist* AliEveLego::LoadAllEvents()
       CreateHistoLego(slotLeftBottom);
       CreateProjections(slotRightTop, slotRightBottom);
 
-      LoadAllData();
+      FilterAllData();
 
       gEve->Redraw3D(kTRUE);
 
@@ -614,18 +822,73 @@ TEveCaloDataHist* AliEveLego::LoadAllEvents()
    return fDataAllEvents;
 }
 
+//______________________________________________________________________________
+void AliEveLego::ApplyParticleTypeSelectionAE()
+{
+  // reload all events applying particle type selection
+  FilterAllData();
+}
+
 //______________________________________________________________________________
 Float_t AliEveLego::GetPtMax()
 {
+   // return pT maximum
    return fData->GetMaxVal(fLego->GetPlotEt());
 }
 
 //______________________________________________________________________________
 Float_t AliEveLego::GetPtMaxAE()
 {
+   // return pT max from all events
    return fDataAllEvents->GetMaxVal(fLegoAllEvents->GetPlotEt());
 }
 
+//______________________________________________________________________________
+Int_t AliEveLego::GetParticleType(AliESDtrack *track)
+{
+  // determine the particle type
+  Double_t *prob = new Double_t[5];
+  track->GetESDpid(prob);
+
+  Double_t max = prob[0];
+  Int_t index = 0;
+
+  for (Int_t i = 1 ; i < 5; i++)
+  {
+    if (prob[i] > max){
+      max = prob[i];
+      index = i;
+    }
+  }
+  return index;
+}
+
+//______________________________________________________________________________
+void AliEveLego::SetParticleType(Int_t id)
+{
+  // activate/deactivate particles types
+  if (fParticleTypeId[id] == 0)
+  {
+    fParticleTypeId[id] = 1;
+  } else {
+    fParticleTypeId[id] = 0;
+  }
+
+  Update();
+}
+
+//______________________________________________________________________________
+void AliEveLego::SetParticleTypeAE(Int_t id)
+{
+  // activate/deactivate particles types
+  if (fParticleTypeIdAE[id] == 0)
+  {
+    fParticleTypeIdAE[id] = 1;
+  } else {
+    fParticleTypeIdAE[id] = 0;
+  }
+}
+
 //______________________________________________________________________________
 void AliEveLego::SetMaxPt(Double_t val)
 {
@@ -648,6 +911,11 @@ void AliEveLego::SetThreshold(Double_t val)
    // Setting up the new threshold for all histograms
    fData->SetSliceThreshold(0,val);
    fData->SetSliceThreshold(1,val);
+   fData->SetSliceThreshold(2,val);
+   fData->SetSliceThreshold(3,val);
+   fData->SetSliceThreshold(4,val);
+   fData->SetSliceThreshold(5,val);
+   fData->SetSliceThreshold(6,val);
    fData->DataChanged();
 
    gEve->Redraw3D(kTRUE);
@@ -659,125 +927,50 @@ void AliEveLego::SetThresholdAE(Double_t val)
    // Setting up the new threshold for all histograms
    fDataAllEvents->SetSliceThreshold(0,val);
    fDataAllEvents->SetSliceThreshold(1,val);
+   fDataAllEvents->SetSliceThreshold(2,val);
+   fDataAllEvents->SetSliceThreshold(3,val);
+   fDataAllEvents->SetSliceThreshold(4,val);
+   fDataAllEvents->SetSliceThreshold(5,val);
+   fDataAllEvents->SetSliceThreshold(6,val);
    fDataAllEvents->DataChanged();
 
    gEve->Redraw3D(kTRUE);
 }
 
 //______________________________________________________________________________
-void AliEveLego::SetEventSelection()
+void AliEveLego::SwitchDataType()
 {
-   // activate/deactivate info box
-   if (fShowEventsInfo == 0)
-   {
-      fShowEventsInfo = 1;
-   } else {
-      fShowEventsInfo = 0;
-   }
-
-   ShowEventSeletion(fShowEventsInfo);
-}
-
-//______________________________________________________________________________
-void AliEveLego::ShowEventSeletion(Bool_t show, Bool_t updateonly)
-{
-   // activate/deactivate info box
-   if (show == 0)
-   {
-      gEve->GetDefaultGLViewer()->RemoveOverlayElement(fGButton);
-      fAl->Get3DView()->GetGLViewer()->RemoveOverlayElement(fGButton);
-      fHisto2dv->GetGLViewer()->RemoveOverlayElement(fGButton);
-
-      gEve->GetDefaultGLViewer()->RemoveOverlayElement(fB1);
-      fAl->Get3DView()->GetGLViewer()->RemoveOverlayElement(fB1);
-      fHisto2dv->GetGLViewer()->RemoveOverlayElement(fB1);
-
-      gEve->GetDefaultGLViewer()->RemoveOverlayElement(fB2);
-      fAl->Get3DView()->GetGLViewer()->RemoveOverlayElement(fB2);
-      fHisto2dv->GetGLViewer()->RemoveOverlayElement(fB2);
-
-   } else {
-
-      //Collision candidate
-      if (updateonly == kFALSE) {
-         gEve->GetDefaultGLViewer()->AddOverlayElement(fGButton);
-         fAl->Get3DView()->GetGLViewer()->AddOverlayElement(fGButton);
-         fHisto2dv->GetGLViewer()->AddOverlayElement(fGButton);
-      }
-
-      Bool_t ev = fPhysicsSelection->IsCollisionCandidate(fEsd);
-
-      if (ev == 1)
-      {
-         fGButton->SetText("Collision candidate: YES");
-      } else {
-         fGButton->SetText("Collision candidate: NO ");
-      }
-
-      // Beam 1 & 2 setup: method 1
-      if (updateonly == kFALSE) {
-         gEve->GetDefaultGLViewer()->AddOverlayElement(fB1);
-         fAl->Get3DView()->GetGLViewer()->AddOverlayElement(fB1);
-         fHisto2dv->GetGLViewer()->AddOverlayElement(fB1);
-
-         gEve->GetDefaultGLViewer()->AddOverlayElement(fB2);
-         fAl->Get3DView()->GetGLViewer()->AddOverlayElement(fB2);
-         fHisto2dv->GetGLViewer()->AddOverlayElement(fB2);
-      }
-
-      Bool_t b1  = fEsd->IsTriggerClassFired("CINT1A-ABCE-NOPF-ALL");
-      Bool_t b2  = fEsd->IsTriggerClassFired("CINT1C-ABCE-NOPF-ALL");
-      Bool_t b12 = fEsd->IsTriggerClassFired("CINT1B-ABCE-NOPF-ALL");
-
-      if (b1 == 1 || b12 == 1)
-      {
-         fB1->SetText("Beam 1: YES");
-         fB1->SetBackColor(0x00ff00);
-      } else {
-         fB1->SetText("Beam 1: NO");
-         fB1->SetBackColor(0xff0000);
-      }
-
-      if (b2 == 1 || b12 == 1)
-      {
-         fB2->SetText("Beam 2: YES");
-         fB2->SetBackColor(0x00ff00);
-      } else {
-         fB2->SetText("Beam 2: NO");
-         fB2->SetBackColor(0xff0000);
-      }
-   }
+  // activate/deactivate MC / real data type
+  if (fIsMC == 0)
+  {
+    fIsMC = 1;
+  } else {
+    fIsMC = 0;
+  }
+  //Removing defaul physics selection
 
-   gEve->Redraw3D(kTRUE);
+  delete fPhysicsSelection;
+  fPhysicsSelection = NULL;
 
+  fPhysicsSelection = new AliPhysicsSelection();
+  fPhysicsSelection->SetAnalyzeMC(fIsMC);
+  fPhysicsSelection->Initialize(fEsd->GetRunNumber());
+  FilterAllData();
 }
 
 //______________________________________________________________________________
-void AliEveLego::SelectEventSelection(Int_t id)
-{
-   // show trigger information
-   if (id == 0)
-   {
-      fEventSelector->SetSelectOnTriggerType(kFALSE);
-   } else {
-      if (id == 1) fEventSelector->SetTriggerType("CINT1A-ABCE-NOPF-ALL");
-      if (id == 2) fEventSelector->SetTriggerType("CINT1C-ABCE-NOPF-ALL");
-      if (id == 3) fEventSelector->SetTriggerType("CINT1B-ABCE-NOPF-ALL");
-      fEventSelector->SetSelectOnTriggerType(kTRUE);
-   }
-}
-
-//______________________________________________________________________________
-void AliEveLego::ShowPrevEvent()
+void AliEveLego::SetCollisionCandidatesOnly()
 {
-   AliEveEventManager::GetMaster()->PrevEvent();
+  // activate/deactivate MC / real data type
+  if (fCollisionCandidatesOnly == 0)
+  {
+    fCollisionCandidatesOnly = 1;
+  } else {
+    fCollisionCandidatesOnly = 0;
+  }
+  FilterAllData();
 }
 
-//______________________________________________________________________________
-void AliEveLego::ShowNextEvent()
-{
-   AliEveEventManager::GetMaster()->NextEvent();
-}
 /******************************************************************************/
 
 
index e132034e73bfbc196dcb2f9d981710f28ea89b37..7e71577d5098a79899280859f88df775ba4303b1 100644 (file)
@@ -16,6 +16,7 @@ class AliESDEvent;
 class AliEveEventSelector;
 class AliEveMultiView;
 class AliPhysicsSelection;
+class AliESDtrack;
 
 class TEveCaloDataHist;
 class TEveCaloLego;
@@ -50,20 +51,19 @@ public:
   AliEveMultiView*  GetMultiView()      {   return fAl;               }
   Float_t           GetPtMax();
   Float_t           GetPtMaxAE();
+  Int_t             GetParticleType(AliESDtrack *track);
 
   // Set Methods
-  void SetCharge(Int_t id) {  fChargeId = id;  Update();  }
-  void SetAllEventsCharge(Int_t id) {  fChargeIdAE = id; FilterAllData();  }
+  void SetParticleType(Int_t id);
+  void SetParticleTypeAE(Int_t id);
   void SetTracks(Int_t id) {  fTracksId = id;  Update();  }
   void SetTracksAE(Int_t id) {  fTracksIdAE = id;  FilterAllData();  }
-  void SetEvents(Int_t id) {  fEventsId = id;  Update();  }
   void SetMaxPt(Double_t val);
   void SetMaxPtAE(Double_t val);
   void SetThreshold(Double_t val);
   void SetThresholdAE(Double_t val);
-  void SetEventSelection();
-  void ShowPrevEvent();
-  void ShowNextEvent();
+  void SwitchDataType();
+  void SetCollisionCandidatesOnly();
 
   // Functions
   void Update();
@@ -78,16 +78,16 @@ public:
   void              CreateProjections(TEveWindowSlot* slot1,
                                       TEveWindowSlot* slot2);
   TEveCaloDataHist* LoadAllEvents();
-  void              ShowEventSeletion(Bool_t show, Bool_t updateonly = kFALSE);
-  void              SelectEventSelection(Int_t id);
+  void ApplyParticleTypeSelectionAE();
 
 private:
-  Int_t fChargeId;  // determine if the charge is +/-
-  Int_t fTracksId;  // determine tracks selection
-  Int_t fEventsId;  // determine events selection
-  Float_t fMaxPt;   // set maximum pT
+  Bool_t fIsMC;                    // switch to MC mode for AliPhysicsSelection
+  Bool_t fCollisionCandidatesOnly; // activate flag when loading all events
+  Bool_t *fParticleTypeId;    // determine how particles to show
+  Bool_t *fParticleTypeIdAE;  // determine how particles to show
+  Int_t   fTracksId;          // determine tracks selection
+  Float_t fMaxPt;             // set maximum pT
 
-  Int_t fChargeIdAE;  // determine if the charge is +/- for all events
   Int_t fTracksIdAE;  // determine tracks selection for all events
   Float_t fMaxPtAE;   // determine maximum pT for all events
 
@@ -97,6 +97,16 @@ private:
   TH2F *fHistoposAllEvents;               // positive charge histogram for all events
   TH2F *fHistoneg;                        // negative charge histogram
   TH2F *fHistonegAllEvents;               // negative charge histogram for all events
+  TH2F *fHistoElectrons;                  // electrons histogram
+  TH2F *fHistoElectronsAllEvents;         // electrons histogram all events
+  TH2F *fHistoMuons;                      // muons histogram
+  TH2F *fHistoMuonsAllEvents;             // muons histogram all events
+  TH2F *fHistoPions;                      // pions histogram
+  TH2F *fHistoPionsAllEvents;             // pions histogram all events
+  TH2F *fHistoKaons;                      // kaons histogram
+  TH2F *fHistoKaonsAllEvents;             // kaons histogram all events
+  TH2F *fHistoProtons;                    // protons histogram
+  TH2F *fHistoProtonsAllEvents;           // protons histogram all events
 
   TEveCaloDataHist *fData;          // calo data for 2D, 3D histograms
   TEveCaloDataHist *fDataAllEvents; // calo data for all events
@@ -123,12 +133,6 @@ private:
   TEveCaloLegoOverlay* fHisto2dAllEventsLegoOverlay; // Overlay for calo lego all events
   TEveWindowSlot* fHisto2dAllEventsSlot;  // window slot for 2d all events histogram
 
-  AliEveEventSelector *fEventSelector;  // event selector
-  Bool_t fShowEventsInfo;               // determine if show events info
-  TGLOverlayButton *fGButton;           // button box with collision candidate information
-  TGLOverlayButton *fB1;                // button box with beam 1 information
-  TGLOverlayButton *fB2;                // button box with beam 2 information
-
   AliEveLego(const AliEveLego&);            // Not implemented
   AliEveLego& operator=(const AliEveLego&); // Not implemented
 
index 0c0a6fb5659ce752535970b97919847170c7e42e..c19e58f7cacbf59a484dec7c91aff99f3a3a269a 100644 (file)
@@ -34,31 +34,38 @@ AliEveLegoEditor::AliEveLegoEditor(const TGWindow *p, Int_t width, Int_t height,
              UInt_t options, Pixel_t back) :
   TGedFrame(p, width, height, options | kVerticalFrame, back),
   fM(0),
-
   fAllEventsButton(0),
   fParticlesBG(0),
   fTrackSelection(0),
-  fEventSelection(0),
-  fRevents(0),
+  fPosCharged(0),
+  fNegCharged(0),
+  fElectrons(0),
+  fMuons(0),
+  fPions(0),
+  fKaons(0),
+  fProtons(0),
   fLabel(0),
   fLabel1(0),
   fThreshold(0),
   fMaxPt(0),
   fSelect(0),
-  fButtonPrev(0),
-  fButtonNext(0),
-
-  fParticlesBGAE(0),
+  fParticlesBGAE(0),  
   fTrackSelectionAE(0),
-  fEventSelectionAE(0),
-  fReventsAE(0),
+  fPosChargedAE(0),
+  fNegChargedAE(0),
+  fElectronsAE(0),
+  fMuonsAE(0),
+  fPionsAE(0),
+  fKaonsAE(0),
+  fProtonsAE(0),
+  fApplyChanges(0),
   fLabelAE(0),
   fLabel1AE(0),
   fThresholdAE(0),
   fMaxPtAE(0),
-  fSelectAE(0),
-  fButtonPrevAE(0),
-  fButtonNextAE(0)
+  fEventControl(0),
+  fIsMC(kFALSE),
+  fCollisionCandidatesOnly(0)
 {
   // Constructor.
   MakeTitle("AliEveLego");
@@ -68,13 +75,41 @@ AliEveLegoEditor::AliEveLegoEditor(const TGWindow *p, Int_t width, Int_t height,
   AddFrame(fAllEventsButton, new TGLayoutHints(kLHintsExpandX));
   fAllEventsButton->Connect("Clicked()", "AliEveLegoEditor", this, "DoAllEvents()");
 
-  fParticlesBG = new TGButtonGroup(this, "Charge selection:", kVerticalFrame);
-  fRcharge[0] = new TGRadioButton(fParticlesBG, new TGHotString("&Positive and negative"));
-  fRcharge[1] = new TGRadioButton(fParticlesBG, new TGHotString("&Only positive"));
-  fRcharge[2] = new TGRadioButton(fParticlesBG, new TGHotString("&Only negative"));
-  fRcharge[0]->SetState(kButtonDown);
+  fParticlesBG = new TGGroupFrame(this, "Particle selection:", kVerticalFrame);
+  fPosCharged  = new TGCheckButton(fParticlesBG, new TGHotString("&Positive charged"));
+  fNegCharged  = new TGCheckButton(fParticlesBG, new TGHotString("&Negative charged"));
+  fElectrons   = new TGCheckButton(fParticlesBG, new TGHotString("&Electrons"));
+  fMuons       = new TGCheckButton(fParticlesBG, new TGHotString("&Muons"));
+  fPions       = new TGCheckButton(fParticlesBG, new TGHotString("&Pions"));
+  fKaons       = new TGCheckButton(fParticlesBG, new TGHotString("&Kaons"));
+  fProtons     = new TGCheckButton(fParticlesBG, new TGHotString("&Protons"));
+
+  fPosCharged->SetState(kButtonDown);
+  fNegCharged->SetState(kButtonDown);
+  fElectrons->SetState(kButtonUp);
+  fMuons->SetState(kButtonUp);
+  fPions->SetState(kButtonUp);
+  fKaons->SetState(kButtonUp);
+  fProtons->SetState(kButtonUp);
+
+  fPosCharged->Connect("Clicked()", "AliEveLegoEditor", this, "ShowPosCharge()");
+  fNegCharged->Connect("Clicked()", "AliEveLegoEditor", this, "ShowNegCharge()");
+  fElectrons->Connect("Clicked()", "AliEveLegoEditor", this, "ShowElectrons()");
+  fMuons->Connect("Clicked()", "AliEveLegoEditor", this, "ShowMuons()");
+  fPions->Connect("Clicked()", "AliEveLegoEditor", this, "ShowPions()");
+  fKaons->Connect("Clicked()", "AliEveLegoEditor", this, "ShowKaons()");
+  fProtons->Connect("Clicked()", "AliEveLegoEditor", this, "ShowProtons()");
+
+  fParticlesBG->AddFrame(fPosCharged, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+  fParticlesBG->AddFrame(fNegCharged, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+  fParticlesBG->AddFrame(fElectrons, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+  fParticlesBG->AddFrame(fMuons, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+  fParticlesBG->AddFrame(fPions, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+  fParticlesBG->AddFrame(fKaons, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+  fParticlesBG->AddFrame(fProtons, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
+  fParticlesBG->SetLayoutManager(new TGVerticalLayout(fParticlesBG));
+
   AddFrame(fParticlesBG, new TGLayoutHints(kLHintsExpandX));
-  fParticlesBG->Connect("Clicked(Int_t)", "AliEveLegoEditor", this, "ShowByCharge(Int_t)");
 
   fTrackSelection = new TGButtonGroup(this, "Track selection:", kHorizontalFrame);
   fRtracks[0] = new TGRadioButton(fTrackSelection, new TGHotString("&All tracks  "));
@@ -115,90 +150,106 @@ AliEveLegoEditor::AliEveLegoEditor(const TGWindow *p, Int_t width, Int_t height,
   horz1->AddFrame( fThreshold, new TGLayoutHints(kLHintsRight | kLHintsNormal | kLHintsCenterY));
 
 
+}
 
-  //***************
-
-  // Events selection
-  fEventSelection = new TGGroupFrame(this, "Event selection:", kHorizontalFrame);
-
-  fRevents = new TGCheckButton(fEventSelection, new TGHotString("&Show info "));
-  fRevents->SetState(kButtonUp);
-  fRevents->Connect("Clicked()", "AliEveLegoEditor", this, "ShowEventSelection()");
-  fEventSelection->AddFrame(fRevents, new TGLayoutHints(kLHintsLeft | kLHintsTop));
-
-  fSelect = new TGComboBox(fEventSelection,-1,kHorizontalFrame | kSunkenFrame | kDoubleBorder | kOwnBackground);
-  fSelect->AddEntry("All events",0);
-  fSelect->AddEntry("Beam 1",1);
-  fSelect->AddEntry("Beam 2",2);
-  fSelect->AddEntry("Beams 1 & 2",3);
-  fSelect->Resize(102,22);
-  fSelect->Select(0);
-  fEventSelection->AddFrame(fSelect, new TGLayoutHints(kLHintsRight | kLHintsExpandX));
-
-  fSelect->Connect("Selected(Int_t)", "AliEveLegoEditor", this, "SelectEventSelection(Int_t)");
-
-  AddFrame(fEventSelection, new TGLayoutHints(kLHintsExpandX));
-
-  //**********
+/******************************************************************************/
 
-  TGHorizontalFrame *horz3 = new TGHorizontalFrame(this);
+//______________________________________________________________________________
+void AliEveLegoEditor::SetModel(TObject* obj)
+{
+  fM = dynamic_cast<AliEveLego*>(obj);
+}
 
-  fButtonPrev = new TGTextButton(horz3, "Previous event");
-  horz3->AddFrame(fButtonPrev, new TGLayoutHints(kLHintsLeft | kLHintsCenterY | kLHintsExpandX));
-  fButtonPrev->Connect("Clicked()", "AliEveLegoEditor", this, "ShowPrevEvent()");
+//______________________________________________________________________________
+void AliEveLegoEditor::DoAllEvents()
+{
+  fAllEventsButton->SetEnabled(kFALSE);
+  CreateAllEventsEditor();
+  fM->LoadAllEvents();
+}
 
-  fButtonNext = new TGTextButton(horz3, "Next event");
-  horz3->AddFrame( fButtonNext, new TGLayoutHints(kLHintsRight | kLHintsNormal | kLHintsExpandX));
-  fButtonNext->Connect("Clicked()", "AliEveLegoEditor", this, "ShowNextEvent()");
+//______________________________________________________________________________
+void AliEveLegoEditor::ShowPosCharge()
+{   
+  fM->SetParticleType(0);
+}
 
-  AddFrame(horz3, new TGLayoutHints(kLHintsExpandX | kLHintsCenterY));
+//______________________________________________________________________________
+void AliEveLegoEditor::ShowNegCharge()
+{
+  fM->SetParticleType(1);
+}
 
-  //**********
+//______________________________________________________________________________
+void AliEveLegoEditor::ShowElectrons()
+{
+  fM->SetParticleType(2);
+}
 
+//______________________________________________________________________________
+void AliEveLegoEditor::ShowMuons()
+{
+  fM->SetParticleType(3);
+}
 
+//______________________________________________________________________________
+void AliEveLegoEditor::ShowPions()
+{
+  fM->SetParticleType(4);
 }
 
-/******************************************************************************/
+//______________________________________________________________________________
+void AliEveLegoEditor::ShowKaons()
+{
+  fM->SetParticleType(5);
+}
 
 //______________________________________________________________________________
-void AliEveLegoEditor::SetModel(TObject* obj)
+void AliEveLegoEditor::ShowProtons()
 {
-  fM = dynamic_cast<AliEveLego*>(obj);
+  fM->SetParticleType(6);
 }
 
-/******************************************************************************/
+//______________________________________________________________________________
+void AliEveLegoEditor::ShowPosChargeAE()
+{
+   fM->SetParticleTypeAE(0);
+}
 
-// Implements callback/slot methods
+//______________________________________________________________________________
+void AliEveLegoEditor::ShowNegChargeAE()
+{
+  fM->SetParticleTypeAE(1);
+}
 
 //______________________________________________________________________________
-// void AliEveLegoEditor::DoXYZZ()
-// {
-//    // Slot for XYZZ.
-//
-//    fM->SetXYZZ(fXYZZ->GetValue());
-//    Update();
-// }
+void AliEveLegoEditor::ShowElectronsAE()
+{
+  fM->SetParticleTypeAE(2);
+}
 
 //______________________________________________________________________________
-void AliEveLegoEditor::DoAllEvents()
+void AliEveLegoEditor::ShowMuonsAE()
 {
-  // Slot for XYZZ.
-  fAllEventsButton->SetEnabled(kFALSE);
-  CreateAllEventsEditor();
-  fM->LoadAllEvents();
+  fM->SetParticleTypeAE(3);
+}
 
+//______________________________________________________________________________
+void AliEveLegoEditor::ShowPionsAE()
+{
+  fM->SetParticleTypeAE(4);
 }
 
 //______________________________________________________________________________
-void AliEveLegoEditor::ShowByCharge(Int_t id)
-{   
-  fM->SetCharge(id);
+void AliEveLegoEditor::ShowKaonsAE()
+{
+  fM->SetParticleTypeAE(5);
 }
 
 //______________________________________________________________________________
-void AliEveLegoEditor::ShowByChargeAE(Int_t id)
+void AliEveLegoEditor::ShowProtonsAE()
 {
-   fM->SetAllEventsCharge(id);
+  fM->SetParticleTypeAE(6);
 }
 
 //______________________________________________________________________________
@@ -237,41 +288,54 @@ void AliEveLegoEditor::ShowByTracksAE(Int_t id)
    fM->SetTracksAE(id);
 }
 
-//______________________________________________________________________________
-void AliEveLegoEditor::ShowByEvents(Int_t id)
-{
-   fM->SetEvents(id);
-}
-
-//______________________________________________________________________________
-void AliEveLegoEditor::ShowEventSelection()
-{
-   fM->SetEventSelection();
-}
-
-//______________________________________________________________________________
-void AliEveLegoEditor::SelectEventSelection(Int_t id)
-{
-   fM->SelectEventSelection(id);
-}
-
 //______________________________________________________________________________
 void AliEveLegoEditor::CreateAllEventsEditor()
 {
    // create the GUI of all events
    TGVerticalFrame *this2 = this->CreateEditorTabSubFrame("All events style");
 
-   TGLabel *ftitle = new TGLabel(this2, "AliLego all events ------");
-   this2->AddFrame(ftitle, new TGLayoutHints(kLHintsLeft | kLHintsCenterY));
+   fEventControl = new TGButtonGroup(this2, "Event control:", kVerticalFrame);
+   fIsMC = new TGCheckButton(fEventControl, new TGHotString("&Data is from simulation (MC)"));
+   fCollisionCandidatesOnly = new TGCheckButton(fEventControl, new TGHotString("&Only collision candidates events"));
+
+   fIsMC->SetState(kButtonUp);
+   fCollisionCandidatesOnly->SetState(kButtonUp);
+
+   fIsMC->Connect("Clicked()", "AliEveLegoEditor", this, "DataIsMC()");
+   fCollisionCandidatesOnly->Connect("Clicked()", "AliEveLegoEditor", this, "CollisionCandidatesOnly()");
+   this2->AddFrame(fEventControl, new TGLayoutHints(kLHintsExpandX));
+
+   fParticlesBGAE = new TGButtonGroup(this2, "Particle selection:", kVerticalFrame);
+
+   fPosChargedAE  = new TGCheckButton(fParticlesBGAE, new TGHotString("&Positive charged"));
+   fNegChargedAE  = new TGCheckButton(fParticlesBGAE, new TGHotString("&Negative charged"));
+   fElectronsAE   = new TGCheckButton(fParticlesBGAE, new TGHotString("&Electrons"));
+   fMuonsAE       = new TGCheckButton(fParticlesBGAE, new TGHotString("&Muons"));
+   fPionsAE       = new TGCheckButton(fParticlesBGAE, new TGHotString("&Pions"));
+   fKaonsAE       = new TGCheckButton(fParticlesBGAE, new TGHotString("&Kaons"));
+   fProtonsAE     = new TGCheckButton(fParticlesBGAE, new TGHotString("&Protons"));
+
+   fPosChargedAE->SetState(kButtonDown);
+   fNegChargedAE->SetState(kButtonDown);
+   fElectronsAE->SetState(kButtonUp);
+   fMuonsAE->SetState(kButtonUp);
+   fPionsAE->SetState(kButtonUp);
+   fKaonsAE->SetState(kButtonUp);
+   fProtonsAE->SetState(kButtonUp);
+
+   fPosChargedAE->Connect("Clicked()", "AliEveLegoEditor", this, "ShowPosChargeAE()");
+   fNegChargedAE->Connect("Clicked()", "AliEveLegoEditor", this, "ShowNegChargeAE()");
+   fElectronsAE->Connect("Clicked()", "AliEveLegoEditor", this, "ShowElectronsAE()");
+   fMuonsAE->Connect("Clicked()", "AliEveLegoEditor", this, "ShowMuonsAE()");
+   fPionsAE->Connect("Clicked()", "AliEveLegoEditor", this, "ShowPionsAE()");
+   fKaonsAE->Connect("Clicked()", "AliEveLegoEditor", this, "ShowKaonsAE()");
+   fProtonsAE->Connect("Clicked()", "AliEveLegoEditor", this, "ShowProtonsAE()");
 
-   fParticlesBGAE = new TGButtonGroup(this2, "Charge selection:", kVerticalFrame);
-   fRchargeAE[0] = new TGRadioButton(fParticlesBGAE, new TGHotString("&Positive and negative"));
-   fRchargeAE[1] = new TGRadioButton(fParticlesBGAE, new TGHotString("&Only positive"));
-   fRchargeAE[2] = new TGRadioButton(fParticlesBGAE, new TGHotString("&Only negative"));
-   fRchargeAE[0]->SetState(kButtonDown);
    this2->AddFrame(fParticlesBGAE, new TGLayoutHints(kLHintsExpandX));
 
-   fParticlesBGAE->Connect("Clicked(Int_t)", "AliEveLegoEditor", this, "ShowByChargeAE(Int_t)");
+   fApplyChanges = new TGTextButton(this2, "Apply particle selection");
+   this2->AddFrame(fApplyChanges, new TGLayoutHints(kLHintsExpandX));
+   fApplyChanges->Connect("Clicked()", "AliEveLegoEditor", this, "ApplyChanges()");
 
    fTrackSelectionAE = new TGButtonGroup(this2, "Track selection:", kHorizontalFrame);
    fRtracksAE[0] = new TGRadioButton(fTrackSelectionAE, new TGHotString("&All tracks  "));
@@ -314,17 +378,23 @@ void AliEveLegoEditor::CreateAllEventsEditor()
 
    this2->AddFrame(horz1AE, new TGLayoutHints(kLHintsExpandX | kLHintsCenterY));
 
+
 }
 
 //______________________________________________________________________________
-void AliEveLegoEditor::ShowPrevEvent()
+void AliEveLegoEditor::ApplyChanges()
 {
-   fM->ShowPrevEvent();
+  fM->ApplyParticleTypeSelectionAE();
 }
 
 //______________________________________________________________________________
-void AliEveLegoEditor::ShowNextEvent()
+void AliEveLegoEditor::DataIsMC()
 {
-   fM->ShowNextEvent();
+  fM->SwitchDataType();
 }
 
+//______________________________________________________________________________
+void AliEveLegoEditor::CollisionCandidatesOnly()
+{
+  fM->SetCollisionCandidatesOnly();
+}
index 11cccc3e001878c7ef68a8d9381f6aa5f8653968..1abf63ff7e979ec60dce80d1d6b7d49387caded1 100644 (file)
@@ -39,55 +39,73 @@ public:
 
    // Declare callback/slot methods
    void DoAllEvents();
-   void ShowByCharge(Int_t id);
-   void ShowByChargeAE(Int_t id);
+   void ShowPosCharge();
+   void ShowNegCharge();
+   void ShowElectrons();
+   void ShowMuons();
+   void ShowPions();
+   void ShowKaons();
+   void ShowProtons();
+   void ShowPosChargeAE();
+   void ShowNegChargeAE();
+   void ShowElectronsAE();
+   void ShowMuonsAE();
+   void ShowPionsAE();
+   void ShowKaonsAE();
+   void ShowProtonsAE();
    void SetThreshold();
    void SetThresholdAE();
    void SetMaxPt();
    void SetMaxPtAE();
    void ShowByTracks(Int_t id);
    void ShowByTracksAE(Int_t id);
-   void ShowByEvents(Int_t id);
-   void ShowEventSelection();
-   void SelectEventSelection(Int_t id);
    void CreateAllEventsEditor();
-   void ShowPrevEvent();
-   void ShowNextEvent();
+   void ApplyChanges();
+   void DataIsMC();
+   void CollisionCandidatesOnly();
 
 protected:
    AliEveLego            *fM; // Model object.
 
    // Single event GUI
    TGTextButton  *fAllEventsButton; // text button for all events
-   TGButtonGroup *fParticlesBG;     // particle selection button
+   TGGroupFrame  *fParticlesBG;     // particle selection button
    TGButtonGroup *fTrackSelection;  // track selection button
-   TGGroupFrame *fEventSelection;   // event selection button
-   TGCheckButton *fRevents;         // check button for events
-   TGRadioButton *fRcharge[3];      // radio button for charge selection
+   TGCheckButton *fPosCharged;      // check button for positive only charged particles
+   TGCheckButton *fNegCharged;      // check button for negative only charged particles
+   TGCheckButton *fElectrons;       // check button for electrons
+   TGCheckButton *fMuons;           // check button for muons
+   TGCheckButton *fPions;           // check button for pions
+   TGCheckButton *fKaons;           // check button for kaons
+   TGCheckButton *fProtons;         // check button for protons
    TGRadioButton *fRtracks[2];      // radio button for track selection
    TGLabel       *fLabel;           // label for track selection
    TGLabel       *fLabel1;          // label for event selection
    TGNumberEntry *fThreshold;       // number entry to setup threshold
    TGNumberEntry *fMaxPt;           // number entry to setup max pt
    TGComboBox    *fSelect;          // combo box to filter events
-   TGTextButton  *fButtonPrev;      // previous event selection button
-   TGTextButton  *fButtonNext;      // next event selection button
+
 
    // All events GUI
    TGButtonGroup *fParticlesBGAE;    // particle selection button for all events
    TGButtonGroup *fTrackSelectionAE; // track selection for all events
-   TGGroupFrame  *fEventSelectionAE; // event selection for all events
-   TGCheckButton *fReventsAE;        // check button for event selection
-   TGRadioButton *fRchargeAE[3];     // radio button event
+   TGCheckButton *fPosChargedAE;     // check button for positive only charged particles
+   TGCheckButton *fNegChargedAE;     // check button for negative only charged particles
+   TGCheckButton *fElectronsAE;      // check button for electrons
+   TGCheckButton *fMuonsAE;          // check button for muons
+   TGCheckButton *fPionsAE;          // check button for pions
+   TGCheckButton *fKaonsAE;          // check button for kaons
+   TGCheckButton *fProtonsAE;        // check button for protons
+   TGTextButton  *fApplyChanges;     // apply selections
    TGRadioButton *fRtracksAE[2];     // radio button track
    TGLabel       *fLabelAE;          // label for track selection
    TGLabel       *fLabel1AE;         // label for event selection
    TGNumberEntry *fThresholdAE;      // number entry to setup threshold
    TGNumberEntry *fMaxPtAE;          // number entry to setup max pt
-   TGComboBox    *fSelectAE;         // combo box to filter events
-   TGTextButton  *fButtonPrevAE;     // previous event selection button
-   TGTextButton  *fButtonNextAE;     // next event selection button
 
+   TGButtonGroup *fEventControl;            // event control panel
+   TGCheckButton *fIsMC;                    // check if data is from MC
+   TGCheckButton *fCollisionCandidatesOnly; // fill all collision candidates events
 
 private:
 
index f252137bee860d986915e70fc7c1bc4b945cd4ce..d4af5d0087d8d49de2f173e97af8fbebf0107769 100644 (file)
@@ -88,3 +88,7 @@
 // AliEveLego
 #pragma link C++ class AliEveLego+;
 #pragma link C++ class AliEveLegoEditor+;
+
+// AliEveBeamInfo
+#pragma link C++ class AliEveBeamsInfo+;
+#pragma link C++ class AliEveBeamsInfoEditor+;
index 271e36adea3eb104f3254b09eed76c9004bd9330..fa824cca09c44364d90904eefe2712b1fa177370 100644 (file)
@@ -140,6 +140,7 @@ void visscan_init(const TString& cdburi = "",
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks by category",  "esd_tracks.C+", "esd_tracks_by_category",  "", kTRUE));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks by anal cuts", "esd_tracks.C+", "esd_tracks_by_anal_cuts", "", kFALSE));
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks Lego", "lego.C", "lego", "", kTRUE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks Beams Info", "beams_info.C", "beams_info", "", kTRUE));
 
   exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracklets SPD", "esd_spd_tracklets.C", "esd_spd_tracklets", "", kTRUE));