]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
mchview related changes.
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Jun 2008 15:22:59 +0000 (15:22 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Jun 2008 15:22:59 +0000 (15:22 +0000)
Can now read and display HV values from OCDB

New program option --geometry to force geometry of the window

Added possibility, in painters' context menu, to include or exclude part of the detector (which will be used later on to communicate with LC2 which parts should be read out or not)

 When displaying Gains, the quality information is now decoded

32 files changed:
MUON/AliMUONAttPainter.cxx
MUON/AliMUONAttPainter.h
MUON/AliMUONBusPatchPainter.cxx
MUON/AliMUONBusPatchPainter.h
MUON/AliMUONChamberPainter.cxx
MUON/AliMUONChamberPainter.h
MUON/AliMUONDEPainter.cxx
MUON/AliMUONDEPainter.h
MUON/AliMUONDigitMaker.cxx
MUON/AliMUONManuPadPainter.cxx
MUON/AliMUONManuPadPainter.h
MUON/AliMUONManuPainter.cxx
MUON/AliMUONManuPainter.h
MUON/AliMUONMchViewApplication.cxx
MUON/AliMUONMchViewApplication.h
MUON/AliMUONPCBPainter.cxx
MUON/AliMUONPCBPainter.h
MUON/AliMUONPainterDataSourceFrame.cxx
MUON/AliMUONPainterMasterFrame.cxx
MUON/AliMUONPainterPlotSelector.cxx
MUON/AliMUONPainterRegistry.cxx
MUON/AliMUONPainterRegistry.h
MUON/AliMUONTrackerACFDataMaker.cxx
MUON/AliMUONTrackerData.cxx
MUON/AliMUONTrackerData.h
MUON/AliMUONTrackerOCDBDataMaker.cxx
MUON/AliMUONTrackerOCDBDataMaker.h
MUON/AliMUONVPainter.cxx
MUON/AliMUONVPainter.h
MUON/AliMUONVTrackerData.cxx
MUON/AliMUONVTrackerData.h
MUON/mchview.cxx

index 807cff8e8cbd12654d0b10243f7d1be38ab0f97d..e9b51e6bca959e7c26e4e3caafd97cf296a5a5ad 100644 (file)
@@ -96,6 +96,28 @@ AliMUONAttPainter::CathodeName() const
   return "";
 }
 
+//_____________________________________________________________________________
+void
+AliMUONAttPainter::Invert()
+{
+  /// Invert our cathode/plane states
+  
+  if ( IsCathodeDefined() ) 
+  {
+    Bool_t cath0(IsCathode0());
+    Bool_t cath1(IsCathode1());
+    SetCathode(!cath0,!cath1);
+  }
+
+  if ( IsPlaneDefined() ) 
+  {
+    Bool_t b(IsBendingPlane());
+    Bool_t nb(IsNonBendingPlane());
+    
+    SetPlane(!b,!nb);
+  }
+}
+
 //_____________________________________________________________________________
 TString
 AliMUONAttPainter::PlaneName() const
index 4945628d74413d033bec78fa1e755d26888000b2..8bbfe978324adaa64a7beb1c83bd9f59d2c5cca5 100644 (file)
@@ -78,6 +78,8 @@ public:
   /// Whether we are valid
   Bool_t IsValid() const { return TestBit(kIsValid); }
   
+  void Invert();
+  
   /// Set our cathode states
   void SetCathode(Bool_t cath0, Bool_t cath1) { SetBit(kIsCathode0,cath0); SetBit(kIsCathode1,cath1); }
   
index 5c85ba294233a56ba0a0e778943347098c63b629..fe73616225d360c5126703f4a19b7947cbb0a7c7 100644 (file)
@@ -52,6 +52,14 @@ fBusPatchId(-1)
   /// default ctor
 }
 
+//_____________________________________________________________________________
+AliMUONBusPatchPainter::AliMUONBusPatchPainter(TRootIOCtor* ioCtor)
+: AliMUONVPainter(ioCtor),
+fBusPatchId(-1)
+{
+  /// default streaming ctor
+}
+
 //_____________________________________________________________________________
 AliMUONBusPatchPainter::AliMUONBusPatchPainter(const AliMUONAttPainter& att, 
                                                Int_t busPatchId)
@@ -198,6 +206,14 @@ AliMUONBusPatchPainter::Copy(TObject& object) const
   ((AliMUONBusPatchPainter&)(object)).fBusPatchId = fBusPatchId;
 }
 
+//_____________________________________________________________________________
+Bool_t
+AliMUONBusPatchPainter::IsIncluded() const
+{
+  /// whether this bus patch is included in the readout or not
+  return ( InteractiveReadOutConfig()->BusPatch(fBusPatchId) > 0 );
+}
+
 //_____________________________________________________________________________
 TString
 AliMUONBusPatchPainter::Describe(const AliMUONVTrackerData& data, Int_t dataIndex, 
index feaec92127af31baa913e3dd1348b5cdb61196f2..a1faf7d87b8f93a4f7ac3d3a63a8f2d442bb3eaa 100644 (file)
@@ -24,6 +24,7 @@ class AliMUONBusPatchPainter : public AliMUONVPainter
 public:
   
   AliMUONBusPatchPainter();
+  AliMUONBusPatchPainter(TRootIOCtor*);
   AliMUONBusPatchPainter(const AliMUONAttPainter& att, Int_t busPatchId);
   AliMUONBusPatchPainter(const AliMUONBusPatchPainter& rhs);
   AliMUONBusPatchPainter& operator=(const AliMUONBusPatchPainter& rhs);
@@ -45,6 +46,8 @@ public:
 
   virtual AliMUONAttPainter Validate(const AliMUONAttPainter& attributes) const;
 
+  virtual Bool_t IsIncluded() const;
+  
 private:
   Int_t fBusPatchId; ///< our identifier
   
index 652c8cc4d5393772d366ad2da9e8982c26a9fe8c..32a36aa05de231161db597af3218c1a82b5ba6c9 100644 (file)
@@ -55,6 +55,14 @@ fChamberId(-1)
   /// ctor
 }
 
+//_____________________________________________________________________________
+AliMUONChamberPainter::AliMUONChamberPainter(TRootIOCtor* ioCtor)
+: AliMUONVPainter(ioCtor),
+fChamberId(-1)
+{
+  /// ctor
+}
+
 //_____________________________________________________________________________
 AliMUONChamberPainter::AliMUONChamberPainter(const AliMUONAttPainter& att, 
                                              Int_t chamberId)
@@ -196,6 +204,14 @@ AliMUONChamberPainter::Describe(const AliMUONVTrackerData& data, Int_t dataIndex
   return AliMUONPainterHelper::Instance()->FormatValue(data.DimensionName(dataIndex).Data(),value);
 }
 
+//_____________________________________________________________________________
+Bool_t 
+AliMUONChamberPainter::IsIncluded() const
+{
+  /// whether this chamber is included in the readout or not
+  return ( InteractiveReadOutConfig()->Chamber(fChamberId) > 0 );
+}
+
 //_____________________________________________________________________________
 void
 AliMUONChamberPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
index e65df20d4f6a02957480434aee5000bbf3b5c310..60511924984d3efd9580c2a8576cab9381133c20 100644 (file)
@@ -26,6 +26,7 @@ class AliMUONChamberPainter : public AliMUONVPainter
 {
 public:
   AliMUONChamberPainter();
+  AliMUONChamberPainter(TRootIOCtor* ioCtor);
   AliMUONChamberPainter(const AliMUONAttPainter& att, Int_t chamberId);
   AliMUONChamberPainter(const AliMUONChamberPainter& rhs);
   AliMUONChamberPainter& operator=(const AliMUONChamberPainter& rhs);
@@ -48,6 +49,8 @@ public:
     
   AliMUONAttPainter Validate(const AliMUONAttPainter& attributes) const;
 
+  Bool_t IsIncluded() const;
+  
 private:
   Int_t fChamberId; ///< our identifier (0..n)
   
index d298e9e38aabc701aad58bd66e2090ad4d61fd99..7c9837d091e29dd5541639d625d0dd5a42b7ee17 100644 (file)
@@ -54,6 +54,14 @@ fDetElemId(-1)
   /// default ctor
 }
 
+//_____________________________________________________________________________
+AliMUONDEPainter::AliMUONDEPainter(TRootIOCtor* ioCtor)
+: AliMUONVPainter(ioCtor),
+fDetElemId(-1)
+{
+  /// default streaming ctor
+}
+
 //_____________________________________________________________________________
 AliMUONDEPainter::AliMUONDEPainter(const AliMUONAttPainter& att, Int_t detElemId)
 : AliMUONVPainter("DE"),
@@ -250,7 +258,15 @@ AliMUONDEPainter::FillManuList(TObjArray& manuList) const
     }
   }
 }
-                            
+
+//_____________________________________________________________________________
+Bool_t
+AliMUONDEPainter::IsIncluded() const
+{
+  /// whether this detection element is included in the readout or not
+  return ( InteractiveReadOutConfig()->DetectionElement(fDetElemId) > 0 );
+}
+
 //_____________________________________________________________________________
 void
 AliMUONDEPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
index 13f9ce1bed32ca9253e713f85656712bc3ce13b7..8135b9d0cb77c517c58fa349d9482044d0148117 100644 (file)
@@ -20,6 +20,7 @@ class AliMUONDEPainter : public AliMUONVPainter
 {
 public:
   AliMUONDEPainter();
+  AliMUONDEPainter(TRootIOCtor*);
   AliMUONDEPainter(const AliMUONAttPainter& att, Int_t detElemId);
   AliMUONDEPainter(const AliMUONDEPainter& rhs);
   AliMUONDEPainter& operator=(const AliMUONDEPainter& rhs);
@@ -46,6 +47,8 @@ public:
 
   virtual void FillManuList(TObjArray& manuList) const;
   
+  virtual Bool_t IsIncluded() const;
+  
 private:
   Int_t fDetElemId; ///< our id
 
index cd36d068d60f2f9e53e9a31ad2ffe9d5ce467d33..68c7a357a4d081d4646d0be4e6856ea35abd45e0 100644 (file)
@@ -456,7 +456,7 @@ AliMUONDigitMaker::ReadTriggerDDLFast(AliRawReader* rawReader)
 
          if ( !loCircuit ) continue; // empty slot
 
-         AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(loCircuit, false);
+         AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(loCircuit, kTRUE);
 
          // skip copy cards
          if( !localBoard->IsNotified()) 
index 11e8a39d1e8add4002816c82c79e48694a997314..a8e4774a97bfbe9a2d07c2589f53c491fcca939c 100644 (file)
@@ -61,6 +61,19 @@ fFillStyleBck(-1)
   /// ctor
 }
 
+//_____________________________________________________________________________
+AliMUONManuPadPainter::AliMUONManuPadPainter(TRootIOCtor* ioCtor)
+: AliMUONVPainter(ioCtor), 
+fDetElemId(-1), 
+fManuId(-1),
+fLineColorBck(-1),
+fLineWidthBck(-1),
+fFillColorBck(-1),
+fFillStyleBck(-1)
+{
+  /// ctor
+}
+
 //_____________________________________________________________________________
 AliMUONManuPadPainter::AliMUONManuPadPainter(const AliMUONVPainter& mother,
                                              Int_t detElemId,
@@ -148,6 +161,14 @@ AliMUONManuPadPainter::NameAtPosition(Double_t x, Double_t y) const
   return name;
 }
 
+//_____________________________________________________________________________
+Bool_t
+AliMUONManuPadPainter::IsIncluded() const
+{
+  /// whether this manu is included in the readout or not
+  return ( InteractiveReadOutConfig()->Manu(fDetElemId,fManuId) > 0 );
+}
+
 //_____________________________________________________________________________
 TString 
 AliMUONManuPadPainter::Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
index 9454a4c131399571923fcedcea8582bac88d7943..8c9cf99c0c3fe932957de21c1d75bdb819a877b4 100644 (file)
@@ -22,6 +22,7 @@
 class AliMUONManuPadPainter : public AliMUONVPainter
 {
 public:
+  AliMUONManuPadPainter(TRootIOCtor* ioCtor);
   AliMUONManuPadPainter();
   AliMUONManuPadPainter(const AliMUONVPainter& mother,
                         Int_t detElemId,
@@ -57,6 +58,8 @@ public:
 
   virtual void DrawHistogramClone(Double_t* values=0x0) const;
 
+  virtual Bool_t IsIncluded() const;
+  
 private:
     
   void BackupStyle();
index 9976c539f829c5f5440502bf5ab91ba1ceed12a0..d4836ffafa809584d38260b953f3516e9cf0965d 100644 (file)
 ClassImp(AliMUONManuPainter)
 ///\endcond
 
+//_____________________________________________________________________________
+AliMUONManuPainter::AliMUONManuPainter(TRootIOCtor* ioCtor)
+: AliMUONVPainter(ioCtor),
+fDetElemId(-1),
+fManuId(-1)
+{
+  /// ctor
+}
+
 //_____________________________________________________________________________
 AliMUONManuPainter::AliMUONManuPainter()
 : AliMUONVPainter(),
@@ -191,6 +200,14 @@ AliMUONManuPainter::FillManuList(TObjArray& manuList) const
   manuList.Add(new AliMpManuUID(fDetElemId,fManuId));
 }
 
+//_____________________________________________________________________________
+Bool_t
+AliMUONManuPainter::IsIncluded() const
+{
+  /// whether this manu is included in the readout or not
+  return ( InteractiveReadOutConfig()->Manu(fDetElemId,fManuId) > 0 );
+}
+
 //_____________________________________________________________________________
 void
 AliMUONManuPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
index 82144f2efcf9c0f56706b7f05b3adc4b3dee2db7..196441f58103df2637f7257b9d9cb3df25ffe2e2 100644 (file)
@@ -20,6 +20,7 @@ class AliMUONManuPainter : public AliMUONVPainter
 {
 public:
 
+  AliMUONManuPainter(TRootIOCtor*);
   AliMUONManuPainter();
   AliMUONManuPainter(const AliMUONAttPainter& att, 
                      Int_t detElemId, 
@@ -47,6 +48,8 @@ public:
 
     virtual void FillManuList(TObjArray& manuList) const;
     
+    virtual Bool_t IsIncluded() const;
+    
 private:
   Int_t fDetElemId; ///< our detection element id
   Int_t fManuId; ///< our manu id
index 38b7067d9395edd8577a20250bd13c3e7d3df650..31754e5d7e12ecc781ab8f1ca0f12b85d25d9cb9 100644 (file)
@@ -70,22 +70,22 @@ const char* AliMUONMchViewApplication::fgkFileTypes[] = {
 //______________________________________________________________________________
 AliMUONMchViewApplication::AliMUONMchViewApplication(const char* name,
                                                      int* argc, char** argv,
-                                                     Float_t wfraction,
-                                                     Float_t hfraction
+                                                     UInt_t w, UInt_t h,
+                                                     UInt_t ox, UInt_t oy
 : TRint(name,argc,argv),
   fMainFrame(0x0),
   fPainterMasterFrame(0x0)
 {
 
   /// ctor
-  /// wfraction,hfraction are the fractions of display width and height
-  /// we want to draw on
-  
-  UInt_t dw = gClient->GetDisplayWidth(); 
-  UInt_t dh = gClient->GetDisplayHeight(); 
-                   
-  UInt_t w = (UInt_t)(wfraction*dw);
-  UInt_t h = (UInt_t)(hfraction*dh);
+  /// (w,h) is the size in pixel (if 0,0 it will be computed as 70%,90% of display size)
+  /// (ox,oy) is the offset from the top-left of the display
+
+  if (!w | !h)
+  {
+    w = (UInt_t)(gClient->GetDisplayWidth()*0.7);
+    h = (UInt_t)(gClient->GetDisplayHeight()*0.9); 
+  }
 
   fMainFrame = new TGMainFrame(gClient->GetRoot(),w,h);
   
@@ -123,13 +123,9 @@ AliMUONMchViewApplication::AliMUONMchViewApplication(const char* name,
   fMainFrame->MapWindow();
   
   fMainFrame->Connect("CloseWindow()","AliMUONMchViewApplication",this,"Terminate()");
-  
-  UInt_t x = dw/2 - w/2;
-  UInt_t y = 0;
-  
-  fMainFrame->MoveResize(x, y, w, h); 
-  fMainFrame->SetWMPosition(x, y);
-  
+
+  fMainFrame->MoveResize(ox,oy, w, h); 
+  fMainFrame->SetWMPosition(ox, oy);
   fMainFrame->SetWMSizeHints(w,h,w,h,0,0);
   
   cout << "***************************************************" << endl;
@@ -339,6 +335,20 @@ AliMUONMchViewApplication::ReleaseNotes()
   TGTransientFrame* t = new TGTransientFrame(gClient->GetRoot(),gClient->GetRoot(),width,height);
   
   TGTextView* rn = new TGTextView(t);
+
+  rn->AddLine("0.9%");
+  rn->AddLine("");
+  rn->AddLine("New features");
+  rn->AddLine("");
+  rn->AddLine("- Can now read and display HV values from OCDB");
+  rn->AddLine("- New program option --geometry to force geometry of the window");
+  rn->AddLine("- Added possibility, in painters' context menu, to include or exclude part of the detector");
+  rn->AddLine("  (which will be used later on to communicate with LC2 which parts should be read out or not)");
+  rn->AddLine("");
+  rn->AddLine("Improvement");
+  rn->AddLine("");
+  rn->AddLine("- When displaying Gains, the quality information is now decoded");
+  rn->AddLine("");
   
   rn->AddLine("0.94");
   rn->AddLine("");
index 310f8b39b61093b74281eea23c6e61a237d96ef7..431e770462ee1b578ef4bc24ec8e0a45e2ef7aca 100644 (file)
@@ -23,13 +23,13 @@ class AliMUONMchViewApplication : public TRint
 {
 public:
   AliMUONMchViewApplication(const char* name, int* argc, char** argv, 
-                            Float_t wfraction, Float_t hfraction);
+                            UInt_t w=0, UInt_t h=0, UInt_t ox=0, UInt_t oy=0);
   virtual ~AliMUONMchViewApplication();
 
   void HandleMenu(Int_t i);
 
   /// Return the version number of the mchview application
-  static const char* Version() { return "0.94"; }
+  static const char* Version() { return "0.95"; }
   
   /// Return the SVN revision  and version number of the mchview application
   static const char* FullVersion() { return Form("mchview Version %s ($Id$)",Version()); }
index 0cd8ffd718c6badad3daa2e427ba96da7df06d5e..0abd3c7edca2a25733ab50b4042c6f06152829a3 100644 (file)
 ClassImp(AliMUONPCBPainter)
 /// \endcond
 
+//_____________________________________________________________________________
+AliMUONPCBPainter::AliMUONPCBPainter(TRootIOCtor* ioCtor)
+: AliMUONVPainter(ioCtor),
+fDetElemId(-1),
+fPCBIndex(-1)
+{
+  /// root streaming ctor
+}
+
 //_____________________________________________________________________________
 AliMUONPCBPainter::AliMUONPCBPainter()
 : AliMUONVPainter(),
@@ -165,6 +174,14 @@ AliMUONPCBPainter::Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
   return AliMUONPainterHelper::Instance()->FormatValue(data.DimensionName(dataIndex).Data(),value);
 }
 
+//_____________________________________________________________________________
+Bool_t
+AliMUONPCBPainter::IsIncluded() const
+{
+  /// Whether this PCB is included in the read out or not
+  return ( InteractiveReadOutConfig()->PCB(fDetElemId,fPCBIndex) > 0 );
+}
+
 //_____________________________________________________________________________
 void
 AliMUONPCBPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
index 1b9d26790b41372b6ab0c89035b93cbd8e081a94..18b1fbd8f1fcc71c8e9937d4cf873d279aab2391 100644 (file)
@@ -19,6 +19,7 @@
 class AliMUONPCBPainter : public AliMUONVPainter
 {
 public:
+  AliMUONPCBPainter(TRootIOCtor*);
   AliMUONPCBPainter();
   AliMUONPCBPainter(const AliMUONAttPainter& att, 
                     Int_t detElemId, 
@@ -42,6 +43,8 @@ public:
   void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
                  Double_t min, Double_t max);
   
+  Bool_t IsIncluded() const;
+  
 private:
   Int_t fDetElemId; ///< Detection element this pcb is in
   Int_t fPCBIndex;  ///< Index of this PCB within the detection element
index 037bbd84ef7c04015b223d3450d48328d331f21b..dbd1d3f079d4a826df8dbd267fc8c6afdbb63679 100644 (file)
@@ -174,6 +174,7 @@ AliMUONPainterDataSourceFrame::AliMUONPainterDataSourceFrame(const TGWindow* p,
     fOCDBTypes->AddEntry("Pedestals",0);
     fOCDBTypes->AddEntry("Gains",1);
     fOCDBTypes->AddEntry("Capacitances",2);
+    fOCDBTypes->AddEntry("HV",3);
     fOCDBTypes->Select(0);
     fOCDBTypes->Resize(100,20);
     
index a47b1ae20ff1970aad2c917499ee379493f8fe8d..18384c98c8389ef78c504d981374857a9bebb074 100644 (file)
@@ -333,16 +333,8 @@ AliMUONPainterMasterFrame::ShiftClicked(AliMUONVPainter* painter, Double_t*)
     // create "opposite" attributes
     AliMUONAttPainter a1(a);
     AliMUONAttPainter a2(a);
-    
-    if ( a.IsCathodeDefined() ) 
-    {
-      a2.SetCathode(!a.IsCathode0(),!a.IsCathode1());
-    }
-    
-    if ( a.IsPlaneDefined() ) 
-    {
-      a2.SetPlane(!a.IsBendingPlane(),!a.IsNonBendingPlane());
-    }
+  
+    a2.Invert();
     
     a1.SetCathodeAndPlaneDisabled(kTRUE);
     a2.SetCathodeAndPlaneDisabled(kTRUE);
index 643d481efa09be85f2a9004a89acbb7b5fa5e78b..68ceaecb89c816f0706a6a679a195d1dcee82389 100644 (file)
@@ -552,9 +552,12 @@ AliMUONPainterPlotSelector::UpdateSourceButton()
   (AliMUONPainterInterfaceHelper::FindButtonByUserData(*fDataSourceNames,
                                                        fCurrentData));
   
-  AliMUONPainterInterfaceHelper::Select(*fDataSourceNames,button->GetTitle());
+  if ( button ) 
+  {
+    AliMUONPainterInterfaceHelper::Select(*fDataSourceNames,button->GetTitle());
   
-  RestoreDimensionButtons(button->GetTitle(),kFALSE);
+    RestoreDimensionButtons(button->GetTitle(),kFALSE);
+  }
   
   fDataSourceNames->Show();
 }
index 1802420db2d41b9d88cd139ac4b5e892b6439033..36713020718a5aa90ceca688f1de6771af8b86ed 100644 (file)
 
 #include "AliMUONPainterRegistry.h"
 
+#include "AliMpManuIterator.h"
+#include "AliMUON2DMap.h"
+#include "AliMUONCalibParamND.h"
 #include "AliMUONPainterMatrix.h"
-#include "AliMUONVTrackerData.h"
+#include "AliMUONTrackerData.h"
 #include "AliMUONVTrackerDataMaker.h"
 #include "AliLog.h"
 #include <TGMenu.h>
@@ -48,7 +51,8 @@ fDataMakers(new TObjArray),
 fHistoryMenu(0x0),
 fMenuBar(0x0),
 fHistoryCounter(0),
-fZombies(new TObjArray)
+fZombies(new TObjArray),
+fInteractiveReadOutConfig(0x0)
 {
   /// ctor
   fPainterMatrices->SetOwner(kTRUE);
@@ -62,6 +66,28 @@ AliMUONPainterRegistry::~AliMUONPainterRegistry()
   /// dtor
   delete fPainterMatrices;
   delete fDataMakers;
+  delete fInteractiveReadOutConfig;
+}
+
+//_____________________________________________________________________________
+void
+AliMUONPainterRegistry::CreateInteractiveReadOutConfig() const
+{
+  fInteractiveReadOutConfig = new AliMUONTrackerData("IROC","IROC",1);
+  fInteractiveReadOutConfig->SetDimensionName(0,"Switch");
+    /// FIXME: should use a version of TrackerData w/ no storage for channels
+    /// (i.e. starting at the manu level, or even bus patch level ?)
+  AliMpManuIterator it;
+  Int_t detElemId;
+  Int_t manuId;
+  AliMUON2DMap store(true);
+
+  while ( it.Next(detElemId,manuId) )
+  {
+    AliMUONVCalibParam* param = new AliMUONCalibParamND(1,64,detElemId,manuId,1);
+    store.Add(param);
+  }
+  fInteractiveReadOutConfig->Add(store);
 }
 
 //_____________________________________________________________________________
@@ -190,6 +216,17 @@ AliMUONPainterRegistry::Instance()
   return fgInstance;
 }
 
+//_____________________________________________________________________________
+AliMUONVTrackerData*
+AliMUONPainterRegistry::InteractiveReadOutConfig() const
+{
+  /// Return an object that contains the parts of the detector selected
+  /// (using the mouse) to be part of the readout.
+
+  if (!fInteractiveReadOutConfig) CreateInteractiveReadOutConfig();
+  return fInteractiveReadOutConfig;
+}
+
 //_____________________________________________________________________________
 AliMUONPainterMatrix* 
 AliMUONPainterRegistry::PainterMatrix(Int_t i) const
index 3417059da0bd12445a4320f0394b81bb73b7a6dd..4b38a240a9e3a1fb46a0d1148fb13aa79d87f50f 100644 (file)
@@ -36,6 +36,8 @@ public:
   AliMUONVTrackerData* DataSource(Int_t i) const;
   
   AliMUONVTrackerData* DataSource(const char* name) const;
+
+  AliMUONVTrackerData* InteractiveReadOutConfig() const;
   
   void DataSourceWasRegistered(AliMUONVTrackerData* data); // *SIGNAL*
   
@@ -93,6 +95,8 @@ private:
   /// Not implemented
   AliMUONPainterRegistry& operator=(const AliMUONPainterRegistry&);
   
+  void CreateInteractiveReadOutConfig() const;
+  
 private:
   static AliMUONPainterRegistry* fgInstance; ///< unique instance
   TObjArray* fPainterMatrices; ///< painter matrices
@@ -101,8 +105,9 @@ private:
   TGMenuBar* fMenuBar; ///< Menu bar where to put the history menu
   Int_t fHistoryCounter; ///< index to get back history menu items
   TObjArray* fZombies; ///< data readers to be deleted
+  mutable AliMUONVTrackerData* fInteractiveReadOutConfig; ///< clickable readout configuration
   
-  ClassDef(AliMUONPainterRegistry,3) // Registry for AliMUONVPainter related stuff
+  ClassDef(AliMUONPainterRegistry,4) // Registry for AliMUONVPainter related stuff
 };
 
 #endif
index 508f169bbdea3768c508738f630854fa6d2c54b2..1e9d52921c611c0b9f8ec6441e8bc4363895ef5f 100644 (file)
@@ -24,6 +24,7 @@
 #include "AliLog.h"
 #include <TString.h>
 #include <TSystem.h>
+#include "AliMUONTrackerOCDBDataMaker.h"
 
 ///\class AliMUONTrackerACFDataMaker
 ///
@@ -53,34 +54,26 @@ AliMUONTrackerACFDataMaker::AliMUONTrackerACFDataMaker(const char* acfPath,
     
     TString stype(type);
     stype.ToUpper();
-    Bool_t isSingleEvent(kTRUE);
     TString filename(gSystem->ExpandPathName(acfPath));
     
     if ( stype == "PEDESTALS" )
     {
-      fData = new AliMUONTrackerData(Form("PED",number),"Pedestals",2,isSingleEvent);
-      fData->SetDimensionName(0,"Mean");
-      fData->SetDimensionName(1,"Sigma");
+      fData = AliMUONTrackerOCDBDataMaker::CreateDataPedestals(number);
       store = new AliMUON2DMap(kTRUE);
       AliMUONTrackerIO::ReadPedestals(filename.Data(),*store);
     }
     else if ( stype == "GAINS" ) 
     {
-      fData = new AliMUONTrackerData(Form("GAIN%d",number),"Gains",5,isSingleEvent);
-      fData->SetDimensionName(0,"a1");
-      fData->SetDimensionName(1,"a2");
-      fData->SetDimensionName(2,"thres");
-      fData->SetDimensionName(3,"qual");
-      fData->SetDimensionName(4,"sat");
-      store = new AliMUON2DMap(kTRUE);
+      fData = AliMUONTrackerOCDBDataMaker::CreateDataGains(number);
+      AliMUONVStore* gains = new AliMUON2DMap(kTRUE);
       TString comment;
-      AliMUONTrackerIO::ReadGains(filename.Data(),*store,comment);
+      AliMUONTrackerIO::ReadGains(filename.Data(),*gains,comment);
+      store = AliMUONTrackerOCDBDataMaker::SplitQuality(*gains);
+      delete gains;      
     }
     else if ( stype == "CAPACITANCES" )
     {
-      fData = new AliMUONTrackerData(Form("CAPA%d",number),"Capacitances",2,isSingleEvent);
-      fData->SetDimensionName(0,"Capa");
-      fData->SetDimensionName(1,"Injection gain");
+      fData = AliMUONTrackerOCDBDataMaker::CreateDataCapacitances(number);
       store = new AliMUON1DMap(20000);
       AliMUONTrackerIO::ReadCapacitances(filename.Data(),*store);
     }
index 518970d3ad7cdce4b4528584be46d0222e564ebd..0aec61069b91f9687431a3d2cc473342d577ce51 100644 (file)
@@ -105,21 +105,40 @@ AliMUONTrackerData::~AliMUONTrackerData()
 //_____________________________________________________________________________
 Bool_t
 AliMUONTrackerData::Add(const AliMUONVStore& store)
+{
+  /// Add the given external store to our internal store
+  return InternalAdd(store,kFALSE);
+}
+
+//_____________________________________________________________________________
+Bool_t
+AliMUONTrackerData::Replace(const AliMUONVStore& store)
+{
+  /// Replace our values by values from the given external store
+  Bool_t rv = InternalAdd(store,kTRUE);
+  AliMUONVTrackerData::Replace(store);
+  return rv;
+}
+
+//_____________________________________________________________________________
+Bool_t
+AliMUONTrackerData::InternalAdd(const AliMUONVStore& store, Bool_t replace)
 {
   /// Add the given external store to our internal store
   
   AliCodeTimerAuto(GetName());
     
-  if ( IsSingleEvent() && fNevents == 1 ) 
+  if ( !replace)
   {
-    AliError(Form("%s is supposed to be single event only",GetName()));
-    return kFALSE;
+    if ( IsSingleEvent() && fNevents == 1 ) 
+    {
+      AliError(Form("%s is supposed to be single event only",GetName()));
+      return kFALSE;
+    }  
+    ++fNevents;  
+    NumberOfEventsChanged();
   }
   
-  ++fNevents;
-  
-  NumberOfEventsChanged();
-  
   if (!fChannelValues)
   {
     Int_t numberOfBusPatches(0);
@@ -209,24 +228,26 @@ AliMUONTrackerData::Add(const AliMUONVStore& store)
           
           for ( Int_t k = 0; k < nk; ++k ) 
           {
-            channel->SetValueAsDoubleFast(i,ix+k,channel->ValueAsDoubleFast(i,ix+k)+value[k]);
-
-            manu->SetValueAsDoubleFast(0,ix+k,manu->ValueAsDoubleFast(0,ix+k)+value[k]);            
+            Double_t e = replace ? channel->ValueAsDoubleFast(i,ix+k) : 0.0;
+            
+            channel->SetValueAsDoubleFast(i,ix+k,channel->ValueAsDoubleFast(i,ix+k)-e+value[k]);
+              
+            manu->SetValueAsDoubleFast(0,ix+k,manu->ValueAsDoubleFast(0,ix+k)-e+value[k]);            
+            
+            busPatch->SetValueAsDoubleFast(0,ix+k,busPatch->ValueAsDoubleFast(0,ix+k)-e+value[k]);
+            
+            de->SetValueAsDoubleFast(0,ix+k,de->ValueAsDoubleFast(0,ix+k)-e+value[k]);
+            
+            chamber->SetValueAsDoubleFast(0,ix+k,chamber->ValueAsDoubleFast(0,ix+k)-e+value[k]);
             
-            busPatch->SetValueAsDoubleFast(0,ix+k,busPatch->ValueAsDoubleFast(0,ix+k)+value[k]);
-          
-            de->SetValueAsDoubleFast(0,ix+k,de->ValueAsDoubleFast(0,ix+k)+value[k]);
-          
-            chamber->SetValueAsDoubleFast(0,ix+k,chamber->ValueAsDoubleFast(0,ix+k)+value[k]);
-          
             if ( pcb ) 
             {
-              pcb->SetValueAsDoubleFast(0,ix+k,pcb->ValueAsDoubleFast(0,ix+k)+value[k]);
+              pcb->SetValueAsDoubleFast(0,ix+k,pcb->ValueAsDoubleFast(0,ix+k)-e+value[k]);
             }
           }
         }
         
-        if ( validChannel )
+        if ( validChannel && !replace )
         {
           channel->SetValueAsDoubleFast(i,IndexOfOccupancyDimension(),
                                         channel->ValueAsDoubleFast(i,IndexOfOccupancyDimension())+1.0);
@@ -823,7 +844,7 @@ AliMUONTrackerData::PCB(Int_t detElemId, Int_t pcbIndex, Int_t dim) const
 
   AliMUONVCalibParam* param = PCBParam(detElemId,pcbIndex);
   
-  return param ? Value(*param,pcbIndex,dim) : 0.0;
+  return param ? Value(*param,0,dim) : 0.0;
 }
 
 //_____________________________________________________________________________
index 4825780920d61f5d68fe530aea95503a2c695762..ccd6843c993c6930f40e3fe107753850523f82cc 100644 (file)
@@ -30,7 +30,9 @@ public:
   virtual ~AliMUONTrackerData();
 
   virtual Bool_t Add(const AliMUONVStore& channelValues);
-  
+
+  virtual Bool_t Replace(const AliMUONVStore& channelValues);
+
   virtual Double_t BusPatch(Int_t busPatchId, Int_t dim=0) const;
 
   virtual Double_t Chamber(Int_t chamberId, Int_t dim=0) const;
@@ -167,6 +169,8 @@ private:
     
 private:
     
+    Bool_t InternalAdd(const AliMUONVStore& store, Bool_t replace);
+  
   Bool_t fIsSingleEvent; ///< whether we can deal with more than one event
   AliMUONVStore* fChannelValues; ///< the channel store
   AliMUONVStore* fManuValues; ///< the manu store
index e939955429719d4ab499fd431b22c90fe78b9608..54d15025f4f770a0cae861fc4174c0338ebf94bf 100644 (file)
 
 #include "AliMUONTrackerOCDBDataMaker.h"
 
-#include "AliMUONTrackerData.h"
 #include "AliCDBManager.h"
 #include "AliCDBStorage.h"
+#include "AliDCSValue.h"
+#include "AliLog.h"
+#include "AliMUON2DMap.h"
+#include "AliMUONCalibParamND.h"
 #include "AliMUONCalibrationData.h"
+#include "AliMUONTrackerData.h"
 #include "AliMUONVStore.h"
-#include "AliLog.h"
+#include "AliMpConstants.h"
+#include "AliMpDDLStore.h"
+#include "AliMpDetElement.h"
+#include "AliMpHVNamer.h"
+#include <TClass.h>
+#include <TMap.h>
+#include <TObjArray.h>
+#include <TObjString.h>
 #include <TString.h>
 
 ///\class AliMUONTrackerOCDBDataMaker
@@ -57,28 +68,29 @@ AliMUONTrackerOCDBDataMaker::AliMUONTrackerOCDBDataMaker(const char* ocdbPath,
     
     if ( stype == "PEDESTALS" )
     {
-      fData = new AliMUONTrackerData(Form("PED%d",runNumber),"Pedestals",2,isSingleEvent);
-      fData->SetDimensionName(0,"Mean");
-      fData->SetDimensionName(1,"Sigma");
+      fData = CreateDataPedestals(runNumber);
       store = AliMUONCalibrationData::CreatePedestals(runNumber);
     }
     else if ( stype == "GAINS" ) 
     {
-      fData = new AliMUONTrackerData(Form("GAIN%d",runNumber),"Gains",5,isSingleEvent);
-      fData->SetDimensionName(0,"a1");
-      fData->SetDimensionName(1,"a2");
-      fData->SetDimensionName(2,"thres");
-      fData->SetDimensionName(3,"qual");
-      fData->SetDimensionName(4,"sat");
-      store = AliMUONCalibrationData::CreateGains(runNumber);
+      fData = CreateDataGains(runNumber);
+      AliMUONVStore* gains = AliMUONCalibrationData::CreateGains(runNumber);
+      store = SplitQuality(*gains);
+      delete gains;
     }
     else if ( stype == "CAPACITANCES" )
     {
-      fData = new AliMUONTrackerData(Form("CAPA%d",runNumber),"Capacitances",2,isSingleEvent);
-      fData->SetDimensionName(0,"Capa");
-      fData->SetDimensionName(1,"Injection gain");
+      fData = CreateDataCapacitances(runNumber);
       store = AliMUONCalibrationData::CreateCapacitances(runNumber);
     }
+    else if ( stype == "HV" )
+    {
+      fData = new AliMUONTrackerData(Form("HV%d",runNumber),"High Voltages",1,!isSingleEvent);
+      fData->SetDimensionName(0,"HV");
+      TMap* m = AliMUONCalibrationData::CreateHV(runNumber);
+      store = CreateHVStore(*m);
+      delete m;
+    }
     
     AliCDBManager::Instance()->SetDefaultStorage(storage);
 
@@ -92,6 +104,8 @@ AliMUONTrackerOCDBDataMaker::AliMUONTrackerOCDBDataMaker(const char* ocdbPath,
     }
     
     fData->Add(*store);
+    
+    delete store;
 }
 
 //_____________________________________________________________________________
@@ -101,6 +115,122 @@ AliMUONTrackerOCDBDataMaker::~AliMUONTrackerOCDBDataMaker()
   delete fData;
 }
 
+//_____________________________________________________________________________
+AliMUONVTrackerData*
+AliMUONTrackerOCDBDataMaker::CreateDataCapacitances(Int_t runNumber)
+{
+  /// Create data to hold capa values
+  
+  AliMUONVTrackerData* data = new AliMUONTrackerData(Form("CAPA%d",runNumber),"Capacitances",2,kTRUE);
+  data->SetDimensionName(0,"Capa");
+  data->SetDimensionName(1,"Injection gain");
+  return data;
+}
+
+//_____________________________________________________________________________
+AliMUONVTrackerData*
+AliMUONTrackerOCDBDataMaker::CreateDataGains(Int_t runNumber)
+{
+  /// Create data to hold gains values
+  
+  AliMUONVTrackerData* data = new AliMUONTrackerData(Form("GAIN%d",runNumber),"Gains",6,kTRUE);
+  data->SetDimensionName(0,"a1");
+  data->SetDimensionName(1,"a2");
+  data->SetDimensionName(2,"thres");
+  data->SetDimensionName(3,"qual1");
+  data->SetDimensionName(4,"qual2");
+  data->SetDimensionName(5,"sat");
+  return data;
+}
+
+//_____________________________________________________________________________
+AliMUONVTrackerData*
+AliMUONTrackerOCDBDataMaker::CreateDataPedestals(Int_t runNumber)
+{
+  /// Create data to hold pedestal values
+  
+  AliMUONVTrackerData* data  = new AliMUONTrackerData(Form("PED%d",runNumber),"Pedestals",2,kTRUE);
+  data->SetDimensionName(0,"Mean");
+  data->SetDimensionName(1,"Sigma");
+  return data;
+}
+
+//_____________________________________________________________________________
+AliMUONVStore*
+AliMUONTrackerOCDBDataMaker::CreateHVStore(TMap& m)
+{
+  /// Create a store from hv values
+  
+  AliMUONVStore* store = new AliMUON2DMap(kTRUE);
+  
+  TIter next(&m);
+  TObjString* s;
+  AliMpHVNamer hvNamer;
+  
+  while ( ( s = static_cast<TObjString*>(next()) ) )
+  {
+    TString name(s->String());
+
+    Int_t detElemId = hvNamer.DetElemIdFromDCSAlias(name.Data());
+    
+    Int_t nindex = 1;
+    Int_t hvIndex = hvNamer.HVIndexFromDCSAlias(name.Data());
+    
+    if ( hvIndex > 0 && detElemId >= 500 ) 
+    {
+      AliFatalClass("FIXME"); // there's now switch aliases which should be taken into account
+    }
+
+    if ( hvIndex == -2 ) // we should consider switch alias there...
+    {
+      nindex = hvNamer.NumberOfPCBs(detElemId);
+      hvIndex = 0;
+    }
+
+    AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(detElemId);
+
+    for ( int i = 0 ; i < nindex; ++i )
+    {
+      Int_t index = hvIndex + i ;
+      
+      const AliMpArrayI* manus = de->ManusForHV(index);
+      
+      TPair* p = static_cast<TPair*>(m.FindObject(name.Data()));
+      TObjArray* a = static_cast<TObjArray*>(p->Value());
+      TIter n2(a);
+      AliDCSValue* v;
+      Float_t hvValue(0);
+      Int_t n(0);
+      while ( ( v = static_cast<AliDCSValue*>(n2()) ) )
+      {
+        hvValue += v->GetFloat();  
+        ++n;
+      }
+      if ( n ) hvValue /= n;
+      
+      Int_t N(AliMpConstants::ManuNofChannels());
+      
+      for ( Int_t k = 0 ; k < manus->GetSize(); ++k )
+      {
+        Int_t manuId = manus->GetValue(k);
+        AliMUONVCalibParam* param = static_cast<AliMUONVCalibParam*>(store->FindObject(detElemId,manuId));
+        if ( ! param ) 
+        {
+          param = new AliMUONCalibParamND(1,N,detElemId,manuId,0);
+          store->Add(param);
+        }
+        for ( Int_t j = 0 ; j < N; ++j )
+        {
+          param->SetValueAsDouble(j,0,hvValue);
+        }
+      }
+    }
+  }
+  
+  return store;
+  
+}
+
 //_____________________________________________________________________________
 Long64_t 
 AliMUONTrackerOCDBDataMaker::Merge(TCollection*)
@@ -110,3 +240,39 @@ AliMUONTrackerOCDBDataMaker::Merge(TCollection*)
   return 0;
 }
 
+//_____________________________________________________________________________
+AliMUONVStore*
+AliMUONTrackerOCDBDataMaker::SplitQuality(const AliMUONVStore& gains)
+{
+  /// Create a new store, identical to source gain store, except that qual 
+  /// dimension is "decompacted" in two separated values
+  
+  AliMUONVStore* store = gains.Create();
+  
+  TIter next(gains.CreateIterator());
+  AliMUONVCalibParam* param;
+  
+  while ( ( param = static_cast<AliMUONVCalibParam*>(next()) ) ) 
+  {
+    AliMUONVCalibParam* nd = new AliMUONCalibParamND(param->Dimension()+1,
+                                                      param->Size(),
+                                                      param->ID0(),
+                                                      param->ID1());
+    for ( Int_t i = 0; i < param->Size(); ++i ) 
+    {
+      for ( Int_t k = 0; k < param->Dimension(); ++k ) 
+      {
+        if ( k == 3 ) continue;
+        Int_t m = ( k < 3 ? k : k+1 ) ;
+        nd->SetValueAsDouble(i,m,param->ValueAsFloat(i,k));
+      }
+      Int_t qual = param->ValueAsInt(i,3);
+      Int_t q1 = ( qual & 0xF );
+      Int_t q2 = ( qual & 0xF0 );
+      nd->SetValueAsInt(i,3,q1);
+      nd->SetValueAsInt(i,4,q2);
+    }
+    store->Add(nd);
+  }
+  return store;
+}
index 9ff6ad802c1c651e2586f8851c41a432a1b2de80..1adbf35de4825fbe061339af9c2b0931736dfbfe 100644 (file)
@@ -19,6 +19,9 @@
 #  include "TString.h"
 #endif
 
+class TMap;
+class AliMUONVStore;
+
 class AliMUONTrackerOCDBDataMaker : public AliMUONVTrackerDataMaker
 {
 public:
@@ -58,6 +61,13 @@ public:
     Int_t NumberOfEvents() const { return 1; }
 
   virtual Long64_t Merge(TCollection* li);
+
+  static AliMUONVStore* CreateHVStore(TMap& hvMap);
+  static AliMUONVStore* SplitQuality(const AliMUONVStore& gains);
+
+  static AliMUONVTrackerData* CreateDataPedestals(Int_t runNumber);
+  static AliMUONVTrackerData* CreateDataGains(Int_t runNumber);
+  static AliMUONVTrackerData* CreateDataCapacitances(Int_t runNumber);
   
 private:
   /// Not implemented
@@ -65,6 +75,7 @@ private:
   /// Not implemented
   AliMUONTrackerOCDBDataMaker& operator=(const AliMUONTrackerOCDBDataMaker& rhs);
   
+  
 private:
   Bool_t fIsValid; ///< whether we have valid data
   AliMUONVTrackerData* fData; ///< our data
index ab824c6ce2308396dfc474a01237e3deb5ece738..807b2af6a510ba48878c88bfed98c4b4751fc809 100644 (file)
 
 #include "AliCodeTimer.h"
 #include "AliLog.h"
+#include "AliMUON2DMap.h"
+#include "AliMUONCalibParamND.h"
+#include "AliMUONPainterRegistry.h"
+#include "AliMpManuUID.h"
 #include "AliMUONObjectPair.h"
 #include "AliMUONPainterContour.h"
 #include "AliMUONPainterGroup.h"
 ClassImp(AliMUONVPainter)
 ///\endcond
 
+//_____________________________________________________________________________
+AliMUONVPainter::AliMUONVPainter(TRootIOCtor*) : TObject(), 
+TQObject(),
+fHistogram(0x0),
+fName(""),
+fPathName(""),
+fType(""),
+fMother(0x0),
+fGroup(0x0),
+fContour(0x0),
+fPainterGroups(0x0),
+fChildren(0x0),
+fResponderGroup(0x0),
+fPlotterGroup(0x0),
+fBorderFactor(1.1),
+fPad(0x0),
+fAttributes(),
+fLineColor(1),
+fLineWidth(1),
+fIsValid(kTRUE)
+{
+  /// streamer ctor
+}
+
 //_____________________________________________________________________________
 AliMUONVPainter::AliMUONVPainter(const char* type)
 : TObject(), 
@@ -719,6 +747,12 @@ AliMUONVPainter::Paint(Option_t*)
   {
     PaintOutline();
   }
+  
+  if ( IsExcluded() )
+  {
+    fContour->PaintArea(2);
+    fContour->PaintOutline(1,1);
+  }
 }
 
 //_____________________________________________________________________________
@@ -736,6 +770,7 @@ AliMUONVPainter::PaintArea(const AliMUONVTrackerData&, Int_t, Double_t, Double_t
 {
   /// Default implementation (must be overriden)
   AliError(Form("%s : implement me",GetName()));
+  return;
 }
 
 //_____________________________________________________________________________
@@ -901,7 +936,14 @@ AliMUONVPainter::SetData(const char* pattern, AliMUONVTrackerData* data,
 //    l->Clear();
     l->Delete();
   
-    if ( group ) 
+    TClassMenuItem* n(0x0);
+    
+    l->Add(new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
+                              "Include","Include",p,"",-1,kTRUE));
+    l->Add(new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
+                              "Exclude","Exclude",p,"",-1,kTRUE));    
+    
+    if ( group )  
     {
       Int_t dim = group->Data()->InternalToExternal(group->DataIndex());
       if ( dim < group->Data()->ExternalDimension() )
@@ -909,7 +951,7 @@ AliMUONVPainter::SetData(const char* pattern, AliMUONVTrackerData* data,
         if ( data && data->IsHistogrammed(dim) ) 
         {
           // Add histo drawing to the popup menu
-          TClassMenuItem* n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
+          n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
                                                  "Draw histogram","DrawHistogram0",p,"",-1,kTRUE);
           l->Add(n);
           
@@ -920,11 +962,13 @@ AliMUONVPainter::SetData(const char* pattern, AliMUONVTrackerData* data,
         
       }
       
-      for ( Int_t i = 0; i < data->ExternalDimension()*2; ++i ) 
+      Int_t nd = data->IsSingleEvent() ? data->ExternalDimension() : data->ExternalDimension()*2;
+      
+      for ( Int_t i = 0; i < nd; ++i ) 
       {
-        TClassMenuItem* n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
-                                               Form("Draw %s clone",data->DimensionName(i).Data()),
-                                               Form("DrawInternalHistogramClone%d",i),p,"",-1,kTRUE);
+        n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
+                               Form("Draw %s clone",data->DimensionName(i).Data()),
+                               Form("DrawInternalHistogramClone%d",i),p,"",-1,kTRUE);
         l->Add(n);
       } 
     }
@@ -1201,6 +1245,86 @@ AliMUONVPainter::UpdateGroupsFrom(const AliMUONVPainter& painter)
     
     SetLine(group->Depth(),group->GetLineColor(),group->GetLineWidth());
   }
+  
+}
+
+//_____________________________________________________________________________
+void
+AliMUONVPainter::Include()
+{
+  /// Include this painter
+  AliInfo(GetName());
+  
+  /// Update the global interactive read out configuration  
+  WriteIROC(1);
+}
+
+//_____________________________________________________________________________
+void
+AliMUONVPainter::GetIROCManuList(TObjArray& manuList)
+{
+  /// Get the list of manus spanned by this painter AND by its dual
+
+  FillManuList(manuList);
+  
+  // get our dual
+  AliMUONAttPainter att(Attributes());
+  
+  att.Invert();
+  
+  att.SetCathodeAndPlaneDisabled(kTRUE);
+  
+  AliMUONVPainter* p = AliMUONVPainter::CreatePainter(ClassName(),att,ID0(),ID1());
+  
+  if (p)
+  {
+    p->FillManuList(manuList);
+  }
+  
+  delete p;
+}
+
+//_____________________________________________________________________________
+void
+AliMUONVPainter::WriteIROC(Double_t value)
+{
+  /// Update the interactive readout configuration
+  
+  TObjArray manuList;
+  GetIROCManuList(manuList);
+  
+  AliMpManuUID* muid;
+  TIter nextm(&manuList);
+  AliMUON2DMap store(true);
+  
+  while ((muid=static_cast<AliMpManuUID*>(nextm())))
+  {
+    AliMUONVCalibParam* param = new AliMUONCalibParamND(1,64,
+                                                        muid->DetElemId(),
+                                                        muid->ManuId(),value);
+    store.Add(param);
+  }
+  
+  InteractiveReadOutConfig()->Replace(store);
+}
+
+//_____________________________________________________________________________
+void
+AliMUONVPainter::Exclude()
+{
+  /// Exclude this painter
+  AliInfo(GetName());
+  
+  /// Update the global interactive read out configuration
+  WriteIROC(0.0);
+}
+
+//_____________________________________________________________________________
+AliMUONVTrackerData*
+AliMUONVPainter::InteractiveReadOutConfig() const
+{
+  /// get the interactive readout config object
+  return AliMUONPainterRegistry::Instance()->InteractiveReadOutConfig();
 }
 
 //_____________________________________________________________________________
index d9b0aecc98a229e68fa90e31594d48485edcadef..ac3ea2a558a6e3d8ccff26b4c00d3d4fb92d7c37 100644 (file)
@@ -45,6 +45,7 @@ class AliMUONVPainter : public TObject, public TQObject
 {
 public:  
 
+  AliMUONVPainter(TRootIOCtor*);
   AliMUONVPainter(const char* type="");
   AliMUONVPainter(const AliMUONVPainter& rhs);
   AliMUONVPainter& operator=(const AliMUONVPainter& rhs);
@@ -254,12 +255,24 @@ public:
   /// SL
   void DrawInternalHistogramClone9() { DrawInternalHistogramClone(9); }
   
+  /// Whether or not the part of the detector represented by this painter should be included in readout.
+  virtual Bool_t IsIncluded() const = 0;
+  
+  /// Whether or not the part of the detector represented by this painter should be excluded from readout.
+  Bool_t IsExcluded() const { return ! IsIncluded(); }
+
+  virtual void Include();
+  
+  virtual void Exclude();
+
 protected:
     
   virtual TCollection* Children() const;
 
   mutable TH1* fHistogram; //!< histogram
   
+  AliMUONVTrackerData* InteractiveReadOutConfig() const;
+  
 private:
   
     void FlatList(TList& list);
@@ -273,6 +286,10 @@ private:
   
   AliMUONVPainter* GetPainter(Int_t px, Int_t py, Double_t& x, Double_t& y) const;
   
+  void WriteIROC(Double_t value);
+  
+  void GetIROCManuList(TObjArray& manuList);
+
 private:
   
   TString fName; ///< our (short) name
index 872df125936eeb262ff0a25f9cdfad4370582e5d..38032a7e94c243c9951ab973863f68fe808de605 100644 (file)
@@ -74,3 +74,9 @@ AliMUONVTrackerData::Print(Option_t* wildcard) const
   Print(wildcard,"summary");
 }
 
+//_____________________________________________________________________________
+Bool_t
+AliMUONVTrackerData::Replace(const AliMUONVStore& store)
+{
+  Emit("Replace(const AliMUONVStore&)");
+}
index f2fbd50201d95a74f7dacd44580d906a8f85ec66..036464e5e1801e3c6fe750f73edd5565b46a2f4a 100644 (file)
@@ -38,6 +38,9 @@ public:
   /// Add values for one event from one full store
   virtual Bool_t Add(const AliMUONVStore& store) = 0;
 
+  /// Replace values
+  virtual Bool_t Replace(const AliMUONVStore& store) = 0;
+  
   /// Get the value for a given buspatch and given dimension
   virtual Double_t BusPatch(Int_t busPatchId, Int_t dim=0) const = 0;
   
index 47b4c3920b2edad8a6be3ac4dfcdf501a83bef71..405786df4f0218018b68333f53803da15c0643f4 100644 (file)
 
 
 #include "AliMUONMchViewApplication.h"
-#include "AliMUONPainterHelper.h"
+
 #include "AliCDBManager.h"
 #include "AliCodeTimer.h"
 #include "AliLog.h"
-#include <TROOT.h>
-#include <TStyle.h>
+#include "AliMUONPainterHelper.h"
+#include <Riostream.h>
 #include <TObjArray.h>
 #include <TObjString.h>
-#include <Riostream.h>
+#include <TROOT.h>
+#include <TStyle.h>
 
 //______________________________________________________________________________
 Int_t Usage()
@@ -40,6 +41,8 @@ Int_t Usage()
   cout << "mchview " << endl;
   cout << "  --version : shows the current version of the program" << endl;
   cout << "  --use filename.root : reuse a previously saved (from this program) root file. Several --use can be used ;-)" << endl;
+  cout << "  --geometry #x#+#+# : manually specify the geometry of the window, ala X11..., e.g. --geometry 1280x900+1600+0 will" << endl;
+  cout << "    get a window of size 1280x900, located at (1600,0) from the top-left of the (multihead) display " << endl;
   return -1;
 }
 
@@ -57,7 +60,10 @@ int main(int argc, char** argv)
   Int_t nok(0);
   
   TObjArray filesToOpen;
-  
+  Bool_t isGeometryFixed(kFALSE);
+  Int_t gix, giy;
+  Int_t gox,goy;
+
   for ( Int_t i = 0; i <= args.GetLast(); ++i ) 
   {
     TString a(static_cast<TObjString*>(args.At(i))->String());
@@ -73,6 +79,15 @@ int main(int argc, char** argv)
       ++i;
       nok += 2;
     }
+    else if ( a == "--geometry" )
+    {
+      isGeometryFixed = kTRUE;
+      TString g(static_cast<TObjString*>(args.At(i+1))->String());
+      sscanf(g.Data(),"%dx%d+%d+%d",&gix,&giy,&gox,&goy);
+      nok += 2;
+      ++i;
+    }
+    
     else
     {
       return Usage();
@@ -84,7 +99,7 @@ int main(int argc, char** argv)
     return Usage();
   }
   
-  AliWarningGeneral("main","Remove default storage and run number from here...");
+  AliWarningGeneral("main","FIXME ? Remove default storage and run number from here...");
   
   AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
   AliCDBManager::Instance()->SetRun(0);
@@ -101,8 +116,21 @@ int main(int argc, char** argv)
   colors[n+1] = 1;
   gStyle->SetPalette(n+2,colors);
   delete[] colors;
+
+  UInt_t w(0);
+  UInt_t h(0);
+  UInt_t ox(0);
+  UInt_t oy(0);
+
+  if ( isGeometryFixed )
+  {
+    w = gix;
+    h = giy;
+    ox = gox;
+    oy = goy;
+  }
   
-  AliMUONMchViewApplication* theApp = new AliMUONMchViewApplication("mchview", &argc, argv, 0.7, 0.9);
+  AliMUONMchViewApplication* theApp = new AliMUONMchViewApplication("mchview", &argc, argv, w,h,gox,goy);
    
   AliCodeTimer::Instance()->Print();