]>
Commit | Line | Data |
---|---|---|
913f1b43 | 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 | /// \ingroup macros | |
19 | /// \file MakeMUONRecoParamArray.C | |
20 | /// \brief Macro to set reconstruction parameters and put them in the OCDB | |
21 | /// | |
22 | /// \author Philippe Pillot, SUBATECH | |
23 | ||
24 | #if !defined(__CINT__) || defined(__MAKECINT__) | |
25 | ||
26 | #include "AliMUONRecoParam.h" | |
27 | #include "AliMUONCDB.h" | |
28 | ||
29 | #include "AliCDBManager.h" | |
30 | #include "AliRecoParam.h" | |
31 | ||
32 | #include <TObjArray.h> | |
33 | #include <TIterator.h> | |
34 | ||
35 | #include <Riostream.h> | |
36 | ||
37 | #endif | |
38 | ||
39 | ||
40 | //----------------------------------------------------------------------- | |
41 | void MakeMUONRecoParamArray(Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity(), | |
42 | AliRecoParam::EventSpecie_t defaultParam = AliRecoParam::kLowMult) | |
43 | { | |
44 | /// set the reconstruction parameters and store them in the OCDB ($ALICE_ROOT/MUON/Calib/RecoParam/). | |
45 | /// - make a CDB entry for the run range [startRun, endRun] | |
46 | /// - "defaultParam" specifies the parameters to be used as default | |
47 | ||
48 | // init CDB | |
49 | AliCDBManager* man = AliCDBManager::Instance(); | |
162637e4 | 50 | if(!man->IsDefaultStorageSet()) man->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); |
913f1b43 | 51 | man->SetRun(startRun); |
52 | ||
53 | // set RecoParams | |
54 | AliMUONRecoParam *param; | |
55 | TObjArray recoParams; | |
c6e702f8 | 56 | /* |
913f1b43 | 57 | // set parameters for p-p runs |
58 | param = AliMUONRecoParam::GetLowFluxParam(); | |
59 | recoParams.AddLast(param); | |
60 | ||
61 | // set parameters for Pb-Pb runs | |
62 | param = AliMUONRecoParam::GetHighFluxParam(); | |
63 | recoParams.AddLast(param); | |
c6e702f8 | 64 | */ |
65 | ||
913f1b43 | 66 | // set parameters for cosmic runs |
67 | param = AliMUONRecoParam::GetCosmicParam(); | |
68 | recoParams.AddLast(param); | |
c6e702f8 | 69 | |
70 | // set (dummy) parameters for calibration runs | |
71 | param = AliMUONRecoParam::GetCalibrationParam(); | |
72 | recoParams.AddLast(param); | |
73 | ||
913f1b43 | 74 | // identify default parameters (exit if identification failed) |
75 | Bool_t defaultIsSet = kFALSE; | |
76 | TIter next(recoParams.MakeIterator()); | |
77 | while ( (param = static_cast<AliMUONRecoParam*>(next())) ) { | |
78 | if (param->GetEventSpecie() == defaultParam) { | |
79 | param->SetAsDefault(); | |
80 | defaultIsSet = kTRUE; | |
81 | } | |
82 | param->Print("FULL"); | |
83 | } | |
84 | if (!defaultIsSet) { | |
85 | cout<<"The default reconstruction parameters are not set! Exiting..."<<endl; | |
86 | return; | |
87 | } | |
88 | ||
89 | // save RecoParam in CDB | |
90 | AliMUONCDB cdb; | |
91 | cdb.WriteToCDB(&recoParams, "MUON/Calib/RecoParam", startRun, endRun, "reconstruction parameters for MUON", "Philippe Pillot"); | |
92 | ||
93 | } | |
94 |