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 #if !defined(__CINT__) || defined(__MAKECINT__)
24 #include "AliMUONCDB.h"
25 #include "AliMUONCalibrationData.h"
26 #include "AliMUONTriggerEfficiencyCells.h"
27 #include "AliCDBManager.h"
28 #include "AliCDBRunRange.h"
29 #include "Riostream.h"
34 /// \file MUONTriggerChamberEfficiency.C
35 /// \brief Macro to view and save the trigger chamber efficiency map
36 /// calculated during reconstruction.
38 /// Efficiency map can be made available for next simulation.
40 /// \author Diego Stocco, INFN Torino
42 void MUONTriggerChamberEfficiency(Char_t* inputFile="./MUON.TriggerEfficiencyMap.root",
43 Bool_t addMapInLocalOCDB = kFALSE,
44 Int_t firstRun=0, Int_t lastRun = AliCDBRunRange::Infinity(),
45 Bool_t useMeanValues = kFALSE)
47 /// \param inputFile (default "./MUON.TriggerEfficiencyMaps.root")
48 /// File with the numerator and denominator histos for efficiency calculation
49 /// (It is the output of the PWG3/muon/AliAnalysisTaskTrigChEff analysis
50 /// \param addMapInLocalOCDB (default kFALSE)
51 /// if the map is OK, add it in local OCDB
52 /// \param firstRun (default 0)
53 /// first run of validity for CDB object
54 /// \param lastRun (default AliCDBRunRange::Infinity())
55 /// last run of validity for CDB Object
56 /// \param useMeanValues (default kFALSE)
57 /// Fill local board maps with the average RPC efficiency
58 /// (useful when the statistics is low (i.e. for cosmic runs))
60 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
62 AliMUONTriggerEfficiencyCells* effMap = new AliMUONTriggerEfficiencyCells(inputFile);
64 AliCDBManager::Instance()->SetRun(firstRun);
65 effMap->LowStatisticsSettings();
68 if ( !addMapInLocalOCDB ){
69 AliCDBManager::Instance()->SetRun(firstRun);
70 effMap->DisplayEfficiency();
73 AliMUONCDB::WriteToCDB("MUON/Calib/TriggerEfficiency", effMap, firstRun, lastRun,true);
76 //____________________________________________________________
77 void ShowOCDBmap(Int_t runNumber = 0, TString ocdbPath="local://$ALICE_ROOT/OCDB")
79 /// \param runNumber (default 0)
81 /// \param ocdbPath(default "local://$ALICE_ROOT/OCDB")
83 if ( ocdbPath.BeginsWith("alien://") || ocdbPath.BeginsWith("raw://"))
84 TGrid::Connect("alien://");
86 AliCDBManager::Instance()->SetDefaultStorage(ocdbPath.Data());
87 AliCDBManager::Instance()->SetRun(runNumber);
88 AliMUONCalibrationData calib(runNumber);
90 calib.TriggerEfficiency()->DisplayEfficiency();