From 5312f439a33ed12682f6b126b3a9f1c9a9b27eb0 Mon Sep 17 00:00:00 2001 From: marian Date: Thu, 20 Aug 2009 15:55:52 +0000 Subject: [PATCH] --This li AliTPCCalibCE.cxx.diff fix problem with Graph creation AliTPCcalibDB.cxx.diff add support for more calibration entries, gui tree creation AliTPCcalibDB.h.diff add support for more calibration entries, gui tree creation AliTPCCalibRawBase.cxx.diff fix handling of run number and time stamp extraction for date raw data processing AliTPCCalibRawBase.h.diff fix handling of run number and time stamp extraction for date raw data processing AliTPCCalibRaw.cxx.diff fix altro L1 phase information logging AliTPCCalibRaw.h.diff fix altro L1 phase information logging AliTPCCalibViewerGUI.cxx.diff add alias #draw# which is replaced by the selected variable, add Reset of the GUI AliTPCCalibViewerGUI.h.diff add alias #draw# which is replaced by the selected variable, add Reset of the GUI AliTPCCalPad.cxx.diff modify GlobalSidesFit: allow arbitrary combinations of gx,gy,lx,ly for local and global directions AliTPCCalPad.h.diff modify GlobalSidesFit: allow arbitrary combinations of gx,gy,lx,ly for local and global directions AliTPCMonitorAltro.cxx.diff change to new raw reader, don't use internal ALTRO decoder anymore AliTPCMonitorAltro.h.diff change to new raw reader, don't use internal ALTRO decoder anymore AliTPCMonitor.cxx.diff change to new raw reader, don't use internal ALTRO decoder anymore AliTPCMonitor.h.diff change to new raw reader, don't use internal ALTRO decoder anymore CalibEnv.C.diff Add more variables to be dumped to the tree libTPCbase.pkg.diff Add AliTPCConfigParser, Add AliTPCCalibViewerGUItime TPCbaseLinkDef.h.diff Add AliTPCConfigParser, Add AliTPCCalibViewerGUItime TPCCEda.cxx.diff Change to the date event process function, to ensure proper run number and time stamp TPCPEDESTALda.cxx.diff Change to the date event process function, to ensure proper run number and time stamp TPCPULSERda.cxx.diff Change to the date event process function, to ensure proper run number and time stamp TPCRAWda.cxx.diff Change to the date event process function, to ensure proper run number and time stamp AliTPCConfigParser.cxx Parser for simple ascii configuration files of structure "key value1,value2,value3,value4,..." AliTPCConfigParser.h Parser for simple ascii configuration files of structure "key value1,value2,value3,value4,..." AliTPCCalibViewerGUItime.cxx GUI to display calibration data over time. Uses the tree created by the CalibEnv.C macro AliTPCCalibViewerGUItime.h GUI to display calibration data over time. Uses the tree created by the CalibEnv.C macro ~ ne, and those below, will be ignored-- M AliTPCCalibCE.cxx M AliTPCcalibDB.cxx M AliTPCcalibDB.h M AliTPCCalibRawBase.cxx M AliTPCCalibRawBase.h M AliTPCCalibRaw.cxx M AliTPCCalibRaw.h M AliTPCCalibViewerGUI.cxx M AliTPCCalibViewerGUI.h M AliTPCCalPad.cxx M AliTPCCalPad.h M AliTPCMonitorAltro.cxx M AliTPCMonitorAltro.h M AliTPCMonitor.cxx M AliTPCMonitor.h M CalibMacros/CalibEnv.C M libTPCbase.pkg M TPCbaseLinkDef.h M TPCCEda.cxx M TPCPEDESTALda.cxx M TPCPULSERda.cxx M TPCRAWda.cxx A AliTPCConfigParser.cxx A AliTPCConfigParser.h A AliTPCCalibViewerGUItime.cxx A AliTPCCalibViewerGUItime.h --- TPC/AliTPCCalPad.cxx | 99 +- TPC/AliTPCCalPad.h | 4 +- TPC/AliTPCCalibCE.cxx | 1 - TPC/AliTPCCalibRaw.cxx | 52 +- TPC/AliTPCCalibRaw.h | 1 + TPC/AliTPCCalibRawBase.cxx | 22 +- TPC/AliTPCCalibRawBase.h | 1 + TPC/AliTPCCalibViewerGUI.cxx | 79 +- TPC/AliTPCCalibViewerGUI.h | 3 + TPC/AliTPCCalibViewerGUItime.cxx | 794 +++++++++ TPC/AliTPCCalibViewerGUItime.h | 151 ++ TPC/AliTPCConfigParser.cxx | 213 +++ TPC/AliTPCConfigParser.h | 42 + TPC/AliTPCMonitor.cxx | 2715 +++++++++++++----------------- TPC/AliTPCMonitor.h | 332 ++-- TPC/AliTPCMonitorAltro.cxx | 145 +- TPC/AliTPCMonitorAltro.h | 12 +- TPC/AliTPCcalibDB.cxx | 105 +- TPC/AliTPCcalibDB.h | 46 +- TPC/CalibMacros/CalibEnv.C | 442 ++++- TPC/TPCCEda.cxx | 18 +- TPC/TPCPEDESTALda.cxx | 9 +- TPC/TPCPULSERda.cxx | 9 +- TPC/TPCRAWda.cxx | 4 +- TPC/TPCbaseLinkDef.h | 2 + TPC/libTPCbase.pkg | 4 +- 26 files changed, 3414 insertions(+), 1891 deletions(-) create mode 100644 TPC/AliTPCCalibViewerGUItime.cxx create mode 100644 TPC/AliTPCCalibViewerGUItime.h create mode 100644 TPC/AliTPCConfigParser.cxx create mode 100644 TPC/AliTPCConfigParser.h diff --git a/TPC/AliTPCCalPad.cxx b/TPC/AliTPCCalPad.cxx index ddba3f1da5c..444248918ec 100644 --- a/TPC/AliTPCCalPad.cxx +++ b/TPC/AliTPCCalPad.cxx @@ -32,6 +32,9 @@ #include "TTreeStream.h" #include "TFile.h" #include "TKey.h" +#include +#include +#include #include ClassImp(AliTPCCalPad) @@ -507,7 +510,101 @@ AliTPCCalPad* AliTPCCalPad::GlobalFit(const char* padName, AliTPCCalPad* PadOutl return pad; } +void AliTPCCalPad::GlobalSidesFit(const AliTPCCalPad* PadOutliers, const char* fitFormula, TVectorD &fitParamSideA, TVectorD &fitParamSideC,TMatrixD &covMatrixSideA, TMatrixD &covMatrixSideC, Float_t & chi2SideA, Float_t & chi2SideC, Double_t pointError, Bool_t robust, Double_t robustFraction){ + // + // Performs a fit on both sides. + // Valid information for the fitFormula are the variables gx, gy, lx ,ly, meaning global x, global y, local x, local y value of the padName + // eg. a formula might look 'gy' or 'gx ++ gy' or 'gx ++ gy ++ lx ++ lx^2' and so on + // + // PadOutliers - pads with value !=0 are not used in fitting procedure + // chi2Threshold: Threshold for chi2 when EvalRobust is called + // robustFraction: Fraction of data that will be used in EvalRobust + // + + // split fit string in single parameters + // find dimension of the fit: + TString fitString(fitFormula); + fitString.ReplaceAll("++","#"); + fitString.ReplaceAll(" ",""); + TObjArray *arrFitParams = fitString.Tokenize("#"); + Int_t ndim = arrFitParams->GetEntries(); + //resize output data arrays + fitParamSideA.ResizeTo(ndim+1); + fitParamSideC.ResizeTo(ndim+1); + covMatrixSideA.ResizeTo(ndim+1,ndim+1); + covMatrixSideC.ResizeTo(ndim+1,ndim+1); + // create linear fitter for A- and C- Side + TLinearFitter* fitterGA = new TLinearFitter(ndim+1,Form("hyp%d",ndim)); + TLinearFitter* fitterGC = new TLinearFitter(ndim+1,Form("hyp%d",ndim)); + fitterGA->StoreData(kTRUE); + fitterGC->StoreData(kTRUE); + //create array of TFormulas to evaluate the parameters + TObjArray *arrFitFormulas = new TObjArray(ndim); + arrFitFormulas->SetOwner(kTRUE); + for (Int_t idim=0;idimAt(idim))->GetString(); + s.ReplaceAll("gx","[0]"); + s.ReplaceAll("gy","[1]"); + s.ReplaceAll("lx","[2]"); + s.ReplaceAll("ly","[3]"); + arrFitFormulas->AddAt(new TFormula(Form("param%02d",idim),s.Data()),idim); + } + //loop over data and add points to the fitter + AliTPCROC* tpcROCinstance = AliTPCROC::Instance(); // to calculate the pad's position + Float_t localXYZ[3]; + Float_t globalXYZ[3]; + TVectorD parValues(ndim); + + for (UInt_t isec = 0; isecGetCalROC(isec); + AliTPCCalROC *rocData=GetCalROC(isec); + if (!rocData) continue; + for (UInt_t irow = 0; irow < GetCalROC(isec)->GetNrows(); irow++) { + for (UInt_t ipad = 0; ipad < GetCalROC(isec)->GetNPads(irow); ipad++) { + //check for outliers + if (rocOut && rocOut->GetValue(irow,ipad)) continue; + //calculate local and global pad positions + tpcROCinstance->GetPositionLocal(isec, irow, ipad, localXYZ); + tpcROCinstance->GetPositionGlobal(isec, irow, ipad, globalXYZ); + //calculate parameter values + for (Int_t idim=0;idimAt(idim); + f->SetParameters(globalXYZ[0],globalXYZ[1],localXYZ[0],localXYZ[1]); + parValues[idim]=f->Eval(0); + } + //get value + Float_t value=rocData->GetValue(irow,ipad); + //add points to the fitters + if (isec/18%2==0){ + fitterGA->AddPoint(parValues.GetMatrixArray(),value,pointError); + }else{ + fitterGC->AddPoint(parValues.GetMatrixArray(),value,pointError); + } + } + } + } + if (robust){ + fitterGA->EvalRobust(robustFraction); + fitterGC->EvalRobust(robustFraction); + } else { + fitterGA->Eval(); + fitterGC->Eval(); + } + chi2SideA=fitterGA->GetChisquare()/(fitterGA->GetNpoints()-(ndim+1)); + chi2SideC=fitterGC->GetChisquare()/(fitterGC->GetNpoints()-(ndim+1)); + fitterGA->GetParameters(fitParamSideA); + fitterGC->GetParameters(fitParamSideC); + fitterGA->GetCovarianceMatrix(covMatrixSideA); + fitterGC->GetCovarianceMatrix(covMatrixSideC); + + delete arrFitParams; + delete arrFitFormulas; + delete fitterGA; + delete fitterGC; + +} +/* void AliTPCCalPad::GlobalSidesFit(const AliTPCCalPad* PadOutliers, TVectorD &fitParamSideA, TVectorD &fitParamSideC,TMatrixD &covMatrixSideA, TMatrixD &covMatrixSideC, Float_t & chi2SideA, Float_t & chi2SideC, Int_t fitType, Bool_t robust, Double_t chi2Threshold, Double_t robustFraction){ // // Makes a GlobalFit over each side and return fit-parameters, covariance and chi2 for each side @@ -646,5 +743,5 @@ void AliTPCCalPad::GlobalSidesFit(const AliTPCCalPad* PadOutliers, TVectorD &fit delete fitterGA; delete fitterGC; } - +*/ diff --git a/TPC/AliTPCCalPad.h b/TPC/AliTPCCalPad.h index 3fb2deeb10d..4d332544044 100644 --- a/TPC/AliTPCCalPad.h +++ b/TPC/AliTPCCalPad.h @@ -15,6 +15,7 @@ //#include //#include #include "TLinearFitter.h" +#include "TVectorD.h" //#include @@ -57,7 +58,8 @@ class AliTPCCalPad : public TNamed { AliTPCCalPad* LocalFit(const char* padName, Int_t rowRadius, Int_t padRadius, AliTPCCalPad* Padoutliers = 0, Bool_t robust = kFALSE, Double_t chi2Threshold = 5, Double_t robustFraction = 0.7, Bool_t printCurrentSector = kFALSE) const; AliTPCCalPad* GlobalFit(const char* padName, AliTPCCalPad* Padoutliers = 0, Bool_t robust = kFALSE, Int_t fitType = 1, Double_t chi2Threshold = 5, Double_t robustFraction = 0.7, Double_t err=1, TObjArray *fitParArr=0x0, TObjArray *fitCovArr=0x0); - void GlobalSidesFit(const AliTPCCalPad* PadOutliers, TVectorD &fitParamSideA, TVectorD &fitParamSideC, TMatrixD &covMatrixSideA, TMatrixD &covMatrixSideC, Float_t &chi2SideA, Float_t &chi2SideC, Int_t fitType = 1, Bool_t robust = kFALSE, Double_t chi2Threshold = 5, Double_t robustFraction = 0.7); + + void GlobalSidesFit(const AliTPCCalPad* PadOutliers, const char* fitFormula, TVectorD &fitParamSideA, TVectorD &fitParamSideC, TMatrixD &covMatrixSideA, TMatrixD &covMatrixSideC, Float_t &chi2SideA, Float_t &chi2SideC, Double_t pointError=1, Bool_t robust = kFALSE, Double_t robustFraction = 0.7); protected: AliTPCCalROC *fROC[kNsec]; // Array of ROC objects which contain the values per pad diff --git a/TPC/AliTPCCalibCE.cxx b/TPC/AliTPCCalibCE.cxx index 869cd7793e8..ad4fad0cdf8 100644 --- a/TPC/AliTPCCalibCE.cxx +++ b/TPC/AliTPCCalibCE.cxx @@ -1627,7 +1627,6 @@ TGraph *AliTPCCalibCE::MakeGraphTimeCE(Int_t sector, Int_t xVariable, Int_t fitT Int_t npoints=0; // sanity checks - if ( !GetHistoT0(sector) ) return 0x0; //Sector has not been filled if ( (sector<-2) || (sector>71) ) return 0x0; if ( (xVariable<0) || (xVariable>2) ) return 0x0; if ( (fitType<0) || (fitType>3) ) return 0x0; diff --git a/TPC/AliTPCCalibRaw.cxx b/TPC/AliTPCCalibRaw.cxx index 22d61549410..ec8356f90a9 100644 --- a/TPC/AliTPCCalibRaw.cxx +++ b/TPC/AliTPCCalibRaw.cxx @@ -137,19 +137,6 @@ Int_t AliTPCCalibRaw::Update(const Int_t isector, const Int_t iRow, const Int_t if (iPad<0) return 0; if (iTimeBin<0) return 0; if (!fFirstTimeStamp) fFirstTimeStamp=GetTimeStamp(); - if (fCurrDDLNum!=fPrevDDLNum){ - TVectorF *arr=MakeArrL1PhaseRCU(fCurrDDLNum,kTRUE); - if (arr->GetNrows()<=fNevents) arr->ResizeTo(arr->GetNrows()+1000); - // phase as a position of a quarter time bin - Int_t phase=(Int_t)(GetL1PhaseTB()*4.); -// printf("DDL: %03d, phase: %d (%f))\n",fCurrDDLNum,phase,GetL1PhaseTB()); - //Fill pahse information of current rcu and event - (arr->GetMatrixArray())[fNevents]=phase; - //increase phase counter - ++((fArrCurrentPhaseDist.GetMatrixArray())[phase]); -// printf("RCUId: %03d (%03d), DDL: %03d, sector: %02d\n",fCurrRCUId, fPrevRCUId, fCurrDDLNum, isector); - } - if ( (iTimeBin>fLastTimeBin) || (iTimeBinGetNrows()<=fNevents) arr->ResizeTo(arr->GetNrows()+1000); + // phase as a position of a quarter time bin + Int_t phase=(Int_t)(GetL1PhaseTB()*4.); + printf("DDL: %03d, phase: %d (%f))\n",fCurrDDLNum,phase,GetL1PhaseTB()); + //Fill pahse information of current rcu and event + (arr->GetMatrixArray())[fNevents]=phase; + //increase phase counter + ++((fArrCurrentPhaseDist.GetMatrixArray())[phase]); +// printf("RCUId: %03d (%03d), DDL: %03d, sector: %02d\n",fCurrRCUId, fPrevRCUId, fCurrDDLNum, isector); +// } + } //_____________________________________________________________________ void AliTPCCalibRaw::ResetEvent() @@ -243,13 +249,23 @@ TH2C *AliTPCCalibRaw::MakeHistL1RCUEvents(Int_t type) // //type: 0=Failures, 1=Phases TH2C *h2 = new TH2C("hL1FailRCUEvents","L1 Failures;RCU;Event",216,0,216,GetNevents(),0,GetNevents()); + Int_t add=0; for (Int_t ircu=0;ircu<216;++ircu) { const TVectorF *v=0; - if (type==0) v=GetALTROL1PhaseFailEventsRCU(ircu); - else if (type==1) v=GetALTROL1PhaseEventsRCU(ircu); + if (type==0){ + v=GetALTROL1PhaseFailEventsRCU(ircu); + add=1; + h2->SetMinimum(0); + h2->SetMaximum(2); + } else if (type==1) { + v=GetALTROL1PhaseEventsRCU(ircu); + add=0; + h2->SetMinimum(0); + h2->SetMaximum(4); + } if (!v) continue; for (Int_t iev=0;ievSetBinContent(ircu+1,iev+1,(*v)(iev)+1); + h2->SetBinContent(ircu+1,iev+1,(*v)(iev)+add); } } return h2; @@ -268,7 +284,7 @@ TH2C *AliTPCCalibRaw::MakeHistL1RCUEventsIROC(Int_t type) else if (type==1) v=GetALTROL1PhaseEventsRCU(ircu); if (!v) continue; for (Int_t iev=0;ievSetBinContent(ircu+1,iev+1,(*v)(iev)+1); + h2->SetBinContent(ircu+1,iev+1,(*v)(iev)); } } return h2; @@ -287,7 +303,7 @@ TH2C *AliTPCCalibRaw::MakeHistL1RCUEventsOROC(Int_t type) else if (type==1) v=GetALTROL1PhaseEventsRCU(ircu); if (!v) continue; for (Int_t iev=0;ievSetBinContent(ircu-72+1,iev+1,(*v)(iev)+1); + h2->SetBinContent(ircu-72+1,iev+1,(*v)(iev)); } } return h2; diff --git a/TPC/AliTPCCalibRaw.h b/TPC/AliTPCCalibRaw.h index 9b4cdeaa190..bad07b660b2 100644 --- a/TPC/AliTPCCalibRaw.h +++ b/TPC/AliTPCCalibRaw.h @@ -28,6 +28,7 @@ public: virtual Int_t Update(const Int_t isector, const Int_t iRow, const Int_t iPad, const Int_t iTimeBin, const Float_t signal); + virtual void UpdateDDL(); virtual void EndEvent(); virtual void ResetEvent(); virtual void Analyse(); diff --git a/TPC/AliTPCCalibRawBase.cxx b/TPC/AliTPCCalibRawBase.cxx index a28b1270be5..ae46f50c88a 100644 --- a/TPC/AliTPCCalibRawBase.cxx +++ b/TPC/AliTPCCalibRawBase.cxx @@ -179,14 +179,16 @@ Bool_t AliTPCCalibRawBase::ProcessEvent(AliTPCRawStreamV3 *rawStreamV3) // fAltroRawStream = static_cast(rawStreamV3); while ( rawStreamV3->NextDDL() ){ if (AliLog::GetGlobalDebugLevel()>2) rawStreamV3->PrintRCUTrailer(); + fPrevDDLNum=-1; + fCurrRCUId=rawStreamV3->GetRCUId(); + fCurrDDLNum=rawStreamV3->GetDDLNumber(); if (fUseL1Phase){ // fAltroL1Phase = fAltroRawStream->GetL1Phase(); fAltroL1Phase = rawStreamV3->GetL1Phase(); fAltroL1PhaseTB = (fAltroL1Phase*1e09/100.); - AliDebug(1, Form("L1Phase: %.2e\n",fAltroL1PhaseTB)); + AliDebug(1, Form("L1Phase: %.2e (%03d)\n",fAltroL1PhaseTB,fCurrDDLNum)); } - fCurrRCUId=rawStreamV3->GetRCUId(); - fCurrDDLNum=rawStreamV3->GetDDLNumber(); + UpdateDDL(); while ( rawStreamV3->NextChannel() ){ Int_t isector = rawStreamV3->GetSector(); // current sector Int_t iRow = rawStreamV3->GetRow(); // current row @@ -289,10 +291,16 @@ Bool_t AliTPCCalibRawBase::ProcessEvent(eventHeaderStruct *event) // // Event processing loop - date event // - AliRawReader *rawReader = new AliRawReaderDate((void*)event); - Bool_t result=ProcessEvent(rawReader); - delete rawReader; - return result; + + fRunNumber=event->eventRunNb; + fTimeStamp=event->eventTimestamp; + fEventType=event->eventType; + AliRawReader *rawReader = new AliRawReaderDate((void*)event); + AliTPCRawStreamV3 *rawStreamV3 = new AliTPCRawStreamV3(rawReader, (AliAltroMapping**)fMapping); + Bool_t result=ProcessEvent(rawStreamV3); + delete rawStreamV3; + delete rawReader; + return result; } //_____________________________________________________________________ diff --git a/TPC/AliTPCCalibRawBase.h b/TPC/AliTPCCalibRawBase.h index d3d2807546e..50419d9c851 100644 --- a/TPC/AliTPCCalibRawBase.h +++ b/TPC/AliTPCCalibRawBase.h @@ -48,6 +48,7 @@ public: virtual Int_t Update(const Int_t /*isector*/, const Int_t /*iRow*/, const Int_t /*iPad*/, const Int_t /*iTimeBin*/, const Float_t /*signal*/) { return 0; } + virtual void UpdateDDL() {return;} virtual void Analyse(){ return; } //Setters diff --git a/TPC/AliTPCCalibViewerGUI.cxx b/TPC/AliTPCCalibViewerGUI.cxx index 026bc98df4c..12e7836bf03 100644 --- a/TPC/AliTPCCalibViewerGUI.cxx +++ b/TPC/AliTPCCalibViewerGUI.cxx @@ -1264,22 +1264,33 @@ void AliTPCCalibViewerGUI::Initialize(AliTPCCalibViewer *viewer) { if (fInitialized && currentStr->GetString() == selectedVariable) variableId = id; id++; } - delete iter; - arr->Delete(); - delete arr; // fill fListNorm, list of normalization variables: - arr = fViewer->GetListOfNormalizationVariables(); - iter = arr->MakeIterator(); - iter->Reset(); + TObjArray *arrNorm = fViewer->GetListOfNormalizationVariables(); + TIterator *iterNorm = arrNorm->MakeIterator(); + iterNorm->Reset(); currentStr = 0; id = 0; fListNormalization->RemoveAll(); + while ((currentStr = (TObjString*)(iterNorm->Next()))) { + fListNormalization->AddEntry(currentStr->GetString().Data(), id); + if (fInitialized && currentStr->GetString() == selectedNormalization) normalizationId = id; + id++; + } + currentStr = 0; + iter->Reset(); + //Add draw variables to the list of normalisation while ((currentStr = (TObjString*)(iter->Next()))) { + if (currentStr->GetString().BeginsWith("Map")) continue; //don't add mapping information fListNormalization->AddEntry(currentStr->GetString().Data(), id); if (fInitialized && currentStr->GetString() == selectedNormalization) normalizationId = id; id++; } + + delete iterNorm; + arrNorm->Delete(); + delete arrNorm; + delete iter; arr->Delete(); delete arr; @@ -1301,6 +1312,15 @@ void AliTPCCalibViewerGUI::Initialize(AliTPCCalibViewer *viewer) { } +void AliTPCCalibViewerGUI::Reset(){ + // + // reset variables, delete calib viewer + // + if (fViewer) delete fViewer; + fListVariables->RemoveAll(); + fListNormalization->RemoveAll(); + fInitialized = kFALSE; +} void AliTPCCalibViewerGUI::HandleButtonsGeneral(Int_t id) { // @@ -1508,6 +1528,32 @@ void AliTPCCalibViewerGUI::HandleButtonsNoRedraw(Int_t id) { SetMinMaxLabel(); } +void AliTPCCalibViewerGUI::ReplacePlaceHolders(TString &str) +{ + // + // replace the defined placeholders in the custom draw string and cut string + // + TString drawPlaceHolder("#draw#"); + TString normPlaceHolder("#norm#"); + + //current draw variable + TString desiredData(""); + if (!fListVariables->GetSelectedEntry()) return; + desiredData += ((TGTextLBEntry*)(fListVariables->GetSelectedEntry()))->GetTitle(); +// desiredData += fViewer->GetAbbreviation(); + + //current normalisation + TString normalizationData(""); + if (!fListNormalization->GetSelectedEntry()) return; + normalizationData += ((TGTextLBEntry*)(fListNormalization->GetSelectedEntry()))->GetTitle(); + if (! (TString(((TGTextLBEntry*)(fListNormalization->GetSelectedEntry()))->GetTitle())).BeginsWith("Fit")) + if ( normalizationData.BeginsWith("_") ) normalizationData = desiredData+normalizationData; + if ( fListVariables->FindEntry(normalizationData.Data()) ) + normalizationData+="~"; + + str.ReplaceAll(drawPlaceHolder,desiredData); + str.ReplaceAll(normPlaceHolder,normalizationData); +} void AliTPCCalibViewerGUI::DoNewSelection() { // @@ -1585,12 +1631,15 @@ TString* AliTPCCalibViewerGUI::GetDrawString() { desiredData += op; if (! (TString(((TGTextLBEntry*)(fListNormalization->GetSelectedEntry()))->GetTitle())).BeginsWith("Fit")) - desiredData += ((TGTextLBEntry*)(fListVariables->GetSelectedEntry()))->GetTitle(); + if ( normalizationData.BeginsWith("_") ) desiredData += ((TGTextLBEntry*)(fListVariables->GetSelectedEntry()))->GetTitle(); + if ( fListVariables->FindEntry(normalizationData.Data()) ) + normalizationData+="~"; desiredData += normalizationData; } else if (fRadioCustom->GetState() == kButtonDown) { desiredData = fComboCustom->GetTextEntry()->GetText(); if (desiredData == "") return 0; + ReplacePlaceHolders(desiredData); } // try to add forgotten '~' @@ -1643,8 +1692,11 @@ TString* AliTPCCalibViewerGUI::GetSectorString() { cutsStr += "!=0"; if (fChkAddCuts->GetState() == kButtonDown) cutsStr += " && "; } - if (fChkAddCuts->GetState() == kButtonDown) - cutsStr += fComboAddCuts->GetTextEntry()->GetText(); + if (fChkAddCuts->GetState() == kButtonDown){ + cutsStr += fComboAddCuts->GetTextEntry()->GetText(); + ReplacePlaceHolders(cutsStr); + } + // try to add forgotten '~' if (fChkAutoAppend->GetState() == kButtonDown) @@ -1925,7 +1977,12 @@ void AliTPCCalibViewerGUI::ChangeSector(){ // // function that is called, when the number of the sector is changed // to change the sector label - // + // + if ( fRadioROC->GetState()!=kButtonDown && fRadioSector->GetState()!=kButtonDown ){ + fLblSector->SetText("not used"); + return; + } + Int_t sector = (Int_t)(fNmbSector->GetNumber()); TString secLabel = ""; if ( sector < 36 ) @@ -2027,7 +2084,7 @@ void AliTPCCalibViewerGUI::MouseMove(Int_t event, Int_t x, Int_t y, TObject *sel if (quadrant == 3) phi = pi + phi; if (quadrant == 4) phi = 2 * pi - phi; Double_t phiGrad = phi / pi * 180; - Int_t sector = (Int_t) phiGrad / 20; // one sector coresponds to 20° + Int_t sector = (Int_t) phiGrad / 20; // one sector coresponds to 20� // IROC starts at 84.5 cm // IROC ends at 135.5 cm, OROC begins // OROC ends at 250 cm diff --git a/TPC/AliTPCCalibViewerGUI.h b/TPC/AliTPCCalibViewerGUI.h index 7353683e9d7..ac07659c0ba 100644 --- a/TPC/AliTPCCalibViewerGUI.h +++ b/TPC/AliTPCCalibViewerGUI.h @@ -29,6 +29,7 @@ #include #include #include +#include class TROOTt; class AliTPCCalibViewer; class AliTPCPreprocessorOnline; @@ -64,6 +65,7 @@ public: void Initialize(const char* fileName, const char* treeName = "calPads"); // initializes the GUI with default settings and opens tree for drawing void Initialize(AliTPCCalibViewer *viewer); // initializes the GUI with default settings and opens tree for drawing void Reload(){Initialize(fViewer);} // reload the viewr after it has been changed, e.g. added a new referenceTree, ... + void Reset(); TString* GetDrawString(); // create the draw string out of selection TString* GetCutString(); // create the cut string out of selection TString* GetSectorString(); // create the sector string out of selection @@ -75,6 +77,7 @@ public: void HandleButtonsStat(Int_t id = -1); // handles statistic check boxes void HandleButtonsCuts(Int_t id = -1); // handles mutual radio button exclusions for right side void HandleButtonsNoRedraw(Int_t id = -1);// handles label & scaling checkboxes without redrawing + void ReplacePlaceHolders(TString &str); // replace place holders of the draw variable and normalisation variable void DoNewSelection(); // decides whether to redraw if user makes another selection void DoDraw(); // main method for drawing according to user selection void DoFit(); // main method for fitting diff --git a/TPC/AliTPCCalibViewerGUItime.cxx b/TPC/AliTPCCalibViewerGUItime.cxx new file mode 100644 index 00000000000..8902d22a1d3 --- /dev/null +++ b/TPC/AliTPCCalibViewerGUItime.cxx @@ -0,0 +1,794 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + + +/////////////////////////////////////////////////////////////////////////////// +// // +// // +/////////////////////////////////////////////////////////////////////////////// + +#include +//Root includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// +#include +#include +// +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//AliRoot includes +#include "AliTPCCalibViewerGUI.h" +#include "AliTPCcalibDB.h" + +#include "AliTPCCalibViewerGUItime.h" + +ClassImp(AliTPCCalibViewerGUItime) + +AliTPCCalibViewerGUItime::AliTPCCalibViewerGUItime(const TGWindow *p, UInt_t w, UInt_t h) : +TGCompositeFrame(p,w,h), + fFile(0x0), + fTree(0x0), + fCalibViewerGUI(0x0), + fCalibViewerGUItab(0x0), + fCurrentHist(0x0), + fCurrentGraph(0x0), + fCurrentRunDetails(-1), + fOutputCacheDir("/tmp"), + fDrawString(""), + fIsCustomDraw(kFALSE), + fRunNumbers(10), + fTimeStamps(10), + fValuesX(10), + fValuesY(10), + //GUI elements + //main canvas Top part, bottom part + fContTopBottom(0x0), + //top left, centre, right + fContLCR(0x0), + //content left + fContLeft(0x0), + fContDrawSel(0x0), + fContDrawSelSubRunTime(0x0), + fRadioXhist(0x0), + fRadioXrun(0x0), + fRadioXtime(0x0), + fListVariables(0x0), + fComboRunType(0x0), + fLblRunType(0x0), + fNmbPar(0x0), + fLblPar(0x0), + //content centre + fContCenter(0x0), + fCanvMain(0x0), + //content right + fContRight(0x0), + fContValues(0x0), + fLblRunNumber(0x0), + fLblRunTime(0x0), + fLblValueX(0x0), + fLblValueY(0x0), + fLblRunNumberVal(0x0), + fLblRunTimeVal(0x0), + fLblValueXVal(0x0), + fLblValueYVal(0x0), + fBtnDumpRuns(0x0), + //content bottom + fContCustom(0x0), + fContCustomCuts(0x0), + fLblCustomDraw(0x0), + fLblCustomCuts(0x0), + fComboCustomDraw(0x0), + fComboCustomCuts(0x0) +{ + // + // ctor + // + DrawGUI(p,w,h); + SetInitialValues(); +} +//______________________________________________________________________________ +AliTPCCalibViewerGUItime::~AliTPCCalibViewerGUItime(){ + // + // dtor + // + +} +//______________________________________________________________________________ +void AliTPCCalibViewerGUItime::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) { + // + // draw the GUI + // + // ====================================================================== + // ************************* Display everything ************************* + // ====================================================================== + + SetCleanup(kDeepCleanup); + p = p; // to avoid compiler warnings + + // ***************************************************************************** + // ************************* content of this MainFrame ************************* + // ***************************************************************************** + // top level container with horizontal layout + fContTopBottom = new TGCompositeFrame(this, w, h, kVerticalFrame | kFixedWidth | kFixedHeight); + AddFrame(fContTopBottom, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0)); + + fContLCR = new TGCompositeFrame(fContTopBottom, w, h, kHorizontalFrame | kFixedWidth | kFixedHeight); + fContTopBottom->AddFrame(fContLCR, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0)); + + // *********************************************************************** + // ************************* content of fContLCR ************************* + // *********************************************************************** + // left container + fContLeft = new TGCompositeFrame(fContLCR, 200, 200, kVerticalFrame | kFixedWidth | kFitHeight); + fContLCR->AddFrame(fContLeft, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandY, 5, 3, 3, 3)); + + // left vertical splitter + TGVSplitter *splitLeft = new TGVSplitter(fContLCR); + splitLeft->SetFrame(fContLeft, kTRUE); + fContLCR->AddFrame(splitLeft, new TGLayoutHints(kLHintsLeft | kLHintsExpandY, 0, 0, 0, 0)); + + // right container + fContRight = new TGCompositeFrame(fContLCR, 150, 200, kVerticalFrame | kFixedWidth | kFitHeight); + fContLCR->AddFrame(fContRight, new TGLayoutHints(kLHintsTop | kLHintsRight | kLHintsExpandY, 3, 5, 3, 3)); + + // center container + fContCenter = new TGCompositeFrame(fContLCR, 200, 200, kVerticalFrame | kFixedWidth | kFitHeight); + fContLCR->AddFrame(fContCenter, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0)); + + // right vertical splitter + TGVSplitter *splitRight = new TGVSplitter(fContLCR); + splitRight->SetFrame(fContRight, kFALSE); + fContLCR->AddFrame(splitRight, new TGLayoutHints(kLHintsLeft | kLHintsExpandY, 0, 0, 0, 0)); + + + // ======================================================================== + // ************************* content of fContLeft ************************* + // ======================================================================== + // --- draw button and tabLeft --- + + // draw selection group + fContDrawSel = new TGGroupFrame(fContLeft, "Draw selection", kVerticalFrame | kFitWidth | kFitHeight); + fContLeft->AddFrame(fContDrawSel, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 10, 0)); + //x-axis variables selection, Run of Time + fContDrawSelSubRunTime = new TGCompositeFrame(fContDrawSel, 200, 23, kHorizontalFrame | kFitWidth | kFixedHeight); + fContDrawSel->AddFrame(fContDrawSelSubRunTime, new TGLayoutHints(kLHintsCenterX | kLHintsExpandX , 0, 0, 0, 0)); + + // ------------------------- content of fContDrawOpt ------------------------- + // + // Run radio button + // Time radio button + fRadioXhist = new TGRadioButton(fContDrawSelSubRunTime, "hist", kRadioXhist); + fContDrawSelSubRunTime->AddFrame(fRadioXhist, new TGLayoutHints(kLHintsNormal, 0, 2, 0, 0)); + fRadioXhist->Connect("Clicked()", "AliTPCCalibViewerGUItime", this, "HandleButtonsDrawSel()"); + fRadioXhist->SetToolTipText("Draw the distribution of the variable"); + + fRadioXrun = new TGRadioButton(fContDrawSelSubRunTime, ":Run", kRadioXrun); + fContDrawSelSubRunTime->AddFrame(fRadioXrun, new TGLayoutHints(kLHintsNormal, 2, 2, 0, 0)); + fRadioXrun->Connect("Clicked()", "AliTPCCalibViewerGUItime", this, "HandleButtonsDrawSel()"); + fRadioXrun->SetToolTipText("Use run number as x-value"); + + // Time radio button + fRadioXtime = new TGRadioButton(fContDrawSelSubRunTime, ":Time", kRadioXtime); + fContDrawSelSubRunTime->AddFrame(fRadioXtime, new TGLayoutHints(kLHintsNormal, 2, 2, 0, 0)); + fRadioXtime->Connect("Clicked()", "AliTPCCalibViewerGUItime", this, "HandleButtonsDrawSel()"); + fRadioXtime->SetToolTipText("Use time stamp number as x-value"); + + + // list of variables + fListVariables = new TGListBox(fContDrawSel); + fContDrawSel->AddFrame(fListVariables, new TGLayoutHints(kLHintsNormal | kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0)); + fListVariables->Connect("Selected(Int_t)", "AliTPCCalibViewerGUItime", this, "DoNewSelection()"); + + //-------------------- rynType selection ------------------------ + // Parameter label + fLblRunType = new TGLabel(fContDrawSel, "Run Type:"); + fLblRunType->SetTextJustify(kTextLeft); + fContDrawSel->AddFrame(fLblRunType, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0)); + + fComboRunType = new TGComboBox(fContDrawSel); + fComboRunType->EnableTextInput(kFALSE); + fContDrawSel->AddFrame(fComboRunType, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0)); + fComboRunType->Connect("Selected(Int_t)", "AliTPCCalibViewerGUItime", this, "DoDraw()"); +// fComboRunType->SetEnabled(kFALSE); + fComboRunType->Resize(0, 22); + + //-------------------- parameter selection ------------------------ + // Parameter label + fLblPar = new TGLabel(fContDrawSel, "Parameter:"); + fLblPar->SetTextJustify(kTextLeft); + fContDrawSel->AddFrame(fLblPar, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0)); + + fNmbPar = new TGNumberEntry(fContDrawSel, 0, 1, -1, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative, TGNumberFormat::kNELLimitMinMax, 0, 71); + fContDrawSel->AddFrame(fNmbPar, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0)); + fNmbPar->Connect("ValueSet(Long_t)", "AliTPCCalibViewerGUItime", this, "DoParLimitChange()"); + fNmbPar->SetState(kFALSE); + + + // ========================================================================== + // ************************* content of fContCenter ************************* + // ======================================================================== + // main drawing canvas + fCanvMain = new TRootEmbeddedCanvas("GUItime_Canvas", fContCenter, 200, 200, kFitWidth | kFitHeight); + fContCenter->AddFrame(fCanvMain, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0)); + 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."); + + + // ========================================================================= + // ************************* content of fContRight ************************* + // ======================================================================== + //group frame for value information + fContValues = new TGGroupFrame(fContRight, "Data point info", kVerticalFrame | kFitWidth | kFitHeight); + fContRight->AddFrame(fContValues, new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 0)); + //set layout manager + fContValues->SetLayoutManager(new TGMatrixLayout(fContValues, 0, 2, 5)); + //value information labels + + //run number label + fLblRunNumber = new TGLabel(fContValues, "Run:"); + fLblRunNumber->SetTextJustify(kTextLeft); + fContValues->AddFrame(fLblRunNumber, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0)); + //run number + fLblRunNumberVal = new TGLabel(fContValues, "00000"); + fLblRunNumberVal->SetTextJustify(kTextLeft); + fContValues->AddFrame(fLblRunNumberVal, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 0, 0, 0, 0)); + //time stamp label + fLblRunTime = new TGLabel(fContValues, "Time:"); + fLblRunTime->SetTextJustify(kTextLeft); + fContValues->AddFrame(fLblRunTime, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0)); + //run number + fLblRunTimeVal = new TGLabel(fContValues, "00.00.0000\n00:00:00"); + fLblRunTimeVal->SetTextJustify(kTextLeft); + fContValues->AddFrame(fLblRunTimeVal, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 0, 0, 0, 0)); + //value label x + fLblValueX = new TGLabel(fContValues, "x-Value:"); + fLblValueX->SetTextJustify(kTextLeft); + fContValues->AddFrame(fLblValueX, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0)); + //value x + fLblValueXVal = new TGLabel(fContValues, "00000.000"); + fLblValueXVal->SetTextJustify(kTextRight); + fContValues->AddFrame(fLblValueXVal, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0)); + //value label y + fLblValueY = new TGLabel(fContValues, "y-Value:"); + fLblValueY->SetTextJustify(kTextLeft); + fContValues->AddFrame(fLblValueY, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0)); + //value y + fLblValueYVal = new TGLabel(fContValues, "00000.000"); + fLblValueYVal->SetTextJustify(kTextRight); + 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)); + fBtnDumpRuns->Connect("Clicked()", "AliTPCCalibViewerGUItime", this, "DoDumpRuns()"); + fBtnDumpRuns->SetToolTipText("Press to dump the run numbers of the current selection."); + + // ========================================================================= + // ****************** bottom content of fContTopBottom ********************* + // ========================================================================= + + // custom options container + // --- fComboCustom --- the custom draw line on the very low + fContCustom = new TGCompositeFrame(fContTopBottom, 200, 200, kHorizontalFrame | kFitWidth | kFitHeight); + fContTopBottom->AddFrame(fContCustom, new TGLayoutHints(kLHintsExpandX, 10, 0, 0, 0)); + + // ------------------------- content of fContCustom ------------------------- + fLblCustomDraw = new TGLabel(fContCustom, "Custom draw: "); + fLblCustomDraw->SetTextJustify(kTextLeft); + fContCustom->AddFrame(fLblCustomDraw, new TGLayoutHints(kLHintsNormal, 5, 0, 0, 0)); + // text field for custom draw command + fComboCustomDraw = new TGComboBox(fContCustom); +// fComboCustomDraw->Resize(0, fLblValueY->GetDefaultHeight()); + fComboCustomDraw->Resize(0, 22); + fComboCustomDraw->EnableTextInput(kTRUE); + fContCustom->AddFrame(fComboCustomDraw, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0)); + fComboCustomDraw->Connect("ReturnPressed()", "AliTPCCalibViewerGUItime", this, "DoCustomDraw()"); + fComboCustomDraw->Connect("Selected(Int_t)", "AliTPCCalibViewerGUItime", this, "DoCustomDraw()"); + + + // additional cuts container + fContCustomCuts = new TGCompositeFrame(fContTopBottom, 200, 200, kHorizontalFrame | kFitWidth | kFitHeight); + fContTopBottom->AddFrame(fContCustomCuts, new TGLayoutHints(kLHintsExpandX, 10, 0, 0, 0)); + + // ------------------------- content of fContCustomCuts ------------------------- + fLblCustomCuts = new TGLabel(fContCustomCuts, "Custom cuts: "); + fLblCustomCuts->SetTextJustify(kTextLeft); + fContCustomCuts->AddFrame(fLblCustomCuts, new TGLayoutHints(kLHintsNormal, 5, 0, 0, 0)); + // combo text field for additional cuts + fComboCustomCuts = new TGComboBox(fContCustomCuts); +// fComboCustomCuts->Resize(0, fLblValueY->GetDefaultHeight()); + 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()"); + + SetWindowName("AliTPCCalibViewer GUI - Time"); + MapSubwindows(); + Resize(GetDefaultSize()); + MapWindow(); +} +//______________________________________________________________________________ +void AliTPCCalibViewerGUItime::SetInitialValues(){ + // + // Set inital selections of the gui + // + fRadioXrun->SetState(kButtonDown); + fRadioXtime->SetState(kButtonUp); +} + +//______________________________________________________________________________ +void AliTPCCalibViewerGUItime::UseFile(const char* fileName) { + // + // retrieve tree from file + // + TDirectory *save=gDirectory; + if (fFile) delete fFile; + fFile = TFile::Open(fileName); + fTree=(TTree*)fFile->Get("dcs"); + save->cd(); + Reload(); +} +//______________________________________________________________________________ +void AliTPCCalibViewerGUItime::Reload(){ + // + // reload the gui contents, this is needed after the input tree has changed + // + + //reset variables list + fListVariables->RemoveAll(); + + if ( !fTree ) return; + TObjArray *branchList = fTree->GetListOfBranches(); + if ( !branchList ) return; + TIter nextBranch(branchList); + 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); + TObjString *runType=0x0; + Int_t nevets=fTree->GetEntries(); + TBranch *branch=fTree->GetBranch("runType."); + if (!branch) return; + branch->SetAddress(&runType); + fTree->SetBranchStatus("*",0); + fTree->SetBranchStatus("runType.*",1); + for (Int_t iev=0;ievGetEntry(iev); + TString type=runType->String(); + if (!type.IsNull()&&!fComboRunType->FindEntry(type)) fComboRunType->AddEntry(type,id++); + } + branch->ResetAddress(); + fTree->SetBranchStatus("*",1); +} +//______________________________________________________________________________ +const char* AliTPCCalibViewerGUItime::GetDrawString(){ + // + // create draw string for ttree by combining the user requestsa + // + + TString selectedVariable=""; + if (fListVariables->GetSelectedEntry()) selectedVariable = fListVariables->GetSelectedEntry()->GetTitle(); + //treat case of TVector + if (selectedVariable.EndsWith(".")){ + Int_t par = (Int_t)(fNmbPar->GetNumber()); + selectedVariable.Append(Form("fElements[%d]",par)); + } +// if (fRadioXrun->GetState()==kButtonDown) +// selectedVariable.Append(":run"); +// if (fRadioXtime->GetState()==kButtonDown) +// selectedVariable.Append(":time"); + + return selectedVariable.Data(); +} +//______________________________________________________________________________ +const char* AliTPCCalibViewerGUItime::GetCutString(){ + // + // create cut string + // + TCut cuts(fComboCustomCuts->GetTextEntry()->GetText()); + TString runType=""; + if (fComboRunType->GetSelectedEntry()) runType=fComboRunType->GetSelectedEntry()->GetTitle(); + if (runType!="ALL"&&!runType.IsNull()) cuts+=Form("runType.String().Data()==\"%s\"",runType.Data()); + return cuts.GetTitle(); +} +//______________________________________________________________________________ +void AliTPCCalibViewerGUItime::DoDraw() { + TString drawString=fDrawString; + drawString.Prepend("run:time:"); + TString cutString = GetCutString(); + TString optString = "goff"; + TVirtualPad *padsave=gPad; + fCanvMain->GetCanvas()->cd(); + //delete old histogram and graph + if (fCurrentGraph) { + delete fCurrentGraph; + fCurrentGraph=0x0; + //fCurrentHist in case of graph is the internal histogram, + // which is deletet by the graph itself. + fCurrentHist=0x0; + } + if (fCurrentHist) delete fCurrentHist; + //select data + fTree->Draw(drawString.Data(),cutString.Data(),optString.Data()); + if (fTree->GetSelectedRows()==-1) return; + fValuesX.ResizeTo(fTree->GetSelectedRows()); + fValuesY.ResizeTo(fTree->GetSelectedRows()); + fRunNumbers.ResizeTo(fTree->GetSelectedRows()); + fTimeStamps.ResizeTo(fTree->GetSelectedRows()); + fValuesY.SetElements(fTree->GetV3()); + fRunNumbers.SetElements(fTree->GetV1()); + fTimeStamps.SetElements(fTree->GetV2()); + TString title=""; + Bool_t drawGraph=kFALSE; + if (fIsCustomDraw){ + if (fDrawString.Contains(":")){ + fValuesX.SetElements(fTree->GetV4()); + TString yname=fDrawString(0,fDrawString.First(':')); + TString xname=fDrawString(fDrawString.First(':')+1,fDrawString.Length()); + title=Form("%s;%s;%s",fDrawString.Data(),xname.Data(),yname.Data()); + drawGraph=kTRUE; + } else { + drawGraph=kFALSE; + } + }else{ + drawGraph=kTRUE; + if (fRadioXrun->GetState()==kButtonDown){ + fValuesX.SetElements(fTree->GetV1()); + title=Form("%s:Run;Run;%s",fDrawString.Data(),fDrawString.Data()); + } else if (fRadioXtime->GetState()==kButtonDown){ + fValuesX.SetElements(fTree->GetV2()); + title=Form("%s:Time;Time;%s",fDrawString.Data(),fDrawString.Data()); + } else { + drawGraph=kFALSE; + } + } + //create graph according to selection + if (drawGraph){ + fCurrentGraph=new TGraph(fValuesX,fValuesY); + fCurrentGraph->Draw("alp"); + fCurrentHist=fCurrentGraph->GetHistogram(); + fCurrentHist->SetTitle(title.Data()); + } else { + fCurrentGraph=0x0; + Float_t add=TMath::Abs(fValuesY.Min()*.05); + fCurrentHist=new TH1D("hist",Form("%s;%s",fDrawString.Data(),fDrawString.Data()),100,fValuesY.Min()-add,fValuesY.Max()+add); + fCurrentHist->FillN(fValuesY.GetNrows(),fValuesY.GetMatrixArray(),0); + 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(); + xaxis->SetTimeFormat("#splitline{%d.%m}{%H:%M}"); + xaxis->SetTimeDisplay(1); + xaxis->SetLabelOffset(xaxis->GetLabelOffset()*3); + xaxis->SetLabelSize(xaxis->GetLabelSize()/1.3); + } + if (fCurrentGraph){ + fCurrentGraph->SetEditable(kFALSE); + fCurrentGraph->SetMarkerStyle(20); + fCurrentGraph->SetMarkerSize(0.5); + } + gPad->Modified(); + gPad->Update(); + padsave->cd(); +} + +//______________________________________________________________________________ +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; + DoDraw(); +} +//______________________________________________________________________________ +void AliTPCCalibViewerGUItime::DoNewSelection() { + // + // decides whether to redraw if user makes another selection + // + UpdateParLimits(); + fDrawString=GetDrawString(); + fIsCustomDraw=kFALSE; + DoDraw(); +} +//______________________________________________________________________________ +void AliTPCCalibViewerGUItime::DoCustomDraw() +{ + // + // + // + fDrawString=fComboCustomDraw->GetTextEntry()->GetText(); + if (fDrawString.Contains(">>")){ + Warning("DoCustomDraw","Currently no user defined histograms allowed!"); + return; + } + fIsCustomDraw=kTRUE; + DoDraw(); +} +//______________________________________________________________________________ +void AliTPCCalibViewerGUItime::DoCustomCutsDraw() +{ + // + // + // + if (fIsCustomDraw) DoCustomDraw(); + else { + fDrawString=GetDrawString(); + fIsCustomDraw=kFALSE; + DoDraw(); + } +} +//______________________________________________________________________________ +void AliTPCCalibViewerGUItime::HandleButtonsDrawSel(Int_t id) +{ + // + // Draw selection button handling (x-variable) + // + + if (id == -1) { + TGButton *btn = (TGButton *) gTQSender; + id = btn->WidgetId(); + } + + Bool_t doDraw=kFALSE; + switch (id) { + case (kRadioXhist): + doDraw=(fRadioXtime->GetState()==kButtonDown||fRadioXrun->GetState()==kButtonDown); + if (doDraw){ + fRadioXrun->SetState(kButtonUp); + fRadioXtime->SetState(kButtonUp); + } + break; + case (kRadioXrun): + doDraw=(fRadioXtime->GetState()==kButtonDown||fRadioXhist->GetState()==kButtonDown); + if (doDraw){ + fRadioXhist->SetState(kButtonUp); + fRadioXtime->SetState(kButtonUp); + } + break; + case (kRadioXtime): + doDraw=(fRadioXhist->GetState()==kButtonDown||fRadioXrun->GetState()==kButtonDown); + if (doDraw){ + fRadioXrun->SetState(kButtonUp); + fRadioXhist->SetState(kButtonUp); + } + break; + } + if (doDraw) DoNewSelection(); +} +//______________________________________________________________________________ +void AliTPCCalibViewerGUItime::UpdateParLimits() +{ + // + // Adjust limits for TVectorT based variables + // + if (!fTree) return; + TString selectedVariable=""; + if (fListVariables->GetSelectedEntry()) selectedVariable = fListVariables->GetSelectedEntry()->GetTitle(); + if (selectedVariable.IsNull()||!selectedVariable.EndsWith(".")) { + fNmbPar->SetState(kFALSE); + return; + } + TVectorD *vD=0x0; + TVectorF *vF=0x0; + Int_t maxPar=0; + TBranch *branch=fTree->GetBranch(selectedVariable.Data()); + TString branchClass=branch->GetClassName(); + if (branchClass=="TVectorT"){ + branch->SetAddress(&vD); + fTree->GetEntry(0); + maxPar=vD->GetNrows(); + } else if (branchClass=="TVectorT"){ + branch->SetAddress(&vF); + fTree->GetEntry(0); + maxPar=vF->GetNrows(); + } else { + //class not known + fNmbPar->SetState(kFALSE); + return; + } + branch->ResetAddress(); + fNmbPar->SetNumber(0); + fNmbPar->SetLimitValues(0,maxPar-1); + fNmbPar->SetState(kTRUE); +} +//______________________________________________________________________________ +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) { + fLblRunNumberVal->SetText(Form("%05u",run)); + fLblRunTimeVal->SetText(Form("%02u.%02u.%04u\n%02u.%02u.%02u",dd,mm,yy,HH,MM,SS)); + fLblValueXVal->SetText(Form("%.3f", valx)); + fLblValueYVal->SetText(Form("%.3f", valy)); + return; + } + TVirtualPad *padsave=gPad; + fCanvMain->GetCanvas()->cd(); + Int_t n=fValuesY.GetNrows(); + Double_t *arr=0x0; + arr=fValuesX.GetMatrixArray(); + + Int_t minDist=1000000; + Int_t minPoint=-1; + 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)); + if (d < minDist) { + minDist = d; + minPoint = i; + } + } + if (minDist<2){ + TTimeStamp t((Int_t)fTimeStamps[minPoint]); + t.GetDate(kTRUE,0,&yy,&mm,&dd); + t.GetTime(kTRUE,0,&HH,&MM,&SS); + run=(UInt_t)fRunNumbers[minPoint]; + valx=fValuesX[minPoint]; + valy=fValuesY[minPoint]; + } else { + dd=0;mm=0;yy=0;HH=0;MM=0;SS=0;run=0; + valx=0.; + valy=0.; + } + fLblRunNumberVal->SetText(Form("%05u",run)); + fLblRunTimeVal->SetText(Form("%02u.%02u.%04u\n%02u.%02u.%02u",dd,mm,yy,HH,MM,SS)); + if (fIsCustomDraw){ + fLblValueXVal->SetText(Form("%.3f", valx)); + }else{ + if (fRadioXrun->GetState()==kButtonDown){ + fLblValueXVal->SetText("Run"); + } else if (fRadioXtime->GetState()==kButtonDown){ + fLblValueXVal->SetText("Time"); + } + } + fLblValueYVal->SetText(Form("%.3f", valy)); + padsave->cd(); + if (run==0) return; + if (event == kButton1Double ){ + SetGuiTree(run); + } + //find closes point of current selection +} +//______________________________________________________________________________ +void AliTPCCalibViewerGUItime::SetGuiTree(Int_t run) +{ + // + // create the AliTPCCalibViewerGUI tree for run + // cache tree in directory fOutputCacheDir + // retrieve file from this directory if it already exists + // + + //try to find file for run in fOutputCacheDir + TString fileName=fOutputCacheDir; + if (!fileName.EndsWith("/")) fileName+="/"; + fileName+=Form("guiTreeRun_%d.root",run); + TFile f(fileName.Data()); + if (f.IsOpen()){ + f.Close(); + fCalibViewerGUI->Initialize(fileName.Data()); + if (fCalibViewerGUItab) fCalibViewerGUItab->SetText(new TGString(Form("Detail - %05d",run))); + return; + } + f.Close(); + Bool_t sucess=AliTPCcalibDB::CreateGUITree(run,fileName.Data()); + if (sucess){ + fCalibViewerGUI->Initialize(fileName.Data()); + if (fCalibViewerGUItab) fCalibViewerGUItab->SetText(new TGString(Form("Detail - %05d",run))); + }else{ + fCalibViewerGUI->Reset(); + if (fCalibViewerGUItab) fCalibViewerGUItab->SetText(new TGString(Form("Detail - XXXXX"))); + } +} +//______________________________________________________________________________ +TObjArray* AliTPCCalibViewerGUItime::ShowGUI(const char* fileName) { + // + // Initialize and show GUI for presentation for demonstration purposes + // or for fast standalone use + // + TGMainFrame* frmMain = new TGMainFrame(gClient->GetRoot(), 1000, 600); + frmMain->SetWindowName("AliTPCCalibViewer GUItime"); + frmMain->SetCleanup(kDeepCleanup); + + TGTab* tabMain = new TGTab(frmMain, 1000, 600); + frmMain->AddFrame(tabMain, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0)); + + TGCompositeFrame* tabCont1 = tabMain->AddTab("Time"); + TGCompositeFrame* tabCont2 = tabMain->AddTab("Detail - XXXXX"); + + AliTPCCalibViewerGUItime* calibViewerTime = new AliTPCCalibViewerGUItime(tabCont1, 1000, 600); + tabCont1->AddFrame(calibViewerTime, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0)); + calibViewerTime->UseFile(fileName); + + AliTPCCalibViewerGUI* calibViewer = new AliTPCCalibViewerGUI(tabCont2, 1000, 600, 0); + tabCont2->AddFrame(calibViewer, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0)); + calibViewerTime->SetCalibViewerGUI(calibViewer); + calibViewerTime->SetCalibViewerGUItab(tabMain->GetTabTab(1)); + + + TObjArray *guiArray = new TObjArray(); + guiArray->Add(calibViewerTime); + guiArray->Add(calibViewer); + + frmMain->MapSubwindows(); + frmMain->Resize(); + frmMain->MapWindow(); + + return guiArray; +} + diff --git a/TPC/AliTPCCalibViewerGUItime.h b/TPC/AliTPCCalibViewerGUItime.h new file mode 100644 index 00000000000..3eb3c4261c0 --- /dev/null +++ b/TPC/AliTPCCalibViewerGUItime.h @@ -0,0 +1,151 @@ +#ifndef AliTPCCalibViewerGUItime_H +#define AliTPCCalibViewerGUItime_H + +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id: AliTPCCalibViewerGUI.h,v */ + +/////////////////////////////////////////////////////////////////////////////// +// // +// GUI for displaying calibration entires over time // +// Calibration Trees are created using the macro TPC/CalibMacros/CalibEnv.C // +// used for the calibration monitor // +// // +/////////////////////////////////////////////////////////////////////////////// + + +#ifndef ROOT_TGButton +#include "TGWidget.h" +#endif +#ifndef ROOT_TGFrame +#include "TGFrame.h" +#endif + +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +#include +#include + +class TGCompositeFrame; +class TRootEmbeddedCanvas; +class TGTextButton; +class TGListBox; +class TGRadioButton; +class TGGroupFrame; +class TGLabel; +class TGComboBox; +class TGTabElement; + +class TFile; +class TTree; +class TGraph; + +class AliTPCCalibViewerGUI; + + + +class AliTPCCalibViewerGUItime : public TGCompositeFrame { +public: + AliTPCCalibViewerGUItime(const TGWindow *p, UInt_t w, UInt_t h); + virtual ~AliTPCCalibViewerGUItime(); + + static TObjArray* ShowGUI(const char* fileName = 0); // initialize and show GUI standalone + + void DrawGUI(const TGWindow *p, UInt_t w, UInt_t h); + + void UseFile(const char* fileName); + void Reload(); + void SetInitialValues(); + + + void SetCalibViewerGUI(AliTPCCalibViewerGUI *gui) {fCalibViewerGUI=gui;} + void SetCalibViewerGUItab(TGTabElement *tab) {fCalibViewerGUItab=tab;} + const char* GetDrawString(); + const char* GetCutString(); + //Slots + void DoDraw(); + void DoDumpRuns(); + void DoCustomDraw(); + void DoCustomCutsDraw(); + void DoParLimitChange(); + void DoNewSelection(); // decides whether to redraw if user makes another selection + void HandleButtonsDrawSel(Int_t id = -1); + void MouseMove(Int_t event, Int_t x, Int_t y, TObject *selected); + +private: + TFile* fFile; //file that keeps the tree + TTree* fTree; //internal tree + AliTPCCalibViewerGUI *fCalibViewerGUI; //calib viewer gui used to display verbose information for one run + TGTabElement *fCalibViewerGUItab; //tab the calib view gui redies in + TH1* fCurrentHist; //histogram currently drawn in main canvas + TGraph* fCurrentGraph; //current graph + 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 + Bool_t fIsCustomDraw; //if custom draw string is selected + TVectorD fRunNumbers; //run numbers of current selection + TVectorD fTimeStamps; //timr stamps of current selection + TVectorD fValuesX; //values of current selection + TVectorD fValuesY; //values of current selection + + //GUI elements + //main canvas Top part, bottom part + TGCompositeFrame *fContTopBottom; // container for all GUI elements, vertical divided + //top left, centre, right + TGCompositeFrame *fContLCR; // container for all GUI elements, horizontal divided + //content left + TGCompositeFrame *fContLeft; // container for GUI elements on left side + TGGroupFrame *fContDrawSel; // Subgroup for draw selection + TGCompositeFrame *fContDrawSelSubRunTime; //Radio button subframe + TGRadioButton *fRadioXhist; // Radio button x-variable: show only 1D distribution + 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 + TGNumberEntry *fNmbPar; // parameter number + TGLabel *fLblPar; // parameter name + //content centre + TGCompositeFrame *fContCenter; // container for GUI elements at the center + TRootEmbeddedCanvas *fCanvMain; // main drawing canvas + //content right + TGCompositeFrame *fContRight; // container for GUI elements on right side + TGGroupFrame *fContValues; // container to keep data point information + TGLabel *fLblRunNumber; // run number label + TGLabel *fLblRunTime; // time stamp label + TGLabel *fLblValueX; // value label + TGLabel *fLblValueY; // value label + TGLabel *fLblRunNumberVal; // run number of the data point hoovered + TGLabel *fLblRunTimeVal; // time stamp of the data point hoovered + TGLabel *fLblValueXVal; // value of the data point hoovered + TGLabel *fLblValueYVal; // value of the data point hoovered + TGTextButton *fBtnDumpRuns; // draw button + //content bottom + TGCompositeFrame *fContCustom; // container for custom draw command GUI elements + TGCompositeFrame *fContCustomCuts; // container for custom cut options GUI elements + TGLabel *fLblCustomDraw; // label for custom draw string + TGLabel *fLblCustomCuts; // label for custom cuts string + TGComboBox *fComboCustomDraw; // combo box custom draw string + TGComboBox *fComboCustomCuts; // combo box custom cuts string + + enum { kRadioXhist=10, kRadioXrun=11, kRadioXtime=12 }; + + void UpdateParLimits(); + void SetGuiTree(Int_t run); + + AliTPCCalibViewerGUItime(const AliTPCCalibViewerGUItime &v); + AliTPCCalibViewerGUItime &operator = (const AliTPCCalibViewerGUItime &v); // assignment operator + + ClassDef(AliTPCCalibViewerGUItime, 0) + +}; + +#endif diff --git a/TPC/AliTPCConfigParser.cxx b/TPC/AliTPCConfigParser.cxx new file mode 100644 index 00000000000..b756cead9d8 --- /dev/null +++ b/TPC/AliTPCConfigParser.cxx @@ -0,0 +1,213 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class for Parsing simple text configuration files // +// It produces a TList for the TObjArrays with the name of the Key +// the TObjArray contain the Values, split from kommas, as found in the // +// Configutation file. // +// // +// The configuration file has a simple structure: // +// * Lines starting with a # or empty lines are ignored // +// * Key and Value are separated either by a or es // +// // +// Currently the class is used in the TPC DAs to allow an adjustment of // +// the most relevant parameters without recompiling the DAs // +/////////////////////////////////////////////////////////////////////////////// + + +#include +//Root includes +#include +#include +#include +#include +#include +//AliRoot includes + +//header +#include "AliTPCConfigParser.h" + + +AliTPCConfigParser::AliTPCConfigParser() : +TObject(), +fConfigMap(new TList), +fKeyIter(0), +fValIter(0) +{ + // + // default constructor + // + fConfigMap->SetOwner(); +} +//_____________________________________________________________________ +AliTPCConfigParser::AliTPCConfigParser(const AliTPCConfigParser &cfg) : +TObject(), +fConfigMap((TList*)cfg.fConfigMap->Clone()), +fKeyIter(0), +fValIter(0) +{ + // + // copy constructor + // + fConfigMap->SetOwner(); +} + +//_____________________________________________________________________ +AliTPCConfigParser::AliTPCConfigParser(const char* cfgfile) : +TObject(), +fConfigMap(new TList), +fKeyIter(0), +fValIter(0) +{ + // + // default constructor using the config file name as input parameter + // + fConfigMap->SetOwner(); + if ( !cfgfile ) return; + ParseConfigFileTxt(cfgfile); +} +//_____________________________________________________________________ +AliTPCConfigParser& AliTPCConfigParser::operator = (const AliTPCConfigParser &source) +{ + // + // assignment operator + // + if (&source == this) return *this; + new (this) AliTPCConfigParser(source); + + return *this; +} +//_____________________________________________________________________ +AliTPCConfigParser::~AliTPCConfigParser() +{ + // + // dtor + // + delete fConfigMap; + delete fKeyIter; + delete fValIter; +} +//_____________________________________________________________________ +Int_t AliTPCConfigParser::ParseConfigFileTxt(const char* cfgfile) +{ + // + // Function to parse a configuration file + // + + ifstream file(cfgfile); + if ( !file.is_open() ){ + Error("ParseConfigFileTxt","File '%s' could not be opened!", cfgfile); + return 1; + } + TString strFile; + strFile.ReadFile(file); + TObjArray *arr=strFile.Tokenize("\n"); + if ( !arr ) { + file.close(); + return 2; + } + TIter nextLine(arr); + while (TObject *l=nextLine()){ + TString line(((TObjString*)l)->GetString()); + //remove whitespcaces + line.Remove(TString::kBoth,' '); + line.Remove(TString::kBoth,'\t'); + if ( line.BeginsWith("#") || line=="" ) continue; + line.ReplaceAll(", ",","); + TObjArray *arrValues=line.Tokenize(" \t"); + //currently only name => Value is supported + //and name => 'nothing' + //value may be a comma separated list, in which case a TObjArray + //of the list will be created and stored as the value + Int_t nentries=arrValues->GetEntries(); + if (nentries>2){ + Error("AliTPCConfigParser","ParseConfigFileTxt: Cannot parse line '%s'\n",line.Data()); + delete arrValues; + continue; + } + TObjArray *objArr=0x0; + if (nentries==2){ + TObject *objVal=arrValues->At(1); + const TString &str=((TObjString*)objVal)->GetString(); + if (str.Contains(",")) + objArr=str.Tokenize(","); + else{ + objArr=new TObjArray; + objArr->Add(objVal->Clone()); + } + objArr->SetOwner(kTRUE); + } else { + objArr=new TObjArray; + } + objArr->SetName(arrValues->At(0)->GetName()); + fConfigMap->AddLast(objArr); + delete arrValues; + } + + delete arr; + return 0; +} +//_____________________________________________________________________ +Float_t AliTPCConfigParser::GetValue(const char *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(); +} +//_____________________________________________________________________ +TObject* AliTPCConfigParser::NextKey(){ + if (!fKeyIter) fKeyIter=fConfigMap->MakeIterator(); + TObject *obj=fKeyIter->Next(); + if (!obj) { + delete fKeyIter; + fKeyIter=0; + } + return obj; +} +//_____________________________________________________________________ +TObject* AliTPCConfigParser::NextValue(const char *key){ + return NextValueIter((TObjArray*)fConfigMap->FindObject(key)); +} +//_____________________________________________________________________ +TObject* AliTPCConfigParser::NextValue(TObject *key){ + return NextValueIter((TObjArray*)fConfigMap->FindObject(key)); +} +//_____________________________________________________________________ +TObject* AliTPCConfigParser::NextValueIter(TObjArray *key){ + if (!key) return 0; + //check if the collection has changed + if (fValIter && key!=fValIter->GetCollection()) delete fValIter; + if (!fValIter) fValIter=key->MakeIterator(); + TObject *value=fValIter->Next(); + if (!value) { + delete fValIter; + fValIter=0; + } + return value; +} +//_____________________________________________________________________ +void AliTPCConfigParser::ResetMap() +{ + // + // Reset the map with the configuration values + // + fConfigMap->Delete(); +} diff --git a/TPC/AliTPCConfigParser.h b/TPC/AliTPCConfigParser.h new file mode 100644 index 00000000000..6e4e9c4a205 --- /dev/null +++ b/TPC/AliTPCConfigParser.h @@ -0,0 +1,42 @@ +#ifndef AliTPCConfigParser_H +#define AliTPCConfigParser_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ +#include + +class TObjArray; +class TList; + +class AliTPCConfigParser : public TObject{ + +public: + AliTPCConfigParser(); + AliTPCConfigParser(const char* cfgfile); + AliTPCConfigParser(const AliTPCConfigParser &cfg); + AliTPCConfigParser& operator = (const AliTPCConfigParser &cfg); + + virtual ~AliTPCConfigParser(); + + Int_t ParseConfigFileTxt(const char* cfgfile); + Float_t GetValue(const char* name, UInt_t position=0); + + const TList* GetConfigurationMap() const {return fConfigMap;} + void ResetMap(); + + const TList* operator()() const {return fConfigMap;} + const TObject* operator()(const char* key) const {return fConfigMap->FindObject(key);} + const TObject* operator()(TObject* key) const {return fConfigMap->FindObject(key);} + TObject* NextKey(); + TObject* NextValue(const char *key); + TObject* NextValue(TObject *key); + +private: + TList *fConfigMap; + TIterator *fKeyIter; + TIterator *fValIter; + + TObject *NextValueIter(TObjArray *obj); + + ClassDef(AliTPCConfigParser, 1) // TPC DA configuration file parser +}; +#endif diff --git a/TPC/AliTPCMonitor.cxx b/TPC/AliTPCMonitor.cxx index c432bcdfb79..f3f010d0ad7 100755 --- a/TPC/AliTPCMonitor.cxx +++ b/TPC/AliTPCMonitor.cxx @@ -6,7 +6,7 @@ * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * + * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * @@ -47,18 +47,15 @@ New TPC monitoring package from Stefan Kniege. The monitoring package can be sta //// ///////////////////////////////////////////////////////////////////////// - + #include "AliLog.h" #include "AliTPCMonitor.h" #include "AliTPCMonitorMappingHandler.h" -#include "AliTPCMonitorDateFile.h" -#include "AliTPCMonitorDateFormat.h" -#include "AliTPCMonitorAltro.h" #include "AliTPCMonitorFFT.h" -#include "AliRawReaderRoot.h" #include "AliRawReader.h" #include "AliRawEventHeaderBase.h" +#include "AliAltroRawStreamV3.h" #include "TH2F.h" #include "TF1.h" #include "TMath.h" @@ -71,183 +68,185 @@ New TPC monitoring package from Stefan Kniege. The monitoring package can be sta #include "TPaveText.h" #include "TFile.h" #include -#include "AliTPCMonitorDateMonitor.h" ClassImp(AliTPCMonitor) +const Int_t AliTPCMonitor::fgkHwMaskFEC = 0x0780; +const Int_t AliTPCMonitor::fgkHwMaskBranch = 0x0800; +const Int_t AliTPCMonitor::fgkHwMaskFECChannel = 0x007f; +const Int_t AliTPCMonitor::fgkHwMaskAltroChannel = 0x000f; +const Int_t AliTPCMonitor::fgkHwMaskAltroChip = 0x0070; +const Int_t AliTPCMonitor::fgkHwMaskRCU = 0x7000; + //____________________________________________________________________________ AliTPCMonitor::AliTPCMonitor(char* name, char* title) : - AliTPCMonitorConfig(name,title), - fPad(new Int_t*[GetMaxHwAddr()]), - fPadMapHw(new Float_t[GetMaxHwAddr()]), - fPadMapRCU(new Int_t*[GetMaxHwAddr()]), - fHistIROC(0), - fHistOROC(0), - fHistIROCIndex(0), - fHistOROCIndex(0), - fHistIROCTime(0), - fHistOROCTime(0), - fHistIROCClone(0), - fHistOROCClone(0), - fHistIROCRMS(0), - fHistOROCRMS(0), - fHistIROCBASE(0), - fHistOROCBASE(0), - fHistIROCSUM(0), - fHistOROCSUM(0), - fHistChannelTime(0), - fHistAddrMapIndex(0), - fHistAddrMaxAdc(0), - fHistAddrBaseMean(0), - fHistAddrMaxAdcX(0), - fHistAddrAdcSum(0), - fHistAddrBaseRms(0), - fHistDistrSumIROC(0), - fHistDistrMaxIROC(0), - fHistDistrSumOROC(0), - fHistDistrMaxOROC(0), - fHistDistrBase2dIROC(0), - fHistDistrBase2dOROC(0), - fHistDistrBaseRmsIROC(0), - fHistDistrBaseMeanIROC(0), - fHistDistrBaseRmsOROC(0), - fHistDistrBaseMeanOROC(0), - fHistGlobalMaxA(0), - fHistGlobalMaxC(0), - fHistList(new TObjArray()), - - fkNRowsIroc(63), - fkNRowsOroc(96), - - fkNPadsIroc(110), - fkNPadsOroc(140), - fkNPadMinIroc(-55), - fkNPadMinOroc(-70), - fkNPadMaxIroc(55), - fkNPadMaxOroc(70), - fVerb(0), - fLastEv(0), - fEventNumber(0), - fEventNumberOld(0), - fDisableFit(0), - fExecGlob(0), - fExecPlaneMax(0), - fExecPadIrocRms(0), - fExecPadOrocRms(0), - fRunId(0), - fEqId(0), - fPadUsedRoc(-1), - fPadUsedHwAddr(-1), - fGdcId(0), - fLdcId(0), - fLdcIdOld(1), - fMapEqidsSec(new Int_t*[36]), - fMapEqidsRcu(new Int_t[1000]), - fMirror(1), - fChannelIter(0), - fMapHand(0), - fReaderROOT(0), - fReaderDATE(0), - fReaderDATEMon(0) +AliTPCMonitorConfig(name,title), +fPad(new Int_t*[GetMaxHwAddr()]), +fPadMapHw(new Float_t[GetMaxHwAddr()]), +fPadMapRCU(new Int_t*[GetMaxHwAddr()]), +fHistIROC(0), +fHistOROC(0), +fHistIROCIndex(0), +fHistOROCIndex(0), +fHistIROCTime(0), +fHistOROCTime(0), +fHistIROCClone(0), +fHistOROCClone(0), +fHistIROCRMS(0), +fHistOROCRMS(0), +fHistIROCBASE(0), +fHistOROCBASE(0), +fHistIROCSUM(0), +fHistOROCSUM(0), +fHistChannelTime(0), +fHistAddrMapIndex(0), +fHistAddrMaxAdc(0), +fHistAddrBaseMean(0), +fHistAddrMaxAdcX(0), +fHistAddrAdcSum(0), +fHistAddrBaseRms(0), +fHistDistrSumIROC(0), +fHistDistrMaxIROC(0), +fHistDistrSumOROC(0), +fHistDistrMaxOROC(0), +fHistDistrBase2dIROC(0), +fHistDistrBase2dOROC(0), +fHistDistrBaseRmsIROC(0), +fHistDistrBaseMeanIROC(0), +fHistDistrBaseRmsOROC(0), +fHistDistrBaseMeanOROC(0), +fHistGlobalMaxA(0), +fHistGlobalMaxC(0), +fHistList(new TObjArray()), + +fkNRowsIroc(63), +fkNRowsOroc(96), + +fkNPadsIroc(110), +fkNPadsOroc(140), +fkNPadMinIroc(-55), +fkNPadMinOroc(-70), +fkNPadMaxIroc(55), +fkNPadMaxOroc(70), +fVerb(0), +fLastEv(0), +fEventNumber(0), +fEventNumberOld(0), +fDisableFit(0), +fExecGlob(0), +fExecPlaneMax(0), +fExecPadIrocRms(0), +fExecPadOrocRms(0), +fRunId(0), +fEqId(0), +fPadUsedRoc(-1), +fPadUsedHwAddr(-1), +fGdcId(0), +fLdcId(0), +fLdcIdOld(1), +fMapEqidsSec(new Int_t*[36]), +fMapEqidsRcu(new Int_t[1000]), +fMirror(1), +fChannelIter(0), +fMapHand(0), +fRawReader(0) { - // Constructor + // Constructor for(Int_t i = 0; iGetList()) { - if (!gDirectory->GetList()) - { - Warning("Build","Current directory is not a valid directory"); - return; - } - AliTPCMonitor *hold = (AliTPCMonitor*)gDirectory->GetList()->FindObject(GetName()); - if(hold) - { - Warning("Build","Replacing existing histogram: %s (Potential memory leak).",GetName()); - gDirectory->GetList()->Remove(hold); - } - gDirectory->Append(this); + Warning("Build","Current directory is not a valid directory"); + return; } + AliTPCMonitor *hold = (AliTPCMonitor*)gDirectory->GetList()->FindObject(GetName()); + if(hold) + { + Warning("Build","Replacing existing histogram: %s (Potential memory leak).",GetName()); + gDirectory->GetList()->Remove(hold); + } + gDirectory->Append(this); + } CreateHistos(); SetEqIds(); - + } //____________________________________________________________________________ AliTPCMonitor::AliTPCMonitor(const AliTPCMonitor &monitor): - AliTPCMonitorConfig(monitor.GetName(),monitor.GetTitle()), - fPad(new Int_t*[GetMaxHwAddr()]), - fPadMapHw(new Float_t[GetMaxHwAddr()]), - fPadMapRCU(new Int_t*[GetMaxHwAddr()]), - fHistIROC(0), - fHistOROC(0), - fHistIROCIndex(0), - fHistOROCIndex(0), - fHistIROCTime(0), - fHistOROCTime(0), - fHistIROCClone(0), - fHistOROCClone(0), - fHistIROCRMS(0), - fHistOROCRMS(0), - fHistIROCBASE(0), - fHistOROCBASE(0), - fHistIROCSUM(0), - fHistOROCSUM(0), - fHistChannelTime(0), - fHistAddrMapIndex(0), - fHistAddrMaxAdc(0), - fHistAddrBaseMean(0), - fHistAddrMaxAdcX(0), - fHistAddrAdcSum(0), - fHistAddrBaseRms(0), - fHistDistrSumIROC(0), - fHistDistrMaxIROC(0), - fHistDistrSumOROC(0), - fHistDistrMaxOROC(0), - fHistDistrBase2dIROC(0), - fHistDistrBase2dOROC(0), - fHistDistrBaseRmsIROC(0), - fHistDistrBaseMeanIROC(0), - fHistDistrBaseRmsOROC(0), - fHistDistrBaseMeanOROC(0), - fHistGlobalMaxA(0), - fHistGlobalMaxC(0), - fHistList(new TObjArray()), - fkNRowsIroc(monitor.fkNRowsIroc), - fkNRowsOroc(monitor.fkNRowsOroc), - fkNPadsIroc(monitor.fkNPadsIroc), - fkNPadsOroc(monitor.fkNPadsOroc), - fkNPadMinIroc(monitor.fkNPadMinIroc), - fkNPadMinOroc(monitor.fkNPadMinOroc), - fkNPadMaxIroc(monitor.fkNPadMaxIroc), - fkNPadMaxOroc(monitor.fkNPadMaxOroc), - fVerb(monitor.fVerb), - fLastEv(monitor.fLastEv), - fEventNumber(monitor.fEventNumber), - fEventNumberOld(monitor.fEventNumberOld), - fDisableFit(monitor.fDisableFit), - fExecGlob(monitor.fExecGlob), - fExecPlaneMax(monitor.fExecPlaneMax), - fExecPadIrocRms(monitor.fExecPadIrocRms), - fExecPadOrocRms(monitor.fExecPadOrocRms), - fRunId(monitor.fRunId), - fEqId(monitor.fEqId), - fPadUsedRoc(monitor.fPadUsedRoc), - fPadUsedHwAddr(monitor.fPadUsedHwAddr), - fGdcId(monitor.fGdcId), - fLdcId(monitor.fLdcId), - fLdcIdOld(monitor.fLdcIdOld), - fMapEqidsSec(new Int_t*[36]), - fMapEqidsRcu(new Int_t[1000]), - fMirror(monitor.fMirror), - fChannelIter(monitor.fChannelIter), - fMapHand(monitor.fMapHand), - fReaderROOT(monitor.fReaderROOT), - fReaderDATE(monitor.fReaderDATE), - fReaderDATEMon(monitor.fReaderDATEMon) +AliTPCMonitorConfig(monitor.GetName(),monitor.GetTitle()), +fPad(new Int_t*[GetMaxHwAddr()]), +fPadMapHw(new Float_t[GetMaxHwAddr()]), +fPadMapRCU(new Int_t*[GetMaxHwAddr()]), +fHistIROC(0), +fHistOROC(0), +fHistIROCIndex(0), +fHistOROCIndex(0), +fHistIROCTime(0), +fHistOROCTime(0), +fHistIROCClone(0), +fHistOROCClone(0), +fHistIROCRMS(0), +fHistOROCRMS(0), +fHistIROCBASE(0), +fHistOROCBASE(0), +fHistIROCSUM(0), +fHistOROCSUM(0), +fHistChannelTime(0), +fHistAddrMapIndex(0), +fHistAddrMaxAdc(0), +fHistAddrBaseMean(0), +fHistAddrMaxAdcX(0), +fHistAddrAdcSum(0), +fHistAddrBaseRms(0), +fHistDistrSumIROC(0), +fHistDistrMaxIROC(0), +fHistDistrSumOROC(0), +fHistDistrMaxOROC(0), +fHistDistrBase2dIROC(0), +fHistDistrBase2dOROC(0), +fHistDistrBaseRmsIROC(0), +fHistDistrBaseMeanIROC(0), +fHistDistrBaseRmsOROC(0), +fHistDistrBaseMeanOROC(0), +fHistGlobalMaxA(0), +fHistGlobalMaxC(0), +fHistList(new TObjArray()), +fkNRowsIroc(monitor.fkNRowsIroc), +fkNRowsOroc(monitor.fkNRowsOroc), +fkNPadsIroc(monitor.fkNPadsIroc), +fkNPadsOroc(monitor.fkNPadsOroc), +fkNPadMinIroc(monitor.fkNPadMinIroc), +fkNPadMinOroc(monitor.fkNPadMinOroc), +fkNPadMaxIroc(monitor.fkNPadMaxIroc), +fkNPadMaxOroc(monitor.fkNPadMaxOroc), +fVerb(monitor.fVerb), +fLastEv(monitor.fLastEv), +fEventNumber(monitor.fEventNumber), +fEventNumberOld(monitor.fEventNumberOld), +fDisableFit(monitor.fDisableFit), +fExecGlob(monitor.fExecGlob), +fExecPlaneMax(monitor.fExecPlaneMax), +fExecPadIrocRms(monitor.fExecPadIrocRms), +fExecPadOrocRms(monitor.fExecPadOrocRms), +fRunId(monitor.fRunId), +fEqId(monitor.fEqId), +fPadUsedRoc(monitor.fPadUsedRoc), +fPadUsedHwAddr(monitor.fPadUsedHwAddr), +fGdcId(monitor.fGdcId), +fLdcId(monitor.fLdcId), +fLdcIdOld(monitor.fLdcIdOld), +fMapEqidsSec(new Int_t*[36]), +fMapEqidsRcu(new Int_t[1000]), +fMirror(monitor.fMirror), +fChannelIter(monitor.fChannelIter), +fMapHand(monitor.fMapHand), +fRawReader(monitor.fRawReader) { // copy constructor @@ -274,13 +273,13 @@ AliTPCMonitor::AliTPCMonitor(const AliTPCMonitor &monitor): fHistAddrMaxAdcX=(TH1F*)monitor.fHistAddrMaxAdcX->Clone(); fHistList->Add(fHistAddrMaxAdcX); fHistAddrAdcSum=(TH1F*)monitor.fHistAddrAdcSum->Clone(); fHistList->Add(fHistAddrAdcSum); fHistAddrBaseRms=(TH1F*)monitor.fHistAddrBaseRms->Clone(); fHistList->Add(fHistAddrBaseRms); - + fHistDistrSumIROC=(TH1F*)monitor.fHistDistrSumIROC->Clone(); fHistList->Add(fHistDistrSumIROC); fHistDistrMaxIROC=(TH1F*)monitor.fHistDistrMaxIROC->Clone(); fHistList->Add(fHistDistrMaxIROC); fHistDistrSumOROC=(TH1F*)monitor.fHistDistrSumOROC->Clone(); fHistList->Add(fHistDistrSumOROC); fHistDistrMaxOROC=(TH1F*)monitor.fHistDistrMaxOROC->Clone(); fHistList->Add(fHistDistrMaxOROC); - + fHistDistrBase2dIROC=(TH2F*)monitor.fHistDistrBase2dIROC->Clone(); fHistList->Add(fHistDistrBase2dIROC); fHistDistrBase2dOROC=(TH2F*)monitor.fHistDistrBase2dOROC->Clone(); fHistList->Add(fHistDistrBase2dOROC); fHistDistrBaseRmsIROC=(TH1D*)monitor.fHistDistrBaseRmsIROC->Clone(); fHistList->Add(fHistDistrBaseRmsIROC); @@ -291,10 +290,10 @@ AliTPCMonitor::AliTPCMonitor(const AliTPCMonitor &monitor): fHistGlobalMaxA=(TH2S*)monitor.fHistGlobalMaxA->Clone(); fHistList->Add(fHistGlobalMaxA); fHistGlobalMaxC=(TH2S*)monitor.fHistGlobalMaxC->Clone(); fHistList->Add(fHistGlobalMaxC); - // fPad = new Int_t*[monitor.GetMaxHwAddr()]; + // fPad = new Int_t*[monitor.GetMaxHwAddr()]; for(Int_t i = 0; iGetList()) { - if (!gDirectory->GetList()) - { - Warning("Build","Current directory is not a valid directory"); - - } - else - { - AliTPCMonitor *hold = (AliTPCMonitor*)gDirectory->GetList()->FindObject(monitor.GetName()); - if(hold) - { - Warning("Build","Replacing existing histogram: %s (Potential memory leak).",monitor.GetName()); - gDirectory->GetList()->Remove(hold); - } - gDirectory->Append(this); - } - } + Warning("Build","Current directory is not a valid directory"); + + } + else + { + AliTPCMonitor *hold = (AliTPCMonitor*)gDirectory->GetList()->FindObject(monitor.GetName()); + if(hold) + { + Warning("Build","Replacing existing histogram: %s (Potential memory leak).",monitor.GetName()); + gDirectory->GetList()->Remove(hold); + } + gDirectory->Append(this); + } + } } @@ -331,108 +330,106 @@ AliTPCMonitor &AliTPCMonitor:: operator= (const AliTPCMonitor& monitor) { // assigment operator if(this!=&monitor) + { + ((AliTPCMonitorConfig *)this)->operator=(monitor); + fkNRowsIroc=monitor.fkNRowsIroc; + fkNRowsOroc=monitor.fkNRowsOroc; + fkNPadsIroc=monitor.fkNPadsIroc; + fkNPadsOroc=monitor.fkNPadsOroc; + fkNPadMinIroc=monitor.fkNPadMinIroc; + fkNPadMinOroc=monitor.fkNPadMinOroc; + fkNPadMaxIroc=monitor.fkNPadMaxIroc; + fkNPadMaxOroc=monitor.fkNPadMaxOroc; + fVerb=monitor.fVerb; + fLastEv=monitor.fLastEv; + fEventNumber=monitor.fEventNumber; + fEventNumberOld=monitor.fEventNumberOld; + fDisableFit=monitor.fDisableFit; + fExecGlob=monitor.fExecGlob; + fExecPlaneMax=monitor.fExecPlaneMax; + fExecPadIrocRms=monitor.fExecPadIrocRms; + fExecPadOrocRms=monitor.fExecPadOrocRms; + fRunId=monitor.fRunId; + fEqId=monitor.fEqId; + fPadUsedRoc=monitor.fPadUsedRoc; + fPadUsedHwAddr=monitor.fPadUsedHwAddr; + fGdcId=monitor.fGdcId; + fLdcId=monitor.fLdcId; + fLdcIdOld=monitor.fLdcIdOld; + fMapHand=monitor.fMapHand; + fRawReader=monitor.fRawReader; + + + fHistList = new TObjArray(); + fHistIROC=(TH2F*)monitor.fHistIROC->Clone(); fHistList->Add(fHistIROC); + fHistOROC=(TH2F*)monitor.fHistOROC->Clone(); fHistList->Add(fHistOROC); + fHistIROCIndex=(TH2S*)monitor.fHistIROCIndex->Clone(); fHistList->Add(fHistIROCIndex); + fHistOROCIndex=(TH2S*)monitor.fHistOROCIndex->Clone(); fHistList->Add(fHistOROCIndex); + fHistIROCTime=(TH2F*)monitor.fHistIROCTime->Clone(); fHistList->Add(fHistIROCTime); + fHistOROCTime=(TH2F*)monitor.fHistOROCTime->Clone(); fHistList->Add(fHistOROCTime); + fHistIROCClone=(TH2F*)monitor.fHistIROCClone->Clone(); fHistList->Add(fHistIROCClone); + fHistOROCClone=(TH2F*)monitor.fHistOROCClone->Clone(); fHistList->Add(fHistOROCClone); + fHistIROCRMS=(TH2F*)monitor.fHistIROCRMS->Clone(); fHistList->Add(fHistIROCRMS); + fHistOROCRMS=(TH2F*)monitor.fHistOROCRMS->Clone(); fHistList->Add(fHistOROCRMS); + fHistIROCBASE=(TH2F*)monitor.fHistIROCBASE->Clone(); fHistList->Add(fHistIROCBASE); + fHistOROCBASE=(TH2F*)monitor.fHistOROCBASE->Clone(); fHistList->Add(fHistOROCBASE); + fHistIROCSUM=(TH2F*)monitor.fHistIROCSUM->Clone(); fHistList->Add(fHistIROCSUM); + fHistOROCSUM=(TH2F*)monitor.fHistOROCSUM->Clone(); fHistList->Add(fHistOROCSUM); + + fHistChannelTime=(TH2F*)monitor.fHistChannelTime->Clone(); fHistList->Add(fHistChannelTime); + + fHistAddrMapIndex=(TH1F*)monitor.fHistAddrMapIndex->Clone(); fHistList->Add(fHistAddrMapIndex); + fHistAddrMaxAdc=(TH1F*)monitor.fHistAddrMaxAdc->Clone(); fHistList->Add(fHistAddrMaxAdc); + fHistAddrBaseMean=(TH1F*)monitor.fHistAddrBaseMean->Clone(); fHistList->Add(fHistAddrBaseMean); + fHistAddrMaxAdcX=(TH1F*)monitor.fHistAddrMaxAdcX->Clone(); fHistList->Add(fHistAddrMaxAdcX); + fHistAddrAdcSum=(TH1F*)monitor.fHistAddrAdcSum->Clone(); fHistList->Add(fHistAddrAdcSum); + fHistAddrBaseRms=(TH1F*)monitor.fHistAddrBaseRms->Clone(); fHistList->Add(fHistAddrBaseRms); + + + fHistDistrSumIROC=(TH1F*)monitor.fHistDistrSumIROC->Clone(); fHistList->Add(fHistDistrSumIROC); + fHistDistrMaxIROC=(TH1F*)monitor.fHistDistrMaxIROC->Clone(); fHistList->Add(fHistDistrMaxIROC); + fHistDistrSumOROC=(TH1F*)monitor.fHistDistrSumOROC->Clone(); fHistList->Add(fHistDistrSumOROC); + fHistDistrMaxOROC=(TH1F*)monitor.fHistDistrMaxOROC->Clone(); fHistList->Add(fHistDistrMaxOROC); + + fHistDistrBase2dIROC=(TH2F*)monitor.fHistDistrBase2dIROC->Clone(); fHistList->Add(fHistDistrBase2dIROC); + fHistDistrBase2dOROC=(TH2F*)monitor.fHistDistrBase2dOROC->Clone(); fHistList->Add(fHistDistrBase2dOROC); + fHistDistrBaseRmsIROC=(TH1D*)monitor.fHistDistrBaseRmsIROC->Clone(); fHistList->Add(fHistDistrBaseRmsIROC); + fHistDistrBaseMeanIROC=(TH1D*)monitor.fHistDistrBaseMeanIROC->Clone(); fHistList->Add(fHistDistrBaseMeanIROC); + fHistDistrBaseRmsOROC=(TH1D*)monitor.fHistDistrBaseRmsOROC->Clone(); fHistList->Add(fHistDistrBaseRmsOROC); + fHistDistrBaseMeanOROC=(TH1D*)monitor.fHistDistrBaseMeanOROC->Clone(); fHistList->Add(fHistDistrBaseMeanOROC); + + fHistGlobalMaxA=(TH2S*)monitor.fHistGlobalMaxA->Clone(); fHistList->Add(fHistGlobalMaxA); + fHistGlobalMaxC=(TH2S*)monitor.fHistGlobalMaxC->Clone(); fHistList->Add(fHistGlobalMaxC); + + fPad = new Int_t*[monitor.GetMaxHwAddr()]; + for(Int_t i = 0; ioperator=(monitor); - fkNRowsIroc=monitor.fkNRowsIroc; - fkNRowsOroc=monitor.fkNRowsOroc; - fkNPadsIroc=monitor.fkNPadsIroc; - fkNPadsOroc=monitor.fkNPadsOroc; - fkNPadMinIroc=monitor.fkNPadMinIroc; - fkNPadMinOroc=monitor.fkNPadMinOroc; - fkNPadMaxIroc=monitor.fkNPadMaxIroc; - fkNPadMaxOroc=monitor.fkNPadMaxOroc; - fVerb=monitor.fVerb; - fLastEv=monitor.fLastEv; - fEventNumber=monitor.fEventNumber; - fEventNumberOld=monitor.fEventNumberOld; - fDisableFit=monitor.fDisableFit; - fExecGlob=monitor.fExecGlob; - fExecPlaneMax=monitor.fExecPlaneMax; - fExecPadIrocRms=monitor.fExecPadIrocRms; - fExecPadOrocRms=monitor.fExecPadOrocRms; - fRunId=monitor.fRunId; - fEqId=monitor.fEqId; - fPadUsedRoc=monitor.fPadUsedRoc; - fPadUsedHwAddr=monitor.fPadUsedHwAddr; - fGdcId=monitor.fGdcId; - fLdcId=monitor.fLdcId; - fLdcIdOld=monitor.fLdcIdOld; - fMapHand=monitor.fMapHand; - fReaderROOT=monitor.fReaderROOT; - fReaderDATE=monitor.fReaderDATE; - - - fHistList = new TObjArray(); - fHistIROC=(TH2F*)monitor.fHistIROC->Clone(); fHistList->Add(fHistIROC); - fHistOROC=(TH2F*)monitor.fHistOROC->Clone(); fHistList->Add(fHistOROC); - fHistIROCIndex=(TH2S*)monitor.fHistIROCIndex->Clone(); fHistList->Add(fHistIROCIndex); - fHistOROCIndex=(TH2S*)monitor.fHistOROCIndex->Clone(); fHistList->Add(fHistOROCIndex); - fHistIROCTime=(TH2F*)monitor.fHistIROCTime->Clone(); fHistList->Add(fHistIROCTime); - fHistOROCTime=(TH2F*)monitor.fHistOROCTime->Clone(); fHistList->Add(fHistOROCTime); - fHistIROCClone=(TH2F*)monitor.fHistIROCClone->Clone(); fHistList->Add(fHistIROCClone); - fHistOROCClone=(TH2F*)monitor.fHistOROCClone->Clone(); fHistList->Add(fHistOROCClone); - fHistIROCRMS=(TH2F*)monitor.fHistIROCRMS->Clone(); fHistList->Add(fHistIROCRMS); - fHistOROCRMS=(TH2F*)monitor.fHistOROCRMS->Clone(); fHistList->Add(fHistOROCRMS); - fHistIROCBASE=(TH2F*)monitor.fHistIROCBASE->Clone(); fHistList->Add(fHistIROCBASE); - fHistOROCBASE=(TH2F*)monitor.fHistOROCBASE->Clone(); fHistList->Add(fHistOROCBASE); - fHistIROCSUM=(TH2F*)monitor.fHistIROCSUM->Clone(); fHistList->Add(fHistIROCSUM); - fHistOROCSUM=(TH2F*)monitor.fHistOROCSUM->Clone(); fHistList->Add(fHistOROCSUM); - - fHistChannelTime=(TH2F*)monitor.fHistChannelTime->Clone(); fHistList->Add(fHistChannelTime); - - fHistAddrMapIndex=(TH1F*)monitor.fHistAddrMapIndex->Clone(); fHistList->Add(fHistAddrMapIndex); - fHistAddrMaxAdc=(TH1F*)monitor.fHistAddrMaxAdc->Clone(); fHistList->Add(fHistAddrMaxAdc); - fHistAddrBaseMean=(TH1F*)monitor.fHistAddrBaseMean->Clone(); fHistList->Add(fHistAddrBaseMean); - fHistAddrMaxAdcX=(TH1F*)monitor.fHistAddrMaxAdcX->Clone(); fHistList->Add(fHistAddrMaxAdcX); - fHistAddrAdcSum=(TH1F*)monitor.fHistAddrAdcSum->Clone(); fHistList->Add(fHistAddrAdcSum); - fHistAddrBaseRms=(TH1F*)monitor.fHistAddrBaseRms->Clone(); fHistList->Add(fHistAddrBaseRms); - - - fHistDistrSumIROC=(TH1F*)monitor.fHistDistrSumIROC->Clone(); fHistList->Add(fHistDistrSumIROC); - fHistDistrMaxIROC=(TH1F*)monitor.fHistDistrMaxIROC->Clone(); fHistList->Add(fHistDistrMaxIROC); - fHistDistrSumOROC=(TH1F*)monitor.fHistDistrSumOROC->Clone(); fHistList->Add(fHistDistrSumOROC); - fHistDistrMaxOROC=(TH1F*)monitor.fHistDistrMaxOROC->Clone(); fHistList->Add(fHistDistrMaxOROC); - - fHistDistrBase2dIROC=(TH2F*)monitor.fHistDistrBase2dIROC->Clone(); fHistList->Add(fHistDistrBase2dIROC); - fHistDistrBase2dOROC=(TH2F*)monitor.fHistDistrBase2dOROC->Clone(); fHistList->Add(fHistDistrBase2dOROC); - fHistDistrBaseRmsIROC=(TH1D*)monitor.fHistDistrBaseRmsIROC->Clone(); fHistList->Add(fHistDistrBaseRmsIROC); - fHistDistrBaseMeanIROC=(TH1D*)monitor.fHistDistrBaseMeanIROC->Clone(); fHistList->Add(fHistDistrBaseMeanIROC); - fHistDistrBaseRmsOROC=(TH1D*)monitor.fHistDistrBaseRmsOROC->Clone(); fHistList->Add(fHistDistrBaseRmsOROC); - fHistDistrBaseMeanOROC=(TH1D*)monitor.fHistDistrBaseMeanOROC->Clone(); fHistList->Add(fHistDistrBaseMeanOROC); - - fHistGlobalMaxA=(TH2S*)monitor.fHistGlobalMaxA->Clone(); fHistList->Add(fHistGlobalMaxA); - fHistGlobalMaxC=(TH2S*)monitor.fHistGlobalMaxC->Clone(); fHistList->Add(fHistGlobalMaxC); - - fPad = new Int_t*[monitor.GetMaxHwAddr()]; - for(Int_t i = 0; iGetList()) - { - Warning("Build","Current directory is not a valid directory"); - return *this; - } - AliTPCMonitor *hold = (AliTPCMonitor*)gDirectory->GetList()->FindObject(monitor.GetName()); - if(hold) - { - Warning("Build","Replacing existing histogram: %s (Potential memory leak).",monitor.GetName()); - gDirectory->GetList()->Remove(hold); - } - gDirectory->Append(this); - } - fReaderDATEMon=monitor.fReaderDATEMon; + if (!gDirectory->GetList()) + { + Warning("Build","Current directory is not a valid directory"); + return *this; + } + AliTPCMonitor *hold = (AliTPCMonitor*)gDirectory->GetList()->FindObject(monitor.GetName()); + if(hold) + { + Warning("Build","Replacing existing histogram: %s (Potential memory leak).",monitor.GetName()); + gDirectory->GetList()->Remove(hold); + } + gDirectory->Append(this); } + } return *this; } @@ -451,28 +448,28 @@ AliTPCMonitor::~AliTPCMonitor() //____________________________________________________________________________ void AliTPCMonitor::CreateHistos() { - // Create histograms to be displayed - + // Create histograms to be displayed + if(fVerb) cout << " create new ones " << endl; fHistIROC = new TH2F("fHistIROC" ,"fHistIROC" ,fkNRowsIroc,0,fkNRowsIroc,fkNPadsIroc, fkNPadMinIroc, fkNPadMaxIroc); fHistList->Add(fHistIROC); - fHistOROC = new TH2F("fHistOROC" ,"fHistOROC" ,fkNRowsOroc,0,fkNRowsOroc,fkNPadsOroc, fkNPadMinOroc, fkNPadMaxOroc); fHistList->Add(fHistOROC); - + fHistOROC = new TH2F("fHistOROC" ,"fHistOROC" ,fkNRowsOroc,0,fkNRowsOroc,fkNPadsOroc, fkNPadMinOroc, fkNPadMaxOroc); fHistList->Add(fHistOROC); + fHistIROCIndex = new TH2S("fHistIROCIndex" ,"fHistIROCIndex" ,fkNRowsIroc,0,fkNRowsIroc,fkNPadsIroc, fkNPadMinIroc, fkNPadMaxIroc); fHistList->Add(fHistIROCIndex); fHistOROCIndex = new TH2S("fHistOROCIndex" ,"fHistOROCIndex" ,fkNRowsOroc,0,fkNRowsOroc,fkNPadsOroc, fkNPadMinOroc, fkNPadMaxOroc); fHistList->Add(fHistOROCIndex); - + fHistIROCTime = new TH2F("fHistIROCTime" ,"fHistIROCTime" ,fkNRowsIroc,0,fkNRowsIroc,fkNPadsIroc, fkNPadMinIroc, fkNPadMaxIroc); fHistList->Add(fHistIROCTime); fHistOROCTime = new TH2F("fHistOROCTime" ,"fHistOROCTime" ,fkNRowsOroc,0,fkNRowsOroc,fkNPadsOroc, fkNPadMinOroc, fkNPadMaxOroc); fHistList->Add(fHistOROCTime); fHistIROCRMS = new TH2F("fHistIROCRMS" ,"fHistIROCRMS" ,fkNRowsIroc,0,fkNRowsIroc,fkNPadsIroc, fkNPadMinIroc, fkNPadMaxIroc); fHistList->Add(fHistIROCRMS); fHistOROCRMS = new TH2F("fHistOROCRMS" ,"fHistOROCRMS" ,fkNRowsOroc,0,fkNRowsOroc,fkNPadsOroc, fkNPadMinOroc, fkNPadMaxOroc); fHistList->Add(fHistOROCRMS); - + fHistIROCSUM = new TH2F("fHistIROCSUM" ,"fHistIROCSUM" ,fkNRowsIroc,0,fkNRowsIroc,fkNPadsIroc, fkNPadMinIroc, fkNPadMaxIroc); fHistList->Add(fHistIROCSUM); fHistOROCSUM = new TH2F("fHistOROCSUM" ,"fHistOROCSUM" ,fkNRowsOroc,0,fkNRowsOroc,fkNPadsOroc, fkNPadMinOroc, fkNPadMaxOroc); fHistList->Add(fHistOROCSUM); - + fHistIROCBASE = new TH2F("fHistIROCBASE" ,"fHistIROCBASE" ,fkNRowsIroc,0,fkNRowsIroc,fkNPadsIroc, fkNPadMinIroc, fkNPadMaxIroc); fHistList->Add(fHistIROCBASE); fHistOROCBASE = new TH2F("fHistOROCBASE" ,"fHistOROCBASE" ,fkNRowsOroc,0,fkNRowsOroc,fkNPadsOroc, fkNPadMinOroc, fkNPadMaxOroc); fHistList->Add(fHistOROCBASE); - - + + fHistChannelTime = new TH2F("fHistChannelTime" ,"fHistChannelTime" ,GetNumOfChannels(),0,GetNumOfChannels(),GetTimeBins(),0,GetTimeBins());fHistList->Add(fHistChannelTime); fHistAddrMapIndex = new TH1F("fHistAddrMapIndex" ,"fHistAddrMapIndex" ,GetMaxHwAddr() ,0,GetMaxHwAddr()); fHistList->Add(fHistAddrMapIndex); fHistAddrMaxAdc = new TH1F("fHistAddrMaxAdc" ,"fHistAddrMaxAdc" ,GetMaxHwAddr(),0,GetMaxHwAddr()); fHistList->Add(fHistAddrMaxAdc); @@ -484,7 +481,7 @@ void AliTPCMonitor::CreateHistos() fHistDistrMaxIROC = new TH1F("fHistDistrMaxIROC" ,"fHistDistrMaxIROC" ,500,0.0,1000.0); fHistList->Add(fHistDistrMaxIROC); fHistDistrSumOROC = new TH1F("fHistDistrSumOROC" ,"fHistDistrSumOROC" ,400,0.0,4000.0); fHistList->Add(fHistDistrSumOROC); fHistDistrMaxOROC = new TH1F("fHistDistrMaxOROC" ,"fHistDistrMaxOROC" ,500,0.0,1000.0); fHistList->Add(fHistDistrMaxOROC); - + fHistDistrBase2dIROC = new TH2F("fHistDistrBase2dIROC" ,"fHistDistrBase2dIROC",100,0.0,100.0,100,0.0,10.0); fHistList->Add(fHistDistrBase2dIROC); fHistDistrBase2dOROC = new TH2F("fHistDistrBase2dOROC" ,"fHistDistrBase2dOROC",100,0.0,100.0,100,0.0,10.0); fHistList->Add(fHistDistrBase2dOROC); @@ -500,15 +497,15 @@ Int_t AliTPCMonitor::ProcessEvent() // Depending on the value of the sector id all sectors (sectorid == -1) are processed. // // In this case only the maximum values are calculated per pad and filled to the global histograms - // In a second loop the last processed(displayed) sector will be processed (sectorid!=-1) + // In a second loop the last processed(displayed) sector will be processed (sectorid!=-1) // again and the baseline rms and further quantities are calculated // // If only one sector should be processed SetProcOneSector(1) should be set. // In this case only the specified (last/last displayed) sector will be processed. // // If GetProcNextEvent()==0 the same event will be processed again - - + + Int_t sectorid = 0; Int_t retflag = 0; // id of last sector + 1000, or error flag if(GetProcNextEvent()==1 && fLastEv) { AliInfo("Last event already processed"); } @@ -518,8 +515,8 @@ Int_t AliTPCMonitor::ProcessEvent() if(GetProcNextEvent()==0 || GetProcOneSector()==1 ) sectorid = GetLastSector(); else sectorid = -1; - // first iteration - retflag = ReadData(sectorid); + // first iteration + retflag = ReadDataNew(sectorid); SetLastProcFile(GetFile()); @@ -527,15 +524,15 @@ Int_t AliTPCMonitor::ProcessEvent() DrawHists(3); - // second iteration - if(sectorid==-1 && retflag >1000) - { - AliInfo("Second read cycle"); - SetProcNextEvent(0); - if(GetLastSectorDisplayed()==-1) {sectorid = GetLastSector() ; } - else {sectorid = GetLastSectorDisplayed(); SetLastSector(sectorid) ; } - retflag = ReadData(sectorid); - } + // second iteration + if(sectorid==-1 && retflag >1000) + { + AliInfo("Second read cycle"); + SetProcNextEvent(0); + if(GetLastSectorDisplayed()==-1) {sectorid = GetLastSector() ; } + else {sectorid = GetLastSectorDisplayed(); SetLastSector(sectorid) ; } + retflag = ReadDataNew(sectorid); + } SetLastSectorDisplayed(sectorid) ; fMapHand->ReadfecHwMap(GetLastSector()); @@ -544,517 +541,160 @@ Int_t AliTPCMonitor::ProcessEvent() SetEventProcessed(1); return retflag; } - //__________________________________________________________________ -Int_t AliTPCMonitor::ReadData(Int_t secid) +Int_t AliTPCMonitor::ReadDataNew(Int_t secid) { - // Read Data File/Stream for specified Format. - // Payload will be extracted from either ROOT or DATE format - // and passed to FillHistsDecode for decoding of the adc information - - Int_t format = GetFormat(); - - - //if(format==2 && !gSystem->Getenv("DATE_ROOT")) { AliError("DATE not initialized on this system"); return 11;} - - if( format==0) {return ReadDataROOT(secid);} - else if(format==1) {return ReadDataDATEFile(secid);} - else if(format==2) - { - return ReadDataDATEStream(secid); - } - - AliWarning("Function should already be left"); - return 11; -} -//__________________________________________________________________ -Int_t AliTPCMonitor::ReadDataDATEFile(Int_t secid) -{ - // Read Data in Date format. - // Date file and monitor will be handled in this function. - - if(fReaderROOT) { delete fReaderROOT ; fReaderROOT=0;} - -#ifdef ALI_DATE - if(fReaderDATEMon) { delete fReaderDATEMon ; fReaderDATEMon=0;} -#endif - - Char_t* eventPtr = 0; - AliTPCMonitorDateFormat* dateform = 0; - - // Create objects // - if( fReaderDATE==0 || ( fReaderDATE!=0 && (strcmp(GetLastProcFile(),GetFile())!=0) ) ) - { - cout << " Create new DATE file "<< endl; - if(fReaderDATE) { delete fReaderDATE ; fReaderDATE=0; } - fReaderDATE = new AliTPCMonitorDateFile() ; - fReaderDATE->SetName("fReaderDATE") ; - fReaderDATE->OpenDateFile(GetFile()) ; - fEventNumber =0; - } - - // Get Event pointer /// - if(fReaderDATE->IsDateFileOpen() ==false ) { AliError("Could not open Date File"); return 11 ; } - // Rewind event if new event number is smaller than old one - if(fEventNumberOld>fEventNumber ) { fReaderDATE->ResetFilePos(); } - while(GetProcNextEvent() || fEventNumber==0) - { - fReaderDATE->ReadEvent(); - eventPtr = fReaderDATE->GetMemoryPointer(); - dateform = new AliTPCMonitorDateFormat(eventPtr); - Int_t currentev = dateform->GetEventID(); - if(fEventNumber <= currentev ){ break; } - } - - eventPtr = fReaderDATE->GetMemoryPointer(); - - if(dateform==0) dateform = new AliTPCMonitorDateFormat(eventPtr); - fEventNumber = dateform->GetEventID(); - fEventNumberOld = dateform->GetEventID(); - - if(fReaderDATE->IsLastEvent()) fLastEv =1; - if(dateform->IsEventEndOfRun()) { AliInfo("Event is end of run: eventType END_OF_RUN "); } - - if(fReaderDATE->IsEventValid() == false ) {AliInfo("Skipping Event because invalid"); return 10; } - if(dateform->IsEventPhysicsEvent() == false ) {AliInfo("Skipping Header/event because not Physics event"); return 12; } - - ResetHistos() ; - - Int_t lastrcu = ReadDataDATESubEventLoop(dateform,secid); - - delete dateform; - if(fVerb) cout << " last rcu " << lastrcu << endl; - return lastrcu; -} - - -#ifdef ALI_DATE -//__________________________________________________________________ -Int_t AliTPCMonitor::ReadDataDATEStream(Int_t secid) -{ - // Read Data from DATE stream. - // Can also be used for DATE file. - - - if(fReaderROOT) { delete fReaderROOT ; fReaderROOT=0;} - if(fReaderDATE) { delete fReaderDATE ; fReaderDATE =0; } - - Char_t* eventPtr = 0; - - AliTPCMonitorDateFormat* dateform =0 ; - - // Create objects /// - if((fReaderDATEMon==0 || ( fReaderDATEMon!=0 && (strcmp(GetLastProcFile(),GetFile())!=0) ))) - { - if(fReaderDATEMon!=0) - { - fReaderDATEMon->Logout(); - delete fReaderDATEMon; - } - fReaderDATEMon = new AliTPCMonitorDateMonitor(); - fReaderDATEMon->SetName("DMon"); - Int_t status = fReaderDATEMon->OpenMonitoring(GetFile()); - if(status) { AliError(Form("Could not read event online: Error: %s",fReaderDATEMon->DecodeError(status))); return 11; } - } - - if(GetProcNextEvent()) - { - fReaderDATEMon->Free(); - Int_t status = fReaderDATEMon->GetEvent(); - if(status) { AliError(Form("Could not read event online: Error: %s",fReaderDATEMon->DecodeError(status))); return 11 ;} - //fReaderDATEMon->Logout(); - } - - eventPtr = fReaderDATEMon->GetEventPointerasChar(); - - if(dateform==0) dateform = new AliTPCMonitorDateFormat(eventPtr); - fEventNumber = dateform->GetEventID(); - fEventNumberOld = dateform->GetEventID(); - - if(dateform->IsEventEndOfRun()) { AliInfo("Event is end of run: eventType END_OF_RUN "); } - if(dateform->IsEventPhysicsEvent() == false ) {AliInfo("Skipping Header/event because not Physics event"); return 12; } - - ResetHistos() ; - - Int_t lastrcu = ReadDataDATESubEventLoop(dateform,secid); - - delete dateform; - if(fVerb) cout << " last rcu " << lastrcu << endl; - return lastrcu; -} -#else -//__________________________________________________________________ -Int_t AliTPCMonitor::ReadDataDATEStream(Int_t /*secid*/) -{ - // Read Data from DATE stream. - // Can also be used for DATE file. - // In case DATE is not install - // this method is dummy - - AliError("DATE not initialized on this system"); - return 11; -} -#endif - -Int_t AliTPCMonitor::ReadDataDATESubEventLoop(AliTPCMonitorDateFormat* dateform, Int_t secid) -{ - // Loop over DATE Subevents - - Bool_t exitSubEventLoop = false; - Int_t lastrcuid = 0; - Int_t lasteq = 0; - Int_t start = 1; - Int_t rcupatch = 0; - Char_t* eventPtr = 0; - UInt_t* eventPtrUI = 0; - - fChannelIter =0; - - while(exitSubEventLoop == false) - { - if(start==1) { dateform->GotoSubEventHeader() ; start=0;} - else { dateform->GotoNextSubEventHeader(); } - if(dateform->IsLastSubEventHeader()) exitSubEventLoop = true; - - if(fVerb) cout << " next subevent LDC " << (Int_t)dateform->GetSubEventLDC() << endl; - - lasteq = 0 ; - Int_t neq = 0 ; - - while(lasteq==0) - { - if(neq ==0){ dateform->GotoFirstEquipment();} - else { dateform->GotoNextEquipment();} - - fGdcId = dateform->GetSubEventGDC() ; - fLdcId = dateform->GetSubEventLDC(); - fRunId = dateform->GetEventRunID(); - fEqId = dateform->GetEquipmentID(); - rcupatch = GetRCUPatch(fRunId, fEqId); - lastrcuid = (rcupatch+1000); - neq++; - - if(fLdcIdOld!=fLdcId && fChannelIter!=0) { - if(secid==-1) - { - FillGlobal(GetLastSector()); - ResetArrays(); - fChannelIter =0; - } - else - { - return lastrcuid; - } - } - fLdcIdOld = fLdcId ; - - - if(dateform->IsLastEquipment() != false ) lasteq = 1; - - eventPtr = dateform->GetFirstDataPointer(); - eventPtrUI = (UInt_t *) eventPtr; - Int_t payload = dateform->GetPayloadSize(); // 40Bit words - - if(fVerb)DumpHeader(dateform); - if(fVerb) cout << "Check sector and fEqId " << endl; - - if(fVerb && secid >0 ) - { - cout << "secid : "<< secid << " fEqId "<< fEqId << " equipment 0 form map " << endl; - cout << fMapEqidsSec[secid][0] << endl; - cout << " showed map_eqids " << endl; - } - - if(CheckEqId(secid,fEqId)) - { - if(fVerb) cout << " init altro " << endl; - AliTPCMonitorAltro* altro = new AliTPCMonitorAltro((UInt_t *)eventPtrUI,(payload/4),1); //hier - altro->SetWrite10Bit(GetWrite10Bit()); - altro->SetActFilename(GetFile()); - if(fVerb) cout << " allocated 10bit " << endl; - altro->Allocate10BitArray(); - altro->Decodeto10Bit(fEqId); - AliInfo(Form("Process eqid %i , patch %i ",fEqId,rcupatch%6)); - FillHistsDecode(altro,(rcupatch%6),secid); - if(fChannelIter!=0 && secid==-1 ) SetSectorFilled(rcupatch/6); - delete altro; - }// if(CheckID) - }// while last eq - SetLastSector(rcupatch/6); - } - if(fChannelIter!=0 && secid==-1){ FillGlobal(GetLastSector()); } - return lastrcuid; - -} -//__________________________________________________________________ -Int_t AliTPCMonitor::ReadDataROOT(Int_t secid) -{ - // Read in data in ROOT format - if(fReaderDATE){ delete fReaderDATE ; fReaderDATE=0;} - fChannelIter =0; - Int_t lastrcuid = 0; - Int_t rcupatch = 0; - Int_t equipmentSize = 0; - UChar_t* eventPtr = 0 ; - UInt_t* eventPtrUI = 0 ; - Int_t evtype = 0; - - if(fReaderROOT==0 || ( fReaderROOT!=0 && (strcmp(GetLastProcFile(),GetFile())!=0) ) ) - { - if(fVerb) cout << "AliTPCMonitor::ReadDataROOT create new reader " << endl; - if(fReaderROOT) { delete fReaderROOT ; fReaderROOT=0; } - fReaderROOT = new AliRawReaderRoot(GetFile()); - if(!fReaderROOT) { AliError("Could not initiate AliRawReaderRoo "); return 10;} - fEventNumber=0; - } - - // reset to beginning of the event - fReaderROOT->Reset(); + // Read Data File/Stream for specified Format. + // Payload will be extracted from either ROOT or DATE format + // and passed to FillHistsDecode for decoding of the adc information + + if (!fRawReader){ + fRawReader = AliRawReader::Create(GetFile()); + SetLastProcFile(GetFile()); + } else if (strcmp(GetLastProcFile(),GetFile())!=0){ + delete fRawReader; + fRawReader = AliRawReader::Create(GetFile()); +// printf("New file!!!\n"); + SetLastProcFile(GetFile()); + } - // Rewind event if new event number is smaller than old one - if(fEventNumberOld>fEventNumber) fReaderROOT->RewindEvents(); + if (!fRawReader){ + AliWarning("Coult not initialize raw reader"); + return 11; + } - while(GetProcNextEvent() || fEventNumber==0) + Bool_t skip=kTRUE; + while(skip && GetProcNextEvent()) { - if(fVerb) cout << "AliTPCMonitor::ReadDataROOT get event " << endl; - if(!fReaderROOT->NextEvent()) { AliError("Could not get next Event"); return 11 ;} -// Int_t currentev = *(fReaderROOT->GetEventId()); - //!! think about - Int_t currentev=fReaderROOT->GetEventIndex(); -// break; - // skip all events but physics, calibration and software trigger events! - UInt_t eventType=fReaderROOT->GetType(); + if(fVerb) cout << "AliTPCMonitor::ReadDataNew get event " << endl; + if(!fRawReader->NextEvent()) { AliError("Could not get next Event"); return 11 ;} + // skip all events but physics, calibration and software trigger events! + UInt_t eventType=fRawReader->GetType(); if ( !(eventType==AliRawEventHeaderBase::kPhysicsEvent || eventType==AliRawEventHeaderBase::kCalibrationEvent || eventType==AliRawEventHeaderBase::kSystemSoftwareTriggerEvent || eventType==AliRawEventHeaderBase::kDetectorSoftwareTriggerEvent) ) { - if (fVerb) cout<< "Skipping event! Its neither of 'physics, calibration and software trigger event'" << endl; - continue; + if (fVerb) cout<< "Skipping event! Its neither of 'physics, calibration and software trigger event'" << endl; + continue; } - if(fEventNumber <= currentev ){ break; } + skip=kFALSE; + fEventNumber = fRawReader->GetEventIndex(); + fEventNumberOld = fRawReader->GetEventIndex(); } -// fEventNumber = *(fReaderROOT->GetEventId()); -// fEventNumberOld = *(fReaderROOT->GetEventId()); - fEventNumber = fReaderROOT->GetEventIndex(); - fEventNumberOld = fReaderROOT->GetEventIndex(); +// printf("secid: %d\n",secid); - ResetHistos() ; + //========================== Histogram filling ====================== + ResetHistos() ; + AliAltroRawStreamV3 *altro=new AliAltroRawStreamV3(fRawReader); + altro->SelectRawData("TPC"); + altro->Reset(); + fChannelIter=0; - while(fReaderROOT->ReadHeader()) - { - if(fVerb) cout << "AliTPCMonitor::ReadDataROOT read header " << endl; - fGdcId = fReaderROOT->GetGDCId() ; - fLdcId = fReaderROOT->GetLDCId() ; - fRunId = fReaderROOT->GetRunNumber() ; - equipmentSize = fReaderROOT->GetEquipmentSize(); - fEqId = fReaderROOT->GetEquipmentId(); - evtype = fReaderROOT->GetType(); - rcupatch = GetRCUPatch(fRunId, fEqId); - lastrcuid = (rcupatch+1000); - - if(evtype==1) { AliWarning(Form("EventType==1 in event %i ",fEventNumber)); return 10; } - if(equipmentSize==0) { AliWarning(Form("Equipmentsize ==0 in event %i ",fEventNumber)); return 10; } - - if(fVerb) DumpHeader(fReaderROOT); - - if(fLdcIdOld!=fLdcId && fChannelIter!=0) { - if(secid==-1) - { - FillGlobal(GetLastSector()); - ResetArrays(); - fChannelIter =0; - } - else - { - return lastrcuid; - } - } - fLdcIdOld = fLdcId ; - - if(CheckEqId(secid,fEqId)) - { - fReaderROOT->ReadNextData(eventPtr); - eventPtrUI = (UInt_t *) eventPtr; - Int_t offset = 16; - Int_t fsize = (Int_t)((equipmentSize/4) -offset) +1; - AliTPCMonitorAltro* altro = new AliTPCMonitorAltro((UInt_t *)eventPtrUI,fsize,2); - altro->SetWrite10Bit(GetWrite10Bit()); - if(fVerb) cout << "AliTPCMonitor::ReadDataROOT Set Write10bit to " << GetWrite10Bit() << endl; - altro->SetActFilename(GetFile()); - altro->Allocate10BitArray(); - altro->Decodeto10Bit(fEqId); - AliInfo(Form("Process sector %i eqid %i , patch %i ",rcupatch/6,fEqId,rcupatch%6)); - FillHistsDecode(altro,(rcupatch%6),secid); - if(fChannelIter!=0 && secid==-1 ) SetSectorFilled(rcupatch/6); - delete altro; - } - SetLastSector(rcupatch/6); - } - if(fChannelIter!=0 && secid==-1) { FillGlobal(GetLastSector()); } - return lastrcuid; -} - - -//____________________________________________________________________________ -void AliTPCMonitor::FillHistsDecode(AliTPCMonitorAltro* altro ,Int_t rcupatch, Int_t secid) -{ - // Decode Channels, calculate base mean and rms depending on the - // value of secid (see ProcessEvent) and fill histograms - - - if(fVerb) cout << "FillHistsDecode : rcupatch " << rcupatch << " id " << secid << endl; - Int_t timestamp = 0; - Int_t sampleiter = 0; - Int_t samplelength = 0; - Int_t samplebins = 0; - Float_t max = 0; - Float_t maxx = 0; - Float_t sum = 0.0; - Int_t sumn = 0; - Int_t blockpos = 0; Int_t hw = 0; - Int_t nwords = 0; Int_t nextHwAddress = 0; - Int_t ntime = 0; - Int_t adc = 0; - Int_t nextpos = 0; - Int_t lastpos = altro->Get10BitArraySize()-1; - Short_t* entries = altro->Get10BitArray(); - Double_t hrms = 0.0; - Double_t hmean = 0.0; - Int_t supnextpos = 0; -// TH1D* hbase = new TH1D("hbase","hbase",GetTimeBins(),0.5,(GetTimeBins()+0.5)); - Float_t fbase[1000]; - - - while(lastpos>0) - { - nextpos = altro->DecodeTrailer(lastpos); - supnextpos = altro->GetNextTrailerPos(); - if(nextpos==-1) { break; } - Int_t itimebin=0; //timebins in this pad - - lastpos = nextpos; - blockpos = altro->GetTrailerBlockPos(); - hw = altro->GetTrailerHwAddress(); - nwords = altro->GetTrailerNWords(); - nextHwAddress = ( hw + (rcupatch<<12) ); - fPad[fChannelIter][0] = nextHwAddress ; - - if(fPadMapHw[nextHwAddress]!=-1 ) + Int_t rcupatch = 0; + Int_t maxADC = 0; + Int_t maxx = 0; + Int_t sum = 0; + Int_t sumn = 0; + Int_t lastrcuid = 0; + + while ( altro->NextDDL() ){ + fGdcId = fRawReader->GetGDCId() ; + fLdcId = fRawReader->GetLDCId() ; + fRunId = fRawReader->GetRunNumber() ; + fEqId = fRawReader->GetEquipmentId(); + rcupatch = GetRCUPatch(fRunId, fEqId); + Int_t rcupatchSector=rcupatch%6; + lastrcuid = (rcupatch+1000); +// printf("RCU patch: %d, LDC: %d, EqId: %d\n",rcupatch, fLdcId, fEqId); + if(fLdcIdOld!=fLdcId && fChannelIter!=0) { + if(secid==-1) { - //Int_t hw_before1 = fPad[fChannelIter-2][0]; - //Int_t hw_before2 = fPad[fChannelIter-3][0]; - - if(fVerb){ cout <<"\n //// Ambiguous hwaddress " << nextHwAddress << " write 10bit files and check file for eqid : " << fEqId << " /////// " << endl;} - continue; - - if( TMath::Abs(fPadMapRCU[nextHwAddress][4] - fChannelIter)==1) - { - if(fVerb) cout << "//// Difference to previous channel==1 : reset branch bit of hw from last channel to 1 " << endl; - Int_t hwreset = (nextHwAddress + (1<<11)); - fPad[fChannelIter-1][0] = hwreset; - - fPadMapHw[hwreset] = fChannelIter-1 ; - fPadMapRCU[hwreset][0]= rcupatch ; - fPadMapRCU[hwreset][1]= ((hwreset & AliTPCMonitorAltro::GetHwMaskBranch()) >> 11); - fPadMapRCU[hwreset][2]= ((hwreset & AliTPCMonitorAltro::GetHwMaskFEC()) >>7 ); - fPadMapRCU[hwreset][3]= ( hwreset & AliTPCMonitorAltro::GetHwMaskFECChannel() ); - fPadMapRCU[hwreset][4]= fChannelIter-1; - fPadMapRCU[hwreset][5]= altro->GetTrailerPos(); - } - } - + FillGlobal(GetLastSector()); + ResetArrays(); +// printf("filled sector: %d\n",GetLastSector()); + fChannelIter =0; + } + else + { + return lastrcuid; +// if (rcupatch/6!=secid) continue; + } +// fChannelIter=0; + } + if (!CheckEqId(secid,fEqId)) continue; + while ( altro->NextChannel() ){ + hw=altro->GetHWAddress(); + nextHwAddress = ( hw + (rcupatchSector<<12) ); + fPad[fChannelIter][0] = nextHwAddress ; fPadMapHw[nextHwAddress] = fChannelIter ; - fPadMapRCU[nextHwAddress][0]= rcupatch ; - fPadMapRCU[nextHwAddress][1]= ((nextHwAddress & AliTPCMonitorAltro::GetHwMaskBranch())>> 11) ; - fPadMapRCU[nextHwAddress][2]= ((nextHwAddress & AliTPCMonitorAltro::GetHwMaskFEC()) >>7); - fPadMapRCU[nextHwAddress][3]= (nextHwAddress & AliTPCMonitorAltro::GetHwMaskFECChannel()); - fPadMapRCU[nextHwAddress][4]= fChannelIter; - fPadMapRCU[nextHwAddress][5]= altro->GetTrailerPos(); - - timestamp = 0; - sampleiter = 0; - samplelength = 0; - samplebins = 0; - - max = 0.0; - maxx = 0.0; - sum = 0.0; - sumn = 0; - -// hbase->Reset(); - - for(Int_t iterwords = 0 ; iterwords< nwords ; iterwords++) - { - if(entries[blockpos-iterwords]==682) { continue; } - if(entries[blockpos-iterwords]!=682 && sampleiter==0) - { - samplelength = entries[blockpos-iterwords]; - sampleiter = samplelength; - samplebins = 0; - timestamp = entries[blockpos-iterwords-1]; - iterwords++; - sampleiter-=2; - } - else - { - ntime = timestamp-samplebins; - adc = entries[blockpos-iterwords]; - fPad[fChannelIter][ntime] = adc; -//if( (adc!=0) && (ntime>=GetRangeBaseMin() ) && (ntimeFill(adc) ;} - if( (adc!=0) && (ntime>=GetRangeBaseMin() ) && (ntimemax) && (ntime>=GetRangeMaxAdcMin()) && (ntime=GetRangeSumMin()) && (ntimeGetMean(); -// hbase->GetXaxis()->SetRangeUser(hmean- hmean/3 , hmean + hmean/3); -// hmean = hbase->GetMean(); -// hrms = hbase->GetRMS(); - if (itimebin>0){ - hmean = TMath::Mean(itimebin, fbase); - hrms = TMath::RMS(itimebin, fbase); - } - - if( GetPedestals()==1) fHistAddrMaxAdc->SetBinContent( nextHwAddress,max- hmean); - else fHistAddrMaxAdc->SetBinContent( nextHwAddress,max ); + maxADC=0; + while ( altro->NextBunch() ){ + Int_t startTbin = (Int_t)altro->GetStartTimeBin(); + Int_t bunchlength = (Int_t)altro->GetBunchLength(); + const UShort_t *sig = altro->GetSignals(); + for (Int_t iTimeBin = 0; iTimeBinmaxADC) && (ntime>=GetRangeMaxAdcMin()) && (ntime=GetRangeSumMin()) && (ntimeSetBinContent(nextHwAddress,maxADC-GetPedestals()*pedestal); if(secid!=-1) - { - if(rcupatch<2) - { - fHistDistrBase2dIROC->Fill(hmean,hrms); - fHistDistrSumIROC->Fill(sum); - if( GetPedestals()==1 ) { fHistDistrMaxIROC->Fill(max-hmean); fHistDistrSumIROC->Fill(sum -sumn*hmean);} - else { fHistDistrMaxIROC->Fill(max); fHistDistrSumIROC->Fill(sum );} - } - else - { - fHistDistrBase2dOROC->Fill(hmean,hrms); - fHistDistrSumOROC->Fill(sum); - if( GetPedestals()==1 ){ fHistDistrMaxOROC->Fill(max-hmean); fHistDistrSumOROC->Fill(sum -sumn*hmean);} - else { fHistDistrMaxOROC->Fill(max); fHistDistrSumOROC->Fill(sum) ;} - } - - fHistAddrAdcSum->SetBinContent( nextHwAddress,sum); - fHistAddrMapIndex->SetBinContent(nextHwAddress,fChannelIter); - fHistAddrBaseMean->SetBinContent(nextHwAddress,hmean); - fHistAddrMaxAdcX->SetBinContent( nextHwAddress,maxx); - fHistAddrBaseRms->SetBinContent( nextHwAddress,hrms); - } - fChannelIter++; - if(nextpos<0) { AliError("Error : next pos < 0 "); break ;} + { + if(rcupatchSector<2) + { + fHistDistrBase2dIROC->Fill(pedestal,noise); + fHistDistrSumIROC->Fill(sum); + fHistDistrMaxIROC->Fill(maxADC-pedestal*GetPedestals()); + fHistDistrSumIROC->Fill(sum -sumn*pedestal*GetPedestals()); + } + else + { + fHistDistrBase2dOROC->Fill(pedestal,noise); + fHistDistrSumOROC->Fill(sum); + fHistDistrMaxOROC->Fill(maxADC-pedestal*GetPedestals()); + fHistDistrSumOROC->Fill(sum -sumn*pedestal*GetPedestals()); + } + + fHistAddrAdcSum->SetBinContent( nextHwAddress,sum); + fHistAddrMapIndex->SetBinContent(nextHwAddress,fChannelIter); + fHistAddrBaseMean->SetBinContent(nextHwAddress,pedestal); + fHistAddrMaxAdcX->SetBinContent( nextHwAddress,maxx); + fHistAddrBaseRms->SetBinContent( nextHwAddress,noise); + } + + ++fChannelIter; } -// delete hbase; - return ; + SetLastSector(rcupatch/6); + if(fChannelIter!=0 && secid==-1 ) SetSectorFilled(rcupatch/6); + fLdcIdOld = fLdcId ; + } + delete altro; + if(fChannelIter!=0 && secid==-1) { FillGlobal(GetLastSector());} + return lastrcuid; } + + + + + + + + + //____________________________________________________________________________ void AliTPCMonitor::FillHistsPadPlane() { @@ -1062,45 +702,45 @@ void AliTPCMonitor::FillHistsPadPlane() if(fVerb)cout << "AliTPCMonitor::FillHistsPadPlane() Start " << endl; if(fVerb)PrintConfig(); - + Int_t pad = 0; Int_t row = 0; Int_t padmax = 0; Int_t hwadd = 0; - for(Int_t ch = 0; chSetCellContent(ch,0,hwadd); + + for(Int_t bin = 1; bin SetCellContent(ch,0,hwadd); - - for(Int_t bin = 1; bin GetCellContent(ch,bin)!=0) cout << " cellcontent already set " << endl; - if( GetPedestals()==1 ) fHistChannelTime->SetCellContent(ch,bin,(fPad[ch][bin]- fHistAddrBaseMean->GetBinContent(hwadd))); - else fHistChannelTime->SetCellContent(ch,bin,(fPad[ch][bin])); - } - - pad = fMapHand->GetPad( hwadd); - row = fMapHand->GetPadRow(hwadd); - padmax = fMapHand->GetNumofPads(row); - - if(row<63) - { - fHistIROC->SetCellContent( row +1 ,pad +55 -padmax/2 +1,fHistAddrMaxAdc->GetBinContent( hwadd)); - fHistIROCIndex->SetCellContent(row +1 ,pad +55 -padmax/2 +1,ch); - fHistIROCRMS->SetCellContent( row +1 ,pad +55 -padmax/2 +1,fHistAddrBaseRms->GetBinContent( hwadd)); - fHistIROCBASE->SetCellContent( row +1 ,pad +55 -padmax/2 +1,fHistAddrBaseMean->GetBinContent(hwadd)); - fHistIROCSUM->SetCellContent( row +1 ,pad +55 -padmax/2 +1,fHistAddrAdcSum->GetBinContent( hwadd)); - } - else - { - fHistOROC->SetCellContent( row-63 +1 ,pad +70 -padmax/2 +1,fHistAddrMaxAdc->GetBinContent( hwadd)); - fHistOROCIndex->SetCellContent(row-63 +1 ,pad +70 -padmax/2 +1,ch); - fHistOROCRMS->SetCellContent( row-63 +1 ,pad +70 -padmax/2 +1,fHistAddrBaseRms->GetBinContent( hwadd)); - fHistOROCBASE->SetCellContent( row-63 +1 ,pad +70 -padmax/2 +1,fHistAddrBaseMean->GetBinContent(hwadd)); - fHistOROCSUM->SetCellContent( row-63 +1 ,pad +70 -padmax/2 +1,fHistAddrAdcSum->GetBinContent( hwadd)); - } + if( fHistChannelTime->GetCellContent(ch,bin)!=0) cout << " cellcontent already set " << endl; + if( GetPedestals()==1 ) fHistChannelTime->SetCellContent(ch,bin,(fPad[ch][bin]- fHistAddrBaseMean->GetBinContent(hwadd))); + else fHistChannelTime->SetCellContent(ch,bin,(fPad[ch][bin])); + } + + pad = fMapHand->GetPad( hwadd); + row = fMapHand->GetPadRow(hwadd); + padmax = fMapHand->GetNumofPads(row); + + if(row<63) + { + fHistIROC->SetCellContent( row +1 ,pad +55 -padmax/2 +1,fHistAddrMaxAdc->GetBinContent( hwadd)); + fHistIROCIndex->SetCellContent(row +1 ,pad +55 -padmax/2 +1,ch); + fHistIROCRMS->SetCellContent( row +1 ,pad +55 -padmax/2 +1,fHistAddrBaseRms->GetBinContent( hwadd)); + fHistIROCBASE->SetCellContent( row +1 ,pad +55 -padmax/2 +1,fHistAddrBaseMean->GetBinContent(hwadd)); + fHistIROCSUM->SetCellContent( row +1 ,pad +55 -padmax/2 +1,fHistAddrAdcSum->GetBinContent( hwadd)); + } + else + { + fHistOROC->SetCellContent( row-63 +1 ,pad +70 -padmax/2 +1,fHistAddrMaxAdc->GetBinContent( hwadd)); + fHistOROCIndex->SetCellContent(row-63 +1 ,pad +70 -padmax/2 +1,ch); + fHistOROCRMS->SetCellContent( row-63 +1 ,pad +70 -padmax/2 +1,fHistAddrBaseRms->GetBinContent( hwadd)); + fHistOROCBASE->SetCellContent( row-63 +1 ,pad +70 -padmax/2 +1,fHistAddrBaseMean->GetBinContent(hwadd)); + fHistOROCSUM->SetCellContent( row-63 +1 ,pad +70 -padmax/2 +1,fHistAddrAdcSum->GetBinContent( hwadd)); } + } fHistChannelTime->GetXaxis()->SetRange(0,fChannelIter); fHistChannelTime->GetYaxis()->SetRange(0,GetTimeBins()); @@ -1111,49 +751,49 @@ void AliTPCMonitor::FillHistsPadPlane() //____________________________________________________________________________ void AliTPCMonitor::ResetArrays() { - // Reset data arrays - for(Int_t row = 0 ; row < fkNRowsIroc; row++) + // Reset data arrays + for(Int_t row = 0 ; row < fkNRowsIroc; row++) + { + for(Int_t pad = 0 ; pad < fkNPadsIroc ; pad++) { - for(Int_t pad = 0 ; pad < fkNPadsIroc ; pad++) - { - fHistIROCIndex->SetCellContent(row+1,pad+1,-1); - } + fHistIROCIndex->SetCellContent(row+1,pad+1,-1); } - for(Int_t row = 0 ; row < fkNRowsOroc; row++) + } + for(Int_t row = 0 ; row < fkNRowsOroc; row++) + { + for(Int_t pad = 0 ; pad < fkNPadsOroc ; pad++) { - for(Int_t pad = 0 ; pad < fkNPadsOroc ; pad++) - { - fHistOROCIndex->SetCellContent(row+1,pad+1,-1); - } + fHistOROCIndex->SetCellContent(row+1,pad+1,-1); } + } - for(Int_t ch= 0; chSetBinContent(ch,-1); - fHistAddrMapIndex->SetBinContent(ch,-1); - fHistAddrMaxAdc->SetBinContent( ch, 0); - fHistAddrBaseMean->SetBinContent( ch, 0); - fHistAddrAdcSum->SetBinContent( ch, 0); - fHistAddrBaseRms->SetBinContent(ch, 0); - } + for(Int_t ch= 0; chSetBinContent(ch,-1); + fHistAddrMapIndex->SetBinContent(ch,-1); + fHistAddrMaxAdc->SetBinContent( ch, 0); + fHistAddrBaseMean->SetBinContent( ch, 0); + fHistAddrAdcSum->SetBinContent( ch, 0); + fHistAddrBaseRms->SetBinContent(ch, 0); + } for(Int_t ch = 0; ch< GetNumOfChannels(); ch++) + { + for(Int_t bin = 0; bin< GetTimeBins(); bin++) { - for(Int_t bin = 0; bin< GetTimeBins(); bin++) - { - fPad[ch][bin] = 0; - } - } - for(Int_t ch = 0; ch< GetMaxHwAddr(); ch++) - { - fPadMapHw[ch]=-1; - fPadMapRCU[ch][0]=-1; - fPadMapRCU[ch][1]=-1; - fPadMapRCU[ch][2]=-1; - fPadMapRCU[ch][3]=-1; - fPadMapRCU[ch][4]=-1; - fPadMapRCU[ch][5]=-1; + fPad[ch][bin] = 0; } + } + for(Int_t ch = 0; ch< GetMaxHwAddr(); ch++) + { + fPadMapHw[ch]=-1; + fPadMapRCU[ch][0]=-1; + fPadMapRCU[ch][1]=-1; + fPadMapRCU[ch][2]=-1; + fPadMapRCU[ch][3]=-1; + fPadMapRCU[ch][4]=-1; + fPadMapRCU[ch][5]=-1; + } fPadUsedHwAddr=-1; } @@ -1161,60 +801,60 @@ void AliTPCMonitor::ResetArrays() //____________________________________________________________________________ void AliTPCMonitor::ResetHistos() { - // Reset all but + // Reset all but for(Int_t i =0; iGetEntries(); i++) - { - if(GetProcNextEvent()==0 && strcmp(((TH1*)fHistList->At(i))->GetName(),"SIDE A")==0) continue; - if(GetProcNextEvent()==0 && strcmp(((TH1*)fHistList->At(i))->GetName(),"SIDE C")==0) continue; - ((TH1*)fHistList->At(i))->Reset(); - } + { + if(GetProcNextEvent()==0 && strcmp(((TH1*)fHistList->At(i))->GetName(),"SIDE A")==0) continue; + if(GetProcNextEvent()==0 && strcmp(((TH1*)fHistList->At(i))->GetName(),"SIDE C")==0) continue; + ((TH1*)fHistList->At(i))->Reset(); + } ResetArrays(); } //____________________________________________________________________________ void AliTPCMonitor::DeleteHistos() { - // Delete histograms + // Delete histograms for(Int_t i =0; iGetEntries(); i++) - { - delete (TH1*)fHistList->At(i); - } + { + delete (TH1*)fHistList->At(i); + } } //__________________________________________________________________ Int_t AliTPCMonitor::CheckEqId(Int_t secid,Int_t eqid) { - // Check if equipment id corresponds to any rcu patch in sector + // Check if equipment id corresponds to any rcu patch in sector // Equipment ids changed during commisioning in 2006 (starting from run 704) // However Runids started from 0 again in 2007 // Now only runids from commissioning in 2006 after runid 704 and all new ones are supported. // Comment in equipment check for runids < 704 if old runs should be processed - + if(fVerb) cout << "AliTPCMonitor::CheckEqId : SectorId " << secid << " EquipmentId " << eqid << " runid " << fRunId << endl; Int_t passed =1; //skip all eqids which do not belong to the TPC if ( eqid<768||eqid>983 ) return 0; // if(fRunId<704 && 0) // commented out --> runs with runid < 704 in 2006 are not recognized anymore + { + if( (secid>-1) && (secid<36) ) // if ( secid is in range) { take only specific eqids} else { take all } { - if( (secid>-1) && (secid<36) ) // if ( secid is in range) { take only specific eqids} else { take all } - { - if( (secid==13) && ( eqid!=408 && eqid!=409 && eqid!=509 && eqid!=512 && eqid!=513 && eqid!=517 )) {passed=0;} - else if( (secid==4) && ( eqid!=404 && eqid!=504 && eqid!=407 && eqid!=503 && eqid!=508 && eqid!=506 )) {passed=0;} - } - else {if(fVerb) cout << "passed check "<< endl; } + if( (secid==13) && ( eqid!=408 && eqid!=409 && eqid!=509 && eqid!=512 && eqid!=513 && eqid!=517 )) {passed=0;} + else if( (secid==4) && ( eqid!=404 && eqid!=504 && eqid!=407 && eqid!=503 && eqid!=508 && eqid!=506 )) {passed=0;} } + else {if(fVerb) cout << "passed check "<< endl; } + } else + { + if( (secid>-1) && (secid<36) ) // if ( secid is in range) { take only specific eqids} else { take all } { - if( (secid>-1) && (secid<36) ) // if ( secid is in range) { take only specific eqids} else { take all } - { - if(eqid!=fMapEqidsSec[secid][0] && eqid!= fMapEqidsSec[secid][1] && eqid!=fMapEqidsSec[secid][2] && - eqid!=fMapEqidsSec[secid][3] && eqid!= fMapEqidsSec[secid][4] && eqid!=fMapEqidsSec[secid][5] ) {passed=0;} - } - else {if(fVerb) cout << "passed check "<< endl;} + if(eqid!=fMapEqidsSec[secid][0] && eqid!= fMapEqidsSec[secid][1] && eqid!=fMapEqidsSec[secid][2] && + eqid!=fMapEqidsSec[secid][3] && eqid!= fMapEqidsSec[secid][4] && eqid!=fMapEqidsSec[secid][5] ) {passed=0;} } - + else {if(fVerb) cout << "passed check "<< endl;} + } + return passed; } @@ -1222,30 +862,30 @@ Int_t AliTPCMonitor::CheckEqId(Int_t secid,Int_t eqid) void AliTPCMonitor::SetEqIds() { // Set mapping for equipment ids - for(Int_t i = 0; i<36 ; i++) - { - for(Int_t j = 0; j<6; j++) - { - if(j<2) fMapEqidsSec[i][j]= 768+i*2+j; - else fMapEqidsSec[i][j]= 840+i*4+j-2; - } + for(Int_t i = 0; i<36 ; i++) + { + for(Int_t j = 0; j<6; j++) + { + if(j<2) fMapEqidsSec[i][j]= 768+i*2+j; + else fMapEqidsSec[i][j]= 840+i*4+j-2; } + } for(Int_t i = 0; i<36 ; i++) - { - for(Int_t j = 0; j<6; j++) - { - if(j<2) fMapEqidsRcu[768+i*2+j] = i*6 +j; - else fMapEqidsRcu[840+i*4+j-2] = i*6 +j; - } + { + for(Int_t j = 0; j<6; j++) + { + if(j<2) fMapEqidsRcu[768+i*2+j] = i*6 +j; + else fMapEqidsRcu[840+i*4+j-2] = i*6 +j; } + } } //__________________________________________________________________ void AliTPCMonitor::FillGlobal(Int_t sector) { - - // Fill global histograms with max adc for each channel + + // Fill global histograms with max adc for each channel TH2S* hglob =0; if((sector/18) ==0) hglob = fHistGlobalMaxA; @@ -1271,22 +911,22 @@ void AliTPCMonitor::FillGlobal(Int_t sector) Float_t xdr = 0; Float_t ydr = 0; - for(Int_t hw = 0; hwGetNbinsX(); hw++) + for(Int_t hw = 0; hwGetNbinsX(); hw++) + { + max = (Int_t)fHistAddrMaxAdc->GetBinContent(hw); + if(max!=-1) { - max = (Int_t)fHistAddrMaxAdc->GetBinContent(hw); - if(max!=-1) - { - pad = fMapHand->GetPad( hw); - row = fMapHand->GetPadRow(hw); - padmax = fMapHand->GetNumofPads(row); - if (sector%36>17) fMirror=-1; - else fMirror=1; - GetXY(xval ,yval , padmax,row ,pad); - xdr = xval*m11 +yval*m12; - ydr = xval*m21 +yval*m22; - if(hglob->GetBinContent(hglob->GetXaxis()->FindBin(xdr),hglob->GetYaxis()->FindBin(ydr))==0) hglob->Fill(xdr,ydr,(Int_t)max); - } + pad = fMapHand->GetPad( hw); + row = fMapHand->GetPadRow(hw); + padmax = fMapHand->GetNumofPads(row); + if (sector%36>17) fMirror=-1; + else fMirror=1; + GetXY(xval ,yval , padmax,row ,pad); + xdr = xval*m11 +yval*m12; + ydr = xval*m21 +yval*m22; + if(hglob->GetBinContent(hglob->GetXaxis()->FindBin(xdr),hglob->GetYaxis()->FindBin(ydr))==0) hglob->Fill(xdr,ydr,(Int_t)max); } + } } @@ -1295,17 +935,17 @@ void AliTPCMonitor::GetXY( Double_t& xval , Double_t& yval , Int_t padmax, Int_t { // Get x and y position of pad - if(row<63) - { - xval = fMirror*( 2*padmax -4*pad -2); - yval = 852.25 +7.5*row; - } - else - { - xval = fMirror*( 3*padmax -6*pad -3); - if((row-63)<63) { yval = 10*(row-63) +1351; } - else { yval = 15*(row-63-64)+1993.5; } - } + if(row<63) + { + xval = fMirror*( 2*padmax -4*pad -2); + yval = 852.25 +7.5*row; + } + else + { + xval = fMirror*( 3*padmax -6*pad -3); + if((row-63)<63) { yval = 10*(row-63) +1351; } + else { yval = 15*(row-63-64)+1993.5; } + } } @@ -1326,9 +966,9 @@ Int_t AliTPCMonitor::GetPadAtX(Float_t xval, Int_t row, Int_t padmax) const //__________________________________________________________________ Int_t AliTPCMonitor::GetPadAtX(Float_t xval, Int_t row) const { - + // Get pad number at given position in x - + Int_t padmax = fMapHand->GetNumofPads(row); Int_t pad = 0; @@ -1343,14 +983,14 @@ Int_t AliTPCMonitor::GetPadAtX(Float_t xval, Int_t row) const //__________________________________________________________________ void AliTPCMonitor::DrawHists(Int_t histos) { - + // Draw sets of histograms // histos==1 : 2Dim histos for MAX adc and add executables - // histos==2 : distributions max/rms/sum + // histos==2 : distributions max/rms/sum // histos==3 : global max adc for specified SideA/C - - - if(fVerb) cout << " Draw histos " << endl; + + + if(fVerb) cout << " Draw histos " << endl; Char_t cside[10]; if(GetLastSector()/18==0 ) sprintf(cside,"A"); else sprintf(cside,"C"); @@ -1365,221 +1005,221 @@ void AliTPCMonitor::DrawHists(Int_t histos) Char_t titleBASE[256]; sprintf(titleBASE ,"Baseline RMS<->Mean (timebin: %i-%i) %s" ,GetRangeBaseMin() ,GetRangeBaseMax() ,titleSEC); Char_t titleMEAN[256]; sprintf(titleMEAN ,"Baseline Mean (timebin: %i-%i) %s" ,GetRangeBaseMin() ,GetRangeBaseMax() ,titleSEC); Char_t titleRMS[256] ; sprintf(titleRMS ,"Baseline RMS (timebin: %i-%i) %s" ,GetRangeBaseMin() ,GetRangeBaseMax() ,titleSEC); - - if(histos==1) - { + + if(histos==1) + { // IROC _______________________________________________________________ - TCanvas* ciroc = 0; - ciroc = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("ciroc"); - if(!ciroc) - { - ciroc = CreateCanvas("ciroc"); - fExecPlaneMax=0; - } - ciroc->cd(); - - fHistIROC->SetXTitle("row"); - fHistIROC->SetYTitle("pad"); - if(GetPedestals()) fHistIROC->SetZTitle("max ADC (baseline sub)"); - else fHistIROC->SetZTitle("max ADC "); - fHistIROC->SetTitle(titleIROC); - fHistIROC->SetMinimum(0.01); - fHistIROC->Draw("COLZ"); - ciroc->UseCurrentStyle(); - - - fHistIROCTime->SetXTitle("row"); fHistIROCTime->SetZTitle("peak time (fit)"); fHistIROCTime->SetYTitle("pad"); fHistIROCTime->SetTitle(titleIROC); - fHistIROCRMS->SetXTitle("row"); fHistIROCRMS->SetZTitle( "baseline rms (ADC)"); fHistIROCRMS->SetYTitle("pad"); fHistIROCRMS->SetTitle(titleIROC); - + TCanvas* ciroc = 0; + ciroc = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("ciroc"); + if(!ciroc) + { + ciroc = CreateCanvas("ciroc"); + fExecPlaneMax=0; + } + ciroc->cd(); + + fHistIROC->SetXTitle("row"); + fHistIROC->SetYTitle("pad"); + if(GetPedestals()) fHistIROC->SetZTitle("max ADC (baseline sub)"); + else fHistIROC->SetZTitle("max ADC "); + fHistIROC->SetTitle(titleIROC); + fHistIROC->SetMinimum(0.01); + fHistIROC->Draw("COLZ"); + ciroc->UseCurrentStyle(); + + + fHistIROCTime->SetXTitle("row"); fHistIROCTime->SetZTitle("peak time (fit)"); fHistIROCTime->SetYTitle("pad"); fHistIROCTime->SetTitle(titleIROC); + fHistIROCRMS->SetXTitle("row"); fHistIROCRMS->SetZTitle( "baseline rms (ADC)"); fHistIROCRMS->SetYTitle("pad"); fHistIROCRMS->SetTitle(titleIROC); + // OROC - TCanvas* coroc = 0; - coroc =(TCanvas*)gROOT->GetListOfCanvases()->FindObject("coroc"); - if(!coroc) { - coroc = CreateCanvas("coroc"); - fExecPlaneMax=0; - } - coroc->cd(); - - fHistOROC->SetXTitle("row"); - fHistOROC->SetYTitle("pad"); - if(GetPedestals()) fHistOROC->SetZTitle("max ADC (baseline sub)"); - else fHistOROC->SetZTitle("max ADC "); - fHistOROC->SetTitle(titleOROC); - fHistOROC->SetMinimum(0.01); - fHistOROC->Draw("COLZ"); - coroc->UseCurrentStyle(); - - - fHistOROCTime->SetXTitle("row"); fHistOROCTime->SetZTitle("peak time (fit) (timebins)"); fHistOROCTime->SetYTitle("pad"); fHistOROCTime->SetTitle(titleOROC); - fHistOROCRMS->SetXTitle("row"); fHistOROCRMS->SetZTitle("baseline rms (ADC)"); fHistOROCRMS->SetYTitle("pad"); fHistOROCRMS->SetTitle(titleOROC); - - // SUM - Char_t namesum[256] ; sprintf(namesum,"ADC sum (bins: %i, %i)",GetRangeSumMin() ,GetRangeSumMax() ); - fHistIROCSUM->SetXTitle("row"); fHistIROCSUM->SetZTitle(namesum); fHistIROCSUM->SetYTitle("pad"); fHistIROCSUM->SetTitle(titleIROC); - fHistOROCSUM->SetXTitle("row"); fHistOROCSUM->SetZTitle(namesum); fHistOROCSUM->SetYTitle("pad"); fHistOROCSUM->SetTitle(titleOROC); + TCanvas* coroc = 0; + coroc =(TCanvas*)gROOT->GetListOfCanvases()->FindObject("coroc"); + if(!coroc) { + coroc = CreateCanvas("coroc"); + fExecPlaneMax=0; + } + coroc->cd(); + + fHistOROC->SetXTitle("row"); + fHistOROC->SetYTitle("pad"); + if(GetPedestals()) fHistOROC->SetZTitle("max ADC (baseline sub)"); + else fHistOROC->SetZTitle("max ADC "); + fHistOROC->SetTitle(titleOROC); + fHistOROC->SetMinimum(0.01); + fHistOROC->Draw("COLZ"); + coroc->UseCurrentStyle(); + + + fHistOROCTime->SetXTitle("row"); fHistOROCTime->SetZTitle("peak time (fit) (timebins)"); fHistOROCTime->SetYTitle("pad"); fHistOROCTime->SetTitle(titleOROC); + fHistOROCRMS->SetXTitle("row"); fHistOROCRMS->SetZTitle("baseline rms (ADC)"); fHistOROCRMS->SetYTitle("pad"); fHistOROCRMS->SetTitle(titleOROC); + + // SUM + Char_t namesum[256] ; sprintf(namesum,"ADC sum (bins: %i, %i)",GetRangeSumMin() ,GetRangeSumMax() ); + fHistIROCSUM->SetXTitle("row"); fHistIROCSUM->SetZTitle(namesum); fHistIROCSUM->SetYTitle("pad"); fHistIROCSUM->SetTitle(titleIROC); + fHistOROCSUM->SetXTitle("row"); fHistOROCSUM->SetZTitle(namesum); fHistOROCSUM->SetYTitle("pad"); fHistOROCSUM->SetTitle(titleOROC); // BASE - Char_t namebase[256] ; sprintf(namebase ,"base mean (timbebin: %i, %i )",GetRangeBaseMin(),GetRangeBaseMax()); - fHistIROCBASE->SetXTitle("row"); fHistIROCBASE->SetZTitle(namebase); fHistIROCBASE->SetYTitle("pad"); fHistIROCBASE->SetTitle(titleIROC); - fHistOROCBASE->SetXTitle("row"); fHistOROCBASE->SetZTitle(namebase); fHistOROCBASE->SetYTitle("pad"); fHistOROCBASE->SetTitle(titleOROC); - - if(fHistIROCClone) fHistIROCClone->Delete(); - if(fHistOROCClone) fHistOROCClone->Delete(); - fHistIROCClone = (TH2F*)fHistIROC->Clone("fHistIROCClone"); - fHistOROCClone = (TH2F*)fHistOROC->Clone("fHistOROCClone"); - + Char_t namebase[256] ; sprintf(namebase ,"base mean (timbebin: %i, %i )",GetRangeBaseMin(),GetRangeBaseMax()); + fHistIROCBASE->SetXTitle("row"); fHistIROCBASE->SetZTitle(namebase); fHistIROCBASE->SetYTitle("pad"); fHistIROCBASE->SetTitle(titleIROC); + fHistOROCBASE->SetXTitle("row"); fHistOROCBASE->SetZTitle(namebase); fHistOROCBASE->SetYTitle("pad"); fHistOROCBASE->SetTitle(titleOROC); + + if(fHistIROCClone) fHistIROCClone->Delete(); + if(fHistOROCClone) fHistOROCClone->Delete(); + fHistIROCClone = (TH2F*)fHistIROC->Clone("fHistIROCClone"); + fHistOROCClone = (TH2F*)fHistOROC->Clone("fHistOROCClone"); + // Executables - if(fExecPlaneMax==0) - { - Char_t carry1[100]; - sprintf(carry1,".x %s/TPC/AliTPCMonitorExec.C(1)",gSystem->Getenv("ALICE_ROOT")); - ciroc->AddExec("pad",carry1); - coroc->AddExec("pad",carry1); - - Char_t carry2[100]; - sprintf(carry2,".x %s/TPC/AliTPCMonitorExec.C(2)",gSystem->Getenv("ALICE_ROOT")); - ciroc->AddExec("row",carry2); - coroc->AddExec("row",carry2); - fExecPlaneMax=1; - } - coroc->Update(); - ciroc->Update(); - } - else if(histos==2) + if(fExecPlaneMax==0) { + Char_t carry1[100]; + sprintf(carry1,".x %s/TPC/AliTPCMonitorExec.C(1)",gSystem->Getenv("ALICE_ROOT")); + ciroc->AddExec("pad",carry1); + coroc->AddExec("pad",carry1); + + Char_t carry2[100]; + sprintf(carry2,".x %s/TPC/AliTPCMonitorExec.C(2)",gSystem->Getenv("ALICE_ROOT")); + ciroc->AddExec("row",carry2); + coroc->AddExec("row",carry2); + fExecPlaneMax=1; + } + coroc->Update(); + ciroc->Update(); + } + else if(histos==2) + { // MAX ADC distribution ____________________________________________ - TCanvas* cmax = 0; - cmax = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("cmax"); - if(!cmax) cmax = CreateCanvas("cmax"); + TCanvas* cmax = 0; + cmax = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("cmax"); + if(!cmax) cmax = CreateCanvas("cmax"); - cmax->cd(); - fHistDistrMaxIROC->GetXaxis()->SetRangeUser(0.0,1000.0); - fHistDistrMaxIROC->SetXTitle("max ADC (ADC)"); - fHistDistrMaxIROC->SetYTitle("counts"); - fHistDistrMaxIROC->SetTitle(titleMAX); - fHistDistrMaxIROC->Draw(""); - fHistDistrMaxOROC->SetLineColor(2); - fHistDistrMaxOROC->Draw("same"); + cmax->cd(); + fHistDistrMaxIROC->GetXaxis()->SetRangeUser(0.0,1000.0); + fHistDistrMaxIROC->SetXTitle("max ADC (ADC)"); + fHistDistrMaxIROC->SetYTitle("counts"); + fHistDistrMaxIROC->SetTitle(titleMAX); + fHistDistrMaxIROC->Draw(""); + fHistDistrMaxOROC->SetLineColor(2); + fHistDistrMaxOROC->Draw("same"); - if(fHistDistrMaxOROC->GetMaximum()> fHistDistrMaxIROC->GetMaximum()) fHistDistrMaxIROC->SetMaximum(fHistDistrMaxOROC->GetMaximum()*1.1); - - TLegend* legio = new TLegend(0.6,0.6,0.8,0.8); - legio->SetFillColor(0); - legio->AddEntry(fHistDistrMaxIROC,"IROC","l"); - legio->AddEntry(fHistDistrMaxOROC,"OROC","l"); - legio->Draw("same"); + if(fHistDistrMaxOROC->GetMaximum()> fHistDistrMaxIROC->GetMaximum()) fHistDistrMaxIROC->SetMaximum(fHistDistrMaxOROC->GetMaximum()*1.1); + + TLegend* legio = new TLegend(0.6,0.6,0.8,0.8); + legio->SetFillColor(0); + legio->AddEntry(fHistDistrMaxIROC,"IROC","l"); + legio->AddEntry(fHistDistrMaxOROC,"OROC","l"); + legio->Draw("same"); // ADC sum distribution - TCanvas* csum = 0; - csum = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("csum"); - if(!csum) csum = CreateCanvas("csum") ; - csum->cd(); + TCanvas* csum = 0; + csum = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("csum"); + if(!csum) csum = CreateCanvas("csum") ; + csum->cd(); - fHistDistrSumIROC->SetXTitle("sum ADC (ADC)"); - fHistDistrSumIROC->SetYTitle("counts"); - fHistDistrSumIROC->SetTitle(titleSUM); - fHistDistrSumIROC->Draw(""); - fHistDistrSumOROC->SetLineColor(2); - fHistDistrSumOROC->Draw("same"); - if(fHistDistrSumOROC->GetMaximum()> fHistDistrSumIROC->GetMaximum()) fHistDistrSumIROC->SetMaximum(fHistDistrSumOROC->GetMaximum()*1.1); - legio->Draw("same"); + fHistDistrSumIROC->SetXTitle("sum ADC (ADC)"); + fHistDistrSumIROC->SetYTitle("counts"); + fHistDistrSumIROC->SetTitle(titleSUM); + fHistDistrSumIROC->Draw(""); + fHistDistrSumOROC->SetLineColor(2); + fHistDistrSumOROC->Draw("same"); + if(fHistDistrSumOROC->GetMaximum()> fHistDistrSumIROC->GetMaximum()) fHistDistrSumIROC->SetMaximum(fHistDistrSumOROC->GetMaximum()*1.1); + legio->Draw("same"); // BASELINE MEAN distribution - TCanvas* cbasemean = 0; - cbasemean = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("cbasemean"); - if(!cbasemean) cbasemean = CreateCanvas("cbasemean"); - cbasemean->cd(); + TCanvas* cbasemean = 0; + cbasemean = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("cbasemean"); + if(!cbasemean) cbasemean = CreateCanvas("cbasemean"); + cbasemean->cd(); - fHistDistrBaseMeanIROC = fHistDistrBase2dIROC->ProjectionX("fHistDistrBaseMeanIROC"); - fHistDistrBaseMeanIROC->SetXTitle("base mean (ADC)"); - fHistDistrBaseMeanIROC->SetYTitle("counts"); - fHistDistrBaseMeanIROC->SetTitle(titleMEAN); - fHistDistrBaseMeanIROC->Draw(""); + fHistDistrBaseMeanIROC = fHistDistrBase2dIROC->ProjectionX("fHistDistrBaseMeanIROC"); + fHistDistrBaseMeanIROC->SetXTitle("base mean (ADC)"); + fHistDistrBaseMeanIROC->SetYTitle("counts"); + fHistDistrBaseMeanIROC->SetTitle(titleMEAN); + fHistDistrBaseMeanIROC->Draw(""); - fHistDistrBaseMeanOROC = fHistDistrBase2dOROC->ProjectionX("fHistDistrBaseMeanOROC"); - fHistDistrBaseMeanOROC->SetLineColor(2); - fHistDistrBaseMeanOROC->Draw("same"); - if(fHistDistrBaseMeanOROC->GetMaximum()>fHistDistrBaseMeanIROC->GetMaximum()) fHistDistrBaseMeanIROC->SetMaximum(fHistDistrBaseMeanOROC->GetMaximum()*1.1); - legio->Draw("same"); - - TCanvas* cbaserms = 0; - cbaserms = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("cbaserms"); - if(!cbaserms) cbaserms = CreateCanvas("cbaserms") ; - cbaserms->cd(); + fHistDistrBaseMeanOROC = fHistDistrBase2dOROC->ProjectionX("fHistDistrBaseMeanOROC"); + fHistDistrBaseMeanOROC->SetLineColor(2); + fHistDistrBaseMeanOROC->Draw("same"); + if(fHistDistrBaseMeanOROC->GetMaximum()>fHistDistrBaseMeanIROC->GetMaximum()) fHistDistrBaseMeanIROC->SetMaximum(fHistDistrBaseMeanOROC->GetMaximum()*1.1); + legio->Draw("same"); + + TCanvas* cbaserms = 0; + cbaserms = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("cbaserms"); + if(!cbaserms) cbaserms = CreateCanvas("cbaserms") ; + cbaserms->cd(); // BASELINE RMS distribution - fHistDistrBaseRmsIROC = fHistDistrBase2dIROC->ProjectionY("fHistDistrBaseRmsIROC"); - fHistDistrBaseRmsIROC->SetXTitle("base rms (ADC)"); - fHistDistrBaseRmsIROC->SetYTitle("counts"); - fHistDistrBaseRmsIROC->SetTitle(titleRMS); - fHistDistrBaseRmsIROC->Draw(""); + fHistDistrBaseRmsIROC = fHistDistrBase2dIROC->ProjectionY("fHistDistrBaseRmsIROC"); + fHistDistrBaseRmsIROC->SetXTitle("base rms (ADC)"); + fHistDistrBaseRmsIROC->SetYTitle("counts"); + fHistDistrBaseRmsIROC->SetTitle(titleRMS); + fHistDistrBaseRmsIROC->Draw(""); - fHistDistrBaseRmsOROC = fHistDistrBase2dOROC->ProjectionY("fHistDistrBaseRmsOROC"); - fHistDistrBaseRmsOROC->SetLineColor(2); - fHistDistrBaseRmsOROC->Draw("same"); - if(fHistDistrBaseRmsOROC->GetMaximum()>fHistDistrBaseRmsIROC->GetMaximum()) fHistDistrBaseRmsIROC->SetMaximum(fHistDistrBaseRmsOROC->GetMaximum()*1.1); - legio->Draw("same"); + fHistDistrBaseRmsOROC = fHistDistrBase2dOROC->ProjectionY("fHistDistrBaseRmsOROC"); + fHistDistrBaseRmsOROC->SetLineColor(2); + fHistDistrBaseRmsOROC->Draw("same"); + if(fHistDistrBaseRmsOROC->GetMaximum()>fHistDistrBaseRmsIROC->GetMaximum()) fHistDistrBaseRmsIROC->SetMaximum(fHistDistrBaseRmsOROC->GetMaximum()*1.1); + legio->Draw("same"); - cmax->Update(); - csum->Update(); - cbasemean->Update(); - cbaserms->Update(); - } + cmax->Update(); + csum->Update(); + cbasemean->Update(); + cbaserms->Update(); + } else if(histos==3) - { + { // GLOBAL MAX ADC _________________________________ - if(GetProcNextEvent()==1) - { - TCanvas* cglobA =0; - TCanvas* cglobC =0; - - if(!(cglobC=(TCanvas*)gROOT->GetListOfCanvases()->FindObject("SIDE C all"))) cglobC = CreateCanvas("SIDE C all"); - if(!(cglobA=(TCanvas*)gROOT->GetListOfCanvases()->FindObject("SIDE A all"))) cglobA = CreateCanvas("SIDE A all"); - - Char_t globtitle1[256]; sprintf(globtitle1,"SIDE A Run %05i (EventID %i)",fRunId,fEventNumber); - Char_t globtitle2[256]; sprintf(globtitle2,"SIDE C Run %05i (EventID %i)",fRunId,fEventNumber); - - fHistGlobalMaxA->SetTitle(globtitle1); - fHistGlobalMaxC->SetTitle(globtitle2); - fHistGlobalMaxA->SetXTitle("x/mm"); - fHistGlobalMaxA->SetYTitle("y/mm"); - fHistGlobalMaxC->SetXTitle("x/mm"); - fHistGlobalMaxC->SetYTitle("y/mm"); - - if(GetPedestals()==0) { fHistGlobalMaxA->SetZTitle("max adc (not baseline sub)"); fHistGlobalMaxC->SetZTitle("max adc (not baseline sub)"); } - else { fHistGlobalMaxA->SetZTitle("max adc "); fHistGlobalMaxC->SetZTitle("max adc "); } - - fHistGlobalMaxA->SetMinimum(0.01); - fHistGlobalMaxC->SetMinimum(0.01); - - cglobC->cd() ; fHistGlobalMaxC->Draw("COLZ"); - cglobA->cd() ; fHistGlobalMaxA->Draw("COLZ"); - - Char_t nameom[256]; - sprintf(nameom,".x %s/TPC/AliTPCMonitorExec.C(3)",gSystem->Getenv("ALICE_ROOT")); - - if(fExecGlob==0) - { - if(fVerb)cout << " set exec " << nameom << endl; - cglobC->AddExec("glob",nameom); - cglobA->AddExec("glob",nameom); - fExecGlob = 1; - } - else - { - cglobC->DeleteExec("glob"); - cglobA->DeleteExec("glob"); - - if(fVerb) cout << " set exec " << nameom << endl; - cglobC->AddExec("glob",nameom); - cglobA->AddExec("glob",nameom); - - } - cglobC->Update(); - cglobA->Update(); - } + if(GetProcNextEvent()==1) + { + TCanvas* cglobA =0; + TCanvas* cglobC =0; + + if(!(cglobC=(TCanvas*)gROOT->GetListOfCanvases()->FindObject("SIDE C all"))) cglobC = CreateCanvas("SIDE C all"); + if(!(cglobA=(TCanvas*)gROOT->GetListOfCanvases()->FindObject("SIDE A all"))) cglobA = CreateCanvas("SIDE A all"); + + Char_t globtitle1[256]; sprintf(globtitle1,"SIDE A Run %05i (EventID %i)",fRunId,fEventNumber); + Char_t globtitle2[256]; sprintf(globtitle2,"SIDE C Run %05i (EventID %i)",fRunId,fEventNumber); + + fHistGlobalMaxA->SetTitle(globtitle1); + fHistGlobalMaxC->SetTitle(globtitle2); + fHistGlobalMaxA->SetXTitle("x/mm"); + fHistGlobalMaxA->SetYTitle("y/mm"); + fHistGlobalMaxC->SetXTitle("x/mm"); + fHistGlobalMaxC->SetYTitle("y/mm"); + + if(GetPedestals()==0) { fHistGlobalMaxA->SetZTitle("max adc (not baseline sub)"); fHistGlobalMaxC->SetZTitle("max adc (not baseline sub)"); } + else { fHistGlobalMaxA->SetZTitle("max adc "); fHistGlobalMaxC->SetZTitle("max adc "); } + + fHistGlobalMaxA->SetMinimum(0.01); + fHistGlobalMaxC->SetMinimum(0.01); + + cglobC->cd() ; fHistGlobalMaxC->Draw("COLZ"); + cglobA->cd() ; fHistGlobalMaxA->Draw("COLZ"); + Char_t nameom[256]; + sprintf(nameom,".x %s/TPC/AliTPCMonitorExec.C(3)",gSystem->Getenv("ALICE_ROOT")); + + if(fExecGlob==0) + { + if(fVerb)cout << " set exec " << nameom << endl; + cglobC->AddExec("glob",nameom); + cglobA->AddExec("glob",nameom); + fExecGlob = 1; + } + else + { + cglobC->DeleteExec("glob"); + cglobA->DeleteExec("glob"); + + if(fVerb) cout << " set exec " << nameom << endl; + cglobC->AddExec("glob",nameom); + cglobA->AddExec("glob",nameom); + + } + cglobC->Update(); + cglobA->Update(); } + + } } @@ -1587,47 +1227,47 @@ void AliTPCMonitor::DrawHists(Int_t histos) //__________________________________________________________________ void AliTPCMonitor::DrawRMSMap() { - // Draw 2Dim rms histos for IROC and OROC + // Draw 2Dim rms histos for IROC and OROC // and set executables for canvases TCanvas* crmsoroc =0; TCanvas* crmsiroc =0; if(!(crmsoroc = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("crmsoroc"))) crmsoroc = CreateCanvas("crmsoroc"); if(!(crmsiroc = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("crmsiroc"))) crmsiroc = CreateCanvas("crmsiroc"); - + crmsiroc->cd(); fHistIROCRMS->Draw("COLZ"); crmsoroc->cd(); fHistOROCRMS->Draw("COLZ"); - + Char_t carry1[100]; sprintf(carry1,".x %s/TPC/AliTPCMonitorExec.C(1)",gSystem->Getenv("ALICE_ROOT")); Char_t carry2[100]; sprintf(carry2,".x %s/TPC/AliTPCMonitorExec.C(2)",gSystem->Getenv("ALICE_ROOT")); - - if(fExecPadIrocRms==0) - { - crmsiroc->AddExec("pad",carry1); - crmsiroc->AddExec("row",carry2); - fExecPadIrocRms=1; - } - if(fExecPadOrocRms==0) - { - crmsoroc->AddExec("pad",carry1); - crmsoroc->AddExec("row",carry2); - fExecPadOrocRms=1; - } + if(fExecPadIrocRms==0) + { + crmsiroc->AddExec("pad",carry1); + crmsiroc->AddExec("row",carry2); + fExecPadIrocRms=1; + } + + if(fExecPadOrocRms==0) + { + crmsoroc->AddExec("pad",carry1); + crmsoroc->AddExec("row",carry2); + fExecPadOrocRms=1; + } crmsiroc->Update(); crmsoroc->Update(); - DrawHists(2); - + DrawHists(2); + } //__________________________________________________________________ void AliTPCMonitor::ExecPad() { - - // Executable for Pad - // Show time profile for channel the mouse is pointing at + + // Executable for Pad + // Show time profile for channel the mouse is pointing at Int_t event = gPad->GetEvent(); if (event != 51) return; @@ -1644,7 +1284,7 @@ void AliTPCMonitor::ExecPad() Float_t upx = gPad->AbsPixeltoX(px); Float_t y = gPad->PadtoY(upy); Float_t x = gPad->PadtoX(upx); - + Int_t setrange = 0; TCanvas* cpad = 0; @@ -1652,62 +1292,70 @@ void AliTPCMonitor::ExecPad() Char_t projhist[60]; Char_t namesel[256]; Char_t namecanv[256]; - + Int_t xbinmin = 0; Int_t xbinmax = 0; Float_t ybinmin = 0; Float_t ybinmax = 0; Int_t rocid = 0; - - // Check wich Canvas executed the event + // Check wich Canvas executed the event TH2S* fHistIndex=0; sprintf(namesel,select->GetName()); - if(strcmp(namesel,"fHistOROC")==0 || strcmp(namesel,"fHistOROCRMS")==0 || strcmp(namesel,"fHistOROCTime")==0 ) - { - rocid = 1; - fPadUsedRoc =1; - sprintf(projhist,"ProjectionOROC"); - sprintf(namecanv,"coroc_ch"); - fHistIndex = fHistOROCIndex; - } - if(strcmp(namesel,"fHistIROC")==0 || strcmp(namesel,"fHistIROCRMS")==0 || strcmp(namesel,"fHistIROCTime")==0 ) - { - rocid = 0; - fPadUsedRoc=0; - sprintf(projhist,"ProjectionIROC"); - sprintf(namecanv,"ciroc_ch"); - fHistIndex = fHistIROCIndex; - } + if(strcmp(namesel,"fHistOROC")==0 || strcmp(namesel,"fHistOROCRMS")==0 || strcmp(namesel,"fHistOROCTime")==0 ) + { + rocid = 1; + fPadUsedRoc =1; + sprintf(projhist,"ProjectionOROC"); + sprintf(namecanv,"coroc_ch"); + fHistIndex = fHistOROCIndex; + } + if(strcmp(namesel,"fHistIROC")==0 || strcmp(namesel,"fHistIROCRMS")==0 || strcmp(namesel,"fHistIROCTime")==0 ) + { + rocid = 0; + fPadUsedRoc=0; + sprintf(projhist,"ProjectionIROC"); + sprintf(namecanv,"ciroc_ch"); + fHistIndex = fHistIROCIndex; + } - // Check if Canvas already existed and get Ranges from former Prjection histogram - if((cpad=(TCanvas*)gROOT->GetListOfCanvases()->FindObject(namecanv))) - { - cpad->cd(); - if(gROOT->Get(projhist)) - { - setrange = 1; - xbinmin = ((TH1D*)gROOT->Get(projhist))->GetXaxis()->GetFirst(); - xbinmax = ((TH1D*)gROOT->Get(projhist))->GetXaxis()->GetLast(); - ybinmin = ((TH1D*)gROOT->Get(projhist))->GetMinimum(); - ybinmax = ((TH1D*)gROOT->Get(projhist))->GetMaximum(); - delete gROOT->Get("legfit"); - delete gROOT->Get("fg"); - } - } - else + // Check if Canvas already existed and get Ranges from former Prjection histogram + if((cpad=(TCanvas*)gROOT->GetListOfCanvases()->FindObject(namecanv))) + { + cpad->cd(); + if(gROOT->Get(projhist)) { - cpad = CreateCanvas(namecanv); cpad->cd(); + setrange = 1; + xbinmin = ((TH1D*)gROOT->Get(projhist))->GetXaxis()->GetFirst(); + xbinmax = ((TH1D*)gROOT->Get(projhist))->GetXaxis()->GetLast(); + ybinmin = ((TH1D*)gROOT->Get(projhist))->GetMinimum(); + ybinmax = ((TH1D*)gROOT->Get(projhist))->GetMaximum(); + delete gROOT->Get("legfit"); + delete gROOT->Get("fg"); } + } + else + { + cpad = CreateCanvas(namecanv); cpad->cd(); + } - // Get Bin + // Get Bin Int_t testy = fHistIndex->GetYaxis()->FindBin(y); Int_t testx = fHistIndex->GetXaxis()->FindBin(x); Int_t binchannel = (Int_t)fHistIndex->GetCellContent(testx,testy); if(binchannel>30000 || binchannel<0) return; - - if(gROOT->Get(projhist)) delete gROOT->Get(projhist); - // Get Projection - TH1D *hp = (TH1D*)(((TH1D*)fHistChannelTime->ProjectionY("hp",binchannel,binchannel))->Clone(projhist)); + + TH1D *hp=(TH1D*)gROOT->Get(projhist); + if(!hp) hp=new TH1D(projhist,projhist,GetTimeBins(),0,GetTimeBins());//delete gROOT->Get(projhist); + // Get Projection +// TH1D *hp = (TH1D*)(((TH1D*)fHistChannelTime->ProjectionY("hp",binchannel,binchannel))->Clone(projhist)); +// TH1D *hp = fHistChannelTime->ProjectionY(projhist,binchannel,binchannel); +// hp->Reset(); + Int_t nbinsx=fHistChannelTime->GetNbinsX(); + for (Int_t itb=0;itbGetArray()[itb]=fHistChannelTime->GetArray()[binchannel+itb*(nbinsx+2)]; + } +// printf("hi\n"); +// return; // Make title and Pave for channel Info Char_t title[256]; @@ -1722,9 +1370,9 @@ void AliTPCMonitor::ExecPad() nhw = hwadd; nmax = (Int_t)hp->GetMaximum(); - + TPaveText* legstat = new TPaveText(0.18,0.65,0.3,0.8,"NDC"); - + Int_t connector = fMapHand->GetFECconnector(hwadd); Int_t fecnr = fMapHand->GetFECfromHw(hwadd); Int_t fecch = fMapHand->GetFECchannel(hwadd); @@ -1733,13 +1381,13 @@ void AliTPCMonitor::ExecPad() Int_t fecloc = fMapHand->U2fGetFECinRCU(fecnr) ; Int_t feclocbran = fMapHand->U2fGetFECinBranch(fecnr); Int_t branch = fMapHand->U2fGetBranch(fecnr); - - Short_t fecget = (hwadd & AliTPCMonitorAltro::GetHwMaskFEC()) >> 7; - Short_t branchget = (hwadd & AliTPCMonitorAltro::GetHwMaskBranch())>> 11; - - - Char_t nstat1[100]; Char_t nstat2[100]; Char_t nstat3[100]; Char_t nstat4[100]; + + Short_t fecget = (hwadd & fgkHwMaskFEC) >> 7; + Short_t branchget = (hwadd & fgkHwMaskBranch)>> 11; + + + Char_t nstat1[100]; Char_t nstat2[100]; Char_t nstat3[100]; Char_t nstat4[100]; Char_t nstat5[100]; Char_t nstat6[100]; Char_t nstat7[100]; Char_t nstat8[100]; sprintf(nstat1,"Branch (map) \t %i (%i) \n",branchget,branch); @@ -1751,64 +1399,64 @@ void AliTPCMonitor::ExecPad() sprintf(nstat5,"Altro chip\t %i \n",altrochip); sprintf(nstat6,"Altro chan\t %i \n",altrochannel); - legstat->AddText(nstat1); legstat->AddText(nstat2); legstat->AddText(nstat8); legstat->AddText(nstat7); + legstat->AddText(nstat1); legstat->AddText(nstat2); legstat->AddText(nstat8); legstat->AddText(nstat7); legstat->AddText(nstat3); legstat->AddText(nstat4); legstat->AddText(nstat5); legstat->AddText(nstat6); - + sprintf(title,"Row=%d Pad=%d Hw =%d maxADC =%d count =%d",npadRow,npad,nhw,nmax,binchannel); - hp->SetName(projhist); +// hp->SetName(projhist); hp->SetTitleSize(0.04); hp->SetTitle(title); hp->SetYTitle("ADC"); hp->SetXTitle("Timebin"); hp->GetXaxis()->SetTitleColor(1); - if(setrange) - { - hp->GetXaxis()->SetRange(xbinmin,xbinmax); - hp->SetMinimum(ybinmin); - hp->SetMaximum(ybinmax); - } - else - { - hp->SetMinimum(0.0); - hp->SetMaximum(1000.0); - } + if(setrange) + { + hp->GetXaxis()->SetRange(xbinmin,xbinmax); + hp->SetMinimum(ybinmin); + hp->SetMaximum(ybinmax); + } + else + { + hp->SetMinimum(0.0); + hp->SetMaximum(1000.0); + } cpad->cd(); hp->Draw(); // Make Fit to peak - if(GetPedestals() && fDisableFit==0) + if(GetPedestals() && fDisableFit==0) + { + Int_t maxx = (Int_t)fHistAddrMaxAdcX->GetBinContent(hwadd); + Float_t max = (Float_t)fHistAddrMaxAdc->GetBinContent(hwadd); + Float_t base = (Float_t)fHistAddrBaseMean->GetBinContent(hwadd); + if(base!=0) { - Int_t maxx = (Int_t)fHistAddrMaxAdcX->GetBinContent(hwadd); - Float_t max = (Float_t)fHistAddrMaxAdc->GetBinContent(hwadd); - Float_t base = (Float_t)fHistAddrBaseMean->GetBinContent(hwadd); - if(base!=0) - { - if( ((max+base)/base)>1.2) - { - TF1* fg = new TF1("fg",AliTPCMonitor::Gamma4,maxx-5,maxx+5,4); - fg->SetParName(0,"Normalisation"); - fg->SetParName(1,"Minimum"); - fg->SetParName(2,"Width"); - fg->SetParName(3,"Base"); - fg->SetParameter(0,max); - fg->SetParameter(1,maxx-2); - fg->SetParameter(2,1.5); - fg->FixParameter(3,0); - fg->SetLineColor(4); - fg->SetLineWidth(1); - hp->Fit("fg","RQ"); - - TLegend* legfit = new TLegend(0.6,0.7,0.7,0.8); - legfit->AddEntry("fg","#Gamma 4 fit","l"); - legfit->SetFillColor(0); - legfit->SetName("legfit"); - legfit->Draw("same"); - } - } + if( ((max+base)/base)>1.2) + { + TF1* fg = new TF1("fg",AliTPCMonitor::Gamma4,maxx-5,maxx+5,4); + fg->SetParName(0,"Normalisation"); + fg->SetParName(1,"Minimum"); + fg->SetParName(2,"Width"); + fg->SetParName(3,"Base"); + fg->SetParameter(0,max); + fg->SetParameter(1,maxx-2); + fg->SetParameter(2,1.5); + fg->FixParameter(3,0); + fg->SetLineColor(4); + fg->SetLineWidth(1); + hp->Fit("fg","RQ"); + + TLegend* legfit = new TLegend(0.6,0.7,0.7,0.8); + legfit->AddEntry("fg","#Gamma 4 fit","l"); + legfit->SetFillColor(0); + legfit->SetName("legfit"); + legfit->Draw("same"); + } } + } legstat->SetFillColor(0); legstat->Draw("same"); cpad->Update(); @@ -1818,18 +1466,18 @@ void AliTPCMonitor::ExecPad() //__________________________________________________________________ void AliTPCMonitor::ExecRow() { - - // Executable for Pad - // Show profile of max adc over given pad row - // and 2dim histo adc(pad-in-row,time bin) - + + // Executable for Pad + // Show profile of max adc over given pad row + // and 2dim histo adc(pad-in-row,time bin) + Int_t event = gPad->GetEvent(); if (event != 61) return; gPad->cd(); TObject *select = gPad->GetSelected(); if(!select) return; if(!select->InheritsFrom("TH2")) { return; } - + Int_t rocid = 0; // Char_t namehist[50]; Char_t rowhist[60]; @@ -1841,7 +1489,7 @@ void AliTPCMonitor::ExecRow() sprintf(rowhistxmax ,"hxmax"); sprintf(rowhistmax , "hrowmax"); - // get position + // get position Int_t px = gPad->GetEventX(); Int_t py = gPad->GetEventY(); Float_t upy = gPad->AbsPixeltoY(py); @@ -1854,8 +1502,8 @@ void AliTPCMonitor::ExecRow() TCanvas*cxmax = 0; TH2S* fHistIndex = 0; - - // ranges from already existing histos + + // ranges from already existing histos Int_t rowtimexmin = 0; Int_t rowtimexmax = 0; Int_t rowtimeymin = 0; @@ -1867,24 +1515,24 @@ void AliTPCMonitor::ExecRow() Int_t profrowxmax = 0; Double_t profrowymin = 0; Double_t profrowymax = 0; - + Int_t profxxmin = 0; Int_t profxxmax = 0; Double_t profxymin = 0; Double_t profxymax = 0; - - + + Int_t setrange = 0; - - - if( strcmp(select->GetName(),"fHistIROC")==0 || strcmp(select->GetName(),"fHistIROCRMS")==0 ) { fHistIndex = fHistIROCIndex; rocid =1; } + + + if( strcmp(select->GetName(),"fHistIROC")==0 || strcmp(select->GetName(),"fHistIROCRMS")==0 ) { fHistIndex = fHistIROCIndex; rocid =1; } else if(strcmp(select->GetName(),"fHistOROC")==0 || strcmp(select->GetName(),"fHistOROCRMS")==0 ) { fHistIndex = fHistOROCIndex; rocid =2; } else { cout << " not implemented for this histo " << endl; return; } gPad->GetCanvas()->FeedbackMode(kTRUE); - - + + // check if canvases exist // crowtime = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("crowtime"); crowmax = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("crowmax"); @@ -1894,34 +1542,34 @@ void AliTPCMonitor::ExecRow() if(!crowmax) crowmax = CreateCanvas("crowmax") ; if(!cxmax ) cxmax = CreateCanvas("cxmax") ; - // check ranges of already existing histos - if(gROOT->Get(rowhist)) - { - rowtimexmin = ((TH2F*)gROOT->Get(rowhist))->GetXaxis()->GetFirst(); - rowtimexmax = ((TH2F*)gROOT->Get(rowhist))->GetXaxis()->GetLast(); - rowtimeymin = ((TH2F*)gROOT->Get(rowhist))->GetYaxis()->GetFirst(); - rowtimeymax = ((TH2F*)gROOT->Get(rowhist))->GetYaxis()->GetLast(); - rowtimezmin = ((TH2F*)gROOT->Get(rowhist))->GetMinimum(); - rowtimezmax = ((TH2F*)gROOT->Get(rowhist))->GetMaximum(); - - profrowxmin = ((TH1F*)gROOT->Get(rowhistmax))->GetXaxis()->GetFirst(); - profrowxmax = ((TH1F*)gROOT->Get(rowhistmax))->GetXaxis()->GetLast(); - profrowymin = ((TH1F*)gROOT->Get(rowhistmax))->GetMinimum(); - profrowymax = ((TH1F*)gROOT->Get(rowhistmax))->GetMaximum(); - - profxxmin = ((TH1F*)gROOT->Get(rowhistxmax))->GetXaxis()->GetFirst(); - profxxmax = ((TH1F*)gROOT->Get(rowhistxmax))->GetXaxis()->GetLast(); - profxymin = ((TH1F*)gROOT->Get(rowhistxmax))->GetMinimum(); - profxymax = ((TH1F*)gROOT->Get(rowhistxmax))->GetMaximum(); - - setrange =1; - - delete gROOT->Get(rowhist); - delete gROOT->Get(rowhistmax); - delete gROOT->Get(rowhistsum); - delete gROOT->Get("hxmax"); - delete gROOT->Get("legrow"); - } + // check ranges of already existing histos + if(gROOT->Get(rowhist)) + { + rowtimexmin = ((TH2F*)gROOT->Get(rowhist))->GetXaxis()->GetFirst(); + rowtimexmax = ((TH2F*)gROOT->Get(rowhist))->GetXaxis()->GetLast(); + rowtimeymin = ((TH2F*)gROOT->Get(rowhist))->GetYaxis()->GetFirst(); + rowtimeymax = ((TH2F*)gROOT->Get(rowhist))->GetYaxis()->GetLast(); + rowtimezmin = ((TH2F*)gROOT->Get(rowhist))->GetMinimum(); + rowtimezmax = ((TH2F*)gROOT->Get(rowhist))->GetMaximum(); + + profrowxmin = ((TH1F*)gROOT->Get(rowhistmax))->GetXaxis()->GetFirst(); + profrowxmax = ((TH1F*)gROOT->Get(rowhistmax))->GetXaxis()->GetLast(); + profrowymin = ((TH1F*)gROOT->Get(rowhistmax))->GetMinimum(); + profrowymax = ((TH1F*)gROOT->Get(rowhistmax))->GetMaximum(); + + profxxmin = ((TH1F*)gROOT->Get(rowhistxmax))->GetXaxis()->GetFirst(); + profxxmax = ((TH1F*)gROOT->Get(rowhistxmax))->GetXaxis()->GetLast(); + profxymin = ((TH1F*)gROOT->Get(rowhistxmax))->GetMinimum(); + profxymax = ((TH1F*)gROOT->Get(rowhistxmax))->GetMaximum(); + + setrange =1; + + delete gROOT->Get(rowhist); + delete gROOT->Get(rowhistmax); + delete gROOT->Get(rowhistsum); + delete gROOT->Get("hxmax"); + delete gROOT->Get("legrow"); + } // get channel for xy bin -> getRow -> getNrows -> getHw for each Pad in Row -> get channel for each hw -> make proj Int_t testy = fHistIndex->GetYaxis()->FindBin(y); @@ -1931,51 +1579,51 @@ void AliTPCMonitor::ExecRow() if(binchannel>30000) return; if(binchannel<=0 ) { crowtime->Update() ; crowmax->Update() ; return ; } - // get hwaddress + // get hwaddress Int_t hwadd = (Int_t)fHistChannelTime->GetCellContent(binchannel,0); Int_t row = fMapHand->GetPadRow(hwadd); Int_t pad = fMapHand->GetPad(hwadd) ; Int_t numofpads = fMapHand->GetNumofPads(row); - // create histos + // create histos TH2F *hrowtime = new TH2F(rowhist , "" ,numofpads,0,numofpads,GetTimeBins(),0.0,GetTimeBins()); TH1F *hrowmax = new TH1F(rowhistmax , "" ,numofpads,0,numofpads); TH1F *hxmax = new TH1F(rowhistxmax, "" ,159,0,159 ); // Row profile /////////// if(fVerb) cout << " Number of pads " << numofpads << endl; - for(Int_t padnr = 0; padnrGetPadAddInRow(row,padnr ); - Int_t channel = (Int_t)fHistAddrMapIndex->GetBinContent(addrinrow); - if(channel==-1) continue; + for(Int_t padnr = 0; padnrGetPadAddInRow(row,padnr ); + Int_t channel = (Int_t)fHistAddrMapIndex->GetBinContent(addrinrow); + if(channel==-1) continue; + + hrowmax->SetBinContent(padnr+1,fHistAddrMaxAdc->GetBinContent(addrinrow)); + TH1D *hp = fHistChannelTime->ProjectionY("hp",channel,channel); + for(Int_t time = 0;timeSetBinContent(padnr+1,fHistAddrMaxAdc->GetBinContent(addrinrow)); - TH1D *hp = fHistChannelTime->ProjectionY("hp",channel,channel); - for(Int_t time = 0;timeGetBinContent(time); - hrowtime->SetCellContent(padnr+1,time+1,val); - } + Float_t val = hp->GetBinContent(time); + hrowtime->SetCellContent(padnr+1,time+1,val); } + } // X profile ///////////// Double_t xval = 0.0; Double_t yval = 0.0; GetXY(xval,yval,numofpads,row,pad); - Int_t padnr = 0; + Int_t padnr = 0; Int_t hw = 0; for(Int_t nrow = 0; nrow<159; nrow++) + { + padnr = GetPadAtX(xval,nrow); + if(padnr>=0) { - padnr = GetPadAtX(xval,nrow); - if(padnr>=0) - { - hw = fMapHand->GetPadAddInRow(nrow,padnr); - if(fPadMapHw[hw]==-1){ continue ; } - else { hxmax->SetBinContent(nrow+1,fHistAddrMaxAdc->GetBinContent(hw)) ; } - } + hw = fMapHand->GetPadAddInRow(nrow,padnr); + if(fPadMapHw[hw]==-1){ continue ; } + else { hxmax->SetBinContent(nrow+1,fHistAddrMaxAdc->GetBinContent(hw)) ; } } + } cxmax->cd(); Char_t hxtitle[50] ; sprintf(hxtitle,"max adc in pads at x=%5.1f mm",xval); @@ -1987,22 +1635,22 @@ void AliTPCMonitor::ExecRow() hxmax->Draw("l"); if(setrange) - { - hxmax->GetXaxis()->SetRange(profxxmin,profxxmax); - hxmax->SetMinimum(profxymin); - hxmax->SetMaximum(profxymax); - } + { + hxmax->GetXaxis()->SetRange(profxxmin,profxxmax); + hxmax->SetMinimum(profxymin); + hxmax->SetMaximum(profxymax); + } cxmax->Update(); - + crowtime->cd(); Char_t title[256]; Char_t titlemax[256]; - if(rocid==1) {sprintf(title,"%s Row=%d",((TH2*)select)->GetTitle(),row) ; sprintf(titlemax,"IROC max/sum Row=%d",row );} + if(rocid==1) {sprintf(title,"%s Row=%d",((TH2*)select)->GetTitle(),row) ; sprintf(titlemax,"IROC max/sum Row=%d",row );} else {sprintf(title,"%s Row=%d",((TH2*)select)->GetTitle(),row-63); sprintf(titlemax,"OROC max/sum Row=%d",row-63);} if(fVerb) cout << " set name " << endl; - + // row vs time crowtime->cd(); hrowtime->SetTitleSize(0.04); @@ -2010,23 +1658,23 @@ void AliTPCMonitor::ExecRow() hrowtime->SetYTitle("timbin"); hrowtime->SetXTitle("pad in row"); hrowtime->SetZTitle("signal (ADC)"); - + hrowtime->GetXaxis()->SetTitleColor(1); hrowtime->SetMaximum(1000.0); hrowtime->SetMinimum(0.0); - if(setrange) - { - hrowtime->GetXaxis()->SetRange(rowtimexmin,rowtimexmax); - hrowtime->GetYaxis()->SetRange(rowtimeymin,rowtimeymax); - hrowtime->SetMinimum(rowtimezmin); - hrowtime->SetMaximum(rowtimezmax); - } - + if(setrange) + { + hrowtime->GetXaxis()->SetRange(rowtimexmin,rowtimexmax); + hrowtime->GetYaxis()->SetRange(rowtimeymin,rowtimeymax); + hrowtime->SetMinimum(rowtimezmin); + hrowtime->SetMaximum(rowtimezmax); + } + hrowtime->Draw("COLZ"); crowtime->UseCurrentStyle(); crowtime->Update(); - + // max and sum ///////////////////////// crowmax->cd(); if(setrange) { @@ -2039,9 +1687,9 @@ void AliTPCMonitor::ExecRow() hrowmax->SetYTitle("max adc"); hrowmax->SetXTitle("pad in row"); hrowmax->GetXaxis()->SetTitleColor(1); - + hrowmax->SetLineColor(2); - hrowmax->Draw("l"); + hrowmax->Draw("l"); crowmax->Update(); return; @@ -2051,55 +1699,55 @@ void AliTPCMonitor::ExecRow() void AliTPCMonitor::Write10bitChannel() { - // Write 10 bit words form histogram for active(last pointed) channel + // Write 10 bit words form histogram for active(last pointed) channel if(fPadUsedHwAddr==-1){ AliWarning(" No active pad "); return ;} - Int_t pad = (Int_t)fMapHand->GetPad( fPadUsedHwAddr); - Int_t row = (Int_t)fMapHand->GetPadRow(fPadUsedHwAddr); + Int_t pad = (Int_t)fMapHand->GetPad( fPadUsedHwAddr); + Int_t row = (Int_t)fMapHand->GetPadRow(fPadUsedHwAddr); Int_t channel = (Int_t)fPadMapHw[fPadUsedHwAddr]; Char_t filenameroot[256]; Char_t filenamedat[256]; Char_t projhist[256]; - + if(fPadUsedRoc==1) { sprintf(projhist,"ProjectionOROC"); } if(fPadUsedRoc==0) { sprintf(projhist,"ProjectionIROC"); } sprintf(filenamedat, "Channel_Run%05i_EventID_%i_Pad_%i_Row_%i.dat" ,fRunId,fEventNumber,pad,row); sprintf(filenameroot,"Channel_Run%05i_EventID_%i_Pad_%i_Row_%i.root" ,fRunId,fEventNumber,pad,row); - TH1D* hpr = 0; - if((hpr=(TH1D*)gROOT->Get(projhist))) + TH1D* hpr = 0; + if((hpr=(TH1D*)gROOT->Get(projhist))) + { + // root histo + TFile f(filenameroot,"recreate"); + hpr->Write(); + f.Close(); + + // raw singal + ofstream datout(filenamedat,ios::out); + datout <<"Timebin \t ADC value " << endl; + for(Int_t i = 1; i Write(); - f.Close(); - - // raw singal - ofstream datout(filenamedat,ios::out); - datout <<"Timebin \t ADC value " << endl; - for(Int_t i = 1; i Get(projhist)==0){AliWarning("Proj histo does not exist \n Move mouse over 2d histo choose channel \n and drag mouse form histo again!"); return ;} else hproj = (TH1D*)gROOT->Get(projhist) ; - + if(fPadUsedRoc==1) { sprintf(namehtrimag,"htransimagfreq_oroc"); sprintf(namehtrreal,"htransrealfreq_oroc"); sprintf(namehtrmag,"htransmagfreq_oroc"); } else { sprintf(namehtrimag,"htransimagfreq_iroc"); sprintf(namehtrreal,"htransrealfreq_iroc"); sprintf(namehtrmag,"htransmagfreq_iroc"); } - + if( gROOT->Get(namehtrimag)) delete gROOT->Get(namehtrimag); if( gROOT->Get(namehtrreal)) delete gROOT->Get(namehtrreal); if( gROOT->Get(namehtrmag)) delete gROOT->Get(namehtrmag); - + TCanvas *ctrans = 0; if(!(ctrans = (TCanvas*)gROOT->GetListOfCanvases()->FindObject(namecanv))) { @@ -2135,49 +1783,49 @@ void AliTPCMonitor::ExecTransform() ctrans2 = CreateCanvas(namecanv2); // ctrans2->Divide(1,2); } - + Int_t binfirst = hproj->GetXaxis()->GetFirst(); Int_t binlast = hproj->GetXaxis()->GetLast(); Int_t bins = binlast -binfirst +1; - + Int_t power = 0; for(Int_t pot = 0; pot<=10 ; pot++) { Int_t comp = (Int_t)TMath::Power(2,pot); if(bins>=comp)power = pot; } - + bins = (Int_t)TMath::Power(2,power); - + // sampling frequency ; Double_t deltat = 1.0/(Float_t)GetSamplingFrequency(); - + // output histo TH1D* htransrealfreq = new TH1D(namehtrreal,namehtrreal,10000,-1/(2*deltat),1/(2*deltat)); TH1D* htransimagfreq = new TH1D(namehtrimag,namehtrimag,10000,-1/(2*deltat),1/(2*deltat)); TH1D* htransmag = new TH1D(namehtrmag,namehtrmag,10000,-1/(2*deltat),1/(2*deltat)); - + Char_t titlereal[256]; Char_t titleimag[256]; Char_t titlemag[256]; if(fPadUsedRoc==1) { sprintf(titlereal,"OROC DFT real part"); sprintf(titleimag,"OROC DFT imag part"); sprintf(titlemag,"OROC DFT magnitude"); } else { sprintf(titlereal,"IROC DFT real part"); sprintf(titleimag,"IROC DFT imag part"); sprintf(titlemag,"IROC DFT magnitude"); } - + htransrealfreq->SetTitle(titlereal); htransrealfreq->SetXTitle("f/hz"); htransrealfreq->SetYTitle("z_{real}(f)"); htransimagfreq->SetTitle(titleimag); htransimagfreq->SetXTitle("f/hz"); htransimagfreq->SetYTitle("z_{imag}(f)"); htransmag->SetTitle(titlemag); htransmag->SetXTitle("f/hz"); htransmag->SetYTitle("mag(f)"); - - // create complex packed data array + + // create complex packed data array const Int_t kdatasiz = 2*bins; Double_t* data = new Double_t[kdatasiz]; for(Int_t i=0;i<2*bins;i++) { data[i] = 0.0;} for(Int_t i=0;iGetBinContent(binfirst+i); } - + // make fourier transformation AliTPCMonitorFFT* four = new AliTPCMonitorFFT(); four->ComplexRadix2ForwardWrap(data,1,bins); - - // write output and fill histos forward + + // write output and fill histos forward Double_t freq = 0.0; for(Int_t i=0;i<2*bins;i++) { @@ -2190,7 +1838,7 @@ void AliTPCMonitor::ExecTransform() htransmag->Fill( freq, TMath::Sqrt(data[2*i]*data[2*i]+data[2*i+1]*data[2*i+1]) ); } } - + ctrans->cd(1); htransrealfreq->Draw(); ctrans->cd(2); @@ -2207,9 +1855,9 @@ void AliTPCMonitor::ExecTransform() void AliTPCMonitor::ShowSel(Int_t* compval) { - // Show only selected components - // First restore original histogram from clone - // Than remove all not matching pads form histos + // Show only selected components + // First restore original histogram from clone + // Than remove all not matching pads form histos Int_t connector = 0; Int_t fecnr = 0; @@ -2220,30 +1868,30 @@ void AliTPCMonitor::ShowSel(Int_t* compval) Int_t emptyI = 1; Int_t index = -1; Int_t hwadd = 0; - + Float_t maxiroc = fHistIROCClone->GetMaximum(); Float_t maxoroc = fHistOROCClone->GetMaximum(); - - // restore original histos - for(Int_t row = 0; rowGetCellContent(row+1,pad+1); if(index==-1)continue; else fHistIROC->SetCellContent(row+1,pad+1,fHistIROCClone->GetCellContent(row+1,pad+1)); - } } - for(Int_t row = 0; rowGetCellContent(row+1,pad+1); - if(index==-1)continue; - else fHistOROC->SetCellContent(row+1,pad+1,fHistOROCClone->GetCellContent(row+1,pad+1)); - } + index = (Int_t)fHistOROCIndex->GetCellContent(row+1,pad+1); + if(index==-1)continue; + else fHistOROC->SetCellContent(row+1,pad+1,fHistOROCClone->GetCellContent(row+1,pad+1)); } + } // remove not matching entries from fHistIROC/fHistOROC @@ -2253,64 +1901,64 @@ void AliTPCMonitor::ShowSel(Int_t* compval) Int_t npads =0; Int_t subrows =0; - for(Int_t row = 0; row< (fkNRowsIroc + fkNRowsOroc); row++) + for(Int_t row = 0; row< (fkNRowsIroc + fkNRowsOroc); row++) + { + if(rowGetCellContent(row -subrows +1,pad+1); + if(index==-1) continue ; + hwadd = (Int_t)fHistChannelTime->GetCellContent(index,0); + + // global fecnr + fecnr = fMapHand->GetFECfromHw(hwadd); + if(compval[0]!=-1 && fecnr!=compval[0]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } + + // rcu + rcuget = (hwadd & fgkHwMaskRCU)>> 12; + if(compval[1]!=-1 && rcuget!=compval[1]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } + + // branch + branch = fMapHand->U2fGetBranch(fecnr) ; + if(compval[2]!=-1 && branch!=compval[2]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } - for(Int_t pad = 0; padGetCellContent(row -subrows +1,pad+1); - if(index==-1) continue ; - hwadd = (Int_t)fHistChannelTime->GetCellContent(index,0); - - // global fecnr - fecnr = fMapHand->GetFECfromHw(hwadd); - if(compval[0]!=-1 && fecnr!=compval[0]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } - - // rcu - rcuget = (hwadd & AliTPCMonitorAltro::GetHwMaskRCU())>> 12; - if(compval[1]!=-1 && rcuget!=compval[1]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } - - // branch - branch = fMapHand->U2fGetBranch(fecnr) ; - if(compval[2]!=-1 && branch!=compval[2]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } - - // local fec - feclocbran= fMapHand->U2fGetFECinBranch(fecnr) ; - if(compval[3]!=-1 && feclocbran!=compval[3]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } - - // connector - connector = fMapHand->GetFECconnector(hwadd); - if(compval[4]!=-1 && connector!=compval[4]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } - - // Altro chip - altrochip = fMapHand->GetAltro(hwadd); - if(compval[5]!=-1 && altrochip!=compval[5]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } - emptyI =0; - } + // local fec + feclocbran= fMapHand->U2fGetFECinBranch(fecnr) ; + if(compval[3]!=-1 && feclocbran!=compval[3]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } + + // connector + connector = fMapHand->GetFECconnector(hwadd); + if(compval[4]!=-1 && connector!=compval[4]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } + + // Altro chip + altrochip = fMapHand->GetAltro(hwadd); + if(compval[5]!=-1 && altrochip!=compval[5]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } + emptyI =0; } + } TCanvas* c1 =0; TCanvas* c2 =0; - if(gROOT->GetListOfCanvases()->FindObject("ciroc")) - { - c1 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("ciroc"); - c1->cd() ; - fHistIROC->Draw("COLZ"); - fHistIROC->SetMaximum(maxiroc); - fHistIROC->SetMinimum(0.0); - c1->Update(); - } - if(gROOT->GetListOfCanvases()->FindObject("coroc")) - { - c2 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("coroc"); - c2->cd() ; - fHistOROC->Draw("COLZ"); - fHistOROC->SetMaximum(maxoroc); - fHistOROC->SetMinimum(0.0); - c2->Update(); - } + if(gROOT->GetListOfCanvases()->FindObject("ciroc")) + { + c1 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("ciroc"); + c1->cd() ; + fHistIROC->Draw("COLZ"); + fHistIROC->SetMaximum(maxiroc); + fHistIROC->SetMinimum(0.0); + c1->Update(); + } + if(gROOT->GetListOfCanvases()->FindObject("coroc")) + { + c2 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("coroc"); + c2->cd() ; + fHistOROC->Draw("COLZ"); + fHistOROC->SetMaximum(maxoroc); + fHistOROC->SetMinimum(0.0); + c2->Update(); + } return ; } @@ -2319,9 +1967,9 @@ void AliTPCMonitor::ResizeCanv() { // Resize canvases and delete some of them - Char_t carry1[100]; + Char_t carry1[100]; sprintf(carry1,".x %s/TPC/AliTPCMonitorExec.C(1)",gSystem->Getenv("ALICE_ROOT")); - Char_t carry3[100]; + Char_t carry3[100]; sprintf(carry3,".x %s/TPC/AliTPCMonitorExec.C(2)",gSystem->Getenv("ALICE_ROOT")); if(fVerb) cout << " canv 1 " << endl; @@ -2329,30 +1977,30 @@ void AliTPCMonitor::ResizeCanv() if(gROOT->GetListOfCanvases()->FindObject( "ciroc_ch")) { delete gROOT->GetListOfCanvases()->FindObject("ciroc_ch") ; } // for 2dim plots delete create and draw again - if(gROOT->GetListOfCanvases()->FindObject("ciroc")) - { - delete gROOT->GetListOfCanvases()->FindObject("ciroc"); - TCanvas* ciroc = CreateCanvas("ciroc"); - ciroc->cd(); - fHistIROC->Draw("COLZ"); - ciroc->AddExec("pad",carry1); - ciroc->AddExec("row",carry3); - fExecPlaneMax=1; - ciroc->Update(); - } + if(gROOT->GetListOfCanvases()->FindObject("ciroc")) + { + delete gROOT->GetListOfCanvases()->FindObject("ciroc"); + TCanvas* ciroc = CreateCanvas("ciroc"); + ciroc->cd(); + fHistIROC->Draw("COLZ"); + ciroc->AddExec("pad",carry1); + ciroc->AddExec("row",carry3); + fExecPlaneMax=1; + ciroc->Update(); + } // for 2dim plots delete create and draw again - if(gROOT->GetListOfCanvases()->FindObject("coroc")) - { - delete gROOT->GetListOfCanvases()->FindObject("coroc"); - TCanvas* coroc = CreateCanvas("coroc"); - coroc->cd(); - fHistOROC->Draw("COLZ"); - - coroc->AddExec("pad",carry1); - coroc->AddExec("row",carry3); - coroc->Update(); - fExecPlaneMax=1; - } + if(gROOT->GetListOfCanvases()->FindObject("coroc")) + { + delete gROOT->GetListOfCanvases()->FindObject("coroc"); + TCanvas* coroc = CreateCanvas("coroc"); + coroc->cd(); + fHistOROC->Draw("COLZ"); + + coroc->AddExec("pad",carry1); + coroc->AddExec("row",carry3); + coroc->Update(); + fExecPlaneMax=1; + } if(gROOT->GetListOfCanvases()->FindObject( "cbasemean")) { delete gROOT->GetListOfCanvases()->FindObject("cbasemean"); } if(gROOT->GetListOfCanvases()->FindObject( "cbase")) { delete gROOT->GetListOfCanvases()->FindObject("cbase");} @@ -2368,7 +2016,7 @@ void AliTPCMonitor::ResizeCanv() if(gROOT->GetListOfCanvases()->FindObject( "crmsiroc")) { delete gROOT->GetListOfCanvases()->FindObject("crmsiroc"); fExecPadIrocRms = 0; } if(gROOT->GetListOfCanvases()->FindObject( "crowmax")) { delete gROOT->GetListOfCanvases()->FindObject("crowmax"); } if(gROOT->GetListOfCanvases()->FindObject( "crowmax")) { delete gROOT->GetListOfCanvases()->FindObject("crowmax"); } - + } @@ -2379,7 +2027,7 @@ Int_t AliTPCMonitor::ExecProcess() { // Executable for global Histogram // Will be called from /TPC/AliTPCMonitorExec.C(3) - // Call ProcessEvent for same event and sector pointed at + // Call ProcessEvent for same event and sector pointed at Int_t side = 0; Int_t sector = 0; @@ -2392,7 +2040,7 @@ Int_t AliTPCMonitor::ExecProcess() if(!select->InheritsFrom("TH2")) {gPad->SetUniqueID(0); return -1; } if( strcmp(select->GetName(),"hglobal" )==0 || ( strcmp(select->GetName(),"SIDE A" )==0) ) side = 0; else if( strcmp(select->GetName(),"hglobal2")==0 || ( strcmp(select->GetName(),"SIDE C" )==0) ) side = 1; - + // get position Int_t px = gPad->GetEventX(); Int_t py = gPad->GetEventY(); @@ -2400,11 +2048,11 @@ Int_t AliTPCMonitor::ExecProcess() Float_t upx = gPad->AbsPixeltoX(px); Float_t y = gPad->PadtoY(upy); Float_t x = gPad->PadtoX(upx); - + Int_t testy = ((TH2*)select)->GetYaxis()->FindBin(y); Int_t testx = ((TH2*)select)->GetXaxis()->FindBin(x); if(((TH2*)select)->GetCellContent(testx,testy)==0) return -1 ; - + Float_t alpha = 0.0; if(x>0.0 && y > 0.0) alpha = TMath::Abs(TMath::ATan(TMath::Abs(x/y))); if(x>0.0 && y < 0.0) alpha = TMath::Abs(TMath::ATan(TMath::Abs(y/x))); @@ -2430,78 +2078,65 @@ Int_t AliTPCMonitor::ExecProcess() if(fVerb) cout << "AliTPCMonitor::ExecProcess() next side " << side << " next sector " << sector << endl; return (Int_t)ProcessEvent(); - + } //__________________________________________________________________ Int_t AliTPCMonitor::GetRCUPatch(Int_t runid, Int_t eqid) const { - // Return RCU patch index for given equipment id eqid + // Return RCU patch index for given equipment id eqid Int_t patch = 0; //if(runid>=704) if ( eqid<768 || eqid>983 ) return 0; //no TPC eqid if(runid>=0) - { - if(eqid>=1000) return 0; - patch = fMapEqidsRcu[eqid] ; - } + { + if(eqid>=1000) return 0; + patch = fMapEqidsRcu[eqid] ; + } else - { - if(eqid==408) {patch = 13*6+4 +0; } - if(eqid==409) {patch = 13*6+5 +0; } - if(eqid==509) {patch = 13*6+0 +0; } - if(eqid==512) {patch = 13*6+3 +0; } - if(eqid==513) {patch = 13*6+1 +0; } - if(eqid==517) {patch = 13*6+2 +0; } - - if(eqid==404) {patch = 4*6+5 +0; } - if(eqid==504) {patch = 4*6+4 +0; } - if(eqid==407) {patch = 4*6+3 +0; } - if(eqid==503) {patch = 4*6+2 +0; } - if(eqid==508) {patch = 4*6+1 +0; } - if(eqid==506) {patch = 4*6+0 +0; } - } + { + if(eqid==408) {patch = 13*6+4 +0; } + if(eqid==409) {patch = 13*6+5 +0; } + if(eqid==509) {patch = 13*6+0 +0; } + if(eqid==512) {patch = 13*6+3 +0; } + if(eqid==513) {patch = 13*6+1 +0; } + if(eqid==517) {patch = 13*6+2 +0; } + + if(eqid==404) {patch = 4*6+5 +0; } + if(eqid==504) {patch = 4*6+4 +0; } + if(eqid==407) {patch = 4*6+3 +0; } + if(eqid==503) {patch = 4*6+2 +0; } + if(eqid==508) {patch = 4*6+1 +0; } + if(eqid==506) {patch = 4*6+0 +0; } + } return patch; } //__________________________________________________________________ -void AliTPCMonitor::DumpHeader(AliRawReaderRoot * readerROOT) const +void AliTPCMonitor::DumpHeader(AliRawReader * reader) const { - // Dump Event header for ROOT format - - cout << "EventHeader : fReaderROOT->GetEquipmentSize() :" << readerROOT->GetEquipmentSize() << endl; - cout << "EventHeader : fReaderROOT->GetType() :" << readerROOT->GetType() << endl; - cout << "EventHeader : fReaderROOT->GetRunNumber() :" << readerROOT->GetRunNumber() << endl; - cout << "EventHeader : fReaderROOT->GetEventId() :" << *(readerROOT->GetEventId()) << endl; - cout << "EventHeader : fReaderROOT->GetLDCId() :" << readerROOT->GetLDCId() << endl; - cout << "EventHeader : fReaderROOT->GetGDCId() :" << readerROOT->GetGDCId() << endl; + // Dump Event header for format + + cout << "EventHeader : fReader->GetEquipmentSize() :" << reader->GetEquipmentSize() << endl; + cout << "EventHeader : fReader->GetType() :" << reader->GetType() << endl; + cout << "EventHeader : fReader->GetRunNumber() :" << reader->GetRunNumber() << endl; + cout << "EventHeader : fReader->GetEventId() :" << *(reader->GetEventId()) << endl; + cout << "EventHeader : fReader->GetLDCId() :" << reader->GetLDCId() << endl; + cout << "EventHeader : fReader->GetGDCId() :" << reader->GetGDCId() << endl; } -//__________________________________________________________________ -void AliTPCMonitor::DumpHeader(AliTPCMonitorDateFormat* dateform) const -{ - // Dump Event header for DATE format - - cout << "EquipmentHeader : dateform->GetEquipmentSize() :" << dateform->GetEquipmentSize() << endl; - cout << "EquipmentHeader : dateform->GetEquipmentType() :" << dateform->GetEquipmentType() << endl; - cout << "EquipmentHeader : dateform->GetEquipmentID() :" << dateform->GetEquipmentID() << endl; - cout << "EquipmentHeader : dateform->GetEquipmentTypeAttribute() :" << dateform->GetEquipmentTypeAttribute() << endl; - cout << "EquipmentHeader : dateform->GetEquipmentBasicSize() :" << dateform->GetEquipmentBasicSize() << endl; - cout << "EquipmentHeader : dateform->GetEquipmentHeaderSize() :" << dateform->GetEquipmentHeaderSize() << endl; - cout << "EquipmentHeader : dateform->IsLastSubEventHeader() :" << dateform->IsLastSubEventHeader() << endl; -} //__________________________________________________________________ Double_t AliTPCMonitor::Gamma4(Double_t* x, Double_t* par) { // Gamma4 function used to fit signals - // Defined in sections: diverging branch set to 0 + // Defined in sections: diverging branch set to 0 - Double_t val = 0.0; + Double_t val = 0.0; if(x[0] > par[1]) val = par[0]*exp(4.0)* pow((x[0]-par[1])/par[2],4)*exp(-4.0*(x[0]-par[1])/par[2])+ par[3]; - else + else val = 0; return val; } @@ -2509,7 +2144,7 @@ Double_t AliTPCMonitor::Gamma4(Double_t* x, Double_t* par) { //__________________________________________________________________ TCanvas* AliTPCMonitor::CreateCanvas(const Char_t* name) { - // Create Canvases + // Create Canvases TCanvas* canv =0; @@ -2523,7 +2158,7 @@ TCanvas* AliTPCMonitor::CreateCanvas(const Char_t* name) if( strcmp(name,"coroc" )==0) { canv = new TCanvas("coroc" ,"coroc" , -1+xoffset,(Int_t)(yspace+0.5*ysize) ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; } else if(strcmp(name,"ciroc" )==0) { canv = new TCanvas("ciroc" ,"ciroc" , -1+xoffset, 0 ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; } // ROC 2dim rms distribution - else if(strcmp(name,"crmsoroc" )==0) { canv = new TCanvas("crmsoroc" ,"crmsoroc" , -1+xoffset,(Int_t)(yspace+0.5*ysize) ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; } + else if(strcmp(name,"crmsoroc" )==0) { canv = new TCanvas("crmsoroc" ,"crmsoroc" , -1+xoffset,(Int_t)(yspace+0.5*ysize) ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; } else if(strcmp(name,"crmsiroc" )==0) { canv = new TCanvas("crmsiroc" ,"crmsiroc" , -1+xoffset, 0 ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; } // Global ADC max Histos else if(strcmp(name,"SIDE C all" )==0) { canv = new TCanvas("SIDE C all" ,"SIDE C all" , (Int_t)(3*xspace+ xoffset),(Int_t)(yspace+0.5*ysize) ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; } @@ -2531,7 +2166,7 @@ TCanvas* AliTPCMonitor::CreateCanvas(const Char_t* name) // 1 dim max sum basekine distribution else if(strcmp(name,"cmax" )==0) { canv = new TCanvas("cmax" ,"cmax" , -1+xoffset, 3*yspace ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; } else if(strcmp(name,"csum" )==0) { canv = new TCanvas("csum" ,"csum" , xspace+xoffset, 3*yspace ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; } - else if(strcmp(name,"cbasemean" )==0) { canv = new TCanvas("cbasemean" ,"cbasemean" , 2*xspace+xoffset, 3*yspace ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; } + else if(strcmp(name,"cbasemean" )==0) { canv = new TCanvas("cbasemean" ,"cbasemean" , 2*xspace+xoffset, 3*yspace ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; } else if(strcmp(name,"cbaserms" )==0) { canv = new TCanvas("cbaserms" ,"cbaserms" , 3*xspace+xoffset, 3*yspace ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; } // Projections of single channel else if(strcmp(name,"coroc_ch" )==0) { canv = new TCanvas("coroc_ch" ,"coroc_ch" , (Int_t)(1.5*xspace+xoffset),(Int_t)(yspace+0.5*ysize),(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; } @@ -2552,28 +2187,28 @@ TCanvas* AliTPCMonitor::CreateCanvas(const Char_t* name) void AliTPCMonitor::WriteHistos() { // Writes all available histograms to a file in current directory - // File name will be specified by : sector, side, runid and eventnumber + // File name will be specified by : sector, side, runid and eventnumber if(GetEventProcessed()) + { + AliInfo("Write histos to file"); + Char_t name[256]; + sprintf(name,"SIDE_%i_SECTOR_%02i_RUN_%05i_EventID_%06i.root",(GetLastSector()/18),(GetLastSector()%18),fRunId,fEventNumber); + TFile* f = new TFile(name,"recreate"); + for(Int_t i =0; iGetEntries(); i++) { - AliInfo("Write histos to file"); - Char_t name[256]; - sprintf(name,"SIDE_%i_SECTOR_%02i_RUN_%05i_EventID_%06i.root",(GetLastSector()/18),(GetLastSector()%18),fRunId,fEventNumber); - TFile* f = new TFile(name,"recreate"); - for(Int_t i =0; iGetEntries(); i++) - { - if(((TH1*)fHistList->At(i))!=0) - { - ((TH1*)fHistList->At(i))->Write(); - } - } - f->ls(); - f->Close(); + if(((TH1*)fHistList->At(i))!=0) + { + ((TH1*)fHistList->At(i))->Write(); + } } + f->ls(); + f->Close(); + } else - { - AliError("No Event Processed : Chose Format , File and push 'Next Event' "); - } + { + AliError("No Event Processed : Chose Format , File and push 'Next Event' "); + } } @@ -2586,12 +2221,12 @@ TH1* AliTPCMonitor::GetHisto(char* histname) TH1* hist = 0; if((TH1*)fHistList->FindObject(histname)) - { - hist = (TH1*)fHistList->FindObject(histname); - } - else - { - cout << " AliTPCMonitor::GetHisto :: Can not find histo with name " << histname << endl; - } + { + hist = (TH1*)fHistList->FindObject(histname); + } + else + { + cout << " AliTPCMonitor::GetHisto :: Can not find histo with name " << histname << endl; + } return hist ; } diff --git a/TPC/AliTPCMonitor.h b/TPC/AliTPCMonitor.h index 05584d3ec5d..9ee772711ea 100755 --- a/TPC/AliTPCMonitor.h +++ b/TPC/AliTPCMonitor.h @@ -31,187 +31,177 @@ class TH2S; class TCanvas; class TH3S; class AliTPCMonitorMappingHandler; -class AliTPCMonitorDateFile; -class AliTPCMonitorDateFormat; -class AliTPCMonitorAltro; class AliTPCMonitorFFT; class AliTPCMonitorConfig; -class AliRawReaderRoot; class AliRawReader; -class AliTPCMonitorDateMonitor; - +class AliAltroRawStreamV3; class AliTPCMonitor : public AliTPCMonitorConfig { + +public: + + AliTPCMonitor(char* name, char* title); + AliTPCMonitor(const AliTPCMonitor &monitor); + AliTPCMonitor& operator= (const AliTPCMonitor& monitor); + + virtual ~AliTPCMonitor(); + + Int_t CheckEqId(Int_t secid, Int_t eqid); + TCanvas* CreateCanvas(const char* name); + void CreateHistos(); + + void DeleteHistos(); + void DisableFit(Int_t val) { fDisableFit =val; } + void DrawHists(Int_t histos); + void DrawRMSMap(); + void DumpHeader(AliRawReader* reader ) const ; + + void ExecPad() ; + void ExecRow() ; + Int_t ExecProcess(); + void ExecTransform(); + + void FillGlobal(Int_t sector); + void FillHistsPadPlane(); + + static double Gamma4(double* x, double* par); + Int_t GetChannelsProc() const { return fChannelIter ;} + Int_t GetEventID() const { return fEventNumber ;} + TH1* GetHisto(char* histname); + Int_t GetRCUPatch(Int_t runid, Int_t eqid) const; + + Int_t GetPadAtX(Float_t xval, Int_t row, Int_t padmax) const ; + Int_t GetPadAtX(Float_t xval, Int_t row) const ; + void GetXY( Double_t& xval , Double_t& yval , Int_t padmax, Int_t row , Int_t pad) const ; + + Int_t IsLastEvent() const { return fLastEv ;} + + Int_t ProcessEvent(); + + void SetEventID(Int_t val) { fEventNumber =val;} + void SetMirror(Int_t val) { fMirror=val;} + void SetVerbose(Int_t val) { fVerb = val;} + void SetMappingHandler(AliTPCMonitorMappingHandler* val ) { fMapHand = val;} + void ShowSel(Int_t* compval); + void SetEqIds(); + + void ResizeCanv(); + void ResetHistos(); + void ResetArrays(); + Int_t ReadDataNew( Int_t secid); - public: - - AliTPCMonitor(char* name, char* title); - AliTPCMonitor(const AliTPCMonitor &monitor); - AliTPCMonitor& operator= (const AliTPCMonitor& monitor); - - virtual ~AliTPCMonitor(); - - Int_t CheckEqId(Int_t secid, Int_t eqid); - TCanvas* CreateCanvas(const char* name); - void CreateHistos(); - - void DeleteHistos(); - void DisableFit(Int_t val) { fDisableFit =val; } - void DrawHists(Int_t histos); - void DrawRMSMap(); - void DumpHeader(AliRawReaderRoot* reader ) const ; - void DumpHeader(AliTPCMonitorDateFormat* DateForm) const ; - - void ExecPad() ; - void ExecRow() ; - Int_t ExecProcess(); - void ExecTransform(); - - void FillGlobal(Int_t sector); - void FillHistsDecode( AliTPCMonitorAltro* altro , Int_t rcupatch, Int_t secid=0); - void FillHistsPadPlane(); - - static double Gamma4(double* x, double* par); - Int_t GetChannelsProc() const { return fChannelIter ;} - Int_t GetEventID() const { return fEventNumber ;} - TH1* GetHisto(char* histname); - Int_t GetRCUPatch(Int_t runid, Int_t eqid) const; - - Int_t GetPadAtX(Float_t xval, Int_t row, Int_t padmax) const ; - Int_t GetPadAtX(Float_t xval, Int_t row) const ; - void GetXY( Double_t& xval , Double_t& yval , Int_t padmax, Int_t row , Int_t pad) const ; - - Int_t IsLastEvent() const { return fLastEv ;} - - Int_t ProcessEvent(); - - void SetEventID(Int_t val) { fEventNumber =val;} - void SetMirror(Int_t val) { fMirror=val;} - void SetVerbose(Int_t val) { fVerb = val;} - void SetMappingHandler(AliTPCMonitorMappingHandler* val ) { fMapHand = val;} - void ShowSel(Int_t* compval); - void SetEqIds(); - - void ResizeCanv(); - void ResetHistos(); - void ResetArrays(); - Int_t ReadData( Int_t secid); - - Int_t ReadDataDATEFile(Int_t secid); - Int_t ReadDataDATEStream(Int_t secid); - Int_t ReadDataDATESubEventLoop(AliTPCMonitorDateFormat* DateForm, Int_t secid); - Int_t ReadDataROOT(Int_t secid ); - - void WriteHistos() ; - void Write10bitChannel(); - - + void WriteHistos() ; + void Write10bitChannel(); + + // private: - + // stats for size of arrays and histograms ///////////////////////////////////////////////// - Int_t** fPad; // array to store channel adc in time - Float_t* fPadMapHw; // array to store mapping of hardware address and channel number - Int_t** fPadMapRCU; // store multiple information for hardware address for debugging purpose (read out errors occur) - - + Int_t** fPad; // array to store channel adc in time + Float_t* fPadMapHw; // array to store mapping of hardware address and channel number + Int_t** fPadMapRCU; // store multiple information for hardware address for debugging purpose (read out errors occur) + + // histograms to be used //////////////////////////////////////////////////////////////// - TH2F* fHistIROC; // histo for max adc IROC - TH2F* fHistOROC; // histo for max adc OROC - TH2S* fHistIROCIndex; // histo for channel number in each bin IROC - TH2S* fHistOROCIndex; // histo for channel number in each bin OROC - TH2F* fHistIROCTime; // histo for peaking time in each bin IROC - TH2F* fHistOROCTime; // histo for peaking time in each bin OROC - TH2F* fHistIROCClone; // clone histo for max adc IROC (backup when selecting component) - TH2F* fHistOROCClone; // clone histo for max adc OROC (backup when selecting component) - TH2F* fHistIROCRMS; // histo for RMS IROC - TH2F* fHistOROCRMS; // histo for RMS OROC - TH2F* fHistIROCBASE; // histo for baseline IROC - TH2F* fHistOROCBASE; // histo for baseline OROC - TH2F* fHistIROCSUM; // histo for adc sum IROC - TH2F* fHistOROCSUM; // histo for adc sum OROC - - TH2F* fHistChannelTime; // histo for adc(channel,time) - TH1F* fHistAddrMapIndex; // histo for channel(hardware address) - TH1F* fHistAddrMaxAdc; // histo for max-adc(hardware address) - TH1F* fHistAddrBaseMean; // histo for baseline(hardware address) - TH1F* fHistAddrMaxAdcX; // histo for max-adc-xposition(hardware address) - TH1F* fHistAddrAdcSum; // histo for adc-sum(hardware address) - TH1F* fHistAddrBaseRms; // histo for baselinr-rms(hardware address) - - TH1F* fHistDistrSumIROC; // distribution of adc sum for all channels IROC - TH1F* fHistDistrMaxIROC; // distribution of adc max for all channels OROC - TH1F* fHistDistrSumOROC; // distribution of adc sum for all channels OROC - TH1F* fHistDistrMaxOROC; // distribution of adc max for all channels OROC - - TH2F* fHistDistrBase2dIROC; // distribution of baseline vs rms for all channels IROC - TH2F* fHistDistrBase2dOROC; // distribution of baseline vs rms for all channels OROC - TH1D* fHistDistrBaseRmsIROC; // projection of fHistDistrBase2dIROC on Rms - TH1D* fHistDistrBaseMeanIROC; // projection of fHistDistrBase2dIROC on Mean - TH1D* fHistDistrBaseRmsOROC; // projection of fHistDistrBase2dOROC on Rms - TH1D* fHistDistrBaseMeanOROC; // projection of fHistDistrBase2dOROC on Mean - - TH2S* fHistGlobalMaxA; // global histogramm for max adc of all sectors Side A - TH2S* fHistGlobalMaxC; // global histogramm for max adc of all sectors Side C - - TObjArray* fHistList; // array to store all histogram - - - // row and pad settings - Int_t fkNRowsIroc; // number of rows in IROC - Int_t fkNRowsOroc; // number of rows in OROC - - Int_t fkNPadsIroc; // number of pads in IROC - Int_t fkNPadsOroc; // number of pads in OROC - - Int_t fkNPadMinIroc; // min for pad (y-axis) representation in 2D histogram IROC - Int_t fkNPadMinOroc; // min for pad (y-axis) representation in 2D histogram OROC - Int_t fkNPadMaxIroc; // max for pad (y-axis) representation in 2D histogram IROC - Int_t fkNPadMaxOroc; // max for pad (y-axis) representation in 2D histogram IROC - - Int_t fVerb; // verbose flag - - Int_t fLastEv; // flag for last event - - Int_t fEventNumber; // current event number (ID) - Int_t fEventNumberOld; // previous event number - - Int_t fDisableFit; // flag to disable fit of maximum peak - - Int_t fExecGlob; // flag to add Executable to global histo - Int_t fExecPlaneMax; // flag to add executable for plane view ( max iroc/oroc) - Int_t fExecPadIrocRms; // flag to add executable for rms plane view IROC - Int_t fExecPadOrocRms; // flag to add executable for rms plane view OROC - - Int_t fRunId; // current run id - Int_t fEqId; // currend equipment id - - Int_t fPadUsedRoc; // last ROC canvas the mouse pointed at - Int_t fPadUsedHwAddr; // hwaddress for last pad the mouse pointed at - - Int_t fGdcId; // current GDC id - Int_t fLdcId; // current LDC id - Int_t fLdcIdOld; // previous LDC id - - Int_t** fMapEqidsSec; // mapping rcu-patch(equipmentid) - Int_t* fMapEqidsRcu; // mapping equipmentid(sector,rcu-patch) - - Int_t fMirror; // mirror x position on C-side - Int_t fChannelIter; // counter for channels read - - - AliTPCMonitorMappingHandler* fMapHand; // mapping handler - - AliRawReaderRoot* fReaderROOT; // reader for ROOT format - AliTPCMonitorDateFile* fReaderDATE; // reader for DATE files + TH2F* fHistIROC; // histo for max adc IROC + TH2F* fHistOROC; // histo for max adc OROC + TH2S* fHistIROCIndex; // histo for channel number in each bin IROC + TH2S* fHistOROCIndex; // histo for channel number in each bin OROC + TH2F* fHistIROCTime; // histo for peaking time in each bin IROC + TH2F* fHistOROCTime; // histo for peaking time in each bin OROC + TH2F* fHistIROCClone; // clone histo for max adc IROC (backup when selecting component) + TH2F* fHistOROCClone; // clone histo for max adc OROC (backup when selecting component) + TH2F* fHistIROCRMS; // histo for RMS IROC + TH2F* fHistOROCRMS; // histo for RMS OROC + TH2F* fHistIROCBASE; // histo for baseline IROC + TH2F* fHistOROCBASE; // histo for baseline OROC + TH2F* fHistIROCSUM; // histo for adc sum IROC + TH2F* fHistOROCSUM; // histo for adc sum OROC + + TH2F* fHistChannelTime; // histo for adc(channel,time) + TH1F* fHistAddrMapIndex; // histo for channel(hardware address) + TH1F* fHistAddrMaxAdc; // histo for max-adc(hardware address) + TH1F* fHistAddrBaseMean; // histo for baseline(hardware address) + TH1F* fHistAddrMaxAdcX; // histo for max-adc-xposition(hardware address) + TH1F* fHistAddrAdcSum; // histo for adc-sum(hardware address) + TH1F* fHistAddrBaseRms; // histo for baselinr-rms(hardware address) + + TH1F* fHistDistrSumIROC; // distribution of adc sum for all channels IROC + TH1F* fHistDistrMaxIROC; // distribution of adc max for all channels OROC + TH1F* fHistDistrSumOROC; // distribution of adc sum for all channels OROC + TH1F* fHistDistrMaxOROC; // distribution of adc max for all channels OROC + + TH2F* fHistDistrBase2dIROC; // distribution of baseline vs rms for all channels IROC + TH2F* fHistDistrBase2dOROC; // distribution of baseline vs rms for all channels OROC + TH1D* fHistDistrBaseRmsIROC; // projection of fHistDistrBase2dIROC on Rms + TH1D* fHistDistrBaseMeanIROC; // projection of fHistDistrBase2dIROC on Mean + TH1D* fHistDistrBaseRmsOROC; // projection of fHistDistrBase2dOROC on Rms + TH1D* fHistDistrBaseMeanOROC; // projection of fHistDistrBase2dOROC on Mean + + TH2S* fHistGlobalMaxA; // global histogramm for max adc of all sectors Side A + TH2S* fHistGlobalMaxC; // global histogramm for max adc of all sectors Side C + + TObjArray* fHistList; // array to store all histogram + + + // row and pad settings + Int_t fkNRowsIroc; // number of rows in IROC + Int_t fkNRowsOroc; // number of rows in OROC + + Int_t fkNPadsIroc; // number of pads in IROC + Int_t fkNPadsOroc; // number of pads in OROC + + Int_t fkNPadMinIroc; // min for pad (y-axis) representation in 2D histogram IROC + Int_t fkNPadMinOroc; // min for pad (y-axis) representation in 2D histogram OROC + Int_t fkNPadMaxIroc; // max for pad (y-axis) representation in 2D histogram IROC + Int_t fkNPadMaxOroc; // max for pad (y-axis) representation in 2D histogram IROC + + Int_t fVerb; // verbose flag + + Int_t fLastEv; // flag for last event + + Int_t fEventNumber; // current event number (ID) + Int_t fEventNumberOld; // previous event number + + Int_t fDisableFit; // flag to disable fit of maximum peak + + Int_t fExecGlob; // flag to add Executable to global histo + Int_t fExecPlaneMax; // flag to add executable for plane view ( max iroc/oroc) + Int_t fExecPadIrocRms; // flag to add executable for rms plane view IROC + Int_t fExecPadOrocRms; // flag to add executable for rms plane view OROC + + Int_t fRunId; // current run id + Int_t fEqId; // currend equipment id + + Int_t fPadUsedRoc; // last ROC canvas the mouse pointed at + Int_t fPadUsedHwAddr; // hwaddress for last pad the mouse pointed at + + Int_t fGdcId; // current GDC id + Int_t fLdcId; // current LDC id + Int_t fLdcIdOld; // previous LDC id + + Int_t** fMapEqidsSec; // mapping rcu-patch(equipmentid) + Int_t* fMapEqidsRcu; // mapping equipmentid(sector,rcu-patch) + + Int_t fMirror; // mirror x position on C-side + Int_t fChannelIter; // counter for channels read + + + AliTPCMonitorMappingHandler* fMapHand; // mapping handler + + AliRawReader* fRawReader; // reader for ROOT format + - AliTPCMonitorDateMonitor* fReaderDATEMon; // reader for DATE monitoring - - - - - - - ClassDef(AliTPCMonitor,1); + + static const Int_t fgkHwMaskFEC ; // mask for fec in hardware address + static const Int_t fgkHwMaskBranch ; // mask for branch in hardware address + static const Int_t fgkHwMaskFECChannel ; // mask for fec channel in hardware address + static const Int_t fgkHwMaskAltroChannel ; // mask for altro channel in hardware address + static const Int_t fgkHwMaskAltroChip ; // mask for altro chip in hardware address + static const Int_t fgkHwMaskRCU ; // not part of the trailer added afterwards + + + ClassDef(AliTPCMonitor,1); }; #endif diff --git a/TPC/AliTPCMonitorAltro.cxx b/TPC/AliTPCMonitorAltro.cxx index 176cbdbbc5f..31f6b40711e 100755 --- a/TPC/AliTPCMonitorAltro.cxx +++ b/TPC/AliTPCMonitorAltro.cxx @@ -228,58 +228,58 @@ void AliTPCMonitorAltro::Decodeto10Bit(Int_t equipment) ofstream datout; if(fwrite10bit) + { + Char_t nameout[256] ; sprintf(nameout,"%s_PayloadEquipmentId_%03i.txt",ffilename,equipment); + datout.open(nameout); + AliInfo(Form("AliTPCMonitorAltro::decodeto10Bit : Write Data to %s",nameout)); + if(foffset==0) datout << "Payload without CDH in 10bit words " << endl; + else datout << "CDH in 32 bit hex words words (" << foffset << " lines ) followed by payload in 10 bit words " << endl; + for(Int_t ih = 0; ih< foffset ; ih++) { - Char_t nameout[256] ; sprintf(nameout,"%s_PayloadEquipmentId_%03i.txt",ffilename,equipment); - datout.open(nameout); - AliInfo(Form("AliTPCMonitorAltro::decodeto10Bit : Write Data to %s",nameout)); - if(foffset==0) datout << "Payload without CDH in 10bit words " << endl; - else datout << "CDH in 32 bit hex words words (" << foffset << " lines ) followed by payload in 10 bit words " << endl; - for(Int_t ih = 0; ih< foffset ; ih++) - { - datout << hex << fmemory[ih] << endl; - } + datout << hex << fmemory[ih] << endl; } + } - for(Int_t ind = 0; ind < Get40BitArraySize(); ind++) + for(Int_t ind = 0; ind < Get40BitArraySize(); ind++) + { + rest = ind%4; + switch(rest) { - rest = ind%4; - switch(rest) - { - case 0: - blackbox = (fmemory[foffset]) + (((Long64_t)(fmemory[foffset+1]&fgk08BitOn))<<32); - foffset +=1; - break; - case 1: - blackbox = (fmemory[foffset]>>8 ) + (((Long64_t)(fmemory[foffset+1]&fgk16BitOn))<<24); - foffset +=1; - break; - case 2: - blackbox = (fmemory[foffset]>>16) + (((Long64_t)(fmemory[foffset+1]&fgk24BitOn))<<16); - foffset +=1; - break; - case 3: - blackbox = (fmemory[foffset]>>24) + (((Long64_t)(fmemory[foffset+1] ))<< 8); - foffset +=2; - break; - default: - blackbox = 0; - break; - } - f10BitArray[ind*4+0] = (Short_t)( blackbox & fgkmask10 ) ; - f10BitArray[ind*4+1] = (Short_t)((blackbox & fgkmask20)>>10); - f10BitArray[ind*4+2] = (Short_t)((blackbox & fgkmask30)>>20); - f10BitArray[ind*4+3] = (Short_t)((blackbox & fgkmask40)>>30); + case 0: + blackbox = (fmemory[foffset]) + (((Long64_t)(fmemory[foffset+1]&fgk08BitOn))<<32); + foffset +=1; + break; + case 1: + blackbox = (fmemory[foffset]>>8 ) + (((Long64_t)(fmemory[foffset+1]&fgk16BitOn))<<24); + foffset +=1; + break; + case 2: + blackbox = (fmemory[foffset]>>16) + (((Long64_t)(fmemory[foffset+1]&fgk24BitOn))<<16); + foffset +=1; + break; + case 3: + blackbox = (fmemory[foffset]>>24) + (((Long64_t)(fmemory[foffset+1] ))<< 8); + foffset +=2; + break; + default: + blackbox = 0; + break; } + f10BitArray[ind*4+0] = (Short_t)( blackbox & fgkmask10 ) ; + f10BitArray[ind*4+1] = (Short_t)((blackbox & fgkmask20)>>10); + f10BitArray[ind*4+2] = (Short_t)((blackbox & fgkmask30)>>20); + f10BitArray[ind*4+3] = (Short_t)((blackbox & fgkmask40)>>30); + } if(fwrite10bit) + { + for(Int_t ind = 0; ind < Get40BitArraySize(); ind++) { - for(Int_t ind = 0; ind < Get40BitArraySize(); ind++) - { - datout << dec << f10BitArray[ind*4+0] << "\n"; - datout << dec << f10BitArray[ind*4+1] << "\n"; - datout << dec << f10BitArray[ind*4+2] << "\n"; - datout << dec << f10BitArray[ind*4+3] << "\n"; - } + datout << dec << f10BitArray[ind*4+0] << "\n"; + datout << dec << f10BitArray[ind*4+1] << "\n"; + datout << dec << f10BitArray[ind*4+2] << "\n"; + datout << dec << f10BitArray[ind*4+3] << "\n"; } + } if(fwrite10bit) datout.close(); } @@ -289,7 +289,7 @@ Int_t AliTPCMonitorAltro::DecodeTrailer(Int_t pos) { // Decode the trailer word starting at position pos in fmemory // Check if information leads to proper next trailer position - + if (GetAltroVersion()==0xaabb) return DecodeTrailerVbb(pos); fTrailerPos = pos; if(pos<=4) return 0; @@ -324,5 +324,60 @@ Int_t AliTPCMonitorAltro::DecodeTrailer(Int_t pos) } +//_____________________________________________________________________________________________ +Int_t AliTPCMonitorAltro::DecodeTrailerVbb(Int_t pos) +{ + // Decode the trailer word starting at position pos in fmemory + // Check if information leads to proper next trailer position + fTrailerPos = pos; + if(pos>Get10BitArraySize()-4) return 0; + + Long64_t words = 0; + Long64_t tail = 0; + Long64_t trailer = 0; + Long64_t carry = 0; + Long64_t rest = 0 ; + + for(Long64_t iter = 0 ; iter<4;iter++) + { + carry = f10BitArray[pos-iter] ; + carry = ( carry << (30- ((iter)*10))); + trailer += carry ; + } + + fTrailerHwAddress = (trailer & ((Long64_t )fgkTrailerMaskHardw) ); + words = (Long64_t )( (trailer & ((Long64_t )fgkTrailerMaskNWords))>>16); + tail = (Long64_t )( (trailer & ((Long64_t )fgkTrailerMaskTail ))>>26 ); + + //Decide on read direction (sign) from the RCU trailer information + Int_t sign=-1; + if (GetAltroVersion()==0xaabb) sign=1; + + if(words%4!=0) rest = 4-(words%4); + fTrailerNWords = words+rest ; + fTrailerDataPos = pos +sign*(4+rest) ; + fTrailerBlockPos = pos +sign*4 ; + fNextPos = (pos +sign*(fTrailerNWords+4)); + + if( tail==fgkTrailerTailErr ) { + AliError(Form("Found Altro header with error marker (2AEE)[%0x]: %i. Supp.next Trailer line (2AA)[%0x]: %i ", + tail,pos,f10BitArray[fNextPos],fNextPos)); + return -fNextPos; + } else if ( tail!=fgkTrailerTail ) { + AliError(Form("Could not read Trailer. \"Write 10bit\" for this event. Last Trailer line (2AA)[%0x]: %i. Supp.next Trailer line (2AA)[%0x]: %i ", + tail,pos,f10BitArray[fNextPos],fNextPos)); return -1; + } else if( fNextPos==Get10BitArraySize()+3 ) { /* was last channel */ + return 0; + } else if( fNextPos >=Get10BitArraySize() ) { + AliError(Form("Next Trailer position < 0 %i", fNextPos)); + return -1; + } else if((f10BitArray[fNextPos]!=682)&&(f10BitArray[fNextPos]!=686)) { + AliError(Form("Could not find tail (2AA) at next supposed position %i",fNextPos)); + return -1; + } else { + return fNextPos; + } + +} diff --git a/TPC/AliTPCMonitorAltro.h b/TPC/AliTPCMonitorAltro.h index 224bbec1bc6..5c682380cb5 100755 --- a/TPC/AliTPCMonitorAltro.h +++ b/TPC/AliTPCMonitorAltro.h @@ -33,10 +33,11 @@ class AliTPCMonitorAltro : public TNamed { void Decodeto10Bit(Int_t equipment = -1); Int_t DecodeTrailer(Int_t pos); - + Int_t DecodeTrailerVbb(Int_t pos); + Long64_t* Get40BitArray(); Short_t *Get10BitArray(); - Int_t Get40BitArraySize() const { return fmemory[fsize-GetRCUTrailerSize()];} //hier ändern + Int_t Get40BitArraySize() const { return fmemory[fsize-GetRCUTrailerSize()];} //hier �ndern Int_t Get10BitArraySize() const { return fmemory[fsize-GetRCUTrailerSize()]*4;} //number of 10 bit words from trailer Char_t* GetActFileName() const { return ffilename;} @@ -56,7 +57,9 @@ class AliTPCMonitorAltro : public TNamed { Int_t GetTrailerBlockPos() const { return fTrailerBlockPos ;} Int_t GetTrailerPos() const { return fTrailerPos ;} - Int_t GetRCUTrailerSize() const { Int_t ts=(fmemory[fsize-1]>>16==0xaaaa)*(fmemory[fsize-1]&0x3F); return (ts>0)?ts:1;} + Int_t GetRCUTrailerSize() const { Int_t ts=(GetAltroVersion()==0xaaaa||GetAltroVersion()==0xaabb)* + (fmemory[fsize-1]&0x3F); return (ts>0)?ts:1;} + UInt_t GetAltroVersion() const { return fmemory[fsize-1]>>16; } void SetDataOffset(Int_t val){ foffset =val ;} void SetWrite10Bit(Int_t wr) { fwrite10bit =wr ;} @@ -99,7 +102,8 @@ class AliTPCMonitorAltro : public TNamed { static const Long64_t fgkmask40 = (Long64_t)0x000000FFC0000000ULL; // mask fourth 10 bit out of 4o0 bit word static const Long64_t fgkTrailerTail = (Long64_t)0x0000000000002AAAULL; // Tail of the Trailer set to 2AAA - static const Long64_t fgkTrailerMaskTail = (Long64_t)0x000000fffC000000ULL; // mask for trailer + static const Long64_t fgkTrailerTailErr = (Long64_t)0x0000000000002AEEULL; // Tail of the Trailer set to 2AEE if an error occured + static const Long64_t fgkTrailerMaskTail = (Long64_t)0x000000fffC000000ULL; // mask for trailer static const Long64_t fgkTrailerMaskHardw = (Long64_t)0x0000000000000FFFULL; // mask for hardware address static const Long64_t fgkTrailerMaskNWords = (Long64_t)0x0000000003FF0000ULL; // mask for nwords (number of 40 bit data words) diff --git a/TPC/AliTPCcalibDB.cxx b/TPC/AliTPCcalibDB.cxx index 4d04a3e5497..f831c125fb9 100644 --- a/TPC/AliTPCcalibDB.cxx +++ b/TPC/AliTPCcalibDB.cxx @@ -115,7 +115,7 @@ class AliTPCCalDet; #include "AliTPCTempMap.h" #include "AliTPCCalibVdrift.h" - +#include "AliTPCPreprocessorOnline.h" ClassImp(AliTPCcalibDB) @@ -170,6 +170,9 @@ AliTPCcalibDB::AliTPCcalibDB(): fPadTime0(0), fPadNoise(0), fPedestals(0), + fALTROConfigData(0), + fPulserData(0), + fCEData(0), fTemperature(0), fMapping(0), fParam(0), @@ -203,6 +206,9 @@ AliTPCcalibDB::AliTPCcalibDB(const AliTPCcalibDB& ): fPadTime0(0), fPadNoise(0), fPedestals(0), + fALTROConfigData(0), + fPulserData(0), + fCEData(0), fTemperature(0), fMapping(0), fParam(0), @@ -348,11 +354,31 @@ void AliTPCcalibDB::Update(){ entry = GetCDBEntry("TPC/Calib/ClusterParam"); if (entry){ - //if (fPadNoise) delete fPadNoise; entry->SetOwner(kTRUE); fClusterParam = (AliTPCClusterParam*)(entry->GetObject()->Clone()); } + //ALTRO configuration data + entry = GetCDBEntry("TPC/Calib/AltroConfig"); + if (entry){ + entry->SetOwner(kTRUE); + fALTROConfigData=(TObjArray*)(entry->GetObject()); + } + + //Calibration Pulser data + entry = GetCDBEntry("TPC/Calib/Pulser"); + if (entry){ + entry->SetOwner(kTRUE); + fPulserData=(TObjArray*)(entry->GetObject()); + } + + //CE data + entry = GetCDBEntry("TPC/Calib/CE"); + if (entry){ + entry->SetOwner(kTRUE); + fCEData=(TObjArray*)(entry->GetObject()); + } + entry = GetCDBEntry("TPC/Calib/Mapping"); if (entry){ //if (fPadNoise) delete fPadNoise; @@ -361,7 +387,7 @@ void AliTPCcalibDB::Update(){ if (array && array->GetEntriesFast()==6){ fMapping = new AliTPCAltroMapping*[6]; for (Int_t i=0; i<6; i++){ - fMapping[i] = dynamic_cast(array->At(i)); + fMapping[i] = dynamic_cast(array->At(i)); } } } @@ -1163,6 +1189,41 @@ Float_t AliTPCcalibDB::GetPressure(Int_t timeStamp, Int_t run, Int_t type){ return sensor->GetValue(stamp); } +Float_t AliTPCcalibDB::GetL3Current(Int_t run, Int_t statType){ + // + // return L3 current + // stat type is: AliGRPObject::Stats: kMean = 0, kTruncMean = 1, kMedian = 2, kSDMean = 3, kSDMedian = 4 + // + Float_t current=-1; + AliGRPObject *grp=AliTPCcalibDB::GetGRP(run); + if (grp) current=grp->GetL3Current((AliGRPObject::Stats)statType); + return current; +} + +Float_t AliTPCcalibDB::GetBz(Int_t run){ + // + // calculate BZ from L3 current + // + Float_t bz=-1; + Float_t current=AliTPCcalibDB::GetL3Current(run); + if (current>-1) bz=5*current/30000.; + return bz; +} + +Char_t AliTPCcalibDB::GetL3Polarity(Int_t run) { + // + // get l3 polarity from GRP + // + return AliTPCcalibDB::GetGRP(run)->GetL3Polarity(); +} + +TString AliTPCcalibDB::GetRunType(Int_t run){ + // + // return run type from grp + // + return AliTPCcalibDB::GetGRP(run)->GetRunType(); +} + Float_t AliTPCcalibDB::GetValueGoofie(Int_t timeStamp, Int_t run, Int_t type){ // // GetPressure for given time stamp and runt @@ -1400,5 +1461,43 @@ AliGRPObject * AliTPCcalibDB::MakeGRPObjectFromMap(TMap *map){ return grpRun; } +Bool_t AliTPCcalibDB::CreateGUITree(Int_t run, const char* filename) +{ + // + // Create a gui tree for run number 'run' + // + if (!AliCDBManager::Instance()->GetDefaultStorage()){ + AliLog::Message(AliLog::kError, "Default Storage not set. Cannot create Calibration Tree!", + MODULENAME(), "AliTPCcalibDB", FUNCTIONNAME(), __FILE__, __LINE__); + return kFALSE; + } + //db instance + AliTPCcalibDB *db=AliTPCcalibDB::Instance(); + // retrieve cal pad objects + db->SetRun(run); + AliTPCPreprocessorOnline prep; + //noise and pedestals + prep.AddComponent(db->GetPedestals()); + prep.AddComponent(db->GetPadNoise()); + //pulser data + prep.AddComponent(db->GetPulserTmean()); + prep.AddComponent(db->GetPulserTrms()); + prep.AddComponent(db->GetPulserQmean()); + //CE data + prep.AddComponent(db->GetCETmean()); + prep.AddComponent(db->GetCETrms()); + prep.AddComponent(db->GetCEQmean()); + //Altro data + prep.AddComponent(db->GetALTROAcqStart() ); + prep.AddComponent(db->GetALTROZsThr() ); + prep.AddComponent(db->GetALTROFPED() ); + prep.AddComponent(db->GetALTROAcqStop() ); + prep.AddComponent(db->GetALTROMasked() ); + // + TString file(filename); + if (file.IsNull()) file=Form("guiTreeRun_%d.root",run); + prep.DumpToFile(file.Data()); + return kTRUE; +} diff --git a/TPC/AliTPCcalibDB.h b/TPC/AliTPCcalibDB.h index 089bac33bcb..231c41816bc 100644 --- a/TPC/AliTPCcalibDB.h +++ b/TPC/AliTPCcalibDB.h @@ -16,8 +16,10 @@ class AliTPCExB; #include "TObjArray.h" #include "TArrayI.h" #include "TVectorD.h" +#include "TGraph.h" +#include "AliTPCCalPad.h" +#include "TString.h" -class AliTPCCalPad; class AliTPCSensorTempArray; class AliDCSSensorArray; class AliCDBEntry; @@ -42,6 +44,7 @@ class AliTPCcalibDB : public TObject void Update(); //update entries void UpdateRunInformations(Int_t run, Bool_t force=kFALSE); // + Long64_t GetRun() const {return fRun;} // // // @@ -54,28 +57,55 @@ class AliTPCcalibDB : public TObject AliTPCCalPad* GetPadTime0() {return fPadTime0;} AliTPCCalPad* GetPadNoise() {return fPadNoise;} AliTPCCalPad* GetPedestals() {return fPedestals;} + //ALTRO config data + TObjArray* GetAltroConfigData() const {return fALTROConfigData;} + AliTPCCalPad* GetALTROAcqStart() const {return fALTROConfigData?static_cast(fALTROConfigData->FindObject("AcqStart")):0;} + AliTPCCalPad* GetALTROZsThr() const {return fALTROConfigData?static_cast(fALTROConfigData->FindObject("ZsThr")):0;} + AliTPCCalPad* GetALTROFPED() const {return fALTROConfigData?static_cast(fALTROConfigData->FindObject("FPED")):0;} + AliTPCCalPad* GetALTROAcqStop() const {return fALTROConfigData?static_cast(fALTROConfigData->FindObject("AcqStop")):0;} + AliTPCCalPad* GetALTROMasked() const {return fALTROConfigData?static_cast(fALTROConfigData->FindObject("Masked")):0;} + //Pulser data + TObjArray* GetPulserData() const {return fPulserData;} + AliTPCCalPad* GetPulserTmean() const {return fPulserData?static_cast(fPulserData->FindObject("PulserTmean")):0;} + AliTPCCalPad* GetPulserTrms() const {return fPulserData?static_cast(fPulserData->FindObject("PulserTrms")):0;} + AliTPCCalPad* GetPulserQmean() const {return fPulserData?static_cast(fPulserData->FindObject("PulserQmean")):0;} +//CE data + TObjArray* GetCEData() const {return fCEData;} + AliTPCCalPad* GetCETmean() const {return fCEData?static_cast(fCEData->FindObject("CETmean")):0;} + AliTPCCalPad* GetCETrms() const {return fCEData?static_cast(fCEData->FindObject("CETrms")):0;} + AliTPCCalPad* GetCEQmean() const {return fCEData?static_cast(fCEData->FindObject("CEQmean")):0;} + TObjArray* GetCErocTtime() const {return fCEData?static_cast(fCEData->FindObject("rocTtime")):0;} + TObjArray* GetCErocQtime() const {return fCEData?static_cast(fCEData->FindObject("rocQtime")):0;} + TGraph* GetCErocTgraph(const Int_t roc)const {return GetCErocTtime()?static_cast(GetCErocTtime()->At(roc)):0;} + TGraph* GetCErocQgraph(const Int_t roc)const {return GetCErocQtime()?static_cast(GetCErocQtime()->At(roc)):0;} +// AliTPCSensorTempArray* GetTemperature() {return fTemperature;} AliTPCParam* GetParameters(){return fParam;} AliTPCAltroMapping ** GetMapping(){ return fMapping;} AliTPCClusterParam *GetClusterParam(){ return fClusterParam;} TObjArray *GetTimeGainSplines(){ return fTimeGainSplines;} // - // + //GRP information static AliGRPObject * GetGRP(Int_t run); static TMap * GetGRPMap(Int_t run); static Float_t GetPressure(Int_t timeStamp, Int_t run, Int_t type=0); - //Voltage information + static Float_t GetL3Current(Int_t run, Int_t statType=0); + static Float_t GetBz(Int_t run); + static Char_t GetL3Polarity(Int_t run); + static TString GetRunType(Int_t run); + // static Float_t GetDCSSensorValue(AliDCSSensorArray *arr, Int_t timeStamp, const char * sensorName, Int_t sigDigits=-1); static Float_t GetDCSSensorMeanValue(AliDCSSensorArray *arr, const char * sensorName, Int_t sigDigits=-1); - + //Voltage information static Float_t GetChamberHighVoltage(Int_t run, Int_t sector, Int_t timeStamp=-1, Int_t sigDigits=0); static Float_t GetSkirtVoltage(Int_t run, Int_t sector, Int_t timeStamp=-1, Int_t sigDigits=0); static Float_t GetCoverVoltage(Int_t run, Int_t sector, Int_t timeStamp=-1, Int_t sigDigits=0); static Float_t GetGGoffsetVoltage(Int_t run, Int_t sector, Int_t timeStamp=-1, Int_t sigDigits=0); static Float_t GetGGnegVoltage(Int_t run, Int_t sector, Int_t timeStamp=-1, Int_t sigDigits=0); static Float_t GetGGposVoltage(Int_t run, Int_t sector, Int_t timeStamp=-1, Int_t sigDigits=0); - + //Goofie Values static Float_t GetValueGoofie(Int_t timeStamp, Int_t run, Int_t type); + // static Bool_t GetTemperatureFit(Int_t timeStamp, Int_t run, Int_t side,TVectorD& fit); static Float_t GetTemperature(Int_t timeStamp, Int_t run, Int_t side); static Double_t GetPTRelative(UInt_t timeSec, Int_t run, Int_t side); @@ -97,6 +127,8 @@ class AliTPCcalibDB : public TObject static void ProcessEnv(const char * runList); AliGRPObject * MakeGRPObjectFromMap(TMap *map); + //Create a tree suited for diplaying with the AliTPCCalibViewerGUI + static Bool_t CreateGUITree(Int_t run, const char* filename=""); // protected: @@ -113,6 +145,10 @@ protected: AliTPCCalPad* fPadTime0; // Time0 calibration entry AliTPCCalPad* fPadNoise; // Noise calibration entry AliTPCCalPad* fPedestals; // Pedestal calibration entry + TObjArray *fALTROConfigData; // ALTRO configuration data + TObjArray *fPulserData; // Calibration Pulser data + TObjArray *fCEData; // CE data + // AliTPCSensorTempArray* fTemperature; // Temperature calibration entry AliTPCAltroMapping **fMapping; // Altro mapping // diff --git a/TPC/CalibMacros/CalibEnv.C b/TPC/CalibMacros/CalibEnv.C index ae62f29743e..e447a36d106 100644 --- a/TPC/CalibMacros/CalibEnv.C +++ b/TPC/CalibMacros/CalibEnv.C @@ -26,6 +26,7 @@ if (!gGrid) TGrid::Connect("alien://",0,0,"t"); #include #include +#include #include #include #include @@ -44,18 +45,28 @@ if (!gGrid) TGrid::Connect("alien://",0,0,"t"); #include "TObjString.h" #include "TString.h" #include "AliTPCCalPad.h" +#include "AliTPCROC.h" +#include "AliTPCParam.h" #include "AliTPCCalibPulser.h" #include "AliTPCCalibPedestal.h" #include "AliTPCCalibCE.h" #include "AliTPCExBFirst.h" #include "TTreeStream.h" #include "AliTPCTempMap.h" +#include "TVectorD.h" +#include "TMatrixD.h" TTree * dcsTree=0; void ProcessGoofie( AliDCSSensorArray* goofieArray, TVectorD & vecEntries, TVectorD & vecMedian, TVectorD &vecMean, TVectorD &vecRMS); - +void ProcessCEdata(const char* fitFormula, TVectorD &fitResultsA, TVectorD &fitResultsC); +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 Init(){ // // @@ -101,6 +112,7 @@ void CalibEnv(const char * runList){ in >> irun; if (irun==0) continue; printf("Processing run %d ...\n",irun); + AliTPCcalibDB::Instance()->SetRun(irun); AliDCSSensor * sensorPressure = AliTPCcalibDB::Instance()->GetPressureSensor(irun); if (!sensorPressure) continue; AliTPCSensorTempArray * tempArray = AliTPCcalibDB::Instance()->GetTemperatureSensor(irun); @@ -110,66 +122,101 @@ void CalibEnv(const char * runList){ Int_t startTime = sensorPressure->GetStartTime(); Int_t endTime = sensorPressure->GetEndTime(); Int_t dtime = TMath::Max((endTime-startTime)/20,10*60); + //CE data processing - see ProcessCEdata function for description of the results + TVectorD fitResultsA, fitResultsC; + ProcessCEdata("gx++gy++lx++lx**2",fitResultsA,fitResultsC); + //noise data Processing - see ProcessNoiseData function for description of the results + TVectorD vNoiseMean, vNoiseMeanSenRegions, vNoiseRMS, vNoiseRMSSenRegions; + Int_t nonMaskedZero=0; + ProcessNoiseData(vNoiseMean, vNoiseMeanSenRegions, vNoiseRMS, vNoiseRMSSenRegions, nonMaskedZero); + //L3 data + Float_t bz=AliTPCcalibDB::GetBz(irun); + Char_t l3pol=AliTPCcalibDB::GetL3Polarity(irun); + //calibration Pulser data processing + Int_t nMasked=0; + Int_t nOffChannels=0; + ProcessPulser(nMasked,nOffChannels); + //production information + Int_t nalien=0,nlocal=0; + GetProductionInfo(irun, nalien, nlocal); + //run type + TObjString runType(AliTPCcalibDB::GetRunType(irun).Data()); + for (Int_t itime=startTime; itimeGetPressure(tstamp,irun,0); Float_t valuePressure2 = calibDB->GetPressure(tstamp,irun,1); - + //temperature fits TLinearFitter * fitter = 0; TVectorD vecTemp[10]; for (Int_t itype=0; itype<5; itype++) - for (Int_t iside=0; iside<2; iside++){ - fitter= tempMap->GetLinearFitter(itype,iside,tstamp); - if (!fitter) continue; - fitter->Eval(); - fitter->GetParameters(vecTemp[itype+iside*5]); - delete fitter; - } - + for (Int_t iside=0; iside<2; iside++){ + fitter= tempMap->GetLinearFitter(itype,iside,tstamp); + if (!fitter) continue; + fitter->Eval(); + fitter->GetParameters(vecTemp[itype+iside*5]); + delete fitter; + } + //measured skirt temperatures + TVectorD vecSkirtTempA(18); + TVectorD vecSkirtTempC(18); + Int_t nsenTemp=tempArray->NumSensors(); + for (Int_t isenTemp=0;isenTempGetSensorNum(isenTemp); + if (senTemp->GetType()!=3) continue; + if (TMath::Sqrt(senTemp->GetX()*senTemp->GetX()+senTemp->GetY()*senTemp->GetY())<100) continue; //only skirt, outer FC vessel + Double_t val=senTemp->GetValue(tstamp); + if (senTemp->GetSide()==0) + vecSkirtTempA[senTemp->GetSector()]=val; + else + vecSkirtTempC[senTemp->GetSector()]=val; + } TVectorD vecGoofie, vecEntries, vecMean, vecMedian,vecRMS; - if (goofieArray){ - vecGoofie.ResizeTo(goofieArray->NumSensors()); - ProcessGoofie(goofieArray, vecEntries ,vecMedian, vecMean, vecRMS); - // - for (Int_t isensor=0; isensorNumSensors();isensor++){ - AliDCSSensor *gsensor = goofieArray->GetSensor(isensor); - if (gsensor){ - vecGoofie[isensor] = gsensor->GetValue(tstamp); - } - } + if (goofieArray){ + vecGoofie.ResizeTo(goofieArray->NumSensors()); + ProcessGoofie(goofieArray, vecEntries ,vecMedian, vecMean, vecRMS); + // + for (Int_t isensor=0; isensorNumSensors();isensor++){ + AliDCSSensor *gsensor = goofieArray->GetSensor(isensor); + if (gsensor){ + vecGoofie[isensor] = gsensor->GetValue(tstamp); + } + } } Double_t ptrelative0 = AliTPCcalibDB::GetPTRelative(tstamp,irun,0); Double_t ptrelative1 = AliTPCcalibDB::GetPTRelative(tstamp,irun,1); // - TVectorD voltagesIROC(36); - TVectorD voltagesOROC(36); + TVectorD voltagesIROC(36); + TVectorD voltagesOROC(36); for(Int_t j=1; j<36; j++) voltagesIROC[j-1] = AliTPCcalibDB::Instance()->GetChamberHighVoltage(irun, j,tstamp); for(Int_t j=36; j<72; j++) voltagesOROC[j-36] = AliTPCcalibDB::Instance()->GetChamberHighVoltage(irun, j,tstamp); Double_t voltIROC = TMath::Median(36, voltagesIROC.GetMatrixArray()); Double_t voltOROC = TMath::Median(36, voltagesOROC.GetMatrixArray()); // - Float_t coverIA=AliTPCcalibDB::GetCoverVoltage(irun,0,tstamp); - Float_t coverIC=AliTPCcalibDB::GetCoverVoltage(irun,18,tstamp); - Float_t coverOA=AliTPCcalibDB::GetCoverVoltage(irun,36,tstamp); - Float_t coverOC=AliTPCcalibDB::GetCoverVoltage(irun,54,tstamp); - Float_t skirtA=AliTPCcalibDB::GetSkirtVoltage(irun,0,tstamp); - Float_t skirtC=AliTPCcalibDB::GetSkirtVoltage(irun,18,tstamp); - Float_t ggOffA=AliTPCcalibDB::GetGGoffsetVoltage(irun,0,tstamp); - Float_t ggOffC=AliTPCcalibDB::GetGGoffsetVoltage(irun,18,tstamp); - - - + Float_t coverIA=AliTPCcalibDB::GetCoverVoltage(irun,0,itime); + Float_t coverIC=AliTPCcalibDB::GetCoverVoltage(irun,18,itime); + Float_t coverOA=AliTPCcalibDB::GetCoverVoltage(irun,36,itime); + Float_t coverOC=AliTPCcalibDB::GetCoverVoltage(irun,54,itime); + Float_t skirtA=AliTPCcalibDB::GetSkirtVoltage(irun,0,itime); + Float_t skirtC=AliTPCcalibDB::GetSkirtVoltage(irun,18,itime); + Float_t ggOffA=AliTPCcalibDB::GetGGoffsetVoltage(irun,0,itime); + Float_t ggOffC=AliTPCcalibDB::GetGGoffsetVoltage(irun,18,itime); + + + //tempMap->GetLinearFitter(0,0,itime); (*pcstream)<<"dcs"<< - "run="<GetCETmean(); + if (!cet0){ + TString fitString(fitFormula); + fitString.ReplaceAll("++","#"); + Int_t ndim=fitString.CountChar('#')+1; + fitResultsA.ResizeTo(ndim); + fitResultsC.ResizeTo(ndim); + return; + } + AliTPCCalPad padT0(*cet0); + AliTPCCalPad *padMasked=AliTPCcalibDB::Instance()->GetALTROMasked(); + //create outlier map + AliTPCCalPad out("out","out"); + //loop over all channels + for (UInt_t iroc=0;irocGetCalROC(iroc); + AliTPCCalROC *rocOut=out.GetCalROC(iroc); + if (!rocData) continue; + //add time offset to IROCs + if (irocGetNInnerSector()) + rocData->Add(irocToffset); + //select outliers + for (UInt_t ichannel=0;ichannelGetNchannels();++ichannel){ + if (rocMasked && rocMasked->GetValue(ichannel)) rocOut->SetValue(ichannel,1); + Float_t valTmean=rocData->GetValue(ichannel); + if (valTmean==0) rocOut->SetValue(ichannel,1); //exclude values that are exactly 0 + if (TMath::Abs(valTmean)>tMaxLimit) rocOut->SetValue(ichannel,1); // exclude channels with too large variations + } + } + //perform fit + TMatrixD dummy; + Float_t chi2A,chi2C; + padT0.GlobalSidesFit(&out,fitFormula,fitResultsA,fitResultsC,dummy,dummy,chi2A,chi2C); +} + +void ProcessNoiseData(TVectorD &vNoiseMean, TVectorD &vNoiseMeanSenRegions, + TVectorD &vNoiseRMS, TVectorD &vNoiseRMSSenRegions, + Int_t &nonMaskedZero) +{ + // + // process noise data + // vNoiseMean/RMS contains the Mean/RMS noise of the complete TPC [0], IROCs only [1], + // OROCs small pads [2] and OROCs large pads [3] + // vNoiseMean/RMSsenRegions constains the same information, but only for the sensitive regions (edge pads, corners, IROC spot) + // + + //set proper size and reset + const UInt_t infoSize=4; + vNoiseMean.ResizeTo(infoSize); + vNoiseMeanSenRegions.ResizeTo(infoSize); + vNoiseRMS.ResizeTo(infoSize); + vNoiseRMSSenRegions.ResizeTo(infoSize); + vNoiseMean.Zero(); + vNoiseMeanSenRegions.Zero(); + vNoiseRMS.Zero(); + vNoiseRMSSenRegions.Zero(); + //counters + TVectorD c(infoSize); + TVectorD cs(infoSize); + //tpc parameters + AliTPCParam par; + par.Update(); + //retrieve noise and ALTRO data + AliTPCCalPad *noise=AliTPCcalibDB::Instance()->GetPadNoise(); + AliTPCCalPad *padMasked=AliTPCcalibDB::Instance()->GetALTROMasked(); + //create IROC, OROC1, OROC2 and sensitive region masks + for (UInt_t isec=0;isecGetCalROC(isec); + UInt_t nrows=noiseROC->GetNrows(); + for (UInt_t irow=0;irowGetNPads(irow); + for (UInt_t ipad=0;ipadGetCalROC(isec)->GetValue(irow,ipad); + Float_t noiseVal=noiseROC->GetValue(irow,ipad); + if (masked) continue; // don't use inactive pads + //check if noise==0 + if (noiseVal==0) ++nonMaskedZero; + Int_t cpad=(Int_t)ipad-(Int_t)npads/2; + Int_t masksen=1; // sensitive pards are not masked (0) + if (ipad<2||npads-ipad-1<2) masksen=0; //don't mask edge pads (sensitive) + if (isecGetNInnerSector()){ + //IROCs + if (irow>19&&irow<46){ + if (TMath::Abs(cpad)<7) masksen=0; //IROC spot + } + Int_t type=1; + vNoiseMean[type]+=noiseVal; + vNoiseRMS[type]+=noiseVal*noiseVal; + ++c[type]; + if (!masksen){ + vNoiseMeanSenRegions[type]+=noiseVal; + vNoiseRMSSenRegions[type]+=noiseVal*noiseVal; + ++cs[type]; + } + } else { + //OROCs + //define sensive regions + if ((nrows-irow-1)<3) masksen=0; //last three rows in OROCs are sensitive + if ( irow>75 ){ + Int_t padEdge=(Int_t)TMath::Min(ipad,npads-ipad); + if (padEdge<((((Int_t)irow-76)/4+1))*2) masksen=0; //OROC outer corners are sensitive + } + if ((Int_t)irowverySmall){ + mean=vNoiseMean[i]/c[i]; + rms=vNoiseRMS[i]; + rms=TMath::Sqrt(TMath::Abs(rms/c[i]-mean*mean)); + } + vNoiseMean[i]=mean; + vNoiseRMS[i]=rms; + + if (cs[i]>verySmall){ + meanSen=vNoiseMeanSenRegions[i]/cs[i]; + rmsSen=vNoiseRMSSenRegions[i]; + rmsSen=TMath::Sqrt(TMath::Abs(rmsSen/cs[i]-meanSen*meanSen)); + } + vNoiseMeanSenRegions[i]=meanSen; + vNoiseRMSSenRegions[i]=rmsSen; + } +} + +void ProcessPulser(Int_t &nMasked, Int_t &nonMaskedZero) +{ + // + // Process the Pulser information + // + + //reset counters + nonMaskedZero=0; + nMasked=0; + //retrieve pulser and ALTRO data + AliTPCCalPad *pulserTmean=AliTPCcalibDB::Instance()->GetPulserTmean(); +// 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); +// AliTPCCalROC *trmsROC=pulserTrms->GetCalROC(isec); +// AliTPCCalROC *qmeanROC=pulserQmean->GetCalROC(isec); + Float_t tmeanMedian=tmeanROC->GetMedian(); + UInt_t nrows=tmeanROC->GetNrows(); + for (UInt_t irow=0;irowGetNPads(irow); + for (UInt_t ipad=0;ipadGetCalROC(isec)->GetValue(irow,ipad); + Float_t tmeanVal=tmeanROC->GetValue(irow,ipad); +// Float_t trmsVal =trmsROC->GetValue(irow,ipad); +// Float_t qmeanVal=qmeanROC->GetValue(irow,ipad); + if (masked){ + ++nMasked; + continue; // don't use inactive pads + } + if ( TMath::Abs(tmeanVal-tmeanMedian)>1.5 ) ++nonMaskedZero; + } + } + } +} + +void GetProductionInfo(Int_t run, Int_t &nalien, Int_t &nlocal){ + // + // find number of ESDs in central and local production for run + // + + nalien=0; + nlocal=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); + nalien=sNlines.Atoi(); + //find number of ESDs local + command="find /lustre/alice/alien/alice/data/2009 -name "; + command += Form("%09d",run); + command += " | grep AliESDs.root | wc -l"; + pipe = gSystem->OpenPipe(command.Data(),"r"); + sNlines.Gets(pipe); + gSystem->ClosePipe(pipe); + nlocal=sNlines.Atoi(); +} void FilterMag(const char * runList){ // @@ -278,7 +586,7 @@ void FilterMag(const char * runList){ AliGRPObject *grp = AliTPCcalibDB::GetGRP(irun); Float_t current = -1; Float_t bz = -1; - Float_t press = 0; +// Float_t press = 0; if (grp){ current = grp->GetL3Current((AliGRPObject::Stats)0); bz = 5*current/30000.; @@ -294,12 +602,12 @@ void FilterMag(const char * runList){ void GetTree(){ TFile *fdcs = new TFile("dcsTime.root"); - dcsTree = (TTree*)fdcs->Get("dcs"); + dcsTree = (TTree*)fdcs->Get("dcs"); // // mean temp A - + dcsTree->Draw("temp30.fElements[0]"); - + } void GetNominalValues(){ @@ -333,7 +641,7 @@ void PlotPressureResol(){ his->SetXTitle("#sigma_{P/P_{0}}(10^{-5})"); gPad->SaveAs("picDCS/deltaPoverP.eps"); gPad->SaveAs("picDCS/deltaPoverP.gif"); - + } void PlotTresol(){ // diff --git a/TPC/TPCCEda.cxx b/TPC/TPCCEda.cxx index 0e67f3da2b2..cfa3edab477 100644 --- a/TPC/TPCCEda.cxx +++ b/TPC/TPCCEda.cxx @@ -206,11 +206,19 @@ 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; - +// 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 faca07b9d6b..792eb88c42f 100644 --- a/TPC/TPCPEDESTALda.cxx +++ b/TPC/TPCPEDESTALda.cxx @@ -223,10 +223,11 @@ 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; +// AliRawReader *rawReader = new AliRawReaderDate((void*)event); +// if ( fastDecoding ) calibPedestal.ProcessEventFast(rawReader); +// else calibPedestal.ProcessEvent(rawReader); +// delete rawReader; + calibPedestal.ProcessEvent(event); /* free resources */ free(event); diff --git a/TPC/TPCPULSERda.cxx b/TPC/TPCPULSERda.cxx index 54e50ce0404..ef4059c9d87 100644 --- a/TPC/TPCPULSERda.cxx +++ b/TPC/TPCPULSERda.cxx @@ -198,10 +198,11 @@ 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; +// AliRawReader *rawReader = new AliRawReaderDate((void*)event); +// if ( fastDecoding ) calibPulser.ProcessEventFast(rawReader); +// else calibPulser.ProcessEvent(rawReader); +// delete rawReader; + calibPulser.ProcessEvent(event); /* free resources */ free(event); diff --git a/TPC/TPCRAWda.cxx b/TPC/TPCRAWda.cxx index 2355ae66886..9f730a557f5 100644 --- a/TPC/TPCRAWda.cxx +++ b/TPC/TPCRAWda.cxx @@ -188,8 +188,8 @@ int main(int argc, char **argv) { // get the run number runNb = event->eventRunNb; // Pulser calibration - AliRawReader *rawReader = new AliRawReaderDate((void*)event); - calibRaw.ProcessEvent(rawReader); +// AliRawReader *rawReader = new AliRawReaderDate((void*)event); + calibRaw.ProcessEvent(event); delete rawReader; /* free resources */ diff --git a/TPC/TPCbaseLinkDef.h b/TPC/TPCbaseLinkDef.h index 0a4610d1110..331364b5ecf 100644 --- a/TPC/TPCbaseLinkDef.h +++ b/TPC/TPCbaseLinkDef.h @@ -57,7 +57,9 @@ #pragma link C++ class AliTPCPreprocessorOnline+; #pragma link C++ class AliTPCCalibViewer+; #pragma link C++ class AliTPCCalibViewerGUI+; +#pragma link C++ class AliTPCCalibViewerGUItime+; #pragma link C++ class AliTPCConfigDA+; +#pragma link C++ class AliTPCConfigParser+; #pragma link C++ class AliTPCCalibVdrift+; #pragma link C++ class AliTPCGoofieValues+; diff --git a/TPC/libTPCbase.pkg b/TPC/libTPCbase.pkg index d74a8160f79..0044ba805ac 100644 --- a/TPC/libTPCbase.pkg +++ b/TPC/libTPCbase.pkg @@ -14,13 +14,13 @@ SRCS:= AliSegmentID.cxx AliSegmentArray.cxx AliDigits.cxx AliH2F.cxx \ AliTPCCalibRawBase.cxx AliTPCCalibPedestal.cxx AliTPCCalibPulser.cxx AliTPCCalibCE.cxx \ AliTPCCalibRaw.cxx \ AliTPCPreprocessor.cxx AliTPCPreprocessorOnline.cxx \ - AliTPCCalibViewer.cxx AliTPCCalibViewerGUI.cxx \ + AliTPCCalibViewer.cxx AliTPCCalibViewerGUI.cxx AliTPCCalibViewerGUItime.cxx \ AliTPCGenDBTemp.cxx AliTPCGenDBConf.cxx \ AliTPCExB.cxx AliTPCExBExact.cxx AliTPCExBFirst.cxx \ AliTPCTempMap.cxx AliTPCCalibVdrift.cxx \ AliTPCCalibTCF.cxx AliTPCAltroEmulator.cxx AliTPCeventInfo.cxx \ AliTransform.cxx AliTPCTransform.cxx AliTPCAlign.cxx AliTPCGoofieValues.cxx \ - AliTPCdataQA.cxx AliTPCQAChecker.cxx AliTPCConfigDA.cxx AliExternalComparison.cxx \ + AliTPCdataQA.cxx AliTPCQAChecker.cxx AliTPCConfigDA.cxx AliTPCConfigParser.cxx AliExternalComparison.cxx \ AliTPCkalmanTime.cxx AliESDcosmic.cxx AliTPCPointCorrection.cxx AliTPCTransformation.cxx \ AliTPCkalmanFit.cxx -- 2.43.0