2222#include <vector>
2323#include <string>
2424
25+ #include "CCDB/BasicCCDBManager.h"
2526#define ENABLE_UPGRADES
2627#include "ITSMFTSimulation/AlpideSimResponse.h"
2728#include "ITS3Simulation/ChipSimResponse.h"
@@ -37,41 +38,37 @@ double cm2um(double cm) { return cm * 1e+4; }
3738
3839std ::unique_ptr < o2 ::its3 ::ChipSimResponse > mAlpSimResp0 , mAlpSimResp1 , mAptSimResp1 ;
3940
40- std ::unique_ptr < o2 ::its3 ::ChipSimResponse > loadResponse (const std ::string & fileName , const std :: string & respName )
41+ std ::unique_ptr < o2 ::its3 ::ChipSimResponse > loadResponse (const std ::string & path )
4142{
42- TFile * f = TFile ::Open (fileName .data ());
43- if (!f ) {
44- std ::cerr << fileName << " not found" << std ::endl ;
45- return nullptr ;
46- }
47- auto base = f -> Get < o2 ::itsmft ::AlpideSimResponse > (respName .c_str ());
43+ auto& cdb = o2 ::ccdb ::BasicCCDBManager ::instance ();
44+ o2 ::itsmft ::AlpideSimResponse * base = cdb .get < o2 ::itsmft ::AlpideSimResponse > (path );
4845 if (!base ) {
49- std ::cerr << respName << " not found in " << fileName << std :: endl ;
46+ std ::cerr << path << " not found in " << '\n' ;
5047 return nullptr ;
5148 }
5249 return std ::make_unique < o2 ::its3 ::ChipSimResponse > (base );
5350}
5451
5552void LoadRespFunc ()
5653{
57- std :: string AptsFile = "$(O2_ROOT)/share/Detectors/Upgrades/ITS3/data/ITS3ChipResponseData/APTSResponseData.root" ;
58- std :: string AlpideFile = "$(O2_ROOT)/share/Detectors/ITSMFT/data/AlpideResponseData/AlpideResponseData.root" ;
54+ auto & cdb = o2 :: ccdb :: BasicCCDBManager :: instance () ;
55+ cdb . setURL ( "https://alice-ccdb.cern.ch/" ) ;
5956
6057 std ::cout << "=====================\n" ;
6158 LOGP (info , "ALPIDE Vbb=0V response" );
62- mAlpSimResp0 = loadResponse (AlpideFile , "response0 " ); // Vbb=0V
59+ mAlpSimResp0 = loadResponse ("ITSMFT/Calib/ALPIDEResponseVbb0 " ); // Vbb=0V
6360 mAlpSimResp0 -> computeCentreFromData ();
6461 mAlpSimResp0 -> print ();
6562 LOGP (info , "Response Centre {}" , mAlpSimResp0 -> getRespCentreDep ());
6663 std ::cout << "=====================\n" ;
6764 LOGP (info , "ALPIDE Vbb=-3V response" );
68- mAlpSimResp1 = loadResponse (AlpideFile , "response1 " ); // Vbb=-3V
65+ mAlpSimResp1 = loadResponse ("ITSMFT/Calib/ALPIDEResponseVbbM3 " ); // Vbb=-3V
6966 mAlpSimResp1 -> computeCentreFromData ();
7067 mAlpSimResp1 -> print ();
7168 LOGP (info , "Response Centre {}" , mAlpSimResp1 -> getRespCentreDep ());
7269 std ::cout << "=====================\n" ;
7370 LOGP (info , "APTS response" );
74- mAptSimResp1 = loadResponse (AptsFile , "response1 " ); // APTS
71+ mAptSimResp1 = loadResponse ("IT3/Calib/APTSResponse " ); // APTS
7572 mAptSimResp1 -> computeCentreFromData ();
7673 mAptSimResp1 -> print ();
7774 LOGP (info , "Response Centre {}" , mAptSimResp1 -> getRespCentreDep ());
0 commit comments