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(TString inputFile = "./MUON.TriggerEfficiencyMap.root",
44 TString 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.Data());
62 if ( outputCDB.IsNull() ){
63 // Draw the efficiency and exit
64 AliCDBManager::Instance()->SetRun(firstRun);
65 AliMUONTriggerChamberEfficiency* trigChEff = new AliMUONTriggerChamberEfficiency(effMap);
67 trigChEff->DisplayEfficiency(kFALSE,kFALSE);
72 // Write efficiency on OCDB
74 AliCDBManager::Instance()->SetSpecificStorage("MUON/Calib/TriggerEfficiency", outputCDB.Data());
76 AliMUONCDB::WriteToCDB(effMap, "MUON/Calib/TriggerEfficiency", firstRun, lastRun, "Measured efficiencies");
79 //____________________________________________________________
80 void ShowOCDBmap(Int_t runNumber = 0, TString specificCDB="", TString ocdbPath = "local://$ALICE_ROOT/OCDB")
82 /// \param runNumber (default 0)
84 /// \param specificCDB (default "")
85 /// specific CDB for trigger efficiency
86 /// \param ocdbPath(default "local://$ALICE_ROOT/OCDB")
88 if ( ocdbPath.BeginsWith("alien://") || ocdbPath.BeginsWith("raw://"))
89 TGrid::Connect("alien://");
91 AliCDBManager::Instance()->SetDefaultStorage(ocdbPath.Data());
92 if ( !specificCDB.IsNull() )
93 AliCDBManager::Instance()->SetSpecificStorage("MUON/Calib/TriggerEfficiency", specificCDB.Data());
94 AliCDBManager::Instance()->SetRun(runNumber);
95 AliMUONCalibrationData calib(runNumber);
97 AliMUONTriggerChamberEfficiency* trigChEff = new AliMUONTriggerChamberEfficiency(calib.TriggerEfficiency());
98 trigChEff->DisplayEfficiency();