* provided "as is" without express or implied warranty. *
**************************************************************************/
/* $Id$ */
+
+/* History of cvs commits:
+ *
+ * $Log$
+ * Revision 1.26 2006/08/25 16:00:53 kharlov
+ * Compliance with Effective C++AliPHOSHit.cxx
+ *
+ * Revision 1.25 2005/05/28 14:19:05 schutz
+ * Compilation warnings fixed by T.P.
+ *
+ */
+
//_________________________________________________________________________
// Algorithm Base class to construct PHOS track segments
// Associates EMC and PPSD clusters
// --- ROOT system ---
-#include "TGeometry.h"
-#include "TFile.h"
-#include "TTree.h"
// --- Standard library ---
-#include <iostream.h>
-#include <stdlib.h>
// --- AliRoot header files ---
-#include "AliRun.h"
#include "AliPHOSTrackSegmentMaker.h"
-#include "AliHeader.h"
+#include "AliPHOSGetter.h"
ClassImp( AliPHOSTrackSegmentMaker)
//____________________________________________________________________________
- AliPHOSTrackSegmentMaker:: AliPHOSTrackSegmentMaker() : TTask("","")
+AliPHOSTrackSegmentMaker:: AliPHOSTrackSegmentMaker() :
+ TTask("",""),
+ fEventFolderName(""),
+ fFirstEvent(0),
+ fLastEvent(-1),
+ fESD(0)
{
// ctor
- fSplitFile= 0 ;
-
}
//____________________________________________________________________________
-AliPHOSTrackSegmentMaker::AliPHOSTrackSegmentMaker(const char * headerFile, const char * name): TTask(name, headerFile)
+AliPHOSTrackSegmentMaker::AliPHOSTrackSegmentMaker(const TString alirunFileName,
+ const TString eventFolderName):
+ TTask("PHOS"+AliConfig::Instance()->GetTrackerTaskName(), alirunFileName),
+ fEventFolderName(eventFolderName),
+ fFirstEvent(0),
+ fLastEvent(-1),
+ fESD(0)
{
// ctor
- fSplitFile= 0 ;
}
//____________________________________________________________________________
-AliPHOSTrackSegmentMaker::~AliPHOSTrackSegmentMaker()
+AliPHOSTrackSegmentMaker::AliPHOSTrackSegmentMaker(const AliPHOSTrackSegmentMaker & tsmaker) :
+ TTask(tsmaker),
+ fEventFolderName(tsmaker.GetEventFolderName()),
+ fFirstEvent(tsmaker.GetFirstEvent()),
+ fLastEvent(tsmaker.GetLastEvent()),
+ fESD(tsmaker.GetESD())
{
-
- fSplitFile = 0 ;
-}
+ //Copy constructor
+}
//____________________________________________________________________________
-void AliPHOSTrackSegmentMaker::SetSplitFile(const TString splitFileName) const
+AliPHOSTrackSegmentMaker::~AliPHOSTrackSegmentMaker()
{
- // Diverts the TrackSegments in a file separate from the Digits file
-
-
- TDirectory * cwd = gDirectory ;
- TFile * splitFile = gAlice->InitTreeFile("R",splitFileName.Data());
- splitFile->cd() ;
- gAlice->Write(0, TObject::kOverwrite);
-
- TTree *treeE = gAlice->TreeE();
- if (!treeE) {
- cerr << "ERROR: AliPHOSTrackSegmentMaker::SetSplitFile -> No TreeE found "<<endl;
- abort() ;
- }
-
- // copy TreeE
- AliHeader *header = new AliHeader();
- treeE->SetBranchAddress("Header", &header);
- treeE->SetBranchStatus("*",1);
- TTree *treeENew = treeE->CloneTree();
- treeENew->Write(0, TObject::kOverwrite);
-
- // copy AliceGeom
- TGeometry *AliceGeom = static_cast<TGeometry*>(cwd->Get("AliceGeom"));
- if (!AliceGeom) {
- cerr << "ERROR: AliPHOSTrackSegmentMaker::SetSplitFile -> AliceGeom was not found in the input file "<<endl;
- abort() ;
- }
- AliceGeom->Write(0, TObject::kOverwrite);
-
- gAlice->MakeTree("R",splitFile);
- cwd->cd() ;
- cout << "INFO: AliPHOSTrackSegmentMaker::SetSPlitMode -> TrackSegments will be stored in " << splitFileName.Data() << endl ;
+ //Remove this from the parental task before destroying
+ if(AliPHOSGetter::Instance()->PhosLoader())
+ AliPHOSGetter::Instance()->PhosLoader()->CleanTracker();
}
+