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 "AliMUONTriggerChamberEfficiency.h"
28 #include "AliCDBManager.h"
29 #include "AliCDBRunRange.h"
30 #include "Riostream.h"
35 /// \file MUONTriggerChamberEfficiency.C
36 /// \brief Macro to view and save the trigger chamber efficiency map
37 /// calculated during reconstruction.
39 /// Efficiency map can be made available for next simulation.
41 /// \author Diego Stocco, Subatech, Nantes
43 void MUONTriggerChamberEfficiency(const Char_t* inputFile="./MUON.TriggerEfficiencyMap.root",
44 const Char_t* outputCDB = "",
45 Int_t firstRun=0, Int_t lastRun = AliCDBRunRange::Infinity()
48 /// \param inputFile (default "./MUON.TriggerEfficiencyMaps.root")
49 /// File with the numerator and denominator histos for efficiency calculation
50 /// (It is the output of the PWG3/muon/AliAnalysisTaskTrigChEff analysis
51 /// \param outputCDB (default "")
52 /// add the map on the specified CDB
53 /// \param firstRun (default 0)
54 /// first run of validity for CDB object
55 /// \param lastRun (default AliCDBRunRange::Infinity())
56 /// last run of validity for CDB Object
58 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
60 AliMUONTriggerEfficiencyCells* effMap = new AliMUONTriggerEfficiencyCells(inputFile);
61 TString outCDB(outputCDB);
63 if ( outCDB.IsNull() ){
64 // Draw the efficiency and exit
65 AliCDBManager::Instance()->SetRun(firstRun);
66 AliMUONTriggerChamberEfficiency* trigChEff = new AliMUONTriggerChamberEfficiency(effMap);
68 trigChEff->DisplayEfficiency(kFALSE,kFALSE);
73 // Write efficiency on OCDB
75 AliCDBManager::Instance()->SetSpecificStorage("MUON/Calib/TriggerEfficiency", outputCDB);
77 AliMUONCDB::WriteToCDB(effMap, "MUON/Calib/TriggerEfficiency", firstRun, lastRun, "Measured efficiencies");
80 //____________________________________________________________
81 void ShowOCDBmap(Int_t runNumber = 0, TString specificCDB="", TString ocdbPath = "local://$ALICE_ROOT/OCDB")
83 /// \param runNumber (default 0)
85 /// \param specificCDB (default "")
86 /// specific CDB for trigger efficiency
87 /// \param ocdbPath(default "local://$ALICE_ROOT/OCDB")
89 if ( ocdbPath.BeginsWith("alien://") || ocdbPath.BeginsWith("raw://"))
90 TGrid::Connect("alien://");
92 AliCDBManager::Instance()->SetDefaultStorage(ocdbPath.Data());
93 if ( !specificCDB.IsNull() )
94 AliCDBManager::Instance()->SetSpecificStorage("MUON/Calib/TriggerEfficiency", specificCDB.Data());
95 AliCDBManager::Instance()->SetRun(runNumber);
96 AliMUONCalibrationData calib(runNumber);
98 AliMUONTriggerChamberEfficiency* trigChEff = new AliMUONTriggerChamberEfficiency(calib.TriggerEfficiency());
99 trigChEff->DisplayEfficiency();