]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/macros/CreateDefaultCDBEntries.C
9040becb55640c95eca38ebd4d2d765c258af5d8
[u/mrichter/AliRoot.git] / HLT / MUON / macros / CreateDefaultCDBEntries.C
1 /**************************************************************************
2  * This file is property of and copyright by the ALICE HLT Project        *
3  * All rights reserved.                                                   *
4  *                                                                        *
5  * Primary Authors:                                                       *
6  *   Artur Szostak <artursz@iafrica.com>                                  *
7  *                                                                        *
8  * Permission to use, copy, modify and distribute this software and its   *
9  * documentation strictly for non-commercial purposes is hereby granted   *
10  * without fee, provided that the above copyright notice appears in all   *
11  * copies and that both the copyright notice and this permission notice   *
12  * appear in the supporting documentation. The authors make no claims     *
13  * about the suitability of this software for any purpose. It is          *
14  * provided "as is" without express or implied warranty.                  *
15  **************************************************************************/
16
17 /* $Id: $ */
18
19 /**
20  * \ingroup macros
21  * \file CreateDefaultCDBEntries.C
22  * \brief Macro for generating default CDB entries for dHLT.
23  *
24  * This macro is used to generate some default CDB entries for the dHLT.
25  * It is an experts macro so make sure you know what you are doing.
26  *
27  * The simplest way to run this macro with defaults is to copy "rootlogon.C" from
28  * $ALICE_ROOT/HLT/MUON/macros into your current working directory, then from
29  * the shell command prompt run the following command:
30  * \code
31  *   > aliroot -b -q -l $ALICE_ROOT/HLT/MUON/macros/CreateDefaultCDBEntries.C+
32  * \endcode
33  *
34  * \author Artur Szostak <artursz@iafrica.com>
35  */
36
37 #if !defined(__CINT__) || defined(__MAKECINT__)
38 #include "AliCDBManager.h"
39 #include "AliCDBStorage.h"
40 #include "AliCDBEntry.h"
41 #include "AliHLTMUONConstants.h"
42 #include "TMap.h"
43 #include "TObjString.h"
44 #include "TString.h"
45 #include <iostream>
46 using std::cerr;
47 using std::endl;
48 #endif
49
50 /**
51  * Generates default CDB entries in the given CDB storage (local by default)
52  * \param cdbPath  The path to the local storage.
53  */
54 void CreateDefaultCDBEntries(const char* cdbPath = "local://$ALICE_ROOT/OCDB")
55 {
56         // Setup the CDB default storage and run number.
57         AliCDBManager* cdbManager = AliCDBManager::Instance();
58         if (cdbManager == NULL)
59         {
60                 cerr << "ERROR: Global CDB manager object does not exist." << endl;
61                 return;
62         }
63         
64         AliCDBStorage* storage = cdbManager->GetStorage(cdbPath);
65         if (storage == NULL)
66         {
67                 cerr << "ERROR: Could not get storage for: " << cdbPath << endl;
68                 return;
69         }
70         
71         Int_t verison = 0;
72         Int_t firstRun = 0;
73         Int_t lastRun = AliCDBRunRange::Infinity();
74         
75         const char* path = NULL;
76         AliCDBMetaData* metaData = NULL;
77         TMap* params = NULL;
78         AliCDBId id;
79         
80         // Create and store the configuration parameters for the trigger reconstructor.
81         params = new TMap;
82         params->SetOwner(kTRUE);
83         params->Add(new TObjString("zmiddle"), new TObjString("-975"));
84         params->Add(new TObjString("bfieldintegral"), new TObjString("3"));
85         
86         path = AliHLTMUONConstants::TriggerReconstructorCDBPath();
87         id = AliCDBId(path, firstRun, lastRun, verison);
88         metaData = new AliCDBMetaData();
89         metaData->SetResponsible("dimuon HLT");
90         metaData->SetComment("Trigger reconstructor configuration parameters for dimuon HLT.");
91         storage->Put(params, id, metaData);
92         
93         // Create and store the configuration parameters for the hit reconstructor.
94         params = new TMap;
95         params->SetOwner(kTRUE);
96         params->Add(new TObjString("dccut"), new TObjString("50"));
97         
98         path = AliHLTMUONConstants::HitReconstructorCDBPath();
99         id = AliCDBId(path, firstRun, lastRun, verison);
100         metaData = new AliCDBMetaData();
101         metaData->SetResponsible("dimuon HLT");
102         metaData->SetComment("Hit reconstructor DC cut parameter for dimuon HLT.");
103         storage->Put(params, id, metaData);
104         
105         // Create and store the configuration parameters for the Manso tracker.
106         params = new TMap;
107         params->SetOwner(kTRUE);
108         params->Add(new TObjString("zmiddle"), new TObjString("-975"));
109         params->Add(new TObjString("bfieldintegral"), new TObjString("3"));
110         params->Add(new TObjString("roi_paramA_chamber7"), new TObjString("0.016"));
111         params->Add(new TObjString("roi_paramB_chamber7"), new TObjString("2.0"));
112         params->Add(new TObjString("roi_paramA_chamber8"), new TObjString("0.016"));
113         params->Add(new TObjString("roi_paramB_chamber8"), new TObjString("2.0"));
114         params->Add(new TObjString("roi_paramA_chamber9"), new TObjString("0.02"));
115         params->Add(new TObjString("roi_paramB_chamber9"), new TObjString("3.0"));
116         params->Add(new TObjString("roi_paramA_chamber10"), new TObjString("0.02"));
117         params->Add(new TObjString("roi_paramB_chamber10"), new TObjString("3.0"));
118         params->Add(new TObjString("chamber7postion"), new TObjString("-1274.5"));
119         params->Add(new TObjString("chamber8postion"), new TObjString("-1305.5"));
120         params->Add(new TObjString("chamber9postion"), new TObjString("-1408.6"));
121         params->Add(new TObjString("chamber10postion"), new TObjString("-1439.6"));
122         params->Add(new TObjString("chamber11postion"), new TObjString("-1603.5"));
123         params->Add(new TObjString("chamber13postion"), new TObjString("-1703.5"));
124         
125         path = AliHLTMUONConstants::MansoTrackerFSMCDBPath();
126         id = AliCDBId(path, firstRun, lastRun, verison);
127         metaData = new AliCDBMetaData();
128         metaData->SetResponsible("dimuon HLT");
129         metaData->SetComment("Manso tracker FSM component configuration parameters for dimuon HLT.");
130         storage->Put(params, id, metaData);
131         
132         // Create and store the configuration parameters for the trigger decision cuts.
133         params = new TMap;
134         params->SetOwner(kTRUE);
135         params->Add(new TObjString("lowptcut"), new TObjString("1"));
136         params->Add(new TObjString("highptcut"), new TObjString("2"));
137         params->Add(new TObjString("lowmasscut"), new TObjString("2.5"));
138         params->Add(new TObjString("highmasscut"), new TObjString("7"));
139         
140         path = AliHLTMUONConstants::DecisionComponentCDBPath();
141         id = AliCDBId(path, firstRun, lastRun, verison);
142         metaData = new AliCDBMetaData();
143         metaData->SetResponsible("dimuon HLT");
144         metaData->SetComment("Trigger decision cuts for dimuon HLT.");
145         storage->Put(params, id, metaData);
146 }