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 **************************************************************************/
19 /// \file MUONStatusMap.C
20 /// \brief Macro to check/test pad status and pad status map makers
22 /// \author Laurent Aphecetche
24 #if !defined(__CINT__) || defined(__MAKECINT__)
25 #include "AliCDBManager.h"
26 #include "AliMUONCalibrationData.h"
27 #include "AliMUONPadStatusMaker.h"
28 #include "AliMUONPadStatusMapMaker.h"
29 #include "AliMUONVCalibParam.h"
30 #include "AliMUONVStore.h"
32 #include "AliMpConstants.h"
33 #include "AliMpDDLStore.h"
34 #include "AliMpDetElement.h"
35 #include "AliMpIntPair.h"
36 #include "AliMpManuIterator.h"
37 #include "Riostream.h"
40 void FindBad(AliMUONPadStatusMaker& statusMaker, Int_t mask, Int_t& nBadPads, Int_t& nPads)
49 while ( it.Next(detElemId,manuId) )
53 AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(detElemId);
58 for ( Int_t i = 0; i < AliMpConstants::ManuNofChannels(); ++i )
60 if ( de->IsConnectedChannel(manuId,i) )
64 Int_t status = statusMaker.PadStatus(detElemId,manuId,i);
65 if ( ( status & mask) || (!mask && status) )
76 cout << Form("DE %4d ManuId %4d %2d bad pads over %2d pads",
77 detElemId,manuId,nb,n) << endl;
82 AliMUONVStore* MUONStatusMap(const TString& cdbStorage = "local://$ALICE_ROOT",
83 Int_t runNumber=0, Bool_t statusOnly=kFALSE,
86 AliCDBManager::Instance()->SetDefaultStorage(cdbStorage.Data());
87 AliCDBManager::Instance()->SetRun(runNumber);
89 AliMpCDB::LoadDDLStore();
91 AliMUONCalibrationData cd(runNumber);
93 AliMUONPadStatusMaker statusMaker(cd);
95 // statusMaker.SetPedMeanLimits(50,200);
96 // statusMaker.SetPedSigmaLimits(0.5,2);
101 FindBad(statusMaker,mask,nbad,ntotal);
105 cout << "Error : got no pad at all ?!" << endl;
109 cout << Form("Nbad = %6d over %6d pads (%7.2f %%)",
110 nbad,ntotal,100.0*nbad/ntotal) << endl;
112 if ( statusOnly ) return statusMaker.StatusStore();
114 const Bool_t deferredInitialization = kFALSE;
116 AliMUONPadStatusMapMaker statusMapMaker(cd,mask,deferredInitialization);
118 return statusMapMaker.StatusMap();