]>
Commit | Line | Data |
---|---|---|
d565d56c | 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 | /// Macro to check/test pad status and pad status map makers | |
3fb89a07 | 19 | /// |
d565d56c | 20 | // Laurent Aphecetche |
21 | ||
22 | #if !defined(__CINT__) || defined(__MAKECINT__) | |
23 | #include "AliCDBManager.h" | |
24 | #include "AliMUONCalibrationData.h" | |
d565d56c | 25 | #include "AliMUONPadStatusMaker.h" |
26 | #include "AliMUONPadStatusMapMaker.h" | |
b1f2fbb2 | 27 | #include "AliMUONVStore.h" |
d565d56c | 28 | #include "AliMUONVCalibParam.h" |
d565d56c | 29 | #include "AliMpIntPair.h" |
30 | #include "Riostream.h" | |
31 | #endif | |
32 | ||
3fb89a07 | 33 | |
b1f2fbb2 | 34 | void findBad(const AliMUONVStore& status) |
d565d56c | 35 | { |
b1f2fbb2 | 36 | TIter next(status.CreateIterator()); |
37 | AliMUONVCalibParam* param; | |
d565d56c | 38 | |
b1f2fbb2 | 39 | while ( ( param = dynamic_cast<AliMUONVCalibParam*>(next()) ) ) |
d565d56c | 40 | { |
b1f2fbb2 | 41 | Int_t detElemId = param->ID0(); |
42 | Int_t manuId = param->ID1(); | |
d565d56c | 43 | Bool_t bad(kFALSE); |
44 | for ( Int_t i = 0; i < param->Size(); ++i ) | |
45 | { | |
46 | if ( param->ValueAsInt(0) ) bad = kTRUE; | |
47 | } | |
48 | if (bad) | |
49 | { | |
50 | cout << Form("DE %4d ManuId %4d",detElemId,manuId) << endl; | |
51 | } | |
52 | } | |
53 | } | |
54 | ||
b1f2fbb2 | 55 | AliMUONVStore* MUONStatusMap(const TString& cdbStorage = "local://$ALICE_ROOT", |
3fb89a07 | 56 | Int_t runNumber=0, Bool_t statusOnly=kFALSE, Int_t mask=0) |
57 | { | |
58 | AliCDBManager::Instance()->SetDefaultStorage(cdbStorage.Data()); | |
59 | ||
d565d56c | 60 | AliMUONCalibrationData cd(runNumber); |
61 | ||
62 | AliMUONPadStatusMaker statusMaker(cd); | |
63 | ||
64 | // statusMaker.SetPedMeanLimits(50,200); | |
65 | statusMaker.SetPedSigmaLimits(0.5,2); | |
66 | ||
b1f2fbb2 | 67 | AliMUONVStore* status = statusMaker.MakeStatus(); |
d565d56c | 68 | |
69 | if ( status ) | |
70 | { | |
71 | findBad(*status); | |
72 | } | |
73 | else | |
74 | { | |
75 | cout << "ERROR. Could not get status from CDB" << endl; | |
76 | return 0; | |
77 | } | |
78 | ||
79 | if ( statusOnly ) return status; | |
80 | ||
2d31341a | 81 | AliMUONPadStatusMapMaker statusMapMaker(cd); |
d565d56c | 82 | |
83 | return statusMapMaker.MakePadStatusMap(*status,mask); | |
84 | } |