27 #include "AliCDBManager.h"
28 #include "AliGeomManager.h"
46 #include <TGComboBox.h>
48 #include <TGNumberEntry.h>
49 #include <TGTextEntry.h>
50 #include <TGeoManager.h>
60 #define PRECISION 1E-12
62 Double_t Difference(Double_t v1, Double_t v2)
65 return TMath::Abs(d) <
PRECISION ? 0.0 : d;
71 : TGTransientFrame(p,main,w,h),
72 fF1(new TGVerticalFrame(this)),
75 fF2(new TGVerticalFrame(this)),
78 fF3(new TGHorizontalFrame(this)),
79 fBasename(new TGTextEntry(fF3)),
80 fButtonFrame(new TGHorizontalFrame(this)),
81 fOK(new TGTextButton(fButtonFrame,
"OK")),
82 fCancel(new TGTextButton(fButtonFrame,
"Cancel"))
86 SetCleanup(kDeepCleanup);
91 fF3->AddFrame(
new TGLabel(
fF3,
"Output basename"),
new TGLayoutHints(kLHintsLeft|kLHintsTop,5,5,5,5));
92 fF3->AddFrame(
fBasename,
new TGLayoutHints(kLHintsRight|kLHintsExpandX|kLHintsTop,5,5,5,5));
94 AddFrame(
fF1,
new TGLayoutHints(kLHintsLeft|kLHintsExpandX|kLHintsTop,5,5,5,5));
95 AddFrame(
fF2,
new TGLayoutHints(kLHintsLeft|kLHintsExpandX|kLHintsTop,5,5,5,5));
96 AddFrame(
fF3,
new TGLayoutHints(kLHintsLeft|kLHintsExpandX|kLHintsTop,5,5,5,5));
98 fButtonFrame->AddFrame(
fOK,
new TGLayoutHints(kLHintsLeft|kLHintsTop,5,5,5,5));
101 AddFrame(
fButtonFrame,
new TGLayoutHints(kLHintsLeft|kLHintsExpandX|kLHintsTop,5,5,5,5));
103 fOK->Connect(
"Clicked()",
"AliMUONAlignmentCompareDialog",
this,
"DoOK()");
104 fCancel->Connect(
"Clicked()",
"AliMUONAlignmentCompareDialog",
this,
"DoCancel()");
115 TGTextEntry*& text, TGNumberEntry*& run)
118 TGHorizontalFrame* hf1 =
new TGHorizontalFrame(frame);
120 hf1->AddFrame(
new TGLabel(hf1,TString(msg) +
" ocdb path"),
new TGLayoutHints(kLHintsLeft|kLHintsTop,5,5,5,5));
122 text =
new TGTextEntry(hf1,
"alien://folder=/alice/data/2012/OCDB");
124 hf1->AddFrame(text,
new TGLayoutHints(kLHintsRight|kLHintsExpandX|kLHintsTop,5,5,5,5));
126 TGHorizontalFrame* hf2 =
new TGHorizontalFrame(frame);
128 hf2->AddFrame(
new TGLabel(hf2,TString(msg) +
" run number"),
new TGLayoutHints(kLHintsLeft|kLHintsTop,5,5,5,5));
130 run =
new TGNumberEntry(hf2);
132 hf2->AddFrame(run,
new TGLayoutHints(kLHintsRight|kLHintsExpandX|kLHintsTop,5,5,5,5));
134 frame->AddFrame(hf1,
new TGLayoutHints(kLHintsLeft|kLHintsExpandX|kLHintsTop,5,5,5,5));
135 frame->AddFrame(hf2,
new TGLayoutHints(kLHintsLeft|kLHintsExpandX|kLHintsTop,5,5,5,5));
155 TTimer::SingleShot(150,
"AliMUONAlignmentCompareDialog",
this,
"CloseWindow()");
163 TTimer::SingleShot(150,
"AliMUONAlignmentCompareDialog",
this,
"CloseWindow()");
169 const char* ocdbPathForAlign2, Int_t run2)
172 AliCDBManager* cdbm = AliCDBManager::Instance();
173 cdbm->SetDefaultStorage(
"raw://");
178 const char*
align[2] = {
187 for (Int_t i = 0; i < 2; i++)
189 cdbm->UnloadFromCache(
"GRP/Geometry/Data");
190 cdbm->UnloadFromCache(
"MUON/Align/Data");
191 AliGeomManager::GetGeometry()->UnlockGeometry();
192 AliGeomManager::LoadGeometry();
193 if (!AliGeomManager::GetGeometry())
return 0x0;
194 cdbm->SetSpecificStorage(
"MUON/Align/Data",align[i]);
195 cdbm->SetRun(runs[i]);
196 AliGeomManager::ApplyAlignObjsFromCDB(
"MUON");
209 while (!nextDE.
IsDone()) {
214 for (Int_t icath = 0; icath < 2; icath++) {
221 while (!nextPad->
IsDone()) {
241 Double_t dx = ::Difference(x2,x1);
242 Double_t dy = ::Difference(y2,y1);
243 Double_t dz = ::Difference(z2,z1);
272 data->
Add(shiftStore);
Implementation of AliMUONVTrackerData.
The iterator over detection elements.
const AliMpVSegmentation * GetMpSegmentation(Int_t detElemId, AliMp::CathodType cath, Bool_t warn=true) const
static AliMpSegmentation * Instance(Bool_t warn=true)
static Int_t NTrackingCh()
Return number of tracking chambers.
TGCompositeFrame * fF3
frame for difference type selection
TGTextEntry * fBasename
basename of resulting (diff-ed) data
TGCompositeFrame * fButtonFrame
to hold OK and Cancel buttons
Producer of some AliMUONVTrackerData.
TGTextButton * fCancel
cancel button
Authors Philippe Pillot, Laurent Aphecetche, Subatech.
TGTextEntry * fOCDBPath2
to select second alignment path
virtual void SetDimensionName(Int_t index, const char *value)
Set the name of a given dimension.
AliMpDetElement * CurrentDE() const
virtual AliMpVPadIterator * CreateIterator(const AliMpArea &area) const =0
Create iterator over pads in the given area.
virtual Bool_t IsDone() const =0
Is iterator done.
TGTextEntry * fOCDBPath1
to select first alignment path
AliMUONAlignmentCompareDialog(const TGWindow *p=0, const TGWindow *main=0, UInt_t w=1, UInt_t h=1)
TGCompositeFrame * fF2
frame for align 2 selection
Int_t GetManuChannel() const
void Register(AliMUONVTrackerDataMaker *reader)
static AliMUONPainterDataRegistry * Instance()
Container of calibration values for a given number of channels.
static Int_t ManuNofChannels()
Max number of channels per manu.
virtual ~AliMUONAlignmentCompareDialog()
TGTextButton * fOK
ok button
virtual TObject * FindObject(Int_t i, Int_t j) const
Find an object using 2 ids.
virtual void Next()=0
Set iterator to the next pad.
An interface for an iterator over pads.
Double_t GetPositionY() const
Return the pad x position (in cm)
std::vector< RunInfo > runs
Implementation of AliMUONVCalibParam for tuples of double.
TGNumberEntry * fRun2
to select second run
AliMp::CathodType GetCathodType(Int_t cathodNumber)
Convert integer number in enum;.
TGNumberEntry * fRun1
to select first run
virtual AliMpPad CurrentItem() const =0
Return current pad.
Bool_t Add(const AliMUONTrackerData &data)
Basic implementation of AliMUONVStore container using AliMpExMap internally.
Simple wrapper of AliMUONVTrackerData (for backward compatibility)
virtual Bool_t Add(TObject *object)
Add an object to the store.
The abstract base class for the segmentation.
AliMUONVTrackerData * CompareAlignment(const char *ocdbPathForAlign1, Int_t run1, const char *ocdbPathForAlign2, Int_t run2)
virtual void First()=0
Set iterator to the first pad.
Class which encapsuate all information about a pad.
Double_t GetPositionX() const
Return the pad x position (in cm)
void AddInput(TGCompositeFrame *frame, const char *msg, TGTextEntry *&text, TGNumberEntry *&run)
Base class for MUON data that can be presented at different levels in the hierarchy of the MUON syste...
int main(int argc, char **argv)
Int_t GetId() const
Return Id.
TGCompositeFrame * fF1
frame for align 1 selection
virtual void SetValueAsDouble(Int_t i, Int_t j, Double_t value)