ClassImp(AliPMDClusterFinder)
-AliPMDClusterFinder::AliPMDClusterFinder():
- fRunLoader(0),
- fPMDLoader(0),
+AliPMDClusterFinder::AliPMDClusterFinder(AliRunLoader* runLoader):
+ fRunLoader(runLoader),
+ fPMDLoader(runLoader->GetLoader("PMDLoader")),
fTreeD(0),
fTreeR(0),
- fDigits(0),
+ fDigits(new TClonesArray("AliPMDdigit", 1000)),
fRecpoints(new TClonesArray("AliPMDrecpoint1", 1000)),
fNpoint(0),
fDebug(0),
fEcut(0.)
{
//
-// Default Constructor
+// Constructor
//
}
// ------------------------------------------------------------------------- //
AliPMDClusterFinder::~AliPMDClusterFinder()
{
// Destructor
+ if (fDigits)
+ {
+ fDigits->Delete();
+ delete fDigits;
+ fDigits=0;
+ }
if (fRecpoints)
{
fRecpoints->Delete();
}
// ------------------------------------------------------------------------- //
-void AliPMDClusterFinder::OpengAliceFile(const Char_t *file, Option_t *option)
-{
- // Loads galice.root file and corresponding header, kinematics
- // hits and sdigits or digits depending on the option
- //
- fRunLoader = AliRunLoader::Open(file,AliConfig::GetDefaultEventFolderName(),
- "UPDATE");
-
- if (!fRunLoader)
- {
- Error("Open","Can not open session for file %s.",file);
- }
-
- fRunLoader->LoadgAlice();
- gAlice = fRunLoader->GetAliRun();
-
- if (gAlice)
- {
- printf("<AliPMDdigitizer::Open> ");
- printf("AliRun object found on file.\n");
- }
- else
- {
- printf("<AliPMDdigitizer::Open> ");
- printf("Could not find AliRun object.\n");
- }
- fPMDLoader = fRunLoader->GetLoader("PMDLoader");
- if (fPMDLoader == 0x0)
- {
- cerr<<"OpengAlice : Can not find PMD or PMDLoader\n";
- }
-
- const char *cDR = strstr(option,"DR");
-
- if (cDR)
- {
- fPMDLoader->LoadDigits("READ");
- fPMDLoader->LoadRecPoints("recreate");
- }
-}
-// ------------------------------------------------------------------------- //
-
void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt)
{
// Converts digits to recpoints after running clustering
Float_t clusdata[5];
TObjArray *pmdcont = new TObjArray();
- AliPMDcluster *pmdcl = new AliPMDcluster;
AliPMDClustering *pmdclust = new AliPMDClustering();
pmdclust->SetDebug(fDebug);
pmdclust->SetEdepCut(fEcut);
pmdclust->DoClust(idet,ismn,fCellADC,pmdcont);
Int_t nentries1 = pmdcont->GetEntries();
- cout << " nentries1 = " << nentries1 << endl;
+// cout << " nentries1 = " << nentries1 << endl;
for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
{
- pmdcl = (AliPMDcluster*)pmdcont->UncheckedAt(ient1);
+ AliPMDcluster *pmdcl = (AliPMDcluster*)pmdcont->UncheckedAt(ient1);
idet = pmdcl->GetDetector();
ismn = pmdcl->GetSMN();
clusdata[0] = pmdcl->GetClusX();
if (fRecpoints) fRecpoints->Clear();
}
// ------------------------------------------------------------------------- //
-void AliPMDClusterFinder::UnLoad(Option_t *option)
+void AliPMDClusterFinder::Load()
+{
+ // Load all the *.root files
+ //
+ fPMDLoader->LoadDigits("READ");
+ fPMDLoader->LoadRecPoints("recreate");
+}
+// ------------------------------------------------------------------------- //
+void AliPMDClusterFinder::UnLoad()
{
// Unload all the *.root files
//
- const char *cR = strstr(option,"R");
-
- fRunLoader->UnloadgAlice();
-
- if (cR)
- {
- fPMDLoader->UnloadDigits();
- fPMDLoader->UnloadRecPoints();
- }
+ fPMDLoader->UnloadDigits();
+ fPMDLoader->UnloadRecPoints();
}
// ------------------------------------------------------------------------- //