From ca7b83710f8744c6c9af3abe7507c847dc4e99bc Mon Sep 17 00:00:00 2001 From: cvetan Date: Fri, 12 Oct 2007 13:36:27 +0000 Subject: [PATCH] Coding convention fixes from Stefan --- TPC/AliTPCMonitor.cxx | 1214 ++++++++++++++++----------- TPC/AliTPCMonitor.h | 195 ++--- TPC/AliTPCMonitorAltro.cxx | 151 +++- TPC/AliTPCMonitorAltro.h | 86 +- TPC/AliTPCMonitorConfig.cxx | 239 ++++-- TPC/AliTPCMonitorConfig.h | 238 +++--- TPC/AliTPCMonitorDateFile.cxx | 77 +- TPC/AliTPCMonitorDateFile.h | 23 +- TPC/AliTPCMonitorDateFormat.cxx | 60 +- TPC/AliTPCMonitorDateFormat.h | 10 +- TPC/AliTPCMonitorDateMonitor.cxx | 45 +- TPC/AliTPCMonitorDateMonitor.h | 24 +- TPC/AliTPCMonitorDialog.cxx | 84 +- TPC/AliTPCMonitorDialog.h | 67 +- TPC/AliTPCMonitorFFT.cxx | 17 + TPC/AliTPCMonitorMappingHandler.cxx | 157 +++- TPC/AliTPCMonitorMappingHandler.h | 15 +- 17 files changed, 1738 insertions(+), 964 deletions(-) diff --git a/TPC/AliTPCMonitor.cxx b/TPC/AliTPCMonitor.cxx index 49c6532c949..4763d1a7c2f 100755 --- a/TPC/AliTPCMonitor.cxx +++ b/TPC/AliTPCMonitor.cxx @@ -15,136 +15,149 @@ /* $Log$ +Revision 1.2 2007/09/18 09:44:45 cvetan +Sorting out some issues concerning the compilation with and without DATE support + Revision 1.1 2007/09/17 10:23:31 cvetan New TPC monitoring package from Stefan Kniege. The monitoring package can be started by running TPCMonitor.C macro located in macros folder. */ -#include "AliTPCMonitor.h" -#ifdef ALI_DATE +//////////////////////////////////////////////////////////////////////// +// +// AliTPCMonitor class +// +// Main class for TPC Monitor +// Monitor can handle rootified data, files and online streams in DATE format. +// The monitor GUI is started by the macro TPCMonitor.C +// +// In the The data are read in in two read cycles. +// If no sector is specified (sectorid==-1) all sectors are read and only the max value +// for each channel is stored in a global histogram for Side A and C. +// In this way the whole TPC can be read in at once. +// +// If the sector is specified only one sector is read in and additional quantities +// e.g baseline and baseline rms are calculated and stored. +// +// Author: Stefan Kniege, IKF, Frankfurt +// +// +///////////////////////////////////////////////////////////////////////// + + + +#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 "TH2F.h" +#include "TF1.h" +#include "TMath.h" +#include "TCanvas.h" +#include "TH3S.h" +#include "TLegend.h" +#include "TROOT.h" +#include "TDirectory.h" +#include "TSystem.h" +#include "TPaveText.h" +#include "TFile.h" +#include #include "AliTPCMonitorDateMonitor.h" -#endif + ClassImp(AliTPCMonitor) //____________________________________________________________________________ -AliTPCMonitor::AliTPCMonitor(char* name, char* title) : AliTPCMonitorConfig(name,title) +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) { - // Constructor + // Constructor - fPad = new Int_t*[GetMaxHwAddr()]; for(Int_t i = 0; iGetList()) { Warning("Build","Current directory is not a valid directory"); - return; + return; } AliTPCMonitor *hold = (AliTPCMonitor*)gDirectory->GetList()->FindObject(GetName()); if(hold) @@ -153,18 +166,273 @@ AliTPCMonitor::AliTPCMonitor(char* name, char* title) : AliTPCMonitorConfig(name gDirectory->GetList()->Remove(hold); } gDirectory->Append(this); - } - - fHistList = new TObjArray(); + } + CreateHistos(); + SetEqIds(); - fGdcId = 0; - fLdcId = 0; - fLdcIdOld = -1; +} - CreateHistos(); +//____________________________________________________________________________ +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) +{ + // copy constructor + + 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"); + + } + 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); + } + } +} + + +//____________________________________________________________________________ +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; + 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; + } + return *this; } + + //____________________________________________________________________________ AliTPCMonitor::~AliTPCMonitor() { @@ -182,23 +450,23 @@ void AliTPCMonitor::CreateHistos() // Create histograms to be displayed if(fVerb) cout << " create new ones " << endl; - fHistIROC = new TH2F("fHistIROC" ,"fHistIROC" ,kNRowsIroc,0,kNRowsIroc,kNPadsIroc, kNPadMinIroc, kNPadMaxIroc); fHistList->Add(fHistIROC); - fHistOROC = new TH2F("fHistOROC" ,"fHistOROC" ,kNRowsOroc,0,kNRowsOroc,kNPadsOroc, kNPadMinOroc, kNPadMaxOroc); fHistList->Add(fHistOROC); + 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); - fHistIROCIndex = new TH2S("fHistIROCIndex" ,"fHistIROCIndex" ,kNRowsIroc,0,kNRowsIroc,kNPadsIroc, kNPadMinIroc, kNPadMaxIroc); fHistList->Add(fHistIROCIndex); - fHistOROCIndex = new TH2S("fHistOROCIndex" ,"fHistOROCIndex" ,kNRowsOroc,0,kNRowsOroc,kNPadsOroc, kNPadMinOroc, kNPadMaxOroc); fHistList->Add(fHistOROCIndex); + 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" ,kNRowsIroc,0,kNRowsIroc,kNPadsIroc, kNPadMinIroc, kNPadMaxIroc); fHistList->Add(fHistIROCTime); - fHistOROCTime = new TH2F("fHistOROCTime" ,"fHistOROCTime" ,kNRowsOroc,0,kNRowsOroc,kNPadsOroc, kNPadMinOroc, kNPadMaxOroc); fHistList->Add(fHistOROCTime); + 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" ,kNRowsIroc,0,kNRowsIroc,kNPadsIroc, kNPadMinIroc, kNPadMaxIroc); fHistList->Add(fHistIROCRMS); - fHistOROCRMS = new TH2F("fHistOROCRMS" ,"fHistOROCRMS" ,kNRowsOroc,0,kNRowsOroc,kNPadsOroc, kNPadMinOroc, kNPadMaxOroc); fHistList->Add(fHistOROCRMS); + 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" ,kNRowsIroc,0,kNRowsIroc,kNPadsIroc, kNPadMinIroc, kNPadMaxIroc); fHistList->Add(fHistIROCSUM); - fHistOROCSUM = new TH2F("fHistOROCSUM" ,"fHistOROCSUM" ,kNRowsOroc,0,kNRowsOroc,kNPadsOroc, kNPadMinOroc, kNPadMaxOroc); fHistList->Add(fHistOROCSUM); + 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" ,kNRowsIroc,0,kNRowsIroc,kNPadsIroc, kNPadMinIroc, kNPadMaxIroc); fHistList->Add(fHistIROCBASE); - fHistOROCBASE = new TH2F("fHistOROCBASE" ,"fHistOROCBASE" ,kNRowsOroc,0,kNRowsOroc,kNPadsOroc, kNPadMinOroc, kNPadMaxOroc); fHistList->Add(fHistOROCBASE); + 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); @@ -276,7 +544,7 @@ Int_t AliTPCMonitor::ProcessEvent() //__________________________________________________________________ Int_t AliTPCMonitor::ReadData(Int_t secid) { - // Read Data File/Stream for specified Format. + // 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 @@ -308,7 +576,7 @@ Int_t AliTPCMonitor::ReadDataDATEFile(Int_t secid) #endif Char_t* eventPtr = 0; - AliTPCMonitorDateFormat* DateForm = 0; + AliTPCMonitorDateFormat* dateform = 0; // Create objects // if( fReaderDATE==0 || ( fReaderDATE!=0 && (strcmp(GetLastProcFile(),GetFile())!=0) ) ) @@ -324,33 +592,33 @@ Int_t AliTPCMonitor::ReadDataDATEFile(Int_t secid) // 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(); } + if(fEventNumberOld>fEventNumber ) { fReaderDATE->ResetFilePos(); } while(GetProcNextEvent() || fEventNumber==0) { fReaderDATE->ReadEvent(); eventPtr = fReaderDATE->GetMemoryPointer(); - DateForm = new AliTPCMonitorDateFormat(eventPtr); - Int_t current_ev = DateForm->GetEventID(); - if(fEventNumber <= current_ev ){ break; } + 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(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(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; } + if(dateform->IsEventPhysicsEvent() == false ) {AliInfo("Skipping Header/event because not Physics event"); return 12; } ResetHistos() ; - Int_t lastrcu = ReadDataDATESubEventLoop(DateForm,secid); + Int_t lastrcu = ReadDataDATESubEventLoop(dateform,secid); - delete DateForm; + delete dateform; if(fVerb) cout << " last rcu " << lastrcu << endl; return lastrcu; } @@ -369,7 +637,7 @@ Int_t AliTPCMonitor::ReadDataDATEStream(Int_t secid) Char_t* eventPtr = 0; - AliTPCMonitorDateFormat* DateForm =0 ; + AliTPCMonitorDateFormat* dateform =0 ; // Create objects /// if((fReaderDATEMon==0 || ( fReaderDATEMon!=0 && (strcmp(GetLastProcFile(),GetFile())!=0) ))) @@ -395,18 +663,18 @@ Int_t AliTPCMonitor::ReadDataDATEStream(Int_t secid) eventPtr = fReaderDATEMon->GetEventPointerasChar(); - if(DateForm==0) DateForm = new AliTPCMonitorDateFormat(eventPtr); - fEventNumber = DateForm->GetEventID(); - fEventNumberOld = DateForm->GetEventID(); + 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; } + 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); + Int_t lastrcu = ReadDataDATESubEventLoop(dateform,secid); - delete DateForm; + delete dateform; if(fVerb) cout << " last rcu " << lastrcu << endl; return lastrcu; } @@ -424,15 +692,15 @@ Int_t AliTPCMonitor::ReadDataDATEStream(Int_t /*secid*/) } #endif -Int_t AliTPCMonitor::ReadDataDATESubEventLoop(AliTPCMonitorDateFormat* DateForm, Int_t secid) +Int_t AliTPCMonitor::ReadDataDATESubEventLoop(AliTPCMonitorDateFormat* dateform, Int_t secid) { // Loop over DATE Subevents Bool_t exitSubEventLoop = false; - Int_t last_rcu_id = 0; - Int_t last_eq = 0; + Int_t lastrcuid = 0; + Int_t lasteq = 0; Int_t start = 1; - Int_t rcu_patch = 0; + Int_t rcupatch = 0; Char_t* eventPtr = 0; UInt_t* eventPtrUI = 0; @@ -440,26 +708,26 @@ Int_t AliTPCMonitor::ReadDataDATESubEventLoop(AliTPCMonitorDateFormat* DateForm, while(exitSubEventLoop == false) { - if(start==1) { DateForm->GotoSubEventHeader() ; start=0;} - else { DateForm->GotoNextSubEventHeader(); } - if(DateForm->IsLastSubEventHeader()) exitSubEventLoop = true; + 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; + if(fVerb) cout << " next subevent LDC " << (Int_t)dateform->GetSubEventLDC() << endl; - last_eq = 0 ; + lasteq = 0 ; Int_t neq = 0 ; - while(last_eq==0) + while(lasteq==0) { - if(neq ==0){ DateForm->GotoFirstEquipment();} - else { DateForm->GotoNextEquipment();} + if(neq ==0){ dateform->GotoFirstEquipment();} + else { dateform->GotoNextEquipment();} - fGdcId = DateForm->GetSubEventGDC() ; - fLdcId = DateForm->GetSubEventLDC(); - fRunId = DateForm->GetEventRunID(); - fEqId = DateForm->GetEquipmentID(); - rcu_patch = GetRCUPatch(fRunId, fEqId); - last_rcu_id = (rcu_patch+1000); + 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) { @@ -471,19 +739,19 @@ Int_t AliTPCMonitor::ReadDataDATESubEventLoop(AliTPCMonitorDateFormat* DateForm, } else { - return last_rcu_id; + return lastrcuid; } } fLdcIdOld = fLdcId ; - if(DateForm->IsLastEquipment() != false ) last_eq = 1; + if(dateform->IsLastEquipment() != false ) lasteq = 1; - eventPtr = DateForm->GetFirstDataPointer(); + eventPtr = dateform->GetFirstDataPointer(); eventPtrUI = (UInt_t *) eventPtr; - Int_t payload = DateForm->GetPayloadSize(); + Int_t payload = dateform->GetPayloadSize(); - if(fVerb)DumpHeader(DateForm); + if(fVerb)DumpHeader(dateform); if(fVerb) cout << "Check sector and fEqId " << endl; if(fVerb && secid >0 ) @@ -502,16 +770,16 @@ Int_t AliTPCMonitor::ReadDataDATESubEventLoop(AliTPCMonitorDateFormat* DateForm, if(fVerb) cout << " allocated 10bit " << endl; altro->Allocate10BitArray(); altro->Decodeto10Bit(fEqId); - AliInfo(Form("Process eqid %i , patch %i ",fEqId,rcu_patch%6)); - FillHistsDecode(altro,(rcu_patch%6),secid); - if(fChannelIter!=0 && secid==-1 ) SetSectorFilled(rcu_patch/6); + 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(rcu_patch/6); + SetLastSector(rcupatch/6); } if(fChannelIter!=0 && secid==-1){ FillGlobal(GetLastSector()); } - return last_rcu_id; + return lastrcuid; } //__________________________________________________________________ @@ -520,18 +788,18 @@ Int_t AliTPCMonitor::ReadDataROOT(Int_t secid) // Read in data in ROOT format if(fReaderDATE){ delete fReaderDATE ; fReaderDATE=0;} fChannelIter =0; - Int_t last_rcu_id = 0; - Int_t rcu_patch = 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()); + fReaderROOT = new AliRawReaderRoot(GetFile()); if(!fReaderROOT) { AliError("Could not initiate AliRawReaderRoo "); return 10;} fEventNumber=0; } @@ -546,9 +814,9 @@ Int_t AliTPCMonitor::ReadDataROOT(Int_t secid) { if(fVerb) cout << "AliTPCMonitor::ReadDataROOT get event " << endl; if(!fReaderROOT->NextEvent()) { AliError("Could not get next Event"); return 11 ;} - Int_t current_ev = *(fReaderROOT->GetEventId()); + Int_t currentev = *(fReaderROOT->GetEventId()); - if(fEventNumber <= current_ev ){ break; } + if(fEventNumber <= currentev ){ break; } } fEventNumber = *(fReaderROOT->GetEventId()); @@ -565,8 +833,8 @@ Int_t AliTPCMonitor::ReadDataROOT(Int_t secid) equipmentSize = fReaderROOT->GetEquipmentSize(); fEqId = fReaderROOT->GetEquipmentId(); evtype = fReaderROOT->GetType(); - rcu_patch = GetRCUPatch(fRunId, fEqId); - last_rcu_id = (rcu_patch+1000); + 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; } @@ -582,7 +850,7 @@ Int_t AliTPCMonitor::ReadDataROOT(Int_t secid) } else { - return last_rcu_id; + return lastrcuid; } } fLdcIdOld = fLdcId ; @@ -599,35 +867,35 @@ Int_t AliTPCMonitor::ReadDataROOT(Int_t secid) altro->SetActFilename(GetFile()); altro->Allocate10BitArray(); altro->Decodeto10Bit(fEqId); - AliInfo(Form("Process sector %i eqid %i , patch %i ",rcu_patch/6,fEqId,rcu_patch%6)); - FillHistsDecode(altro,(rcu_patch%6),secid); - if(fChannelIter!=0 && secid==-1 ) SetSectorFilled(rcu_patch/6); + 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(rcu_patch/6); + SetLastSector(rcupatch/6); } if(fChannelIter!=0 && secid==-1) { FillGlobal(GetLastSector()); } - return last_rcu_id; + return lastrcuid; } //____________________________________________________________________________ -void AliTPCMonitor::FillHistsDecode(AliTPCMonitorAltro* altro ,Int_t rcu_patch, Int_t secid) +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 : rcu_patch " << rcu_patch << " id " << secid << endl; - Int_t time_stamp = 0; - Int_t sample_iter = 0; - Int_t sample_length = 0; - Int_t sample_bins = 0; + 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 max_x = 0; + Float_t maxx = 0; Float_t sum = 0.0; Int_t sumn = 0; - Int_t block_pos = 0; + Int_t blockpos = 0; Int_t hw = 0; Int_t nwords = 0; Int_t nextHwAddress = 0; @@ -636,8 +904,8 @@ void AliTPCMonitor::FillHistsDecode(AliTPCMonitorAltro* altro ,Int_t rcu_patch, Int_t nextpos = 0; Int_t lastpos = altro->Get10BitArraySize()-1; Short_t* entries = altro->Get10BitArray(); - Double_t h_rms = 0.0; - Double_t h_mean = 0.0; + 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)); @@ -648,10 +916,10 @@ void AliTPCMonitor::FillHistsDecode(AliTPCMonitorAltro* altro ,Int_t rcu_patch, if(nextpos==-1) { break; } lastpos = nextpos; - block_pos = altro->GetTrailerBlockPos(); + blockpos = altro->GetTrailerBlockPos(); hw = altro->GetTrailerHwAddress(); nwords = altro->GetTrailerNWords(); - nextHwAddress = ( hw + (rcu_patch<<12) ); + nextHwAddress = ( hw + (rcupatch<<12) ); fPad[fChannelIter][0] = nextHwAddress ; if(fPadMapHw[nextHwAddress]!=-1 ) @@ -668,7 +936,7 @@ void AliTPCMonitor::FillHistsDecode(AliTPCMonitorAltro* altro ,Int_t rcu_patch, fPad[fChannelIter-1][0] = hwreset; fPadMapHw[hwreset] = fChannelIter-1 ; - fPadMapRCU[hwreset][0]= rcu_patch ; + fPadMapRCU[hwreset][0]= rcupatch ; fPadMapRCU[hwreset][1]= ((hwreset & AliTPCMonitorAltro::GetHwMaskBranch()) >> 11); fPadMapRCU[hwreset][2]= ((hwreset & AliTPCMonitorAltro::GetHwMaskFEC()) >>7 ); fPadMapRCU[hwreset][3]= ( hwreset & AliTPCMonitorAltro::GetHwMaskFECChannel() ); @@ -678,78 +946,78 @@ void AliTPCMonitor::FillHistsDecode(AliTPCMonitorAltro* altro ,Int_t rcu_patch, } fPadMapHw[nextHwAddress] = fChannelIter ; - fPadMapRCU[nextHwAddress][0]= rcu_patch ; + 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(); - time_stamp = 0; - sample_iter = 0; - sample_length = 0; - sample_bins = 0; + timestamp = 0; + sampleiter = 0; + samplelength = 0; + samplebins = 0; max = 0.0; - max_x = 0.0; + maxx = 0.0; sum = 0.0; sumn = 0; hbase->Reset(); - for(Int_t iter_words = 0 ; iter_words< nwords ; iter_words++) + for(Int_t iterwords = 0 ; iterwords< nwords ; iterwords++) { - if(entries[block_pos-iter_words]==682) { continue; } - if(entries[block_pos-iter_words]!=682 && sample_iter==0) + if(entries[blockpos-iterwords]==682) { continue; } + if(entries[blockpos-iterwords]!=682 && sampleiter==0) { - sample_length = entries[block_pos-iter_words]; - sample_iter = sample_length; - sample_bins = 0; - time_stamp = entries[block_pos-iter_words-1]; - iter_words++; + samplelength = entries[blockpos-iterwords]; + sampleiter = samplelength; + samplebins = 0; + timestamp = entries[blockpos-iterwords-1]; + iterwords++; } else { - ntime = time_stamp-sample_bins; - adc = entries[block_pos-iter_words]; + ntime = timestamp-samplebins; + adc = entries[blockpos-iterwords]; fPad[fChannelIter][ntime] = adc; if( (adc!=0) && (ntime>=GetRangeBaseMin() ) && (ntimeFill(adc) ;} - if( (adc>max) && (ntime>=GetRangeMaxAdcMin()) && (ntimemax) && (ntime>=GetRangeMaxAdcMin()) && (ntime=GetRangeSumMin()) && (ntimeGetMean(); - hbase->GetXaxis()->SetRangeUser(h_mean- h_mean/3 , h_mean + h_mean/3); - h_mean = hbase->GetMean(); - h_rms = hbase->GetRMS(); + hmean = hbase->GetMean(); + hbase->GetXaxis()->SetRangeUser(hmean- hmean/3 , hmean + hmean/3); + hmean = hbase->GetMean(); + hrms = hbase->GetRMS(); - if( GetPedestals()==1) fHistAddrMaxAdc->SetBinContent( nextHwAddress,max- h_mean); + if( GetPedestals()==1) fHistAddrMaxAdc->SetBinContent( nextHwAddress,max- hmean); else fHistAddrMaxAdc->SetBinContent( nextHwAddress,max ); if(secid!=-1) { - if(rcu_patch<2) + if(rcupatch<2) { - fHistDistrBase2dIROC->Fill(h_mean,h_rms); + fHistDistrBase2dIROC->Fill(hmean,hrms); fHistDistrSumIROC->Fill(sum); - if( GetPedestals()==1 ) { fHistDistrMaxIROC->Fill(max-h_mean); fHistDistrSumIROC->Fill(sum -sumn*h_mean);} + if( GetPedestals()==1 ) { fHistDistrMaxIROC->Fill(max-hmean); fHistDistrSumIROC->Fill(sum -sumn*hmean);} else { fHistDistrMaxIROC->Fill(max); fHistDistrSumIROC->Fill(sum );} } else { - fHistDistrBase2dOROC->Fill(h_mean,h_rms); + fHistDistrBase2dOROC->Fill(hmean,hrms); fHistDistrSumOROC->Fill(sum); - if( GetPedestals()==1 ){ fHistDistrMaxOROC->Fill(max-h_mean); fHistDistrSumOROC->Fill(sum -sumn*h_mean);} + 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,h_mean); - fHistAddrMaxAdcX->SetBinContent( nextHwAddress,max_x); - fHistAddrBaseRms->SetBinContent( nextHwAddress,h_rms); + fHistAddrBaseMean->SetBinContent(nextHwAddress,hmean); + fHistAddrMaxAdcX->SetBinContent( nextHwAddress,maxx); + fHistAddrBaseRms->SetBinContent( nextHwAddress,hrms); } fChannelIter++; if(nextpos<0) { AliError("Error : next pos < 0 "); break ;} @@ -816,16 +1084,16 @@ void AliTPCMonitor::FillHistsPadPlane() void AliTPCMonitor::ResetArrays() { // Reset data arrays - for(Int_t row = 0 ; row < kNRowsIroc; row++) + for(Int_t row = 0 ; row < fkNRowsIroc; row++) { - for(Int_t pad = 0 ; pad < kNPadsIroc ; pad++) + for(Int_t pad = 0 ; pad < fkNPadsIroc ; pad++) { fHistIROCIndex->SetCellContent(row+1,pad+1,-1); } } - for(Int_t row = 0 ; row < kNRowsOroc; row++) + for(Int_t row = 0 ; row < fkNRowsOroc; row++) { - for(Int_t pad = 0 ; pad < kNPadsOroc ; pad++) + for(Int_t pad = 0 ; pad < fkNPadsOroc ; pad++) { fHistOROCIndex->SetCellContent(row+1,pad+1,-1); } @@ -989,7 +1257,7 @@ void AliTPCMonitor::FillGlobal(Int_t sector) //__________________________________________________________________ -void AliTPCMonitor::GetXY( Double_t& xval , Double_t& yval , Int_t padmax, Int_t row , Int_t pad) +void AliTPCMonitor::GetXY( Double_t& xval , Double_t& yval , Int_t padmax, Int_t row , Int_t pad) const { // Get x and y position of pad @@ -1008,7 +1276,7 @@ void AliTPCMonitor::GetXY( Double_t& xval , Double_t& yval , Int_t padmax, Int_t } //__________________________________________________________________ -Int_t AliTPCMonitor::GetPadAtX(Float_t xval, Int_t row, Int_t padmax) +Int_t AliTPCMonitor::GetPadAtX(Float_t xval, Int_t row, Int_t padmax) const { // Get pad number at given position in x Int_t pad = 0; @@ -1022,7 +1290,7 @@ Int_t AliTPCMonitor::GetPadAtX(Float_t xval, Int_t row, Int_t padmax) } //__________________________________________________________________ -Int_t AliTPCMonitor::GetPadAtX(Float_t xval, Int_t row) +Int_t AliTPCMonitor::GetPadAtX(Float_t xval, Int_t row) const { // Get pad number at given position in x @@ -1112,14 +1380,14 @@ void AliTPCMonitor::DrawHists(Int_t histos) fHistOROCRMS->SetXTitle("row"); fHistOROCRMS->SetZTitle("baseline rms (ADC)"); fHistOROCRMS->SetYTitle("pad"); fHistOROCRMS->SetTitle(titleOROC); // SUM - Char_t name_sum[256] ; sprintf(name_sum,"ADC sum (bins: %i, %i)",GetRangeSumMin() ,GetRangeSumMax() ); - fHistIROCSUM->SetXTitle("row"); fHistIROCSUM->SetZTitle(name_sum); fHistIROCSUM->SetYTitle("pad"); fHistIROCSUM->SetTitle(titleIROC); - fHistOROCSUM->SetXTitle("row"); fHistOROCSUM->SetZTitle(name_sum); fHistOROCSUM->SetYTitle("pad"); fHistOROCSUM->SetTitle(titleOROC); + 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 name_base[256] ; sprintf(name_base ,"base mean (timbebin: %i, %i )",GetRangeBaseMin(),GetRangeBaseMax()); - fHistIROCBASE->SetXTitle("row"); fHistIROCBASE->SetZTitle(name_base); fHistIROCBASE->SetYTitle("pad"); fHistIROCBASE->SetTitle(titleIROC); - fHistOROCBASE->SetXTitle("row"); fHistOROCBASE->SetZTitle(name_base); fHistOROCBASE->SetYTitle("pad"); fHistOROCBASE->SetTitle(titleOROC); + 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(); @@ -1234,11 +1502,11 @@ void AliTPCMonitor::DrawHists(Int_t histos) 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 gl_title1[256]; sprintf(gl_title1,"SIDE A Run %05i (EventID %i)",fRunId,fEventNumber); - Char_t gl_title2[256]; sprintf(gl_title2,"SIDE C Run %05i (EventID %i)",fRunId,fEventNumber); + 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(gl_title1); - fHistGlobalMaxC->SetTitle(gl_title2); + fHistGlobalMaxA->SetTitle(globtitle1); + fHistGlobalMaxC->SetTitle(globtitle2); fHistGlobalMaxA->SetXTitle("x/mm"); fHistGlobalMaxA->SetYTitle("y/mm"); fHistGlobalMaxC->SetXTitle("x/mm"); @@ -1253,14 +1521,14 @@ void AliTPCMonitor::DrawHists(Int_t histos) cglobC->cd() ; fHistGlobalMaxC->Draw("COLZ"); cglobA->cd() ; fHistGlobalMaxA->Draw("COLZ"); - Char_t name_om[256]; - sprintf(name_om,".x %s/TPC/AliTPCMonitorExec.C(3)",gSystem->Getenv("ALICE_ROOT")); + Char_t nameom[256]; + sprintf(nameom,".x %s/TPC/AliTPCMonitorExec.C(3)",gSystem->Getenv("ALICE_ROOT")); if(fExecGlob==0) { - if(fVerb)cout << " set exec " << name_om << endl; - cglobC->AddExec("glob",name_om); - cglobA->AddExec("glob",name_om); + if(fVerb)cout << " set exec " << nameom << endl; + cglobC->AddExec("glob",nameom); + cglobA->AddExec("glob",nameom); fExecGlob = 1; } else @@ -1268,9 +1536,9 @@ void AliTPCMonitor::DrawHists(Int_t histos) cglobC->DeleteExec("glob"); cglobA->DeleteExec("glob"); - if(fVerb) cout << " set exec " << name_om << endl; - cglobC->AddExec("glob",name_om); - cglobA->AddExec("glob",name_om); + if(fVerb) cout << " set exec " << nameom << endl; + cglobC->AddExec("glob",nameom); + cglobA->AddExec("glob",nameom); } cglobC->Update(); @@ -1351,18 +1619,18 @@ void AliTPCMonitor::ExecPad() Char_t namesel[256]; Char_t namecanv[256]; - Int_t xbin_min = 0; - Int_t xbin_max = 0; - Float_t ybin_min = 0; - Float_t ybin_max = 0; - Int_t ROC = 0; + 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 TH2S* fHistIndex=0; sprintf(namesel,select->GetName()); if(strcmp(namesel,"fHistOROC")==0 || strcmp(namesel,"fHistOROCRMS")==0 || strcmp(namesel,"fHistOROCTime")==0 ) { - ROC = 1; + rocid = 1; fPadUsedRoc =1; sprintf(projhist,"ProjectionOROC"); sprintf(namecanv,"coroc_ch"); @@ -1370,24 +1638,24 @@ void AliTPCMonitor::ExecPad() } if(strcmp(namesel,"fHistIROC")==0 || strcmp(namesel,"fHistIROCRMS")==0 || strcmp(namesel,"fHistIROCTime")==0 ) { - ROC = 0; + rocid = 0; fPadUsedRoc=0; sprintf(projhist,"ProjectionIROC"); sprintf(namecanv,"ciroc_ch"); - fHistIndex = fHistIROCIndex; + fHistIndex = fHistIROCIndex; } // Check if Canvas already existed and get Ranges from former Prjection histogram - if(cpad=(TCanvas*)gROOT->GetListOfCanvases()->FindObject(namecanv)) + if((cpad=(TCanvas*)gROOT->GetListOfCanvases()->FindObject(namecanv))) { cpad->cd(); if(gROOT->Get(projhist)) { setrange = 1; - xbin_min = ((TH1D*)gROOT->Get(projhist))->GetXaxis()->GetFirst(); - xbin_max = ((TH1D*)gROOT->Get(projhist))->GetXaxis()->GetLast(); - ybin_min = ((TH1D*)gROOT->Get(projhist))->GetMinimum(); - ybin_max = ((TH1D*)gROOT->Get(projhist))->GetMaximum(); + 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"); } @@ -1414,23 +1682,23 @@ void AliTPCMonitor::ExecPad() hwadd = (Int_t)fHistChannelTime->GetCellContent(binchannel,0); fPadUsedHwAddr = hwadd; - if(ROC==0) npadRow = fMapHand->GetPadRow(hwadd); - else npadRow = fMapHand->GetPadRow(hwadd)-63; - npad = fMapHand->GetPad(hwadd); - nhw = hwadd; - nmax = (Int_t)hp->GetMaximum(); + if(rocid==0)npadRow = fMapHand->GetPadRow(hwadd); + else npadRow = fMapHand->GetPadRow(hwadd)-63; + npad = fMapHand->GetPad(hwadd); + 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); - Int_t Altro = fMapHand->GetAltro(hwadd); - Int_t AltroCh = (fMapHand->GetAltroChannel(hwadd))%16; - Int_t FECloc = fMapHand->U2fGetFECinRCU(FECnr) ; - Int_t FEClocbran = fMapHand->U2fGetFECinBranch(FECnr); - Int_t branch = fMapHand->U2fGetBranch(FECnr); + Int_t fecnr = fMapHand->GetFECfromHw(hwadd); + Int_t fecch = fMapHand->GetFECchannel(hwadd); + Int_t altrochip = fMapHand->GetAltro(hwadd); + Int_t altrochannel= (fMapHand->GetAltroChannel(hwadd))%16; + 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; @@ -1441,13 +1709,13 @@ void AliTPCMonitor::ExecPad() 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); - sprintf(nstat2,"Fec in patch \t %i \n",FECloc); - sprintf(nstat8,"Fec in branch (map)\t %i (%i)\n",fecget,FEClocbran); + sprintf(nstat2,"Fec in patch \t %i \n",fecloc); + sprintf(nstat8,"Fec in branch (map)\t %i (%i)\n",fecget,feclocbran); sprintf(nstat7,"Connector \t %i \n",connector); - sprintf(nstat3,"Fec No. \t %i \n",FECnr); - sprintf(nstat4,"Fec chan \t %i \n",FECch); - sprintf(nstat5,"Altro chip\t %i \n",Altro); - sprintf(nstat6,"Altro chan\t %i \n",AltroCh); + sprintf(nstat3,"Fec No. \t %i \n",fecnr); + sprintf(nstat4,"Fec chan \t %i \n",fecch); + 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(nstat3); legstat->AddText(nstat4); legstat->AddText(nstat5); legstat->AddText(nstat6); @@ -1463,9 +1731,9 @@ void AliTPCMonitor::ExecPad() if(setrange) { - hp->GetXaxis()->SetRange(xbin_min,xbin_max); - hp->SetMinimum(ybin_min); - hp->SetMaximum(ybin_max); + hp->GetXaxis()->SetRange(xbinmin,xbinmax); + hp->SetMinimum(ybinmin); + hp->SetMaximum(ybinmax); } else { @@ -1479,20 +1747,20 @@ void AliTPCMonitor::ExecPad() // Make Fit to peak if(GetPedestals() && fDisableFit==0) { - Int_t max_x = (Int_t)fHistAddrMaxAdcX->GetBinContent(hwadd); + 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,max_x-5,max_x+5,4); + 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,max_x-2); + fg->SetParameter(1,maxx-2); fg->SetParameter(2,1.5); fg->FixParameter(3,0); fg->SetLineColor(4); @@ -1528,16 +1796,16 @@ void AliTPCMonitor::ExecRow() if(!select) return; if(!select->InheritsFrom("TH2")) { return; } - Int_t ROC = 0; + Int_t rocid = 0; // Char_t namehist[50]; Char_t rowhist[60]; - Char_t rowhist_sum[60]; - Char_t rowhist_max[60]; - Char_t rowhist_xmax[60]; + Char_t rowhistsum[60]; + Char_t rowhistmax[60]; + Char_t rowhistxmax[60]; - sprintf(rowhist, "hrow_time"); - sprintf(rowhist_xmax ,"hx_max"); - sprintf(rowhist_max , "hrow_max"); + sprintf(rowhist, "hrowtime"); + sprintf(rowhistxmax ,"hxmax"); + sprintf(rowhistmax , "hrowmax"); // get position Int_t px = gPad->GetEventX(); @@ -1547,36 +1815,36 @@ void AliTPCMonitor::ExecRow() Float_t y = gPad->PadtoY(upy); Float_t x = gPad->PadtoX(upx); - TCanvas*crow_time = 0; - TCanvas*crow_max = 0; - TCanvas*cx_max = 0; + TCanvas*crowtime = 0; + TCanvas*crowmax = 0; + TCanvas*cxmax = 0; TH2S* fHistIndex = 0; // ranges from already existing histos - Int_t row_time_xmin = 0; - Int_t row_time_xmax = 0; - Int_t row_time_ymin = 0; - Int_t row_time_ymax = 0; - Float_t row_time_zmin = 0; - Float_t row_time_zmax = 0; + Int_t rowtimexmin = 0; + Int_t rowtimexmax = 0; + Int_t rowtimeymin = 0; + Int_t rowtimeymax = 0; + Float_t rowtimezmin = 0; + Float_t rowtimezmax = 0; - Int_t prof_row_xmin = 0; - Int_t prof_row_xmax = 0; - Double_t prof_row_ymin = 0; - Double_t prof_row_ymax = 0; + Int_t prof_rowxmin = 0; + Int_t prof_rowxmax = 0; + Double_t prof_rowymin = 0; + Double_t prof_rowymax = 0; - Int_t prof_x_xmin = 0; - Int_t prof_x_xmax = 0; - Double_t prof_x_ymin = 0; - Double_t prof_x_ymax = 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; ROC =1; } - else if(strcmp(select->GetName(),"fHistOROC")==0 || strcmp(select->GetName(),"fHistOROCRMS")==0 ) { fHistIndex = fHistOROCIndex; ROC =2; } + 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); @@ -1584,40 +1852,40 @@ void AliTPCMonitor::ExecRow() // check if canvases exist // - crow_time = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("crow_time"); - crow_max = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("crow_max"); - cx_max = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("cx_max"); + crowtime = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("crowtime"); + crowmax = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("crowmax"); + cxmax = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("cxmax"); - if(!crow_time) crow_time = CreateCanvas("crow_time") ; - if(!crow_max) crow_max = CreateCanvas("crow_max") ; - if(!cx_max ) cx_max = CreateCanvas("cx_max") ; + if(!crowtime) crowtime = CreateCanvas("crowtime") ; + if(!crowmax) crowmax = CreateCanvas("crowmax") ; + if(!cxmax ) cxmax = CreateCanvas("cxmax") ; // check ranges of already existing histos if(gROOT->Get(rowhist)) { - row_time_xmin = ((TH2F*)gROOT->Get(rowhist))->GetXaxis()->GetFirst(); - row_time_xmax = ((TH2F*)gROOT->Get(rowhist))->GetXaxis()->GetLast(); - row_time_ymin = ((TH2F*)gROOT->Get(rowhist))->GetYaxis()->GetFirst(); - row_time_ymax = ((TH2F*)gROOT->Get(rowhist))->GetYaxis()->GetLast(); - row_time_zmin = ((TH2F*)gROOT->Get(rowhist))->GetMinimum(); - row_time_zmax = ((TH2F*)gROOT->Get(rowhist))->GetMaximum(); + 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(); - prof_row_xmin = ((TH1F*)gROOT->Get(rowhist_max))->GetXaxis()->GetFirst(); - prof_row_xmax = ((TH1F*)gROOT->Get(rowhist_max))->GetXaxis()->GetLast(); - prof_row_ymin = ((TH1F*)gROOT->Get(rowhist_max))->GetMinimum(); - prof_row_ymax = ((TH1F*)gROOT->Get(rowhist_max))->GetMaximum(); + prof_rowxmin = ((TH1F*)gROOT->Get(rowhistmax))->GetXaxis()->GetFirst(); + prof_rowxmax = ((TH1F*)gROOT->Get(rowhistmax))->GetXaxis()->GetLast(); + prof_rowymin = ((TH1F*)gROOT->Get(rowhistmax))->GetMinimum(); + prof_rowymax = ((TH1F*)gROOT->Get(rowhistmax))->GetMaximum(); - prof_x_xmin = ((TH1F*)gROOT->Get(rowhist_xmax))->GetXaxis()->GetFirst(); - prof_x_xmax = ((TH1F*)gROOT->Get(rowhist_xmax))->GetXaxis()->GetLast(); - prof_x_ymin = ((TH1F*)gROOT->Get(rowhist_xmax))->GetMinimum(); - prof_x_ymax = ((TH1F*)gROOT->Get(rowhist_xmax))->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(rowhist_max); - delete gROOT->Get(rowhist_sum); - delete gROOT->Get("hx_max"); + delete gROOT->Get(rowhistmax); + delete gROOT->Get(rowhistsum); + delete gROOT->Get("hxmax"); delete gROOT->Get("legrow"); } @@ -1627,7 +1895,7 @@ void AliTPCMonitor::ExecRow() Int_t binchannel = (Int_t)fHistIndex->GetCellContent(testx,testy); if(binchannel>30000) return; - if(binchannel<=0 ) { crow_time->Update() ; crow_max->Update() ; return ; } + if(binchannel<=0 ) { crowtime->Update() ; crowmax->Update() ; return ; } // get hwaddress Int_t hwadd = (Int_t)fHistChannelTime->GetCellContent(binchannel,0); @@ -1636,9 +1904,9 @@ void AliTPCMonitor::ExecRow() Int_t numofpads = fMapHand->GetNumofPads(row); // create histos - TH2F *hrow_time = new TH2F(rowhist , "" ,numofpads,0,numofpads,GetTimeBins(),0.0,GetTimeBins()); - TH1F *hrow_max = new TH1F(rowhist_max , "" ,numofpads,0,numofpads); - TH1F *hx_max = new TH1F(rowhist_xmax, "" ,159,0,159 ); + 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; @@ -1648,12 +1916,12 @@ void AliTPCMonitor::ExecRow() Int_t channel = (Int_t)fHistAddrMapIndex->GetBinContent(addrinrow); if(channel==-1) continue; - hrow_max->SetBinContent(padnr+1,fHistAddrMaxAdc->GetBinContent(addrinrow)); + hrowmax->SetBinContent(padnr+1,fHistAddrMaxAdc->GetBinContent(addrinrow)); TH1D *hp = fHistChannelTime->ProjectionY("hp",channel,channel); for(Int_t time = 0;timeGetBinContent(time); - hrow_time->SetCellContent(padnr+1,time+1,val); + hrowtime->SetCellContent(padnr+1,time+1,val); } } @@ -1671,76 +1939,76 @@ void AliTPCMonitor::ExecRow() { hw = fMapHand->GetPadAddInRow(nrow,padnr); if(fPadMapHw[hw]==-1){ continue ; } - else { hx_max->SetBinContent(nrow+1,fHistAddrMaxAdc->GetBinContent(hw)) ; } + else { hxmax->SetBinContent(nrow+1,fHistAddrMaxAdc->GetBinContent(hw)) ; } } } - cx_max->cd(); - Char_t hx_titl[50] ; sprintf(hx_titl,"max adc in pads at x=%5.1f mm",xval); - hx_max->SetTitle(hx_titl); - hx_max->SetXTitle("row"); - if(!GetPedestals()) hx_max->SetYTitle("max adc (baseline sub.)"); - else hx_max->SetYTitle("max adc "); - hx_max->SetMinimum(0.01); - hx_max->Draw("l"); + cxmax->cd(); + Char_t hxtitle[50] ; sprintf(hxtitle,"max adc in pads at x=%5.1f mm",xval); + hxmax->SetTitle(hxtitle); + hxmax->SetXTitle("row"); + if(!GetPedestals()) hxmax->SetYTitle("max adc (baseline sub.)"); + else hxmax->SetYTitle("max adc "); + hxmax->SetMinimum(0.01); + hxmax->Draw("l"); if(setrange) { - hx_max->GetXaxis()->SetRange(prof_x_xmin,prof_x_xmax); - hx_max->SetMinimum(prof_x_ymin); - hx_max->SetMaximum(prof_x_ymax); + hxmax->GetXaxis()->SetRange(profxxmin,profxxmax); + hxmax->SetMinimum(profxymin); + hxmax->SetMaximum(profxymax); } - cx_max->Update(); + cxmax->Update(); - crow_time->cd(); + crowtime->cd(); Char_t title[256]; - Char_t title_max[256]; - if(ROC==1) {sprintf(title,"%s Row=%d",((TH2*)select)->GetTitle(),row) ; sprintf(title_max,"IROC max/sum Row=%d",row );} - else {sprintf(title,"%s Row=%d",((TH2*)select)->GetTitle(),row-63); sprintf(title_max,"OROC max/sum Row=%d",row-63);} + Char_t titlemax[256]; + 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 - crow_time->cd(); - hrow_time->SetTitleSize(0.04); - hrow_time->SetTitle(title); - hrow_time->SetYTitle("timbin"); - hrow_time->SetXTitle("pad in row"); - hrow_time->SetZTitle("signal (ADC)"); + crowtime->cd(); + hrowtime->SetTitleSize(0.04); + hrowtime->SetTitle(title); + hrowtime->SetYTitle("timbin"); + hrowtime->SetXTitle("pad in row"); + hrowtime->SetZTitle("signal (ADC)"); - hrow_time->GetXaxis()->SetTitleColor(1); - hrow_time->SetMaximum(1000.0); - hrow_time->SetMinimum(0.0); + hrowtime->GetXaxis()->SetTitleColor(1); + hrowtime->SetMaximum(1000.0); + hrowtime->SetMinimum(0.0); if(setrange) { - hrow_time->GetXaxis()->SetRange(row_time_xmin,row_time_xmax); - hrow_time->GetYaxis()->SetRange(row_time_ymin,row_time_ymax); - hrow_time->SetMinimum(row_time_zmin); - hrow_time->SetMaximum(row_time_zmax); + hrowtime->GetXaxis()->SetRange(rowtimexmin,rowtimexmax); + hrowtime->GetYaxis()->SetRange(rowtimeymin,rowtimeymax); + hrowtime->SetMinimum(rowtimezmin); + hrowtime->SetMaximum(rowtimezmax); } - hrow_time->Draw("COLZ"); - crow_time->UseCurrentStyle(); - crow_time->Update(); + hrowtime->Draw("COLZ"); + crowtime->UseCurrentStyle(); + crowtime->Update(); // max and sum ///////////////////////// - crow_max->cd(); + crowmax->cd(); if(setrange) { - hrow_max->GetXaxis()->SetRange(prof_row_xmin,prof_row_xmax); - hrow_max->SetMinimum(prof_row_ymin); - hrow_max->SetMaximum(prof_row_ymax); + hrowmax->GetXaxis()->SetRange(prof_rowxmin,prof_rowxmax); + hrowmax->SetMinimum(prof_rowymin); + hrowmax->SetMaximum(prof_rowymax); } - hrow_max->SetTitleSize(0.04); - hrow_max->SetTitle(title); - hrow_max->SetYTitle("max adc"); - hrow_max->SetXTitle("pad in row"); - hrow_max->GetXaxis()->SetTitleColor(1); + hrowmax->SetTitleSize(0.04); + hrowmax->SetTitle(title); + hrowmax->SetYTitle("max adc"); + hrowmax->SetXTitle("pad in row"); + hrowmax->GetXaxis()->SetTitleColor(1); - hrow_max->SetLineColor(2); - hrow_max->Draw("l"); - crow_max->Update(); + hrowmax->SetLineColor(2); + hrowmax->Draw("l"); + crowmax->Update(); return; } @@ -1757,26 +2025,26 @@ void AliTPCMonitor::Write10bitChannel() Int_t row = (Int_t)fMapHand->GetPadRow(fPadUsedHwAddr); Int_t channel = (Int_t)fPadMapHw[fPadUsedHwAddr]; - Char_t filename_root[256]; - Char_t filename_dat[256]; + 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(filename_dat, "Channel_Run%05i_EventID_%i_Pad_%i_Row_%i.dat" ,fRunId,fEventNumber,pad,row); - sprintf(filename_root,"Channel_Run%05i_EventID_%i_Pad_%i_Row_%i.root" ,fRunId,fEventNumber,pad,row); + 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)) + if((hpr=(TH1D*)gROOT->Get(projhist))) { // root histo - TFile f(filename_root,"recreate"); + TFile f(filenameroot,"recreate"); hpr->Write(); f.Close(); // raw singal - ofstream datout(filename_dat,ios::out); + ofstream datout(filenamedat,ios::out); datout <<"Timebin \t ADC value " << endl; for(Int_t i = 1; i Get(projhist) ; - if(fPadUsedRoc==1) { sprintf(name_htr_imag,"htrans_imag_freq_oroc"); sprintf(name_htr_real,"htrans_real_freq_oroc"); } - else { sprintf(name_htr_imag,"htrans_imag_freq_iroc"); sprintf(name_htr_real,"htrans_real_freq_iroc"); } + if(fPadUsedRoc==1) { sprintf(namehtrimag,"htransimagfreq_oroc"); sprintf(namehtrreal,"htransrealfreq_oroc"); } + else { sprintf(namehtrimag,"htransimagfreq_iroc"); sprintf(namehtrreal,"htransrealfreq_iroc"); } - if( gROOT->Get(name_htr_imag)) delete gROOT->Get(name_htr_imag); - if( gROOT->Get(name_htr_real)) delete gROOT->Get(name_htr_real); + if( gROOT->Get(namehtrimag)) delete gROOT->Get(namehtrimag); + if( gROOT->Get(namehtrreal)) delete gROOT->Get(namehtrreal); TCanvas *ctrans = 0; if(!(ctrans = (TCanvas*)gROOT->GetListOfCanvases()->FindObject(namecanv))) @@ -1825,9 +2093,9 @@ void AliTPCMonitor::ExecTransform() ctrans->Divide(1,2); } - Int_t bin_first = hproj->GetXaxis()->GetFirst(); - Int_t bin_last = hproj->GetXaxis()->GetLast(); - Int_t bins = bin_last -bin_first +1; + 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++) @@ -1839,27 +2107,27 @@ void AliTPCMonitor::ExecTransform() bins = (Int_t)TMath::Power(2,power); // sampling frequency ; - Double_t delta_t = 1.0/(Float_t)GetSamplingFrequency(); + Double_t deltat = 1.0/(Float_t)GetSamplingFrequency(); // output histo - TH1D* htrans_real_freq = new TH1D(name_htr_real,name_htr_real,10000,-1/(2*delta_t),1/(2*delta_t)); - TH1D* htrans_imag_freq = new TH1D(name_htr_imag,name_htr_imag,10000,-1/(2*delta_t),1/(2*delta_t)); + 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)); - Char_t title_real[256]; - Char_t title_imag[256]; - if(fPadUsedRoc==1) { sprintf(title_real,"OROC DFT real part"); sprintf(title_imag,"OROC DFT imag part"); } - else { sprintf(title_real,"IROC DFT real part"); sprintf(title_imag,"IROC DFT imag part"); } + Char_t titlereal[256]; + Char_t titleimag[256]; + if(fPadUsedRoc==1) { sprintf(titlereal,"OROC DFT real part"); sprintf(titleimag,"OROC DFT imag part"); } + else { sprintf(titlereal,"IROC DFT real part"); sprintf(titleimag,"IROC DFT imag part"); } - htrans_real_freq->SetTitle(title_real); htrans_real_freq->SetXTitle("f/hz"); htrans_real_freq->SetYTitle("z_{real}(f)"); - htrans_imag_freq->SetTitle(title_imag); htrans_imag_freq->SetXTitle("f/hz"); htrans_imag_freq->SetYTitle("z_{imag}(f)"); + htransrealfreq->SetTitle(titlereal); htransrealfreq->SetXTitle("f/hz"); htransrealfreq->SetYTitle("z_{real}(f)"); + htransimagfreq->SetTitle(titleimag); htransimagfreq->SetXTitle("f/hz"); htransimagfreq->SetYTitle("z_{imag}(f)"); // create complex packed data array - const Int_t datasiz = 2*bins; - Double_t* data = new Double_t[datasiz]; + 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(bin_first+i); } + for(Int_t i=0;iGetBinContent(binfirst+i); } // make fourier transformation AliTPCMonitorFFT* four = new AliTPCMonitorFFT(); @@ -1871,26 +2139,26 @@ void AliTPCMonitor::ExecTransform() { if(iFill( freq,data[2*i] ); - htrans_imag_freq->Fill( freq,data[2*i+1]); + if(i<(bins/2)) { freq = i/(bins*deltat) ; } + else { freq = -1*((bins-i)/(bins*deltat)); } + htransrealfreq->Fill( freq,data[2*i] ); + htransimagfreq->Fill( freq,data[2*i+1]); } } ctrans->cd(1); - htrans_real_freq->Draw(); + htransrealfreq->Draw(); ctrans->cd(2); - htrans_imag_freq->Draw(); + htransimagfreq->Draw(); ctrans->Update(); delete four; delete data; } //__________________________________________________________________ -void AliTPCMonitor::ShowSel(Int_t* comp_val) +void AliTPCMonitor::ShowSel(Int_t* compval) { // Show only selected components @@ -1898,9 +2166,9 @@ void AliTPCMonitor::ShowSel(Int_t* comp_val) // Than remove all not matching pads form histos Int_t connector = 0; - Int_t FECnr = 0; - Int_t Altro = 0; - Int_t FEClocbran = 0; + Int_t fecnr = 0; + Int_t altrochip = 0; + Int_t feclocbran = 0; Int_t branch = 0; Short_t rcuget = 0; Int_t emptyI = 1; @@ -1912,18 +2180,18 @@ void AliTPCMonitor::ShowSel(Int_t* comp_val) // 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; @@ -1939,10 +2207,10 @@ void AliTPCMonitor::ShowSel(Int_t* comp_val) Int_t npads =0; Int_t subrows =0; - for(Int_t row = 0; row< (kNRowsIroc + kNRowsOroc); row++) + for(Int_t row = 0; row< (fkNRowsIroc + fkNRowsOroc); row++) { - if(rowGetCellContent(index,0); // global fecnr - FECnr = fMapHand->GetFECfromHw(hwadd); - if(comp_val[0]!=-1 && FECnr!=comp_val[0]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } + 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(comp_val[1]!=-1 && rcuget!=comp_val[1]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } + if(compval[1]!=-1 && rcuget!=compval[1]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } // branch - branch = fMapHand->U2fGetBranch(FECnr) ; - if(comp_val[2]!=-1 && branch!=comp_val[2]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } + 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(comp_val[3]!=-1 && FEClocbran!=comp_val[3]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } + 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(comp_val[4]!=-1 && connector!=comp_val[4]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } + if(compval[4]!=-1 && connector!=compval[4]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } // Altro chip - Altro = fMapHand->GetAltro(hwadd); - if(comp_val[5]!=-1 && Altro!=comp_val[5]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } + altrochip = fMapHand->GetAltro(hwadd); + if(compval[5]!=-1 && altrochip!=compval[5]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; } emptyI =0; } } @@ -2047,13 +2315,13 @@ void AliTPCMonitor::ResizeCanv() if(gROOT->GetListOfCanvases()->FindObject( "csum")) { delete gROOT->GetListOfCanvases()->FindObject("csum"); } if(gROOT->GetListOfCanvases()->FindObject( "ciroc_ch_trans")) { delete gROOT->GetListOfCanvases()->FindObject("ciroc_ch_trans");} if(gROOT->GetListOfCanvases()->FindObject( "coroc_ch_trans")) { delete gROOT->GetListOfCanvases()->FindObject("coroc_ch_trans");} - if(gROOT->GetListOfCanvases()->FindObject( "crow_time")) { delete gROOT->GetListOfCanvases()->FindObject("crow_time"); } - if(gROOT->GetListOfCanvases()->FindObject( "crow_max")) { delete gROOT->GetListOfCanvases()->FindObject("crow_max"); } - if(gROOT->GetListOfCanvases()->FindObject( "cx_max")) { delete gROOT->GetListOfCanvases()->FindObject("cx_max"); } + if(gROOT->GetListOfCanvases()->FindObject( "crowtime")) { delete gROOT->GetListOfCanvases()->FindObject("crowtime"); } + if(gROOT->GetListOfCanvases()->FindObject( "crowmax")) { delete gROOT->GetListOfCanvases()->FindObject("crowmax"); } + if(gROOT->GetListOfCanvases()->FindObject( "cxmax")) { delete gROOT->GetListOfCanvases()->FindObject("cxmax"); } if(gROOT->GetListOfCanvases()->FindObject( "crmsoroc")) { delete gROOT->GetListOfCanvases()->FindObject("crmsoroc"); fExecPadOrocRms = 0; } if(gROOT->GetListOfCanvases()->FindObject( "crmsiroc")) { delete gROOT->GetListOfCanvases()->FindObject("crmsiroc"); fExecPadIrocRms = 0; } - if(gROOT->GetListOfCanvases()->FindObject( "crow_max")) { delete gROOT->GetListOfCanvases()->FindObject("crow_max"); } - if(gROOT->GetListOfCanvases()->FindObject( "crow_max")) { delete gROOT->GetListOfCanvases()->FindObject("crow_max"); } + if(gROOT->GetListOfCanvases()->FindObject( "crowmax")) { delete gROOT->GetListOfCanvases()->FindObject("crowmax"); } + if(gROOT->GetListOfCanvases()->FindObject( "crowmax")) { delete gROOT->GetListOfCanvases()->FindObject("crowmax"); } } @@ -2151,7 +2419,7 @@ Int_t AliTPCMonitor::GetRCUPatch(Int_t runid, Int_t eqid) } //__________________________________________________________________ -void AliTPCMonitor::DumpHeader(AliRawReaderRoot * fReaderROOT) +void AliTPCMonitor::DumpHeader(AliRawReaderRoot * fReaderROOT) const { // Dump Event header for ROOT format @@ -2164,17 +2432,17 @@ void AliTPCMonitor::DumpHeader(AliRawReaderRoot * fReaderROOT) } //__________________________________________________________________ -void AliTPCMonitor::DumpHeader(AliTPCMonitorDateFormat* DateForm) +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; + 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; } //__________________________________________________________________ @@ -2225,9 +2493,9 @@ TCanvas* AliTPCMonitor::CreateCanvas(Char_t* name) else if(strcmp(name,"coroc_ch_trans")==0) { canv = new TCanvas("coroc_ch_trans","coroc_ch_trans",(Int_t)(3.0*xspace+xoffset),(Int_t)(yspace+0.5*ysize),(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; } else if(strcmp(name,"ciroc_ch_trans")==0) { canv = new TCanvas("ciroc_ch_trans","ciroc_ch_trans",(Int_t)(3.0*xspace+xoffset), 0 ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; } // row profile histograms - else if(strcmp(name,"crow_time" )==0) { canv = new TCanvas("crow_time" ,"crow_time" , 1*xspace+xoffset, 2*yspace +ysize ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; } - else if(strcmp(name,"crow_max" )==0) { canv = new TCanvas("crow_max" ,"crow_max" , 2*xspace+xoffset, 2*yspace +ysize ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; } - else if(strcmp(name,"cx_max" )==0) { canv = new TCanvas("cx_max" ,"cx_max" , 3*xspace+xoffset, 2*yspace +ysize ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; } + else if(strcmp(name,"crowtime" )==0) { canv = new TCanvas("crowtime" ,"crowtime" , 1*xspace+xoffset, 2*yspace +ysize ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; } + else if(strcmp(name,"crowmax" )==0) { canv = new TCanvas("crowmax" ,"crowmax" , 2*xspace+xoffset, 2*yspace +ysize ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; } + else if(strcmp(name,"cxmax" )==0) { canv = new TCanvas("cxmax" ,"cxmax" , 3*xspace+xoffset, 2*yspace +ysize ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; } else { cout << " Warning Canvas name unknown " << endl; return 0 ; } } @@ -2272,7 +2540,7 @@ TH1* AliTPCMonitor::GetHisto(char* histname) { hist = (TH1*)fHistList->FindObject(histname); } - else + else { cout << " AliTPCMonitor::GetHisto :: Can not find histo with name " << histname << endl; } diff --git a/TPC/AliTPCMonitor.h b/TPC/AliTPCMonitor.h index 75a50cf79ef..6faf2e279eb 100755 --- a/TPC/AliTPCMonitor.h +++ b/TPC/AliTPCMonitor.h @@ -12,8 +12,8 @@ // // AliTPCMonitor class // -// Main class for TPC Monitor -// Monitor can handle rootified data, files and online streams in DATE format. +// Main class for the TPC raw data Monitor. +// The Monitor can handle rootified data, files and online streams in DATE format. // The monitor GUI is started by the macro TPCMonitor.C // // Author: Stefan Kniege, IKF, Frankfurt @@ -21,59 +21,93 @@ // ///////////////////////////////////////////////////////////////////////// - -#include -#include -#include -#include -#include -#include -#include "TStyle.h" -#include "TSystem.h" -#include "TH2F.h" -#include "TLegend.h" -#include "TF1.h" -#include "TMath.h" -#include "TFormula.h" -#include -#include "TROOT.h" -#include "TCanvas.h" -#include "TApplication.h" -#include "TGaxis.h" -#include "TPaveText.h" -#include "TGButtonGroup.h" -#include "TGButton.h" -#include "TGTextBuffer.h" -#include "TGTextEntry.h" -#include "TGLabel.h" -#include "TH3S.h" -#include "AliTPCMonitorMappingHandler.h" -#include "AliTPCMonitorDateFile.h" -#include "AliTPCMonitorDateFormat.h" -#include "AliTPCMonitorAltro.h" -#include "AliTPCMonitorFFT.h" #include "AliTPCMonitorConfig.h" -#include "AliSignalProcesor.h" -#include "AliRawReaderRoot.h" -#include "AliRawReader.h" -#include "TGMsgBox.h" -#include "TNamed.h" -#include "TObject.h" -#include "TDirectory.h" -#include "AliLog.h" -#include "RQ_OBJECT.h" +class TH1F; +class TH1D; +class TH1; +class TH2F; +class TH2S; +class TCanvas; +class TH3S; +class AliTPCMonitorMappingHandler; +class AliTPCMonitorDateFile; +class AliTPCMonitorDateFormat; +class AliTPCMonitorAltro; +class AliTPCMonitorFFT; +class AliTPCMonitorConfig; +class AliRawReaderRoot; +class AliRawReader; class AliTPCMonitorDateMonitor; -using namespace std; 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(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 rcu_patch, Int_t id=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); + + 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* comp_val); + 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(); + + + 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 @@ -123,16 +157,16 @@ class AliTPCMonitor : public AliTPCMonitorConfig { // row and pad settings - Int_t kNRowsIroc; // number of rows in IROC - Int_t kNRowsOroc; // number of rows in OROC + Int_t fkNRowsIroc; // number of rows in IROC + Int_t fkNRowsOroc; // number of rows in OROC - Int_t kNPadsIroc; // number of pads in IROC - Int_t kNPadsOroc; // number of pads in OROC + Int_t fkNPadsIroc; // number of pads in IROC + Int_t fkNPadsOroc; // number of pads in OROC - Int_t kNPadMinIroc; // min for pad (y-axis) representation in 2D histogram IROC - Int_t kNPadMinOroc; // min for pad (y-axis) representation in 2D histogram OROC - Int_t kNPadMaxIroc; // max for pad (y-axis) representation in 2D histogram IROC - Int_t kNPadMaxOroc; // max for pad (y-axis) representation in 2D histogram IROC + 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 @@ -171,68 +205,11 @@ class AliTPCMonitor : public AliTPCMonitorConfig { AliTPCMonitorDateFile* fReaderDATE; // reader for DATE files AliTPCMonitorDateMonitor* fReaderDATEMon; // reader for DATE monitoring - - - Int_t CheckEqId(Int_t secid, Int_t eqid); - TCanvas* CreateCanvas(char* name); - void CreateHistos(); - - void DeleteHistos(); - void DisableFit(Int_t val) { fDisableFit =val; } - void DrawHists(Int_t histos); - void DrawRMSMap(); - void DumpHeader(AliRawReaderRoot* reader ); - void DumpHeader(AliTPCMonitorDateFormat* DateForm); - - void ExecPad() ; - void ExecRow() ; - Int_t ExecProcess(); - void ExecTransform(); - - void FillGlobal(Int_t sector); - void FillHistsDecode( AliTPCMonitorAltro* altro , Int_t rcu_patch, Int_t id=0); - void FillHistsPadPlane(); - - static double Gamma4(double* x, double* par); - Int_t GetChannelsProc() { return fChannelIter ;} - Int_t GetEventID() { return fEventNumber ;} - TH1* GetHisto(char* histname); - Int_t GetRCUPatch(Int_t runid, Int_t eqid); - - Int_t GetPadAtX(Float_t xval, Int_t row, Int_t padmax); - Int_t GetPadAtX(Float_t xval, Int_t row); - void GetXY( double& xval , double& yval , Int_t rowmax, Int_t row , Int_t pad); - - Int_t IsLastEvent() { 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* comp_val); - 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(); - - - private: + ClassDef(AliTPCMonitor,1); }; diff --git a/TPC/AliTPCMonitorAltro.cxx b/TPC/AliTPCMonitorAltro.cxx index a0a2509f495..9e74513f235 100755 --- a/TPC/AliTPCMonitorAltro.cxx +++ b/TPC/AliTPCMonitorAltro.cxx @@ -15,37 +15,118 @@ /* $Log$ +Revision 1.1 2007/09/17 10:23:31 cvetan +New TPC monitoring package from Stefan Kniege. The monitoring package can be started by running TPCMonitor.C macro located in macros folder. + */ +//////////////////////////////////////////////////////////////////////// +//// +//// AliTPCMonitorAltro class +//// +//// Class for decoding raw TPC data in the ALTRO format. +//// Data are transformed from 32 bit words to 10 bit or 40 bit respectively. +//// The whole payload is transformed at once and written to an array. +//// The single channels are decoded starting from the trailer word which is +//// decoded by DecodeTrailer(Int_t pos) +//// +//// Authors: Roland Bramm, +//// Stefan Kniege, IKF, Frankfurt +//// +///////////////////////////////////////////////////////////////////////// + #include "AliTPCMonitorAltro.h" -#include "stdlib.h" -#include -ClassImp(AliTPCMonitorAltro) +#include "AliLog.h" +#include + +ClassImp(AliTPCMonitorAltro) //_____________________________________________________________________________________________ -AliTPCMonitorAltro::AliTPCMonitorAltro(UInt_t* memory, Int_t size, Int_t fformat) +AliTPCMonitorAltro::AliTPCMonitorAltro(UInt_t* memory, Int_t size, Int_t fformat) : + fverb(0), + fmemory(memory), + fsize(size), + f40BitArray(0), + f10BitArray(0), + fdecoderPos(0), + fallocate40BitArray(false), + fallocate10BitArray(false), + foffset(0), + fwrite10bit(0), + fTrailerNWords(0), + fTrailerHwAddress(0), + fTrailerDataPos(0), + fTrailerBlockPos(0), + fTrailerPos(0), + fNextPos(0), + ffilename(new Char_t[256]) { - // Constructor: Set different CDH offsets for root(0) and date format - fmemory = memory; - fsize = size; - fallocate40BitArray = false; - fallocate10BitArray = false; - fwrite10bit = 0; + // Constructor: Set different CDH offsets for ROOT (0) and date format + // Data offset can be changed via SetDataOffset(Int_t val) + if( fformat==0) foffset=7; // old CHD Format - else if(fformat==1) foffset=8; // memory pointer form DATE (start CDH) - else if(fformat==2) foffset=0; // memory pointer form ROOT (after CDH) - - fverb =0; - fTrailerNWords =0; - fTrailerHwAddress =0; - fTrailerDataPos =0; - fTrailerBlockPos =0; - fTrailerPos =0; - fNextPos =0; - ffilename = new Char_t[256]; + else if(fformat==1) foffset=8; // memory pointer from DATE (start CDH) + else if(fformat==2) foffset=0; // memory pointer from ROOT (after CDH) } + +//_____________________________________________________________________________________________ +AliTPCMonitorAltro::AliTPCMonitorAltro(const AliTPCMonitorAltro &altro) : + TNamed(altro), + fverb(altro.fverb), + fmemory(altro.fmemory), + fsize(altro.fsize), + f40BitArray(altro.f40BitArray), + f10BitArray(altro.f10BitArray), + fdecoderPos(altro.fdecoderPos), + fallocate40BitArray(altro.fallocate40BitArray), + fallocate10BitArray(altro.fallocate10BitArray), + foffset(altro.foffset), + fwrite10bit(altro.fwrite10bit), + fTrailerNWords(altro.fTrailerNWords), + fTrailerHwAddress(altro.fTrailerHwAddress), + fTrailerDataPos(altro.fTrailerDataPos), + fTrailerBlockPos(altro.fTrailerBlockPos), + fTrailerPos(altro.fTrailerPos), + fNextPos(altro.fNextPos), + ffilename(new Char_t[strlen(altro.ffilename)+1]) +{ + // copy constructor + strcpy(ffilename,altro.ffilename); + +} + +//_____________________________________________________________________________________________ +AliTPCMonitorAltro &AliTPCMonitorAltro::operator =(const AliTPCMonitorAltro& altro) +{ + // assignement operator + + if(this!=&altro){ + ((TNamed *)this)->operator=(altro); + fverb=altro.fverb; + fmemory=altro.fmemory; + fsize=altro.fsize; + f40BitArray=altro.f40BitArray; + f10BitArray=altro.f10BitArray; + fdecoderPos=altro.fdecoderPos; + fallocate40BitArray=altro.fallocate40BitArray; + fallocate10BitArray=altro.fallocate10BitArray; + foffset=altro.foffset; + fwrite10bit=altro.fwrite10bit; + fTrailerNWords=altro.fTrailerNWords; + fTrailerHwAddress=altro.fTrailerHwAddress; + fTrailerDataPos=altro.fTrailerDataPos; + fTrailerBlockPos=altro.fTrailerBlockPos; + fTrailerPos=altro.fTrailerPos; + fNextPos=altro.fNextPos; + ffilename = new Char_t[strlen(altro.ffilename)+1]; + strcpy(ffilename,altro.ffilename); + } + return *this; +} + + //_____________________________________________________________________________________________ AliTPCMonitorAltro::~AliTPCMonitorAltro() { // Destructor @@ -110,15 +191,15 @@ void AliTPCMonitorAltro::Decodeto40Bit() rest = i%4; switch(rest) { case 0: - blackbox = (fmemory[foffset]) + (((Long64_t)(fmemory[foffset+1]&k08BitOn))<<32); + blackbox = (fmemory[foffset]) + (((Long64_t)(fmemory[foffset+1]&fgk08BitOn))<<32); foffset +=1; break; case 1: - blackbox = (fmemory[foffset]>>8 ) + (((Long64_t)(fmemory[foffset+1]&k16BitOn))<<24); + 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]&k24BitOn))<<16); + blackbox = (fmemory[foffset]>>16) + (((Long64_t)(fmemory[foffset+1]&fgk24BitOn))<<16); foffset +=1; break; case 3: @@ -162,15 +243,15 @@ void AliTPCMonitorAltro::Decodeto10Bit(Int_t equipment) switch(rest) { case 0: - blackbox = (fmemory[foffset]) + (((Long64_t)(fmemory[foffset+1]&k08BitOn))<<32); + blackbox = (fmemory[foffset]) + (((Long64_t)(fmemory[foffset+1]&fgk08BitOn))<<32); foffset +=1; break; case 1: - blackbox = (fmemory[foffset]>>8 ) + (((Long64_t)(fmemory[foffset+1]&k16BitOn))<<24); + 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]&k24BitOn))<<16); + blackbox = (fmemory[foffset]>>16) + (((Long64_t)(fmemory[foffset+1]&fgk24BitOn))<<16); foffset +=1; break; case 3: @@ -181,10 +262,10 @@ void AliTPCMonitorAltro::Decodeto10Bit(Int_t equipment) blackbox = 0; break; } - f10BitArray[ind*4+0] = (Short_t)( blackbox & kmask10 ) ; - f10BitArray[ind*4+1] = (Short_t)((blackbox & kmask20)>>10); - f10BitArray[ind*4+2] = (Short_t)((blackbox & kmask30)>>20); - f10BitArray[ind*4+3] = (Short_t)((blackbox & kmask40)>>30); + 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) { @@ -222,9 +303,9 @@ Int_t AliTPCMonitorAltro::DecodeTrailer(Int_t pos) trailer += carry ; } - fTrailerHwAddress = (trailer & ((Long64_t )kTrailerMaskHardw) ); - words = (Long64_t )( (trailer & ((Long64_t )kTrailerMaskNWords))>>16); - tail = (Long64_t )( (trailer & ((Long64_t )kTrailerMaskTail ))>>26 ); + fTrailerHwAddress = (trailer & ((Long64_t )fgkTrailerMaskHardw) ); + words = (Long64_t )( (trailer & ((Long64_t )fgkTrailerMaskNWords))>>16); + tail = (Long64_t )( (trailer & ((Long64_t )fgkTrailerMaskTail ))>>26 ); if(words%4!=0) rest = 4-(words%4); fTrailerNWords = words+rest ; @@ -232,7 +313,7 @@ Int_t AliTPCMonitorAltro::DecodeTrailer(Int_t pos) fTrailerBlockPos = pos -4 ; fNextPos = (pos -fTrailerNWords -4); - if( tail!=kTrailerTail ) { AliError(Form("Could not read Trailer. \"Write 10bit\" for this event. Last Trailer line (2AA): %i. Supp.next Trailer line (2AA): %i ",pos,fNextPos)); return -1; } + if( tail!=fgkTrailerTail ) { AliError(Form("Could not read Trailer. \"Write 10bit\" for this event. Last Trailer line (2AA): %i. Supp.next Trailer line (2AA): %i ",pos,fNextPos)); return -1; } else if( fNextPos==-1 ) { /* was last channel */ return 0; } else if( fNextPos <0 ) { AliError("Next Trailer position < 0 "); return -1; } else if((f10BitArray[fNextPos]!=682)) { AliError(Form("Could not find tail (2AA) at next supposed position %i",fNextPos)); return -1; } diff --git a/TPC/AliTPCMonitorAltro.h b/TPC/AliTPCMonitorAltro.h index 62540a3677b..3d32ec13e26 100755 --- a/TPC/AliTPCMonitorAltro.h +++ b/TPC/AliTPCMonitorAltro.h @@ -7,29 +7,23 @@ /* $Id$ */ //////////////////////////////////////////////////////////////////////// -// -// AliTPCMonitorAltro class -// -// Class for decoding raw TPC data in the ALTRO format -// -// Authors: Roland Bramm, -// Stefan Kniege, IKF, Frankfurt -// +//// +//// AliTPCMonitorAltro class +//// +//// Class for decoding raw TPC data in the ALTRO format +//// +//// Authors: Roland Bramm, +//// Stefan Kniege, IKF, Frankfurt +//// ///////////////////////////////////////////////////////////////////////// - - -#include -#include -#include #include "TNamed.h" -#include "AliLog.h" - -using namespace std; class AliTPCMonitorAltro : public TNamed { public: AliTPCMonitorAltro(UInt_t* memory, Int_t size, Int_t fformat); + AliTPCMonitorAltro(const AliTPCMonitorAltro &altro); + AliTPCMonitorAltro& operator= (const AliTPCMonitorAltro& altro); ~AliTPCMonitorAltro(); void Allocate40BitArray(); @@ -44,23 +38,23 @@ class AliTPCMonitorAltro : public TNamed { Short_t *Get10BitArray(); Int_t Get40BitArraySize(); Int_t Get10BitArraySize(); - Char_t* GetActFileName() { return ffilename;} + Char_t* GetActFileName() const { return ffilename;} - static Int_t GetHwMaskFEC() { return kHwMaskFEC;} - static Int_t GetHwMaskBranch() { return kHwMaskBranch;} - static Int_t GetHwMaskFECChannel() { return kHwMaskFECChannel;} - static Int_t GetHwMaskAltroChannel() { return kHwMaskAltroChannel;} - static Int_t GetHwMaskAltroChip() { return kHwMaskAltroChip;} + static Int_t GetHwMaskFEC() { return fgkHwMaskFEC;} + static Int_t GetHwMaskBranch() { return fgkHwMaskBranch;} + static Int_t GetHwMaskFECChannel() { return fgkHwMaskFECChannel;} + static Int_t GetHwMaskAltroChannel() { return fgkHwMaskAltroChannel;} + static Int_t GetHwMaskAltroChip() { return fgkHwMaskAltroChip;} - static Int_t GetHwMaskRCU() { return kHwMaskRCU;} + static Int_t GetHwMaskRCU() { return fgkHwMaskRCU;} - Int_t GetNextTrailerPos() { return fNextPos;} + Int_t GetNextTrailerPos() const { return fNextPos;} - Int_t GetTrailerNWords() { return fTrailerNWords ;} - Int_t GetTrailerHwAddress() { return fTrailerHwAddress;} - Int_t GetTrailerDataPos() { return fTrailerDataPos ;} - Int_t GetTrailerBlockPos() { return fTrailerBlockPos ;} - Int_t GetTrailerPos() { return fTrailerPos ;} + Int_t GetTrailerNWords() const { return fTrailerNWords ;} + Int_t GetTrailerHwAddress() const { return fTrailerHwAddress;} + Int_t GetTrailerDataPos() const { return fTrailerDataPos ;} + Int_t GetTrailerBlockPos() const { return fTrailerBlockPos ;} + Int_t GetTrailerPos() const { return fTrailerPos ;} void SetDataOffset(Int_t val){ foffset =val ;} void SetWrite10Bit(Int_t wr) { fwrite10bit =wr ;} @@ -92,27 +86,27 @@ class AliTPCMonitorAltro : public TNamed { Int_t fNextPos; // position of next trailer Char_t* ffilename; // name of processed file - static const Int_t k24BitOn = 16777215; // bit masks for first 24 bits of 32 for decoding 32 bit words - static const Int_t k16BitOn = 65535; // bit masks for first 24 bits of 24 - static const Int_t k08BitOn = 255; // bit masks for first 24 bits of 8 + static const Int_t fgk24BitOn = 16777215; // bit masks for first 24 bits of 32 for decoding 32 bit words + static const Int_t fgk16BitOn = 65535; // bit masks for first 24 bits of 24 + static const Int_t fgk08BitOn = 255; // bit masks for first 24 bits of 8 - static const Long64_t kmask10 = (Long64_t)0x00000000000003FFULL; // mask first 10 bit out of 4o0 bit word - static const Long64_t kmask20 = (Long64_t)0x00000000000FFC00ULL; // mask second 10 bit out of 4o0 bit word - static const Long64_t kmask30 = (Long64_t)0x000000003FF00000ULL; // mask third 10 bit out of 4o0 bit word - static const Long64_t kmask40 = (Long64_t)0x000000FFC0000000ULL; // mask fourth 10 bit out of 4o0 bit word + static const Long64_t fgkmask10 = (Long64_t)0x00000000000003FFULL; // mask first 10 bit out of 4o0 bit word + static const Long64_t fgkmask20 = (Long64_t)0x00000000000FFC00ULL; // mask second 10 bit out of 4o0 bit word + static const Long64_t fgkmask30 = (Long64_t)0x000000003FF00000ULL; // mask third 10 bit out of 4o0 bit word + static const Long64_t fgkmask40 = (Long64_t)0x000000FFC0000000ULL; // mask fourth 10 bit out of 4o0 bit word - static const Long64_t kTrailerTail = (Long64_t)0x0000000000002AAAULL; // Tail of the Trailer set to 2AAA - static const Long64_t kTrailerMaskTail = (Long64_t)0x000000fffC000000ULL; // mask for trailer - static const Long64_t kTrailerMaskHardw = (Long64_t)0x0000000000000FFFULL; // mask for hardware address - static const Long64_t kTrailerMaskNWords = (Long64_t)0x0000000003FF0000ULL; // mask for nwords (number of 40 bit data words) + 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 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) - static const Int_t kHwMaskFEC = 0x0780; // mask for fec in hardware address - static const Int_t kHwMaskBranch = 0x0800; // mask for branch in hardware address - static const Int_t kHwMaskFECChannel = 0x007f; // mask for fec channel in hardware address - static const Int_t kHwMaskAltroChannel = 0x000f; // mask for altro channel in hardware address - static const Int_t kHwMaskAltroChip = 0x0070; // mask for altro chip in hardware address - static const Int_t kHwMaskRCU = 0x7000; // not part of the trailer added afterwards + static const Int_t fgkHwMaskFEC = 0x0780; // mask for fec in hardware address + static const Int_t fgkHwMaskBranch = 0x0800; // mask for branch in hardware address + static const Int_t fgkHwMaskFECChannel = 0x007f; // mask for fec channel in hardware address + static const Int_t fgkHwMaskAltroChannel = 0x000f; // mask for altro channel in hardware address + static const Int_t fgkHwMaskAltroChip = 0x0070; // mask for altro chip in hardware address + static const Int_t fgkHwMaskRCU = 0x7000; // not part of the trailer added afterwards ClassDef(AliTPCMonitorAltro,1); }; diff --git a/TPC/AliTPCMonitorConfig.cxx b/TPC/AliTPCMonitorConfig.cxx index 65d23a0a9e4..f061a3f344e 100755 --- a/TPC/AliTPCMonitorConfig.cxx +++ b/TPC/AliTPCMonitorConfig.cxx @@ -15,63 +15,206 @@ /* $Log$ +Revision 1.1 2007/09/17 10:23:31 cvetan +New TPC monitoring package from Stefan Kniege. The monitoring package can be started by running TPCMonitor.C macro located in macros folder. + */ +//////////////////////////////////////////////////////////////////////// +// +// AliTPCMonitorConfig class +// +// Configuration handler class for AliTPCMonitor +// +// The basic configuration will be read from the file AliTPCMonitorConfig.txt +// and can be changed online via the Button "Conf. Ranges" +// Basic configuration settings are e.g. the range for the determination +// of the baseline, maximum adc value and the settings for the pedestal calculation. +// +// Author: Stefan Kniege, IKF, Frankfurt +// +// +///////////////////////////////////////////////////////////////////////// + + #include "AliTPCMonitorConfig.h" +#include "AliLog.h" +#include + ClassImp(AliTPCMonitorConfig) -//_______________________________________________________________________________________________________________ -AliTPCMonitorConfig::AliTPCMonitorConfig(Char_t* name, Char_t* title) : TNamed(name,title) +// _______________________________________________________________________________________________________________ +AliTPCMonitorConfig::AliTPCMonitorConfig(const Char_t* name, const Char_t* title) : + TNamed(name,title), + fFormat(-1), + fSector(0), + fSectorLast(-1), + fSectorLastDisplayed(-1), + fSectorArr(new Int_t[36]), + fFileLast(new Char_t[256]), + fFileLastSet(0), + fFileCurrent(new Char_t[256]), + fEventNext(1), + fEventNextID(1), + fEventProcessed(0), + fRangeMaxAdcMin(50), + fRangeMaxAdcMax(100), + fRangeBaseMin(300), + fRangeBaseMax(600), + fRangeSumMin(50), + fRangeSumMax(100), + fCanvasXSize(100), + fCanvasYSize(100), + fCanvasXSpace(10), + fCanvasYSpace(10), + fCanvasXOffset(130), + fCanvasMainSize(200), + fMainXSize(100), + fMainYSize(600), + fBorderXSize(10), + fBorderYSize(10), + fButtonXSize(100), + fButtonYSize(20), + fButtonFirstX1(10), + fButtonFirstX2(50), + fButtonFirstY(300), + fWrite10Bit(0), + fComponents(new Float_t[10]), + fSamplingFreq(1000000), + fPedestals(1), + fNumOfChannels(16000), + fTimeBins(1024), + fMaxHwAddr(24000), + fFitPulse(1), + fProcOneSector(1) { - // Constructor - // Set default values for Size of Window - - fRangeMaxAdcMin = 50 ; - fRangeMaxAdcMax = 100 ; - - fRangeBaseMin = 300 ; - fRangeBaseMax = 600 ; - - fRangeSumMin = 50 ; - fRangeSumMax = 100 ; + for(Int_t i =0; i<36; i++) { fSectorArr[i] = 0;} + for(Int_t i =0; i<10;i++) { fComponents[i] =0.0;} + SetMainSize(130,720,10,26 ); +} + + +//_______________________________________________________________________________________________________________ +AliTPCMonitorConfig::AliTPCMonitorConfig(const AliTPCMonitorConfig &config) : + TNamed(config.GetName(),config.GetTitle()), + fFormat(config.fFormat), + fSector(config.fSector), + fSectorLast(config.fSectorLast), + fSectorLastDisplayed(config.fSectorLastDisplayed), + fSectorArr(new Int_t[36]), + fFileLast(new Char_t[strlen(config.fFileLast)+1]), + fFileLastSet(config.fFileLastSet), + fFileCurrent(new Char_t[strlen(config.fFileCurrent)+1]), + fEventNext(config.fEventNext), + fEventNextID(config.fEventNextID), + fEventProcessed(config.fEventProcessed), + fRangeMaxAdcMin(config.fRangeMaxAdcMin), + fRangeMaxAdcMax(config.fRangeMaxAdcMax), + fRangeBaseMin(config.fRangeBaseMin), + fRangeBaseMax(config.fRangeBaseMax), + fRangeSumMin(config.fRangeSumMin), + fRangeSumMax(config.fRangeSumMax), + fCanvasXSize(config.fCanvasXSize), + fCanvasYSize(config.fCanvasYSize), + fCanvasXSpace(config.fCanvasXSpace), + fCanvasYSpace(config.fCanvasYSpace), + fCanvasXOffset(config.fCanvasXOffset), + fCanvasMainSize(config.fCanvasMainSize), + fMainXSize(config.fMainXSize), + fMainYSize(config.fMainYSize), + fBorderXSize(config.fBorderXSize), + fBorderYSize(config.fBorderYSize), + fButtonXSize(config.fBorderXSize), + fButtonYSize(config.fButtonYSize), + fButtonFirstX1(config.fButtonFirstX1), + fButtonFirstX2(config.fButtonFirstX2), + fButtonFirstY(config.fButtonFirstY), + fWrite10Bit(config.fWrite10Bit), + fComponents(new Float_t[10]), + fSamplingFreq(config.fSamplingFreq), + fPedestals(config.fPedestals), + fNumOfChannels(config.fNumOfChannels), + fTimeBins(config.fTimeBins), + fMaxHwAddr(config.fMaxHwAddr), + fFitPulse(config.fFitPulse), + fProcOneSector(config.fProcOneSector) +{ + // copy constructor + strcpy(fFileLast,config.fFileLast); + strcpy(fFileCurrent,config.fFileCurrent); - fFormat = -1; - fSector = 0; - fEventNext = 1; - fEventNextID = 1; + for(Int_t i =0; i<36; i++) { fSectorArr[i] = 0;} + for(Int_t i =0; i<10;i++) { fComponents[i] =0.0;} - SetMainSize(130,720,10,26 ); - fFileLast = new Char_t[256] ; - fFileLastSet = 0; - fFileCurrent = new Char_t[256]; - - fSectorLast =-1; - fSectorLastDisplayed =-1; - - fWrite10Bit = 0; - - fSectorArr = new Int_t[36]; for(Int_t i =0; i<36; i++) { fSectorArr[i] = 0;} - fComponents = new Float_t[10]; for(Int_t i =0; i<10;i++) { fComponents[i] =0.0;} - - fSamplingFreq = 1000000; - fTimeBins = 1024; - fPedestals = 1; - fNumOfChannels = 16000; - fMaxHwAddr = 24000; +} +//_______________________________________________________________________________________________________________ +AliTPCMonitorConfig &AliTPCMonitorConfig::operator =(const AliTPCMonitorConfig& config) +{ + // assignement operator + if(this!=&config){ + ((TNamed *)this)->operator=(config); + fFormat=config.fFormat; + fSector=config.fSector; + fSectorLast=config.fSectorLast; + fSectorLastDisplayed=config.fSectorLastDisplayed; + fFileLastSet=config.fFileLastSet; + fEventNext=config.fEventNext; + fEventNextID=config.fEventNextID; + fEventProcessed=config.fEventProcessed; + fRangeMaxAdcMin=config.fRangeMaxAdcMin; + fRangeMaxAdcMax=config.fRangeMaxAdcMax; + fRangeBaseMin=config.fRangeBaseMin; + fRangeBaseMax=config.fRangeBaseMax; + fRangeSumMin=config.fRangeSumMin; + fRangeSumMax=config.fRangeSumMax; + fCanvasXSize=config.fCanvasXSize; + fCanvasYSize=config.fCanvasYSize; + fCanvasXSpace=config.fCanvasXSpace; + fCanvasYSpace=config.fCanvasYSpace; + fCanvasXOffset=config.fCanvasXOffset; + fCanvasMainSize=config.fCanvasMainSize; + fMainXSize=config.fMainXSize; + fMainYSize=config.fMainYSize; + fBorderXSize=config.fBorderXSize; + fButtonYSize=config.fButtonYSize; + fButtonFirstX1=config.fButtonFirstX1; + fButtonFirstX2=config.fButtonFirstX2; + fButtonFirstY=config.fButtonFirstY; + fWrite10Bit=config.fWrite10Bit; + fPedestals=config.fPedestals; + fNumOfChannels=config.fNumOfChannels; + fTimeBins=config.fTimeBins; + fMaxHwAddr=config.fMaxHwAddr; + fFitPulse=config.fFitPulse; + fProcOneSector=config.fProcOneSector; + + fFileLast = new Char_t[strlen(config.fFileLast)+1]; + strcpy(fFileLast,config.fFileLast); + + + fFileCurrent = new Char_t[strlen(config.fFileCurrent)+1]; + strcpy(fFileCurrent,config.fFileCurrent); + + fSectorArr = new Int_t[36]; for(Int_t i =0; i<36; i++) { fSectorArr[i] = 0;} + fComponents = new Float_t[10]; for(Int_t i =0; i<10;i++) { fComponents[i] =0.0;} + + + } + return *this; +} - fFitPulse = 1; - fEventProcessed = 0; - -} - //_______________________________________________________________________________________________________________ AliTPCMonitorConfig::~AliTPCMonitorConfig() { // Destructor + delete[] fFileLast; + delete[] fFileCurrent; + delete[] fSectorArr; + delete[] fComponents; } @@ -113,18 +256,18 @@ void AliTPCMonitorConfig::SetMainSize(Int_t mainx, Int_t mainy, Int_t borderx=10 } //_______________________________________________________________________________________________________________ -void AliTPCMonitorConfig::SetBaseConfig(Float_t* conf_arr) +void AliTPCMonitorConfig::SetBaseConfig(Float_t* confarr) { - // Set base configuration stored in array conf_arr + // Set base configuration stored in array confarr - fRangeBaseMin = (int)conf_arr[0]; - fRangeBaseMax = (int)conf_arr[1]; + fRangeBaseMin = (int)confarr[0]; + fRangeBaseMax = (int)confarr[1]; - fRangeMaxAdcMin = (int)conf_arr[2]; - fRangeMaxAdcMax = (int)conf_arr[3]; + fRangeMaxAdcMin = (int)confarr[2]; + fRangeMaxAdcMax = (int)confarr[3]; - fRangeSumMin = (int)conf_arr[4]; - fRangeSumMax = (int)conf_arr[5]; + fRangeSumMin = (int)confarr[4]; + fRangeSumMax = (int)confarr[5]; cout << " Set Ranges to : " << endl; cout << " range base :: " << fRangeBaseMin << "\t : " << fRangeBaseMax << endl; diff --git a/TPC/AliTPCMonitorConfig.h b/TPC/AliTPCMonitorConfig.h index 3d9939aac1d..d0e56fcf50e 100755 --- a/TPC/AliTPCMonitorConfig.h +++ b/TPC/AliTPCMonitorConfig.h @@ -17,152 +17,73 @@ // ///////////////////////////////////////////////////////////////////////// - - -#include -#include -#include -#include -#include -#include "TNamed.h" -#include "TObject.h" -#include "TSystem.h" -#include "AliLog.h" -using namespace std; +#include "TNamed.h" class AliTPCMonitorConfig: public TNamed { public : - AliTPCMonitorConfig(Char_t* name,Char_t* title); + AliTPCMonitorConfig(const Char_t* name,const Char_t* title); + AliTPCMonitorConfig(const AliTPCMonitorConfig &config); + AliTPCMonitorConfig& operator= (const AliTPCMonitorConfig& config); virtual ~AliTPCMonitorConfig(); - // Data Format 0: DATA 1: ROOT - Int_t fFormat; - - Int_t fSector; // Currently processed sector - Int_t fSectorLast; // Previously processed sector - Int_t fSectorLastDisplayed; // Last displayed sector - Int_t* fSectorArr; // Array of processed sectors - - // Current and Last Files and Dirs - Char_t* fFileLast; // Name of last processed file/stream - Int_t fFileLastSet ; // Flag showing if last file name was set - - Char_t* fFileCurrent; // Current file/stream name - - Int_t fEventNext; // Process next event -> do not stay in current event - Int_t fEventNextID; // Next event ID to be processed (if event id does not exist search for next existing event) - - Int_t fEventProcessed; // Flag to show if event was read in - - // Ranges for determination of ADC max , Baseline and ADC Sum - Int_t fRangeMaxAdcMin ; // Min timebin of range to determine max. adc value - Int_t fRangeMaxAdcMax ; // Max timebin of range to determine max. adc value - - Int_t fRangeBaseMin ; // Min timebin of range to determine baseline - Int_t fRangeBaseMax ; // Max timebin of range to determine basline - - Int_t fRangeSumMin ; // Min timebin of range to determine adc sum - Int_t fRangeSumMax ; // Max timebin of range to determine adc sum - - // Canvas Size for Monitor Canvases - Int_t fCanvasXSize; // Canvas size in x ( set to fCanvasMainSize ) - Int_t fCanvasYSize; // Canvas size in y ( set to fCanvasMainSize ) - Int_t fCanvasXSpace; // Canvas size in x + border size - Int_t fCanvasYSpace; // Canvas size in y + border size - Int_t fCanvasXOffset; // Canvas x offset (main window) - Int_t fCanvasMainSize; // Canvas size in x and y - - // Size of Main frame and Border (depending on Window Manager) // Main window size x - Int_t fMainXSize; // Main window size y - Int_t fMainYSize; - - Int_t fBorderXSize ; // Canvas border size x - Int_t fBorderYSize ; // Canvas border size y - - // Buttonsize; - Float_t fButtonXSize ; // Button size x - Float_t fButtonYSize ; // Button size y - Float_t fButtonFirstX1; // Pos of first button row in x - Float_t fButtonFirstX2; // Pos of second button row in x - Float_t fButtonFirstY ; // Position of first button in y - - Int_t fWrite10Bit ; // Flag to write 10 bit data words to file - - // Arr to Store Selected components to be displayed - Float_t* fComponents; // Array of components to be selected for display - - // Sampling Freq required for FFT - Int_t fSamplingFreq; // Sampling frequency for data taking - - - Int_t fPedestals ; // Version for pedestal calculation - Int_t fNumOfChannels ; // Maximum number of channels - Int_t fTimeBins ; // Number of timebins to be displayed - Int_t fMaxHwAddr ; // Max value of hardware addresses - - Int_t fFitPulse ; // Flag for fitting pulse around max adc - - Int_t fProcOneSector ; - - - Float_t GetButtonXSize() { return fButtonXSize;} - Float_t GetButtonYSize() { return fButtonYSize;} - Float_t GetButtonXFirst1() { return fButtonFirstX1;} - Float_t GetButtonXFirst2() { return fButtonFirstX2;} - Float_t GetButtonYFirst() { return fButtonFirstY;} - Int_t GetMainXSize() { return fMainXSize;} - Int_t GetMainYSize() { return fMainYSize;} - Int_t GetBorderXSize() { return fBorderXSize;} - Int_t GetBorderYSize() { return fBorderYSize;} - Int_t GetCanvasXOffset() { return fCanvasXOffset;} - Int_t GetCanvasXSize() { return fCanvasXSize;} - Int_t GetCanvasYSize() { return fCanvasYSize;} - Int_t GetCanvasXSpace() { return fCanvasXSpace;} - Int_t GetCanvasYSpace() { return fCanvasYSpace;} - - Float_t* GetComponentSelection() { return fComponents;} - - Int_t GetEventProcessed() { return fEventProcessed ;} + Float_t GetButtonXSize() const { return fButtonXSize;} + Float_t GetButtonYSize() const { return fButtonYSize;} + Float_t GetButtonXFirst1() const { return fButtonFirstX1;} + Float_t GetButtonXFirst2() const { return fButtonFirstX2;} + Float_t GetButtonYFirst() const { return fButtonFirstY;} + Int_t GetMainXSize() const { return fMainXSize;} + Int_t GetMainYSize() const { return fMainYSize;} + Int_t GetBorderXSize() const { return fBorderXSize;} + Int_t GetBorderYSize() const { return fBorderYSize;} + Int_t GetCanvasXOffset() const { return fCanvasXOffset;} + Int_t GetCanvasXSize() const { return fCanvasXSize;} + Int_t GetCanvasYSize() const { return fCanvasYSize;} + Int_t GetCanvasXSpace() const { return fCanvasXSpace;} + Int_t GetCanvasYSpace() const { return fCanvasYSpace;} + + Float_t* GetComponentSelection() const { return fComponents;} + + Int_t GetEventProcessed() const { return fEventProcessed ;} - Int_t GetFormat() { return fFormat ;} - Char_t* GetFile() { return fFileCurrent;} + Int_t GetFormat() const { return fFormat ;} + Char_t* GetFile() const { return fFileCurrent;} - Int_t GetFitPulse() { return fFitPulse ;} + Int_t GetFitPulse() const { return fFitPulse ;} Char_t* GetLastProcFile(); - Int_t GetMaxHwAddr() { return fMaxHwAddr ; } + Int_t GetMaxHwAddr() const { return fMaxHwAddr ; } - Int_t GetLastSector() { return fSectorLast;} - Int_t GetLastSectorDisplayed() { return fSectorLastDisplayed;} + Int_t GetLastSector() const { return fSectorLast;} + Int_t GetLastSectorDisplayed() const { return fSectorLastDisplayed;} - Int_t GetNextEventID() { return fEventNextID ;} - Int_t GetNumOfChannels() { return fNumOfChannels ; } + Int_t GetNextEventID() const { return fEventNextID ;} + Int_t GetNumOfChannels() const { return fNumOfChannels ; } - Int_t GetPedestals() { return fPedestals ; } - Int_t GetProcNextEvent() { return fEventNext;} + Int_t GetPedestals() const { return fPedestals ; } + Int_t GetProcNextEvent() const { return fEventNext;} - Int_t GetProcOneSector() { return fProcOneSector;} + Int_t GetProcOneSector() const { return fProcOneSector;} - Int_t GetRangeBaseMin() { return fRangeBaseMin;} - Int_t GetRangeBaseMax() { return fRangeBaseMax;} + Int_t GetRangeBaseMin() const { return fRangeBaseMin;} + Int_t GetRangeBaseMax() const { return fRangeBaseMax;} - Int_t GetRangeMaxAdcMin() { return fRangeMaxAdcMin;} - Int_t GetRangeMaxAdcMax() { return fRangeMaxAdcMax;} + Int_t GetRangeMaxAdcMin() const { return fRangeMaxAdcMin;} + Int_t GetRangeMaxAdcMax() const { return fRangeMaxAdcMax;} - Int_t GetRangeSumMin() { return fRangeSumMin;} - Int_t GetRangeSumMax() { return fRangeSumMax;} + Int_t GetRangeSumMin() const { return fRangeSumMin;} + Int_t GetRangeSumMax() const { return fRangeSumMax;} - Int_t GetSectorFilled(Int_t sector,Int_t side){ return fSectorArr[sector+side*18] ;} - Int_t GetSectorFilled(Int_t sector) { return fSectorArr[sector] ;} + Int_t GetSectorFilled(Int_t sector,Int_t side)const { return fSectorArr[sector+side*18] ;} + Int_t GetSectorFilled(Int_t sector) const { return fSectorArr[sector] ;} - Int_t GetSamplingFrequency() { return fSamplingFreq;} + Int_t GetSamplingFrequency() const { return fSamplingFreq;} - Int_t GetTimeBins() { return fTimeBins ; } + Int_t GetTimeBins() const { return fTimeBins ; } - Int_t GetWrite10Bit() { return fWrite10Bit ;} + Int_t GetWrite10Bit() const { return fWrite10Bit ;} @@ -212,6 +133,77 @@ class AliTPCMonitorConfig: public TNamed void ReadConfig(Char_t* nameconf); void ResetSectorArray() { for(Int_t i=0;i<36; i++) fSectorArr[i]=0;} + private: + + // Data Format 0: DATA 1: ROOT + Int_t fFormat; // Format of the processed file/stream + + Int_t fSector; // Currently processed sector + Int_t fSectorLast; // Previously processed sector + Int_t fSectorLastDisplayed; // Last displayed sector + Int_t* fSectorArr; // Array of processed sectors + + // Current and Last Files and Dirs + Char_t* fFileLast; // Name of last processed file/stream + Int_t fFileLastSet ; // Flag showing if last file name was set + + Char_t* fFileCurrent; // Current file/stream name + + Int_t fEventNext; // Process next event -> do not stay in current event + Int_t fEventNextID; // Next event ID to be processed (if event id does not exist search for next existing event) + + Int_t fEventProcessed; // Flag to show if event was read in + + // Ranges for determination of ADC max , Baseline and ADC Sum + Int_t fRangeMaxAdcMin ; // Min timebin of range to determine max. adc value + Int_t fRangeMaxAdcMax ; // Max timebin of range to determine max. adc value + + Int_t fRangeBaseMin ; // Min timebin of range to determine baseline + Int_t fRangeBaseMax ; // Max timebin of range to determine basline + + Int_t fRangeSumMin ; // Min timebin of range to determine adc sum + Int_t fRangeSumMax ; // Max timebin of range to determine adc sum + + // Canvas Size for Monitor Canvases + Int_t fCanvasXSize; // Canvas size in x ( set to fCanvasMainSize ) + Int_t fCanvasYSize; // Canvas size in y ( set to fCanvasMainSize ) + Int_t fCanvasXSpace; // Canvas size in x + border size + Int_t fCanvasYSpace; // Canvas size in y + border size + Int_t fCanvasXOffset; // Canvas x offset (main window) + Int_t fCanvasMainSize; // Canvas size in x and y + + // Size of Main frame and Border (depending on Window Manager) + Int_t fMainXSize; // Main window size x + Int_t fMainYSize; // Main window size y + + Int_t fBorderXSize ; // Canvas border size x + Int_t fBorderYSize ; // Canvas border size y + + // Buttonsize; + Float_t fButtonXSize ; // Button size x + Float_t fButtonYSize ; // Button size y + Float_t fButtonFirstX1; // Pos of first button row in x + Float_t fButtonFirstX2; // Pos of second button row in x + Float_t fButtonFirstY ; // Position of first button in y + + Int_t fWrite10Bit ; // Flag to write 10 bit data words to file + + // Arr to Store Selected components to be displayed + Float_t* fComponents; // Array of components to be selected for display + + // Sampling Freq required for FFT + Int_t fSamplingFreq; // Sampling frequency for data taking + + + Int_t fPedestals ; // Version for pedestal calculation + Int_t fNumOfChannels ; // Maximum number of channels + Int_t fTimeBins ; // Number of timebins to be displayed + Int_t fMaxHwAddr ; // Max value of hardware addresses + + Int_t fFitPulse ; // Flag for fitting pulse around max adc + + Int_t fProcOneSector ; // Flag for processing only the specified sector for the next event + ClassDef(AliTPCMonitorConfig,1); }; diff --git a/TPC/AliTPCMonitorDateFile.cxx b/TPC/AliTPCMonitorDateFile.cxx index 7ea8f9db5f0..f0fad1cc59b 100755 --- a/TPC/AliTPCMonitorDateFile.cxx +++ b/TPC/AliTPCMonitorDateFile.cxx @@ -15,26 +15,82 @@ /* $Log$ +Revision 1.1 2007/09/17 10:23:31 cvetan +New TPC monitoring package from Stefan Kniege. The monitoring package can be started by running TPCMonitor.C macro located in macros folder. + */ -#include "AliTPCMonitorDateFile.h" +//////////////////////////////////////////////////////////////////////// +// +// AliTPCMonitorDateFile class +// +// Class for handling the data structure in a DATE file +// Used to read DATE files for the TPC raw data Monitor +// +// Author: Roland Bramm +// Stefan Kniege, IKF, Frankfurt +// +// +///////////////////////////////////////////////////////////////////////// + + +#include "AliTPCMonitorDateFile.h" +#include "AliTPCMonitorDateFormat.h" +#include ClassImp(AliTPCMonitorDateFile) //____________________________________________________________________________ -AliTPCMonitorDateFile::AliTPCMonitorDateFile() +AliTPCMonitorDateFile::AliTPCMonitorDateFile() : + ffilePos(0), + fbigMem(0), + fbigMemsize(0), + fisBigMemAllocated(false), + ffileSize(0), + ffilename(""), + finitFile(false), + freadPosOverflow(false), + fin(new ifstream()) { // Constructor - fin = new ifstream(); - fisBigMemAllocated = false; - freadPosOverflow = false; - ffilePos = 0; - ffileSize = 0; - fbigMemsize = 0; - finitFile = false; - ffilename = ""; } +//____________________________________________________________________________ +AliTPCMonitorDateFile::AliTPCMonitorDateFile(const AliTPCMonitorDateFile &datefile) : + TNamed(datefile.GetName(),datefile.GetTitle()), + ffilePos(datefile.ffilePos), + fbigMem(datefile.fbigMem), + fbigMemsize(datefile.fbigMemsize), + fisBigMemAllocated(datefile.fisBigMemAllocated), + ffileSize(datefile.ffileSize), + ffilename(datefile.ffilename), + finitFile(datefile.finitFile), + freadPosOverflow(datefile.freadPosOverflow), + fin(new ifstream()) +{ + // copy constructor +} + +//____________________________________________________________________________ +AliTPCMonitorDateFile &AliTPCMonitorDateFile:: operator= (const AliTPCMonitorDateFile& datefile) +{ + + // assignment operator + if(this!=&datefile) + { + ffilePos=datefile.ffilePos; + fbigMem=datefile.fbigMem; + fbigMemsize=datefile.fbigMemsize; + fisBigMemAllocated=datefile.fisBigMemAllocated; + ffileSize=datefile.ffileSize; + ffilename=datefile.ffilename; + finitFile=datefile.finitFile; + freadPosOverflow=datefile.freadPosOverflow; + fin = new ifstream(); + } + return *this; +} + //____________________________________________________________________________ AliTPCMonitorDateFile::~AliTPCMonitorDateFile() { @@ -104,6 +160,7 @@ void AliTPCMonitorDateFile::ReadEvent() { // Read in event from file Int_t size; + Char_t fmem[512]; // array for event header Char_t swapcarry[4]; Bool_t toSwapEndian = false; //Fetch some bytes to get headers to know how much diff --git a/TPC/AliTPCMonitorDateFile.h b/TPC/AliTPCMonitorDateFile.h index 3eb0f612640..0ab1355c8ca 100755 --- a/TPC/AliTPCMonitorDateFile.h +++ b/TPC/AliTPCMonitorDateFile.h @@ -6,9 +6,21 @@ /* $Id$ */ + +//////////////////////////////////////////////////////////////////////// +// +// AliTPCMonitorDateFile class +// +// Class for handling the data structure in a DATE file +// +// Authors: Roland Bramm +// Stefan Kniege, IKF, Frankfurt +// +// +///////////////////////////////////////////////////////////////////////// + + #include -#include -#include "AliTPCMonitorDateFormat.h" #include "TNamed.h" using namespace std; @@ -16,6 +28,8 @@ using namespace std; class AliTPCMonitorDateFile : public TNamed { public: AliTPCMonitorDateFile(); + AliTPCMonitorDateFile(const AliTPCMonitorDateFile &datefile); + AliTPCMonitorDateFile& operator= (const AliTPCMonitorDateFile& datefile); ~AliTPCMonitorDateFile(); void AllocateArray(int size); @@ -39,10 +53,10 @@ class AliTPCMonitorDateFile : public TNamed { private: + void SetFileSize(); - ifstream * fin; // file to be read + Int_t ffilePos; // position in file - Char_t fmem[512]; // array for event header Char_t* fbigMem; // array for event data UInt_t fbigMemsize; // size of data array Bool_t fisBigMemAllocated; // flag for already allocated array @@ -50,6 +64,7 @@ class AliTPCMonitorDateFile : public TNamed { string ffilename; // name of DATE file Bool_t finitFile; // flag for opened file Bool_t freadPosOverflow; // data position overflow flag + ifstream * fin; // file to be read ClassDef(AliTPCMonitorDateFile,1); }; diff --git a/TPC/AliTPCMonitorDateFormat.cxx b/TPC/AliTPCMonitorDateFormat.cxx index 3c10a1f4d23..782a43a27c9 100755 --- a/TPC/AliTPCMonitorDateFormat.cxx +++ b/TPC/AliTPCMonitorDateFormat.cxx @@ -15,22 +15,72 @@ /* $Log$ +Revision 1.2 2007/09/17 16:34:54 cvetan +The package was overwriting the rootcint flags. This was fixed by applying the necessary changes in the DATE-dependent parts of the code + Revision 1.1 2007/09/17 10:23:31 cvetan New TPC monitoring package from Stefan Kniege. The monitoring package can be started by running TPCMonitor.C macro located in macros folder. */ + +//////////////////////////////////////////////////////////////////////// +// +// AliTPCMonitorDateFormat class +// +// Class for decoding raw data headers in DATE format +// Reads event and subevent header informations form DATE files +// +// Authors: Roland Bramm, +// Stefan Kniege, IKF, Frankfurt +// +///////////////////////////////////////////////////////////////////////// + #include "AliTPCMonitorDateFormat.h" #include "event.h" #include ClassImp(AliTPCMonitorDateFormat) //____________________________________________________________________________ -AliTPCMonitorDateFormat::AliTPCMonitorDateFormat(Char_t* data){ +AliTPCMonitorDateFormat::AliTPCMonitorDateFormat(Char_t* data): + fdataPtr(data), + fsubEventPtr(data), + fcurrentPtr(data), + event((struct eventHeaderStruct*) fdataPtr), + subEvent(0), + equipment(0) +{ // Constructor - fdataPtr = data; - fsubEventPtr = data; - fcurrentPtr = data; - event = (struct eventHeaderStruct*) fdataPtr; +} + + +//____________________________________________________________________________ +AliTPCMonitorDateFormat::AliTPCMonitorDateFormat(const AliTPCMonitorDateFormat &dateformat) : + TNamed(dateformat.GetName(),dateformat.GetTitle()), + fdataPtr(dateformat.fdataPtr), + fsubEventPtr(dateformat.fsubEventPtr), + fcurrentPtr(dateformat.fcurrentPtr), + event((struct eventHeaderStruct*)dateformat.fdataPtr), + subEvent(dateformat.subEvent), + equipment(dateformat.equipment) +{ + // copy constructor +} + +//____________________________________________________________________________ +AliTPCMonitorDateFormat &AliTPCMonitorDateFormat:: operator= (const AliTPCMonitorDateFormat& dateformat) +{ + + // assignment operator + if(this!=&dateformat) + { + fdataPtr=dateformat.fdataPtr; + fsubEventPtr=dateformat.fsubEventPtr; + fcurrentPtr=dateformat.fcurrentPtr; + event=dateformat.event; + subEvent=dateformat.subEvent; + equipment=dateformat.equipment; + } + return *this; } //____________________________________________________________________________ diff --git a/TPC/AliTPCMonitorDateFormat.h b/TPC/AliTPCMonitorDateFormat.h index 52cb9c301e2..a44cc948a0d 100755 --- a/TPC/AliTPCMonitorDateFormat.h +++ b/TPC/AliTPCMonitorDateFormat.h @@ -11,7 +11,7 @@ // // AliTPCMonitorDateFormat class // -// Class for decoding and reading raw data headers in DATE format +// Class for decoding raw data headers in DATE format // // Authors: Roland Bramm, // Stefan Kniege, IKF, Frankfurt @@ -28,6 +28,8 @@ using namespace std; class AliTPCMonitorDateFormat : public TNamed { public: AliTPCMonitorDateFormat(Char_t* data); + AliTPCMonitorDateFormat(const AliTPCMonitorDateFormat &dateformat); + AliTPCMonitorDateFormat& operator= (const AliTPCMonitorDateFormat& dateformat); ~AliTPCMonitorDateFormat(); //Super Event Header @@ -83,9 +85,9 @@ class AliTPCMonitorDateFormat : public TNamed { Int_t GetPositionSubEvent(); private: - Char_t* fdataPtr; // pointer to data array (start, will not be changed in event) - Char_t* fsubEventPtr; // pointer to SubEvent - Char_t* fcurrentPtr; // pointer to current data position (header or data) + Char_t* fdataPtr; // pointer to data array (start, will not be changed in event) + Char_t* fsubEventPtr; // pointer to SubEvent + Char_t* fcurrentPtr; // pointer to current data position (header or data) eventHeaderStruct* event; // event and eventHeaderStruct* subEvent; // subevent structure equipmentHeaderStruct* equipment; // equipmemnt structure diff --git a/TPC/AliTPCMonitorDateMonitor.cxx b/TPC/AliTPCMonitorDateMonitor.cxx index 99188282d26..2afe5d54250 100755 --- a/TPC/AliTPCMonitorDateMonitor.cxx +++ b/TPC/AliTPCMonitorDateMonitor.cxx @@ -15,11 +15,31 @@ /* $Log$ +Revision 1.2 2007/09/17 16:34:54 cvetan +The package was overwriting the rootcint flags. This was fixed by applying the necessary changes in the DATE-dependent parts of the code + Revision 1.1 2007/09/17 10:23:31 cvetan New TPC monitoring package from Stefan Kniege. The monitoring package can be started by running TPCMonitor.C macro located in macros folder. */ +//////////////////////////////////////////////////////////////////////// +// +// AliTPCMonitorDateMonitor class +// +// Monitoring wrapper class for DATE raw data monitoring used by the TPC +// raw data monitor. +// Online monitoring is only possible if DATE is installed on the machine. +// If not, raw data can be read using the AliTPCMonitorDateFile +// (can be choosen from 'Sel.Format' in the TPCMonitor gui") +// +// Authors: Roland Bramm, +// Stefan Kniege, IKF, Frankfurt +// +///////////////////////////////////////////////////////////////////////// + + + #include #include "AliTPCMonitorDateMonitor.h" #include "event.h" @@ -28,9 +48,30 @@ New TPC monitoring package from Stefan Kniege. The monitoring package can be sta ClassImp(AliTPCMonitorDateMonitor) //_____________________________________________________________________________ -AliTPCMonitorDateMonitor::AliTPCMonitorDateMonitor(){ +AliTPCMonitorDateMonitor::AliTPCMonitorDateMonitor(): +fPointer(0) +{ // Constructor - fPointer = 0; +} + + +//_____________________________________________________________________________ +AliTPCMonitorDateMonitor::AliTPCMonitorDateMonitor(const AliTPCMonitorDateMonitor &datemon) : + TNamed(datemon.GetName(),datemon.GetTitle()), + fPointer(datemon.fPointer) +{ + // copy constructor +} + +//_____________________________________________________________________________ +AliTPCMonitorDateMonitor &AliTPCMonitorDateMonitor::operator =(const AliTPCMonitorDateMonitor& datemon) +{ + // assignement operator + if(this!=&datemon){ + fPointer=datemon.fPointer; + } + + return *this; } //_____________________________________________________________________________ diff --git a/TPC/AliTPCMonitorDateMonitor.h b/TPC/AliTPCMonitorDateMonitor.h index 582a5112c05..505b618af3d 100755 --- a/TPC/AliTPCMonitorDateMonitor.h +++ b/TPC/AliTPCMonitorDateMonitor.h @@ -26,17 +26,19 @@ using namespace std; class AliTPCMonitorDateMonitor : public TNamed { public: - AliTPCMonitorDateMonitor(); - ~AliTPCMonitorDateMonitor(); - - void Free(); - Int_t OpenMonitoring(string name); - Char_t* DecodeError(int error); - Int_t DeclareMonitor(string name); - Int_t FlushEvents(); - Int_t GetEvent(); - Char_t *GetEventPointerasChar(); - Int_t Logout(); + AliTPCMonitorDateMonitor(); + AliTPCMonitorDateMonitor(const AliTPCMonitorDateMonitor &config); + AliTPCMonitorDateMonitor& operator= (const AliTPCMonitorDateMonitor& config); + ~AliTPCMonitorDateMonitor(); + + void Free(); + Int_t OpenMonitoring(string name); + Char_t* DecodeError(int error); + Int_t DeclareMonitor(string name); + Int_t FlushEvents(); + Int_t GetEvent(); + Char_t *GetEventPointerasChar(); + Int_t Logout(); private: diff --git a/TPC/AliTPCMonitorDialog.cxx b/TPC/AliTPCMonitorDialog.cxx index 11586a9ad3b..876cc7cfe72 100755 --- a/TPC/AliTPCMonitorDialog.cxx +++ b/TPC/AliTPCMonitorDialog.cxx @@ -15,48 +15,100 @@ /* $Log$ +Revision 1.1 2007/09/17 10:23:31 cvetan +New TPC monitoring package from Stefan Kniege. The monitoring package can be started by running TPCMonitor.C macro located in macros folder. + */ +//////////////////////////////////////////////////////////////////////// +// +// AliTPCMonitorDialog class +// +// Class to handle dialogs for settings of files and configurations +// for the AliTPCMonitor +// +// The dialog will be called by an AliTPCMonitor object from the macro TPCMonitor.C. +// Depending on the version number passed when creating an Object of this class +// a certain dialog window (see constructor) for the TPCMonitor will be opened. +// The data inserted will be passed to the configuration handler and read out +// by the monitor object or a the monitor member function will be directly called. +// +// Author: Stefan Kniege, IKF, Frankfurt +// +// +///////////////////////////////////////////////////////////////////////// + + + #include "AliTPCMonitorDialog.h" +#include "TGTab.h" +#include "TGButton.h" +#include "TGLabel.h" +#include "TGListBox.h" +#include "TGLayout.h" +#include "TGTextBuffer.h" +#include "TGTextEntry.h" +#include "TGWindow.h" +#include "TVirtualPadEditor.h" +#include "TTimer.h" +#include "RQ_OBJECT.h" +#include #include "Rtypes.h" #include "AliLog.h" + ClassImp(AliTPCMonitorDialog) //_____________________________________________________________________________________________ AliTPCMonitorDialog::AliTPCMonitorDialog(const TGWindow *p, const TGWindow *main, UInt_t w, - UInt_t h, UInt_t options, Int_t version,AliTPCMonitor* monitor) + UInt_t h, UInt_t options, Int_t version,AliTPCMonitor* monitor): + fFrameMain(new TGTransientFrame(p, main, w, h, options)), + fFrameComp(0), + fFrameHor(new TGHorizontalFrame(fFrameMain, 60, 20, kFixedWidth)), + fFrameGroup(0), + fOkButton(new TGTextButton(fFrameHor, "&Ok", 1)), + fListBox(0), + fTab(new TGTab(fFrameMain, 300, 300)), + fLayout1(new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2)), + fLayout2(new TGLayoutHints(kLHintsBottom | kLHintsRight , 2, 2, 5, 1)), + fLayout3(new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5)), + fMonitor(monitor) + { - // Constructor for Dialog window. + // Constructor for Dialog window. // Create a dialog window.depending on the version it is called with.. // Verrion 0: Choose DATA Format // Version 1: Choose FEC components to display // Version 2: Choose Ranges for base and max adc calculation - fMonitor = monitor; - - fFrameMain = new TGTransientFrame(p, main, w, h, options); fFrameMain->Connect("CloseWindow()", "AliTPCMonitorDialog", this, "DoClose()"); fFrameMain->DontCallClose(); fFrameMain->SetCleanup(kDeepCleanup); - - fFrameHor = new TGHorizontalFrame(fFrameMain, 60, 20, kFixedWidth); - fOkButton = new TGTextButton(fFrameHor, "&Ok", 1); fOkButton->Connect("Clicked()", "AliTPCMonitorDialog", this, "DoOK()"); - - fLayout1 = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2); - fLayout2 = new TGLayoutHints(kLHintsBottom | kLHintsRight , 2, 2, 5, 1); - fLayout3 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5); - fFrameHor->AddFrame(fOkButton, fLayout1); fFrameHor->Resize(150, fOkButton->GetDefaultHeight()); fFrameMain->AddFrame( fFrameHor, fLayout2); - - fTab = new TGTab(fFrameMain, 300, 300); fTab->Connect("Selected(Int_t)", "AliTPCMonitorDialog", this, "DoTab(Int_t)"); - CreateDialogVersion(version); } +// //_____________________________________________________________________________ +// AliTPCMonitorDialog::AliTPCMonitorDialog(const AliTPCMonitorDialog &dialog) : +// { +// // copy constructor (actually none forseen for this class +// AliWarning("No copying forseen for this class"); + +// } + +// //_____________________________________________________________________________ +// AliTPCMonitorDialog &AliTPCMonitorDialog::operator =(const AliTPCMonitorDialog& dialog) +// { +// // assignement operator +// AliWarning("No assignment forseen for this class"); +// return *this; +// } + + + //_____________________________________________________________________________________________ void AliTPCMonitorDialog::CreateDialogVersion(Int_t version) { diff --git a/TPC/AliTPCMonitorDialog.h b/TPC/AliTPCMonitorDialog.h index 44fc2469de5..0a2bc7b98e2 100755 --- a/TPC/AliTPCMonitorDialog.h +++ b/TPC/AliTPCMonitorDialog.h @@ -19,64 +19,31 @@ ///////////////////////////////////////////////////////////////////////// - -#include -#include "TGWindow.h" -#include "TRootGuiBuilder.h" -#include "TGMenu.h" -#include "TGButtonGroup.h" -#include "TGDockableFrame.h" -#include "TGToolBar.h" -#include "TGButton.h" -#include "TGToolTip.h" -#include "TGuiBldDragManager.h" -#include "TGMdiMainFrame.h" -#include "TGLabel.h" -#include "TG3DLine.h" -#include "TGNumberEntry.h" -#include "TGuiBldHintsButton.h" -#include "TGuiBldHintsEditor.h" -#include "TGuiBldEditor.h" -#include "TGShutter.h" -#include "TGCanvas.h" -#include "TGStatusBar.h" -#include "TGTab.h" -#include "TGSplitter.h" -#include "TGMdiMenu.h" -#include "TGMdiDecorFrame.h" -#include "TGMdiFrame.h" -#include "TGListBox.h" -#include "TGListView.h" -#include "TGFSContainer.h" -#include "TGFSComboBox.h" -#include "TGFileDialog.h" -#include "TGScrollBar.h" -#include "TGMsgBox.h" -#include "TGLayout.h" #include "TGFrame.h" -#include "TGTextEdit.h" #include "RQ_OBJECT.h" -#include "TRootEmbeddedCanvas.h" -#include "TH2F.h" -#include "TRandom.h" -#include "TVirtualPadEditor.h" -#include "TSystem.h" -#include "Rtypes.h" #include "AliTPCMonitor.h" -#include "AliLog.h" - -using namespace std; - - +class TGWindow; +class TGTransientFrame; +class TGLayoutHints; +class TGListBox; +class AliTPCMonitor; +class TGTab; +class TGButton; class TGHorizontalFrame; -class AliLog; +class TGTextBuffer; +class TGTextEntry; +class TGTransientFrame; +class TGCompositeFrame; +class TGGroupFrame; class AliTPCMonitorDialog : public TNamed{ RQ_OBJECT("AliTPCMonitorDialog") - - public: + +public: AliTPCMonitorDialog(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h, UInt_t options = kVerticalFrame, Int_t version =1, AliTPCMonitor* monitor =0); + //AliTPCMonitorDialog(const AliTPCMonitorDialog &dialog); + //AliTPCMonitorDialog& operator= (const AliTPCMonitorDialog& dialog); virtual ~AliTPCMonitorDialog(); void DoClose(); @@ -94,8 +61,6 @@ class AliTPCMonitorDialog : public TNamed{ TGHorizontalFrame* fFrameHor; // Frames for dialog windows TGGroupFrame* fFrameGroup; // Frames for dialog windows TGButton* fOkButton; // Ok button for windows - TGButton* fCancelButton; // Cancel button for windows - TGListBox* fListBox; // ListBox for entries to be selected TGTab* fTab; // Tabs for several pages in one window TGLayoutHints* fLayout1; // Layout for window version 1 diff --git a/TPC/AliTPCMonitorFFT.cxx b/TPC/AliTPCMonitorFFT.cxx index 5eb63f0492f..f9c044601d9 100755 --- a/TPC/AliTPCMonitorFFT.cxx +++ b/TPC/AliTPCMonitorFFT.cxx @@ -15,8 +15,25 @@ /* $Log$ +Revision 1.1 2007/09/17 10:23:31 cvetan +New TPC monitoring package from Stefan Kniege. The monitoring package can be started by running TPCMonitor.C macro located in macros folder. + */ +//////////////////////////////////////////////////////////////////////// +// +// AliTPCMonitorFFT class +// +// Wrapper class to perform Fast Fourier Transformations. +// The code is based on the Gnu Scientific Library. +// See documentation of gsl for further details. +// +// Author: Stefan Kniege, IKF, Frankfurt +// +// +///////////////////////////////////////////////////////////////////////// + + #include "AliTPCMonitorFFT.h" diff --git a/TPC/AliTPCMonitorMappingHandler.cxx b/TPC/AliTPCMonitorMappingHandler.cxx index c8de9064a00..b85d3923093 100755 --- a/TPC/AliTPCMonitorMappingHandler.cxx +++ b/TPC/AliTPCMonitorMappingHandler.cxx @@ -15,20 +15,53 @@ /* $Log$ + Revision 1.1 2007/09/17 10:23:31 cvetan + New TPC monitoring package from Stefan Kniege. The monitoring package can be started by running TPCMonitor.C macro located in macros folder. + */ +//////////////////////////////////////////////////////////////////////// +// +// AliTPCMonitorMappingHandler class +// +// Class for handling mapping information TPC +// +// The mapping information for the TPC front end electornics (pads, front end cards) +// are handled by this class. +// The information from the design mapping and from the hardware address can be +// cross checked in the TPCMonitor.C. +// Malfunctioning front end cards can be identified by looking at single channels +// displayed with the TPCMonitor. +// +// +// Authors: Roland Bramm, +// Stefan Kniege, IKF, Frankfurt +// +///////////////////////////////////////////////////////////////////////// + + #include "AliTPCMonitorMappingHandler.h" +#include "TH1.h" +#include "TLegend.h" +#include "AliLog.h" +#include + ClassImp(AliTPCMonitorMappingHandler) //_____________________________________________________________________________________________ -AliTPCMonitorMappingHandler::AliTPCMonitorMappingHandler(Char_t* name, Char_t* title): TNamed(name,title) +AliTPCMonitorMappingHandler::AliTPCMonitorMappingHandler(Char_t* name, Char_t* title): + TNamed(name,title), + fnumofChannels(0), + fmaxHWAdress(0), + fsizeofArray(0), + fmapping(new Short_t*[24000]), + fmappingChannelinRow(new Int_t*[160]), + fu2ftestmapping(new Short_t*[7000]), + fMapHwFECglobal(new Int_t*[24000]), + fecGainMap(new Float_t*[7000]) { // Constructor : Initialize mapping arrays - fmapping = new Short_t*[24000]; - - - fmappingChannelinRow = new Int_t*[160]; for(Int_t in = 0; in<160; in++) { Int_t* hold = new Int_t[150]; @@ -36,16 +69,13 @@ AliTPCMonitorMappingHandler::AliTPCMonitorMappingHandler(Char_t* name, Char_t* t fmappingChannelinRow[in]= hold; } - - fu2ftestmapping = new Short_t*[7000]; for(Int_t i = 0; i<7000; i++) { Short_t* hold = new Short_t[8]; for(Int_t j = 0; j<8;j++) hold[j]=0; fu2ftestmapping[i]= hold; } - - fMapHwFECglobal = new Int_t*[24000]; + for(Int_t i = 0; i<24000; i++) { Int_t* hold = new Int_t[2]; @@ -53,7 +83,7 @@ AliTPCMonitorMappingHandler::AliTPCMonitorMappingHandler(Char_t* name, Char_t* t fMapHwFECglobal[i]= hold; } - fecGainMap = new Float_t*[7000]; + for(Int_t i = 0; i<7000; i++) { Float_t* hold = new Float_t[128]; @@ -62,6 +92,103 @@ AliTPCMonitorMappingHandler::AliTPCMonitorMappingHandler(Char_t* name, Char_t* t } } +//____________________________________________________________________________ +AliTPCMonitorMappingHandler::AliTPCMonitorMappingHandler(const AliTPCMonitorMappingHandler &maphand) : + TNamed(maphand.GetName(),maphand.GetTitle()), + fnumofChannels(maphand.fnumofChannels), + fmaxHWAdress(maphand.fmaxHWAdress), + fsizeofArray(maphand.fsizeofArray), + fmapping(new Short_t*[24000]), + fmappingChannelinRow(new Int_t*[160]), + fu2ftestmapping(new Short_t*[7000]), + fMapHwFECglobal(new Int_t*[24000]), + fecGainMap(new Float_t*[7000]) +{ + // copy constructor + + + for(Int_t in = 0; in<160; in++) + { + Int_t* hold = new Int_t[150]; + for(Int_t jn = 0; jn<150;jn++) hold[jn]=maphand.fmappingChannelinRow[in][jn]; + fmappingChannelinRow[in]= hold; + } + + for(Int_t i = 0; i<7000; i++) + { + Short_t* hold = new Short_t[8]; + for(Int_t j = 0; j<8;j++) hold[j]=maphand.fu2ftestmapping[i][j]; + fu2ftestmapping[i]= hold; + } + + for(Int_t i = 0; i<24000; i++) + { + Int_t* hold = new Int_t[2]; + for(Int_t j = 0; j<2;j++) hold[j]=maphand.fMapHwFECglobal[i][j]; + fMapHwFECglobal[i]= hold; + } + + for(Int_t i = 0; i<7000; i++) + { + Float_t* hold = new Float_t[128]; + for(Int_t j = 0; j<128;j++) hold[j]=maphand.fecGainMap[i][j]; + fecGainMap[i]= hold; + } + +} + + +//____________________________________________________________________________ +AliTPCMonitorMappingHandler &AliTPCMonitorMappingHandler:: operator= (const AliTPCMonitorMappingHandler& maphand) +{ + // assignment operator + if(this!=&maphand) + { + fnumofChannels=maphand.fnumofChannels; + fmaxHWAdress=maphand.fmaxHWAdress; + fsizeofArray=maphand.fsizeofArray; + + fmapping = new Short_t*[24000]; // empty + + + fmappingChannelinRow = new Int_t*[160]; + for(Int_t in = 0; in<160; in++) + { + Int_t* hold = new Int_t[150]; + for(Int_t jn = 0; jn<150;jn++) hold[jn]=maphand.fmappingChannelinRow[in][jn]; + fmappingChannelinRow[in]= hold; + } + + fu2ftestmapping = new Short_t*[7000]; + for(Int_t i = 0; i<7000; i++) + { + Short_t* hold = new Short_t[8]; + for(Int_t j = 0; j<8;j++) hold[j]=maphand.fu2ftestmapping[i][j]; + fu2ftestmapping[i]= hold; + } + + fMapHwFECglobal = new Int_t*[24000]; + for(Int_t i = 0; i<24000; i++) + { + Int_t* hold = new Int_t[2]; + for(Int_t j = 0; j<2;j++) hold[j]=maphand.fMapHwFECglobal[i][j]; + fMapHwFECglobal[i]= hold; + } + + fecGainMap = new Float_t*[7000]; + for(Int_t i = 0; i<7000; i++) + { + Float_t* hold = new Float_t[128]; + for(Int_t j = 0; j<128;j++) hold[j]=maphand.fecGainMap[i][j]; + fecGainMap[i]= hold; + } + + + } + return *this; +} + + //_____________________________________________________________________________________________ AliTPCMonitorMappingHandler::~AliTPCMonitorMappingHandler() { @@ -135,7 +262,7 @@ void AliTPCMonitorMappingHandler::ReadMapping(char* mapfile) // can hence be found in fmapping[hwaddr] - + Short_t* mappingRow; char readcarry[255]; Int_t version = -1; Int_t actPos = 0; @@ -158,13 +285,13 @@ void AliTPCMonitorMappingHandler::ReadMapping(char* mapfile) } fmappingEmptyRow[1] = -1; for(Int_t i = 0; i < fnumofChannels ; i++) { - fmappingRow = new Short_t[11]; + mappingRow = new Short_t[11]; for(Int_t j = 0 ; j < 11 ; j++) { *in >> readcarry; - fmappingRow[j] = atoi(readcarry); + mappingRow[j] = atoi(readcarry); } - actPos = fmappingRow[0]; - fmapping[actPos] = fmappingRow; + actPos = mappingRow[0]; + fmapping[actPos] = mappingRow; if( (actPos - oldPos) > 1) { for(Int_t j = (oldPos+1); j < actPos; j++) { fmapping[j] = fmappingEmptyRow; diff --git a/TPC/AliTPCMonitorMappingHandler.h b/TPC/AliTPCMonitorMappingHandler.h index fb8dca0fa9c..a4c613000ef 100755 --- a/TPC/AliTPCMonitorMappingHandler.h +++ b/TPC/AliTPCMonitorMappingHandler.h @@ -17,23 +17,15 @@ // ///////////////////////////////////////////////////////////////////////// - -#include -#include -#include -#include "TObject.h" #include "TNamed.h" -#include "TH1.h" -#include "TFile.h" -#include "TLegend.h" -#include "AliLog.h" - -using namespace std; class AliTPCMonitorMappingHandler: public TNamed { public: AliTPCMonitorMappingHandler(Char_t* name, Char_t* title); + AliTPCMonitorMappingHandler(const AliTPCMonitorMappingHandler &maphand); + AliTPCMonitorMappingHandler& operator= (const AliTPCMonitorMappingHandler& maphand); + ~AliTPCMonitorMappingHandler(); void ReadMapping(char* mapfile); @@ -77,7 +69,6 @@ class AliTPCMonitorMappingHandler: public TNamed { Int_t fmaxHWAdress; // Max value of hardware addresses Int_t fsizeofArray; // Set to max value of hardware addresses Short_t** fmapping; // global mapping array - Short_t* fmappingRow; // mapping array in one row of the file Int_t** fmappingChannelinRow; // mapping of hardware addresses in one pad row Short_t** fu2ftestmapping; // mapping of global FEC numbers in sectors (determined during installation with U2F card) -- 2.43.5