From: laphecet Date: Fri, 20 Jun 2008 15:22:59 +0000 (+0000) Subject: mchview related changes. X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=1ffbeb9dda307d5ecbe07a8d2a0361d2dad54215;p=u%2Fmrichter%2FAliRoot.git mchview related changes. 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 --- diff --git a/MUON/AliMUONAttPainter.cxx b/MUON/AliMUONAttPainter.cxx index 807cff8e8cb..e9b51e6bca9 100644 --- a/MUON/AliMUONAttPainter.cxx +++ b/MUON/AliMUONAttPainter.cxx @@ -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 diff --git a/MUON/AliMUONAttPainter.h b/MUON/AliMUONAttPainter.h index 4945628d744..8bbfe978324 100644 --- a/MUON/AliMUONAttPainter.h +++ b/MUON/AliMUONAttPainter.h @@ -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); } diff --git a/MUON/AliMUONBusPatchPainter.cxx b/MUON/AliMUONBusPatchPainter.cxx index 5c85ba29423..fe73616225d 100644 --- a/MUON/AliMUONBusPatchPainter.cxx +++ b/MUON/AliMUONBusPatchPainter.cxx @@ -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, diff --git a/MUON/AliMUONBusPatchPainter.h b/MUON/AliMUONBusPatchPainter.h index feaec92127a..a1faf7d87b8 100644 --- a/MUON/AliMUONBusPatchPainter.h +++ b/MUON/AliMUONBusPatchPainter.h @@ -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 diff --git a/MUON/AliMUONChamberPainter.cxx b/MUON/AliMUONChamberPainter.cxx index 652c8cc4d53..32a36aa05de 100644 --- a/MUON/AliMUONChamberPainter.cxx +++ b/MUON/AliMUONChamberPainter.cxx @@ -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, diff --git a/MUON/AliMUONChamberPainter.h b/MUON/AliMUONChamberPainter.h index e65df20d4f6..60511924984 100644 --- a/MUON/AliMUONChamberPainter.h +++ b/MUON/AliMUONChamberPainter.h @@ -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) diff --git a/MUON/AliMUONDEPainter.cxx b/MUON/AliMUONDEPainter.cxx index d298e9e38aa..7c9837d091e 100644 --- a/MUON/AliMUONDEPainter.cxx +++ b/MUON/AliMUONDEPainter.cxx @@ -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, diff --git a/MUON/AliMUONDEPainter.h b/MUON/AliMUONDEPainter.h index 13f9ce1bed3..8135b9d0cb7 100644 --- a/MUON/AliMUONDEPainter.h +++ b/MUON/AliMUONDEPainter.h @@ -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 diff --git a/MUON/AliMUONDigitMaker.cxx b/MUON/AliMUONDigitMaker.cxx index cd36d068d60..68c7a357a4d 100644 --- a/MUON/AliMUONDigitMaker.cxx +++ b/MUON/AliMUONDigitMaker.cxx @@ -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()) diff --git a/MUON/AliMUONManuPadPainter.cxx b/MUON/AliMUONManuPadPainter.cxx index 11e8a39d1e8..a8e4774a97b 100644 --- a/MUON/AliMUONManuPadPainter.cxx +++ b/MUON/AliMUONManuPadPainter.cxx @@ -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, diff --git a/MUON/AliMUONManuPadPainter.h b/MUON/AliMUONManuPadPainter.h index 9454a4c1313..8c9cf99c0c3 100644 --- a/MUON/AliMUONManuPadPainter.h +++ b/MUON/AliMUONManuPadPainter.h @@ -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(); diff --git a/MUON/AliMUONManuPainter.cxx b/MUON/AliMUONManuPainter.cxx index 9976c539f82..d4836ffafa8 100644 --- a/MUON/AliMUONManuPainter.cxx +++ b/MUON/AliMUONManuPainter.cxx @@ -46,6 +46,15 @@ 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, diff --git a/MUON/AliMUONManuPainter.h b/MUON/AliMUONManuPainter.h index 82144f2efcf..196441f5810 100644 --- a/MUON/AliMUONManuPainter.h +++ b/MUON/AliMUONManuPainter.h @@ -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 diff --git a/MUON/AliMUONMchViewApplication.cxx b/MUON/AliMUONMchViewApplication.cxx index 38b7067d939..31754e5d7e1 100644 --- a/MUON/AliMUONMchViewApplication.cxx +++ b/MUON/AliMUONMchViewApplication.cxx @@ -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(""); diff --git a/MUON/AliMUONMchViewApplication.h b/MUON/AliMUONMchViewApplication.h index 310f8b39b61..431e770462e 100644 --- a/MUON/AliMUONMchViewApplication.h +++ b/MUON/AliMUONMchViewApplication.h @@ -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()); } diff --git a/MUON/AliMUONPCBPainter.cxx b/MUON/AliMUONPCBPainter.cxx index 0cd8ffd718c..0abd3c7edca 100644 --- a/MUON/AliMUONPCBPainter.cxx +++ b/MUON/AliMUONPCBPainter.cxx @@ -39,6 +39,15 @@ 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, diff --git a/MUON/AliMUONPCBPainter.h b/MUON/AliMUONPCBPainter.h index 1b9d26790b4..18b1fbd8f1f 100644 --- a/MUON/AliMUONPCBPainter.h +++ b/MUON/AliMUONPCBPainter.h @@ -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 diff --git a/MUON/AliMUONPainterDataSourceFrame.cxx b/MUON/AliMUONPainterDataSourceFrame.cxx index 037bbd84ef7..dbd1d3f079d 100644 --- a/MUON/AliMUONPainterDataSourceFrame.cxx +++ b/MUON/AliMUONPainterDataSourceFrame.cxx @@ -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); diff --git a/MUON/AliMUONPainterMasterFrame.cxx b/MUON/AliMUONPainterMasterFrame.cxx index a47b1ae20ff..18384c98c83 100644 --- a/MUON/AliMUONPainterMasterFrame.cxx +++ b/MUON/AliMUONPainterMasterFrame.cxx @@ -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); diff --git a/MUON/AliMUONPainterPlotSelector.cxx b/MUON/AliMUONPainterPlotSelector.cxx index 643d481efa0..68ceaecb89c 100644 --- a/MUON/AliMUONPainterPlotSelector.cxx +++ b/MUON/AliMUONPainterPlotSelector.cxx @@ -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(); } diff --git a/MUON/AliMUONPainterRegistry.cxx b/MUON/AliMUONPainterRegistry.cxx index 1802420db2d..36713020718 100644 --- a/MUON/AliMUONPainterRegistry.cxx +++ b/MUON/AliMUONPainterRegistry.cxx @@ -17,8 +17,11 @@ #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 @@ -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 diff --git a/MUON/AliMUONPainterRegistry.h b/MUON/AliMUONPainterRegistry.h index 3417059da0b..4b38a240a9e 100644 --- a/MUON/AliMUONPainterRegistry.h +++ b/MUON/AliMUONPainterRegistry.h @@ -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 diff --git a/MUON/AliMUONTrackerACFDataMaker.cxx b/MUON/AliMUONTrackerACFDataMaker.cxx index 508f169bbde..1e9d52921c6 100644 --- a/MUON/AliMUONTrackerACFDataMaker.cxx +++ b/MUON/AliMUONTrackerACFDataMaker.cxx @@ -24,6 +24,7 @@ #include "AliLog.h" #include #include +#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); } diff --git a/MUON/AliMUONTrackerData.cxx b/MUON/AliMUONTrackerData.cxx index 518970d3ad7..0aec61069b9 100644 --- a/MUON/AliMUONTrackerData.cxx +++ b/MUON/AliMUONTrackerData.cxx @@ -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; } //_____________________________________________________________________________ diff --git a/MUON/AliMUONTrackerData.h b/MUON/AliMUONTrackerData.h index 4825780920d..ccd6843c993 100644 --- a/MUON/AliMUONTrackerData.h +++ b/MUON/AliMUONTrackerData.h @@ -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 diff --git a/MUON/AliMUONTrackerOCDBDataMaker.cxx b/MUON/AliMUONTrackerOCDBDataMaker.cxx index e9399554297..54d15025f4f 100644 --- a/MUON/AliMUONTrackerOCDBDataMaker.cxx +++ b/MUON/AliMUONTrackerOCDBDataMaker.cxx @@ -17,12 +17,23 @@ #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 +#include +#include +#include #include ///\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(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(m.FindObject(name.Data())); + TObjArray* a = static_cast(p->Value()); + TIter n2(a); + AliDCSValue* v; + Float_t hvValue(0); + Int_t n(0); + while ( ( v = static_cast(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(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(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; +} diff --git a/MUON/AliMUONTrackerOCDBDataMaker.h b/MUON/AliMUONTrackerOCDBDataMaker.h index 9ff6ad802c1..1adbf35de48 100644 --- a/MUON/AliMUONTrackerOCDBDataMaker.h +++ b/MUON/AliMUONTrackerOCDBDataMaker.h @@ -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 diff --git a/MUON/AliMUONVPainter.cxx b/MUON/AliMUONVPainter.cxx index ab824c6ce23..807b2af6a51 100644 --- a/MUON/AliMUONVPainter.cxx +++ b/MUON/AliMUONVPainter.cxx @@ -19,6 +19,10 @@ #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" @@ -92,6 +96,30 @@ 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(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(); } //_____________________________________________________________________________ diff --git a/MUON/AliMUONVPainter.h b/MUON/AliMUONVPainter.h index d9b0aecc98a..ac3ea2a558a 100644 --- a/MUON/AliMUONVPainter.h +++ b/MUON/AliMUONVPainter.h @@ -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 diff --git a/MUON/AliMUONVTrackerData.cxx b/MUON/AliMUONVTrackerData.cxx index 872df125936..38032a7e94c 100644 --- a/MUON/AliMUONVTrackerData.cxx +++ b/MUON/AliMUONVTrackerData.cxx @@ -74,3 +74,9 @@ AliMUONVTrackerData::Print(Option_t* wildcard) const Print(wildcard,"summary"); } +//_____________________________________________________________________________ +Bool_t +AliMUONVTrackerData::Replace(const AliMUONVStore& store) +{ + Emit("Replace(const AliMUONVStore&)"); +} diff --git a/MUON/AliMUONVTrackerData.h b/MUON/AliMUONVTrackerData.h index f2fbd50201d..036464e5e18 100644 --- a/MUON/AliMUONVTrackerData.h +++ b/MUON/AliMUONVTrackerData.h @@ -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; diff --git a/MUON/mchview.cxx b/MUON/mchview.cxx index 47b4c3920b2..405786df4f0 100644 --- a/MUON/mchview.cxx +++ b/MUON/mchview.cxx @@ -23,15 +23,16 @@ #include "AliMUONMchViewApplication.h" -#include "AliMUONPainterHelper.h" + #include "AliCDBManager.h" #include "AliCodeTimer.h" #include "AliLog.h" -#include -#include +#include "AliMUONPainterHelper.h" +#include #include #include -#include +#include +#include //______________________________________________________________________________ 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(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(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();