FillESD fills ESDCaloCluster and ESDCaloCells
[u/mrichter/AliRoot.git] / T0 / TestPreprocessor.C
CommitLineData
dc7ca31d 1void TestPreprocessor()
2{
3 gSystem->Load("libT0shuttle.so");
4 gSystem->Load("$ALICE_ROOT/SHUTTLE/TestShuttle/libTestShuttle.so");
5
6
a6c2af33 7 AliTestShuttle::SetMainCDB("local://./TestCDB");
8 AliTestShuttle::SetLocalCDB("local://./TestCDB");
9
10 AliTestShuttle::SetMainRefStorage("local://./TestRef");
11 AliTestShuttle::SetLocalRefStorage("local://./TestRef");
dc7ca31d 12
13 AliTestShuttle* shuttle = new AliTestShuttle(0, 0, 1);
14
15 TMap* dcsAliasMap = CreateDCSAliasMap();
16
17 shuttle->SetDCSInput(dcsAliasMap);
a6c2af33 18
19 shuttle->SetInputRunType("PHYSICS");
dc7ca31d 20
21 shuttle->AddInputFile(AliTestShuttle::kDAQ, "T00", "TIME", "LDC0", "DAQfile.root");
22
a6c2af33 23 AliPreprocessor* start = new AliT0Preprocessor(shuttle);
dc7ca31d 24
25 shuttle->Process();
a6c2af33 26
27 AliCDBManager::Instance()->SetDefaultStorage("local://TestCDB");
dc7ca31d 28
29 AliCDBEntry* entry = AliCDBManager::Instance()->Get("T00/Calib/Data", 0);
30 if (!entry)
31 {
32 printf("The file is not there. Something went wrong.\n");
33 return;
34 }
35
36 AliT0Calc* output = dynamic_cast<AliT0Calc*> (entry->GetObject());
37
38 // output->Print();
39}
40
41TMap* CreateDCSAliasMap()
42{
43 TMap* aliasMap = new TMap;
44 aliasMap->SetOwner(1);
45
46 for(int nAlias=0;nAlias<24;nAlias++)
47 {
48 TObjArray* valueSet = new TObjArray;
49 valueSet->SetOwner(1);
50
51 TString aliasName="T0HV";
52 aliasName += nAlias;
53
54 for (int timeStamp=0;timeStamp<1;timeStamp++)
55 {
56 AliDCSValue* dcsVal = new AliDCSValue((Float_t) nAlias, timeStamp);
57 valueSet->Add(dcsVal);
58// printf("hello! dcsVal= %d %d\n" ,dcsVal->GetFloat(), dcsVal->GetTimeStamp());
59 }
60 aliasMap->Add(new TObjString(aliasName), valueSet);
61 }
62
63 return aliasMap;
64}
65
66TMap* ReadDCSAliasMap()
67{
68 AliCDBEntry *entry = AliCDBManager::Instance()->Get("DET/DCS/Data", 0);
69 return dynamic_cast<TMap*> (entry->GetObject());
70}
71
72void WriteDCSAliasMap()
73{
74 TMap* dcsAliasMap = CreateDCSAliasMap();
75
76 AliCDBMetaData metaData;
77 metaData.SetBeamPeriod(0);
78 metaData.SetResponsible("Responsible person");
79 metaData.SetComment("Test object for TestPreprocessor.C");
80
81 AliCDBId id("DET/DCS/Data", 0, 0);
82
83 // initialize location of CDB
84 AliCDBManager::Instance()->SetDefaultStorage("local://./TestCDB");
85
86 AliCDBManager::Instance()->Put(dcsAliasMap, id, &metaData);
87}