#include "AliTOFdigit.h"
#include "AliTOFGeometry.h"
#include "AliTOFrawData.h"
-//#include "AliTOFRawStream.h"
#include "AliTOFDeltaBCOffset.h"
#include "AliTOFCTPLatency.h"
}
//------------------------------------------------------------------------
-AliTOFClusterFinder::AliTOFClusterFinder(const AliTOFClusterFinder &source)
- :TTask(source),
+AliTOFClusterFinder::AliTOFClusterFinder(const AliTOFClusterFinder &source) :
+ TTask(source),
fRunLoader(0),
fTOFLoader(0),
fTreeD(0),
AliFatal("AliTOFClusterFinder: Can not get TreeD");
}
- TBranch *branch = fTreeD->GetBranch("TOF");
- if (!branch) {
- AliError("can't get the branch with the TOF digits !");
- return;
- }
-
- TClonesArray staticdigits("AliTOFdigit",10000);
- staticdigits.Clear();
- TClonesArray *digits =&staticdigits;
- branch->SetAddress(&digits);
+ fDigits->Clear();
+ fTreeD->GetBranch("TOF")->SetAutoDelete(kFALSE);
+ fTreeD->SetBranchAddress("TOF",&fDigits);
ResetRecpoint();
fTreeR->Branch("TOF", &fRecPoints, bufsize);
fTreeD->GetEvent(0);
- Int_t nDigits = digits->GetEntriesFast();
+ Int_t nDigits = fDigits->GetEntriesFast();
AliDebug(2,Form("Number of TOF digits: %d",nDigits));
Int_t ii;
Int_t parTOF[7]={0,0,0,0,0,0,0}; //The TOF signal parameters
Bool_t status=kTRUE; // assume all sim channels ok in the beginning...
for (ii=0; ii<nDigits; ii++) {
- AliTOFdigit *d = (AliTOFdigit*)digits->UncheckedAt(ii);
+ AliTOFdigit *d = (AliTOFdigit*)fDigits->UncheckedAt(ii);
dig[0]=d->GetSector();
dig[1]=d->GetPlate();
dig[2]=d->GetStrip();
Int_t inholes = 0;
- /// fRunLoader->GetEvent(iEvent);
-
if (digitsTree == 0x0)
{
AliFatal("AliTOFClusterFinder: Can not get TreeD");
}
- TBranch *branch = digitsTree->GetBranch("TOF");
- if (!branch) {
- AliError("can't get the branch with the TOF digits !");
- return;
- }
-
- TClonesArray staticdigits("AliTOFdigit",10000);
- staticdigits.Clear();
- TClonesArray *digits = & staticdigits;
- branch->SetAddress(&digits);
+ fDigits->Clear();
+ digitsTree->GetBranch("TOF")->SetAutoDelete(kFALSE);
+ digitsTree->SetBranchAddress("TOF",&fDigits);
ResetRecpoint();
-
- fTreeR=clusterTree;
Int_t bufsize = 32000;
- fTreeR->Branch("TOF", &fRecPoints, bufsize);
+ clusterTree->Branch("TOF", &fRecPoints, bufsize);
digitsTree->GetEvent(0);
- Int_t nDigits = digits->GetEntriesFast();
+ Int_t nDigits = fDigits->GetEntriesFast();
AliDebug(2,Form("Number of TOF digits: %d",nDigits));
Int_t ii;
Int_t parTOF[7]={0,0,0,0,0,0,0}; //The TOF signal parameters
Bool_t status=kTRUE; // assume all sim channels ok in the beginning...
for (ii=0; ii<nDigits; ii++) {
- AliTOFdigit *d = (AliTOFdigit*)digits->UncheckedAt(ii);
+ AliTOFdigit *d = (AliTOFdigit*)fDigits->UncheckedAt(ii);
dig[0]=d->GetSector();
dig[1]=d->GetPlate();
dig[2]=d->GetStrip();
clustersTree->Branch("TOF", &fRecPoints, bufsize);
TClonesArray * clonesRawData;
-
Int_t dummy = -1;
Int_t detectorIndex[5];
ofstream ftxt;
if (fVerbose==2) ftxt.open("TOFdigitsRead.txt",ios::app);
- //AliTOFRawStream tofInput(rawReader);
fTOFRawStream.Clear();
fTOFRawStream.SetRawReader(rawReader);
}
clonesRawData = (TClonesArray*)fTOFRawStream.GetRawData();
-
+
for (Int_t iRawData = 0; iRawData<clonesRawData->GetEntriesFast(); iRawData++) {
AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData);
} // closed loop on TOF raw data per current DDL file
- clonesRawData->Clear();
+ clonesRawData->Clear("C");
} // closed loop on DDL index
ofstream ftxt;
if (fVerbose==2) ftxt.open("TOFdigitsRead.txt",ios::app);
- //AliTOFRawStream tofInput(rawReader);
fTOFRawStream.Clear();
fTOFRawStream.SetRawReader(rawReader);
} // closed loop on TOF raw data per current DDL file
- clonesRawData->Clear();
+ clonesRawData->Clear("C");
} // closed loop on DDL index
fTreeD = fTOFLoader->TreeD();
}
- TClonesArray *tofDigits = new TClonesArray("AliTOFdigit",10000);
Int_t bufsize = 32000;
- fTreeD->Branch("TOF", &tofDigits, bufsize);
+ fDigits->Clear();
+ fTreeD->Branch("TOF", &fDigits, bufsize);
fRunLoader->GetEvent(iEvent);
Int_t detectorIndex[5];
Int_t digit[4];
- //AliTOFRawStream tofInput(rawReader);
fTOFRawStream.Clear();
fTOFRawStream.SetRawReader(rawReader);
Int_t tracknum[3]={-1,-1,-1};
- TClonesArray &aDigits = *tofDigits;
- Int_t last=tofDigits->GetEntriesFast();
+ TClonesArray &aDigits = *fDigits;
+ Int_t last=fDigits->GetEntriesFast();
new (aDigits[last]) AliTOFdigit(tracknum, detectorIndex, digit);
} // while loop
- clonesRawData->Clear();
+ clonesRawData->Clear("C");
} // DDL Loop
fTOFLoader = fRunLoader->GetLoader("TOFLoader");
fTOFLoader->WriteDigits("OVERWRITE");
- delete tofDigits;
-
AliDebug(1, Form("Execution time to read TOF raw data and to write TOF clusters : R:%.2fs C:%.2fs",
stopwatch.RealTime(),stopwatch.CpuTime()));
return;
}
- TClonesArray *tofDigits = new TClonesArray("AliTOFdigit",10000);
Int_t bufsize = 32000;
- digitsTree->Branch("TOF", &tofDigits, bufsize);
+ digitsTree->Branch("TOF", &fDigits, bufsize);
TClonesArray * clonesRawData;
-
Int_t dummy = -1;
Int_t detectorIndex[5];
Int_t digit[4];
- //AliTOFRawStream tofInput(rawReader);
fTOFRawStream.Clear();
fTOFRawStream.SetRawReader(rawReader);
Int_t tracknum[3]={-1,-1,-1};
- TClonesArray &aDigits = *tofDigits;
- Int_t last=tofDigits->GetEntriesFast();
+ TClonesArray &aDigits = *fDigits;
+ Int_t last=fDigits->GetEntriesFast();
new (aDigits[last]) AliTOFdigit(tracknum, detectorIndex, digit);
} // while loop
- clonesRawData->Clear();
+ clonesRawData->Clear("C");
} // DDL Loop
digitsTree->Fill();
- delete tofDigits;
-
AliDebug(1, Form("Got %d digits: ", fDigits->GetEntries()));
AliDebug(1, Form("Execution time to read TOF raw data and fill TOF digit tree : R:%.2fs C:%.2fs",
stopwatch.RealTime(),stopwatch.CpuTime()));