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 "AliMUONTriggerEfficiencyCells.h"
27 #include "Riostream.h"
32 /// \file MUONTriggerChamberEfficiency.C
33 /// \brief Macro to view and save the trigger chamber efficiency map
34 /// calculated during reconstruction.
36 /// Efficiency map can be made available for next simulation.
38 /// \author Diego Stocco, INFN Torino
40 void MUONTriggerChamberEfficiency(Bool_t addMapInSimulation=kFALSE,
41 const char *inputDir=".")
43 /// \param addMapInSimulation (default kFALSE);
44 /// kTRUE: creates file MUON/Calib/TriggerEfficiency/Run0_99999999_v0_s?.root
45 /// with calculated chamber efficiency which can be used in the next simulation
47 /// path to AliESDs.root (default ".")
49 Char_t filename[150], *className = "AliMUONTriggerEfficiencyCells";
50 sprintf(filename,"%s/AliESDs.root",inputDir);
52 TFile *file = new TFile(filename,"read");
54 cerr << "Cannot find " << filename << "\nExit!" << endl;
58 TTree *esdTree = (TTree*)file->Get("esdTree");
60 cerr << "Cannot find esdTree in " << filename << "\nExit!" << endl;
64 AliMUONTriggerEfficiencyCells *effMap =
65 (AliMUONTriggerEfficiencyCells*)esdTree->GetUserInfo()->FindObject(className);
67 cerr << "Cannot find " << className << " in esdTree.\nExit!" << endl;
71 effMap->DisplayEfficiency();
73 if(!addMapInSimulation) return;
76 muonCDB.WriteToCDB("MUON/Calib/TriggerEfficiency",effMap,0,99999999,true);