#include "TFolder.h"
// --- Standard library ---
-
#include <strstream.h>
-// --- AliRoot header files ---
+// --- AliRoot header files ---
#include "AliPHOS.h"
#include "AliMC.h"
#include "AliRun.h"
fTreeQA = 0;
}
-
//____________________________________________________________________________
AliPHOS::~AliPHOS()
{
void AliPHOS::SetTreeAddress()
{
-
- // TBranch *branch;
- // AliDetector::SetTreeAddress();
-
TBranch *branch;
char branchname[20];
sprintf(branchname,"%s",GetName());
#include "TFile.h"
#include "TTree.h"
-
// --- Standard library ---
#include <iostream.h>
#include <stdlib.h>
// ctor
fSplitFile= 0 ;
fToSplit = kFALSE ;
-// fHitsFileName = "" ;
-// fSDigitsFileName = "" ;
-// fDigitsFileName = "" ;
}
// ctor
fToSplit = toSplit ;
fSplitFile= 0 ;
- // fDigitsFileName = headerFile ;
- // AliPHOSGetter * gime = AliPHOSGetter::GetInstance(headerFile, name,toSplit) ;
-// gime->Event(0,"D") ;
-// fSDigitsFileName = gime->Digitizer()->GetTitle() ;
-// gime = AliPHOSGetter::GetInstance(fSDigitsFileName, name) ;
-// gime->Event(0,"S") ;
-// fHitsFileName = gime->SDigitizer()->GetTitle() ;
+
}
//____________________________________________________________________________
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 ;
-// }
AliPHOSClusterizer(const char * headerFile, const char * name, const Bool_t toSplit) ;
virtual ~AliPHOSClusterizer() ; // dtor
- // const TString GetHitsFileName() const { return fHitsFileName ; }
- // const TString GetSDigitsFileName() const { return fSDigitsFileName ; }
- // const TString GetDigitsFileName() const { return fDigitsFileName ; }
-
virtual Float_t GetEmcClusteringThreshold()const {cout << "Not Defined" << endl ; return 0. ; }
virtual Float_t GetEmcLocalMaxCut()const {cout << "Not Defined" << endl ; return 0. ; }
virtual Float_t GetEmcLogWeight()const {cout << "Not Defined" << endl ; return 0. ; }
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:
- // TString fHitsFileName ; // file name that contains the original hits
- // TString fSDigitsFileName ; // file name that contains the original SDigits
- // TString fDigitsFileName ; // file name that contains the original Digits
TFile * fSplitFile ; //! file in which RecPoints will eventually be stored
Bool_t fToSplit ; //! Should we write to splitted file
// ctor with the indication of the file where header Tree and digits Tree are stored
InitParameters() ;
-
Init() ;
fDefaultInit = kFALSE ;
AliPHOSClusterizerv1::~AliPHOSClusterizerv1()
{
// dtor
+ fSplitFile = 0 ;
-
-// if (!fDefaultInit) {
-// 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() ;
-
- fSplitFile = 0 ;
-// }
}
//____________________________________________________________________________
//____________________________________________________________________________
Float_t AliPHOSClusterizerv1::Calibrate(Int_t amp, Int_t absId) const
{ //To be replased later by the method, reading individual parameters from the database
+
if(absId <= fEmcCrystals) //calibrate as EMC
- return fADCpedestalEmc + amp*fADCchanelEmc ;
+ return fADCpedestalEmc + amp*fADCchanelEmc ;
+
else //Digitize as CPV
return fADCpedestalCpv+ amp*fADCchanelCpv ;
}
+
//____________________________________________________________________________
void AliPHOSClusterizerv1::Exec(Option_t * option)
{
if(strstr(option,"print"))
Print("") ;
-// gAlice->GetEvent(0) ;
-
-// //check, if the branch with name of this" already exits?
-// if(gAlice->TreeR()) {
-// 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 ;
-
-// 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 ;
-// }
-// }
-
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
if(gime->BranchExists("RecPoints"))
return ;
if(ievent == 0)
GetCalibrationParameters() ;
- fNumberOfEmcClusters = 0 ;
- fNumberOfCpvClusters = 0 ;
-
-
- // if(!ReadDigits(ievent)) continue; //reads digits for event ievent
-
+ fNumberOfEmcClusters = fNumberOfCpvClusters = 0 ;
+
MakeClusters() ;
if(fToUnfold)
fADCpedestalCpv = dig->GetCPVpedestal() ;
}
+
//____________________________________________________________________________
void AliPHOSClusterizerv1::Init()
{
gime->PostClusterizer(this) ;
gime->PostRecPoints(branchname) ;
-
- // gime->PostDigits() ;
- // gime->PostDigitizer() ;
}
fEmcTimeGate = 1.e-8 ;
fToUnfold = kTRUE ;
-
- // fHeaderFileName = GetTitle() ;
- // fDigitsBranchTitle = GetName() ;
-
+
TString clusterizerName( GetName()) ;
if (clusterizerName.IsNull() )
clusterizerName = "Default" ;
cpvBranch ->Fill() ;
clusterizerBranch->Fill() ;
- treeR->AutoSave() ; //Write(0,kOverwrite) ;
+ treeR->AutoSave() ;
if(gAlice->TreeR()!=treeR)
treeR->Delete();
}
virtual Float_t GetCpvLogWeight()const { return fW0CPV;}
virtual const char * GetRecPointsBranch() const{ return GetName() ;}
virtual const Int_t GetRecPointsInRun() const {return fRecPointsInRun ;}
- // virtual const char * GetDigitsBranch() const { return (char*) fDigitsBranchTitle.Data() ;}
void Exec(Option_t *option); // Does the job
virtual void SetCpvClusteringThreshold(Float_t cluth) { fCpvClusteringThreshold = cluth ; }
virtual void SetCpvLocalMaxCut(Float_t cut) { fCpvLocMaxCut = cut ; }
virtual void SetCpvLogWeight(Float_t w) { fW0CPV = w ; }
- // virtual void SetDigitsBranch(const char * title) { fDigitsBranchTitle = title ;}
- // virtual void SetRecPointsBranch(const char *title){fRecPointsBranchTitle = title; }
- virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) { fToUnfold = toUnfold ;}
+ virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) { fToUnfold = toUnfold ;}
static Double_t ShowerShape(Double_t r) ; // Shape of EM shower used in unfolding;
//class member function (not object member function)
static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag) ;
private:
Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
- // TString fFrom ; // name of Digits
- // TString fHeaderFileName ; // name of the file which contains gAlice, Tree headers etc.
- // TString fDigitsBranchTitle ; // name of the file, where digits branch is stored
- // TString fRecPointsBranchTitle ; // name of the file, where RecPoints branchs are stored
Int_t fEmcCrystals ; // number of EMC cristalls in PHOS
#include <iomanip.h>
// --- AliRoot header files ---
-
#include "AliRun.h"
#include "AliHeader.h"
#include "AliStream.h"
InitParameters() ;
fDefaultInit = kTRUE ;
fManager = 0 ; // We work in the standalong mode
-
- // fHitsFileName = "" ;
- // fSDigitsFileName = "" ;
+
}
//____________________________________________________________________________
fToSplit = toSplit ;
Init() ;
fDefaultInit = kFALSE ;
- // fSDigitsFileName = headerFile ;
- // AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
- // gime->Event(0, "S") ;
- // fHitsFileName = gime->SDigitizer()->GetTitle() ;
}
//____________________________________________________________________________
SetName("Default") ;
fToSplit = kFALSE ;
}
-
-// fSDigitsFileName = fManager->GetInputFileName(0, 0) ;
-// AliPHOSGetter * gime = AliPHOSGetter::GetInstance(fSDigitsFileName, GetName()) ;
-// gime->Event(0,"S") ;
-// fHitsFileName = gime->SDigitizer()->GetTitle() ;
-
}
//____________________________________________________________________________
AliPHOSDigitizer::~AliPHOSDigitizer()
{
// dtor
- // fDefaultInit = kTRUE if Digitizer created by default ctor (to get just the parameters)
-
-// if (!fDefaultInit) {
-// AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
-
-// // 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 ;
- // }
}
//____________________________________________________________________________
//remove digits below thresholds
for(i = 0; i < nEMC ; i++){
- digit = (AliPHOSDigit*) digits->At(i) ;
+ digit = dynamic_cast<AliPHOSDigit*>( digits->At(i) ) ;
if(sDigitizer->Calibrate( digit->GetAmp() ) < fEMCDigitThreshold)
digits->RemoveAt(i) ;
else
//Set indexes in list of digits and make true digitization of the energy
for (i = 0 ; i < ndigits ; i++) {
- AliPHOSDigit * digit = (AliPHOSDigit *) digits->At(i) ;
+ digit = dynamic_cast<AliPHOSDigit*>( digits->At(i) ) ;
digit->SetIndexInList(i) ;
Float_t energy = sDigitizer->Calibrate(digit->GetAmp()) ;
digit->SetAmp(DigitizeEnergy(energy,digit->GetId()) ) ;
}
}
+
//____________________________________________________________________________
Int_t AliPHOSDigitizer::DigitizeEnergy(Float_t energy, Int_t absId)
{
}
return chanel ;
}
+
//____________________________________________________________________________
void AliPHOSDigitizer::Exec(Option_t *option)
{
// check if the specified SDigits do not already exist on the White Board:
// //Folders/RunMC/Event/Data/PHOS/SDigits/headerFile/sdigitsname
- TString path = "Folders/RunMC/Event/Data/PHOS/SDigits" ;
+ AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
+ TString path = gime->SDigitsFolder()->GetName() ;
+
+ // before it was ???? "Folders/RunMC/Event/Data/PHOS/SDigits" ;
path += headerFile ;
path += "/" ;
path += GetName() ;
return;
}
- AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
gime->PostSDigits(GetName(),headerFile) ;
// check if the requested file is already open or exist and if SDigits Branch exist
}
-// //__________________________________________________________________
-// void AliPHOSDigitizer::SetSplitFile(const TString splitFileName)
-// {
-// // Diverts the Digits in a file separate from the hits file
-
-// // I guess it is not going to work if we do merging
-// // if (fManager) {
-// // cerr << "ERROR: AliPHOSDigitizer::SetSplitFile -> Not yet available in case of merging activated " << endl ;
-// // return ;
-// // }
-
-// cout << "AliPHOSDigitizer::SetSplitFile " << gDirectory->GetName() << endl ;
-// cout << "AliPHOSDigitizer::SetSplitFile " << gAlice->GetTreeDFileName() << endl ;
-// cout << "AliPHOSDigitizer::SetSplitFile " << splitFileName.Data() << endl ;
-
-// SetTitle(splitFileName) ;
-
-// TDirectory * cwd = gDirectory ;
-// if ( !(gAlice->GetTreeDFileName() == splitFileName) ) {
-// if (gAlice->GetTreeDFile() )
-// gAlice->GetTreeDFile()->Close() ;
-// }
-
-// fSplitFile = gAlice->InitTreeFile("D",splitFileName.Data());
-// fSplitFile->cd() ;
-// gAlice->Write(0, TObject::kOverwrite);
-
-// TTree *treeE = gAlice->TreeE();
-// if (!treeE) {
-// cerr << "ERROR: AliPHOSDigitizer::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: AliPHOSDigitizer::SetSplitFile -> AliceGeom was not found in the input file "<<endl;
-// abort() ;
-// }
-// AliceGeom->Write(0, TObject::kOverwrite);
-
-// gAlice->MakeTree("D",fSplitFile);
-// cwd->cd() ;
-// cout << "INFO: AliPHOSDigitizer::SetSPlitMode -> Digits will be stored in " << splitFileName.Data() << endl ;
-// }
-
//__________________________________________________________________
void AliPHOSDigitizer::Print(Option_t* option)const {
// Print Digitizer's parameters
}
-// //__________________________________________________________________
-// void AliPHOSDigitizer::SetSDigitsBranch(const char* title)
-// {
-// // we set title (comment) of the SDigits branch in the first! header file
-// if( strcmp(GetName(), "") == 0 )
-// Init() ;
-
-// AliPHOSGetter::GetInstance()->SDigits()->SetName(title) ;
-
-// }
//__________________________________________________________________
Float_t AliPHOSDigitizer::TimeOfNoise(void)
{ // Calculates the time signal generated by noise
return 1. ;
}
-// //____________________________________________________________________________
-// void AliPHOSDigitizer::Reset()
-// {
-// // sets current event number to the first simulated event
-
-// if( strcmp(GetName(), "") == 0 )
-// Init() ;
-
-// // Int_t inputs ;
-// // for(inputs = 0; inputs < fNinputs ;inputs++)
-// // fIevent->AddAt(-1, inputs ) ;
-
-// }
//____________________________________________________________________________
void AliPHOSDigitizer::WriteDigits(Int_t event)
//General
const Int_t GetDigitsInRun() const { return fDigitsInRun ;}
- // const TString GetHitsFileName() const { return fHitsFileName ; }
- // const TString GetSDigitsFileName() const { return fSDigitsFileName ; }
-
void MixWith(const char* HeaderFile) ; // Add another one file to mix
void Print(Option_t* option)const ;
- // void Reset() ; //restarts starts event processing from 0 event(s)
- // void SetSplitFile(const TString splitFileName = "PHOS.Digits.root") ;
- // void SetSDigitsBranch(const char* file) ;
-
+
AliPHOSDigitizer & operator = (const AliPHOSDigitizer & rvalue) {
// assignement operator requested by coding convention but not needed
abort() ;
private:
- // TString fHitsFileName ; // file name that contains the original hits
- // TString fSDigitsFileName ; // file name that contains the original SDigits
Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
+ Int_t fDigitsInRun ; //! Total number of digits in one run
+
Int_t fEmcCrystals ; // Number of EMC crystalls in the given geometry
Float_t fPinNoise ; // Electronics noise in EMC
Float_t fCPVNoise ; // Noise in CPV
Float_t fCPVDigitThreshold ; // Threshold for storing digits in CPV
- Int_t fDigitsInRun ; //! Total number of digits in one run
Float_t fTimeResolution ; // Time resolution of FEE electronics
Float_t fTimeThreshold ; // Threshold to start timing for given crystall
//*-- systematic usage of TFolders without changing the interface
//////////////////////////////////////////////////////////////////////////////
-
// --- ROOT system ---
#include "TFile.h"
#include "TTree.h"
#include <iostream.h>
// --- AliRoot header files ---
-
#include "AliRun.h"
#include "AliConfig.h"
#include "AliPHOSGetter.h"
// Returns the pointer of the unique instance already defined
if ( fgObjGetter ) {
-// if (fFile) // not the case if fManager
-// fFile->cd() ;
return fgObjGetter ;
}
else {
{
// Creates and returns the pointer of the unique instance
// Must be called only when the environment has changed
+
if(!fgObjGetter){
fgObjGetter = new AliPHOSGetter(headerFile,branchTitle,toSplit) ;
if(fgObjGetter->fFailed)
return kTRUE;
}
+
//____________________________________________________________________________
const Bool_t AliPHOSGetter::PostDigits(const char * name) const
{ //---------- Digits -------------------------
// the hierarchy is //Folders/Tasks/Reconstructioner/PHOS/sdigitsname
-
TTask * tasks = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ;
if ( !tasks ) {
//____________________________________________________________________________
TObject** AliPHOSGetter::RecParticlesRef(const char * name) const
-{ // ---------------TrackSegments -----------------------------------
+{ // ---------------RecParticles -----------------------------------
// the hierarchy is //Folders/Run/Event/RecData/PHOS/TrackSegments/name
p = fAlice->Particle(index) ;
else
p = gAlice->Particle(index) ;
- // if (p->GetFirstMother() != -1 ) {
- // cout << "AliPHOSGetter::Primary : Not a primary " << endl ;
- // }
return p ;
-
-
- // Int_t primaryIndex = index % 10000000 ;
-// Int_t primaryList = (Int_t ) ((index-primaryIndex)/10000000.) ;
-
-// if ( primaryList > 0 ) {
-// if (fDebug) {
-// cout << " Getter does not support currently Mixing of primary " << endl ;
-// cout << " can not return primary: " << index<< " (list "<< primaryList<< " primary # " << primaryIndex << " )"<<endl ;
-// }
-// return 0;
-// }
-
-// return gAlice->Particle(primaryIndex) ;
-
}
//____________________________________________________________________________
else
treeD = gAlice->TreeD() ;
-// if(!treeD) { // TreeD not found in header file
-
-// if (fDebug)
-// cout << "WARNING: AliPHOSGetter::ReadTreeD -> Cannot find TreeD in " << fHeaderFile << endl ;
-
-// TString searchFileName("") ;
-
-// if (Digitizer()) // Digitizer found in header file
-// searchFileName = Digitizer()->GetTitle() ;
-
-// else if (Clusterizer()) // Clusterizer found in header file
-// searchFileName = Clusterizer()->GetDigitsFileName() ;
-
-// if ( (treeD = TreeD(searchFileName)) ) { //found TreeD in the file which contains the hits
-// if (fDebug)
-// cout << "INFO: AliPHOSGetter::ReadTreeD -> TreeD found in " << searchFileName.Data() << endl ;
-
-// } else {
-// cerr << "ERROR: AliPHOSGetter::ReadTreeD -> TreeD not found " << endl ;
-// return 1;
-// }
-// }
-
-
TObjArray * lob = static_cast<TObjArray*>(treeD->GetListOfBranches()) ;
TIter next(lob) ;
TBranch * branch = 0 ;
hitsbranch->SetAddress(HitsRef()) ;
hitsbranch->GetEntry(itrack) ;
-
}
+
//____________________________________________________________________________
void AliPHOSGetter::ReadTreeQA()
{
pidbranch->GetEntry(0) ;
}
- if(gAlice->TreeR()!=treeR){
+ if(gAlice->TreeR()!=treeR)
treeR->Delete();
- }
return 0 ;
}
PostSDigitizer(fSDigitsTitle,folder->GetName()) ;
sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
sdigitizerBranch->GetEntry(0) ;
- // lob ->Delete();
if(gAlice->TreeS()!=treeS)
treeS->Delete();
}
-
- // After SDigits have been read from all files, return to the first one
-
-// next.Reset();
-// folder = static_cast<TFolder*>(next());
-// if(folder){
-// TString fileName(folder->GetName()) ;
-// fileName.ReplaceAll("_","/") ;
-// file = static_cast<TFile*>(gROOT->GetFile(fileName));
-// file ->cd() ;
-// }
return 0 ;
}
+
//____________________________________________________________________________
void AliPHOSGetter::ReadTreeS(TTree * treeS, Int_t input)
PostSDigitizer(sdigitsBranch->GetTitle(),filename) ;
sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
sdigitizerBranch->GetEntry(0) ;
- // lob ->Delete();
if(gAlice->TreeS()!=treeS)
treeS->Delete();
}
void AliPHOSGetter::Event(const Int_t event, const char* opt)
{
// Reads the content of all Tree's S, D and R
+
if (event >= gAlice->TreeE()->GetEntries() ) {
cerr << "ERROR: AliPHOSGetter::Event -> " << event << " not found in TreeE!" << endl ;
return ;
TFolder * folder = 0 ;
TObject * phosO = 0 ;
- // if ( name.IsNull() ) {
if ( what.CompareTo("Primaries") == 0 ) {
folder = dynamic_cast<TFolder *>(fPrimariesFolder->FindObject("Primaries")) ;
if (folder)
}
- //---- Now Tascks -----------
+ //---- Now Tasks -----------
TObject * obj ;
TString sdname(fSDigitsTitle);
return *this ;
}
virtual ~AliPHOSGetter() ;
-
+
//=========== Instantiators ================
static AliPHOSGetter * GetInstance(const char* headerFile,
const char* branchTitle = "Default",
const Bool_t toSplit = kFALSE ) ;
static AliPHOSGetter * GetInstance() ;
-
+
//=========== General information about run ==============
const Int_t MaxEvent() const { return static_cast<Int_t>(gAlice->TreeE()->GetEntries()) ; }
const Int_t EventNumber() const { return static_cast<Int_t>(gAlice->GetEvNumber()) ; }
//========== PHOSGeometry and PHOS =============
const AliPHOS * PHOS() ;
const AliPHOSGeometry * PHOSGeometry() ;
-
+
//========== Methods to read something from file ==========
void Event(const Int_t event, const char * opt = "HSDRP") ;
void Track(const Int_t itrack) ;
TFolder * Alarms() const { return dynamic_cast<TFolder*>(ReturnO("Alarms", 0)) ; }
const TObjArray * Alarms(const char * name ) const { return dynamic_cast<const TObjArray*>(ReturnO("Alarms", name)) ; }
const TTask * QATasks(const char * name = 0) const { return ReturnT("QATasks", name) ; }
-
+
//-----------------now getter's data--------------------------------------
-
+
//=========== Primaries ============
TTree * TreeK(TString filename="") ;
TClonesArray * Primaries(void) const { return dynamic_cast<TClonesArray*>(ReturnO("Primaries")) ; }
const TParticle * Primary(Int_t index) const ;
const Int_t NPrimaries()const { return fNPrimaries; }
const TParticle * Secondary(TParticle * p, Int_t index=1) const ;
-
+
//=========== Hits =================
TTree * TreeH(TString filename="") ;
const TClonesArray * Hits(void) { return dynamic_cast<const TClonesArray*>(ReturnO("Hits")) ; }
const AliPHOSSDigitizer * SDigitizer(const char * name =0) const {
return (const AliPHOSSDigitizer *) ReturnT("SDigitizer", name) ; // here static or dynamic cast does not work ! why ?
}
-
+
//========== Digits ================
TTree * TreeD(TString filename="") ;
TClonesArray * Digits(const char * name = 0)const {
return dynamic_cast<TClonesArray*>(ReturnO("Digits", name)) ; }
-//const AliPHOSDigit * Digit(Int_t index) { return static_cast<const AliPHOSDigit *>(Digits()->At(index)) ;} !!! why no such method ?
+ //const AliPHOSDigit * Digit(Int_t index) { return static_cast<const AliPHOSDigit *>(Digits()->At(index)) ;} !!! why no such method ?
const AliPHOSDigitizer * Digitizer(const char * name = 0) const {
return (const AliPHOSDigitizer*)(ReturnT("Digitizer", name)) ; }
//========== RecPoints =============
- //TTree * TreeR(TString filename="") ; !!! why no such method ?
TObjArray * EmcRecPoints(const char * name = 0) {
return dynamic_cast<TObjArray*>(ReturnO("EmcRecPoints", name)) ; }
-//const AliPHOSEmcRecPoint * EmcRecPoint(Int_t index) { return static_cast<const AliPHOSEmcRecPoint *>(EmcRecPoints()->At(index)) ;} !!! why no such method ?
+ //const AliPHOSEmcRecPoint * EmcRecPoint(Int_t index) { return static_cast<const AliPHOSEmcRecPoint *>(EmcRecPoints()->At(index)) ;} !!! why no such method ?
TObjArray * CpvRecPoints(const char * name = 0) {
return dynamic_cast<TObjArray*>(ReturnO("CpvRecPoints", name)) ; }
-//const AliPHOSCpvRecPoint * CpvRecPoint(Int_t index) { return static_cast<const AliPHOSCpvRecPoint *>(EmcCpvPoints()->At(index)) ;} !!! why no such method ?
const AliPHOSClusterizer * Clusterizer (const char * name =0) const {
return (const AliPHOSClusterizer*)(ReturnT("Clusterizer", name)) ; // here static or dynamic cast does not work ! why ?
-}
+ }
//========== TrackSegments ==========
TClonesArray * TrackSegments(const char * name = 0) {
TClonesArray * RecParticles(const char * name = 0) {
return static_cast<TClonesArray*>(ReturnO("RecParticles", name)) ; }
const AliPHOSPID * PID(const char * name =0) const {
- return (const AliPHOSPID*)(ReturnT("PID", name)) ; // here static or dynamic cast does not work ! why ?
- }
-
+ return (const AliPHOSPID*)(ReturnT("PID", name)) ; } // here static or dynamic cast does not work ! why ?
+
//-----------------Auxiliary methods: cleaners-----------------
void RemoveTask(TString opt, TString name) const ;
void RemoveObjects(TString opt, TString name) const ;
};
#endif // AliPHOSGETTER_H
-
-
//____________________________________________________________________________
- AliPHOSSDigitizer::AliPHOSSDigitizer():TTask("","") {
+ AliPHOSSDigitizer::AliPHOSSDigitizer():TTask("","")
+{
// ctor
InitParameters() ;
fDefaultInit = kTRUE ;
void AliPHOSSDigitizer::Exec(Option_t *option)
{
// Collects all hits in the same active volume into digit
+
if( strcmp(GetName(), "") == 0 )
Init() ;
gime->PostSDigits( title, GetTitle()) ;
}
-// //__________________________________________________________________
-// void AliPHOSSDigitizer::SetSplitFile(const TString splitFileName)
-// {
-// // Diverts the SDigits in a file separate from the hits file
-
-// TDirectory * cwd = gDirectory ;
-
-// if ( !(gAlice->GetTreeSFileName() == splitFileName) ) {
-// if (gAlice->GetTreeSFile() )
-// gAlice->GetTreeSFile()->Close() ;
-// }
-
-// fSplitFile = gAlice->InitTreeFile("S",splitFileName.Data());
-// fSplitFile->cd() ;
-// gAlice->Write(0, TObject::kOverwrite);
-
-// TTree *treeE = gAlice->TreeE();
-// if (!treeE) {
-// cerr << "ERROR: AliPHOSSDigitizer::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: AliPHOSSDigitizer::SetSPlitFile -> AliceGeom was not found in the input file "<<endl;
-// abort() ;
-// }
-// AliceGeom->Write(0, TObject::kOverwrite);
-
-// gAlice->MakeTree("S",fSplitFile);
-// cwd->cd() ;
-// cout << "INFO: AliPHOSSDigitizer::SetSPlitMode -> SDigits will be stored in " << splitFileName.Data() << endl ;
-
-// }
//__________________________________________________________________
void AliPHOSSDigitizer::Print(Option_t* option)const
cout << "---------------------------------------------------"<<endl ;
}
+
//__________________________________________________________________
Bool_t AliPHOSSDigitizer::operator==( AliPHOSSDigitizer const &sd )const
{
else
return kFALSE ;
}
-//__________________________________________________________________
+
//__________________________________________________________________
void AliPHOSSDigitizer::PrintSDigits(Option_t * option)
{
// --- ROOT system ---
#include "TTask.h"
#include "TString.h"
-class TFile ;
-
// --- Standard library ---
// --- AliRoot header files ---
const Int_t GetSDigitsInRun() const {return fSDigitsInRun ;}
virtual void Print(Option_t* option) const ;
void SetSDigitsBranch(const char * title ) ;
- // void SetSplitFile(const TString splitFileName = "PHOS.SDigits.root") ;
void UseHitsFrom(const char * filename) ;
Bool_t operator == (const AliPHOSSDigitizer & sd) const ;