AliRoot Core  3abf5b4 (3abf5b4)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONPadStatusMaker.cxx
Go to the documentation of this file.
1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15 
16 // $Id$
17 
18 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
26 
27 #include "AliMUONPadStatusMaker.h"
28 
29 #include "AliMUON2DMap.h"
31 #include "AliMUONCalibParamNI.h"
32 #include "AliMUONCalibrationData.h"
33 #include "AliMUONLogger.h"
34 #include "AliMUONRecoParam.h"
35 #include "AliMUONStringIntMap.h"
36 #include "AliMUONTrackerData.h"
37 #include "AliMUONVCalibParam.h"
38 
39 #include "AliMpArea.h"
40 #include "AliMpArrayI.h"
41 #include "AliMpBusPatch.h"
42 #include "AliMpCDB.h"
43 #include "AliMpConstants.h"
44 #include "AliMpDDLStore.h"
45 #include "AliMpDEManager.h"
46 #include "AliMpDetElement.h"
47 #include "AliMpDCSNamer.h"
48 #include "AliMpManuIterator.h"
49 #include "AliMpManuUID.h"
50 
51 #include "AliCDBEntry.h"
52 #include "AliCDBManager.h"
53 #include "AliCodeTimer.h"
54 #include "AliDCSValue.h"
55 #include "AliLog.h"
56 
57 #include <Riostream.h>
58 #include <TArrayI.h>
59 #include <TExMap.h>
60 #include <TFile.h>
61 #include <TKey.h>
62 #include <TMap.h>
63 #include <TROOT.h>
64 #include <TString.h>
65 #include <TSystem.h>
66 
67 using std::cout;
68 using std::endl;
72 
73 //_____________________________________________________________________________
75 : fkCalibrationData(calibData),
76 fPedMeanLimits(0,4095),
77 fPedSigmaLimits(0,4095),
78 fManuOccupancyLimits(0,1.0),
79 fBuspatchOccupancyLimits(0,1.0),
80 fDEOccupancyLimits(0,1.0),
81 fStatus(new AliMUON2DMap(true)),
82 fHV(0x0),
83 fPedestals(calibData.Pedestals()),
84 fTrackerData(0x0),
85 fConfig(calibData.Config())
86 {
88  if ( calibData.OccupancyMap() )
89  {
91  fTrackerData = new AliMUONTrackerData("OCC","OCC",*(calibData.OccupancyMap()));
92  }
93  if ( calibData.HV() )
94  {
96  fHV = new TExMap;
97  }
98 
99  SetHVLimit(-1,0.0);
100 }
101 
102 //_____________________________________________________________________________
104 {
106 
107  delete fStatus;
108  delete fHV;
109  delete fTrackerData;
110 }
111 
112 //_____________________________________________________________________________
113 TString
115 {
117 
118  if ( status == 0 )
119  {
120  return "Brave New World";
121  }
122 
123  Int_t pedStatus;
124  Int_t lvStatus;
125  Int_t hvStatus;
126  Int_t occStatus;
127 
128  DecodeStatus(status,pedStatus,hvStatus,lvStatus,occStatus);
129 
130  TString s;
131 
132  if ( pedStatus & kPedMeanZero ) s += "& Ped Mean is Zero ";
133  if ( pedStatus & kPedMeanTooLow ) s += "& Ped Mean Too Low ";
134  if ( pedStatus & kPedMeanTooHigh ) s += "& Ped Mean Too High ";
135  if ( pedStatus & kPedSigmaTooLow ) s += "& Ped Sigma Too Low ";
136  if ( pedStatus & kPedSigmaTooHigh ) s += "& Ped Sigma Too High ";
137  if ( pedStatus & kPedMissing ) s += "& Ped is missing ";
138 
139  if ( lvStatus & kLVTooLow ) s+="& LV is Too Low ";
140  if ( lvStatus & kLVMissing ) s+="& LV is missing ";
141 
142  if ( hvStatus & kHVError ) s+="& HV is on error ";
143  if ( hvStatus & kHVTooLow ) s+="& HV is Too Low ";
144  if ( hvStatus & kHVTooHigh ) s+="& HV is Too High ";
145  if ( hvStatus & kHVChannelOFF ) s+="& HV has channel OFF ";
146  if ( hvStatus & kHVSwitchOFF ) s+="& HV has switch OFF ";
147  if ( hvStatus & kHVMissing ) s+="& HV is missing ";
148 
149  if ( occStatus & kManuOccupancyTooHigh ) s+="& manu occupancy too high ";
150  if ( occStatus & kManuOccupancyTooLow ) s+="& manu occupancy too low ";
151  if ( occStatus & kBusPatchOccupancyTooHigh ) s+="& bus patch occupancy too high ";
152  if ( occStatus & kBusPatchOccupancyTooLow ) s+="& bus patch occupancy too low ";
153  if ( occStatus & kDEOccupancyTooHigh ) s+="& DE occupancy too high ";
154  if ( occStatus & kDEOccupancyTooLow ) s+="& DE occupancy too low ";
155 
156  if ( occStatus & kBusPatchRemovedByPAR ) s+="& BusPatch removed during PAR";
157 
158  if ( s[0] == '&' ) s[0] = ' ';
159 
160  return s;
161 }
162 
163 //_____________________________________________________________________________
164 TString
166 {
168 
169  TString s(AsString(mask));
170 
171  s.ReplaceAll("&","|");
172 
173  return s;
174 }
175 
176 //_____________________________________________________________________________
177 Int_t
179  Int_t hvStatus,
180  Int_t lvStatus,
181  Int_t occStatus)
182 {
184 
185  return ( hvStatus & 0xFF ) | ( ( pedStatus & 0xFF ) << 8 ) |
186  ( ( lvStatus & 0xFF ) << 16 ) |
187  ( ( occStatus & 0xFF ) << 24 ) ;
188 }
189 
190 //_____________________________________________________________________________
192  Int_t manuId) const
193 {
196 
197  AliMUONVCalibParam* pedestals = static_cast<AliMUONVCalibParam*>(fPedestals->FindObject(detElemId,manuId));
198 
199  AliMUONVCalibParam* config = static_cast<AliMUONVCalibParam*>(fConfig->FindObject(detElemId,manuId));
200 
201  if ( pedestals == 0 && config == 0 )
202  {
204  return 0;
205  }
206 
207  if ( config == 0 && pedestals )
208  {
209  // a manu present in the pedestal run disappeared in the configuration
210  // that is happening if we removed a bus patch _during_ the run and then
211  // issued a PAR (Pause And Reconfigure) to change the readout configuration
212  //
213  // So, that's normal if all the manus of the same buspatch are in the same case.
214  // Let's check that...
215  AliMpBusPatch* busPatch = AliMpDDLStore::Instance()->GetBusPatch(detElemId,manuId);
216  Int_t n = busPatch->GetNofManus();
217  Int_t missing(0);
218  for ( Int_t i = 0; i < n; ++i )
219  {
220  Int_t manu = busPatch->GetManuId(i);
221  if ( fConfig->FindObject(detElemId,manuId) == 0x0 ) ++missing;
222  }
223  if ( missing != n )
224  {
225  AliError(Form("Got an inconsistent state between config and pedestal information for DE %4d MANU %4d BUSPATCH %4d : not all the manus from this bus patch are missing in the configuration ? ",detElemId,manuId,busPatch->GetId()));
226  return -1;
227  }
228  return 1;
229  }
230 
231  if ( pedestals == 0 && config != 0 )
232  {
233  AliError(Form("Got an inconsistent state between config and pedestal information for DE %4d MANU %4d : got a configuration but no pedestal values ???",detElemId,manuId));
234  return -2;
235  }
236 
237  return 0;
238 }
239 
240 //_____________________________________________________________________________
241 void
243  Int_t& pedStatus,
244  Int_t& hvStatus,
245  Int_t& lvStatus,
246  Int_t& occStatus)
247 {
249 
250  occStatus = ( status & 0xFF000000 ) >> 24;
251  lvStatus = ( status & 0xFF0000 ) >> 16;
252  pedStatus = ( status & 0xFF00 ) >> 8;
253  hvStatus = (status & 0xFF);
254 }
255 
256 //_____________________________________________________________________________
257 Bool_t
258 AliMUONPadStatusMaker::HVSt12Status(Int_t detElemId, Int_t sector,
259  Bool_t& hvChannelTooLow,
260  Bool_t& hvChannelTooHigh,
261  Bool_t& hvChannelON) const
262 {
264 
268 
269  AliCodeTimerAuto("",0)
270 
271  if (!fHV) return kFALSE;
272 
273  Bool_t error = kFALSE;
274  hvChannelTooLow = kFALSE;
275  hvChannelTooHigh = kFALSE;
276  hvChannelON = kTRUE;
277 
278  Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
279 
280  AliMpDCSNamer hvNamer("TRACKER");
281 
282  TString hvChannel(hvNamer.DCSAliasName(detElemId,sector));
283 
284  TMap* hvMap = fkCalibrationData.HV();
285  TPair* hvPair = static_cast<TPair*>(hvMap->FindObject(hvChannel.Data()));
286  if (!hvPair)
287  {
288  AliError(Form("Did not find expected alias (%s) for DE %d",
289  hvChannel.Data(),detElemId));
290  error = kTRUE;
291  }
292  else
293  {
294  TObjArray* values = static_cast<TObjArray*>(hvPair->Value());
295  if (!values)
296  {
297  AliError(Form("Could not get values for alias %s",hvChannel.Data()));
298  error = kTRUE;
299  }
300  else
301  {
302  // find out min value, and makes a cut
303  Float_t hvMin(1E9);
304  TIter next(values);
305  AliDCSValue* val;
306 
307  while ( ( val = static_cast<AliDCSValue*>(next()) ) )
308  {
309  Float_t hv = val->GetFloat();
310  hvMin = TMath::Min(hv,hvMin);
311  }
312 
313  float lowThreshold = HVLimit(chamberId);
314 
315  if ( hvMin < lowThreshold ) hvChannelTooLow = kTRUE;
316  if ( hvMin < hvNamer.TrackerHVOFF() ) hvChannelON = kFALSE;
317  }
318  }
319 
320  return error;
321 }
322 
323 //_____________________________________________________________________________
324 Float_t
326 {
329 
330  // we'll count the number of ON/OFF for this pad, to insure
331  // consistency (i.e. if status changed during the run, we should
332  // at least notify this fact ;-) and hope it's not the norm)
333  Int_t nTrue(0);
334  Int_t nFalse(0);
335  TIter next(&dcsArray);
336  AliDCSValue* val;
337 
338  while ( ( val = static_cast<AliDCSValue*>(next()) ) )
339  {
340  if ( val->GetBool() )
341  {
342  ++nTrue;
343  }
344  else
345  {
346  ++nFalse;
347  }
348  }
349 
350  if ( (nTrue>0 && nFalse>0) )
351  {
352  // change of state during the run, consider it off
353  return 0.0;
354  }
355 
356  if ( nFalse )
357  {
360  return 1.0;
361  }
362 
363  return 0.0;
364 }
365 
366 //_____________________________________________________________________________
367 Bool_t
368 AliMUONPadStatusMaker::HVSt345Status(Int_t detElemId, Int_t pcbIndex,
369  Bool_t& hvChannelTooLow,
370  Bool_t& hvChannelTooHigh,
371  Bool_t& hvChannelON,
372  Bool_t& hvSwitchON) const
373 {
378 
379  AliCodeTimerAuto("",0)
380 
381  if (!fHV) return kFALSE;
382 
383  Bool_t error = kFALSE;
384  hvChannelTooLow = kFALSE;
385  hvChannelTooHigh = kFALSE;
386  hvSwitchON = kTRUE;
387  hvChannelON = kTRUE;
388 
389  AliMpDCSNamer hvNamer("TRACKER");
390 
391  Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
392 
393  TString hvChannel(hvNamer.DCSAliasName(detElemId));
394 
395  TMap* hvMap = fkCalibrationData.HV();
396 
397  TPair* hvPair = static_cast<TPair*>(hvMap->FindObject(hvChannel.Data()));
398  if (!hvPair)
399  {
400  AliError(Form("Did not find expected alias (%s) for DE %d",
401  hvChannel.Data(),detElemId));
402  error = kTRUE;
403  }
404  else
405  {
406  TObjArray* values = static_cast<TObjArray*>(hvPair->Value());
407  if (!values)
408  {
409  AliError(Form("Could not get values for alias %s",hvChannel.Data()));
410  error = kTRUE;
411  }
412  else
413  {
414  // find out min value, and makes a cut
415  Float_t hvMin(1E9);
416  TIter next(values);
417  AliDCSValue* val;
418 
419  while ( ( val = static_cast<AliDCSValue*>(next()) ) )
420  {
421  Float_t hv = val->GetFloat();
422  hvMin = TMath::Min(hv,hvMin);
423  }
424 
425  float lowThreshold = HVLimit(chamberId);
426 
427  if ( hvMin < lowThreshold ) hvChannelTooLow = kTRUE;
428  if ( hvMin < hvNamer.TrackerHVOFF() ) hvChannelON = kFALSE;
429  }
430  }
431 
432  TString hvSwitch(hvNamer.DCSSwitchAliasName(detElemId,pcbIndex));
433  TPair* switchPair = static_cast<TPair*>(hvMap->FindObject(hvSwitch.Data()));
434  if (!switchPair)
435  {
436  AliError(Form("Did not find expected alias (%s) for DE %d PCB %d",
437  hvSwitch.Data(),detElemId,pcbIndex));
438  error = kTRUE;
439  }
440  else
441  {
442  TObjArray* values = static_cast<TObjArray*>(switchPair->Value());
443  if (!values)
444  {
445  AliError(Form("Could not get values for alias %s",hvSwitch.Data()));
446  error = kTRUE;
447  }
448  else
449  {
450  Float_t sv = SwitchValue(*values);
451  if ( sv < 0.99 ) hvSwitchON = kFALSE;
452  }
453  }
454  return error;
455 }
456 
457 //_____________________________________________________________________________
458 Int_t
459 AliMUONPadStatusMaker::HVStatus(Int_t detElemId, Int_t manuId) const
460 {
462 
463  AliCodeTimerAuto("",0)
464 
465  if ( !fHV ) return kMissing;
466 
467  Long_t lint = fHV->GetValue(AliMpManuUID::BuildUniqueID(detElemId,manuId));
468 
469  if ( lint )
470  {
471  return (Int_t)(lint - 1);
472  }
473 
474  Int_t status(0);
475 
476  AliMpDCSNamer hvNamer("TRACKER");
477 
478  switch ( AliMpDEManager::GetStationType(detElemId) )
479  {
480  case AliMp::kStation12:
481  {
482  int sector = hvNamer.ManuId2Sector(detElemId,manuId);
483  if ( sector >= 0 )
484  {
485  Bool_t hvChannelTooLow, hvChannelTooHigh, hvChannelON;
486  Bool_t error = HVSt12Status(detElemId,sector,
487  hvChannelTooLow,
488  hvChannelTooHigh,
489  hvChannelON);
490  if ( error ) status |= kHVError;
491  if ( hvChannelTooLow ) status |= kHVTooLow;
492  if ( hvChannelTooHigh ) status |= kHVTooHigh;
493  if ( !hvChannelON ) status |= kHVChannelOFF;
494  // assign this status to all the other manus handled by the same HV channel
495  SetHVStatus(detElemId,sector,status);
496  }
497  }
498  break;
499  case AliMp::kStation345:
500  {
501  int pcbIndex = hvNamer.ManuId2PCBIndex(detElemId,manuId);
502  if ( pcbIndex >= 0 )
503  {
504  Bool_t hvChannelTooLow, hvChannelTooHigh, hvChannelON,hvSwitchON;
505  Bool_t error = HVSt345Status(detElemId,pcbIndex,
506  hvChannelTooLow,hvChannelTooHigh,
507  hvChannelON,hvSwitchON);
508  if ( error ) status |= kHVError;
509  if ( hvChannelTooLow ) status |= kHVTooLow;
510  if ( hvChannelTooHigh ) status |= kHVTooHigh;
511  if ( !hvSwitchON ) status |= kHVSwitchOFF;
512  if ( !hvChannelON) status |= kHVChannelOFF;
513  // assign this status to all the other manus handled by the same HV channel
514  SetHVStatus(detElemId,pcbIndex,status);
515  }
516  }
517  break;
518  default:
519  break;
520  }
521 
522  return status;
523 }
524 
525 //_____________________________________________________________________________
526 Int_t AliMUONPadStatusMaker::LVStatus(Int_t detElemId) const
527 {
529  return kLVMissing;
530 }
531 
532 //_____________________________________________________________________________
534 AliMUONPadStatusMaker::Neighbours(Int_t detElemId, Int_t manuId) const
535 {
537  AliMUONVStore* neighbourStore = fkCalibrationData.Neighbours();
538  return static_cast<AliMUONVCalibParam*>(neighbourStore->FindObject(detElemId,manuId));
539 }
540 
541 //_____________________________________________________________________________
544 {
546  return fkCalibrationData.Neighbours();
547 }
548 
549 //_____________________________________________________________________________
551 AliMUONPadStatusMaker::ComputeStatus(Int_t detElemId, Int_t manuId) const
552 {
555 
556  AliMUONVCalibParam* param = new AliMUONCalibParamNI(1,AliMpConstants::ManuNofChannels(),detElemId,manuId,-1);
557  fStatus->Add(param);
558 
559  AliMUONVCalibParam* pedestals = static_cast<AliMUONVCalibParam*>(fPedestals->FindObject(detElemId,manuId));
560 
561  Int_t hvStatus = HVStatus(detElemId,manuId);
562  Int_t lvStatus = LVStatus(detElemId);
563 
564  Int_t occStatus = OccupancyStatus(detElemId,manuId);
565 
566  for ( Int_t manuChannel = 0; manuChannel < param->Size(); ++manuChannel )
567  {
568  Int_t pedStatus(0);
569 
570  if (pedestals)
571  {
572  Float_t pedMean = pedestals->ValueAsFloatFast(manuChannel,0);
573  Float_t pedSigma = pedestals->ValueAsFloatFast(manuChannel,1);
574  if ( pedMean < fPedMeanLimits.X() ) pedStatus |= kPedMeanTooLow;
575  else if ( pedMean > fPedMeanLimits.Y() ) pedStatus |= kPedMeanTooHigh;
576  if ( pedSigma < fPedSigmaLimits.X() ) pedStatus |= kPedSigmaTooLow;
577  else if ( pedSigma > fPedSigmaLimits.Y() ) pedStatus |= kPedSigmaTooHigh;
578  if ( pedMean == 0 ) pedStatus |= kPedMeanZero;
579  }
580  else
581  {
582  pedStatus = kPedMissing;
583  }
584 
585  Int_t status = BuildStatus(pedStatus,hvStatus,lvStatus,occStatus);
586 
587  param->SetValueAsIntFast(manuChannel,0,status);
588  }
589 
590  return param;
591 }
592 
593 //_____________________________________________________________________________
594 Int_t
595 AliMUONPadStatusMaker::OccupancyStatus(Int_t detElemId, Int_t manuId) const
596 {
598 
599  Int_t rv(0);
600 
601  if ( fTrackerData )
602  {
603  const Int_t occIndex = 2;
604 
605  Double_t occ = fTrackerData->DetectionElement(detElemId,occIndex);
606 
607  if ( occ <= fDEOccupancyLimits.X() )
608  {
609  rv |= kDEOccupancyTooLow;
610  }
611  else if ( occ > fDEOccupancyLimits.Y() )
612  {
613  rv |= kDEOccupancyTooHigh;
614  }
615 
616  Int_t busPatchId = AliMpDDLStore::Instance()->GetBusPatchId(detElemId,manuId);
617 
618  occ = fTrackerData->BusPatch(busPatchId,occIndex);
619 
620  if ( occ <= fBuspatchOccupancyLimits.X() )
621  {
623  }
624  else if ( occ > fBuspatchOccupancyLimits.Y() )
625  {
627  }
628 
629  occ = fTrackerData->Manu(detElemId,manuId,occIndex);
630 
631  if ( occ <= fManuOccupancyLimits.X() )
632  {
633  rv |= kManuOccupancyTooLow;
634  }
635  else if ( occ > fManuOccupancyLimits.Y() )
636  {
637  rv |= kManuOccupancyTooHigh;
638  }
639  }
640 
641  Int_t config = CheckConfigConsistencyWithPedestalInformation(detElemId,manuId);
642 
643  if (config==1)
644  {
645  Int_t bpid = AliMpDDLStore::Instance()->GetBusPatchId(detElemId,manuId);
646 
647  AliWarning(Form("BusPatchRemovedByPAR : BP %4d",bpid));
648  rv |= kBusPatchRemovedByPAR;
649  }
650 
651  return rv;
652 }
653 
654 //_____________________________________________________________________________
656 AliMUONPadStatusMaker::PadStatus(Int_t detElemId, Int_t manuId) const
657 {
659 
660  AliMUONVCalibParam* param = static_cast<AliMUONVCalibParam*>(fStatus->FindObject(detElemId,manuId));
661  if (!param)
662  {
663  // not already there, so compute it now
664  AliCodeTimerAuto("ComputeStatus",0);
665  param = ComputeStatus(detElemId,manuId);
666  }
667  return param;
668 }
669 
670 //_____________________________________________________________________________
671 Int_t
672 AliMUONPadStatusMaker::PadStatus(Int_t detElemId, Int_t manuId, Int_t manuChannel) const
673 {
675 
676  AliMUONVCalibParam* param = static_cast<AliMUONVCalibParam*>(fStatus->FindObject(detElemId,manuId));
677  if (!param)
678  {
679  // not already there, so compute it now
680  param = ComputeStatus(detElemId,manuId);
681  }
682  return param->ValueAsInt(manuChannel,0);
683 }
684 
685 //_____________________________________________________________________________
686 void
687 AliMUONPadStatusMaker::SetHVStatus(Int_t detElemId, Int_t index, Int_t status) const
688 {
691 
692  AliCodeTimerAuto("",0)
693 
695 
696  const AliMpArrayI* manus = de->ManusForHV(index);
697 
698  for ( Int_t i = 0; i < manus->GetSize(); ++ i )
699  {
700  Int_t manuId = manus->GetValue(i);
701  fHV->Add(AliMpManuUID::BuildUniqueID(detElemId,manuId),status + 1);
702  }
703 }
704 
705 //_____________________________________________________________________________
706 Double_t
707 AliMUONPadStatusMaker::HVLimit(Int_t chamberId) const
708 {
710  if ( chamberId >=0 && chamberId < 10 )
711  {
712  return fHVLimit[chamberId];
713  }
714  return 0.0;
715 }
716 
717 //_____________________________________________________________________________
718 void
719 AliMUONPadStatusMaker::SetHVLimit(Int_t chamberId, Double_t hv)
720 {
722 
723  if ( chamberId == -1 )
724  {
725  for ( Int_t i = 0; i < 10; ++i )
726  {
727  fHVLimit[i] = hv;
728  }
729  }
730  else if ( chamberId >= 0 && chamberId < 10 )
731  {
732  fHVLimit[chamberId]=hv;
733  }
734  else
735  {
736  AliError(Form("chamberId=%d is invalid",chamberId));
737  }
738 }
739 
740 //_____________________________________________________________________________
741 void
743 {
745 
746  for ( int i = 0; i < 10; ++i )
747  {
748  SetHVLimit(i,recoParams.HVLimit(i));
749  }
750 
751  SetPedMeanLimits(recoParams.PedMeanLowLimit(),recoParams.PedMeanHighLimit());
752  SetPedSigmaLimits(recoParams.PedSigmaLowLimit(),recoParams.PedSigmaHighLimit());
753 
757 }
758 
759 //_____________________________________________________________________________
760 void
762 {
765 
766  AliInfo("");
767  AliCodeTimerAuto("",0);
768 
769  AliMUONLogger log(1064008);
770 
771  Int_t nBadPads(0);
772  Int_t nPads(0);
773 
775 
776  Int_t detElemId, manuId;
777 
778  while ( it.Next(detElemId,manuId) )
779  {
781 
782  for ( Int_t i = 0; i < AliMpConstants::ManuNofChannels(); ++i )
783  {
784  if ( de->IsConnectedChannel(manuId,i) )
785  {
786  ++nPads;
787 
788  Int_t status = PadStatus(detElemId,manuId,i);
789 
790  if ( mask && ( status & mask) ) // note that if mask == 0, all pads are good...
791  {
792  ++nBadPads;
793  log.Log(AsString(status));
794  }
795  }
796  }
797  }
798 
799  if (!nPads)
800  {
801  AliError("Got no pad from the iterator ?! That's not normal. Please check !");
802  return;
803  }
804 
805  TString msg;
806  Int_t ntimes;
807 
808  cout << Form("According to mask %x (human readable form below) %6d pads are bad (over a total of %6d, i.e. %7.2f %%)",
809  mask,nBadPads,nPads,nBadPads*100.0/nPads) << endl;
810  cout << AliMUONPadStatusMaker::AsCondition(mask) << endl;
811  cout << "--------" << endl;
812 
813  while ( log.Next(msg,ntimes) )
814  {
815  cout << Form("The message (%120s) occured %15d times (%7.4f %%)",msg.Data(),ntimes,ntimes*100.0/nPads) << endl;
816  }
817 
818  TMap* hvMap = CalibrationData().HV();
819 
820  std::cout << "Map UniqueID = " << hvMap->GetUniqueID() << std::endl;
821 }
822 
Int_t GetNofManus() const
AliMUONVCalibParam * Neighbours(Int_t detElemId, Int_t manuId) const
Float_t ManuOccupancyHighLimit() const
Retrieve high value of manu occupancy limit.
virtual Double_t DetectionElement(Int_t detElemId, Int_t dim=0) const =0
Get the value for a given DE and given dimension.
AliMUONVStore * fPedestals
! pedestal values
Implementation of AliMUONVTrackerData.
void SetDEOccupancyLimits(float low, float high)
Set Low and High DE occupancy limits.
static UInt_t BuildUniqueID(Int_t detElemId, Int_t manuId)
Int_t ManuId2PCBIndex(Int_t detElemId, Int_t manuId) const
Returns the index of PCB (within a St345 slat) for a given manu number.
station 1,2 (quadrants)
const AliMUONCalibrationData & fkCalibrationData
! helper class to get data access (not owner)
TVector2 fManuOccupancyLimits
! Low and High manu occupancy limits
static Float_t SwitchValue(const TObjArray &dcsArray)
Int_t GetSize() const
static TString AsString(Int_t status)
TMap * HV(Bool_t patched=kTRUE) const
Get the HV values. Use patched=kFALSE to get unprocessed (i.e. "raw") values as they are in the OCDB...
Bool_t HVSt345Status(Int_t detElemId, Int_t pcbIndex, Bool_t &hvChannelTooLow, Bool_t &hvChannelTooHigh, Bool_t &hvChannelON, Bool_t &hvSwitchON) const
#define TObjArray
AliMUONVStore * Neighbours() const
Get the neighbours store.
virtual Int_t Size() const =0
The number of channels handled by this object.
static Float_t TrackerHVOFF()
Definition: AliMpDCSNamer.h:70
void SetBuspatchOccupancyLimits(float low, float high)
Set Low and High bus patch occupancy limits.
static Int_t BuildStatus(Int_t pedStatus, Int_t hvStatus, Int_t lvStatus, Int_t otherStatus)
virtual Float_t ValueAsFloatFast(Int_t i, Int_t j=0) const =0
Same as above but without bound checking.
Int_t ManuId2Sector(Int_t detElemId, Int_t manuId) const
Return the HV-sector number (within a St12 quadrant) for a given manu number.
Double_t fHVLimit[10]
! Low thresholds for HV
Float_t PedMeanHighLimit() const
Retrieve high limit of ped mean.
station 3,4,5 (slats)
Int_t Log(const char *message)
Float_t BuspatchOccupancyLowLimit() const
Retrieve low value of bp occupancy limit.
Collection of methods usefull to DCS handling for MUON TRK and TRG.
Definition: AliMpDCSNamer.h:22
void SetHVLimit(Int_t chamberId, Double_t hv)
Set HV limit.
TVector2 fDEOccupancyLimits
! Low and High DE occupancy limits
Class with MUON reconstruction parameters.
AliMpDetElement * GetDetElement(Int_t detElemId, Bool_t warn=true) const
Int_t GetManuId(Int_t index) const
void Config()
Definition: ConfigKr.C:51
The class defines the electronics properties of detection element.
Bool_t Next(TString &msg, Int_t &occurance)
static void DecodeStatus(Int_t status, Int_t &pedStatus, Int_t &hvStatus, Int_t &lvStatus, Int_t &otherStatus)
Bool_t Next(Int_t &detElemId, Int_t &manuId)
Class to loop over all manus of MUON Tracker.
void SetManuOccupancyLimits(float low, float high)
Set Low and High manu occupancy limits.
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
A logger that keeps track of the number of times a message appeared.
Definition: AliMUONLogger.h:24
Container of calibration values for a given number of channels.
static AliMpDDLStore * Instance(Bool_t warn=true)
static Int_t GetChamberId(Int_t detElemId, Bool_t warn=true)
static Int_t ManuNofChannels()
Max number of channels per manu.
AliMUONVCalibParam * PadStatus(Int_t detElemId, Int_t manuId) const
virtual Double_t Manu(Int_t detElemId, Int_t manuId, Int_t dim=0) const =0
Get the value for a given manu and given dimension.
Int_t GetBusPatchId(Int_t detElemId, Int_t manuId) const
TVector2 fBuspatchOccupancyLimits
! Low and High buspatch occupancy limits
Implementation of AliMUONVCalibParam for tuples of ints.
Double_t HVLimit(Int_t chamberId) const
Return HV threshold.
void SetHVStatus(Int_t detElemId, Int_t index, Int_t status) const
Double_t HVLimit(Int_t chamberId) const
Retrieve HV limit for chamber (chamberId=0..9)
Float_t PedSigmaLowLimit() const
Retrieve low limit of ped sigma.
static AliMp::StationType GetStationType(Int_t detElemId)
static TString AsCondition(Int_t status)
AliMpBusPatch * GetBusPatch(Int_t busPatchId, Bool_t warn=true) const
Int_t GetId() const
Return the unique Id.
Definition: AliMpBusPatch.h:89
Bool_t HVSt12Status(Int_t detElemId, Int_t sector, Bool_t &hvChannelTooLow, Bool_t &hvChannelTooHigh, Bool_t &hvChannelON) const
Helper class for sorted integer array.
Definition: AliMpArrayI.h:21
Float_t DEOccupancyLowLimit() const
Retrieve low value of DE occupancy limit.
virtual Int_t ValueAsInt(Int_t i, Int_t j=0) const =0
Basic implementation of AliMUONVStore container using AliMpExMap internally.
Definition: AliMUON2DMap.h:20
Int_t OccupancyStatus(Int_t detElemId, Int_t manuId) const
Int_t CheckConfigConsistencyWithPedestalInformation(Int_t detElemId, Int_t manuId) const
AliMUONCalibrationData * calibData
virtual Bool_t Add(TObject *object)=0
Add an object to the store.
TVector2 fPedMeanLimits
! Low and High threshold for pedestal mean
The class defines the properties of BusPatch.
Definition: AliMpBusPatch.h:21
Single entry point to access MUON calibration data.
Float_t PedMeanLowLimit() const
Retrieve low limit of ped mean.
AliMUONVStore * fStatus
! statuses of the pads
virtual Double_t BusPatch(Int_t busPatchId, Int_t dim=0) const =0
Get the value for a given buspatch and given dimension.
TExMap * fHV
! cache of hv statuses
virtual void SetValueAsIntFast(Int_t i, Int_t j, Int_t value)=0
Same as above but w/o bound checkings.
AliMUONVTrackerData * fTrackerData
! to get occupancies...
TString DCSSwitchAliasName(Int_t detElemId, Int_t pcbNumber) const
Int_t HVStatus(Int_t detElemId, Int_t manuId) const
const AliMpArrayI * ManusForHV(Int_t hvIndex) const
void SetPedSigmaLimits(float low, float high)
Set Low and High threshold for pedestal sigma.
AliMUONVCalibParam * ComputeStatus(Int_t detElemId, Int_t manuId) const
Int_t GetValue(Int_t index) const
Bool_t IsConnectedChannel(Int_t manuId, Int_t manuChannel) const
Float_t ManuOccupancyLowLimit() const
Retrieve low value of manu occupancy limit.
Int_t LVStatus(Int_t detElemId) const
void SetPedMeanLimits(float low, float high)
Set Low and High threshold for pedestal mean.
Base class for MUON data stores.
Definition: AliMUONVStore.h:22
TString DCSAliasName(Int_t detElemId, Int_t sector=0, Int_t dcsMeasure=0) const
AliMUONVStore * fConfig
! readout configuration
const AliMUONCalibrationData & CalibrationData() const
Get the reference to the calibrationdata object we use.
Float_t PedSigmaHighLimit() const
Retrieve high limit of ped sigma.
AliMUONVStore * NeighboursStore() const
Float_t DEOccupancyHighLimit() const
Retrieve high value of DE occupancy limit.
TVector2 fPedSigmaLimits
! Low and High threshold for pedestal sigma
Make a 2DStore of pad statuses, using different sources of information.
Float_t BuspatchOccupancyHighLimit() const
Retrieve high value of bp occupancy limit.
virtual TObject * FindObject(const char *name) const
Find an object by name.
void SetLimits(const AliMUONRecoParam &recoParams)