]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/MUONTriggerChamberEfficiency.C
Adding 4 new QA histos:
[u/mrichter/AliRoot.git] / MUON / MUONTriggerChamberEfficiency.C
CommitLineData
23567f21 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#if !defined(__CINT__) || defined(__MAKECINT__)
19// ROOT includes
a4342473 20#include "TGrid.h"
21#include "TString.h"
23567f21 22
23// MUON includes
24#include "AliMUONCDB.h"
a4342473 25#include "AliMUONCalibrationData.h"
23567f21 26#include "AliMUONTriggerEfficiencyCells.h"
a99c3449 27#include "AliCDBManager.h"
aca1050a 28#include "AliCDBRunRange.h"
23567f21 29#include "Riostream.h"
30
31#endif
32
e54bf126 33/// \ingroup macros
34/// \file MUONTriggerChamberEfficiency.C
35/// \brief Macro to view and save the trigger chamber efficiency map
36/// calculated during reconstruction.
37///
38/// Efficiency map can be made available for next simulation.
39///
40/// \author Diego Stocco, INFN Torino
23567f21 41
a4342473 42void 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)
23567f21 46{
a4342473 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))
e54bf126 59
a4342473 60 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
23567f21 61
a4342473 62 AliMUONTriggerEfficiencyCells* effMap = new AliMUONTriggerEfficiencyCells(inputFile);
63 if ( useMeanValues ){
64 AliCDBManager::Instance()->SetRun(firstRun);
65 effMap->LowStatisticsSettings();
66 }
23567f21 67
a4342473 68 if ( !addMapInLocalOCDB ){
69 AliCDBManager::Instance()->SetRun(firstRun);
311d0691 70 effMap->DisplayEfficiency();
a4342473 71 }
72 else
73 AliMUONCDB::WriteToCDB("MUON/Calib/TriggerEfficiency", effMap, firstRun, lastRun,true);
74}
75
76//____________________________________________________________
77void ShowOCDBmap(Int_t runNumber = 0, TString ocdbPath="local://$ALICE_ROOT/OCDB")
78{
79/// \param runNumber (default 0)
80/// run number
81/// \param ocdbPath(default "local://$ALICE_ROOT/OCDB")
82/// path to OCDB
83 if ( ocdbPath.BeginsWith("alien://") || ocdbPath.BeginsWith("raw://"))
84 TGrid::Connect("alien://");
23567f21 85
a4342473 86 AliCDBManager::Instance()->SetDefaultStorage(ocdbPath.Data());
87 AliCDBManager::Instance()->SetRun(runNumber);
88 AliMUONCalibrationData calib(runNumber);
23567f21 89
a4342473 90 calib.TriggerEfficiency()->DisplayEfficiency();
23567f21 91}
a4342473 92