- /// Combine two status containers into one, shifting store2 status bits
- /// to the left by binShift before making an OR with store1.
-
- TStopwatch timer;
- timer.Start(kTRUE);
-
- AliMUONV2DStore* combined = static_cast<AliMUONV2DStore*>(store1.Clone());
-
- AliMUONVDataIterator* it = store1.Iterator();
- AliMUONObjectPair* pair;
-
- while ( ( pair = static_cast<AliMUONObjectPair*>(it->Next()) ) )
- {
- AliMpIntPair* ip = static_cast<AliMpIntPair*>(pair->First());
- Int_t detElemId = ip->GetFirst();
- Int_t manuId = ip->GetSecond();
- AliMUONVCalibParam* param1 = static_cast<AliMUONVCalibParam*>(store1.Get(detElemId,manuId));
- if (!param1)
- {
- AliError(Form("Oups. Could not get statuses for store1 for DE %d ManuId %d !!!",
- detElemId,manuId));
- delete combined;
- combined = 0x0;
- break;
- }
- AliMUONVCalibParam* param2 = static_cast<AliMUONVCalibParam*>(store2.Get(detElemId,manuId));
- if (!param2)
- {
- AliError(Form("Oups. Could not get statuses for store2 for DE %d ManuId %d",
- detElemId,manuId));
- delete combined;
- combined = 0x0;
- break;
- }
- AliMUONVCalibParam* paramCombined = static_cast<AliMUONVCalibParam*>(combined->Get(detElemId,manuId));
- if (!paramCombined)
- {
- AliError(Form("Oups. Could not get statuses for combined for DE %d ManuId %d",
- detElemId,manuId));
- delete combined;
- combined = 0x0;
- break;
- }
-
- for ( Int_t manuChannel = 0; manuChannel < param1->Size(); ++manuChannel )
- {
- if ( AliMpManuList::DoesChannelExist(detElemId, manuId, manuChannel) )
- {
- Int_t status1(param1->ValueAsInt(manuChannel));
- Int_t status2(param2->ValueAsInt(manuChannel));
-
- Int_t status = status1 | (status2 << binShift);
-
- paramCombined->SetValueAsInt(manuChannel,0,status);
- }
- }
- }
-
- delete it;
+ /// return a human readable version of the integer status
+ Int_t pedStatus;
+ Int_t gainStatus;
+ Int_t hvStatus;
+
+ DecodeStatus(status,pedStatus,hvStatus,gainStatus);
+
+// /// Gain status
+// enum EGainStatus
+// {
+// kGainOK = 0,
+// kGainA0TooLow = (1<<1),
+// kGainA0TooHigh = (1<<2),
+// kGainA1TooLow = (1<<3),
+// kGainA1TooHigh = (1<<4),
+// kGainThresTooLow = (1<<5),
+// kGainThresTooHigh = (1<<6),
+//
+// kGainMissing = kMissing // please always use last bit for meaning "missing"
+// };
+//
+// /// Pedestal status
+// enum EPedestalStatus
+// {
+// kPedOK = 0,
+// kPedMeanZero = (1<<1),
+// kPedMeanTooLow = (1<<2),
+// kPedMeanTooHigh = (1<<3),
+// kPedSigmaTooLow = (1<<4),
+// kPedSigmaTooHigh = (1<<5),
+//
+// kPedMissing = kMissing // please always use last bit for meaning "missing"
+// };
+//
+ TString s("PED ");
+
+ if ( pedStatus == 0 ) s+= " OK";
+ if ( pedStatus & kPedMeanZero ) s += " Mean is Zero. ";
+ if ( pedStatus & kPedMeanTooLow ) s += " Mean Too Low. ";
+ if ( pedStatus & kPedMeanTooHigh ) s += " Mean Too High. ";
+ if ( pedStatus & kPedSigmaTooLow ) s += " Sigma Too Low. ";
+ if ( pedStatus & kPedSigmaTooHigh ) s += " Sigma Too High. ";
+ if ( pedStatus & kPedMissing ) s += " is missing.";
+
+// /// HV Error
+// enum EHVError
+// {
+// kHVOK = 0,
+// kHVError = (1<<0),
+// kHVTooLow = (1<<1),
+// kHVTooHigh = (1<<2),
+// kHVChannelOFF = (1<<3),
+// kHVSwitchOFF = (1<<4),
+//
+// kHVMissing = kMissing // please always use last bit for meaning "missing"
+// };
+
+ return s;
+}
+
+//_____________________________________________________________________________
+Int_t
+AliMUONPadStatusMaker::BuildStatus(Int_t pedStatus,
+ Int_t hvStatus,
+ Int_t gainStatus)
+{
+ /// Build a complete status from specific parts (ped,hv,gain)