//
// Modified by D. Elia, G.E. Bruno, H. Tydesjo
// March-April 2006
-// Last mod: H. Tydesjo Oct 2007
+// Last mod: H. Tydesjo Aug 2008
// September 2007: CouplingRowDefault = 0.055 (was 0.047)
//
///////////////////////////////////////////////////////////////////////////
const Double_t AliITSCalibrationSPD::fgkCouplRowDefault = 0.055;
const Double_t AliITSCalibrationSPD::fgkBiasVoltageDefault = 18.182;
-ClassImp(AliITSCalibrationSPD)
+ClassImp(AliITSCalibrationSPD)
//______________________________________________________________________
AliITSCalibrationSPD::AliITSCalibrationSPD():
SetBiasVoltage(fgkBiasVoltageDefault);
SetNoiseParam(0.,0.);
SetDataType("simulated");
+ ClearBad();
+}
+//____________________________________________________________________________
+void AliITSCalibrationSPD::ClearBad() {
+ // clear all bad pixels (single+chips)
+ fBadChannels.Reset();
+ fNrBad=0;
+ for (UInt_t chip=0; chip<5; chip++) {
+ fBadChip[chip]=kFALSE;
+ }
}
//____________________________________________________________________________
void AliITSCalibrationSPD::AddBad(UInt_t col, UInt_t row) {
- //
- // add bad pixel
- //
+ // add single bad pixel
fBadChannels.Set(fNrBad*2+2);
fBadChannels.AddAt(col,fNrBad*2);
fBadChannels.AddAt(row,fNrBad*2+1);
fNrBad++;
}
//____________________________________________________________________________
-Int_t AliITSCalibrationSPD::GetBadColAt(UInt_t index) {
- //
+void AliITSCalibrationSPD::SetChipBad(UInt_t chip) {
+ // set full chip bad
+ if (chip>=5) {AliError("Wrong chip number");}
+ fBadChip[chip]=kTRUE;
+}
+//____________________________________________________________________________
+void AliITSCalibrationSPD::UnSetChipBad(UInt_t chip) {
+ // unset full chip bad
+ if (chip>=5) {AliError("Wrong chip number");}
+ fBadChip[chip]=kFALSE;
+}
+//____________________________________________________________________________
+Int_t AliITSCalibrationSPD::GetBadColAt(UInt_t index) const {
// Get column of index-th bad pixel
- //
- if (index<fNrBad) {
+ if ((Int_t)index<GetNrBadSingle()) {
return fBadChannels.At(index*2);
}
+ else {
+ Int_t badChipIndex=(index-GetNrBadSingle())/(32*256);
+ Int_t badChipsFound =0;
+ for (UInt_t chip=0; chip<5; chip++) {
+ if (fBadChip[chip]) badChipsFound++;
+ if (badChipIndex==badChipsFound-1) {
+ Int_t badPixelIndex=(index-GetNrBadSingle())%(32*256);
+ return chip*32 + badPixelIndex/256;
+ }
+ }
+ }
+ AliError(Form("Index %d is out of bounds - returning -1",index));
return -1;
}
//____________________________________________________________________________
-Int_t AliITSCalibrationSPD::GetBadRowAt(UInt_t index) {
- //
+Int_t AliITSCalibrationSPD::GetBadRowAt(UInt_t index) const {
// Get row of index-th bad pixel
- //
- if (index<fNrBad) {
+ if ((Int_t)index<GetNrBadSingle()) {
return fBadChannels.At(index*2+1);
}
- return -1;
-}
-//____________________________________________________________________________
-Bool_t AliITSCalibrationSPD::IsPixelBad(Int_t col, Int_t row) const {
- //
- // Check if pixel (col,row) is bad
- //
- for (UInt_t i=0; i<fNrBad; i++) {
- if (fBadChannels.At(i*2)==col && fBadChannels.At(i*2+1)==row) {
- return true;
+ else {
+ Int_t badChipIndex=(index-GetNrBadSingle())/(32*256);
+ Int_t badChipsFound =0;
+ for (UInt_t chip=0; chip<5; chip++) {
+ if (fBadChip[chip]) badChipsFound++;
+ if (badChipIndex==badChipsFound-1) {
+ Int_t badPixelIndex=(index-GetNrBadSingle())%(32*256);
+ return badPixelIndex%256;
+ }
}
}
- return false;
+ AliError(Form("Index %d is out of bounds - returning -1",index));
+ return -1;
}
-
//____________________________________________________________________________
-void AliITSCalibrationSPD::GetBadPixel(Int_t i, Int_t &row, Int_t &col) const {
- //
- // i: is the i-th bad pixel in fBadChannels
+void AliITSCalibrationSPD::GetBadPixel(Int_t index, Int_t &row, Int_t &col) const {
+ // i: is the i-th bad pixel in single bad pixel list
// row: is the corresponding row (-1 if i is out of range)
// col: is the corresponding column (-1 if i is out of range)
row = -1;
col = -1;
- if(i<0 || i>=GetNrBad()){
- AliWarning(Form("Index %d is out of bounds - nothing done",i));
+ if(index>=0 && index<GetNrBadSingle()){
+ col = GetBadColAt(index);
+ row = GetBadRowAt(index);
return;
}
- col = fBadChannels.At(i*2);
- row = fBadChannels.At(i*2+1);
+ else {
+ if (index>=0) {
+ Int_t badChipIndex=(index-GetNrBadSingle())/(32*256);
+ Int_t badChipsFound =0;
+ for (UInt_t chip=0; chip<5; chip++) {
+ if (fBadChip[chip]) badChipsFound++;
+ if (badChipIndex==badChipsFound-1) {
+ Int_t badPixelIndex=(index-GetNrBadSingle())%(32*256);
+ col = chip*32 + badPixelIndex/256;
+ row = badPixelIndex%256;
+ return;
+ }
+ }
+ }
+ }
+ AliError(Form("Index %d is out of bounds - nothing done",index));
}
-
//___________________________________________________________________________
-Int_t AliITSCalibrationSPD::GetNrBadInColumn(Int_t col) const {
- //
- // Count n. of bad in a given column: col. range [0,159]
- //
- if(col<0 || col>159) {AliWarning("GetNrBadInColumn: wrong column number"); return -1;}
- Int_t bad=0;
- for (UInt_t i=0; i<fNrBad; i++) if (fBadChannels.At(i*2)==col) bad++;
- return bad;
+Int_t AliITSCalibrationSPD::GetNrBad() const {
+ // Total number of bad pixels (including bad chips) in a given module
+ Int_t bad=0;
+ // single pixels:
+ bad+=fNrBad;
+ // whole chips:
+ for (UInt_t chip=0; chip<5; chip++) {
+ bad+=fBadChip[chip]*32*256;
+ }
+ return bad;
}
//___________________________________________________________________________
Int_t AliITSCalibrationSPD::GetNrBadInChip(Int_t chip) const {
- //
- // Count n. of bad in a given chip: chip range [0,4]
- //
- if(chip<0 || chip>4) {AliWarning("GetNrBadInChip: wrong chip number"); return -1;}
- Int_t bad=0;
- for (Int_t col=32*chip; col<32*(chip+1); col++) bad+=GetNrBadInColumn(col);
- return bad;
+ // Total number of bad pixels (including bad chips) in a given chip: chip range [0,4]
+ if(chip<0 || chip>4) {AliError("Wrong chip number"); return -1;}
+ if (fBadChip[chip]) return 32*256;
+ else {
+ Int_t bad=0;
+ for (UInt_t i=0; i<fNrBad; i++) {
+ Int_t col = GetBadColAt(i);
+ if (col!=-1) {
+ if (GetChipIndexFromCol(col)==chip) bad++;
+ }
+ }
+ return bad;
+ }
+}
+//___________________________________________________________________________
+Int_t AliITSCalibrationSPD::GetNrBadInColumn(Int_t col) const {
+ // Total number of bad pixels (including bad chips) in a given column: col. range [0,159]
+ if(col<0 || col>159) {AliError("Wrong column number"); return -1;}
+ if (fBadChip[GetChipIndexFromCol(col)]) return 256;
+ else {
+ Int_t bad=0;
+ for (UInt_t i=0; i<fNrBad; i++) {
+ if (GetBadColAt(i)==col) bad++;
+ }
+ return bad;
+ }
+}
+//______________________________________________________________________
+Bool_t AliITSCalibrationSPD::IsBad() const {
+ // Are all chips of this module bad?
+ for (UInt_t chip=0; chip<5; chip++) {
+ if (!fBadChip[chip]) return kFALSE;
+ }
+ return kTRUE;
+}
+//______________________________________________________________________
+Bool_t AliITSCalibrationSPD::IsChipBad(Int_t chip) const {
+ // Is the full chip bad?
+ return (GetNrBadInChip(chip)==32*256);
+}
+//______________________________________________________________________
+Bool_t AliITSCalibrationSPD::IsColumnBad(Int_t col) const {
+ // Is the full column bad?
+ return (GetNrBadInColumn(col)==256);
+}
+//____________________________________________________________________________
+Bool_t AliITSCalibrationSPD::IsPixelBad(Int_t col, Int_t row) const {
+ // Is this pixel bad?
+ if(col<0 || col>159) {AliError("Wrong column number"); return kFALSE;}
+ Int_t chip = GetChipIndexFromCol(col);
+ if (fBadChip[chip]) return kTRUE;
+ for (UInt_t i=0; i<fNrBad; i++) {
+ if (GetBadColAt(i)==col && GetBadRowAt(i)==row) {
+ return kTRUE;
+ }
+ }
+ return kFALSE;
+}
+//______________________________________________________________________
+Int_t AliITSCalibrationSPD::GetChipIndexFromCol(UInt_t col) const {
+ // returns chip index for specific column
+ if(col>=160) {AliWarning("Wrong column number"); return -1;}
+ return col/32;
+}
+//______________________________________________________________________
+void AliITSCalibrationSPD::SetNrBad(UInt_t /*nr*/) {
+ // should not be used anymore !!!
+ AliError("This method should not be used anymore. Use SetNrBadSingle instead!!!");
}
//______________________________________________________________________
void AliITSCalibrationSPD::Streamer(TBuffer &R__b) {
R__b >> fCouplRow;
R__b >> fBiasVoltage;
R__b >> fNrBad;
- if (R__v > 5) {
+ if (R__v >= 7) {
fBadChannels.Streamer(R__b);
+ R__b.ReadStaticArray((bool*)fBadChip);
}
else {
- TArrayI fBadChannelsV1;
- fBadChannelsV1.Streamer(R__b);
- fBadChannels.Set(fNrBad*2);
- for (UInt_t i=0; i<fNrBad*2; i++) {
- fBadChannels[i] = fBadChannelsV1[i];
+ if (R__v == 6) {
+ fBadChannels.Streamer(R__b);
+ }
+ else {
+ TArrayI fBadChannelsV1;
+ fBadChannelsV1.Streamer(R__b);
+ fBadChannels.Set(fNrBad*2);
+ for (UInt_t i=0; i<fNrBad*2; i++) {
+ fBadChannels[i] = fBadChannelsV1[i];
+ }
+ }
+ for (UInt_t i=0; i<5; i++) {
+ fBadChip[i]=kFALSE;
}
}
R__b.CheckByteCount(R__s, R__c, AliITSCalibrationSPD::IsA());
R__b << fBiasVoltage;
R__b << fNrBad;
fBadChannels.Streamer(R__b);
+ R__b.WriteArray(fBadChip, 5);
R__b.SetByteCount(R__c, kTRUE);
}
}
AliITSCalibrationSPD(); // default constructor
virtual ~AliITSCalibrationSPD() {;} // destructror
+ virtual void ClearBad();
+
+ virtual Int_t GetNrBad() const;
+ virtual Int_t GetNrBadInChip(Int_t chip) const;
+ virtual Int_t GetNrBadInColumn(Int_t col) const;
+
+ virtual Int_t GetBadColAt(UInt_t index) const;
+ virtual Int_t GetBadRowAt(UInt_t index) const;
+ virtual void GetBadPixel(Int_t index, Int_t &row, Int_t &col) const;
+
+ virtual Int_t GetNrBadSingle() const {return fNrBad;}
+ virtual void SetNrBadSingle(UInt_t nr) {fNrBad=nr;} // used to be called SetNrBad, but misleading
+ virtual void SetBadList(TArrayS badlist) {fBadChannels=badlist;}
+ virtual void SetNrBad(UInt_t /*nr*/); // Use SetNrBadSingle!!!
+
+ virtual Bool_t IsBad() const;
+ virtual Bool_t IsChipBad(Int_t chip) const;
+ virtual Bool_t IsColumnBad(Int_t col) const;
+ virtual Bool_t IsPixelBad(Int_t col, Int_t row) const;
+
+ virtual void SetChipBad(UInt_t chip);
+ virtual void UnSetChipBad(UInt_t chip);
+
+ virtual void AddBad(UInt_t col, UInt_t row);
+
+ virtual Int_t GetChipIndexFromCol(UInt_t col) const;
+ // virtual Int_t GetChipFromChipIndex(UInt_t index) const;
+
+
// Set Threshold and noise + threshold fluctuations parameter values
virtual void SetThresholds(Double_t thresh, Double_t sigma)
{fThresh=thresh; fSigma=sigma;}
virtual void SetSigmaDiffusionAsymmetry(Double_t ecc) {((AliITSresponseSPD*)fResponse)->SetSigmaDiffusionAsymmetry(ecc);}
virtual void GetSigmaDiffusionAsymmetry(Double_t &ecc) const {((AliITSresponseSPD*)fResponse)->GetSigmaDiffusionAsymmetry(ecc);}
- void AddBad(UInt_t col, UInt_t row);
- Int_t GetNrBad() const {return fNrBad;}
- Int_t GetNrBadInChip(Int_t chip) const ;
- Int_t GetNrBadInColumn(Int_t col) const ;
- Int_t GetBadColAt(UInt_t index); //returns -1 if out of bounds
- Int_t GetBadRowAt(UInt_t index); //returns -1 if out of bounds
- void ClearBad() {fBadChannels.Reset(); fNrBad=0;}
- Bool_t IsPixelBad(Int_t col, Int_t row) const ;
- void GetBadPixel(Int_t i, Int_t &row, Int_t &col) const;
-
- void SetBadList(TArrayS badlist) {fBadChannels=badlist;}
- void SetNrBad(UInt_t nr) {fNrBad=nr;}
- virtual Bool_t IsBad() const {return (GetNrBad()==256*160);};
- virtual Bool_t IsChipBad(Int_t chip) const {return (GetNrBadInChip(chip)==256*32);};
- Bool_t IsColumnBad(Int_t col) const {return (GetNrBadInColumn(col)==256);};
+
protected:
// static const Double_t fgkDiffCoeffDefault; //default for fDiffCoeff
Double_t fCouplCol; // Coupling parameter along the cols
Double_t fCouplRow; // Coupling parameter along the rows
Double_t fBiasVoltage; // Bias Voltage for the SPD (used to compute DistanceOverVoltage)
- UInt_t fNrBad; // Nr of bad pixels
+ UInt_t fNrBad; // Nr of SINGLE bad pixels
TArrayS fBadChannels; // Array with bad channels info (col0,row0,col1...rowN) N = fNrBad
+ Bool_t fBadChip[5]; // Is chip completely dead?
- ClassDef(AliITSCalibrationSPD,6) // SPD response
+ ClassDef(AliITSCalibrationSPD,7) // SPD response
};
#endif
fEqNr(0),
fNrBad(0),
fBadChannels(0),
-fActiveEq(kTRUE)
+fActiveEq(kTRUE),
+fDeadEq(kFALSE)
{
ActivateALL();
+ UnSetDeadALL();
}
//____________________________________________________________________________
Int_t AliITSOnlineCalibrationSPD::GetKeyAt(UInt_t index) const {
}
return fActiveChip[hs*10+chip];
}
-
+//____________________________________________________________________________
+void AliITSOnlineCalibrationSPD::UnSetDeadALL() {
+ // activate eq, all hs, all chips
+ SetDeadEq(kFALSE);
+ for (UInt_t hs=0; hs<6; hs++) {
+ SetDeadHS(hs,kFALSE);
+ for (UInt_t chip=0; chip<10; chip++) {
+ SetDeadChip(hs,chip,kFALSE);
+ }
+ }
+}
+//____________________________________________________________________________
+void AliITSOnlineCalibrationSPD::SetDeadEq(Bool_t setval) {
+ // set this eq dead
+ fDeadEq = setval;
+}
+//____________________________________________________________________________
+void AliITSOnlineCalibrationSPD::SetDeadHS(UInt_t hs, Bool_t setval) {
+ // set dead hs on this eq
+ if (hs>=6) {
+ Error("AliITSOnlineCalibrationSPD::SetDeadHS", "hs (%d) out of bounds.",hs);
+ return;
+ }
+ fDeadHS[hs] = setval;
+}
+//____________________________________________________________________________
+void AliITSOnlineCalibrationSPD::SetDeadChip(UInt_t hs, UInt_t chip, Bool_t setval) {
+ // set dead chip on this eq
+ if (hs>=6 || chip>=10) {
+ Error("AliITSOnlineCalibrationSPD::SetDeadChip", "hs,chip (%d,%d) out of bounds.",hs,chip);
+ return;
+ }
+ fDeadChip[hs*10+chip] = setval;
+}
+//____________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPD::IsDeadEq() const {
+ // is this eq dead?
+ return fDeadEq;
+}
+//____________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPD::IsDeadHS(UInt_t hs) const {
+ // is this hs dead?
+ if (hs>=6) {
+ Error("AliITSOnlineCalibrationSPD::IsDeadHS", "hs (%d) out of bounds.",hs);
+ return kFALSE;
+ }
+ return fDeadHS[hs];
+}
+//____________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPD::IsDeadChip(UInt_t hs, UInt_t chip) const {
+ // is this chip dead?
+ if (hs>=6 || chip>=10) {
+ Error("AliITSOnlineCalibrationSPD::IsDeadChip", "hs,chip (%d,%d) out of bounds.",hs,chip);
+ return kFALSE;
+ }
+ return fDeadChip[hs*10+chip];
+}
void ClearBad() {fBadChannels.Reset(); fNrBad=0;}
- Bool_t IsActiveEq() const;
- Bool_t IsActiveHS(UInt_t hs) const;
- Bool_t IsActiveChip(UInt_t hs, UInt_t chip) const;
-
void ActivateALL();
void ActivateEq(Bool_t setval = kTRUE);
void ActivateHS(UInt_t hs, Bool_t setval = kTRUE);
void ActivateChip(UInt_t hs, UInt_t chip, Bool_t setval = kTRUE);
+ Bool_t IsActiveEq() const;
+ Bool_t IsActiveHS(UInt_t hs) const;
+ Bool_t IsActiveChip(UInt_t hs, UInt_t chip) const;
+
+ void UnSetDeadALL();
+ void SetDeadEq(Bool_t setval = kTRUE);
+ void SetDeadHS(UInt_t hs, Bool_t setval = kTRUE);
+ void SetDeadChip(UInt_t hs, UInt_t chip, Bool_t setval = kTRUE);
+
+ Bool_t IsDeadEq() const;
+ Bool_t IsDeadHS(UInt_t hs) const;
+ Bool_t IsDeadChip(UInt_t hs, UInt_t chip) const;
+
private:
- UInt_t fEqNr; // eq nr
- UInt_t fNrBad; // nr of bad pixels
- TArrayI fBadChannels; // array of keys for the bad
- Bool_t fActiveEq; // active bit for each equipment
- Bool_t fActiveHS[6]; // active bit for each half-stave
- Bool_t fActiveChip[60]; // active bit for each chip
-
- ClassDef(AliITSOnlineCalibrationSPD,2)
+ UInt_t fEqNr; // eq nr
+ UInt_t fNrBad; // nr of bad (single) pixels
+ TArrayI fBadChannels; // array of keys for the bad (single) pixels
+ Bool_t fActiveEq; // active bit for each equipment
+ Bool_t fActiveHS[6]; // active bit for each half-stave
+ Bool_t fActiveChip[60]; // active bit for each chip
+ Bool_t fDeadEq; // dead bit for each equipment
+ Bool_t fDeadHS[6]; // dead bit for each half-stave
+ Bool_t fDeadChip[60]; // dead bit for each chip
+
+ ClassDef(AliITSOnlineCalibrationSPD,3)
};
#endif
fNoisyPixelMap[gloChip] = new AliITSIntMap();
}
ActivateALL();
+ UnSetDeadALL();
}
//____________________________________________________________________________________________
AliITSOnlineCalibrationSPDhandler::AliITSOnlineCalibrationSPDhandler(const AliITSOnlineCalibrationSPDhandler& handle):
//____________________________________________________________________________________________
void AliITSOnlineCalibrationSPDhandler::ResetDead() {
// reset the dead pixel map and inactive eq,hs,chip
+ UnSetDeadALL();
for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
fNrDead[gloChip]=0;
fDeadPixelMap[gloChip]->Clear();
//____________________________________________________________________________________________
void AliITSOnlineCalibrationSPDhandler::ResetDeadForChip(UInt_t eq, UInt_t hs, UInt_t chip) {
// clear the dead pixels for this chip
+ SetDeadChip(eq,hs,chip,kFALSE);
UInt_t gloChip = GetGloChip(eq,hs,chip);
for (UInt_t col=0; col<32; col++) {
for (UInt_t row=0; row<256; row++) {
UInt_t row = GetRowFromKey(key);
SetDeadPixel(eq,hs,chip,col,row);
}
+ UInt_t eq = calib->GetEqNr();
+ if (calib->IsDeadEq()) SetDeadEq(eq);
+ else SetDeadEq(eq,kFALSE);
+ for (UInt_t hs=0; hs<6; hs++) {
+ if (calib->IsDeadHS(hs)) SetDeadHS(eq,hs);
+ else SetDeadHS(eq,hs,kFALSE);
+ for (UInt_t chip=0; chip<10; chip++) {
+ if (calib->IsDeadChip(hs,chip)) SetDeadChip(eq,hs,chip);
+ else SetDeadChip(eq,hs,chip,kFALSE);
+ }
+ }
if (inactive) {
UInt_t eq = calib->GetEqNr();
if (calib->IsActiveEq()) ActivateEq(eq);
calib->SetEqNr(eq);
calib->SetBadList(GetDeadArrayOnline(eq));
calib->SetNrBad(GetNrDeadEq(eq));
+ if (IsDeadEq(eq)) calib->SetDeadEq();
+ else calib->SetDeadEq(kFALSE);
+ for (UInt_t hs=0; hs<6; hs++) {
+ if (IsDeadHS(eq,hs)) calib->SetDeadHS(hs);
+ else calib->SetDeadHS(hs,kFALSE);
+ for (UInt_t chip=0; chip<10; chip++) {
+ if (IsDeadChip(eq,hs,chip)) calib->SetDeadChip(hs,chip);
+ else calib->SetDeadChip(hs,chip,kFALSE);
+ }
+ }
if (inactive) {
if (IsActiveEq(eq)) calib->ActivateEq();
else calib->ActivateEq(kFALSE);
}
AliITSCalibrationSPD* calibSPD;
calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
- UInt_t nrDead = calibSPD->GetNrBad();
+
+ UInt_t nrDead = calibSPD->GetNrBadSingle();
if (nrDead>0) {
if (!treeSerial) RecursiveInsertDead(calibSPD,module,0,nrDead-1);
else {
}
}
}
+ for (UInt_t chipIndex=0; chipIndex<5; chipIndex++) {
+ UInt_t eq,hs,chip,col,row;
+ AliITSRawStreamSPD::OfflineToOnline(module, chipIndex*32, 0, eq, hs, chip, col, row);
+ if (calibSPD->IsChipBad(chipIndex)) {
+ SetDeadChip(eq,hs,chip);
+ }
+ else {
+ SetDeadChip(eq,hs,chip,kFALSE);
+ }
+ }
+
spdEntry->SetOwner(kTRUE);
spdEntry->Clear();
return kTRUE;
}
AliITSCalibrationSPD* calibSPD;
calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
- UInt_t nrNoisy = calibSPD->GetNrBad();
+ UInt_t nrNoisy = calibSPD->GetNrBadSingle();
if (nrNoisy>0) {
if (!treeSerial) RecursiveInsertNoisy(calibSPD,module,0,nrNoisy-1);
else {
}
AliITSCalibrationSPD* calibSPD;
for (UInt_t module=0; module<240; module++) {
- // printf("Reading module %d\n",module);
calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
- UInt_t nrDead = calibSPD->GetNrBad();
+ UInt_t nrDead = calibSPD->GetNrBadSingle();
if (nrDead>0) {
if (!treeSerial) RecursiveInsertDead(calibSPD,module,0,nrDead-1);
else {
}
}
}
+ for (UInt_t chipIndex=0; chipIndex<5; chipIndex++) {
+ UInt_t eq,hs,chip,col,row;
+ AliITSRawStreamSPD::OfflineToOnline(module, chipIndex*32, 0, eq, hs, chip, col, row);
+ if (calibSPD->IsChipBad(chipIndex)) {
+ SetDeadChip(eq,hs,chip);
+ }
+ else {
+ SetDeadChip(eq,hs,chip,kFALSE);
+ }
+ }
}
spdEntry->SetOwner(kTRUE);
spdEntry->Clear();
for (UInt_t module=0; module<240; module++) {
// printf("Reading module %d\n",module);
calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
- UInt_t nrNoisy = calibSPD->GetNrBad();
+ UInt_t nrNoisy = calibSPD->GetNrBadSingle();
if (nrNoisy>0) {
if (!treeSerial) {
- printf("*** mod %d nrnoisy=%d\n",module,nrNoisy);
RecursiveInsertNoisy(calibSPD,module,0,nrNoisy-1);
}
else {
Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromCalibObj(TObjArray* calObj) {
// reads dead pixels from calib object
for (UInt_t module=0; module<240; module++) {
- for (Int_t i=0; i<((AliITSCalibrationSPD*)calObj->At(module))->GetNrBad(); i++) {
- SetDeadPixelM(module,
- ((AliITSCalibrationSPD*)calObj->At(module))->GetBadColAt(i),
- ((AliITSCalibrationSPD*)calObj->At(module))->GetBadRowAt(i));
+ AliITSCalibrationSPD* calibSPD = (AliITSCalibrationSPD*)calObj->At(module);
+ for (Int_t i=0; i<calibSPD->GetNrBadSingle(); i++) {
+ SetDeadPixelM(module,calibSPD->GetBadColAt(i),calibSPD->GetBadRowAt(i));
+ }
+ for (UInt_t chipIndex=0; chipIndex<5; chipIndex++) {
+ UInt_t eq,hs,chip,col,row;
+ AliITSRawStreamSPD::OfflineToOnline(module, chipIndex*32, 0, eq, hs, chip, col, row);
+ if (calibSPD->IsChipBad(chipIndex)) {
+ SetDeadChip(eq,hs,chip);
+ }
+ else {
+ SetDeadChip(eq,hs,chip,kFALSE);
+ }
}
}
return kTRUE;
Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyFromCalibObj(TObjArray* calObj) {
// reads noisy pixels from calib object
for (UInt_t module=0; module<240; module++) {
- for (Int_t i=0; i<((AliITSCalibrationSPD*)calObj->At(module))->GetNrBad(); i++) {
- SetNoisyPixelM(module,
- ((AliITSCalibrationSPD*)calObj->At(module))->GetBadColAt(i),
- ((AliITSCalibrationSPD*)calObj->At(module))->GetBadRowAt(i));
+ AliITSCalibrationSPD* calibSPD = (AliITSCalibrationSPD*)calObj->At(module);
+ for (Int_t i=0; i<calibSPD->GetNrBadSingle(); i++) {
+ SetNoisyPixelM(module,calibSPD->GetBadColAt(i),calibSPD->GetBadRowAt(i));
}
}
return kTRUE;
TObjArray* spdEntry = new TObjArray(240);
spdEntry->SetOwner(kTRUE);
for(UInt_t module=0; module<240; module++){
- AliITSCalibrationSPD* calObj = new AliITSCalibrationSPD();
+ AliITSCalibrationSPD* calibSPD = new AliITSCalibrationSPD();
// *** this is temporarily hard coded here ********************
// (later these parameters will be separated from the cal.obj.)
- calObj->SetThresholds(3000, 250);
- calObj->SetBiasVoltage(18.182);
- calObj->SetNoiseParam(0,0);
- calObj->SetCouplingParam(0.,0.055);
+ calibSPD->SetThresholds(3000, 250);
+ calibSPD->SetBiasVoltage(18.182);
+ calibSPD->SetNoiseParam(0,0);
+ calibSPD->SetCouplingParam(0.,0.055);
// *** remove later...
// ************************************************************
- spdEntry->Add(calObj);
+ spdEntry->Add(calibSPD);
}
for(UInt_t module=0; module<240; module++){
- ((AliITSCalibrationSPD*) spdEntry->At(module)) -> SetNrBad( GetNrSilent(module) );
- ((AliITSCalibrationSPD*) spdEntry->At(module)) -> SetBadList( GetSilentArray(module) );
+ AliITSCalibrationSPD* calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
+ calibSPD->SetNrBadSingle( GetNrDead(module) );
+ calibSPD->SetBadList( GetDeadArray(module) );
+ for (UInt_t chipIndex=0; chipIndex<5; chipIndex++) {
+ UInt_t eq,hs,chip,col,row;
+ AliITSRawStreamSPD::OfflineToOnline(module, chipIndex*32, 0, eq, hs, chip, col, row);
+ if (IsSilentChip(eq,hs,chip)) {
+ calibSPD->SetChipBad(chipIndex);
+ }
+ else {
+ calibSPD->UnSetChipBad(chipIndex);
+ }
+ }
}
AliCDBEntry* cdbEntry = new AliCDBEntry((TObject*)spdEntry,idCalSPD,metaData);
man->Put(cdbEntry);
TObjArray* spdEntry = new TObjArray(240);
spdEntry->SetOwner(kTRUE);
for(UInt_t module=0; module<240; module++){
- AliITSCalibrationSPD* calObj = new AliITSCalibrationSPD();
+ AliITSCalibrationSPD* calibSPD = new AliITSCalibrationSPD();
// *** this is temporarily hard coded here ********************
// (later these parameters will be separated from the cal.obj.)
- calObj->SetThresholds(3000, 250);
- calObj->SetBiasVoltage(18.182);
- calObj->SetNoiseParam(0,0);
- calObj->SetCouplingParam(0.,0.055);
+ calibSPD->SetThresholds(3000, 250);
+ calibSPD->SetBiasVoltage(18.182);
+ calibSPD->SetNoiseParam(0,0);
+ calibSPD->SetCouplingParam(0.,0.055);
// *** remove later...
// ************************************************************
- spdEntry->Add(calObj);
+ spdEntry->Add(calibSPD);
}
for(UInt_t module=0; module<240; module++){
- ((AliITSCalibrationSPD*) spdEntry->At(module)) -> SetNrBad( GetNrNoisy(module) );
- ((AliITSCalibrationSPD*) spdEntry->At(module)) -> SetBadList( GetNoisyArray(module) );
+ AliITSCalibrationSPD* calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
+ calibSPD->SetNrBadSingle( GetNrNoisy(module) );
+ calibSPD->SetBadList( GetNoisyArray(module) );
}
AliCDBEntry* cdbEntry = new AliCDBEntry((TObject*)spdEntry,idCalSPD,metaData);
man->Put(cdbEntry);
//____________________________________________________________________________________________
TArrayS AliITSOnlineCalibrationSPDhandler::GetSilentArray(UInt_t module, Bool_t treeSerial) {
// get a TArrayS of the silent=dead+inactive pixels (format for the AliITSCalibrationSPD object)
+ // NB! with new implementation of AliITSCalibrationSPD this is not needed anymore
TArrayS returnArray;
UInt_t eq = GetEqIdFromOffline(module);
}
//____________________________________________________________________________________________
TArrayS AliITSOnlineCalibrationSPDhandler::GetDeadArray(UInt_t module, Bool_t treeSerial) {
- // get a TArrayS of the dead pixels (format for the AliITSCalibrationSPD object)
+ // get a TArrayS of the single dead pixels (format for the AliITSCalibrationSPD object)
TArrayS returnArray;
UInt_t eq = GetEqIdFromOffline(module);
returnArray.Set(size*2);
UInt_t gloIndex=0;
for (UInt_t ch=0; ch<5; ch++) {
- UInt_t gloChip = GetGloChip(eq,hs,GetChipFromOffline(module,ch*32));
+ UInt_t chip = GetChipFromOffline(module,ch*32);
+ UInt_t gloChip = GetGloChip(eq,hs,chip);
if (treeSerial) fDeadPixelMap[gloChip]->PrepareSerialize(); // for tree ordered values
else fDeadPixelMap[gloChip]->PrepareSerializeOrdered(); // for key ordered values
- for (UInt_t index=0; index<fNrDead[gloChip]; index++) {
- Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(index);
- Int_t colM = GetColMFromKey(key);
- Int_t rowM = GetRowMFromKey(key);
- returnArray.AddAt(colM,gloIndex*2);
- returnArray.AddAt(rowM,gloIndex*2+1);
- gloIndex++;
+ if (!IsSilentChip(eq,hs,chip)) {
+ for (UInt_t index=0; index<fNrDead[gloChip]; index++) {
+ Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(index);
+ Int_t colM = GetColMFromKey(key);
+ Int_t rowM = GetRowMFromKey(key);
+ returnArray.AddAt(colM,gloIndex*2);
+ returnArray.AddAt(rowM,gloIndex*2+1);
+ gloIndex++;
+ }
}
}
return returnArray;
}
//____________________________________________________________________________________________
TArrayS AliITSOnlineCalibrationSPDhandler::GetNoisyArray(UInt_t module, Bool_t treeSerial) {
- // get a TArrayS of the noisy pixels (format for the AliITSCalibrationSPD object)
+ // get a TArrayS of the single noisy pixels (format for the AliITSCalibrationSPD object)
TArrayS returnArray;
UInt_t eq = GetEqIdFromOffline(module);
}
//____________________________________________________________________________________________
TArrayI AliITSOnlineCalibrationSPDhandler::GetDeadArrayOnline(UInt_t eq) {
- // get a TArrayI of the dead pixels (format for the AliITSOnlineCalibrationSPD object)
+ // get a TArrayI of the single dead pixels (format for the AliITSOnlineCalibrationSPD object)
TArrayI returnArray;
// fix size of array
UInt_t size=0;
}
//____________________________________________________________________________________________
TArrayI AliITSOnlineCalibrationSPDhandler::GetNoisyArrayOnline(UInt_t eq) {
- // get a TArrayI of the noisy pixels (format for the AliITSOnlineCalibrationSPD object)
+ // get a TArrayI of the single noisy pixels (format for the AliITSOnlineCalibrationSPD object)
TArrayI returnArray;
// fix size of array
UInt_t size=0;
printf("Eq summary:\n");
printf("-----------\n");
for (UInt_t eq=0; eq<20; eq++) {
- printf("Eq %*d: %*d silent(dead+inactive) , %*d dead , %*d noisy\n",2,eq,5,GetNrSilentEq(eq),5,GetNrDeadEq(eq),5,GetNrNoisyEq(eq));
+ printf("Eq %*d: %*d silent(dead+inactive) , %*d dead , %*d noisy\n",2,eq,6,GetNrSilentEq(eq),6,GetNrDeadEq(eq),6,GetNrNoisyEq(eq));
}
}
//____________________________________________________________________________________________
void AliITSOnlineCalibrationSPDhandler::PrintSilent() const {
// print the inactive and dead pixels to screen
- printf("------------------------------------------------------\n");
- printf("Inactive Equipments: (eq | module1 .. module12)\n");
- printf("------------------------------------------------------\n");
+ printf("-----------------------------------------------------------\n");
+ printf("Inactive or dead Equipments: (eq | module1 .. module12)\n");
+ printf("-----------------------------------------------------------\n");
for (UInt_t eq=0; eq<20; eq++) {
- if (!IsActiveEq(eq)) {
+ if (IsSilentEq(eq)) {
printf("%*d | ",2,eq);
for (UInt_t hs=0; hs<6; hs++) {
for (UInt_t chip=0; chip<10; chip+=5) {
}
}
- printf("------------------------------------------------------\n");
- printf("Inactive Half-staves: (eq,hs | module1,module2)\n");
- printf("------------------------------------------------------\n");
+ printf("-----------------------------------------------------------\n");
+ printf("Inactive or dead Half-staves: (eq,hs | module1,module2)\n");
+ printf("-----------------------------------------------------------\n");
for (UInt_t eq=0; eq<20; eq++) {
- if (IsActiveEq(eq)) {
+ if (!IsSilentEq(eq)) {
for (UInt_t hs=0; hs<6; hs++) {
- if (!IsActiveHS(eq,hs)) {
+ if (IsSilentHS(eq,hs)) {
printf("%*d,%*d | ",2,eq,1,hs);
for (UInt_t chip=0; chip<10; chip+=5) {
UInt_t module = AliITSRawStreamSPD::GetOfflineModuleFromOnline(eq,hs,chip);
}
}
- printf("------------------------------------------------------\n");
- printf("Inactive Chips: (eq,hs,chip | module,colM1-colM2)\n");
- printf("------------------------------------------------------\n");
+ printf("-----------------------------------------------------------\n");
+ printf("Inactive or dead Chips: (eq,hs,chip | module,colM1-colM2)\n");
+ printf("-----------------------------------------------------------\n");
for (UInt_t eq=0; eq<20; eq++) {
- if (IsActiveEq(eq)) {
+ if (!IsSilentEq(eq)) {
for (UInt_t hs=0; hs<6; hs++) {
- if (IsActiveHS(eq,hs)) {
+ if (!IsSilentHS(eq,hs)) {
for (UInt_t chip=0; chip<10; chip++) {
- if (!IsActiveChip(eq,hs,chip)) {
+ if (IsSilentChip(eq,hs,chip)) {
printf("%*d,%*d,%*d | ",2,eq,1,hs,1,chip);
UInt_t module = AliITSRawStreamSPD::GetOfflineModuleFromOnline(eq,hs,chip);
UInt_t colM1 = AliITSRawStreamSPD::GetOfflineColFromOnline(eq,hs,chip,0);
PrintDead();
-//!!! printf("------------------------------------------------------\n");
-//!!! printf("Dead Pixels: (eq,hs,chip,col,row | module,colM,rowM)\n");
-//!!! printf("------------------------------------------------------\n");
-//!!! for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
-//!!! for (UInt_t index=0; index<fNrDead[gloChip]; index++) {
-//!!! Int_t key = fDeadPixelMap[gloChip]->GetKeyIndex(index);
-//!!! UInt_t eq = GetEqIdFromKey(key);
-//!!! UInt_t hs = GetHSFromKey(key);
-//!!! UInt_t chip = GetChipFromKey(key);
-//!!! if (!( IsActiveEq(eq) && IsActiveHS(eq,hs) && IsActiveChip(eq,hs,chip) )) continue;
-//!!! UInt_t col = GetColFromKey(key);
-//!!! UInt_t row = GetRowFromKey(key);
-//!!!
-//!!! UInt_t module = AliITSRawStreamSPD::GetOfflineModuleFromOnline(eq,hs,chip);
-//!!! UInt_t colM = AliITSRawStreamSPD::GetOfflineColFromOnline(eq,hs,chip,col);
-//!!! UInt_t rowM = AliITSRawStreamSPD::GetOfflineRowFromOnline(eq,hs,chip,row);
-//!!!
-//!!! printf("%*d,%*d,%*d,%*d,%*d | %*d,%*d,%*d\n",2,eq,1,hs,1,chip,2,col,3,row,3,module,3,colM,3,rowM);
-//!!! }
-//!!! }
-
}
//____________________________________________________________________________________________
void AliITSOnlineCalibrationSPDhandler::PrintDead() const {
return UnSetNoisyPixel(eq,hs,chip,col,row);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::SetDeadChip(UInt_t eq, UInt_t hs, UInt_t chip) {
- // set a full chip dead, returns nr of new dead pixels
- UInt_t nrNew = 0;
- for (UInt_t col=0; col<32; col++) {
- for (UInt_t row=0; row<256; row++) {
- if (SetDeadPixel(eq,hs,chip,col,row)) {
- nrNew++;
- }
- }
- }
- return nrNew;
-}
-//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::SetNoisyChip(UInt_t eq, UInt_t hs, UInt_t chip) {
- // set a full chip noisy, returns nr of new noisy pixels
- UInt_t nrNew = 0;
- for (UInt_t col=0; col<32; col++) {
- for (UInt_t row=0; row<256; row++) {
- if (SetNoisyPixel(eq,hs,chip,col,row)) {
- nrNew++;
- }
- }
- }
- return nrNew;
-}
-//____________________________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPDhandler::UnSetDeadChip(UInt_t eq, UInt_t hs, UInt_t chip) {
- // unset a full dead chip, returns false if it was not all dead before
- UInt_t nrUnset = 0;
- for (UInt_t col=0; col<32; col++) {
- for (UInt_t row=0; row<256; row++) {
- if (UnSetDeadPixel(eq,hs,chip,col,row)) {
- nrUnset++;
- }
- }
- }
- if (nrUnset+GetNrNoisyC(eq,hs,chip)<8192) return kFALSE;
- else return kTRUE;
-}
-//____________________________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPDhandler::UnSetNoisyChip(UInt_t eq, UInt_t hs, UInt_t chip) {
- // unset a full noisy chip, returns false if it was not all noisy before
- UInt_t nrUnset = 0;
- for (UInt_t col=0; col<32; col++) {
- for (UInt_t row=0; row<256; row++) {
- if (UnSetNoisyPixel(eq,hs,chip,col,row)) {
- nrUnset++;
- }
- }
- }
- if (nrUnset<8192) return kFALSE;
- else return kTRUE;
+Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelBad(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const {
+ // is the pixel bad (silent or noisy)
+ return (IsPixelSilent(eq,hs,chip,col,row) || IsPixelNoisy(eq,hs,chip,col,row));
}
//____________________________________________________________________________________________
Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelSilent(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const {
Error("AliITSOnlineCalibrationSPDhandler::IsPixelSilent", "eq,hs,chip,col,row nrs (%d,%d,%d,%d,%d) out of bounds.",eq,hs,chip,col,row);
return kFALSE;
}
- if (!(IsActiveEq(eq) && IsActiveHS(eq,hs) && IsActiveChip(eq,hs,chip))) return kTRUE;
+ if (IsSilentChip(eq,hs,chip)) return kTRUE;
else return IsPixelDead(eq,hs,chip,col,row);
}
//____________________________________________________________________________________________
Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelDead(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const {
- // is the pixel?
+ // is the pixel dead?
UInt_t gloChip = GetGloChip(eq,hs,chip);
if (gloChip>=1200 || col>=32 || row>=256) {
Error("AliITSOnlineCalibrationSPDhandler::IsPixelDead", "eq,hs,chip,col,row nrs (%d,%d,%d,%d,%d) out of bounds.",eq,hs,chip,col,row);
return kFALSE;
}
UInt_t key = GetKey(eq,hs,chip,col,row);
- if ( fDeadPixelMap[gloChip]->Find(key) != NULL ) return kTRUE;
- else return kFALSE;
+ if (IsDeadEq(eq) || IsDeadHS(eq,hs) || IsDeadChip(eq,hs,chip)) return kTRUE;
+ else {
+ if ( fDeadPixelMap[gloChip]->Find(key) != NULL ) return kTRUE;
+ else return kFALSE;
+ }
}
//____________________________________________________________________________________________
Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelNoisy(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const {
else return kFALSE;
}
//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelBadM(UInt_t module, UInt_t colM, UInt_t rowM) const {
+ // is the pixel bad (silent or noisy)?
+ return (IsPixelSilentM(module,colM,rowM) || IsPixelNoisyM(module,colM,rowM));
+}
+//____________________________________________________________________________________________
Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelSilentM(UInt_t module, UInt_t colM, UInt_t rowM) const {
// is the pixel silent (dead or inactive)?
UInt_t eq = GetEqIdFromOffline(module);
return IsPixelNoisy(eq,hs,chip,col,row);
}
//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelBadKey(Int_t key) const {
+ // is this pixel silent (dead or inactive)?
+ UInt_t eq = GetEqIdFromKey(key);
+ UInt_t hs = GetHSFromKey(key);
+ UInt_t chip = GetChipFromKey(key);
+ UInt_t col = GetColFromKey(key);
+ UInt_t row = GetRowFromKey(key);
+ return IsPixelBad(eq,hs,chip,col,row);
+}
+//____________________________________________________________________________________________
Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelSilentKey(Int_t key) const {
// is this pixel silent (dead or inactive)?
UInt_t eq = GetEqIdFromKey(key);
return IsPixelNoisy(eq,hs,chip,col,row);
}
//____________________________________________________________________________________________
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNrBad() const {
+ // returns the total nr of bad pixels (silent or noisy)
+ UInt_t nrBad=0;
+ nrBad+=GetNrSilent();
+ UInt_t nrNoisy = GetNrNoisy();
+ for (UInt_t i=0; i<nrNoisy; i++) {
+ UInt_t eq = GetNoisyEqIdAt(i);
+ UInt_t hs = GetNoisyHSAt(i);
+ UInt_t chip = GetNoisyChipAt(i);
+ UInt_t col = GetNoisyColAt(i);
+ UInt_t row = GetNoisyRowAt(i);
+ if (!IsPixelSilent(eq,hs,chip,col,row)) nrBad++;
+ }
+ return nrBad;
+}
+//____________________________________________________________________________________________
UInt_t AliITSOnlineCalibrationSPDhandler::GetNrSilent() const {
// returns the total nr of silent pixels (dead or inactive)
UInt_t nrDead = 0;
for (UInt_t eq=0; eq<20; eq++) {
- if (!IsActiveEq(eq)) {
+ if (IsSilentEq(eq)) {
nrDead+=81920*6;
continue;
}
for (UInt_t hs=0; hs<6; hs++) {
- if (!IsActiveHS(eq,hs)) {
+ if (IsSilentHS(eq,hs)) {
nrDead+=81920;
continue;
}
for (UInt_t chip=0; chip<10; chip++) {
- if (!IsActiveChip(eq,hs,chip)) {
+ if (IsSilentChip(eq,hs,chip)) {
nrDead+=8192;
continue;
}
return nrNoisy;
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadEqIdAt(UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadEqIdAt(UInt_t index) const {
// get eq for the dead pixel at position index in list of dead
UInt_t gloChip;
UInt_t chipIndex;
return GetDeadEqIdAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyEqIdAt(UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyEqIdAt(UInt_t index) const {
// get eq for the noisy pixel at position index in list of noisy
UInt_t gloChip;
UInt_t chipIndex;
return GetNoisyEqIdAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadHSAt(UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadHSAt(UInt_t index) const {
// get hs for the dead pixel at position index in list of dead
UInt_t gloChip;
UInt_t chipIndex;
return GetDeadHSAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyHSAt(UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyHSAt(UInt_t index) const {
// get hs for the noisy pixel at position index in list of noisy
UInt_t gloChip;
UInt_t chipIndex;
return GetNoisyHSAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadChipAt(UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadChipAt(UInt_t index) const {
// get chip for the dead pixel at position index in list of dead
UInt_t gloChip;
UInt_t chipIndex;
return GetDeadChipAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyChipAt(UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyChipAt(UInt_t index) const {
// get chip for the noisy pixel at position index in list of noisy
UInt_t gloChip;
UInt_t chipIndex;
return GetNoisyChipAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadColAt(UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadColAt(UInt_t index) const {
// get hs for the dead pixel at position index in list of dead
UInt_t gloChip;
UInt_t chipIndex;
return GetDeadColAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyColAt(UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyColAt(UInt_t index) const {
// get hs for the noisy pixel at position index in list of noisy
UInt_t gloChip;
UInt_t chipIndex;
return GetNoisyColAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadRowAt(UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadRowAt(UInt_t index) const {
// get hs for the dead pixel at position index in list of dead
UInt_t gloChip;
UInt_t chipIndex;
return GetDeadRowAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyRowAt(UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyRowAt(UInt_t index) const {
// get hs for the noisy pixel at position index in list of noisy
UInt_t gloChip;
UInt_t chipIndex;
return GetNoisyRowAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNrBad(UInt_t module) const {
+ // returns the number of bad pixels for a certain module (silent or noisy)
+ UInt_t nrBad = 0;
+ nrBad+=GetNrSilent(module);
+ UInt_t nrNoisy = GetNrNoisy(module);
+ for (UInt_t i=0; i<nrNoisy; i++) {
+ UInt_t eq = GetNoisyEqIdAt(module,i);
+ UInt_t hs = GetNoisyHSAt(module,i);
+ UInt_t chip = GetNoisyChipAt(module,i);
+ UInt_t col = GetNoisyColAt(module,i);
+ UInt_t row = GetNoisyRowAt(module,i);
+ if (!IsPixelSilent(eq,hs,chip,col,row)) nrBad++;
+ }
+ return nrBad;
+}
+//____________________________________________________________________________________________
UInt_t AliITSOnlineCalibrationSPDhandler::GetNrSilent(UInt_t module) const {
// returns the number of silent pixels for a certain module (dead or inactive)
if (module>=240) {
}
UInt_t nrSilent = 0;
UInt_t eq = GetEqIdFromOffline(module);
- if (!IsActiveEq(eq)) return 160*256;
+ if (IsSilentEq(eq)) return 160*256;
UInt_t hs = GetHSFromOffline(module);
- if (!IsActiveHS(eq,hs)) return 160*256;
+ if (IsSilentHS(eq,hs)) return 160*256;
for (UInt_t ch=0; ch<5; ch++) {
UInt_t chip = GetChipFromOffline(module,ch*32);
- if (!IsActiveChip(eq,hs,chip)) {
+ if (IsSilentChip(eq,hs,chip)) {
nrSilent+=8192;
}
else {
return nrNoisy;
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadEqIdAt(UInt_t module, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadEqIdAt(UInt_t module, UInt_t index) const {
// get eq for the dead pixel at position index in list of dead
UInt_t gloChip;
UInt_t chipIndex;
return GetDeadEqIdAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyEqIdAt(UInt_t module, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyEqIdAt(UInt_t module, UInt_t index) const {
// get eq for the noisy pixel at position index in list of noisy
UInt_t gloChip;
UInt_t chipIndex;
return GetNoisyEqIdAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadHSAt(UInt_t module, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadHSAt(UInt_t module, UInt_t index) const {
// get hs for the dead pixel at position index in list of dead
UInt_t gloChip;
UInt_t chipIndex;
return GetDeadHSAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyHSAt(UInt_t module, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyHSAt(UInt_t module, UInt_t index) const {
// get hs for the noisy pixel at position index in list of noisy
UInt_t gloChip;
UInt_t chipIndex;
return GetNoisyHSAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadChipAt(UInt_t module, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadChipAt(UInt_t module, UInt_t index) const {
// get chip for the dead pixel at position index in list of dead
UInt_t gloChip;
UInt_t chipIndex;
return GetDeadChipAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyChipAt(UInt_t module, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyChipAt(UInt_t module, UInt_t index) const {
// get chip for the noisy pixel at position index in list of noisy
UInt_t gloChip;
UInt_t chipIndex;
return GetNoisyChipAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadColAt(UInt_t module, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadColAt(UInt_t module, UInt_t index) const {
// get hs for the dead pixel at position index in list of dead
UInt_t gloChip;
UInt_t chipIndex;
return GetDeadColAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyColAt(UInt_t module, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyColAt(UInt_t module, UInt_t index) const {
// get hs for the noisy pixel at position index in list of noisy
UInt_t gloChip;
UInt_t chipIndex;
return GetNoisyColAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadRowAt(UInt_t module, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadRowAt(UInt_t module, UInt_t index) const {
// get hs for the dead pixel at position index in list of dead
UInt_t gloChip;
UInt_t chipIndex;
return GetDeadRowAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyRowAt(UInt_t module, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyRowAt(UInt_t module, UInt_t index) const {
// get hs for the noisy pixel at position index in list of noisy
UInt_t gloChip;
UInt_t chipIndex;
return GetNoisyRowAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNrBadEq(UInt_t eq) const {
+ // returns nr of bad for eq (silent or noisy)
+ UInt_t nrBad = 0;
+ nrBad+=GetNrSilentEq(eq);
+ UInt_t nrNoisy = GetNrNoisy(eq);
+ for (UInt_t i=0; i<nrNoisy; i++) {
+ UInt_t hs = GetNoisyHSAtEq(eq,i);
+ UInt_t chip = GetNoisyChipAtEq(eq,i);
+ UInt_t col = GetNoisyColAtEq(eq,i);
+ UInt_t row = GetNoisyRowAtEq(eq,i);
+ if (!IsPixelSilent(eq,hs,chip,col,row)) nrBad++;
+ }
+ return nrBad;
+}
+//____________________________________________________________________________________________
UInt_t AliITSOnlineCalibrationSPDhandler::GetNrSilentEq(UInt_t eq) const {
// returns nr of silent for eq (dead or inactive)
UInt_t returnval=0;
- if (!IsActiveEq(eq)) return 81920*6;
+ if (IsSilentEq(eq)) return 81920*6;
for (UInt_t hs=0; hs<6; hs++) {
- if (!IsActiveHS(eq,hs)) {
+ if (IsSilentHS(eq,hs)) {
returnval+=81920;
continue;
}
for (UInt_t chip=0; chip<10; chip++) {
- if (!IsActiveChip(eq,hs,chip)) {
+ if (IsSilentChip(eq,hs,chip)) {
returnval+=8192;
continue;
}
}
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadHSAtEq(UInt_t eq, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadHSAtEq(UInt_t eq, UInt_t index) const {
// get hs for the dead pixel at position index in list of dead
UInt_t gloChip;
UInt_t chipIndex;
return GetDeadHSAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyHSAtEq(UInt_t eq, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyHSAtEq(UInt_t eq, UInt_t index) const {
// get hs for the noisy pixel at position index in list of noisy
UInt_t gloChip;
UInt_t chipIndex;
return GetNoisyHSAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadChipAtEq(UInt_t eq, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadChipAtEq(UInt_t eq, UInt_t index) const {
// get chip for the dead pixel at position index in list of dead
UInt_t gloChip;
UInt_t chipIndex;
return GetDeadChipAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyChipAtEq(UInt_t eq, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyChipAtEq(UInt_t eq, UInt_t index) const {
// get chip for the noisy pixel at position index in list of noisy
UInt_t gloChip;
UInt_t chipIndex;
return GetNoisyChipAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadColAtEq(UInt_t eq, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadColAtEq(UInt_t eq, UInt_t index) const {
// get hs for the dead pixel at position index in list of dead
UInt_t gloChip;
UInt_t chipIndex;
return GetDeadColAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyColAtEq(UInt_t eq, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyColAtEq(UInt_t eq, UInt_t index) const {
// get hs for the noisy pixel at position index in list of noisy
UInt_t gloChip;
UInt_t chipIndex;
return GetNoisyColAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadRowAtEq(UInt_t eq, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetDeadRowAtEq(UInt_t eq, UInt_t index) const {
// get hs for the dead pixel at position index in list of dead
UInt_t gloChip;
UInt_t chipIndex;
return GetDeadRowAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
-UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyRowAtEq(UInt_t eq, UInt_t index) {
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNoisyRowAtEq(UInt_t eq, UInt_t index) const {
// get hs for the noisy pixel at position index in list of noisy
UInt_t gloChip;
UInt_t chipIndex;
return GetNoisyRowAtC2(gloChip,chipIndex);
}
//____________________________________________________________________________________________
+UInt_t AliITSOnlineCalibrationSPDhandler::GetNrBadC(UInt_t eq, UInt_t hs, UInt_t chip) const {
+ // returns nr of bad for chip (silent or noisy)
+ UInt_t nrBad = 0;
+ nrBad+=GetNrSilentC(eq,hs,chip);
+ UInt_t nrNoisy = GetNrNoisyC(eq,hs,chip);
+ for (UInt_t i=0; i<nrNoisy; i++) {
+ UInt_t col = GetNoisyColAtC(eq,hs,chip,i);
+ UInt_t row = GetNoisyRowAtC(eq,hs,chip,i);
+ if (!IsPixelSilent(eq,hs,chip,col,row)) nrBad++;
+ }
+ return nrBad;
+}
+//____________________________________________________________________________________________
UInt_t AliITSOnlineCalibrationSPDhandler::GetNrSilentC(UInt_t eq, UInt_t hs, UInt_t chip) const {
// returns nr of silent for chip (dead or inactive)
- if (!(IsActiveEq(eq) && IsActiveHS(eq,hs) && IsActiveChip(eq,hs,chip))) return 8192;
+ if (IsSilentChip(eq,hs,chip)) return 8192;
else return GetNrDeadC(eq,hs,chip);
}
//____________________________________________________________________________________________
UInt_t module = AliITSRawStreamSPD::GetOfflineModuleFromOnline(eq,hs,chip);
UInt_t colM = AliITSRawStreamSPD::GetOfflineColFromOnline(eq,hs,chip,col);
UInt_t rowM = AliITSRawStreamSPD::GetOfflineRowFromOnline(eq,hs,chip,row);
- returnMess = Form("%*d,%*d,%*d,%*d,%*d | %*d,%*d,%*d\n",2,eq,1,hs,1,chip,2,col,3,row,3,module,3,colM,3,rowM);
+ returnMess = Form("%*d,%*d,%*d,%*d,%*d | %*d,%*d,%*d",2,eq,1,hs,1,chip,2,col,3,row,3,module,3,colM,3,rowM);
return returnMess.Data();
}
else {
UInt_t module = AliITSRawStreamSPD::GetOfflineModuleFromOnline(eq,hs,chip);
UInt_t colM = AliITSRawStreamSPD::GetOfflineColFromOnline(eq,hs,chip,col);
UInt_t rowM = AliITSRawStreamSPD::GetOfflineRowFromOnline(eq,hs,chip,row);
- returnMess = Form("%*d,%*d,%*d,%*d,%*d | %*d,%*d,%*d\n",2,eq,1,hs,1,chip,2,col,3,row,3,module,3,colM,3,rowM);
+ returnMess = Form("%*d,%*d,%*d,%*d,%*d | %*d,%*d,%*d",2,eq,1,hs,1,chip,2,col,3,row,3,module,3,colM,3,rowM);
return returnMess.Data();
}
else {
for (UInt_t eq=0; eq<20; eq++) {
if (!(other->IsActiveEq(eq))) ActivateEq(eq,kFALSE);
+ if (other->IsDeadEq(eq)) SetDeadEq(eq,kTRUE);
for (UInt_t hs=0; hs<6; hs++) {
if (!(other->IsActiveHS(eq,hs))) ActivateHS(eq,hs,kFALSE);
+ if (other->IsDeadHS(eq,hs)) SetDeadHS(eq,hs,kTRUE);
for (UInt_t chip=0; chip<10; chip++) {
if (!(other->IsActiveChip(eq,hs,chip))) ActivateChip(eq,hs,chip,kFALSE);
+ if (other->IsDeadChip(eq,hs,chip)) SetDeadChip(eq,hs,chip,kTRUE);
}
}
}
for (UInt_t eq=0; eq<20; eq++) {
for (UInt_t hs=0; hs<6; hs++) {
for (UInt_t chip=0; chip<10; chip++) {
- if (!(IsActiveEq(eq) && IsActiveHS(eq,hs) && IsActiveChip(eq,hs,chip))) {
- if (other->IsActiveEq(eq) && other->IsActiveHS(eq,hs) && other->IsActiveChip(eq,hs,chip)) {
+ if (!IsActiveEq(eq) || IsDeadEq(eq) || !IsActiveHS(eq,hs) || IsDeadHS(eq,hs) || !IsActiveChip(eq,hs,chip) || IsDeadChip(eq,hs,chip)) {
+ if (other->IsActiveEq(eq) && !other->IsDeadEq(eq) && other->IsActiveHS(eq,hs) && !other->IsDeadHS(eq,hs) && other->IsActiveChip(eq,hs,chip) && !other->IsDeadChip(eq,hs,chip)) {
// if this is inactive and the other is active...
returnval+= 8192 - other->GetNrDeadC(eq,hs,chip);
}
newHandler->ActivateEq(eq,kFALSE);
if (!other->IsActiveEq(eq)) newHandler->ActivateEq(eq);
}
+ if (IsDeadEq(eq)) {
+ newHandler->SetDeadEq(eq);
+ if (other->IsDeadEq(eq)) newHandler->SetDeadEq(eq,kFALSE);
+ }
for (UInt_t hs=0; hs<6; hs++) {
if (!(IsActiveHS(eq,hs))) {
newHandler->ActivateHS(eq,hs,kFALSE);
if (!other->IsActiveHS(eq,hs)) newHandler->ActivateHS(eq,hs);
}
+ if (IsDeadHS(eq,hs)) {
+ newHandler->SetDeadHS(eq,hs);
+ if (other->IsDeadHS(eq,hs)) newHandler->SetDeadHS(eq,hs,kFALSE);
+ }
for (UInt_t chip=0; chip<10; chip++) {
if (!(IsActiveChip(eq,hs,chip))) {
newHandler->ActivateChip(eq,hs,chip,kFALSE);
if (!other->IsActiveChip(eq,hs,chip)) newHandler->ActivateHS(eq,hs,chip);
}
+ if (IsDeadChip(eq,hs,chip)) {
+ newHandler->SetDeadChip(eq,hs,chip);
+ if (other->IsDeadChip(eq,hs,chip)) newHandler->SetDeadChip(eq,hs,chip,kFALSE);
+ }
}
}
}
newHandler->ActivateEq(eq,kFALSE);
if (!other->IsActiveEq(eq)) newHandler->ActivateEq(eq);
}
+ if (IsDeadEq(eq)) {
+ newHandler->SetDeadEq(eq);
+ if (other->IsDeadEq(eq)) newHandler->SetDeadEq(eq,kFALSE);
+ }
for (UInt_t hs=0; hs<6; hs++) {
if (!(IsActiveHS(eq,hs))) {
newHandler->ActivateHS(eq,hs,kFALSE);
if (!other->IsActiveHS(eq,hs)) newHandler->ActivateHS(eq,hs);
}
+ if (IsDeadHS(eq,hs)) {
+ newHandler->SetDeadHS(eq,hs);
+ if (other->IsDeadHS(eq,hs)) newHandler->SetDeadHS(eq,hs,kFALSE);
+ }
for (UInt_t chip=0; chip<10; chip++) {
if (!(IsActiveChip(eq,hs,chip))) {
newHandler->ActivateChip(eq,hs,chip,kFALSE);
if (!other->IsActiveChip(eq,hs,chip)) newHandler->ActivateHS(eq,hs,chip);
}
+ if (IsDeadChip(eq,hs,chip)) {
+ newHandler->SetDeadChip(eq,hs,chip);
+ if (other->IsDeadChip(eq,hs,chip)) newHandler->SetDeadChip(eq,hs,chip,kFALSE);
+ }
}
}
}
return newHandler;
}
//____________________________________________________________________________________________
-void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexDead(UInt_t module, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) {
+void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexDead(UInt_t module, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const {
// find gloChip and chipIndex from module and index
if (index<GetNrDead(module)) {
UInt_t eq = GetEqIdFromOffline(module);
}
}
//____________________________________________________________________________________________
-void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexNoisy(UInt_t module, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) {
+void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexNoisy(UInt_t module, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const {
// find gloChip and chipIndex from module and index
if (index<GetNrNoisy(module)) {
UInt_t eq = GetEqIdFromOffline(module);
}
}
//____________________________________________________________________________________________
-void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexEqDead(UInt_t eq, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) {
+void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexEqDead(UInt_t eq, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const {
// find gloChip and chipIndex from module and index
if (index<GetNrDeadEq(eq)) {
}
}
//____________________________________________________________________________________________
-void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexEqNoisy(UInt_t eq, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) {
+void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexEqNoisy(UInt_t eq, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const {
// find gloChip and chipIndex from module and index
if (index<GetNrNoisyEq(eq)) {
}
}
//____________________________________________________________________________________________
-void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexTotDead(UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) {
+void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexTotDead(UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const {
// find gloChip and chipIndex from global index
if (index<GetNrDead()) {
}
}
//____________________________________________________________________________________________
-void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexTotNoisy(UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) {
+void AliITSOnlineCalibrationSPDhandler::GetChipAndIndexTotNoisy(UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const {
// find gloChip and chipIndex from global index
if (index<GetNrNoisy()) {
}
//____________________________________________________________________________________________
void AliITSOnlineCalibrationSPDhandler::ActivateALL() {
+ // activate all eq,hs,chips
for (UInt_t eq=0; eq<20; eq++) {
ActivateEq(eq);
for (UInt_t hs=0; hs<6; hs++) {
}
//____________________________________________________________________________________________
void AliITSOnlineCalibrationSPDhandler::ActivateEq(UInt_t eq, Bool_t setval) {
+ // activate eq
if (eq>=20) {
Error("AliITSOnlineCalibrationSPDhandler::ActivateEq", "eq (%d) out of bounds.",eq);
return;
}
//____________________________________________________________________________________________
void AliITSOnlineCalibrationSPDhandler::ActivateHS(UInt_t eq, UInt_t hs, Bool_t setval) {
+ // activate hs
if (eq>=20 || hs>=6) {
Error("AliITSOnlineCalibrationSPDhandler::ActivateHS", "eq,hs (%d,%d) out of bounds.",eq,hs);
return;
}
//____________________________________________________________________________________________
void AliITSOnlineCalibrationSPDhandler::ActivateChip(UInt_t eq, UInt_t hs, UInt_t chip, Bool_t setval) {
+ // activate chip
if (eq>=20 || hs>=6 || chip>=10) {
Error("AliITSOnlineCalibrationSPDhandler::ActivateChip", "eq,hs,chip (%d,%d,%d) out of bounds.",eq,hs,chip);
return;
}
//____________________________________________________________________________________________
Bool_t AliITSOnlineCalibrationSPDhandler::IsActiveEq(UInt_t eq) const {
+ // Is eq active?
if (eq>=20) {
Error("AliITSOnlineCalibrationSPDhandler::IsActiveEq", "eq (%d) out of bounds.",eq);
return kFALSE;
}
//____________________________________________________________________________________________
Bool_t AliITSOnlineCalibrationSPDhandler::IsActiveHS(UInt_t eq, UInt_t hs) const {
+ // Is hs active?
if (eq>=20 || hs>=6) {
Error("AliITSOnlineCalibrationSPDhandler::IsActiveHS", "eq,hs (%d,%d) out of bounds.",eq,hs);
return kFALSE;
}
//____________________________________________________________________________________________
Bool_t AliITSOnlineCalibrationSPDhandler::IsActiveChip(UInt_t eq, UInt_t hs, UInt_t chip) const {
+ // Is chip active?
if (eq>=20 || hs>=6 || chip>=10) {
Error("AliITSOnlineCalibrationSPDhandler::IsActiveChip", "eq,hs,chip (%d,%d,%d) out of bounds.",eq,hs,chip);
return kFALSE;
}
return fActiveChip[eq][hs][chip];
}
-
+//____________________________________________________________________________________________
+void AliITSOnlineCalibrationSPDhandler::UnSetDeadALL() {
+ // Clear all dead eq,hs,chips
+ for (UInt_t eq=0; eq<20; eq++) {
+ SetDeadEq(eq,kFALSE);
+ for (UInt_t hs=0; hs<6; hs++) {
+ SetDeadHS(eq,hs,kFALSE);
+ for (UInt_t chip=0; chip<10; chip++) {
+ SetDeadChip(eq,hs,chip,kFALSE);
+ }
+ }
+ }
+}
+//____________________________________________________________________________________________
+void AliITSOnlineCalibrationSPDhandler::SetDeadEq(UInt_t eq, Bool_t setval) {
+ // set eq dead
+ if (eq>=20) {
+ Error("AliITSOnlineCalibrationSPDhandler::SetDeadEq", "eq (%d) out of bounds.",eq);
+ return;
+ }
+ fDeadEq[eq] = setval;
+}
+//____________________________________________________________________________________________
+void AliITSOnlineCalibrationSPDhandler::SetDeadHS(UInt_t eq, UInt_t hs, Bool_t setval) {
+ // set hs dead
+ if (eq>=20 || hs>=6) {
+ Error("AliITSOnlineCalibrationSPDhandler::SetDeadHS", "eq,hs (%d,%d) out of bounds.",eq,hs);
+ return;
+ }
+ fDeadHS[eq][hs] = setval;
+}
+//____________________________________________________________________________________________
+void AliITSOnlineCalibrationSPDhandler::SetDeadChip(UInt_t eq, UInt_t hs, UInt_t chip, Bool_t setval) {
+ // set chip dead
+ if (eq>=20 || hs>=6 || chip>=10) {
+ Error("AliITSOnlineCalibrationSPDhandler::SetDeadChip", "eq,hs,chip (%d,%d,%d) out of bounds.",eq,hs,chip);
+ return;
+ }
+ fDeadChip[eq][hs][chip] = setval;
+}
+//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::IsDeadEq(UInt_t eq) const {
+ // is eq dead?
+ if (eq>=20) {
+ Error("AliITSOnlineCalibrationSPDhandler::IsDeadEq", "eq (%d) out of bounds.",eq);
+ return kFALSE;
+ }
+ return fDeadEq[eq];
+}
+//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::IsDeadHS(UInt_t eq, UInt_t hs) const {
+ // is hs dead?
+ if (eq>=20 || hs>=6) {
+ Error("AliITSOnlineCalibrationSPDhandler::IsDeadHS", "eq,hs (%d,%d) out of bounds.",eq,hs);
+ return kFALSE;
+ }
+ return fDeadHS[eq][hs];
+}
+//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::IsDeadChip(UInt_t eq, UInt_t hs, UInt_t chip) const {
+ // is chip dead?
+ if (eq>=20 || hs>=6 || chip>=10) {
+ Error("AliITSOnlineCalibrationSPDhandler::IsDeadChip", "eq,hs,chip (%d,%d,%d) out of bounds.",eq,hs,chip);
+ return kFALSE;
+ }
+ return fDeadChip[eq][hs][chip];
+}
+//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::IsSilentEq(UInt_t eq) const {
+ // is eq silent?
+ if (eq>=20) {
+ Error("AliITSOnlineCalibrationSPDhandler::IsSilentEq", "eq (%d) out of bounds.",eq);
+ return kFALSE;
+ }
+ return (!IsActiveEq(eq) || IsDeadEq(eq));
+}
+//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::IsSilentHS(UInt_t eq, UInt_t hs) const {
+ // is hs silent?
+ if (eq>=20 || hs>=6) {
+ Error("AliITSOnlineCalibrationSPDhandler::IsSilentHS", "eq,hs (%d,%d) out of bounds.",eq,hs);
+ return kFALSE;
+ }
+ return (!IsActiveEq(eq) || IsDeadEq(eq) || !IsActiveHS(eq,hs) || IsDeadHS(eq,hs));
+}
+//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::IsSilentChip(UInt_t eq, UInt_t hs, UInt_t chip) const {
+ // is chip silent?
+ if (eq>=20 || hs>=6 || chip>=10) {
+ Error("AliITSOnlineCalibrationSPDhandler::IsSilentChip", "eq,hs,chip (%d,%d,%d) out of bounds.",eq,hs,chip);
+ return kFALSE;
+ }
+ return (!IsActiveEq(eq) || IsDeadEq(eq) || !IsActiveHS(eq,hs) || IsDeadHS(eq,hs) || !IsActiveChip(eq,hs,chip) || IsDeadChip(eq,hs,chip));
+}
Bool_t UnSetNoisyPixel(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row);
Bool_t UnSetDeadPixelM(UInt_t module, UInt_t colM, UInt_t row);
Bool_t UnSetNoisyPixelM(UInt_t module, UInt_t colM, UInt_t row);
- UInt_t SetDeadChip(UInt_t eq, UInt_t hs, UInt_t chip);
- UInt_t SetNoisyChip(UInt_t eq, UInt_t hs, UInt_t chip);
- Bool_t UnSetDeadChip(UInt_t eq, UInt_t hs, UInt_t chip);
- Bool_t UnSetNoisyChip(UInt_t eq, UInt_t hs, UInt_t chip);
+ Bool_t IsPixelBad(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const;
Bool_t IsPixelSilent(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const; // silent = dead or inactive
Bool_t IsPixelDead(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const;
Bool_t IsPixelNoisy(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const;
+ Bool_t IsPixelBadM(UInt_t module, UInt_t colM, UInt_t row) const;
Bool_t IsPixelSilentM(UInt_t module, UInt_t colM, UInt_t row) const;
Bool_t IsPixelDeadM(UInt_t module, UInt_t colM, UInt_t row) const;
Bool_t IsPixelNoisyM(UInt_t module, UInt_t colM, UInt_t row) const;
+ Bool_t IsPixelBadKey(Int_t key) const;
Bool_t IsPixelSilentKey(Int_t key) const;
Bool_t IsPixelDeadKey(Int_t key) const;
Bool_t IsPixelNoisyKey(Int_t key) const;
+ UInt_t GetNrBad() const; // bad = silent or noisy
UInt_t GetNrSilent() const; // silent = dead or inactive
UInt_t GetNrDead() const;
- UInt_t GetDeadEqIdAt(UInt_t index);
- UInt_t GetDeadHSAt(UInt_t index);
- UInt_t GetDeadChipAt(UInt_t index);
- UInt_t GetDeadColAt(UInt_t index);
- UInt_t GetDeadRowAt(UInt_t index);
+ UInt_t GetDeadEqIdAt(UInt_t index) const;
+ UInt_t GetDeadHSAt(UInt_t index) const;
+ UInt_t GetDeadChipAt(UInt_t index) const;
+ UInt_t GetDeadColAt(UInt_t index) const;
+ UInt_t GetDeadRowAt(UInt_t index) const;
UInt_t GetNrNoisy() const;
- UInt_t GetNoisyEqIdAt(UInt_t index);
- UInt_t GetNoisyHSAt(UInt_t index);
- UInt_t GetNoisyChipAt(UInt_t index);
- UInt_t GetNoisyColAt(UInt_t index);
- UInt_t GetNoisyRowAt(UInt_t index);
+ UInt_t GetNoisyEqIdAt(UInt_t index) const;
+ UInt_t GetNoisyHSAt(UInt_t index) const;
+ UInt_t GetNoisyChipAt(UInt_t index) const;
+ UInt_t GetNoisyColAt(UInt_t index) const;
+ UInt_t GetNoisyRowAt(UInt_t index) const;
+
+ UInt_t GetNrBad(UInt_t module) const; // bad = silent or noisy
UInt_t GetNrSilent(UInt_t module) const; // silent = dead or inactive
UInt_t GetNrDead(UInt_t module) const;
- UInt_t GetDeadEqIdAt(UInt_t module,UInt_t index);
- UInt_t GetDeadHSAt(UInt_t module,UInt_t index);
- UInt_t GetDeadChipAt(UInt_t module,UInt_t index);
- UInt_t GetDeadColAt(UInt_t module,UInt_t index);
- UInt_t GetDeadRowAt(UInt_t module,UInt_t index);
+ UInt_t GetDeadEqIdAt(UInt_t module,UInt_t index) const;
+ UInt_t GetDeadHSAt(UInt_t module,UInt_t index) const;
+ UInt_t GetDeadChipAt(UInt_t module,UInt_t index) const;
+ UInt_t GetDeadColAt(UInt_t module,UInt_t index) const;
+ UInt_t GetDeadRowAt(UInt_t module,UInt_t index) const;
UInt_t GetNrNoisy(UInt_t module) const;
- UInt_t GetNoisyEqIdAt(UInt_t module, UInt_t index);
- UInt_t GetNoisyHSAt(UInt_t module, UInt_t index);
- UInt_t GetNoisyChipAt(UInt_t module, UInt_t index);
- UInt_t GetNoisyColAt(UInt_t module, UInt_t index);
- UInt_t GetNoisyRowAt(UInt_t module, UInt_t index);
+ UInt_t GetNoisyEqIdAt(UInt_t module, UInt_t index) const;
+ UInt_t GetNoisyHSAt(UInt_t module, UInt_t index) const;
+ UInt_t GetNoisyChipAt(UInt_t module, UInt_t index) const;
+ UInt_t GetNoisyColAt(UInt_t module, UInt_t index) const;
+ UInt_t GetNoisyRowAt(UInt_t module, UInt_t index) const;
+ UInt_t GetNrBadEq(UInt_t eq) const; // bad = silent or noisy
UInt_t GetNrSilentEq(UInt_t eq) const; // silent = dead or inactive
UInt_t GetNrDeadEq(UInt_t eq) const;
UInt_t GetDeadEqIdAtEq(UInt_t eq, UInt_t index) const;
- UInt_t GetDeadHSAtEq(UInt_t eq, UInt_t index);
- UInt_t GetDeadChipAtEq(UInt_t eq, UInt_t index);
- UInt_t GetDeadColAtEq(UInt_t eq, UInt_t index);
- UInt_t GetDeadRowAtEq(UInt_t eq, UInt_t index);
+ UInt_t GetDeadHSAtEq(UInt_t eq, UInt_t index) const;
+ UInt_t GetDeadChipAtEq(UInt_t eq, UInt_t index) const;
+ UInt_t GetDeadColAtEq(UInt_t eq, UInt_t index) const;
+ UInt_t GetDeadRowAtEq(UInt_t eq, UInt_t index) const;
UInt_t GetNrNoisyEq(UInt_t eq) const;
UInt_t GetNoisyEqIdAtEq(UInt_t eq, UInt_t index) const;
- UInt_t GetNoisyHSAtEq(UInt_t eq, UInt_t index);
- UInt_t GetNoisyChipAtEq(UInt_t eq, UInt_t index);
- UInt_t GetNoisyColAtEq(UInt_t eq, UInt_t index);
- UInt_t GetNoisyRowAtEq(UInt_t eq, UInt_t index);
+ UInt_t GetNoisyHSAtEq(UInt_t eq, UInt_t index) const;
+ UInt_t GetNoisyChipAtEq(UInt_t eq, UInt_t index) const;
+ UInt_t GetNoisyColAtEq(UInt_t eq, UInt_t index) const;
+ UInt_t GetNoisyRowAtEq(UInt_t eq, UInt_t index) const;
+ UInt_t GetNrBadC(UInt_t eq, UInt_t hs, UInt_t chip) const; // bad = silent or noisy
UInt_t GetNrSilentC(UInt_t eq, UInt_t hs, UInt_t chip) const; // silent = dead or inactive
UInt_t GetNrDeadC(UInt_t eq, UInt_t hs, UInt_t chip) const;
UInt_t GetDeadEqIdAtC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const;
const Char_t* GetDeadPixelAsTextC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const;
const Char_t* GetNoisyPixelAsTextC(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t index) const;
- void ActivateALL();
- void ActivateEq(UInt_t eq, Bool_t setval = kTRUE);
- void ActivateHS(UInt_t eq, UInt_t hs, Bool_t setval = kTRUE);
- void ActivateChip(UInt_t eq, UInt_t hs, UInt_t chip, Bool_t setval = kTRUE);
+ void ActivateALL();
+ void ActivateEq(UInt_t eq, Bool_t setval = kTRUE);
+ void ActivateHS(UInt_t eq, UInt_t hs, Bool_t setval = kTRUE);
+ void ActivateChip(UInt_t eq, UInt_t hs, UInt_t chip, Bool_t setval = kTRUE);
+
+ void UnSetDeadALL();
+ void SetDeadEq(UInt_t eq, Bool_t setval = kTRUE);
+ void SetDeadHS(UInt_t eq, UInt_t hs, Bool_t setval = kTRUE);
+ void SetDeadChip(UInt_t eq, UInt_t hs, UInt_t chip, Bool_t setval = kTRUE);
+
+ Bool_t IsActiveEq(UInt_t eq) const;
+ Bool_t IsActiveHS(UInt_t eq, UInt_t hs) const;
+ Bool_t IsActiveChip(UInt_t eq, UInt_t hs, UInt_t chip) const;
+
+ Bool_t IsDeadEq(UInt_t eq) const;
+ Bool_t IsDeadHS(UInt_t eq, UInt_t hs) const;
+ Bool_t IsDeadChip(UInt_t eq, UInt_t hs, UInt_t chip) const;
- Bool_t IsActiveEq(UInt_t eq) const;
- Bool_t IsActiveHS(UInt_t eq, UInt_t hs) const;
- Bool_t IsActiveChip(UInt_t eq, UInt_t hs, UInt_t chip) const;
+ Bool_t IsSilentEq(UInt_t eq) const;
+ Bool_t IsSilentHS(UInt_t eq, UInt_t hs) const;
+ Bool_t IsSilentChip(UInt_t eq, UInt_t hs, UInt_t chip) const;
UInt_t AddSilentFrom(AliITSOnlineCalibrationSPDhandler* other);
Bool_t fActiveEq[20]; // active bit for each equipment
Bool_t fActiveHS[20][6]; // active bit for each half-stave
Bool_t fActiveChip[20][6][10]; // active bit for each chip
+ Bool_t fDeadEq[20]; // dead bit for each equipment
+ Bool_t fDeadHS[20][6]; // dead bit for each half-stave
+ Bool_t fDeadChip[20][6][10]; // dead bit for each chip
Int_t GetKey(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const
{return eq*6*10*32*256 + hs*10*32*256 + chip*32*256 + col*256 + row;}
UInt_t GetHSGlo(UInt_t gloChip) const {return (gloChip%60)/10;}
UInt_t GetChipGlo(UInt_t gloChip) const {return (gloChip%60)%10;}
- void GetChipAndIndexDead(UInt_t module, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex);
- void GetChipAndIndexNoisy(UInt_t module, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex);
- void GetChipAndIndexEqDead(UInt_t eq, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex);
- void GetChipAndIndexEqNoisy(UInt_t eq, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex);
- void GetChipAndIndexTotDead(UInt_t index, UInt_t& gloChip, UInt_t& chipIndex);
- void GetChipAndIndexTotNoisy(UInt_t index, UInt_t& gloChip, UInt_t& chipIndex);
+ void GetChipAndIndexDead(UInt_t module, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const;
+ void GetChipAndIndexNoisy(UInt_t module, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const;
+ void GetChipAndIndexEqDead(UInt_t eq, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const;
+ void GetChipAndIndexEqNoisy(UInt_t eq, UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const;
+ void GetChipAndIndexTotDead(UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const;
+ void GetChipAndIndexTotNoisy(UInt_t index, UInt_t& gloChip, UInt_t& chipIndex) const;
UInt_t GetEqIdFromOffline(UInt_t module) const;
UInt_t GetHSFromOffline(UInt_t module) const;
fNrEqHits = 0;
- AliITSOnlineCalibrationSPDhandler *deadPixelHandler = new AliITSOnlineCalibrationSPDhandler();
-
for (UInt_t hs=0; hs<6; hs++) {
- if (!(fHandler->IsActiveHS(GetEqNr(),hs))) {
+ if (!fHandler->IsActiveHS(GetEqNr(),hs)) {
fNrDeadChips+=10;
}
else {
for (UInt_t chip=0; chip<10; chip++) {
- if (!(fHandler->IsActiveChip(GetEqNr(),hs,chip))) {
+ if (!fHandler->IsActiveChip(GetEqNr(),hs,chip)) {
fNrDeadChips++;
}
else {
// perform search for individual dead pixels...
- deadPixelHandler->ResetDead();
Bool_t good=kFALSE;
UInt_t nrPossiblyDeadPixels = 0;
nrPixels++;
if (nrHits==0) {
nrPossiblyDeadPixels++;
- deadPixelHandler->SetDeadPixel(GetEqNr(),hs,chip,col,row);
+ }
+ else {
+ fHandler->UnSetDeadPixel(GetEqNr(),hs,chip,col,row); // unset (no action unless dead before)
}
}
else {
}
fNrEqHits+=nrChipHits;
- // check all pixels that were declared dead from before...
- UInt_t nrDeadBefore = fHandler->GetNrDeadC(GetEqNr(),hs,chip);
- AliITSOnlineCalibrationSPDhandler *tmpHand = new AliITSOnlineCalibrationSPDhandler();
- for (UInt_t index=0; index<nrDeadBefore; index++) {
- UInt_t col = fHandler->GetDeadColAtC(GetEqNr(),hs,chip,index);
- UInt_t row = fHandler->GetDeadRowAtC(GetEqNr(),hs,chip,index);
- if (fPhysObj->GetHits(hs,chip,col,row)>0) {
- // fHandler->UnSetDeadPixel(GetEqNr(),hs,chip,col,row); // This was a bug - cannot delete while moving through indices, use tmpHand instead
- tmpHand->SetDeadPixel(GetEqNr(),hs,chip,col,row);
- }
+ if (nrChipHits>0) {
+ // make sure the chip is not flagged as dead
+ fHandler->SetDeadChip(GetEqNr(),hs,chip,kFALSE);
}
- UInt_t nrToRemove = tmpHand->GetNrDead();
- for (UInt_t index=0; index<nrToRemove; index++) {
- fHandler->UnSetDeadPixel(GetEqNr(),hs,chip,tmpHand->GetDeadColAtC(GetEqNr(),hs,chip,index),tmpHand->GetDeadRowAtC(GetEqNr(),hs,chip,index));
- }
- delete tmpHand;
-
-
if (nrPossiblyDeadPixels==0) {
// no need to see if we have enough statistics...
if (nrChipHits==0) {
nrPossiblyDeadChips++;
- //!!! deadChipHandler->SetDeadChip(GetEqNr(),hs,chip);
possiblyDead->Insert(hs,chip);
good=kFALSE;
// printf("%3d",good);
fNrEnoughStatChips++;
good=kTRUE;
// add dead pixels to handler
- fHandler->AddDeadFrom(deadPixelHandler);
+ for (UInt_t col=0; col<32; col++) {
+ for (UInt_t row=0; row<256; row++) {
+ UInt_t nrHits = fPhysObj->GetHits(hs,chip,col,row);
+ if (!fHandler->IsPixelNoisy(GetEqNr(),hs,chip,col,row)) {
+ // don't include noisy pixels
+ nrPixels++;
+ if (nrHits==0) {
+ fHandler->SetDeadPixel(GetEqNr(),hs,chip,col,row);
+ }
+ }
+ }
+ }
break;
}
}
}
} // for hs
- delete deadPixelHandler;
Int_t key,val;
+
// dead chips?
if (fNrEqHits>fMinNrEqHitsForDeadChips) {
while (possiblyDead->Pop(key,val)) {
- fHandler->ActivateChip(GetEqNr(),key,val,kFALSE);
+ fHandler->SetDeadChip(GetEqNr(),key,val,kFALSE);
}
fNrDeadChips+=nrPossiblyDeadChips;
}
handler->SetFileLocation(fileLoc.Data());
handler->ReadNoisyFromFiles();
for (Int_t module=0; module<240; module++) {
- ((AliITSCalibrationSPD*) spdEntryNoisy->At(module)) -> SetNrBad( handler->GetNrNoisy(module) );
+ ((AliITSCalibrationSPD*) spdEntryNoisy->At(module)) -> SetNrBadSingle( handler->GetNrNoisy(module) );
((AliITSCalibrationSPD*) spdEntryNoisy->At(module)) -> SetBadList( handler->GetNoisyArray(module) );
}
delete handler;
// Add dead from the copied FXS files
handOld->SetFileLocation(".");
handOld->ReadSilentFromFiles();
- for (Int_t module=0; module<240; module++) {
- ((AliITSCalibrationSPD*) spdEntryDead->At(module)) -> SetNrBad( handOld->GetNrSilent(module) );
- ((AliITSCalibrationSPD*) spdEntryDead->At(module)) -> SetBadList( handOld->GetSilentArray(module) );
+ for (UInt_t module=0; module<240; module++) {
+ AliITSCalibrationSPD* calibSPD = (AliITSCalibrationSPD*) spdEntryDead->At(module);
+ calibSPD->SetNrBad( handOld->GetNrDead(module) );
+ calibSPD->SetBadList( handOld->GetDeadArray(module) );
+ for (UInt_t chipIndex=0; chipIndex<5; chipIndex++) {
+ UInt_t eq,hs,chip,col,row;
+ AliITSRawStreamSPD::OfflineToOnline(module, chipIndex*32, 0, eq, hs, chip, col, row);
+ if (handOld->IsSilentChip(eq,hs,chip)) {
+ calibSPD->SetChipBad(chipIndex);
+ }
+ else {
+ calibSPD->UnSetChipBad(chipIndex);
+ }
+ }
}
delete handOld;
// Store the new calibration objects in OCDB
}
for (UInt_t eq=0; eq<20; eq++) {
fActiveEq[eq]=kFALSE;
+ for (UInt_t hs=0; hs<6; hs++) {
+ fActiveHS[eq][hs]=kFALSE;
+ for (UInt_t chip=0; chip<10; chip++) {
+ fActiveChip[eq][hs][chip]=kFALSE;
+ fEventCounterFull[eq][hs][chip] = -1;
+ }
+ }
}
NewEvent();
}
fFillOutOfSynch = kFALSE;
// set eq active and the participating half-staves (for access from outside this class),
- // set what number of chip headers/trailers to expect
+ // set what number of chip headers/trailers to expect (for the moment not used)
fActiveEq[ddlID]=kTRUE;
fExpectedHeaderTrailerCount = 0;
for (UInt_t hs=0; hs<6; hs++) {
if (fAdvancedErrorLog) fAdvLogger->ProcessError(kHSNumberErr,fDDLID,fEqPLBytesRead,fEqPLChipHeadersRead,errMess.Data());
fHalfStaveNr=0;
}
+ fActiveChip[fDDLID][fHalfStaveNr][fChipAddr]=kTRUE;
+ fEventCounterFull[fDDLID][fHalfStaveNr][fChipAddr] = eventCounter;
// translate ("online") ddl, hs, chip nr to ("offline") module id :
fModuleID = GetOfflineModuleFromOnline(fDDLID,fHalfStaveNr,fChipAddr);
}
fEqPLChipHeadersRead,fExpectedHeaderTrailerCount,ddlID);
AliError(errMess.Data());
fRawReader->AddMajorErrorLog(kHeaderCountErr,errMess.Data());
- if (fAdvancedErrorLog) fAdvLogger->ProcessError(kHeaderCountErr,ddlID,-1,-1,errMess.Data());
+ if (fAdvancedErrorLog) fAdvLogger->ProcessError(kHeaderCountErr,ddlID,fEqPLBytesRead,fEqPLChipHeadersRead,errMess.Data());
}
if (fEqPLChipTrailersRead != fExpectedHeaderTrailerCount) {
TString errMess = Form("Chip trailer count inconsistent %d != %d (expected) for ddl %d",
fEqPLChipTrailersRead,fExpectedHeaderTrailerCount,ddlID);
AliError(errMess.Data());
fRawReader->AddMajorErrorLog(kHeaderCountErr,errMess.Data());
- if (fAdvancedErrorLog) fAdvLogger->ProcessError(kTrailerCountErr,ddlID,-1,-1,errMess.Data());
+ if (fAdvancedErrorLog) fAdvLogger->ProcessError(kHeaderCountErr,ddlID,fEqPLBytesRead,fEqPLChipHeadersRead,errMess.Data());
}
}
//__________________________________________________________________________
else return "";
}
//__________________________________________________________________________
+Bool_t AliITSRawStreamSPD::IsActiveEq(UInt_t eq) const {
+ // returns if the eq is active (seen in data)
+ if (eq>=20) {
+ TString errMess = Form("eq = %d out of bounds. Return kFALSE.",eq);
+ AliError(errMess.Data());
+ return kFALSE;
+ }
+ return fActiveEq[eq];
+}
+//__________________________________________________________________________
+Bool_t AliITSRawStreamSPD::IsActiveHS(UInt_t eq, UInt_t hs) const {
+ // returns if the hs is active (info from block attr)
+ if (eq>=20 || hs>=6) {
+ TString errMess = Form("eq,hs = %d,%d out of bounds. Return kFALSE.",eq,hs);
+ AliError(errMess.Data());
+ return kFALSE;
+ }
+ return fActiveHS[eq][hs];
+}
+//__________________________________________________________________________
+Bool_t AliITSRawStreamSPD::IsActiveChip(UInt_t eq, UInt_t hs, UInt_t chip) const {
+ // returns if the chip is active (seen in data)
+ if (eq>=20 || hs>=6 || chip>=10) {
+ TString errMess = Form("eq,hs,chip = %d,%d,%d out of bounds. Return kFALSE.",eq,hs,chip);
+ AliError(errMess.Data());
+ return kFALSE;
+ }
+ return fActiveChip[eq][hs][chip];
+}
+//__________________________________________________________________________
Bool_t AliITSRawStreamSPD::GetHalfStavePresent(UInt_t hs) {
// Reads the half stave present status from the block attributes
// This is not really needed anymore (kept for now in case it is still used somewhere).
}
}
//__________________________________________________________________________
+Bool_t AliITSRawStreamSPD::IsEventCounterFullConsistent() const {
+ // checks if the event counter values are consistent within the event
+ Short_t reference = -1;
+ for (UInt_t eq=0; eq<20; eq++) {
+ if (IsActiveEq(eq)) {
+ for (UInt_t hs=0; hs<6; hs++) {
+ if (IsActiveHS(eq,hs)) {
+ for (UInt_t chip=0; chip<10; chip++) {
+ if (fEventCounterFull[eq][hs][chip]!=-1) {
+ if (reference==-1) reference = fEventCounterFull[eq][hs][chip];
+ if (fEventCounterFull[eq][hs][chip] != reference) return kFALSE;
+ }
+ }
+ }
+ }
+ }
+ }
+ return kTRUE;
+}
+//__________________________________________________________________________
+Short_t AliITSRawStreamSPD::GetEventCounterFullEq(UInt_t eq) const {
+ // if the eq is active; returns the event counter value
+ if (eq>=20) {
+ TString errMess = Form("eq (%d) out of bounds",eq);
+ AliError(errMess.Data());
+ return -1;
+ }
+ if (IsActiveEq(eq)) {
+ for (UInt_t hs=0; hs<6; hs++) {
+ if (IsActiveHS(eq,hs)) {
+ for (UInt_t chip=0; chip<10; chip++) {
+ if (fEventCounterFull[eq][hs][chip]!=-1) {
+ return fEventCounterFull[eq][hs][chip];
+ }
+ }
+ }
+ }
+ }
+ return -1;
+}
+//__________________________________________________________________________
+Short_t AliITSRawStreamSPD::GetEventCounterFullHS(UInt_t eq, UInt_t hs) const {
+ // if the eq,hs is active; returns the event counter value
+ if (eq>=20 || hs>=6) {
+ TString errMess = Form("eq,hs (%d,%d) out of bounds",eq,hs);
+ AliError(errMess.Data());
+ return -1;
+ }
+ if (IsActiveEq(eq)) {
+ if (IsActiveHS(eq,hs)) {
+ for (UInt_t chip=0; chip<10; chip++) {
+ if (fEventCounterFull[eq][hs][chip]!=-1) {
+ return fEventCounterFull[eq][hs][chip];
+ }
+ }
+ }
+ }
+ return -1;
+}
+//__________________________________________________________________________
+Short_t AliITSRawStreamSPD::GetEventCounterFullChip(UInt_t eq, UInt_t hs, UInt_t chip) const {
+ // if the eq,hs,chip is active; returns the event counter value
+ if (eq>=20 || hs>=6 || chip>=10) {
+ TString errMess = Form("eq,hs,chip (%d,%d,%d) out of bounds",eq,hs,chip);
+ AliError(errMess.Data());
+ return -1;
+ }
+ if (IsActiveEq(eq)) {
+ if (IsActiveHS(eq,hs)) {
+ if (IsActiveChip(eq,hs,chip)) {
+ return fEventCounterFull[eq][hs][chip];
+ }
+ }
+ }
+ return -1;
+}
+//__________________________________________________________________________
Bool_t AliITSRawStreamSPD::GetHhalfStaveScanned(UInt_t hs) const {
if (hs<6) return (Bool_t)((fCalHeadWord[0]>>(6+hs)) & (0x00000001));
else return kFALSE;
static UInt_t GetOfflineColFromOnline(UInt_t eqId, UInt_t hs, UInt_t chip, UInt_t col);
static UInt_t GetOfflineRowFromOnline(UInt_t eqId, UInt_t hs, UInt_t chip, UInt_t row);
- Int_t GetEventCounter() {return fEventCounter;}
+ Int_t GetEventCounter() const {return fEventCounter;} // get last read event counter value
+ Short_t GetEventCounterFullEq(UInt_t eq) const;
+ Short_t GetEventCounterFullHS(UInt_t eq, UInt_t hs) const;
+ Short_t GetEventCounterFullChip(UInt_t eq, UInt_t hs, UInt_t chip) const;
+ Bool_t IsEventCounterFullConsistent() const;
- Bool_t IsActiveEq(UInt_t eq) const {return fActiveEq[eq];}
- Bool_t IsActiveHS(UInt_t eq, UInt_t hs) const {return fActiveHS[eq][hs];}
+ Bool_t IsActiveEq(UInt_t eq) const;
+ Bool_t IsActiveHS(UInt_t eq, UInt_t hs) const;
+ Bool_t IsActiveChip(UInt_t eq, UInt_t hs, UInt_t chip) const;
Bool_t GetHalfStavePresent(UInt_t hs);
void CheckHeaderAndTrailerCount(Int_t ddlID);
Int_t fEventCounter; // chip event counter
+ Short_t fEventCounterFull[20][6][10]; // chip event counter
+
UShort_t fChipAddr; // chip nr
UShort_t fHalfStaveNr; // half stave nr
UInt_t fCol; // chip column nr
Bool_t fActiveEq[20]; // which equipments are active (found in data)
Bool_t fActiveHS[20][6]; // which half-staves are active (blockattribute bits)
+ Bool_t fActiveChip[20][6][10]; // which chips are active (found in data)
ClassDef(AliITSRawStreamSPD, 0) // class for reading ITS SPD raw digits
};
for (UInt_t eq=0; eq<20; eq++) {
fTextTmp[eq] = new TGText();
fNEvents[eq] = 0;
- fPayloadSizeSet[eq] = kFALSE;
fByteOffset[eq] = 0;
fSuppressEq[eq] = kFALSE;
for (UInt_t err=0; err<kNrErrorCodes; err++) {
fErrEventCounter[err][eq] = logger.fErrEventCounter[err][eq];
}
fNEvents[eq] = logger.fNEvents[eq];
- fPayloadSize[eq] = logger.fPayloadSize[eq];
- fPayloadSizeSet[eq] = logger.fPayloadSizeSet[eq];
fByteOffset[eq] = logger.fByteOffset[eq];
fSuppressEq[eq] = logger.fSuppressEq[eq];
}
for (UInt_t eq=0; eq<20; eq++) {
for (UInt_t err=0; err<kNrErrorCodes; err++) {
fConsErrEvent[err][eq] = new TGraph(*logger.fConsErrEvent[err][eq]);
- fConsErrPos[err][eq] = new TH1F(*logger.fConsErrPos[err][eq]);
+ fConsErrPos[err][eq] = new TGraph(*logger.fConsErrPos[err][eq]);
}
fConsErrType[eq] = new TH1F(*logger.fConsErrType[eq]);
fConsErrFraction[eq] = new TH1F(*logger.fConsErrFraction[eq]);
fErrEventCounter[err][eq] = logger.fErrEventCounter[err][eq];
}
fNEvents[eq] = logger.fNEvents[eq];
- fPayloadSize[eq] = logger.fPayloadSize[eq];
- fPayloadSizeSet[eq] = logger.fPayloadSizeSet[eq];
fByteOffset[eq] = logger.fByteOffset[eq];
fSuppressEq[eq] = logger.fSuppressEq[eq];
}
for (UInt_t eq=0; eq<20; eq++) {
for (UInt_t err=0; err<kNrErrorCodes; err++) {
fConsErrEvent[err][eq] = new TGraph(*logger.fConsErrEvent[err][eq]);
- fConsErrPos[err][eq] = new TH1F(*logger.fConsErrPos[err][eq]);
+ fConsErrPos[err][eq] = new TGraph(*logger.fConsErrPos[err][eq]);
}
fConsErrType[eq] = new TH1F(*logger.fConsErrType[eq]);
fConsErrFraction[eq] = new TH1F(*logger.fConsErrFraction[eq]);
for (UInt_t err=0; err<kNrErrorCodes; err++) {
fConsErrEvent[err][eq]=new TGraph();
+ fConsErrPos[err][eq]=new TGraph();
+ fConsErrPosTMP[err][eq]=new TGraph();
fErrEventCounter[err][eq] = 0;
- histName = Form("ConsErrPos %d %d",err,eq);
- histTitle = Form("Position in event, eq %d , error code %d",eq,err);
- fConsErrPos[err][eq]=new TH1F(histName.Data(),histTitle.Data(),200,0,100);
- fConsErrPos[err][eq]->SetXTitle("Position [%]");
- fConsErrPos[err][eq]->SetYTitle("Nr Errors");
+ fErrPosCounter[err][eq] = 0;
+ fErrPosTMPCounter[err][eq] = 0;
}
}
}
for (UInt_t err=0; err<kNrErrorCodes; err++) {
delete fConsErrEvent[err][eq];
delete fConsErrPos[err][eq];
+ delete fConsErrPosTMP[err][eq];
}
}
}
fConsErrType[eq]->Reset();
fConsErrFraction[eq]->Reset();
fNEvents[eq] = 0;
- fPayloadSizeSet[eq] = kFALSE;
for (UInt_t err=0; err<kNrErrorCodes; err++) {
fNErrors[err][eq] = 0;
delete fConsErrEvent[err][eq];
+ delete fConsErrPos[err][eq];
+ delete fConsErrPosTMP[err][eq];
fErrEventCounter[err][eq] = 0;
+ fErrPosCounter[err][eq] = 0;
+ fErrPosTMPCounter[err][eq] = 0;
fConsErrEvent[err][eq] = new TGraph();
- fConsErrPos[err][eq]->Reset();
+ fConsErrPos[err][eq] = new TGraph();
+ fConsErrPosTMP[err][eq] = new TGraph();
}
}
}
fNErrors[errorCode][eq]++;
if (errorCode!=kTotal) fNErrors[kTotal][eq]++;
- if (fPayloadSizeSet[eq]) {
- fConsErrPos[errorCode][eq]->Fill(100.*bytesRead/fPayloadSize[eq]);
- if (errorCode!=kTotal) fConsErrPos[kTotal][eq]->Fill(100.*bytesRead/fPayloadSize[eq]);
+ if (bytesRead>=0) {
+ fConsErrPosTMP[errorCode][eq]->SetPoint(fErrPosTMPCounter[errorCode][eq],0,bytesRead+fByteOffset[eq]);
+ fErrPosTMPCounter[errorCode][eq]++;
+ if (errorCode!=kTotal) {
+ fConsErrPosTMP[kTotal][eq]->SetPoint(fErrPosTMPCounter[kTotal][eq],0,bytesRead+fByteOffset[eq]);
+ fErrPosTMPCounter[kTotal][eq]++;
+ }
}
TString msg;
fErrEventCounter[err][eq]++;
fConsErrFraction[eq]->Fill(err);
}
+ for (UInt_t pind=0; pind<fErrPosTMPCounter[err][eq]; pind++) {
+ Double_t x,y;
+ fConsErrPosTMP[err][eq]->GetPoint(pind,x,y);
+ fConsErrPos[err][eq]->SetPoint(fErrPosCounter[err][eq],eventNum,y);
+ fErrPosCounter[err][eq]++;
+ }
}
+
fNEvents[eq]++;
if (fNErrors[kTotal][eq]>0) {
msg = Form("*** Event %d , Eq %d: ***",eventNum,eq);
fText->AddText(fTextTmp[eq]);
fText->InsLine(fText->RowCount()," ");
}
- fPayloadSizeSet[eq]=kFALSE;
fByteOffset[eq]=0;
fTextTmp[eq]->Clear();
for (UInt_t err=0; err<kNrErrorCodes; err++) {
fNErrors[err][eq]=0;
}
}
-}
-//________________________________________________________________________________________________
-void AliITSRawStreamSPDErrorLog::SetPayloadSize(UInt_t eq, UInt_t size) {
- // set the payload size for this event
- if (eq<20) {
- fPayloadSize[eq]=size;
- fPayloadSizeSet[eq]=kTRUE;
- }
- else {
- AliWarning(Form("Equipment number (%d) out of range",eq));
+
+ for (UInt_t eq=0; eq<20; eq++) {
+ for (UInt_t err=0; err<kNrErrorCodes; err++) {
+ delete fConsErrPosTMP[err][eq];
+ fErrPosTMPCounter[err][eq] = 0;
+ fConsErrPosTMP[err][eq] = new TGraph();
+ }
}
}
//________________________________________________________________________________________________
}
}
//________________________________________________________________________________________________
-TH1F* AliITSRawStreamSPDErrorLog::GetConsErrPos(UInt_t errorCode, UInt_t eq) {
+TGraph* AliITSRawStreamSPDErrorLog::GetConsErrPos(UInt_t errorCode, UInt_t eq) {
// returns a pointer to the histogram
if (errorCode<kNrErrorCodes && eq<20) return fConsErrPos[errorCode][eq];
else {
UInt_t GetNrErrorsTotal(UInt_t errorCode, UInt_t eq);
UInt_t GetNrErrorsTotalAllEq(UInt_t errorCode);
- void SetPayloadSize(UInt_t eq, UInt_t size);
void SetByteOffset(UInt_t eq, Int_t size);
void SuppressErrorMessages(UInt_t errorCode, Bool_t suppr = kTRUE);
void SuppressErrorEq(UInt_t eq, Bool_t suppr = kTRUE);
static UInt_t GetNrErrorCodes(){return kNrErrorCodes;}
TGraph* GetConsErrEvent(UInt_t errorCode, UInt_t eq);
+ TGraph* GetConsErrPos(UInt_t errorCode, UInt_t eq);
TH1F* GetConsErrType(UInt_t eq);
TH1F* GetConsErrFraction(UInt_t eq); // NB!!! Take care of deleting returned object later
TH1F* GetConsErrFractionUnScaled(UInt_t eq);
- TH1F* GetConsErrPos(UInt_t errorCode, UInt_t eq);
TGText* GetText() {return fText;}
private:
Int_t fNErrors[kNrErrorCodes][20]; // number of errors for this event, for each code and eq
UInt_t fNEvents[20]; // number of events used, for each eq
- UInt_t fPayloadSize[20]; // size of payload for this event, for each eq
- Bool_t fPayloadSizeSet[20]; // was the payload size set for this eq?
UInt_t fErrEventCounter[kNrErrorCodes][20]; // event counter used when filling graph
+ UInt_t fErrPosCounter[kNrErrorCodes][20]; // event counter used when filling graph
+ UInt_t fErrPosTMPCounter[kNrErrorCodes][20]; // event counter used when filling graph
Int_t fByteOffset[20]; // offset: how many bytes in the equipment header, for each eq
Bool_t fSuppressMess[kNrErrorCodes]; // do we suppress error messages for a specific error code?
Bool_t fSuppressEq[20]; // do we suppress error messages for a specific eq?
TGraph *fConsErrEvent[kNrErrorCodes][20]; // graphs to display number of errors found in each event
+ TGraph *fConsErrPos[kNrErrorCodes][20]; // graphs to display number of bytes read for each error and event
+ TGraph *fConsErrPosTMP[kNrErrorCodes][20]; // temporary, to fill tgraph above for event
TH1F *fConsErrType[20]; // histogram of how many errors for each error code
TH1F *fConsErrFraction[20]; // histogram of rate of events with errors for each error code
- TH1F *fConsErrPos[kNrErrorCodes][20]; // histogram of where in payload the errors occur
TGText *fText; // text buffer for all events analyzed so far
TGText *fTextTmp[20]; // text buffer for this event (defined error codes)
void InitHistograms();
void DeleteHistograms() const;
- ClassDef(AliITSRawStreamSPDErrorLog, 1);
+ ClassDef(AliITSRawStreamSPDErrorLog, 2);
};
#endif
#include "AliLog.h"
#include <iostream>
#include <fstream>
+//#include <time.h>
#include <TROOT.h>
#include <TPluginManager.h>
#include <TObjArray.h>
+#include <TObjString.h>
#include <TString.h>
+
int main(int argc, char **argv) {
if (argc<2) {
printf("Wrong number of arguments\n");
paramsFile >> paramN;
if (paramsFile.eof()) break;
paramsFile >> paramV;
- TString* paramNS = new TString(paramN);
- TString* paramVS = new TString(paramV);
- paramNames.AddAtAndExpand((TObject*)paramNS,nrTuningParams);
- paramVals.AddAtAndExpand((TObject*)paramVS,nrTuningParams);
+ paramNames.AddAtAndExpand(new TObjString(paramN),nrTuningParams);
+ paramVals.AddAtAndExpand(new TObjString(paramV),nrTuningParams);
nrTuningParams++;
if (paramsFile.eof()) break;
}
}
}
// for (UInt_t i=0; i<nrTuningParams; i++) {
- // printf("Entry %d: N=%s , V=%s\n",i,((TString*)paramNames.At(i))->Data(),((TString*)paramVals.At(i))->Data());
+ // // printf("Entry %d: N=%s , V=%s\n",i,((TString*)paramNames.At(i))->Data(),((TString*)paramVals.At(i))->Data());
+ // printf("Entry %d: N=%s , V=%s\n",i,((TObjString*)paramNames.At(i))->GetString().Data(),((TObjString*)paramVals.At(i))->GetString().Data());
// }
// Read silent=dead+inactive info from previous calibrations
handler->SetFileLocation(saveDirDead);
handler->ReadSilentFromFiles();
-//!!! // start by deactivating all eq - should then be activated when found in raw data
-//!!! for (UInt_t eq=0; eq<20; eq++) {
-//!!! handler->ActivateEq(eq,kFALSE);
-//!!! }
+ printf("Nr dead pixels before: %d\n",handler->GetNrDead());
// container objects
AliITSOnlineSPDphys *physObj[20];
Bool_t bPhysInit[20];
- for (UInt_t eqId=0; eqId<20; eqId++) {
- physObj[eqId]=NULL;
- bPhysInit[eqId]=kFALSE;
+ for (UInt_t eq=0; eq<20; eq++) {
+ physObj[eq]=NULL;
+ bPhysInit[eq]=kFALSE;
}
while (str->Next()) {
- Int_t eqId = reader->GetDDLID();
+ Int_t eq = reader->GetDDLID();
// check that this hs is active in handler object
- if (!(handler->IsActiveEq(eqId))) {
- printf("Warning: Found Eq (%d) , previously inactive in this run!\n",eqId);
- handler->ActivateEq(eqId);
+ if (!(handler->IsActiveEq(eq))) {
+ printf("Info: Found Eq (%d) , previously inactive\n",eq);
+ handler->ActivateEq(eq);
}
- if (eqId>=0 && eqId<20) {
- if (!bPhysInit[eqId]) { // this code is duplicated for the moment... (see also below)
- TString fileName = Form("%s/SPDphys_run_%d_eq_%d.root",saveDirNoisyRef,runNr,eqId);
- physObj[eqId] = new AliITSOnlineSPDphys(fileName.Data());
- physObj[eqId]->AddRunNr(runNr);
- physObj[eqId]->SetEqNr(eqId);
- bPhysInit[eqId]=kTRUE;
+ if (eq>=0 && eq<20) {
+ if (!bPhysInit[eq]) { // this code is duplicated for the moment... (see also below)
+ TString fileName = Form("%s/SPDphys_run_%d_eq_%d.root",saveDirNoisyRef,runNr,eq);
+ physObj[eq] = new AliITSOnlineSPDphys(fileName.Data());
+ physObj[eq]->AddRunNr(runNr);
+ physObj[eq]->SetEqNr(eq);
+ bPhysInit[eq]=kTRUE;
}
UInt_t hs = str->GetHalfStaveNr();
// check that this hs is active in handler object
- if (!(handler->IsActiveHS(eqId,hs))) {
- printf("Warning: Found HS (%d,%d) , previously inactive in this run!\n",eqId,hs);
- handler->ActivateHS(eqId,hs);
+ if (!(handler->IsActiveHS(eq,hs))) {
+ printf("Info: Found HS (%d,%d) , previously inactive\n",eq,hs);
+ handler->ActivateHS(eq,hs);
}
UInt_t chip = str->GetChipAddr();
// check that this chip is active in handler object
- if (!(handler->IsActiveChip(eqId,hs,chip))) {
- printf("Info: Found Chip (%d,%d,%d) , inactive in previous run.\n",eqId,hs,chip);
- handler->ActivateChip(eqId,hs,chip);
+ if (!(handler->IsActiveChip(eq,hs,chip))) {
+ printf("Info: Found Chip (%d,%d,%d) , previously inactive\n",eq,hs,chip);
+ handler->ActivateChip(eq,hs,chip);
}
- physObj[eqId]->IncrementHits(hs,chip,str->GetChipCol(),str->GetChipRow());
+ physObj[eq]->IncrementHits(hs,chip,str->GetChipCol(),str->GetChipRow());
}
}
- // check which eq and hs are active for first event only
+ // check which eq and hs are active, for first event only
if (eventNr==0) {
- for (UInt_t eqId=0; eqId<20; eqId++) {
+ for (UInt_t eq=0; eq<20; eq++) {
// activate Eq and HSs in handler object
- if (str->IsActiveEq(eqId)) {
- handler->ActivateEq(eqId);
+ if (str->IsActiveEq(eq)) {
+ handler->ActivateEq(eq);
for (UInt_t hs=0; hs<6; hs++) {
- handler->ActivateHS(eqId,hs,str->IsActiveHS(eqId,hs));
+ if (str->IsActiveHS(eq,hs)) {
+ handler->ActivateHS(eq,hs);
+ for (UInt_t chip=0; chip<10; chip++) {
+ if (str->IsActiveChip(eq,hs,chip)) {
+ handler->ActivateChip(eq,hs,chip);
+ }
+ else {
+ handler->ActivateChip(eq,hs,chip,kFALSE);
+ }
+ }
+ }
+ else {
+ handler->ActivateHS(eq,hs,kFALSE);
+ }
}
- if (!bPhysInit[eqId]) { // this code is duplicated for the moment... (see also above)
- TString fileName = Form("%s/SPDphys_run_%d_eq_%d.root",saveDirNoisyRef,runNr,eqId);
- physObj[eqId] = new AliITSOnlineSPDphys(fileName.Data());
- physObj[eqId]->AddRunNr(runNr);
- physObj[eqId]->SetEqNr(eqId);
- bPhysInit[eqId]=kTRUE;
+ if (!bPhysInit[eq]) { // this code is duplicated for the moment... (see also above)
+ TString fileName = Form("%s/SPDphys_run_%d_eq_%d.root",saveDirNoisyRef,runNr,eq);
+ physObj[eq] = new AliITSOnlineSPDphys(fileName.Data());
+ physObj[eq]->AddRunNr(runNr);
+ physObj[eq]->SetEqNr(eq);
+ bPhysInit[eq]=kTRUE;
}
}
else {
- handler->ActivateEq(eqId,kFALSE);
+ handler->ActivateEq(eq,kFALSE);
}
}
}
// ********* STEP 2: Analyze phys container files. ************************************************
+ // time_t timeStamp = time(NULL);
+ // printf("*** Start step2 , %d\n",time(NULL) - timeStamp);
+
// clear noisyToFXS dir:
TString command;
command = Form("cd %s; rm -f *",saveDirNoisyToFXS);
// configure analyzer with tuning parameters etc:
for (UInt_t i=0; i<nrTuningParams; i++) {
- noisyAnalyzer->SetParam(((TString*)paramNames.At(i))->Data(),((TString*)paramVals.At(i))->Data());
+ noisyAnalyzer->SetParam(((TObjString*)paramNames.At(i))->GetString().Data(),((TObjString*)paramVals.At(i))->GetString().Data());
}
printf("SPD phys STEP 2: Noisy search for eq %d\n",eq);
}
// *** *** *** end loop over equipments (eq_id)
- printf("Noisy search finished. %d noisy pixels found. %d chips (%d) had enough statistics.\n",
- handler->GetNrNoisy(),nrEnoughStatNoisy,nrEqActiveNoisy*60);
+ printf("Noisy search finished. %d noisy pixels found. %d chips had enough statistics.\n",
+ handler->GetNrNoisy(),nrEnoughStatNoisy);
handler->SetFileLocation(saveDirNoisyToFXS);
handler->WriteNoisyToFiles();
-
UInt_t nrEnoughStatChips = 0;
UInt_t nrDeadChips = 0;
UInt_t nrInefficientChips = 0;
deadAnalyzer->GetEqNr(),eq);
}
delete deadAnalyzer;
- //!!! nrDeadChips+=60; // since this eq is inactive...
+ nrDeadChips+=60; // since this eq is inactive...
continue;
}
// configure analyzer with tuning parameters etc:
for (UInt_t i=0; i<nrTuningParams; i++) {
- deadAnalyzer->SetParam(((TString*)paramNames.At(i))->Data(),((TString*)paramVals.At(i))->Data());
+ deadAnalyzer->SetParam(((TObjString*)paramNames.At(i))->GetString().Data(),((TObjString*)paramVals.At(i))->GetString().Data());
}
printf("SPD phys STEP 2: Dead search for eq %d\n",eq);
delete deadAnalyzer;
+
#ifndef SPD_DA_OFF
daqDA_progressReport((unsigned int)(50+(eq+1)*2.5));
#else
}
// *** *** *** end loop over equipments (eq_id)
+
+
- printf("Dead search finished. %d dead pixels in total.\n%d chips (%d) had enough statistics. %d chips were dead. %d chips were inefficient.\n",handler->GetNrDead(),nrEnoughStatChips,nrEqActiveDead*60,nrDeadChips,nrInefficientChips);
+ printf("Dead search finished.\n");
+ printf("%d single dead pixels , %d dead or inactive pixels in total.\n",handler->GetNrDead(),handler->GetNrSilent());
+ printf("%d chips had enough statistics. %d chips are dead. %d chips are inefficient.\n",nrEnoughStatChips,nrDeadChips,nrInefficientChips);
handler->SetFileLocation(saveDirDead);
handler->WriteSilentToFilesAlways();
handler->SetFileLocation(saveDirDeadToFXS);
// send (dead) reference data for this run to FXS - only if there is no chip in category "needsMoreStat"
- if (nrEnoughStatChips+nrDeadChips+nrInefficientChips == nrEqActiveDead*60) {
+ if (nrEnoughStatChips+nrDeadChips+nrInefficientChips == 1200) {
printf("Dead calibration is complete.\n"); // calibration is complete
printf("Preparing dead reference data\n");
// send reference data for dead pixels to FXS
}
+
// send (noisy) reference data for this run to FXS
printf("Preparing noisy reference data\n");
TString tarFiles = "";
idsFXSfile << Form("%s\n",id.Data());
+
+
// send dead pixels to FXS
printf("Preparing dead files\n");
// send a tared file of all the dead files
idsFXSfile << Form("%s\n",id.Data());
+
// send noisy pixels to FXS
if (handler->GetNrNoisy()>0) { // there must be at least one file created
printf("Preparing noisy files\n");
}
+
// send ids file to FXS
idsFXSfile.close();
id = "SPD_id_list";
delete handler;
+ // printf("*** End step2 , %d\n",time(NULL) - timeStamp);
+
return 0;
}
#include <TROOT.h>
#include <TPluginManager.h>
#include <TObjArray.h>
+#include <TObjString.h>
#include <TString.h>
#include <TFitter.h>
paramsFile >> paramN;
if (paramsFile.eof()) break;
paramsFile >> paramV;
- TString* paramNS = new TString(paramN);
- TString* paramVS = new TString(paramV);
- paramNames.AddAtAndExpand((TObject*)paramNS,nrTuningParams);
- paramVals.AddAtAndExpand((TObject*)paramVS,nrTuningParams);
+ paramNames.AddAtAndExpand(new TObjString(paramN),nrTuningParams);
+ paramVals.AddAtAndExpand(new TObjString(paramV),nrTuningParams);
nrTuningParams++;
if (paramsFile.eof()) break;
}
}
}
// for (UInt_t i=0; i<nrTuningParams; i++) {
- // printf("Entry %d: N=%s , V=%s\n",i,((TString*)paramNames.At(i))->Data(),((TString*)paramVals.At(i))->Data());
+ // // printf("Entry %d: N=%s , V=%s\n",i,((TString*)paramNames.At(i))->Data(),((TString*)paramVals.At(i))->Data());
+ // printf("Entry %d: N=%s , V=%s\n",i,((TObjString*)paramNames.At(i))->GetString().Data(),((TObjString*)paramVals.At(i))->GetString().Data());
// }
// perm noisy list:
// configure analyzer with tuning parameters etc:
for (UInt_t i=0; i<nrTuningParams; i++) {
- analyzer->SetParam(((TString*)paramNames.At(i))->Data(),((TString*)paramVals.At(i))->Data());
+ analyzer->SetParam(((TObjString*)paramNames.At(i))->GetString().Data(),((TObjString*)paramVals.At(i))->GetString().Data());
}
UInt_t type = analyzer->GetType();
printf("DA finished.\n");
return 0;
-}
\ No newline at end of file
+}