// unfolding of the clusters with several local maxima.
// results are stored in TreeR#, branches PHOSEmcRP (EMC recPoints),
// PHOSCpvRP (CPV RecPoints) and AliPHOSClusterizer (Clusterizer with all
-// parameters including input digits branch file name thresholds etc.)
+// parameters including input digits branch title, thresholds etc.)
// This TTask normally called from Reconstructioner, but as well can be used it in
// standalone mode:
// root [0] AliPHOSClusterizerv1 * cl = new AliPHOSClusterizerv1("galice.root")
// root [1] cl->ExecuteTask()
// //finds RecPoints in all events stored in galice.root
// root [2] cl->SetDigitsBranch("digits2")
-// //sets another input file
+// //sets another title for Digitis (input) branch
// root [3] cl->SetRecPointsBranch("recp2")
-// //sets another aouput file
+// //sets another title four output branches
// root [4] cl->SetEmcLocalMaxCut(0.03)
// //set clusterization parameters
// root [5] cl->ExecuteTask("deb all time")
#include "AliRun.h"
ClassImp(AliPHOSClusterizerv1)
-
+
//____________________________________________________________________________
AliPHOSClusterizerv1::AliPHOSClusterizerv1():AliPHOSClusterizer()
{
- // default ctor (to be used)
- SetName("AliPHOSClusterizer");
+ // default ctor (to be used mainly by Streamer)
+ SetName("AliPHOSClusterizer");
SetTitle("Version 1") ;
-
+
fNumberOfCpvClusters = 0 ;
fNumberOfEmcClusters = 0 ;
-
+
fCpvClusteringThreshold = 0.0;
fEmcClusteringThreshold = 0.2;
fPpsdClusteringThreshold = 0.0000002 ;
fW0 = 4.5 ;
fW0CPV = 4.0 ;
-
+
fGeom = 0 ;
fDigits = 0 ;
}
//____________________________________________________________________________
- AliPHOSClusterizerv1::AliPHOSClusterizerv1(const char* headerFile,const char* digitsFile):AliPHOSClusterizer()
+AliPHOSClusterizerv1::AliPHOSClusterizerv1(const char* headerFile,const char* digitsFile):AliPHOSClusterizer()
{
SetName("AliPHOSClusterizer");
SetTitle("Version 1") ;
fNumberOfCpvClusters = 0 ;
fNumberOfEmcClusters = 0 ;
-
+
fCpvClusteringThreshold = 0.0;
fEmcClusteringThreshold = 0.2;
fPpsdClusteringThreshold = 0.0000002 ;
TFile * file = (TFile*) gROOT->GetFile(fHeaderFileName.Data() ) ;
if(file == 0){
- file = new TFile(fHeaderFileName.Data(),"update") ;
+ if(fHeaderFileName.Contains("rfio")) // if we read file using HPSS
+ file = TFile::Open(fHeaderFileName.Data(),"update") ;
+ else
+ file = new TFile(fHeaderFileName.Data(),"update") ;
gAlice = (AliRun *) file->Get("gAlice") ;
}
Int_t nPar, Float_t * fitparameters)
{
// Calls TMinuit to fit the energy distribution of a cluster with several maxima
+ // the initial values for fitting procedure are set in the positions of local maxima.
+ // Cluster will be fitted as a superposition of nPar/3 electromagnetic showers
gMinuit->mncler(); // Reset Minuit's list of paramters
gMinuit->SetPrintLevel(-1) ; // No Printout
//____________________________________________________________________________
void AliPHOSClusterizerv1::Init(){
-
+ //Make all memory allocations which can not be done in default constructor.
if(!fIsInitialized){
if(fHeaderFileName.IsNull())
fHeaderFileName = "galice.root" ;
}
//____________________________________________________________________________
Bool_t AliPHOSClusterizerv1::ReadDigits(){
+ //reads digitis with specified title from TreeD
fNumberOfEmcClusters = 0 ;
fNumberOfCpvClusters = 0 ;
// Get Digits Tree header from file
- char treeName[20];
- sprintf(treeName,"TreeD%d",fEvent);
gAlice->GetEvent(fEvent) ;
gAlice->SetEvent(fEvent) ;
- TTree * treeD = gAlice->TreeD() ; // (TTree*)file->Get(treeName);
+ TTree * treeD = gAlice->TreeD() ;
if(treeD==0){
+ char treeName[20];
+ sprintf(treeName,"TreeD%d",fEvent);
cout << "Error in AliPHOSClusterizerv1 : no "<<treeName << endl ;
cout << " Do nothing " << endl ;
return kFALSE ;
//____________________________________________________________________________
void AliPHOSClusterizerv1::WriteRecPoints(){
+ // checks, if PHOSEmcRP etc. branches with given title already exist,
+ // exits without writing, otherwise create new branches with given title
+ // fills and wrights TreeR.
Int_t index ;
//Evaluate poisition, dispersion and other RecPoint properties...
}
-//____________________________________________________________________________
-void AliPHOSClusterizerv1::SetDigitsBranch(const char * title){
-
- fDigitsBranchTitle = title ;
-
-}
-//____________________________________________________________________________
-void AliPHOSClusterizerv1::SetRecPointsBranch(const char * title){
-
- fRecPointsBranchTitle = title;
-
-}
-
//____________________________________________________________________________
Double_t AliPHOSClusterizerv1::ShowerShape(Double_t r)
{