1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 /// Macro to check/test pad status and pad status map makers
22 #if !defined(__CINT__) || defined(__MAKECINT__)
23 #include "AliCDBManager.h"
24 #include "AliMUONCalibrationData.h"
25 #include "AliMUONPadStatusMaker.h"
26 #include "AliMUONPadStatusMapMaker.h"
27 #include "AliMUONVCalibParam.h"
28 #include "AliMUONVStore.h"
30 #include "AliMpConstants.h"
31 #include "AliMpDDLStore.h"
32 #include "AliMpDetElement.h"
33 #include "AliMpIntPair.h"
34 #include "AliMpManuIterator.h"
35 #include "Riostream.h"
38 void FindBad(AliMUONPadStatusMaker& statusMaker, Int_t mask, Int_t& nBadPads, Int_t& nPads)
47 while ( it.Next(detElemId,manuId) )
51 AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(detElemId);
56 for ( Int_t i = 0; i < AliMpConstants::ManuNofChannels(); ++i )
58 if ( de->IsConnectedChannel(manuId,i) )
62 Int_t status = statusMaker.PadStatus(detElemId,manuId,i);
63 if ( ( status & mask) || (!mask && status) )
74 cout << Form("DE %4d ManuId %4d %2d bad pads over %2d pads",
75 detElemId,manuId,nb,n) << endl;
80 AliMUONVStore* MUONStatusMap(const TString& cdbStorage = "local://$ALICE_ROOT",
81 Int_t runNumber=0, Bool_t statusOnly=kFALSE,
84 AliCDBManager::Instance()->SetDefaultStorage(cdbStorage.Data());
85 AliCDBManager::Instance()->SetRun(runNumber);
87 AliMpCDB::LoadDDLStore();
89 AliMUONCalibrationData cd(runNumber);
91 AliMUONPadStatusMaker statusMaker(cd);
93 // statusMaker.SetPedMeanLimits(50,200);
94 // statusMaker.SetPedSigmaLimits(0.5,2);
99 FindBad(statusMaker,mask,nbad,ntotal);
103 cout << "Error : got no pad at all ?!" << endl;
107 cout << Form("Nbad = %6d over %6d pads (%7.2f %%)",
108 nbad,ntotal,100.0*nbad/ntotal) << endl;
110 if ( statusOnly ) return statusMaker.StatusStore();
112 const Bool_t deferredInitialization = kFALSE;
114 AliMUONPadStatusMapMaker statusMapMaker(cd,mask,deferredInitialization);
116 return statusMapMaker.StatusMap();