+void AliEveTOFDigitsInfo::ReadRaw(AliRawReader* rawReader, Int_t nEvent)
+{
+ // Read raw-data. AliTOFdigit is used to
+ // store raw-adata for all sub-detectors.
+
+ //ofstream ftxt;
+ //Char_t fileName[100];
+ //sprintf(fileName,"TOFrawDataReadingFromEVE%d.txt",nEvent);
+
+ //ftxt.open(fileName,ios::app);
+ //ftxt << endl;
+ //ftxt << " " << nEvent << endl;
+
+ const Int_t kDDL = AliDAQ::NumberOfDdls("TOF");
+
+ TClonesArray *tofDigits = new TClonesArray("AliTOFdigit",10000);
+ fTree = new TTree();
+ Int_t bufsize = 32000;
+ TBranch *branch = fTree->Branch("TOF", &tofDigits, bufsize);
+ fTree->GetEntry(0);
+
+ TClonesArray * clonesRawData = 0x0;
+
+ Int_t detectorIndex[5];
+ Int_t digit[4];
+
+ AliTOFRawStream stream(rawReader);
+
+ for (Int_t indexDDL = 0; indexDDL < kDDL; indexDDL++) {
+
+ rawReader->Reset();
+ stream.LoadRawData(indexDDL);
+
+ clonesRawData = (TClonesArray*)stream.GetRawData();
+
+ for (Int_t iRawData = 0; iRawData<clonesRawData->GetEntriesFast(); iRawData++) {
+
+ AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData);
+
+ if (tofRawDatum->GetTOT()==-1 || tofRawDatum->GetTOF()==-1) continue;
+
+ digit[0] = tofRawDatum->GetTOF();
+ digit[1] = tofRawDatum->GetTOT();
+ digit[2] = tofRawDatum->GetTOT();
+ digit[3] = -1;
+ /*
+ if (indexDDL<10) ftxt << " " << indexDDL;
+ else ftxt << " " << indexDDL;
+ if (tofRawDatum->GetTRM()<10) ftxt << " " << tofRawDatum->GetTRM();
+ else ftxt << " " << tofRawDatum->GetTRM();
+ ftxt << " " << tofRawDatum->GetTRMchain();
+ if (tofRawDatum->GetTDC()<10) ftxt << " " << tofRawDatum->GetTDC();
+ else ftxt << " " << tofRawDatum->GetTDC();
+ ftxt << " " << tofRawDatum->GetTDCchannel();
+ */
+ stream.EquipmentId2VolumeId(indexDDL, tofRawDatum->GetTRM(), tofRawDatum->GetTRMchain(),
+ tofRawDatum->GetTDC(), tofRawDatum->GetTDCchannel(), detectorIndex);
+ //dummy = detectorIndex[3];
+ //detectorIndex[3] = detectorIndex[4];
+ //detectorIndex[4] = dummy;
+ /*
+ if (detectorIndex[0]<10) ftxt << " -> " << detectorIndex[0];
+ else ftxt << " -> " << detectorIndex[0];
+ ftxt << " " << detectorIndex[1];
+ if (detectorIndex[2]<10) ftxt << " " << detectorIndex[2];
+ else ftxt << " " << detectorIndex[2];
+ ftxt << " " << detectorIndex[3];
+ if (detectorIndex[4]<10) ftxt << " " << detectorIndex[4];
+ else ftxt << " " << detectorIndex[4];
+
+ if (tofRawDatum->GetTOT()<10) ftxt << " " << tofRawDatum->GetTOT();
+ else if (tofRawDatum->GetTOT()>=10 && tofRawDatum->GetTOT()<100) ftxt << " " << tofRawDatum->GetTOT();
+ else if (tofRawDatum->GetTOT()>=100 && tofRawDatum->GetTOT()<1000) ftxt << " " << tofRawDatum->GetTOT();
+ else if (tofRawDatum->GetTOT()>=1000 && tofRawDatum->GetTOT()<10000) ftxt << " " << tofRawDatum->GetTOT();
+ else if (tofRawDatum->GetTOT()>=10000 && tofRawDatum->GetTOT()<100000) ftxt << " " << tofRawDatum->GetTOT();
+ else if (tofRawDatum->GetTOT()>=100000 && tofRawDatum->GetTOT()<1000000) ftxt << " " << tofRawDatum->GetTOT();
+ else ftxt << " " << tofRawDatum->GetTOT();
+ if (tofRawDatum->GetTOF()<10) ftxt << " " << tofRawDatum->GetTOF() << endl;
+ else if (tofRawDatum->GetTOF()>=10 && tofRawDatum->GetTOF()<100) ftxt << " " << tofRawDatum->GetTOF() << endl;
+ else if (tofRawDatum->GetTOF()>=100 && tofRawDatum->GetTOF()<1000) ftxt << " " << tofRawDatum->GetTOF() << endl;
+ else if (tofRawDatum->GetTOF()>=1000 && tofRawDatum->GetTOF()<10000) ftxt << " " << tofRawDatum->GetTOF() << endl;
+ else if (tofRawDatum->GetTOF()>=10000 && tofRawDatum->GetTOF()<100000) ftxt << " " << tofRawDatum->GetTOF() << endl;
+ else if (tofRawDatum->GetTOF()>=100000 && tofRawDatum->GetTOF()<1000000) ftxt << " " << tofRawDatum->GetTOF() << endl;
+ else ftxt << " " << tofRawDatum->GetTOF() << endl;
+ */
+
+ TClonesArray &aDigits = *tofDigits;
+ Int_t last = tofDigits->GetEntriesFast();
+
+ fTOFdigitMap->AddDigit(detectorIndex, last);
+
+ AliDebug(2,Form(" %3i -> %2i %2i %2i %2i %2i %i %i\n",
+ last, detectorIndex[0], detectorIndex[1], detectorIndex[2], detectorIndex[4], detectorIndex[3],
+ digit[1], digit[0]));
+
+ Int_t tracknum[3]={-1,-1,-1};
+ new (aDigits[last]) AliTOFdigit(tracknum, detectorIndex, digit);
+
+ } // while loop
+
+ clonesRawData->Clear();
+
+ } // DDL Loop
+
+ fTree->Fill();
+
+ //ftxt.close();