Updated online raw data QA for the SSD - occupancy calculation per module (Panos)
[u/mrichter/AliRoot.git] / ITS / AliITSModuleDaSSD.h
CommitLineData
f67db810 1#ifndef ALIITSMODULEDASSD_H
2#define ALIITSMODULEDASSD_H
3
4
223dda26 5/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
6 * See cxx source for full Copyright notice */
7/* */
371588bb 8/* $Id$ */
223dda26 9///////////////////////////////////////////////////////////////////////////////
10///
2e2c6def 11/// This class provides storage container ITS SSD module calibration data
223dda26 12/// used by DA.
13///
14///////////////////////////////////////////////////////////////////////////////
f67db810 15
223dda26 16#include "TObject.h"
c4d90345 17#include "TArrayF.h"
371588bb 18#include "TArrayS.h"
f67db810 19#include "AliITSChannelDaSSD.h"
20
223dda26 21class AliITSNoiseSSD;
2e2c6def 22class AliITSPedestalSSD;
23class AliITSBadChannelsSSD;
223dda26 24
f67db810 25class AliITSModuleDaSSD : public TObject {
26 public :
27 AliITSModuleDaSSD();
28 AliITSModuleDaSSD(const Int_t numberofstrips);
29 AliITSModuleDaSSD(const Int_t numberofstrips, const Long_t eventsnumber);
30 AliITSModuleDaSSD(const UChar_t ddlID, const UChar_t ad, const UChar_t adc, const UShort_t moduleID);
31 AliITSModuleDaSSD(const AliITSModuleDaSSD& module);
32 AliITSModuleDaSSD& operator = (const AliITSModuleDaSSD& module);
33 virtual ~AliITSModuleDaSSD();
34
35 UChar_t GetDdlId() const { return fDdlId; }
36 UChar_t GetAD() const { return fAd; }
37 UChar_t GetADC() const { return fAdc; }
c4d90345 38 Short_t GetModuleId() const { return fModuleId; }
f67db810 39 Int_t GetModuleRorcEquipId() const { return fEquipId; }
40 Int_t GetModuleRorcEquipType() const { return fEquipType; }
41 Int_t GetNumberOfStrips() const { return fNumberOfStrips; }
42 Long_t GetEventsNumber() const { return fEventsNumber; }
c4d90345 43 Float_t* GetCM(const Int_t chipn) const { return chipn < fNumberOfChips ? fCm[chipn].GetArray() : NULL; }
44 Float_t GetCM(const Int_t chipn, const Long_t evn) const;
371588bb 45 TArrayF* GetCM() const { return fCm; }
46 Short_t* GetCMFerom(const Int_t chipn) const { return chipn < fgkChipsPerModule ? fCmFerom[chipn].GetArray() : NULL; }
47 Short_t GetCMFerom(const Int_t chipn, const Long_t evn) const;
48 TArrayS* GetCMFerom() const { return fCmFerom; }
c4d90345 49 Int_t GetNumberOfChips() const { return fNumberOfChips; }
f67db810 50 AliITSChannelDaSSD* GetStrip(const Int_t stripnumber) const
51 { return (fStrips) ? fStrips[stripnumber] : NULL; }
2e2c6def 52 AliITSNoiseSSD* GetCalibrationNoise() const;
53 AliITSPedestalSSD* GetCalibrationPedestal() const;
54 AliITSBadChannelsSSD* GetCalibrationBadChannels() const;
f67db810 55 Bool_t SetEventsNumber(const Long_t eventsnumber);
c4d90345 56 Bool_t SetNumberOfStrips(const Int_t numberofstrips);
57 Bool_t SetNumberOfChips(const Int_t nchips);
58 Bool_t SetModuleIdData (const UChar_t ddlID, const UChar_t ad, const UChar_t adc, const Short_t moduleID);
f67db810 59 void SetModuleFEEId (const UChar_t ddlID, const UChar_t ad, const UChar_t adc);
60 void SetModuleRorcId (const Int_t equipid, const Int_t equiptype);
c4d90345 61 void SetModuleId (const Short_t moduleID) { fModuleId = moduleID; }
f67db810 62 void SetStrip(AliITSChannelDaSSD* strip, const Int_t strID) { if ((fStrips) && (strID <= fNumberOfStrips)) fStrips[strID] = strip; }
c4d90345 63 void SetCM (Float_t* cm, const Int_t chipn) { if (chipn < fNumberOfChips) fCm[chipn].Set(fCm[chipn].GetSize(), cm); }
64 Bool_t SetCM (const Float_t cm, const Int_t chipn, const Int_t evn);
a69c8ba0 65 void DeleteCM () {if (fCm) { delete [] fCm; fNumberOfChips = 0; fCm = NULL; } }
f67db810 66 void DeleteSignal() {if (fStrips) for (Int_t i = 0; i < fNumberOfStrips; i++)
67 if (fStrips[i]) fStrips[i]->DeleteSignal(); fEventsNumber = 0; }
371588bb 68 void SetCMFerom (Short_t* cm, const Int_t chipn) { if (chipn < fgkChipsPerModule) fCmFerom[chipn].Set(fCmFerom[chipn].GetSize(), cm); }
69 Bool_t SetCMFerom (const Short_t cm, const Int_t chipn, const Int_t evn);
70 Bool_t SetCMFeromEventsNumber(const Long_t eventsnumber);
71 void DeleteCMFerom () {if (fCmFerom) { delete [] fCmFerom; fCmFerom = NULL; } }
72
f67db810 73 static Int_t GetStripsPerModuleConst() { return fgkStripsPerModule; }
74 static Int_t GetPNStripsPerModule() { return fgkPNStripsPerModule;}
75 static Int_t GetStripsPerChip() { return fgkStripsPerChip; }
c4d90345 76 static Int_t GetChipsPerModuleConst() { return fgkChipsPerModule; }
f67db810 77
78 protected :
c4d90345 79 static const Int_t fgkStripsPerModule; // Number of strips per SSD module
80 static const Int_t fgkPNStripsPerModule; // Number of N/P strips per SSD module
81 static const Int_t fgkStripsPerChip; // Number of strips per chip HAL25
82 static const UChar_t fgkMaxAdNumber; // MAx SSD FEROM AD number
83 static const UChar_t fgkMaxAdcNumber; // MAx SSD FEROM ADC number
84 static const Int_t fgkChipsPerModule; // Number of HAL25 chips per SSD module
f67db810 85
86 Int_t fEquipId; // required to access to rorc
223dda26 87 Int_t fEquipType; // fEquipType, required to access to rorc
f67db810 88 UChar_t fDdlId; // index of DDL, ITS SSD: 33-48
89 UChar_t fAd; // index of AD module 0-9
90 UChar_t fAdc; // index of ADC module 0-5, 8-13
2e2c6def 91 Short_t fModuleId; // Module number 500-2197
c4d90345 92
93 Int_t fNumberOfStrips; // Number of AliITSChannelDaSSD* allocated
94 AliITSChannelDaSSD **fStrips; //[fNumberOfStrips] Array of *AliITSChannelDaSSD
f67db810 95
c4d90345 96 Int_t fNumberOfChips; // Number of TArrayF objects allocated for CM
97 TArrayF *fCm; //[fNumberOfChips] CM
371588bb 98 TArrayS *fCmFerom; // CM calculated in FEROM
f67db810 99
c4d90345 100 Long_t fEventsNumber; // number of events for fsignal memory allocation
f67db810 101
102 private:
103 Bool_t ForbiddenAdcNumber (const UChar_t adcn) const { return ((adcn == 6) || (adcn == 7)); }
104
371588bb 105 ClassDef(AliITSModuleDaSSD, 3)
f67db810 106
107};
108
109#endif