1 //_____________________________________________________//
3 // This macro reads ACORDE DDL Raw Data and //
4 // converts it into Digits //
6 //____________________________________________________ //
9 void ACORDERaw2Digits(Int_t nEvents = 1, char* fileName = "rawdata.root")
11 // Reads DDL data from fileName
16 // Creates a TreeD to dump Digits
18 AliRunLoader* rl = AliRunLoader::Open("galice.root");
20 AliACORDELoader* loader = (AliACORDELoader*) rl->GetLoader("ACORDELoader");
23 AliError("no ACORDE loader found");
26 TTree* treeD = loader->TreeD();
28 loader->MakeTree("D");
29 treeD = loader->TreeD(); }
32 AliACORDEdigit* pdigit = &digit;
33 const Int_t kBufferSize = 4000;
35 treeD->Branch("ACORDE", "AliACORDEdigit", &pdigit, kBufferSize);
37 AliRawReader* rawReader = 0x0;
38 // rawReader = new AliRawReaderFile(fileName); // DDL files
39 rawReader = new AliRawReaderRoot(fileName); // DDL files
41 AliACORDERawStream* rawStream = new AliACORDERawStream(rawReader);
43 for (Int_t i=0; i<nEvents; i++) {
44 printf("=========== EVENT %d ===========\n",i);
45 if (!rawReader->NextEvent())
49 if (!rawStream->Next())
51 printf("Data size is %d\n",rawStream->DataSize());
53 for(Int_t i=0; i<64; i++) {
54 new(pdigit) AliACORDEdigit(i, (Int_t)rawStream->GetADC(i), (Int_t)rawStream->GetTime(i));
58 // Checks if everything is OK by printing results
60 // for(int i=0;i<64;i++) {
61 // printf("Channel %d : %d %d \n",i,rawStream->GetADC(i),rawStream->GetTime(i)); }
62 // treeD->Print(); printf(" \n");
65 loader->WriteDigits("OVERWRITE");
66 loader->UnloadDigits();