Extacting the OCDB in a separate module. The detectors have write permission in the...
[u/mrichter/AliRoot.git] / TRD / Macros / AliTRDreadRaw2Clusters.C
CommitLineData
ac01a9e7 1void AliTRDreadRaw2Clusters(const char *fname = "raw.root", const char *fnameGeom = "./geometry.root")
2{
3 AliCDBManager *cdb = AliCDBManager::Instance();
162637e4 4 cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
ac01a9e7 5 cdb->SetRun(0);
6
7 TFile *fGeometryFile = TFile::Open(fnameGeom);
8 TGeoManager *fGeoManager = 0;
9 if (fGeometryFile)
10 {
11 fGeoManager = (TGeoManager *)fGeometryFile->Get("Geometry");
12 }
13
14 if (fGeoManager == 0)
15 {
16 cout << "Geo Manager init failed." << endl;
17 }
18
19 AliTRDdigitsManager manR;
20 manR.CreateArrays();
21
22 AliRawReaderRoot reader(fname, 0);
23 reader.Select("TRD");
24
25 Int_t ievent = 0;
26 while (reader.NextEvent())
27 {
28 TTree *treeR = new TTree(sdir, "TRD clusters");
29 AliTRDclusterizer clusterizer("TRDclusterizer", "TRDclusterizer");
30 clusterizer.OpenOutput(treeR);
31 Int_t ir = clusterizer.Raw2ClustersChamber(&reader);
32
33 cout << "Clusterizer returned " << ir << endl;
34
35 // do something witht he clusters...
36
37 ievent++;
38 }
39
40}