]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/MUONTriggerChamberEfficiency.C
- Add information in the trigger chamber efficiency object in order to take into...
[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"
f3d288ab 27#include "AliMUONTriggerChamberEfficiency.h"
a99c3449 28#include "AliCDBManager.h"
aca1050a 29#include "AliCDBRunRange.h"
23567f21 30#include "Riostream.h"
31
32#endif
33
e54bf126 34/// \ingroup macros
35/// \file MUONTriggerChamberEfficiency.C
36/// \brief Macro to view and save the trigger chamber efficiency map
37/// calculated during reconstruction.
38///
39/// Efficiency map can be made available for next simulation.
40///
f3d288ab 41/// \author Diego Stocco, Subatech, Nantes
23567f21 42
f3d288ab 43void MUONTriggerChamberEfficiency(const Char_t* inputFile="./MUON.TriggerEfficiencyMap.root",
a4342473 44 Bool_t addMapInLocalOCDB = kFALSE,
f3d288ab 45 Int_t firstRun=0, Int_t lastRun = AliCDBRunRange::Infinity())
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
e54bf126 56
a4342473 57 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
23567f21 58
a4342473 59 AliMUONTriggerEfficiencyCells* effMap = new AliMUONTriggerEfficiencyCells(inputFile);
f3d288ab 60 if ( ! addMapInLocalOCDB ){
a4342473 61 AliCDBManager::Instance()->SetRun(firstRun);
f3d288ab 62 AliMUONTriggerChamberEfficiency trigChEff(effMap);
63
64 trigChEff.DisplayEfficiency();
a4342473 65 }
66 else
67 AliMUONCDB::WriteToCDB("MUON/Calib/TriggerEfficiency", effMap, firstRun, lastRun,true);
68}
69
70//____________________________________________________________
71void ShowOCDBmap(Int_t runNumber = 0, TString ocdbPath="local://$ALICE_ROOT/OCDB")
72{
73/// \param runNumber (default 0)
74/// run number
75/// \param ocdbPath(default "local://$ALICE_ROOT/OCDB")
76/// path to OCDB
77 if ( ocdbPath.BeginsWith("alien://") || ocdbPath.BeginsWith("raw://"))
78 TGrid::Connect("alien://");
23567f21 79
a4342473 80 AliCDBManager::Instance()->SetDefaultStorage(ocdbPath.Data());
81 AliCDBManager::Instance()->SetRun(runNumber);
82 AliMUONCalibrationData calib(runNumber);
23567f21 83
f3d288ab 84 AliMUONTriggerChamberEfficiency trigChEff(calib.TriggerEfficiency());
85 trigChEff.DisplayEfficiency();
23567f21 86}
a4342473 87