else mddli = 0;
if (!module->SetModuleIdData (ddlID, ad, adc, mddli)) return 0;
module->SetModuleRorcId (equipid, equiptype);
- module->SetCMFeromEventsNumber(fNumberOfEvents);
modpos = fModIndRead + modind;
modind += 1;
fModules[modpos] = module;
fModules[modpos]->SetStrip(strip, stripID);
}
strip->SetSignal(eventind, signal);
- } else fModules[modpos]->SetCMFerom(signal, (stripID - AliITSModuleDaSSD::GetStripsPerModuleConst()), eventind);
+ } else {
+ if (!(fModules[modpos]->GetCMFerom())) {
+ fModules[modpos]->AllocateCMFeromArray();
+ fModules[modpos]->SetCMFeromEventsNumber(fNumberOfEvents);
+ }
+ fModules[modpos]->SetCMFerom(signal, (stripID - AliITSModuleDaSSD::GetStripsPerModuleConst()), eventind);
+ }
}
if (++eventind > fNumberOfEvents) break;
}
Short_t *signal, *cmferom;
if (!module) return kFALSE;
+ if (!module->GetCMFerom()) return kTRUE;
for (Int_t chipind = 0; chipind < AliITSModuleDaSSD::GetChipsPerModuleConst(); chipind++) {
if (!(cmferom = module->GetCMFerom(chipind))) {
AliWarning(Form("AliITSHandleDaSSD: There is no Ferom CM values for chip %i, module %i!", chipind, module->GetModuleId()));
}
if ((n = AliITSModuleDaSSD::GetStripsPerChip() - ovstr)) cmsum /= (Float_t)(n);
else cmsum = 0.0L;
- // if (!(module->SetCM(cmsum, chipind, ev)));
+ if (!(module->SetCM(cmsum, chipind, ev)))
+ AliError(Form("AliITSHandleDaSSD: Error, module->SetCM(...) returned kFALSE module:chip:event : [%i]:[%i]:[%i]\n",
+ module->GetModuleId(), chipind, ev));
}
}
return kTRUE;
//______________________________________________________________________________
Bool_t AliITSHandleDaSSD::PrintModCalibrationData(const UChar_t ddlID, const UChar_t ad, const UChar_t adc, const Char_t *fname) const
{
-// Print Module calibration data whether in file on in cout
+// Print Module calibration data whether in file or in cout
AliITSChannelDaSSD *strip;
ofstream datafile;
ostream *outputfile;
}
return (modoff + modnd);
}
+
/// This class provides storage container ITS SSD module callibration data
/// used by DA.
///
-/// Date: 18/07/2008
+/// Date: 09/07/2009
///////////////////////////////////////////////////////////////////////////////
#include "AliITSNoiseSSD.h"
fNumberOfStrips = 0;
fStrips = NULL;
}
- fCmFerom = new (nothrow) TArrayS [fgkChipsPerModule];
- if (!fCmFerom) {
- AliError(Form("AliITSModuleDaSSD: Error allocating memory for %i TArrayS objects!", fgkChipsPerModule));
- fCmFerom = NULL;
- }
}
fNumberOfStrips = 0;
fStrips = NULL;
}
- fCmFerom = new (nothrow) TArrayS [fgkChipsPerModule];
- if (fCmFerom) {
- for (Int_t i = 0; i < fgkChipsPerModule; i++) {
- fCmFerom[i].Set(eventsnumber);
- fCmFerom[i].Reset(0);
- }
- }
- else {
- AliError(Form("AliITSModuleDaSSD: Error allocating memory for %i TArrayS objects!", fgkChipsPerModule));
- fCmFerom = NULL;
- }
}
fCm = NULL;
}
}
- if (fCmFerom) delete [] fCmFerom;
+ if (fCmFerom) { delete [] fCmFerom; fCmFerom = NULL; }
if (module.fCmFerom) {
fCmFerom = new (nothrow) TArrayS [module.fNumberOfChips];
if (fCmFerom) {
return kFALSE;
}
}
- }
- if (fCmFerom) {
- for (Int_t ie = 0; ie < fgkChipsPerModule; ie++) {
- fCmFerom[ie].Set(eventsnumber);
- fCmFerom[ie].Reset(0);
- }
}
- else AliError("AliITSModuleDaSSD: No memory was allocated for fCmFerom!");
fEventsNumber = eventsnumber;
return kTRUE;
}
}
+//______________________________________________________________________________
+Bool_t AliITSModuleDaSSD::AllocateCMFeromArray(void)
+{
+// Allocates memory for the channels which contains CM calculated in Ferom
+ if (!fCmFerom) {
+ fCmFerom = new (nothrow) TArrayS [fgkChipsPerModule];
+ if (!fCmFerom) {
+ AliError(Form("AliITSModuleDaSSD: Error allocating memory for %i TArrayS objects!", fgkChipsPerModule));
+ fCmFerom = NULL;
+ return kFALSE;
+ }
+ }
+ return kTRUE;
+}
+
//______________________________________________________________________________
Bool_t AliITSModuleDaSSD::SetCMFeromEventsNumber(const Long_t eventsnumber)
}
+void AliITSModuleDaSSD::SetCMFerom (Short_t* cm, const Int_t chipn)
+// Set value of FeromCM for a given chip
+{
+ if (!fCmFerom)
+ if (!AllocateCMFeromArray()) return;
+ if (chipn < fgkChipsPerModule) fCmFerom[chipn].Set(fCmFerom[chipn].GetSize(), cm);
+}
+
//______________________________________________________________________________
Short_t AliITSModuleDaSSD::GetCMFerom(const Int_t chipn, const Long_t evn) const
}
return bcflags;
}
+
Float_t* GetCM(const Int_t chipn) const { return chipn < fNumberOfChips ? fCm[chipn].GetArray() : NULL; }
Float_t GetCM(const Int_t chipn, const Long_t evn) const;
TArrayF* GetCM() const { return fCm; }
- Short_t* GetCMFerom(const Int_t chipn) const { return chipn < fgkChipsPerModule ? fCmFerom[chipn].GetArray() : NULL; }
+ Short_t* GetCMFerom(const Int_t chipn) const { return (fCmFerom && (chipn < fgkChipsPerModule)) ? fCmFerom[chipn].GetArray() : NULL; }
Short_t GetCMFerom(const Int_t chipn, const Long_t evn) const;
TArrayS* GetCMFerom() const { return fCmFerom; }
Int_t GetNumberOfChips() const { return fNumberOfChips; }
void DeleteCM () {if (fCm) { delete [] fCm; fNumberOfChips = 0; fCm = NULL; } }
void DeleteSignal() {if (fStrips) for (Int_t i = 0; i < fNumberOfStrips; i++)
if (fStrips[i]) fStrips[i]->DeleteSignal(); fEventsNumber = 0; }
- void SetCMFerom (Short_t* cm, const Int_t chipn) { if (chipn < fgkChipsPerModule) fCmFerom[chipn].Set(fCmFerom[chipn].GetSize(), cm); }
+ Bool_t AllocateCMFeromArray(void);
+ void SetCMFerom (Short_t* cm, const Int_t chipn);
Bool_t SetCMFerom (const Short_t cm, const Int_t chipn, const Int_t evn);
Bool_t SetCMFeromEventsNumber(const Long_t eventsnumber);
void DeleteCMFerom () {if (fCmFerom) { delete [] fCmFerom; fCmFerom = NULL; } }
private:
Bool_t ForbiddenAdcNumber (const UChar_t adcn) const { return ((adcn == 6) || (adcn == 7)); }
- ClassDef(AliITSModuleDaSSD, 4)
+ ClassDef(AliITSModuleDaSSD, 5)
};
#endif
+
{
// Dowload configuration parameters from configuration file or database
const int nkwords = 12;
- char *keywords[nkwords] = {"ZsDefault", "OffsetDefault", "ZsFactor", "PedestalThresholdFactor", "CmThresholdFactor",
+ char const *keywords[nkwords] = {"ZsDefault", "OffsetDefault", "ZsFactor", "PedestalThresholdFactor", "CmThresholdFactor",
"NModulesToProcess", "DDLMapFile", "BadChannelsFile", "ZSMinValue", "MergeBCFlag",
"CheckChipsOff", "OffLadder"};
Int_t tmpint, laddern;
if (tmparr) delete [] tmparr;
return kTRUE;
}
+