/*
$Log$
+ Revision 1.2 2007/10/12 13:36:27 cvetan
+ Coding convention fixes from Stefan
+
+ 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 <cstdlib>
#include "AliTPCMonitorMappingHandler.h"
+#include "TH1.h"
+#include "TLegend.h"
+#include "AliLog.h"
+#include <Riostream.h>
+
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];
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];
fMapHwFECglobal[i]= hold;
}
- fecGainMap = new Float_t*[7000];
+
for(Int_t i = 0; i<7000; i++)
{
Float_t* hold = new Float_t[128];
}
}
+//____________________________________________________________________________
+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()
{
// can hence be found in fmapping[hwaddr]
-
+ Short_t* mappingRow;
char readcarry[255];
Int_t version = -1;
Int_t actPos = 0;
}
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;
Int_t fsector = 0;
Int_t fec = 0;
Int_t branch = 0;
- Int_t rcu_patch = 0;
+ Int_t rcupatch = 0;
Int_t altrchann = 0;
Int_t altrchip = 0;
Int_t nextHwAddress = 0;
nfecs++;
fec = U2fGetFECinBranch(ind);
branch = U2fGetBranch(ind);
- rcu_patch = U2fGetRCU(ind);
+ rcupatch = U2fGetRCU(ind);
for(Int_t ch = 0; ch<128; ch++)
{
altrchann = ch%16;
altrchip = ch/16;
- nextHwAddress = ( ((branch&1)<<11) + (fec<<7) + (altrchip<<4) + (altrchann) + ((rcu_patch-1)<<12) );
+ nextHwAddress = ( ((branch&1)<<11) + (fec<<7) + (altrchip<<4) + (altrchann) + ((rcupatch-1)<<12) );
fMapHwFECglobal[nextHwAddress][0] = ind;
fMapHwFECglobal[nextHwAddress][1] = ch ;
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::GetNumOfChannels()
+Int_t AliTPCMonitorMappingHandler::GetNumOfChannels() const
{
// Return number of channels
return fnumofChannels;
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::GetSizeofArray()
+Int_t AliTPCMonitorMappingHandler::GetSizeofArray() const
{
// Return sise of global mapping fmapping array.
// Value orresponds to max value of hardware addresses
//_____________________________________________________________________________________________
-Short_t* AliTPCMonitorMappingHandler::GetLine(Int_t hwaddr)
+Short_t* AliTPCMonitorMappingHandler::GetLine(Int_t hwaddr)const
{
// Return pointer to mapping array for the hardware address hwaddr
Short_t* retval;
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::GetIndex(Int_t hwaddr)
+Int_t AliTPCMonitorMappingHandler::GetIndex(Int_t hwaddr) const
{
// Return readout index for the hardware address hwaddr
Int_t retval;
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::GetPadRow(Int_t hwaddr)
+Int_t AliTPCMonitorMappingHandler::GetPadRow(Int_t hwaddr) const
{
// Return global pad row for the hardware address hwaddr
Int_t retval;
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::GetPad(Int_t hwaddr)
+Int_t AliTPCMonitorMappingHandler::GetPad(Int_t hwaddr) const
{
// Return pad number in row for the hardware address hwaddr
Int_t retval;
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::GetConnector(Int_t hwaddr)
+Int_t AliTPCMonitorMappingHandler::GetConnector(Int_t hwaddr) const
{
// Return connector for the hardware address hwaddr
Int_t retval;
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::GetPin(Int_t hwaddr)
+Int_t AliTPCMonitorMappingHandler::GetPin(Int_t hwaddr) const
{
// Return pin for the hardware address hwaddr
Int_t retval;
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::GetFEC(Int_t hwaddr)
+Int_t AliTPCMonitorMappingHandler::GetFEC(Int_t hwaddr) const
{
// Return fec number in IROC/OROC for the hardware address hwaddr
Int_t retval;
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::GetFECchannel(Int_t hwaddr)
+Int_t AliTPCMonitorMappingHandler::GetFECchannel(Int_t hwaddr) const
{
// Return FEC channel for the hardware address hwaddr
Int_t retval;
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::GetFECconnector(Int_t hwaddr)
+Int_t AliTPCMonitorMappingHandler::GetFECconnector(Int_t hwaddr) const
{
// Return FEC connector for the hardware address hwaddr
Int_t retval;
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::GetAltroChannel(Int_t hwaddr)
+Int_t AliTPCMonitorMappingHandler::GetAltroChannel(Int_t hwaddr) const
{
// Return Altro channel for the hardware address hwaddr
Int_t retval;
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::GetAltro(Int_t hwaddr)
+Int_t AliTPCMonitorMappingHandler::GetAltro(Int_t hwaddr) const
{
// Return Altro chip number in FEC for the hardware address hwaddr
Int_t retval;
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::GetNumofPads(Int_t row)
+Int_t AliTPCMonitorMappingHandler::GetNumofPads(Int_t row)
{
// Return number of pads in row
if(row<159)
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::U2fGetFECnr(Int_t index)
+Int_t AliTPCMonitorMappingHandler::U2fGetFECnr(Int_t index) const
{
// Return FEC number for index (FEC number should be equal to index)
return fu2ftestmapping[index][0];
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::U2fGetSide(Int_t fecnr)
+Int_t AliTPCMonitorMappingHandler::U2fGetSide(Int_t fecnr) const
{
// Return side on which FEC is installed
return fu2ftestmapping[fecnr][1];
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::U2fGetSector(Int_t fecnr)
+Int_t AliTPCMonitorMappingHandler::U2fGetSector(Int_t fecnr) const
{
// Return sector in which FEC is installed
return fu2ftestmapping[fecnr][2];
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::U2fGetRCU(Int_t fecnr)
+Int_t AliTPCMonitorMappingHandler::U2fGetRCU(Int_t fecnr) const
{
// Rerurn rcu patch in which FEC is installed
return fu2ftestmapping[fecnr][3];
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::U2fGetFECinRCU(Int_t fecnr)
+Int_t AliTPCMonitorMappingHandler::U2fGetFECinRCU(Int_t fecnr) const
{
// Return index of FEC in RCU (0-25)
return fu2ftestmapping[fecnr][4];
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::U2fGetFECinBranch(Int_t fecnr)
+Int_t AliTPCMonitorMappingHandler::U2fGetFECinBranch(Int_t fecnr) const
{
// Return index of FEC in branch (0-12)
return fu2ftestmapping[fecnr][5];
}
//_____________________________________________________________________________________________
-Int_t AliTPCMonitorMappingHandler::U2fGetBranch(Int_t fecnr)
+Int_t AliTPCMonitorMappingHandler::U2fGetBranch(Int_t fecnr) const
{
// Return branch in which FEC is installed (0,1)
return fu2ftestmapping[fecnr][6];