From 6fb51ca48e5c1f2095e0c3bf2ace633132f87a4a Mon Sep 17 00:00:00 2001 From: marian Date: Thu, 27 Aug 2009 07:58:39 +0000 Subject: [PATCH] Jens Wiechula modifications. AliTPCCalibRaw.cxx.diff remove printf AliTPCCalibViewerGUItime.cxx.diff Add functionality: configuration file, calibration type selection, ... AliTPCCalibViewerGUItime.h.diff Add functionality: configuration file, calibration type selection, ... AliTPCConfigParser.cxx.diff Add functionality to retrieve parameters AliTPCConfigParser.h.diff Add functionality to retrieve parameters CalibEnv.C.diff Add new calibration data written to the tree calibVarDescription.txt Configuration file for AliTPCCalibViewerGUItime TPCCEda.cxx.diff Remove obsolete data filling method TPCPEDESTALda.cxx.diff Remove obsolete data filling method TPCPULSERda.cxx.diff Remove obsolete data filling method TPCQAda.cxx.diff Update meta data TPCRAWda.cxx.diff Update meta data, remove obsolete delete --- TPC/AliTPCCalibViewerGUItime.cxx | 271 ++++++++++++++++++++---- TPC/AliTPCCalibViewerGUItime.h | 24 ++- TPC/AliTPCConfigParser.cxx | 51 +++++ TPC/AliTPCConfigParser.h | 16 +- TPC/CalibMacros/CalibEnv.C | 56 +++-- TPC/CalibMacros/calibVarDescription.txt | 59 ++++++ TPC/TPCCEda.cxx | 11 - TPC/TPCPEDESTALda.cxx | 4 - TPC/TPCPULSERda.cxx | 4 - TPC/TPCQAda.cxx | 2 +- TPC/TPCRAWda.cxx | 18 +- 11 files changed, 412 insertions(+), 104 deletions(-) create mode 100644 TPC/CalibMacros/calibVarDescription.txt diff --git a/TPC/AliTPCCalibViewerGUItime.cxx b/TPC/AliTPCCalibViewerGUItime.cxx index 8902d22a1d3..af56fd7480d 100644 --- a/TPC/AliTPCCalibViewerGUItime.cxx +++ b/TPC/AliTPCCalibViewerGUItime.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -58,8 +59,10 @@ #include //AliRoot includes +#include #include "AliTPCCalibViewerGUI.h" #include "AliTPCcalibDB.h" +#include "AliTPCConfigParser.h" #include "AliTPCCalibViewerGUItime.h" @@ -76,6 +79,8 @@ TGCompositeFrame(p,w,h), fCurrentRunDetails(-1), fOutputCacheDir("/tmp"), fDrawString(""), + fConfigFile("$ALICE_ROOT/TPC/CalibMacros/calibVarDescription.txt"), + fConfigParser(0x0), fIsCustomDraw(kFALSE), fRunNumbers(10), fTimeStamps(10), @@ -98,6 +103,8 @@ TGCompositeFrame(p,w,h), fLblRunType(0x0), fNmbPar(0x0), fLblPar(0x0), + fListCalibType(0x0), + fContCalibType(0x0), //content centre fContCenter(0x0), fCanvMain(0x0), @@ -135,7 +142,7 @@ AliTPCCalibViewerGUItime::~AliTPCCalibViewerGUItime(){ } //______________________________________________________________________________ -void AliTPCCalibViewerGUItime::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) { +void AliTPCCalibViewerGUItime::DrawGUI(const TGWindow */*p*/, UInt_t w, UInt_t h) { // // draw the GUI // @@ -144,7 +151,6 @@ void AliTPCCalibViewerGUItime::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) { // ====================================================================== SetCleanup(kDeepCleanup); - p = p; // to avoid compiler warnings // ***************************************************************************** // ************************* content of this MainFrame ************************* @@ -220,7 +226,8 @@ void AliTPCCalibViewerGUItime::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) { fContDrawSel->AddFrame(fListVariables, new TGLayoutHints(kLHintsNormal | kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0)); fListVariables->Connect("Selected(Int_t)", "AliTPCCalibViewerGUItime", this, "DoNewSelection()"); - //-------------------- rynType selection ------------------------ + +//-------------------- run type selection ------------------------ // Parameter label fLblRunType = new TGLabel(fContDrawSel, "Run Type:"); fLblRunType->SetTextJustify(kTextLeft); @@ -244,6 +251,19 @@ void AliTPCCalibViewerGUItime::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) { fNmbPar->Connect("ValueSet(Long_t)", "AliTPCCalibViewerGUItime", this, "DoParLimitChange()"); fNmbPar->SetState(kFALSE); + //-------------------- calibration type selection ------------------------ + // label + // draw selection group + fContCalibType = new TGGroupFrame(fContLeft, "Calib type selection", kVerticalFrame | kFitWidth | kFitHeight); + fContLeft->AddFrame(fContCalibType, new TGLayoutHints(kLHintsExpandX , 0, 0, 10, 0)); + + // list of variables + fListCalibType = new TGListBox(fContCalibType); + fContCalibType->AddFrame(fListCalibType, new TGLayoutHints(kLHintsNormal | kLHintsExpandX , 0, 0, 0, 0)); + fListCalibType->Connect("Selected(Int_t)", "AliTPCCalibViewerGUItime", this, "DoChangeSelectionList()"); + fListCalibType->Resize(0,88); + fListCalibType->SetMultipleSelections(); + // ========================================================================== // ************************* content of fContCenter ************************* @@ -254,7 +274,8 @@ void AliTPCCalibViewerGUItime::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) { fCanvMain->GetCanvas()->Connect("ProcessedEvent(Int_t, Int_t, Int_t, TObject*)", "AliTPCCalibViewerGUItime", this, "MouseMove(Int_t, Int_t, Int_t, TObject*)"); // fCanvMain->GetCanvas()->Connect("RangeAxisChanged()", "AliTPCCalibViewerGUItime", this, "GetMinMax()"); fCanvMain->GetCanvas()->SetToolTipText("The Main_Canvas, here your plots are displayed."); - + fCanvMain->GetCanvas()->SetRightMargin(0.062); + fCanvMain->GetCanvas()->SetLeftMargin(0.15); // ========================================================================= // ************************* content of fContRight ************************* @@ -300,7 +321,7 @@ void AliTPCCalibViewerGUItime::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) { fContValues->AddFrame(fLblValueYVal, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0)); // draw button fBtnDumpRuns = new TGTextButton(fContRight, "&Dump runs"); - fContRight->AddFrame(fBtnDumpRuns, new TGLayoutHints(kLHintsExpandX, 10, 10, 0, 0)); + fContRight->AddFrame(fBtnDumpRuns, new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 0)); fBtnDumpRuns->Connect("Clicked()", "AliTPCCalibViewerGUItime", this, "DoDumpRuns()"); fBtnDumpRuns->SetToolTipText("Press to dump the run numbers of the current selection."); @@ -341,8 +362,8 @@ void AliTPCCalibViewerGUItime::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) { fComboCustomCuts->Resize(0, 22); fComboCustomCuts->EnableTextInput(kTRUE); fContCustomCuts->AddFrame(fComboCustomCuts, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0)); - fComboCustomCuts->Connect("ReturnPressed()", "AliTPCCalibViewerGUItime", this, "DoCustomDraw()"); - fComboCustomCuts->Connect("Selected(Int_t)", "AliTPCCalibViewerGUItime", this, "DoCustomDraw()"); + fComboCustomCuts->Connect("ReturnPressed()", "AliTPCCalibViewerGUItime", this, "DoCustomCutsDraw()"); + fComboCustomCuts->Connect("Selected(Int_t)", "AliTPCCalibViewerGUItime", this, "DoCustomCutsDraw()"); SetWindowName("AliTPCCalibViewer GUI - Time"); MapSubwindows(); @@ -366,32 +387,26 @@ void AliTPCCalibViewerGUItime::UseFile(const char* fileName) { TDirectory *save=gDirectory; if (fFile) delete fFile; fFile = TFile::Open(fileName); + if (!fFile) return; + if (!fFile->IsOpen()) return; fTree=(TTree*)fFile->Get("dcs"); + if (!fTree){ + AliError(Form("Could not get tree from file '%s'",fileName)); + return; + } save->cd(); + if (fConfigParser) delete fConfigParser; + fConfigParser=new AliTPCConfigParser(gSystem->ExpandPathName(fConfigFile.Data())); Reload(); } //______________________________________________________________________________ -void AliTPCCalibViewerGUItime::Reload(){ +void AliTPCCalibViewerGUItime::FillRunTypes() +{ // - // reload the gui contents, this is needed after the input tree has changed + //Loop over the tree entries and fill the run types // - - //reset variables list - fListVariables->RemoveAll(); - - if ( !fTree ) return; - TObjArray *branchList = fTree->GetListOfBranches(); - if ( !branchList ) return; - TIter nextBranch(branchList); + if (!fTree) return; Int_t id=0; - TObject *objBranch=0; - while ( (objBranch=nextBranch()) ){ - TString branchName(objBranch->GetName()); - if (branchName == "run" || branchName == "time" || branchName == "runType.") continue; - fListVariables->AddEntry(branchName.Data(),id++); - } - //create entris for run types - id=0; fComboRunType->RemoveAll(); fComboRunType->AddEntry("ALL",id++); fComboRunType->Select(0,kFALSE); @@ -411,24 +426,131 @@ void AliTPCCalibViewerGUItime::Reload(){ fTree->SetBranchStatus("*",1); } //______________________________________________________________________________ +void AliTPCCalibViewerGUItime::FillCalibTypes() +{ + // + // loop over configuration and fill calibration types + // + if (!fConfigParser) return; + Int_t id=0; + fListCalibType->RemoveAll(); + TObject *o=0x0; + fConfigParser->ResetIter(); + TString type; + while ( (o=fConfigParser->NextKey()) ){ + type=fConfigParser->GetData(o,kCalibType); + //remove whitespcaces + type.Remove(TString::kBoth,' '); + type.Remove(TString::kBoth,'\t'); + if (type.IsNull()) type="UNSPECIFIED"; +// printf("CalibType: '%s'\n",type.Data()); + if (!fListCalibType->FindEntry(type.Data())) { + fListCalibType->AddEntry(type,id); + fListCalibType->Select(id++); + } + } + //add type for unspecified calibration type + type="UNSPECIFIED"; + if (!fListCalibType->FindEntry(type.Data())) { + fListCalibType->AddEntry(SubstituteUnderscores(type.Data()),id); + fListCalibType->Select(id++); + } +} +//______________________________________________________________________________ +void AliTPCCalibViewerGUItime::Reload(Int_t first){ + // + // reload the gui contents, this is needed after the input tree has changed + // + + if ( !fTree ) return; + //in case of the first call create run type and calibration type entries + if (first){ + FillRunTypes(); + FillCalibTypes(); + } + //activate all branches + fTree->SetBranchStatus("*",1); + //reset variables list + fListVariables->RemoveAll(); + //get selected calibration types + TList calibTypes; + fListCalibType->GetSelectedEntries(&calibTypes); + + TObjArray *branchList = fTree->GetListOfBranches(); + if ( !branchList ) return; + TIter nextBranch(branchList); + Int_t idCount=0,id=0; + TObject *objBranch=0; + while ( (objBranch=nextBranch()) ){ + TString branchName(objBranch->GetName()); + TString branchTitle(objBranch->GetName()); + if (branchName == "run" || branchName == "time" || branchName == "runType.") continue; + Bool_t active=kTRUE; + TString calibType="UNSPECIFIED"; + if (fConfigParser){ + const TObject *key=(*fConfigParser)(branchName.Data()); + if (key){ + //test if branch is active + active=fConfigParser->GetValue(branchName.Data(),kBranchOnOff); + id=(*fConfigParser)()->IndexOf(key); + branchTitle=fConfigParser->GetData(key,kBranchTitle); + calibType=fConfigParser->GetData(key,kCalibType); + } + else{ + id=1000+idCount; + } + } else { + id=idCount; + } + //check if branch is in selected calibration types + //if not, don't show it in the list and deactivate the branch. + Bool_t calibActive=kFALSE; + TIter nextCalib(&calibTypes); + TObject *objCalib=0; + while (objCalib=nextCalib()) + if (calibType==objCalib->GetTitle()) calibActive=kTRUE; + active&=calibActive; + if (!active){ + TString s=branchName; + if (branchName.EndsWith(".")) s+="*"; + fTree->SetBranchStatus(s.Data(),0); + continue; + } + fListVariables->AddEntry(SubstituteUnderscores(branchTitle.Data()),id); + ++idCount; + } + //trick to display modifications + if (!first){ + fListVariables->Resize(fListVariables->GetWidth()-1, fListVariables->GetHeight()); + fListVariables->Resize(fListVariables->GetWidth()+1, fListVariables->GetHeight()); + } +} +//______________________________________________________________________________ const char* AliTPCCalibViewerGUItime::GetDrawString(){ // // create draw string for ttree by combining the user requestsa // TString selectedVariable=""; - if (fListVariables->GetSelectedEntry()) selectedVariable = fListVariables->GetSelectedEntry()->GetTitle(); + Int_t id=-1; + if (!fListVariables->GetSelectedEntry()) return ""; + selectedVariable = fListVariables->GetSelectedEntry()->GetTitle(); + id=fListVariables->GetSelectedEntry()->EntryId(); +// printf("id: %d\n",id); + TString branchName=selectedVariable; + const TObject *key=(*fConfigParser)(id); + if (key) branchName=(*fConfigParser)(id)->GetName(); //treat case of TVector - if (selectedVariable.EndsWith(".")){ + if (branchName.EndsWith(".")){ Int_t par = (Int_t)(fNmbPar->GetNumber()); - selectedVariable.Append(Form("fElements[%d]",par)); + branchName.Append(Form("fElements[%d]",par)); } // if (fRadioXrun->GetState()==kButtonDown) // selectedVariable.Append(":run"); // if (fRadioXtime->GetState()==kButtonDown) // selectedVariable.Append(":time"); - return selectedVariable.Data(); + return branchName.Data(); } //______________________________________________________________________________ const char* AliTPCCalibViewerGUItime::GetCutString(){ @@ -482,12 +604,27 @@ void AliTPCCalibViewerGUItime::DoDraw() { } }else{ drawGraph=kTRUE; + TString yname=fDrawString.Data(); + if (fConfigParser ){ + Int_t id=fListVariables->GetSelectedEntry()->EntryId(); + if ((*fConfigParser)(id)) yname=fConfigParser->GetData((*fConfigParser)(id),kBranchTitle); + yname=SubstituteUnderscores(yname.Data()); + if (fNmbPar->GetButtonUp()->GetState()!=kButtonDisabled){ + yname+=": "; + Int_t par = (Int_t)(fNmbPar->GetNumber()); + if (fConfigParser && (*fConfigParser)(id)) { + TString yparname=fConfigParser->GetData((*fConfigParser)(id),par+kParamNames); + yparname=SubstituteUnderscores(yparname); + yname+=yparname; + } + } + } if (fRadioXrun->GetState()==kButtonDown){ fValuesX.SetElements(fTree->GetV1()); - title=Form("%s:Run;Run;%s",fDrawString.Data(),fDrawString.Data()); + title=Form("%s:Run;Run;%s",fDrawString.Data(),yname.Data()); } else if (fRadioXtime->GetState()==kButtonDown){ fValuesX.SetElements(fTree->GetV2()); - title=Form("%s:Time;Time;%s",fDrawString.Data(),fDrawString.Data()); + title=Form("%s:Time;Time;%s",fDrawString.Data(),yname.Data()); } else { drawGraph=kFALSE; } @@ -506,8 +643,6 @@ void AliTPCCalibViewerGUItime::DoDraw() { fCurrentHist->Draw(); } -// fCurrentHist=fTree->GetHistogram(); -// fCurrentGraph=(TGraph*)gPad->GetPrimitive("Graph"); //Set time axis if choosen as x-variables if (fRadioXtime->GetState()==kButtonDown&&!fIsCustomDraw){ TAxis *xaxis=fCurrentHist->GetXaxis(); @@ -521,6 +656,8 @@ void AliTPCCalibViewerGUItime::DoDraw() { fCurrentGraph->SetMarkerStyle(20); fCurrentGraph->SetMarkerSize(0.5); } + //Set title offset + fCurrentHist->GetYaxis()->SetTitleOffset(1.5); gPad->Modified(); gPad->Update(); padsave->cd(); @@ -532,9 +669,17 @@ void AliTPCCalibViewerGUItime::DoDumpRuns() // // Dump the current run numbers to stdout // - for (Int_t irun=0;irunGetNumber()); - fLblPar->SetText(Form("Parameter: %02d",par)); - fDrawString=GetDrawString(); - fIsCustomDraw=kFALSE; + UpdateParName(); DoDraw(); } //______________________________________________________________________________ @@ -621,8 +763,24 @@ void AliTPCCalibViewerGUItime::HandleButtonsDrawSel(Int_t id) } break; } - if (doDraw) DoNewSelection(); + if (doDraw) DoCustomCutsDraw(); } +//______________________________________________________________________________ +void AliTPCCalibViewerGUItime::UpdateParName() +{ + // + // change parameter name + // + + Int_t par = (Int_t)(fNmbPar->GetNumber()); + TString parName=par; + Int_t id=fListVariables->GetSelectedEntry()->EntryId(); + if (fConfigParser && (*fConfigParser)(id)) parName=fConfigParser->GetData((*fConfigParser)(id),par+kParamNames); + fLblPar->SetText(Form("Parameter: %s",parName.Data())); + fDrawString=GetDrawString(); + fIsCustomDraw=kFALSE; +} + //______________________________________________________________________________ void AliTPCCalibViewerGUItime::UpdateParLimits() { @@ -630,10 +788,19 @@ void AliTPCCalibViewerGUItime::UpdateParLimits() // Adjust limits for TVectorT based variables // if (!fTree) return; - TString selectedVariable=""; - if (fListVariables->GetSelectedEntry()) selectedVariable = fListVariables->GetSelectedEntry()->GetTitle(); + TString selectedVariableTitle=""; + Int_t id=-1; + if (!fListVariables->GetSelectedEntry()) return; + selectedVariableTitle = fListVariables->GetSelectedEntry()->GetTitle(); + id=fListVariables->GetSelectedEntry()->EntryId(); +// printf("id: %d\n",id); + TString selectedVariable=selectedVariableTitle; + const TObject *key=(*fConfigParser)(id); + if (key) selectedVariable=(*fConfigParser)(id)->GetName(); + if (selectedVariable.IsNull()||!selectedVariable.EndsWith(".")) { fNmbPar->SetState(kFALSE); + fLblPar->SetText("Parameter: none"); return; } TVectorD *vD=0x0; @@ -658,16 +825,14 @@ void AliTPCCalibViewerGUItime::UpdateParLimits() fNmbPar->SetNumber(0); fNmbPar->SetLimitValues(0,maxPar-1); fNmbPar->SetState(kTRUE); + UpdateParName(); } //______________________________________________________________________________ -void AliTPCCalibViewerGUItime::MouseMove(Int_t event, Int_t x, Int_t y, TObject *selected) +void AliTPCCalibViewerGUItime::MouseMove(Int_t event, Int_t x, Int_t y, TObject */*selected*/) { // // handle mouse events in the draw canvas // - - //avoid compiler warnings - selected=selected; UInt_t dd=0,mm=0,yy=0,HH=0,MM=0,SS=0,run=0; Double_t valx=0.,valy=0.; if (!fCurrentGraph) { @@ -688,7 +853,7 @@ void AliTPCCalibViewerGUItime::MouseMove(Int_t event, Int_t x, Int_t y, TObject for (Int_t i=0;iXtoAbsPixel(gPad->XtoPad(arr[i])); Int_t pyp = gPad->YtoAbsPixel(gPad->YtoPad(fValuesY[i])); - Int_t d = (Int_t)TMath::Sqrt(TMath::Abs(pxp-x) + TMath::Abs(pyp-y)); + Int_t d = TMath::Sqrt(TMath::Abs(pxp-x) + TMath::Abs(pyp-y)); if (d < minDist) { minDist = d; minPoint = i; @@ -756,6 +921,18 @@ void AliTPCCalibViewerGUItime::SetGuiTree(Int_t run) } } //______________________________________________________________________________ +const char* AliTPCCalibViewerGUItime::SubstituteUnderscores(const char* in) +{ + // + // + // + TString s(in); + s.ReplaceAll("_{","|{"); + s.ReplaceAll("_"," "); + s.ReplaceAll("|{","_{"); + return s.Data(); +} +//______________________________________________________________________________ TObjArray* AliTPCCalibViewerGUItime::ShowGUI(const char* fileName) { // // Initialize and show GUI for presentation for demonstration purposes diff --git a/TPC/AliTPCCalibViewerGUItime.h b/TPC/AliTPCCalibViewerGUItime.h index 3eb3c4261c0..cf47ada086f 100644 --- a/TPC/AliTPCCalibViewerGUItime.h +++ b/TPC/AliTPCCalibViewerGUItime.h @@ -49,6 +49,7 @@ class TTree; class TGraph; class AliTPCCalibViewerGUI; +class AliTPCConfigParser; @@ -59,15 +60,15 @@ public: static TObjArray* ShowGUI(const char* fileName = 0); // initialize and show GUI standalone - void DrawGUI(const TGWindow *p, UInt_t w, UInt_t h); + void DrawGUI(const TGWindow */*p*/, UInt_t w, UInt_t h); void UseFile(const char* fileName); - void Reload(); - void SetInitialValues(); + void Reload(Int_t first=1); void SetCalibViewerGUI(AliTPCCalibViewerGUI *gui) {fCalibViewerGUI=gui;} void SetCalibViewerGUItab(TGTabElement *tab) {fCalibViewerGUItab=tab;} + void SetConfigFile(const char* file) {fConfigFile=file;} const char* GetDrawString(); const char* GetCutString(); //Slots @@ -77,8 +78,9 @@ public: void DoCustomCutsDraw(); void DoParLimitChange(); void DoNewSelection(); // decides whether to redraw if user makes another selection + void DoChangeSelectionList() {Reload(0);} void HandleButtonsDrawSel(Int_t id = -1); - void MouseMove(Int_t event, Int_t x, Int_t y, TObject *selected); + void MouseMove(Int_t event, Int_t x, Int_t y, TObject */*selected*/); private: TFile* fFile; //file that keeps the tree @@ -90,6 +92,8 @@ private: Int_t fCurrentRunDetails; //run number for wich details are currently shown TString fOutputCacheDir; //output cache diretory for AliTPCCalibViewerGUI trees, created on the fly TString fDrawString; //current draw string + TString fConfigFile; //configuration file keeping active branches and branch descriptions + AliTPCConfigParser *fConfigParser; //configuration parser Bool_t fIsCustomDraw; //if custom draw string is selected TVectorD fRunNumbers; //run numbers of current selection TVectorD fTimeStamps; //timr stamps of current selection @@ -109,10 +113,12 @@ private: TGRadioButton *fRadioXrun; // Radio button x-variable: run TGRadioButton *fRadioXtime; // Radio button x-variable: time TGListBox *fListVariables; // listbox with possible variables - TGComboBox *fComboRunType; // parameter number - TGLabel *fLblRunType; // parameter name + TGComboBox *fComboRunType; // run type selection box + TGLabel *fLblRunType; // run type label TGNumberEntry *fNmbPar; // parameter number TGLabel *fLblPar; // parameter name + TGListBox *fListCalibType; // calibration type selection box + TGGroupFrame *fContCalibType; // calibration type label //content centre TGCompositeFrame *fContCenter; // container for GUI elements at the center TRootEmbeddedCanvas *fCanvMain; // main drawing canvas @@ -137,9 +143,15 @@ private: TGComboBox *fComboCustomCuts; // combo box custom cuts string enum { kRadioXhist=10, kRadioXrun=11, kRadioXtime=12 }; + enum { kBranchOnOff=0, kBranchTitle=1, kCalibType=2, kParamNames=3 }; void UpdateParLimits(); + void UpdateParName(); void SetGuiTree(Int_t run); + void FillRunTypes(); + void FillCalibTypes(); + void SetInitialValues(); + const char* SubstituteUnderscores(const char* in); AliTPCCalibViewerGUItime(const AliTPCCalibViewerGUItime &v); AliTPCCalibViewerGUItime &operator = (const AliTPCCalibViewerGUItime &v); // assignment operator diff --git a/TPC/AliTPCConfigParser.cxx b/TPC/AliTPCConfigParser.cxx index b756cead9d8..ad8f25b22d4 100644 --- a/TPC/AliTPCConfigParser.cxx +++ b/TPC/AliTPCConfigParser.cxx @@ -173,6 +173,57 @@ Float_t AliTPCConfigParser::GetValue(const char *key, UInt_t position) return sval.Atof(); } //_____________________________________________________________________ +const char* AliTPCConfigParser::GetData(const char *key, UInt_t position) +{ + // + //Get value for the speciefied key + // + TObject *val=((TObjArray*)fConfigMap->FindObject(key))->At(position); + if ( !val ) { + return ""; + } + return (((TObjString*)val)->GetString()).Data(); +} +//_____________________________________________________________________ +Float_t AliTPCConfigParser::GetValue(const TObject *key, UInt_t position) +{ + // + //Get value for the speciefied key + // + TObject *val=((TObjArray*)fConfigMap->FindObject(key))->At(position); + if ( !val ) return -999.; + TString sval(((TObjString*)val)->GetString()); + return sval.Atof(); +} +//_____________________________________________________________________ +const char* AliTPCConfigParser::GetData(const TObject *key, UInt_t position) +{ + // + //Get value for the speciefied key + // + TObject *val=((TObjArray*)fConfigMap->FindObject(key))->At(position); + if ( !val ) { + return ""; + } + return (((TObjString*)val)->GetString()).Data(); +} +//_____________________________________________________________________ +Int_t AliTPCConfigParser::GetNumberOfValues(const char* key) const +{ + // + // return the number of values for key + // + return ((TObjArray*)fConfigMap->FindObject(key))->GetEntries(); +} +//_____________________________________________________________________ +Int_t AliTPCConfigParser::GetNumberOfValues(TObject* key) const +{ + // + // return the number of values for key + // + return ((TObjArray*)fConfigMap->FindObject(key))->GetEntries(); +} +//_____________________________________________________________________ TObject* AliTPCConfigParser::NextKey(){ if (!fKeyIter) fKeyIter=fConfigMap->MakeIterator(); TObject *obj=fKeyIter->Next(); diff --git a/TPC/AliTPCConfigParser.h b/TPC/AliTPCConfigParser.h index 6e4e9c4a205..b1f1eb406fe 100644 --- a/TPC/AliTPCConfigParser.h +++ b/TPC/AliTPCConfigParser.h @@ -18,14 +18,24 @@ public: virtual ~AliTPCConfigParser(); Int_t ParseConfigFileTxt(const char* cfgfile); - Float_t GetValue(const char* name, UInt_t position=0); - + Float_t GetValue(const char* key, UInt_t position=0); + Float_t GetValue(const TObject *key, UInt_t position=0); + const char* GetData(const char* key, UInt_t position=0); + const char* GetData(const TObject* key, UInt_t position=0); + + Int_t GetNumberOfValues(const char* key) const; + Int_t GetNumberOfValues(TObject* key) const; + const TList* GetConfigurationMap() const {return fConfigMap;} void ResetMap(); - const TList* operator()() const {return fConfigMap;} + const TList* operator()() const {return fConfigMap;} + const TObject* operator()(Int_t pos) const {return fConfigMap->At(pos);} const TObject* operator()(const char* key) const {return fConfigMap->FindObject(key);} const TObject* operator()(TObject* key) const {return fConfigMap->FindObject(key);} + + void ResetIter() {delete fKeyIter; fKeyIter=0; delete fValIter; fValIter=0;} + TObject* NextKey(); TObject* NextValue(const char *key); TObject* NextValue(TObject *key); diff --git a/TPC/CalibMacros/CalibEnv.C b/TPC/CalibMacros/CalibEnv.C index e447a36d106..2ec2ec956a1 100644 --- a/TPC/CalibMacros/CalibEnv.C +++ b/TPC/CalibMacros/CalibEnv.C @@ -65,7 +65,7 @@ void ProcessNoiseData(TVectorD &vNoiseMean, TVectorD &vNoiseMeanSenRegions, TVectorD &vNoiseRMS, TVectorD &vNoiseRMSSenRegions, Int_t &nonMaskedZero); void ProcessPulser(Int_t &nMasked, Int_t &nonMaskedZero); -void GetProductionInfo(Int_t run, Int_t &nalien, Int_t &nlocal); +void GetProductionInfo(Int_t run, Int_t &nalien, Int_t &nRawAlien, Int_t &nlocal, Int_t &nRawLocal); void Init(){ // @@ -73,10 +73,10 @@ void Init(){ // AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Parameters","local://$ALICE_ROOT/OCDB"); - AliCDBManager::Instance()->SetSpecificStorage("GRP/GRP/Data","local:///lustre/alice/alien/alice/data/2008/LHC08d/OCDB/"); - AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Temperature","local:///lustre/alice/alien/alice/data/2008/LHC08d/OCDB/"); - AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/HighVoltage","local:///lustre/alice/alien/alice/data/2008/LHC08d/OCDB/"); - AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Goofie","local:///lustre/alice/alien/alice/data/2008/LHC08d/OCDB/"); + AliCDBManager::Instance()->SetSpecificStorage("GRP/GRP/Data","local:///lustre/alice/alien/alice/data/2009/OCDB/"); + AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Temperature","local:///lustre/alice/alien/alice/data/2009/OCDB/"); + AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/HighVoltage","local:///lustre/alice/alien/alice/data/2009/OCDB/"); + AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Goofie","local:///lustre/alice/alien/alice/data/2009/OCDB/"); AliCDBManager::Instance()->SetRun(1); } @@ -121,6 +121,8 @@ void CalibEnv(const char * runList){ // Int_t startTime = sensorPressure->GetStartTime(); Int_t endTime = sensorPressure->GetEndTime(); + Int_t startTimeGRP = AliTPCcalibDB::GetGRP(irun)->GetTimeStart(); + Int_t stopTimeGRP = AliTPCcalibDB::GetGRP(irun)->GetTimeEnd(); Int_t dtime = TMath::Max((endTime-startTime)/20,10*60); //CE data processing - see ProcessCEdata function for description of the results TVectorD fitResultsA, fitResultsC; @@ -137,8 +139,8 @@ void CalibEnv(const char * runList){ Int_t nOffChannels=0; ProcessPulser(nMasked,nOffChannels); //production information - Int_t nalien=0,nlocal=0; - GetProductionInfo(irun, nalien, nlocal); + Int_t nalien=0,nRawAlien=0,nlocal=0,nRawLocal=0; + GetProductionInfo(irun, nalien, nRawAlien, nlocal,nRawLocal); //run type TObjString runType(AliTPCcalibDB::GetRunType(irun).Data()); @@ -207,9 +209,11 @@ void CalibEnv(const char * runList){ //tempMap->GetLinearFitter(0,0,itime); - (*pcstream)<<"dcs"<< + TTreeStream &mistream = (*pcstream)<<"dcs"<< "run="<GetPulserTmean(); + if (!pulserTmean) return; // AliTPCCalPad *pulserTrms=AliTPCcalibDB::Instance()->GetPulserTrms(); // AliTPCCalPad *pulserQmean=AliTPCcalibDB::Instance()->GetPulserQmean(); AliTPCCalPad *padMasked=AliTPCcalibDB::Instance()->GetALTROMasked(); //create IROC, OROC1, OROC2 and sensitive region masks for (UInt_t isec=0;isecGetCalROC(isec); + if (!tmeanROC) continue; // AliTPCCalROC *trmsROC=pulserTrms->GetCalROC(isec); // AliTPCCalROC *qmeanROC=pulserQmean->GetCalROC(isec); Float_t tmeanMedian=tmeanROC->GetMedian(); @@ -545,31 +555,41 @@ void ProcessPulser(Int_t &nMasked, Int_t &nonMaskedZero) } } -void GetProductionInfo(Int_t run, Int_t &nalien, Int_t &nlocal){ +void GetProductionInfo(Int_t run, Int_t &nalien, Int_t &nRawAlien, Int_t &nlocal, Int_t &nRawLocal){ // // find number of ESDs in central and local production for run // nalien=0; + nRawAlien=0; nlocal=0; + nRawLocal=0; TString sNlines; FILE *pipe = 0x0; //find number of ESDs in alien TString command="alien_find /alice/data/2009 "; command += Form("%09d",run); command += " | grep AliESDs.root | wc -l"; - pipe=gSystem->OpenPipe(command.Data(),"r"); - sNlines.Gets(pipe); - gSystem->ClosePipe(pipe); + sNlines = gSystem->GetFromPipe(command.Data()); nalien=sNlines.Atoi(); + //find number of raw files on alien + command="alien_find /alice/data/2009 "; + command += Form("%09d",run); + command += " | grep raw | grep -v tag | wc -l"; + sNlines = gSystem->GetFromPipe(command.Data()); + nRawAlien=sNlines.Atoi(); //find number of ESDs local - command="find /lustre/alice/alien/alice/data/2009 -name "; + command="find /lustre/alice/alien/alice/data/2009 -name AliESDs.root | grep "; command += Form("%09d",run); - command += " | grep AliESDs.root | wc -l"; - pipe = gSystem->OpenPipe(command.Data(),"r"); - sNlines.Gets(pipe); - gSystem->ClosePipe(pipe); + command += " | wc -l"; + sNlines = gSystem->GetFromPipe(command.Data()); nlocal=sNlines.Atoi(); + //find number of local raw data files + command="find /lustre/alice/alien/alice/data/2009 -name \"*.root\" | grep "; + command += Form("%09d",run); + command += " | grep raw | grep -v tag | wc -l"; + sNlines = gSystem->GetFromPipe(command.Data()); + nRawLocal=sNlines.Atoi(); } void FilterMag(const char * runList){ diff --git a/TPC/CalibMacros/calibVarDescription.txt b/TPC/CalibMacros/calibVarDescription.txt new file mode 100644 index 00000000000..b1f4675cf22 --- /dev/null +++ b/TPC/CalibMacros/calibVarDescription.txt @@ -0,0 +1,59 @@ +#CalibViewerTime Configuration file +#key val0,val1,val2, ... +#the key and the values are separated by spaces or tabs, +#the values must not contain whitespace characters use '_' instead. +#description: +#Key: BranchName +#Value0: Branch On/Off (0,1) +#value1: Branch Title (shown in the gui selection list) +#value2: Calibration Type (one may switch between different types in the GUI) +#value3-n: Parameter description for TVectorT based branches + +VIROC. 1,IROC_anode_voltage_[V], HV, A00, A01, A02, A03, A04, A05, A06, A07, A08, A09, A10, A11, A12, A13, A14, A15, A16, A17, C00, C01, C02, C03, C04, C05, C06, C07, C08, C09, C10, C11, C12, C13, C14, C15, C16, C17 +VOROC. 1,OROC_anode_voltage_[V], HV, A00, A01, A02, A03, A04, A05, A06, A07, A08, A09, A10, A11, A12, A13, A14, A15, A16, A17, C00, C01, C02, C03, C04, C05, C06, C07, C08, C09, C10, C11, C12, C13, C14, C15, C16, C17 +medianVIROC 1, IROC_anode_voltage_Median_[V], HV +medianVOROC 1, OROC_anode_voltage_Median_[V], HV +coverIA 1, Cover_voltage_IROC_A-Side_[V], HV +coverIC 1, Cover_voltage_IROC_C-Side_[V], HV +coverOA 1, Cover_voltage_OROC_A-Side_[V], HV +coverOC 1, Cover_voltage_OROC_C-Side_[V], HV +skirtA 1, Skirt_voltage_A-Side_[V], HV +skirtC 1, Skirt_voltage_C-Side_[V], HV +ggOffA 1, GG_offset_voltage_A-Side_[V], HV +ggOffC 1, GG_offset_voltage_C-Side_[V], HV +ptrel0 1, Relative_P0/T, Environment +ptrel1 1, Relative_P1/T, Environment +goofie. 1, Goofie_Values, Environment, 0, 1, CO2_[%], Drift_Velocity_[cm/#mus], FCage_HV_[V], Gain_Far, Gain_Near, N2_[%], Number_of_Sparks, Peak_area_Far, Peak_area_Near, Peak_pos_Far, Peak_pos_Near, Pickup_HV, Pressure_[mbar], T1/P, T2/P, T/P, Temperature_S1_[K] +goofieE. 1, Goofie_E_Values, Environment, 0, 1, CO2_[%], Drift_Velocity_[cm/#mus], FCage_HV_[V], Gain_Far, Gain_Near, N2_[%], Number_of_Sparks, Peak_area_Far, Peak_area_Near, Peak_pos_Far, Peak_pos_Near, Pickup_HV, Pressure_[mbar], T1/P, T2/P, T/P, Temperature_S1_[K] +goofieMean. 1, Goofie_Mean_Values, Environment, 0, 1, CO2_[%], Drift_Velocity_[cm/#mus], FCage_HV_[V], Gain_Far, Gain_Near, N2_[%], Number_of_Sparks, Peak_area_Far, Peak_area_Near, Peak_pos_Far, Peak_pos_Near, Pickup_HV, Pressure_[mbar], T1/P, T2/P, T/P, Temperature_S1_[K] +goofieMedian. 1, Goofie_Median_Values, Environment, 0, 1, CO2_[%], Drift_Velocity_[cm/#mus], FCage_HV_[V], Gain_Far, Gain_Near, N2_[%], Number_of_Sparks, Peak_area_Far, Peak_area_Near, Peak_pos_Far, Peak_pos_Near, Pickup_HV, Pressure_[mbar], T1/P, T2/P, T/P, Temperature_S1_[K] +goofieRMS. 0, Goofie_RMS_Values, Environment, 0, 1, CO2_[%], Drift_Velocity_[cm/#mus], FCage_HV_[V], Gain_Far, Gain_Near, N2_[%], Number_of_Sparks, Peak_area_Far, Peak_area_Near, Peak_pos_Far, Peak_pos_Near, Pickup_HV, Pressure_[mbar], T1/P, T2/P, T/P, Temperature_S1_[K] +press 1, Pressure1, Environment +press2 1, Pressure2, Environment +temp00. 1, TempFit_ROC_A-Side, Environment, Mean_Temp_[#circC], dT/dgx_[K/cm], dT/dgy_[K/cm] +temp10. 1, TempFit_OFC_A-Side, Environment, Mean_Temp_[#circC], dT/dz_[K/cm], dT/d#phi_[K/rad] +temp20. 1, TempFit_IFC+TS_A-Side, Environment, Mean_Temp_[#circC], dT/dz_[K/cm], dT/d#phi_[K/rad] +temp30. 1, TempFit_Skirt_A-Side, Environment, Mean_Temp_[#circC], dT/dgx_[K/cm], dT/dgy_[K/cm] +temp40. 1, TempFit_IFC_A-Side, Environment, Mean_Temp_[#circC], dT/dz_[K/cm], dT/d#phi_[K/rad] +temp01. 1, TempFit_ROC_C-Side, Environment, Mean_Temp_[#circC], dT/dgx_[K/cm], dT/dgy_[K/cm] +temp11. 1, TempFit_OFC_C-Side, Environment, Mean_Temp_[#circC], dT/dz_[K/cm], dT/d#phi_[K/rad] +temp21. 1, TempFit_IFC+TS_C-Side, Environment, Mean_Temp_[#circC], dT/dz_[K/cm], dT/d#phi_[K/rad] +temp31. 1, TempFit_Skirt_C-Side, Environment, Mean_Temp_[#circC], dT/dgx_[K/cm], dT/dgy_[K/cm] +temp41. 1, TempFit_IFC_C-Side, Environment, Mean_Temp_[#circC], dT/dz_[K/cm], dT/d#phi_[K/rad] +tempSkirtA. 1, Temp_Skirt_A, Environment, A00, A01, A02, A03, A04, A05, A06, A07, A08, A09, A10, A11, A12, A13, A14, A15, A16, A17 +tempSkirtC. 1, Temp_Skirt_C, Environment, C00, C01, C02, C03, C04, C05, C06, C07, C08, C09, C10, C11, C12, C13, C14, C15, C16, C17 +meanNoise. 1, Mean_Noise, Noise_Pedestals, All_Pads, IROCs, OROCs_small_pads, OROCs_large_pads +meanNoiseSen. 1, Mean_Noise_in_sensitive_regions, Noise_Pedestals, All_Pads, IROCs, OROCs_small_pads, OROCs_large_pads +rmsNoise. 1, RMS_Noise, Noise_Pedestals, All_Pads, IROCs, OROCs_small_pads, OROCs_large_pads +rmsNoiseSen. 1, RMS_Noise_in_sensitive_regions, Noise_Pedestals, All_Pads, IROCs, OROCs_small_pads, OROCs_large_pads +zeroNoise 1, Pads_with_zero_noise, Noise_Pedestals +nMasked 1, Number_of_masked_pads, ALTRO +nOffPulser 1, Pads_without_pulser_signal +CEfitA. 1, CE_Fit_A-Side, CE, Offset, dt/dgx_[timebins/cm], dt/dgy_[timebins/cm], dt/dlx_[timebins/cm], dt/dlx^{2}_[timebins/cm^{2}] +CEfitC. 1, CE_Fit_C-Side, CE, Offset, dt/dgx_[timebins/cm], dt/dgy_[timebins/cm], dt/dlx_[timebins/cm], dt/dlx^{2}_[timebins/cm^{2}] +Bz 1, Magnetic_Field_[T] +L3polarity 1, L3_polarity, Environment +nalien 1, Number_of_ESDs_in_alien, reco +nRawAlien 1, Number_of_Raw_in_alien, reco +nlocal 1, Number_of_ESDs_local, reco +nRawLocal 1, Number_of_Raw_local, reco diff --git a/TPC/TPCCEda.cxx b/TPC/TPCCEda.cxx index cfa3edab477..fe795b130f2 100644 --- a/TPC/TPCCEda.cxx +++ b/TPC/TPCCEda.cxx @@ -206,18 +206,7 @@ int main(int argc, char **argv) { // get the run number runNb = event->eventRunNb; // CE calibration -// AliRawReader *rawReader = new AliRawReaderDate((void*)event); -// if ( fastDecoding ) calibCE.ProcessEventFast(rawReader); -// else calibCE.ProcessEvent(rawReader); -// delete rawReader; - - if ( fastDecoding ) { - AliRawReader *rawReader = new AliRawReaderDate((void*)event); - calibCE.ProcessEventFast(rawReader); - delete rawReader; - } else { calibCE.ProcessEvent(event); - } /* free resources */ free(event); diff --git a/TPC/TPCPEDESTALda.cxx b/TPC/TPCPEDESTALda.cxx index 792eb88c42f..4b4ad467d0a 100644 --- a/TPC/TPCPEDESTALda.cxx +++ b/TPC/TPCPEDESTALda.cxx @@ -223,10 +223,6 @@ int main(int argc, char **argv) { // get the run number runNb = event->eventRunNb; // Pedestal calibration -// AliRawReader *rawReader = new AliRawReaderDate((void*)event); -// if ( fastDecoding ) calibPedestal.ProcessEventFast(rawReader); -// else calibPedestal.ProcessEvent(rawReader); -// delete rawReader; calibPedestal.ProcessEvent(event); /* free resources */ diff --git a/TPC/TPCPULSERda.cxx b/TPC/TPCPULSERda.cxx index ef4059c9d87..25d9554b9f6 100644 --- a/TPC/TPCPULSERda.cxx +++ b/TPC/TPCPULSERda.cxx @@ -198,10 +198,6 @@ int main(int argc, char **argv) { // get the run number runNb = event->eventRunNb; // Pulser calibration -// AliRawReader *rawReader = new AliRawReaderDate((void*)event); -// if ( fastDecoding ) calibPulser.ProcessEventFast(rawReader); -// else calibPulser.ProcessEvent(rawReader); -// delete rawReader; calibPulser.ProcessEvent(event); /* free resources */ diff --git a/TPC/TPCQAda.cxx b/TPC/TPCQAda.cxx index a68862db8f4..c4d7a248142 100644 --- a/TPC/TPCQAda.cxx +++ b/TPC/TPCQAda.cxx @@ -6,7 +6,7 @@ Link: Run Type: PHYSICS STANDALONE DAQ DA Type: MON Number of events needed: 500 -Input Files: +Input Files: /castor/cern.ch/alice/raw/global/2009/08/22/11/09000080958023.30.root Output Files: tpcQA.root, to be exported to the DAQ FXS fileId: QA Trigger types used: PHYSICS_EVENT diff --git a/TPC/TPCRAWda.cxx b/TPC/TPCRAWda.cxx index 9f730a557f5..756a56eb9c2 100644 --- a/TPC/TPCRAWda.cxx +++ b/TPC/TPCRAWda.cxx @@ -3,13 +3,13 @@ TPC DA for online calibration Contact: Jens.Wiechula@cern.ch Link: -Run Type: -DA Type: -Number of events needed: -Input Files: +Run Type: PHYSICS STANDALONE +DA Type: MON +Number of events needed: 200 +Input Files: /castor/cern.ch/alice/raw/global/2009/08/22/11/09000080958023.30.root Output Files: tpcCalibRaw.root, to be exported to the DAQ FXS -fileId: pulser -Trigger types used: +fileId: tpcCalibRaw +Trigger types used: PHYSICS_EVENT */ @@ -75,7 +75,7 @@ and save results in a file (named from RESULT_FILE define - see below). */ int main(int argc, char **argv) { /* log start of process */ - printf("TPC Pulser DA started - %s\n",__FILE__); + printf("TPC RAW DA started - %s\n",__FILE__); if (argc<2) { printf("Wrong number of arguments\n"); @@ -187,10 +187,8 @@ int main(int argc, char **argv) { nevents++; // get the run number runNb = event->eventRunNb; - // Pulser calibration -// AliRawReader *rawReader = new AliRawReaderDate((void*)event); + // Raw calibration calibRaw.ProcessEvent(event); - delete rawReader; /* free resources */ free(event); -- 2.39.3