]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSTrackSegmentMaker.cxx
Elaborating split mode to write data only to the split files
[u/mrichter/AliRoot.git] / PHOS / AliPHOSTrackSegmentMaker.cxx
index 44f11661b14e93f6604562426afe523c5a4e56ee..ba25ac94caf6852731d2f8968bd92a28c42bea71 100644 (file)
 // Algorithm Base class to construct PHOS track segments
 // Associates EMC and PPSD clusters
 // Unfolds the EMC cluster   
 // Algorithm Base class to construct PHOS track segments
 // Associates EMC and PPSD clusters
 // Unfolds the EMC cluster   
-//                  
+//*-- 
 //*-- Author: Dmitri Peressounko (RRC Ki & SUBATECH)
 
 
 // --- ROOT system ---
 //*-- Author: Dmitri Peressounko (RRC Ki & SUBATECH)
 
 
 // --- ROOT system ---
-
-#include "TObjArray.h"
-#include "TClonesArray.h"
+#include "TGeometry.h"
+#include "TFile.h"
+#include "TTree.h"
 
 // --- Standard library ---
 
 // --- Standard library ---
+#include <iostream.h>
+#include <stdlib.h>   
 
 // --- AliRoot header files ---
 
 // --- AliRoot header files ---
-
+#include "AliRun.h" 
 #include "AliPHOSTrackSegmentMaker.h"
 #include "AliPHOSTrackSegmentMaker.h"
-#include "AliPHOSTrackSegment.h"
-#include "AliPHOSIndexToObject.h"
-#include "AliPHOSLink.h"
-#include "AliPHOSv0.h"
-#include "AliRun.h"
+#include "AliHeader.h" 
 
 ClassImp( AliPHOSTrackSegmentMaker) 
 
 
 //____________________________________________________________________________
 
 ClassImp( AliPHOSTrackSegmentMaker) 
 
 
 //____________________________________________________________________________
- AliPHOSTrackSegmentMaker:: AliPHOSTrackSegmentMaker() : fNTrackSegments(0)
+  AliPHOSTrackSegmentMaker:: AliPHOSTrackSegmentMaker() : TTask("","")
+{
+  // ctor
+  fSplitFile= 0 ; 
+
+}
+
+//____________________________________________________________________________
+AliPHOSTrackSegmentMaker::AliPHOSTrackSegmentMaker(const char * headerFile, const char * name, const Bool_t toSplit): TTask(name, headerFile)
 {
   // ctor
 {
   // ctor
-  fGeom = AliPHOSGeometry::GetInstance() ;
-  fPlease = AliPHOSIndexToObject::GetInstance() ; 
+  fSplitFile= 0 ; 
+  fToSplit  = toSplit ;
+}
 
 
+//____________________________________________________________________________
+AliPHOSTrackSegmentMaker::~AliPHOSTrackSegmentMaker()
+{
+   
+      fSplitFile = 0 ;
 }
 
 }
 
+// //____________________________________________________________________________
+// void AliPHOSTrackSegmentMaker::SetSplitFile(const TString splitFileName) const
+// {
+//   // 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 ;   
+// }