of objects and tasks posted to the folders. gAlice is also deleted (deferred to the getter)
Use case in Reconstruct.C
//////////////////////////////////////////////////////////////////////////////
// --- ROOT system ---
+#include "TGeometry.h"
+#include "TDirectory.h"
+#include "TFile.h"
+#include "TTree.h"
-
// --- Standard library ---
-
-
+#include <iostream.h>
+#include <stdlib.h>
// --- AliRoot header files ---
-
+#include "AliRun.h"
#include "AliPHOSClusterizer.h"
+#include "AliHeader.h"
ClassImp(AliPHOSClusterizer)
AliPHOSClusterizer::AliPHOSClusterizer():TTask("","")
{
// ctor
+ fSplitFile= 0 ;
}
+
//____________________________________________________________________________
AliPHOSClusterizer::AliPHOSClusterizer(const char* headerFile, const char* name):
TTask(name, headerFile)
{
// ctor
+ fSplitFile= 0 ;
+
}
//____________________________________________________________________________
AliPHOSClusterizer::~AliPHOSClusterizer()
{
// dtor
+
+ fSplitFile = 0 ; ;
+}
+
+//____________________________________________________________________________
+void AliPHOSClusterizer::SetSplitFile(const TString splitFileName)
+{
+ // Diverts the RecPoints in a file separate from the Digits file
+
+
+ TDirectory * cwd = gDirectory ;
+ fSplitFile = gAlice->InitTreeFile("R",splitFileName.Data());
+ fSplitFile->cd() ;
+ gAlice->Write(0, TObject::kOverwrite);
+
+ TTree *treeE = gAlice->TreeE();
+ if (!treeE) {
+ cerr << "ERROR: AliPHOSClusterizer::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: AliPHOSClusterizer::SetSplitFile -> AliceGeom was not found in the input file "<<endl;
+ abort() ;
+ }
+ AliceGeom->Write(0, TObject::kOverwrite);
+
+ gAlice->MakeTree("R", fSplitFile);
+ cwd->cd() ;
+ cout << "INFO: AliPHOSClusterizer::SetSPlitMode -> RecPoints will be stored in " << splitFileName.Data() << endl ;
}
/* $Id$ */
//_________________________________________________________________________
-// Base class for the clusterization algorithm (pure abstract)
+// Base class for the clusterization algorithm
//*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (SUBATECH & Kurchatov Institute)
// --- ROOT system ---
virtual void SetCpvLogWeight(Float_t w) {cout << "Not Defined" << endl ; }
virtual void SetDigitsBranch(const char * title) {cout << "Not Defined" << endl ; }
virtual void SetRecPointsBranch(const char *title) {cout << "Not Defined" << endl ; }
+ virtual void SetSplitFile(const TString splitFileName = "PHOS.RecData.root") ;
virtual void SetUnfolding(Bool_t toUnfold ){cout << "Not Defined" << endl ;}
virtual const char * Version() const {cout << "Not Defined" << endl ; return 0 ; }
+protected:
+
+ TFile * fSplitFile ; //! file in which RecPoints will eventually be stored
+
ClassDef(AliPHOSClusterizer,2) // Clusterization algorithm class
} ;
{
// default ctor (to be used mainly by Streamer)
- fNumberOfCpvClusters = 0 ;
- fNumberOfEmcClusters = 0 ;
-
- fCpvClusteringThreshold = 0.0;
- fEmcClusteringThreshold = 0.2;
-
- fEmcLocMaxCut = 0.03 ;
- fCpvLocMaxCut = 0.03 ;
-
- fW0 = 4.5 ;
- fW0CPV = 4.0 ;
-
- fEmcTimeGate = 1.e-8 ;
-
- fToUnfold = kTRUE ;
-
- fHeaderFileName = "" ;
- fDigitsBranchTitle = "" ;
- fFrom = "" ;
-
- fRecPointsInRun = 0 ;
+ InitParameters() ;
}
//____________________________________________________________________________
{
// ctor with the indication of the file where header Tree and digits Tree are stored
-
- fNumberOfCpvClusters = 0 ;
- fNumberOfEmcClusters = 0 ;
-
- fCpvClusteringThreshold = 0.0;
- fEmcClusteringThreshold = 0.2;
-
- fEmcLocMaxCut = 0.03 ;
- fCpvLocMaxCut = 0.03 ;
+ InitParameters() ;
- fW0 = 4.5 ;
- fW0CPV = 4.0 ;
-
- fEmcTimeGate = 1.e-8 ;
-
- fToUnfold = kTRUE ;
-
- fHeaderFileName = GetTitle() ;
- fDigitsBranchTitle = GetName() ;
-
- TString clusterizerName( GetName()) ;
- clusterizerName.Append(":") ;
- clusterizerName.Append(Version()) ;
- SetName(clusterizerName) ;
- fRecPointsInRun = 0 ;
if ( from == 0 )
fFrom = name ;
else
//____________________________________________________________________________
AliPHOSClusterizerv1::~AliPHOSClusterizerv1()
{
+ // dtor
+
+
+ AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
+
+ // remove the task from the folder list
+ gime->RemoveTask("C",GetName()) ;
+
+ // remove the data from the folder list
+ TString name(GetName()) ;
+ name.Remove(name.Index(":")) ;
+ gime->RemoveObjects("D", name) ; // Digits
+ gime->RemoveObjects("RE", name) ; // EMCARecPoints
+ gime->RemoveObjects("RC", name) ; // CPVRecPoints
+
+ // Delete gAlice
+ gime->CloseFile() ;
+
}
//____________________________________________________________________________
gAlice->GetEvent(0) ;
//check, if the branch with name of this" already exits?
- TObjArray * lob = (TObjArray*)gAlice->TreeR()->GetListOfBranches() ;
- TIter next(lob) ;
- TBranch * branch = 0 ;
- Bool_t phosemcfound = kFALSE, phoscpvfound = kFALSE, clusterizerfound = kFALSE ;
-
- TString branchname = GetName() ;
- branchname.Remove(branchname.Index(Version())-1) ;
-
- while ( (branch = (TBranch*)next()) && (!phosemcfound || !phoscpvfound || !clusterizerfound) ) {
- if ( (strcmp(branch->GetName(), "PHOSEmcRP")==0) && (strcmp(branch->GetTitle(), branchname.Data())==0) )
- phosemcfound = kTRUE ;
+ if(gAlice->TreeR()) {
+ TObjArray * lob = (TObjArray*)gAlice->TreeR()->GetListOfBranches() ;
+ TIter next(lob) ;
+ TBranch * branch = 0 ;
+ Bool_t phosemcfound = kFALSE, phoscpvfound = kFALSE, clusterizerfound = kFALSE ;
- else if ( (strcmp(branch->GetName(), "PHOSCpvRP")==0) && (strcmp(branch->GetTitle(), branchname.Data())==0) )
- phoscpvfound = kTRUE ;
-
- else if ((strcmp(branch->GetName(), "AliPHOSClusterizer")==0) && (strcmp(branch->GetTitle(), GetName())==0) )
- clusterizerfound = kTRUE ;
+ TString branchname = GetName() ;
+ branchname.Remove(branchname.Index(Version())-1) ;
+
+ while ( (branch = (TBranch*)next()) && (!phosemcfound || !phoscpvfound || !clusterizerfound) ) {
+ if ( (strcmp(branch->GetName(), "PHOSEmcRP")==0) && (strcmp(branch->GetTitle(), branchname.Data())==0) )
+ phosemcfound = kTRUE ;
+
+ else if ( (strcmp(branch->GetName(), "PHOSCpvRP")==0) && (strcmp(branch->GetTitle(), branchname.Data())==0) )
+ phoscpvfound = kTRUE ;
+
+ else if ((strcmp(branch->GetName(), "AliPHOSClusterizer")==0) && (strcmp(branch->GetTitle(), GetName())==0) )
+ clusterizerfound = kTRUE ;
+ }
+
+ if ( phoscpvfound || phosemcfound || clusterizerfound ) {
+ cerr << "WARNING: AliPHOSClusterizer::Exec -> Emc(Cpv)RecPoints and/or Clusterizer branch with name "
+ << branchname.Data() << " already exits" << endl ;
+ return ;
+ }
}
-
- if ( phoscpvfound || phosemcfound || clusterizerfound ) {
- cerr << "WARNING: AliPHOSClusterizer::Exec -> Emc(Cpv)RecPoints and/or Clusterizer branch with name "
- << branchname.Data() << " already exits" << endl ;
- return ;
- }
-
+
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
Int_t nevents = (Int_t) gAlice->TreeE()->GetEntries() ;
Int_t ievent ;
if(!gMinuit)
gMinuit = new TMinuit(100) ;
-
gime->PostClusterizer(this) ;
// create a folder on the white board //YSAlice/WhiteBoard/RecPoints/PHOS/recpointsName
gime->PostRecPoints(branchname) ;
}
+//____________________________________________________________________________
+void AliPHOSClusterizerv1::InitParameters()
+{
+
+ fNumberOfCpvClusters = 0 ;
+ fNumberOfEmcClusters = 0 ;
+
+ fCpvClusteringThreshold = 0.0;
+ fEmcClusteringThreshold = 0.2;
+
+ fEmcLocMaxCut = 0.03 ;
+ fCpvLocMaxCut = 0.03 ;
+
+ fW0 = 4.5 ;
+ fW0CPV = 4.0 ;
+
+ fEmcTimeGate = 1.e-8 ;
+
+ fToUnfold = kTRUE ;
+
+ fHeaderFileName = GetTitle() ;
+ fDigitsBranchTitle = GetName() ;
+
+ TString clusterizerName( GetName()) ;
+ if (clusterizerName.IsNull() )
+ clusterizerName = "Default" ;
+ clusterizerName.Append(":") ;
+ clusterizerName.Append(Version()) ;
+ SetName(clusterizerName) ;
+ fRecPointsInRun = 0 ;
+
+}
+
//____________________________________________________________________________
Int_t AliPHOSClusterizerv1::AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const
{
TObjArray * emcRecPoints = gime->EmcRecPoints(BranchName()) ;
TObjArray * cpvRecPoints = gime->CpvRecPoints(BranchName()) ;
TClonesArray * digits = gime->Digits(fFrom) ;
-
+ TTree * treeR = gAlice->TreeR();
+
+ if (!gAlice->TreeR() )
+ gAlice->MakeTree("R", fSplitFile);
+ treeR = gAlice->TreeR() ;
+
Int_t index ;
//Evaluate position, dispersion and other RecPoint properties...
for(index = 0; index < emcRecPoints->GetEntries(); index++)
cpvRecPoints->Expand(cpvRecPoints->GetEntriesFast()) ;
- //Make branches in TreeR for RecPoints and Clusterizer
- char * filename = 0;
- if(gSystem->Getenv("CONFIG_SPLIT_FILE")!=0){ //generating file name
- filename = new char[strlen(gAlice->GetBaseFile())+20] ;
- sprintf(filename,"%s/PHOS.Reco.root",gAlice->GetBaseFile()) ;
- }
-
- //Make new branches
- TDirectory *cwd = gDirectory;
-
-
Int_t bufferSize = 32000 ;
Int_t splitlevel = 0 ;
-
+
//First EMC
- TBranch * emcBranch = gAlice->TreeR()->Branch("PHOSEmcRP","TObjArray",&emcRecPoints,bufferSize,splitlevel);
+ TBranch * emcBranch = treeR->Branch("PHOSEmcRP","TObjArray",&emcRecPoints,bufferSize,splitlevel);
emcBranch->SetTitle(BranchName());
- if (filename) {
- emcBranch->SetFile(filename);
- TIter next( emcBranch->GetListOfBranches());
- TBranch * sb ;
- while ((sb=(TBranch*)next())) {
- sb->SetFile(filename);
- }
-
- cwd->cd();
- }
//Now CPV branch
- TBranch * cpvBranch = gAlice->TreeR()->Branch("PHOSCpvRP","TObjArray",&cpvRecPoints,bufferSize,splitlevel);
+ TBranch * cpvBranch = treeR->Branch("PHOSCpvRP","TObjArray",&cpvRecPoints,bufferSize,splitlevel);
cpvBranch->SetTitle(BranchName());
- if (filename) {
- cpvBranch->SetFile(filename);
- TIter next( cpvBranch->GetListOfBranches());
- TBranch * sb;
- while ((sb=(TBranch*)next())) {
- sb->SetFile(filename);
- }
- cwd->cd();
- }
//And Finally clusterizer branch
AliPHOSClusterizerv1 * cl = this ;
- TBranch * clusterizerBranch = gAlice->TreeR()->Branch("AliPHOSClusterizer","AliPHOSClusterizerv1",
+ TBranch * clusterizerBranch = treeR->Branch("AliPHOSClusterizer","AliPHOSClusterizerv1",
&cl,bufferSize,splitlevel);
clusterizerBranch->SetTitle(BranchName());
- if (filename) {
- clusterizerBranch->SetFile(filename);
- TIter next( clusterizerBranch->GetListOfBranches());
- TBranch * sb ;
- while ((sb=(TBranch*)next())) {
- sb->SetFile(filename);
- }
- cwd->cd();
- }
+
emcBranch ->Fill() ;
cpvBranch ->Fill() ;
clusterizerBranch->Fill() ;
- gAlice->TreeR()->Write(0,kOverwrite) ;
-
- delete [] filename ;
+ treeR->AutoSave() ; //Write(0,kOverwrite) ;
}
Bool_t FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy,
Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
void Init() ;
+ void InitParameters() ;
virtual void MakeUnfolding() ;
void UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax,
{
// ctor
- fPinNoise = 0.004 ;
- fEMCDigitThreshold = 0.012 ;
- fCPVNoise = 0.01;
- fCPVDigitThreshold = 0.09 ;
- fTimeResolution = 0.5e-9 ;
- fTimeSignalLength = 1.0e-9 ;
- fDigitsInRun = 0 ;
- fADCchanelEmc = 0.0015; // width of one ADC channel in GeV
- fADCpedestalEmc = 0.005 ; //
- fNADCemc = (Int_t) TMath::Power(2,16) ; // number of channels in EMC ADC
-
- fADCchanelCpv = 0.0012 ; // width of one ADC channel in CPV 'popugais'
- fADCpedestalCpv = 0.012 ; //
- fNADCcpv = (Int_t) TMath::Power(2,12); // number of channels in CPV ADC
-
- fTimeThreshold = 0.001*10000000 ; //Means 1 MeV in terms of SDigits amplitude
- fManager = 0 ; // We work in the standalong mode
- fSplitFile= 0 ;
+ InitParameters() ;
}
//____________________________________________________________________________
SetTitle(headerFile) ;
fManager = 0 ; // We work in the standalong mode
fSplitFile= 0 ;
+ InitParameters() ;
Init() ;
}
{
// ctor
SetName(""); //Will call init in the digitizing
- SetTitle("aliroot") ;
+ SetTitle("aliroot") ;
}
//____________________________________________________________________________
{
// dtor
- if (fSplitFile)
- if ( fSplitFile->IsOpen() )
- fSplitFile->Close() ;
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
- // Close the root file
- gime->CloseFile() ;
+
// remove the task from the folder list
+ gime->RemoveTask("S",GetName()) ;
gime->RemoveTask("D",GetName()) ;
+
// remove the Digits from the folder list
gime->RemoveObjects("D", GetName()) ;
+
// remove the SDigits from the folder list
gime->RemoveSDigits() ;
+ // Delete gAlice
+ gime->CloseFile() ;
+
+ fSplitFile = 0 ;
}
//____________________________________________________________________________
//increment the total number of Digits per run
fDigitsInRun += gime->Digits()->GetEntriesFast() ;
}
-
- if (fSplitFile)
- if ( fSplitFile->IsOpen() )
- fSplitFile->Close() ;
-
+
if(strstr(option,"tim")){
gBenchmark->Stop("PHOSDigitizer");
cout << "AliPHOSDigitizer:" << endl ;
}
return time ;
}
+
//____________________________________________________________________________
Bool_t AliPHOSDigitizer::Init()
+{
+
+ AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), GetName()) ;
+ if ( gime == 0 ) {
+ cerr << "ERROR: AliPHOSDigitizer::Init -> Could not obtain the Getter object !" << endl ;
+ return kFALSE;
+ }
+
+ const AliPHOSGeometry * geom = gime->PHOSGeometry() ;
+ fEmcCrystals = geom->GetNModules() * geom->GetNCristalsInModule() ;
+
+ // Post Digits to the white board
+ gime->PostDigits(GetName() ) ;
+
+ // Post Digitizer to the white board
+ gime->PostDigitizer(this) ;
+
+ //Mark that we will use current header file
+ if(!fManager){
+ gime->PostSDigits(GetName(),GetTitle()) ;
+ gime->PostSDigitizer(GetName(),GetTitle()) ;
+ }
+ return kTRUE ;
+}
+
+//____________________________________________________________________________
+void AliPHOSDigitizer::InitParameters()
{
fPinNoise = 0.004 ;
fEMCDigitThreshold = 0.012 ;
if( strcmp(GetName(), "") == 0 )
SetName("Default") ;
-
- AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), GetName()) ;
- if ( gime == 0 ) {
- cerr << "ERROR: AliPHOSDigitizer::Init -> Could not obtain the Getter object !" << endl ;
- return kFALSE;
- }
-
- const AliPHOSGeometry * geom = gime->PHOSGeometry() ;
- fEmcCrystals = geom->GetNModules() * geom->GetNCristalsInModule() ;
-
- // Post Digits to the white board
- gime->PostDigits(GetName() ) ;
-
- // Post Digitizer to the white board
- gime->PostDigitizer(this) ;
-
- //Mark that we will use current header file
- if(!fManager){
- gime->PostSDigits(GetName(),GetTitle()) ;
- gime->PostSDigitizer(GetName(),GetTitle()) ;
- }
- return kTRUE ;
}
//__________________________________________________________________
fSplitFile = gAlice->InitTreeFile("D",splitFileName.Data());
fSplitFile->cd() ;
- if ( !fSplitFile->Get("gAlice") )
- gAlice->Write();
-
+ gAlice->Write(0, TObject::kOverwrite);
+
TTree *treeE = gAlice->TreeE();
if (!treeE) {
cerr << "ERROR: AliPHOSDigitizer::SetSplitFile -> No TreeE found "<<endl;
}
// copy TreeE
- if ( !fSplitFile->Get("TreeE") ) {
- AliHeader *header = new AliHeader();
- treeE->SetBranchAddress("Header", &header);
- treeE->SetBranchStatus("*",1);
- TTree *treeENew = treeE->CloneTree();
- treeENew->Write();
- }
-
+ AliHeader *header = new AliHeader();
+ treeE->SetBranchAddress("Header", &header);
+ treeE->SetBranchStatus("*",1);
+ TTree *treeENew = treeE->CloneTree();
+ treeENew->Write(0, TObject::kOverwrite);
+
// copy AliceGeom
- if ( !fSplitFile->Get("AliceGeom") ) {
- TGeometry *AliceGeom = static_cast<TGeometry*>(cwd->Get("AliceGeom"));
- if (!AliceGeom) {
- cerr << "ERROR: AliPHOSDigitizer::SetSplitFile -> AliceGeom was not found in the input file "<<endl;
- abort() ;
+ TGeometry *AliceGeom = static_cast<TGeometry*>(cwd->Get("AliceGeom"));
+ if (!AliceGeom) {
+ cerr << "ERROR: AliPHOSDigitizer::SetSplitFile -> AliceGeom was not found in the input file "<<endl;
+ abort() ;
}
- AliceGeom->Write();
- }
+ AliceGeom->Write(0, TObject::kOverwrite);
gAlice->MakeTree("D",fSplitFile);
cwd->cd() ;
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
const TClonesArray * digits = gime->Digits(GetName()) ;
- TTree * treeD ;
+ TTree * treeD ;
if(fManager)
private:
Bool_t Init() ;
+ void InitParameters() ;
void PrintDigits(Option_t * option) ;
void WriteDigits(Int_t evt) ; // Writes Digits for particular event
Float_t TimeOfNoise(void) ; // Calculate time signal generated by noise
// --- ROOT system ---
-
+#include "TGeometry.h"
+#include "TDirectory.h"
+#include "TFile.h"
+#include "TTree.h"
-
// --- Standard library ---
#include <iostream.h>
#include <stdlib.h>
// --- AliRoot header files ---
-
+#include "AliRun.h"
#include "AliPHOSPID.h"
+#include "AliHeader.h"
ClassImp(AliPHOSPID)
AliPHOSPID::AliPHOSPID():TTask("","")
{
// ctor
+ fSplitFile= 0 ;
+
}
+
//____________________________________________________________________________
AliPHOSPID::AliPHOSPID(const char* headerFile, const char * name ):TTask(name, headerFile)
{
// ctor
+
+ fSplitFile= 0 ;
}
//____________________________________________________________________________
AliPHOSPID::~AliPHOSPID()
{
// dtor
+
+ fSplitFile = 0 ;
+}
+
+//____________________________________________________________________________
+void AliPHOSPID::SetSplitFile(const TString splitFileName) const
+{
+ // Diverts the Digits in a file separate from the hits 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: AliPHOSPID::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: AliPHOSPID::SetSplitFile -> AliceGeom was not found in the input file "<<endl;
+ abort() ;
+ }
+ AliceGeom->Write(0, TObject::kOverwrite) ;
+
+ gAlice->MakeTree("R",splitFile);
+ cwd->cd() ;
+ cout << "INFO: AliPHOSPID::SetSPlitMode -> RecParticles will be stored in " << splitFileName.Data() << endl ;
}
virtual void SetTimeGate(Float_t gate) { cout << "AliPHOSPID::SetTimeGate not defined " << endl ; }
virtual void SetTrackSegmentsBranch(const char* title) { cout << "AliPHOSPID::Exec not define " << endl ; }
virtual void SetRecParticlesBranch (const char* title) { cout << "AliPHOSPID::SetTecParticlesBranch not defined " << endl ; }
+ virtual void SetSplitFile(const TString splitFileName = "PHOS.RecData.root") const ;
virtual const char * Version() const { cout << "AliPHOSPID::Version not defined " << endl ; return 0 ; }
virtual void WriteRecParticles(Int_t event) { cout << "AliPHOSPID::WriteRecParticles not defined " << endl ; }
- private:
+private:
virtual void Init() { cout << "AliPHOSPID::Init not define " << endl ; }
- protected:
+protected:
+ TFile * fSplitFile ; //! file in which RecParticles will eventually be stored
+
ClassDef(AliPHOSPID,1) // Particle Identifier algorithm (base class)
} ;
{
// default ctor
- fFileName = "" ;
- fFileNamePar = "" ;
- fCluster = -1 ;
- fFrom = "" ;
- fHeaderFileName = "" ;
- fOptFileName = "Default" ;
- fTrackSegmentsTitle = "" ;
- fRecPointsTitle = "" ;
- fRecParticlesTitle = "" ;
-
- fNEvent = 0 ;
- fClusterizer = 0 ;
- fTSMaker = 0 ;
- fRecParticlesInRun = 0 ;
- fX = 0 ;
- fP = 0 ;
- fParameters = 0 ;
-
+ InitParameters() ;
}
//____________________________________________________________________________
{
//ctor with the indication on where to look for the track segments
- fHeaderFileName = GetTitle() ;
- fTrackSegmentsTitle = GetName() ;
- fRecPointsTitle = GetName() ;
- fRecParticlesTitle = GetName() ;
- TString tempo(GetName()) ;
- tempo.Append(":") ;
- tempo.Append(Version()) ;
- SetName(tempo) ;
- fRecParticlesInRun = 0 ;
+ InitParameters() ;
+
if ( from == 0 )
fFrom = name ;
else
fFrom = from ;
- fOptFileName = "Default" ;
+
Init() ;
}
delete [] fX ; // Principal input
delete [] fP ; // Principal components
delete fParameters ; // Matrix of Parameters
+
+ AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
+
+ // remove the task from the folder list
+ gime->RemoveTask("P",GetName()) ;
+ TString name(GetName()) ;
+ name.ReplaceAll("pid", "clu") ;
+ gime->RemoveTask("C",name) ;
+
+ // remove the data from the folder list
+ name = GetName() ;
+ name.Remove(name.Index(":")) ;
+ gime->RemoveObjects("RE", name) ; // EMCARecPoints
+ gime->RemoveObjects("RC", name) ; // CPVRecPoints
+ gime->RemoveObjects("T", name) ; // TrackSegments
+ gime->RemoveObjects("P", name) ; // RecParticles
+
+ // Delete gAlice
+ gime->CloseFile() ;
+
}
//____________________________________________________________________________
if ( strcmp(GetTitle(), "") == 0 )
SetTitle("galice.root") ;
-
- SetParameters(fOptFileName) ; // fill the parameters matrix from parameters file
-
+
AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), fFrom.Data()) ;
gime->SetRecParticlesTitle(BranchName()) ;
gime->PostRecParticles(BranchName()) ;
}
+
+//____________________________________________________________________________
+void AliPHOSPIDv1::InitParameters()
+{
+ fFrom = "" ;
+ fHeaderFileName = GetTitle() ;
+ TString name(GetName()) ;
+ if (name.IsNull())
+ name = "Default" ;
+ fTrackSegmentsTitle = name ;
+ fRecPointsTitle = name ;
+ fRecParticlesTitle = name ;
+ name.Append(":") ;
+ name.Append(Version()) ;
+ SetName(name) ;
+ fRecParticlesInRun = 0 ;
+ fOptFileName = "Default" ;
+ fNEvent = 0 ;
+ fClusterizer = 0 ;
+ fTSMaker = 0 ;
+ fRecParticlesInRun = 0 ;
+ SetParameters(fOptFileName) ; // fill the parameters matrix from parameters file
+}
+
//____________________________________________________________________________
Double_t AliPHOSPIDv1::GetCpvtoEmcDistanceCut(const Float_t Cluster_En, const TString Eff_Pur)const
{
gAlice->GetEvent(0) ;
//check, if the branch with name of this" already exits?
- TObjArray * lob = (TObjArray*)gAlice->TreeR()->GetListOfBranches() ;
- TIter next(lob) ;
- TBranch * branch = 0 ;
- Bool_t phospidfound = kFALSE, pidfound = kFALSE ;
-
- TString taskName(GetName()) ;
- taskName.Remove(taskName.Index(Version())-1) ;
-
- while ( (branch = (TBranch*)next()) && (!phospidfound || !pidfound) ) {
- if ( (strcmp(branch->GetName(), "PHOSPID")==0) && (strcmp(branch->GetTitle(), taskName.Data())==0) )
- phospidfound = kTRUE ;
+ if (gAlice->TreeR()) {
+ TObjArray * lob = (TObjArray*)gAlice->TreeR()->GetListOfBranches() ;
+ TIter next(lob) ;
+ TBranch * branch = 0 ;
+ Bool_t phospidfound = kFALSE, pidfound = kFALSE ;
+
+ TString taskName(GetName()) ;
+ taskName.Remove(taskName.Index(Version())-1) ;
+
+ while ( (branch = (TBranch*)next()) && (!phospidfound || !pidfound) ) {
+ if ( (strcmp(branch->GetName(), "PHOSPID")==0) && (strcmp(branch->GetTitle(), taskName.Data())==0) )
+ phospidfound = kTRUE ;
+
+ else if ( (strcmp(branch->GetName(), "AliPHOSPID")==0) && (strcmp(branch->GetTitle(), taskName.Data())==0) )
+ pidfound = kTRUE ;
+ }
- else if ( (strcmp(branch->GetName(), "AliPHOSPID")==0) && (strcmp(branch->GetTitle(), taskName.Data())==0) )
- pidfound = kTRUE ;
+ if ( phospidfound || pidfound ) {
+ cerr << "WARNING: AliPHOSPIDv1::Exec -> RecParticles and/or PIDtMaker branch with name "
+ << taskName.Data() << " already exits" << endl ;
+ return ;
+ }
}
- if ( phospidfound || pidfound ) {
- cerr << "WARNING: AliPHOSPIDv1::Exec -> RecParticles and/or PIDtMaker branch with name "
- << taskName.Data() << " already exits" << endl ;
- return ;
- }
-
Int_t nevents = (Int_t) gAlice->TreeE()->GetEntries() ;
Int_t ievent ;
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
TClonesArray * recParticles = gime->RecParticles(BranchName()) ;
recParticles->Expand(recParticles->GetEntriesFast() ) ;
+ TTree * treeR = gAlice->TreeR() ;
- //Make branch in TreeR for RecParticles
- char * filename = 0;
- if(gSystem->Getenv("CONFIG_SPLIT_FILE")!=0){ //generating file name
- filename = new char[strlen(gAlice->GetBaseFile())+20] ;
- sprintf(filename,"%s/PHOS.Reco.root",gAlice->GetBaseFile()) ;
- }
-
- TDirectory *cwd = gDirectory;
+ if (!treeR)
+ gAlice->MakeTree("R", fSplitFile);
+ treeR = gAlice->TreeR() ;
//First rp
Int_t bufferSize = 32000 ;
- TBranch * rpBranch = gAlice->TreeR()->Branch("PHOSRP",&recParticles,bufferSize);
+ TBranch * rpBranch = treeR->Branch("PHOSRP",&recParticles,bufferSize);
rpBranch->SetTitle(fRecParticlesTitle);
- if (filename) {
- rpBranch->SetFile(filename);
- TIter next( rpBranch->GetListOfBranches());
- TBranch * sb ;
- while ((sb=(TBranch*)next())) {
- sb->SetFile(filename);
- }
- cwd->cd();
- }
+
//second, pid
Int_t splitlevel = 0 ;
AliPHOSPIDv1 * pid = this ;
- TBranch * pidBranch = gAlice->TreeR()->Branch("AliPHOSPID","AliPHOSPIDv1",&pid,bufferSize,splitlevel);
+ TBranch * pidBranch = treeR->Branch("AliPHOSPID","AliPHOSPIDv1",&pid,bufferSize,splitlevel);
pidBranch->SetTitle(fRecParticlesTitle.Data());
- if (filename) {
- pidBranch->SetFile(filename);
- TIter next( pidBranch->GetListOfBranches());
- TBranch * sb ;
- while ((sb=(TBranch*)next())) {
- sb->SetFile(filename);
- }
- cwd->cd();
- }
rpBranch->Fill() ;
pidBranch->Fill() ;
- gAlice->TreeR()->Write(0,kOverwrite) ;
+ gAlice->TreeR()->AutoSave() ;// Write(0,kOverwrite) ;
- delete [] filename ;
}
//____________________________________________________________________________
const TString AliPHOSPIDv1::BranchName() const ;
virtual void Init() ;
+ virtual void InitParameters() ;
void MakeRecParticles(void ) ;
Float_t GetDistance(AliPHOSEmcRecPoint * emc, AliPHOSRecPoint * cpv, Option_t * Axis)const ; // Relative Distance CPV-EMC
Int_t GetPrincipalSign(Double_t* P, Int_t ell, Int_t eff_pur)const ; //Principal cut
//____________________________________________________________________________
- AliPHOSSDigitizer::AliPHOSSDigitizer():TTask("","")
-{
+ AliPHOSSDigitizer::AliPHOSSDigitizer():TTask("","") {
// ctor
- fA = 0;
- fB = 10000000.;
- fPrimThreshold = 0.01 ;
- fSDigitsInRun = 0 ;
- fSplitFile = 0 ;
+ InitParameters() ;
}
//____________________________________________________________________________
AliPHOSSDigitizer::AliPHOSSDigitizer(const char * headerFile, const char * sDigitsTitle):TTask(sDigitsTitle, headerFile)
{
// ctor
- fA = 0;
- fB = 10000000.;
- fPrimThreshold = 0.01 ;
- fSDigitsInRun = 0 ;
- fSplitFile = 0 ;
+ InitParameters() ;
Init();
}
//____________________________________________________________________________
AliPHOSSDigitizer::~AliPHOSSDigitizer()
{
- if (fSplitFile)
- if ( fSplitFile->IsOpen() )
- fSplitFile->Close() ;
- AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
- // Close the root file
- gime->CloseFile() ;
-
- // remove the task from the folder list
- gime->RemoveTask("S",GetName()) ;
-
- TString name(GetName()) ;
- name.Remove(name.Index(":")) ;
-
- // remove the Hits from the folder list
- gime->RemoveObjects("H",name) ;
- // remove the SDigits from the folder list
- gime->RemoveObjects("S", name) ;
+ AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
+ if (gime) {
+ // remove the task from the folder list
+ gime->RemoveTask("S",GetName()) ;
+
+ TString name(GetName()) ;
+ if (! name.IsNull() )
+ name.Remove(name.Index(":")) ;
+
+ // remove the Hits from the folder list
+ gime->RemoveObjects("H",name) ;
+
+ // remove the SDigits from the folder list
+ gime->RemoveObjects("S", name) ;
+
+ // Delete gAlice
+ gime->CloseFile() ;
+
+ }
+ fSplitFile = 0 ;
}
//____________________________________________________________________________
gime->PostSDigitizer(this) ;
}
+//____________________________________________________________________________
+void AliPHOSSDigitizer::InitParameters()
+{
+ fA = 0;
+ fB = 10000000.;
+ fPrimThreshold = 0.01 ;
+ fSDigitsInRun = 0 ;
+ fSplitFile = 0 ;
+}
+
//____________________________________________________________________________
void AliPHOSSDigitizer::Exec(Option_t *option)
{
}
- if (fSplitFile)
- if ( fSplitFile->IsOpen() )
- fSplitFile->Close() ;
-
-
if(strstr(option,"tim")){
gBenchmark->Stop("PHOSSDigitizer");
cout << "AliPHOSSDigitizer:" << endl ;
fSplitFile = gAlice->InitTreeFile("S",splitFileName.Data());
fSplitFile->cd() ;
- if ( !fSplitFile->Get("gAlice") )
- gAlice->Write();
+ gAlice->Write(0, TObject::kOverwrite);
TTree *treeE = gAlice->TreeE();
if (!treeE) {
}
// copy TreeE
- if ( !fSplitFile->Get("TreeE") ) {
AliHeader *header = new AliHeader();
treeE->SetBranchAddress("Header", &header);
treeE->SetBranchStatus("*",1);
TTree *treeENew = treeE->CloneTree();
- treeENew->Write();
- }
+ treeENew->Write(0, TObject::kOverwrite);
+
// copy AliceGeom
- if ( !fSplitFile->Get("AliceGeom") ) {
TGeometry *AliceGeom = static_cast<TGeometry*>(cwd->Get("AliceGeom"));
if (!AliceGeom) {
cerr << "ERROR: AliPHOSSDigitizer::SetSPlitFile -> AliceGeom was not found in the input file "<<endl;
abort() ;
}
- AliceGeom->Write();
- }
+ AliceGeom->Write(0, TObject::kOverwrite);
gAlice->MakeTree("S",fSplitFile);
cwd->cd() ;
cout << "INFO: AliPHOSSDigitizer::SetSPlitMode -> SDigits will be stored in " << splitFileName.Data() << endl ;
+
}
//__________________________________________________________________
private:
void Init() ;
+ void InitParameters() ;
void PrintSDigits(Option_t * option) ;
private:
// --- 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"
ClassImp( AliPHOSTrackSegmentMaker)
AliPHOSTrackSegmentMaker:: AliPHOSTrackSegmentMaker() : TTask("","")
{
// ctor
+ fSplitFile= 0 ;
+
}
//____________________________________________________________________________
AliPHOSTrackSegmentMaker::AliPHOSTrackSegmentMaker(const char * headerFile, const char * name): TTask(name, headerFile)
{
// ctor
+ fSplitFile= 0 ;
+}
+
+//____________________________________________________________________________
+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 ;
+}
// --- ROOT system ---
#include "TTask.h"
-
+class TFile ;
// --- Standard library ---
#include <iostream>
AliPHOSTrackSegmentMaker() ;
AliPHOSTrackSegmentMaker(const char* headerFile, const char* name) ;
- virtual ~ AliPHOSTrackSegmentMaker(){
- // dtor
- }
+ virtual ~ AliPHOSTrackSegmentMaker() ;
virtual void Exec(Option_t * option){cout << "Not Defined" << endl ; }
virtual char* GetRecPointsBranch ()const{cout << "Not Defined" << endl ; return 0 ; }
// virtual void SetMaxEmcCpvDistance(Float_t r) {cout << "Not Defined" << endl ; return 0 ; }
virtual void SetRecPointsBranch(const char * title){cout << "Not Defined" << endl ; }
virtual void SetTrackSegmentsBranch(const char * title){cout << "Not Defined" << endl ; }
+ virtual void SetSplitFile(const TString splitFileName = "PHOS.RecData.root") const ;
virtual const char * Version() const {cout << "Not Defined" << endl ; return 0 ; }
virtual void WriteTrackSegments(Int_t event){cout << "Not Defined" << endl ; }
+protected:
+
+ TFile * fSplitFile ; //! file in which TrackSegments will eventually be stored
+
ClassDef( AliPHOSTrackSegmentMaker,1) // Algorithm class to make PHOS track segments (Base Class)
};
{
// default ctor (to be used mainly by Streamer)
- fR0 = 10. ;
- fEmcFirst = 0 ;
- fEmcLast = 0 ;
- fCpvFirst = 0 ;
- fCpvLast = 0 ;
- fLinkUpArray = 0 ;
+ InitParameters() ;
fHeaderFileName = "" ;
fRecPointsBranchTitle = "" ;
fTrackSegmentsBranchTitle = "" ;
{
// ctor
- fR0 = 10. ;
- fEmcFirst = 0 ;
- fEmcLast = 0 ;
- fCpvFirst = 0 ;
- fCpvLast = 0 ;
- fLinkUpArray = 0 ;
-
+ InitParameters() ;
fHeaderFileName = GetTitle() ;
fRecPointsBranchTitle = GetName() ;
fTrackSegmentsBranchTitle = GetName() ;
fTrackSegmentsInRun = 0 ;
- TString tsmName( GetName()) ;
- tsmName.Append(":") ;
- tsmName.Append(Version()) ;
- SetName(tsmName) ;
if ( from == 0 )
fFrom = name ;
else
{
// dtor
delete fLinkUpArray ;
+
+ AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
+
+ // remove the task from the folder list
+ gime->RemoveTask("T",GetName()) ;
+ TString name(GetName()) ;
+ name.ReplaceAll("tsm", "clu") ;
+ gime->RemoveTask("C",name) ;
+
+ // remove the data from the folder list
+ name = GetName() ;
+ name.Remove(name.Index(":")) ;
+ gime->RemoveObjects("RE", name) ; // EMCARecPoints
+ gime->RemoveObjects("RC", name) ; // CPVRecPoints
+ gime->RemoveObjects("T", name) ; // TrackSegments
+
+ // Delete gAlice
+ gime->CloseFile() ;
+
}
+
//____________________________________________________________________________
const TString AliPHOSTrackSegmentMakerv1::BranchName() const
{
}
+//____________________________________________________________________________
+void AliPHOSTrackSegmentMakerv1::InitParameters()
+{
+ fR0 = 10. ;
+ fEmcFirst = 0 ;
+ fEmcLast = 0 ;
+ fCpvFirst = 0 ;
+ fCpvLast = 0 ;
+ fLinkUpArray = 0 ;
+ TString tsmName( GetName()) ;
+ if (tsmName.IsNull() )
+ tsmName = "Default" ;
+ tsmName.Append(":") ;
+ tsmName.Append(Version()) ;
+ SetName(tsmName) ;
+}
+
+
//____________________________________________________________________________
void AliPHOSTrackSegmentMakerv1::MakeLinks()const
{
gAlice->GetEvent(0) ;
//check, if the branch with name of this" already exits?
- TObjArray * lob = static_cast<TObjArray*>(gAlice->TreeR()->GetListOfBranches()) ;
- TIter next(lob) ;
- TBranch * branch = 0 ;
- Bool_t phostsfound = kFALSE, tracksegmentmakerfound = kFALSE ;
-
- TString branchname = GetName() ;
- branchname.Remove(branchname.Index(Version())-1) ;
-
- while ( (branch = static_cast<TBranch*>(next())) && (!phostsfound || !tracksegmentmakerfound) ) {
- if ( (strcmp(branch->GetName(), "PHOSTS")==0) && (strcmp(branch->GetTitle(), branchname.Data())==0) )
- phostsfound = kTRUE ;
+ if (gAlice->TreeR()) {
+ TObjArray * lob = static_cast<TObjArray*>(gAlice->TreeR()->GetListOfBranches()) ;
+ TIter next(lob) ;
+ TBranch * branch = 0 ;
+ Bool_t phostsfound = kFALSE, tracksegmentmakerfound = kFALSE ;
+
+ TString branchname = GetName() ;
+ branchname.Remove(branchname.Index(Version())-1) ;
+
+ while ( (branch = static_cast<TBranch*>(next())) && (!phostsfound || !tracksegmentmakerfound) ) {
+ if ( (strcmp(branch->GetName(), "PHOSTS")==0) && (strcmp(branch->GetTitle(), branchname.Data())==0) )
+ phostsfound = kTRUE ;
+
+ else if ( (strcmp(branch->GetName(), "AliPHOSTrackSegmentMaker")==0) && (strcmp(branch->GetTitle(), GetName())==0) )
+ tracksegmentmakerfound = kTRUE ;
+ }
- else if ( (strcmp(branch->GetName(), "AliPHOSTrackSegmentMaker")==0) && (strcmp(branch->GetTitle(), GetName())==0) )
- tracksegmentmakerfound = kTRUE ;
+ if ( phostsfound || tracksegmentmakerfound ) {
+ cerr << "WARNING: AliPHOSTrackSegmentMakerv1::Exec -> TrackSegments and/or TrackSegmentMaker branch with name "
+ << branchname.Data() << " already exits" << endl ;
+ return ;
+ }
}
- if ( phostsfound || tracksegmentmakerfound ) {
- cerr << "WARNING: AliPHOSTrackSegmentMakerv1::Exec -> TrackSegments and/or TrackSegmentMaker branch with name "
- << branchname.Data() << " already exits" << endl ;
- return ;
- }
-
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
const AliPHOSGeometry * geom = gime->PHOSGeometry() ;
Int_t nevents = (Int_t) gAlice->TreeE()->GetEntries() ;
TClonesArray * trackSegments = gime->TrackSegments(BranchName()) ;
trackSegments->Expand(trackSegments->GetEntriesFast()) ;
+ TTree * treeR = gAlice->TreeR();
- //Make branch in TreeR for TrackSegments
- char * filename = 0;
- if(gSystem->Getenv("CONFIG_SPLIT_FILE")!=0){ //generating file name
- filename = new char[strlen(gAlice->GetBaseFile())+20] ;
- sprintf(filename,"%s/PHOS.Reco.root",gAlice->GetBaseFile()) ;
- }
+ if (!treeR)
+ gAlice->MakeTree("R", fSplitFile);
+ treeR = gAlice->TreeR();
- TDirectory *cwd = gDirectory;
-
//First TS
Int_t bufferSize = 32000 ;
- TBranch * tsBranch = gAlice->TreeR()->Branch("PHOSTS",&trackSegments,bufferSize);
+ TBranch * tsBranch = treeR->Branch("PHOSTS",&trackSegments,bufferSize);
tsBranch->SetTitle(BranchName());
- if (filename) {
- tsBranch->SetFile(filename);
- TIter next( tsBranch->GetListOfBranches());
- TBranch * sb ;
- while ((sb=static_cast<TBranch*>(next()))) {
- sb->SetFile(filename);
- }
- cwd->cd();
- }
-
+
//Second -TSMaker
Int_t splitlevel = 0 ;
AliPHOSTrackSegmentMakerv1 * ts = this ;
- TBranch * tsMakerBranch = gAlice->TreeR()->Branch("AliPHOSTrackSegmentMaker","AliPHOSTrackSegmentMakerv1",
+ TBranch * tsMakerBranch = treeR->Branch("AliPHOSTrackSegmentMaker","AliPHOSTrackSegmentMakerv1",
&ts,bufferSize,splitlevel);
tsMakerBranch->SetTitle(BranchName());
- if (filename) {
- tsMakerBranch->SetFile(filename);
- TIter next( tsMakerBranch->GetListOfBranches());
- TBranch * sb;
- while ((sb=static_cast<TBranch*>(next()))) {
- sb->SetFile(filename);
- }
- cwd->cd();
- }
-
+
tsBranch->Fill() ;
tsMakerBranch->Fill() ;
- gAlice->TreeR()->Write(0,kOverwrite) ;
+ treeR->AutoSave() ; //Write(0,kOverwrite) ;
- delete [] filename ;
}
const TString BranchName() const ;
Float_t GetDistanceInPHOSPlane(AliPHOSEmcRecPoint * EmcClu , AliPHOSRecPoint * Ppsd , Bool_t & TooFar )const ; // see R0
void Init() ;
+ void InitParameters() ;
void PrintTrackSegments(Option_t *option) ;
virtual void WriteTrackSegments(Int_t event) ;
#include "TString.h"
//AliRoot
+#include "STEER/AliRun.h"
#include "PHOS/AliPHOSSDigitizer.h"
#include "PHOS/AliPHOSDigitizer.h"
+#include "PHOS/AliPHOSClusterizerv1.h"
+#include "PHOS/AliPHOSTrackSegmentMakerv1.h"
+#include "PHOS/AliPHOSPIDv1.h"
#include "EMCAL/AliEMCALSDigitizer.h"
#include "EMCAL/AliEMCALDigitizer.h"
+#include "EMCAL/AliEMCALClusterizerv1.h"
void Hits2SDigits( Bool_t split=kFALSE, TString fileName = "galice.root") {
//root [0] .L Reconstruct.C++
//root [1] SDigits2Digits(kTRUE) // SDigits saved in [DET}.SDigits.root (DET=PHOS, EMCAL)
+ delete gAlice ;
+ gAlice = 0 ;
+
AliPHOSSDigitizer * sdp = new AliPHOSSDigitizer(fileName) ;
if (split)
sdp->SetSplitFile() ;
delete sdp ;
- AliEMCALSDigitizer * sde = new AliEMCALSDigitizer(fileName) ;
- if (split)
- sde->SetSplitFile() ;
- sde->ExecuteTask("deb") ;
+ // AliEMCALSDigitizer * sde = new AliEMCALSDigitizer(fileName) ;
+// if (split)
+// sde->SetSplitFile() ;
+// sde->ExecuteTask("deb") ;
- delete sde ;
+// delete sde ;
}
void SDigits2Digits( Bool_t split=kFALSE, TString fileName = "galice.root") {
// usage :
- // 1. write SDigits in the same file as Hits --------------- (OK)
+ // 1. write SDigits in the same file as SDigits --------------- (OK)
//root [0] .L Reconstruct.C++
- //root [1] Hits2Digits()
- // 2. write SDigits in a separate file, one per detector, from Hits --------------- (OK)
+ //root [1] SDigits2Digits()
+ // 2. write SDigits in a separate file, one per detector, from SDigits --------------- (OK)
//root [0] .L Reconstruct.C++
- //root [1] Hits2Digits(kTRUE) // Digits saved in [DET}.Digits.root (DET=PHOS, EMCAL)
+ //root [1] SDigitsDigits(kTRUE) // Digits saved in [DET}.Digits.root (DET=PHOS, EMCAL)
+ delete gAlice ;
+ gAlice = 0 ;
+
// PHOS
- AliPHOSDigitizer * dp ;
+ AliPHOSDigitizer * dp = 0 ;
if (split) {
dp = new AliPHOSDigitizer("PHOS.SDigits.root") ;
delete dp ;
//EMCAL
- AliEMCALDigitizer * de ;
+// AliEMCALDigitizer * de = 0 ;
+
+// if (split) {
+// de = new AliEMCALDigitizer("EMCAL.SDigits.root") ;
+// de->SetSplitFile() ;
+// } else
+// de = new AliEMCALDigitizer(fileName) ;
+
+// de->ExecuteTask("deb") ;
+
+// delete de ;
+}
+
+//________________________________________________________________________
+void Digits2RecPoints( Bool_t split=kFALSE, TString fileName = "galice.root") {
+
+ // usage :
+ // 1. write RecPoints in the same file as Digits --------------- OK
+ //root [0] .L Reconstruct.C++
+ //root [1] Digits2RecPoints()
+ // 2. write RecPoints in a separate file, one per detector, from Digits --------------- OK
+ //root [0] .L Reconstruct.C++
+ //root [1] Digits2RecPoints(kTRUE) // RecPoints saved in [DET}.RecPoints.root (DET=PHOS, EMCAL)
+ delete gAlice ;
+ gAlice = 0 ;
+
+// PHOS
+ AliPHOSClusterizer * cp = 0 ;
+
if (split) {
- de = new AliEMCALDigitizer("EMCAL.SDigits.root") ;
- de->SetSplitFile() ;
+ cp = new AliPHOSClusterizerv1("PHOS.Digits.root") ;
+ cp->SetSplitFile() ; }
+ else
+ cp = new AliPHOSClusterizerv1(fileName) ;
+
+ cp->ExecuteTask("deb") ;
+
+ delete cp ;
+
+ //EMCAL
+ AliEMCALClusterizerv1 * ce = 0 ;
+
+ if (split) {
+ ce = new AliEMCALClusterizerv1("EMCAL.Digits.root") ;
+ ce->SetSplitFile() ;
} else
- de = new AliEMCALDigitizer(fileName) ;
+ ce = new AliEMCALClusterizerv1(fileName) ;
+
+ ce->ExecuteTask("deb") ;
+
+ delete ce ;
+}
+
+//________________________________________________________________________
+void RecPoints2TrackSegments( Bool_t split=kFALSE, TString fileName = "galice.root") {
+
+ // usage :
+ // 1. write TrackSegments in the same file as RecPoints --------------- (OK)
+ //root [0] .L Reconstruct.C++
+ //root [1] RecPoints2TrackSegments()
+ // 2. write TrackSegments in a separate file, one per detector, from RecPoints --------------- (Not needed)
+ //root [0] .L Reconstruct.C++
+ //root [1] RecPoints2TrackSegments(kTRUE) // TrackSegments saved in [DET}.RecData.root (DET=PHOS, EMCAL)
+
+ delete gAlice ;
+ gAlice = 0 ;
+
+ AliPHOSTrackSegmentMaker * tmp = 0 ;
+
+ if (split) {
+ tmp = new AliPHOSTrackSegmentMakerv1("PHOS.RecData.root") ;
+ tmp->SetSplitFile() ; }
+ else
+ tmp = new AliPHOSTrackSegmentMakerv1(fileName) ;
+
+ tmp->ExecuteTask("deb") ;
+
+ delete tmp ;
+}
+
+//________________________________________________________________________
+void TrackSegments2RecParticles( Bool_t split=kFALSE, TString fileName = "galice.root") {
+
+ // usage :
+ // 1. write RecParticles in the same file as TrackSegments --------------- (OK)
+ //root [0] .L Reconstruct.C++
+ //root [1] TrackSegments2RecParticles()
+ // 2. write RecParticles in a separate file, one per detector, from TrackSegments --------------- (Not needed)
+ //root [0] .L Reconstruct.C++
+ //root [1] TrackSegments2RecParticles(kTRUE) // RecParticles saved in [DET}.RecData.root (DET=PHOS, EMCAL)
+
+ delete gAlice ;
+ gAlice = 0 ;
+
+ AliPHOSPID * pp = 0 ;
+
+ if (split)
+ pp = new AliPHOSPIDv1("PHOS.RecData.root") ;
+ else
+ pp = new AliPHOSPIDv1(fileName) ;
- de->ExecuteTask("deb") ;
+ pp->ExecuteTask("deb") ;
- delete de ;
+ delete pp ;
+}
+
+//________________________________________________________________________
+void Digits2RecParticles( Bool_t split=kFALSE, TString fileName = "galice.root") {
+
+ // usage :
+ // 1. write RecPoints, TrackSegments and RecParticles in the same file as Digits --------------- (OK)
+ //root [0] .L Reconstruct.C++
+ //root [1] Digits2RecParticles()
+ // 2. write RecPoints , TrackSegments and RecParticles in a separate file, one per detector, from Digits --------------- (OK)
+ //root [0] .L Reconstruct.C++
+ //root [1] Digits2RecParticles(kTRUE) // TrackSegments saved in [DET}.RecData.root (DET=PHOS, EMCAL)
+
+
+ delete gAlice ;
+ gAlice = 0 ;
+
+ // PHOS
+ AliPHOSClusterizer * cp = 0 ;
+
+ if (split) {
+ cp = new AliPHOSClusterizerv1("PHOS.Digits.root") ;
+ cp->SetSplitFile() ; }
+ else
+ cp = new AliPHOSClusterizerv1(fileName) ;
+
+ cp->ExecuteTask("deb") ;
+
+ if (split)
+ delete cp ;
+
+ AliPHOSTrackSegmentMaker * tmp = 0 ;
+
+ if (split)
+ tmp = new AliPHOSTrackSegmentMakerv1("PHOS.RecData.root") ;
+ else
+ tmp = new AliPHOSTrackSegmentMakerv1(fileName) ;
+
+ tmp->ExecuteTask("deb") ;
+
+ AliPHOSPID * pp = 0 ;
+
+ if (split)
+ pp = new AliPHOSPIDv1("PHOS.RecData.root") ;
+ else
+ pp = new AliPHOSPIDv1(fileName) ;
+
+ pp->ExecuteTask("deb") ;
+
+ delete cp ;
+ delete tmp;
+ delete pp ;
}
//________________________________________________________________________
//root [1] Hits2Digits(kTRUE) // SDigits saved in [DET}.SDigits.root (DET=PHOS, EMCAL)
// Digits saved in [DET}.Digits.root (DET=PHOS, EMCAL)
+ delete gAlice ;
+ gAlice = 0 ;
+
//PHOS
AliPHOSSDigitizer * sdp = new AliPHOSSDigitizer(fileName) ;
if (split)
sdp->SetSplitFile() ;
sdp->ExecuteTask("deb") ;
- delete sdp ;
+ if (split)
+ delete sdp ;
- AliPHOSDigitizer * dp ;
+ AliPHOSDigitizer * dp = 0 ;
if (split) {
dp = new AliPHOSDigitizer("PHOS.SDigits.root") ;
dp = new AliPHOSDigitizer(fileName) ;
dp->ExecuteTask("deb") ;
-
- delete dp ;
- //EMCAL
- AliEMCALSDigitizer * sde = new AliEMCALSDigitizer(fileName) ;
if (split)
- sde->SetSplitFile() ;
- sde->ExecuteTask("deb") ;
+ delete dp ;
+
+ if (!split) {
+ delete sdp ;
+ delete dp ;
+ }
- delete sde ;
+// //EMCAL
+// AliEMCALSDigitizer * sde = new AliEMCALSDigitizer(fileName) ;
+// if (split)
+// sde->SetSplitFile() ;
+// sde->ExecuteTask("deb") ;
- AliEMCALDigitizer * de ;
- if (split) {
- de = new AliEMCALDigitizer("EMCAL.SDigits.root") ;
- de->SetSplitFile() ;
- } else
- de = new AliEMCALDigitizer(fileName) ;
+// delete sde ;
+
+// AliEMCALDigitizer * de = 0 ;
+// if (split) {
+// de = new AliEMCALDigitizer("EMCAL.SDigits.root") ;
+// de->SetSplitFile() ;
+// } else
+// de = new AliEMCALDigitizer(fileName) ;
- de->ExecuteTask("deb") ;
+// de->ExecuteTask("deb") ;
- delete de ;
+// delete de ;
+
}
+