Creation of TClonesArray and AliPHOSClusterizerv1 once per run instead of once per event.
fCPVRecPoints(0)
{
// ctor
+ fDigitsArr = new TClonesArray("AliPHOSDigit",100);
+ fEMCRecPoints = new TObjArray(100) ;
+ fEMCRecPoints ->SetName("EMCRECPOINTS") ;
+ fCPVRecPoints = new TObjArray(100) ;
+ fCPVRecPoints ->SetName("CPVRECPOINTS") ;
}
//____________________________________________________________________________
fCPVRecPoints(0)
{
// ctor
-
+ fDigitsArr = new TClonesArray("AliPHOSDigit",100);
+ fEMCRecPoints = new TObjArray(100) ;
+ fEMCRecPoints ->SetName("EMCRECPOINTS") ;
+ fCPVRecPoints = new TObjArray(100) ;
+ fCPVRecPoints ->SetName("CPVRECPOINTS") ;
}
//____________________________________________________________________________
AliError("can't get the branch with the PHOS digits !");
return;
}
- fDigitsArr = new TClonesArray("AliPHOSDigit",100);
+ fDigitsArr->Clear();
branch->SetAddress(&fDigitsArr);
branch->GetEntry(0);
}
// and set the corresponding branch addresses
fTreeR = clustersTree;
+// fEMCRecPoints->Clear();
+// fCPVRecPoints->Clear();
+ fEMCRecPoints->Delete();
+ fCPVRecPoints->Delete();
+
AliDebug(9, "Making array for EMC clusters");
- fEMCRecPoints = new TObjArray(100) ;
- fEMCRecPoints->SetName("EMCRECPOINTS") ;
Int_t split = 0;
Int_t bufsize = 32000;
fTreeR->Branch("PHOSEmcRP", "TObjArray", &fEMCRecPoints, bufsize, split);
AliDebug(9, "Making array for CPV clusters");
- fCPVRecPoints = new TObjArray(100) ;
- fCPVRecPoints->SetName("CPVRECPOINTS") ;
fTreeR->Branch("PHOSCpvRP", "TObjArray", &fCPVRecPoints, bufsize, split);
}
gBenchmark->Stop("PHOSClusterizer");
AliInfo(Form("took %f seconds for Clusterizing\n",
gBenchmark->GetCpuTime("PHOSClusterizer")));
- }
+ }
}
//____________________________________________________________________________
// Steering method to construct the clusters stored in a list of Reconstructed Points
// A cluster is defined as a list of neighbour digits
+ fNumberOfCpvClusters = 0 ;
+ fNumberOfEmcClusters = 0 ;
+
TClonesArray * digitsC = static_cast<TClonesArray*>( fDigitsArr->Clone() ) ;
// Clusterization starts
const TString AliPHOSLoader::fgkTrackSegmentsBranchName("PHOSTS");//Name for branch with TrackSegments
const TString AliPHOSLoader::fgkRecParticlesBranchName("PHOSRP");//Name for branch with Reconstructed Particles
//____________________________________________________________________________
-AliPHOSLoader::AliPHOSLoader() : fBranchTitle(), fcdb(0), fDebug(0)
+AliPHOSLoader::AliPHOSLoader() : fBranchTitle(), fcdb(0), fDebug(0), fTmpHits(0x0)
{
//def ctor
+ fTmpHits = new TClonesArray("AliPHOSHit",1000);
}
//____________________________________________________________________________
AliPHOSLoader::AliPHOSLoader(const Char_t *detname,const Char_t *eventfoldername) :
AliLoader(detname, eventfoldername),
- fBranchTitle(), fcdb(0), fDebug(0)
+ fBranchTitle(), fcdb(0), fDebug(0), fTmpHits(0x0)
{
//ctor
}
//____________________________________________________________________________
AliPHOSLoader::AliPHOSLoader(const Char_t *detname,TFolder *topfolder):
- AliLoader(detname,topfolder),
- fBranchTitle(), fcdb(0), fDebug(0)
+ AliLoader(detname,topfolder),
+ fBranchTitle(), fcdb(0), fDebug(0), fTmpHits(0x0)
{
//ctor
+ fTmpHits = new TClonesArray("AliPHOSHit",1000);
}
//____________________________________________________________________________
AliPHOSLoader::AliPHOSLoader(const AliPHOSLoader & obj):
AliLoader(obj),fBranchTitle(obj.GetBranchTitle()),fcdb(obj.CalibrationDB()),
- fDebug(obj.GetDebug())
+ fDebug(obj.GetDebug()),fTmpHits(obj.fTmpHits)
{
// Copy constructor
}
// Reads data from TreeH and stores it in TClonesArray that sits in DetectorDataFolder
//
TObject** hitref = HitsRef();
- if(hitref == 0x0)
- {
- MakeHitsArray();
- hitref = HitsRef();
- }
+ if(hitref == 0x0) {
+ MakeHitsArray();
+ hitref = HitsRef();
+ }
TClonesArray* hits = dynamic_cast<TClonesArray*>(*hitref);
TTree* treeh = TreeH();
- if(treeh == 0)
- {
+ if(treeh == 0) {
AliError("Cannot read TreeH from folder");
return 1;
}
TBranch * hitsbranch = treeh->GetBranch(fDetectorName);
- if (hitsbranch == 0)
- {
+ if (hitsbranch == 0) {
AliError("Cannot find branch PHOS");
return 1;
}
AliDebug(1, "Reading Hits");
- if (hitsbranch->GetEntries() > 1)
- {
- TClonesArray * tempo = new TClonesArray("AliPHOSHit",1000);
+ if (hitsbranch->GetEntries() > 1) {
- hitsbranch->SetAddress(&tempo);
+ hitsbranch->SetAddress(&fTmpHits);
Int_t index = 0 ;
- Int_t i = 0 ;
- for (i = 0 ; i < hitsbranch->GetEntries(); i++)
- {
+ for (Int_t i = 0 ; i < hitsbranch->GetEntries(); i++) {
hitsbranch->GetEntry(i) ;
- Int_t j = 0 ;
- for ( j = 0 ; j < tempo->GetEntries() ; j++)
- {
- AliPHOSHit* hit = (AliPHOSHit*)tempo->At(j);
- new((*hits)[index]) AliPHOSHit( *hit ) ;
- index++ ;
- }
- }
- tempo->Delete();
- delete tempo;
- }
- else
- {
+ for (Int_t j = 0 ; j < fTmpHits->GetEntriesFast() ; j++) {
+ AliPHOSHit* hit = (AliPHOSHit*)fTmpHits->At(j);
+ new((*hits)[index]) AliPHOSHit( *hit ) ;
+ index++ ;
+ }
+ }
+ fTmpHits->Clear();
+ }
+ else {
hitsbranch->SetAddress(hitref);
hitsbranch->GetEntry(0) ;
- }
-
+ }
+
return 0;
}
//____________________________________________________________________________
// another set of RecPoints.
//
// The objects are retrived from folders.
-//*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
+//-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
//
// --- Standard library ---
// --- AliRoot header files ---
-
#include "AliRun.h"
#include "AliLoader.h"
#include "AliRunLoader.h"
class AliPHOSSDigitizer ;
class AliPHOSDigitizer ;
-
-
-//
-
class AliPHOSLoader : public AliLoader {
public:
Int_t ReadRecParticles();
Int_t fDebug ; // Debug level
+ TClonesArray *fTmpHits; //! Temporary array of hits per track
static const TString fgkHitsName;//Name for TClonesArray with hits from one event
static const TString fgkSDigitsName;//Name for TClonesArray
static const TString fgkRecParticlesBranchName;//Name for branch
- ClassDef(AliPHOSLoader,3) // Algorithm class that provides methods to retrieve objects from a list knowing the index
+ ClassDef(AliPHOSLoader,4) // Algorithm class that provides methods to retrieve objects from a list knowing the index
};
ClassImp(AliPHOSQADataMakerSim)
//____________________________________________________________________________
- AliPHOSQADataMakerSim::AliPHOSQADataMakerSim() :
- AliQADataMakerSim(AliQA::GetDetName(AliQA::kPHOS), "PHOS Quality Assurance Data Maker")
+AliPHOSQADataMakerSim::AliPHOSQADataMakerSim() :
+ AliQADataMakerSim(AliQA::GetDetName(AliQA::kPHOS), "PHOS Quality Assurance Data Maker"),
+ fHits(0x0)
{
// ctor
+ fHits = new TClonesArray("AliPHOSHit", 1000);
}
//____________________________________________________________________________
AliPHOSQADataMakerSim::AliPHOSQADataMakerSim(const AliPHOSQADataMakerSim& qadm) :
- AliQADataMakerSim()
+ AliQADataMakerSim(),
+ fHits(0x0)
{
//copy ctor
SetName((const char*)qadm.GetName()) ;
SetTitle((const char*)qadm.GetTitle());
+ fHits = new TClonesArray("AliPHOSHit", 1000);
}
//__________________________________________________________________
TH1F * h0 = new TH1F("hPhosHits", "Hits energy distribution in PHOS", 100, 0., 100.) ;
h0->Sumw2() ;
Add2HitsList(h0, 0) ;
- TH1I * h1 = new TH1I("hPhosHitsMul", "Hits multiplicity distribution in PHOS", 500, 0., 10000) ;
+ TH1I * h1 = new TH1I("hPhosHitsMul", "Hits multiplicity distribution in PHOS", 500, 0., 10000) ;
h1->Sumw2() ;
Add2HitsList(h1, 1) ;
}
}
//____________________________________________________________________________
-void AliPHOSQADataMakerSim::MakeHits(TClonesArray * hits)
+void AliPHOSQADataMakerSim::MakeHits()
{
- //make QA data from Hits
-
- GetHitsData(1)->Fill(hits->GetEntriesFast()) ;
- TIter next(hits) ;
- AliPHOSHit * hit ;
- while ( (hit = dynamic_cast<AliPHOSHit *>(next())) ) {
- GetHitsData(0)->Fill( hit->GetEnergy()) ;
- }
+ //make QA data from Hits
+
+ TIter next(fHits) ;
+ AliPHOSHit * hit ;
+ while ( (hit = dynamic_cast<AliPHOSHit *>(next())) ) {
+ GetHitsData(0)->Fill( hit->GetEnergy()) ;
+ }
}
//____________________________________________________________________________
void AliPHOSQADataMakerSim::MakeHits(TTree * hitTree)
{
- // make QA data from Hit Tree
-
- TClonesArray * hits = new TClonesArray("AliPHOSHit", 1000);
-
- TBranch * branch = hitTree->GetBranch("PHOS") ;
- if ( ! branch ) {
- AliWarning("PHOS branch in Hit Tree not found") ;
- } else {
- TClonesArray * tmp = new TClonesArray("AliPHOSHit", 1000) ;
- branch->SetAddress(&tmp) ;
- Int_t index = 0 ;
- for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
- branch->GetEntry(ientry) ;
- for (Int_t ihit = 0 ; ihit < tmp->GetEntries() ; ihit++) {
- AliPHOSHit * hit = dynamic_cast<AliPHOSHit *> (tmp->At(ihit)) ;
- new((*hits)[index]) AliPHOSHit(*hit) ;
- index++ ;
- }
- }
- tmp->Delete() ;
- delete tmp ;
- MakeHits(hits) ;
- }
+ // make QA data from Hit Tree
+
+ TBranch * branch = hitTree->GetBranch("PHOS") ;
+ if ( ! branch ) {
+ AliWarning("PHOS branch in Hit Tree not found") ;
+ } else {
+ Int_t nHits = 0;
+ branch->SetAddress(&fHits) ;
+ for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
+ branch->GetEntry(ientry) ;
+ nHits += fHits->GetEntriesFast();
+ MakeHits() ;
+ fHits->Clear();
+ }
+ GetHitsData(1)->Fill(nHits) ;
+ }
}
//____________________________________________________________________________
virtual void InitHits() ;
virtual void InitDigits() ;
virtual void InitSDigits() ;
- virtual void MakeHits(TClonesArray * hits) ;
+ void MakeHits() ;
virtual void MakeHits(TTree * hitTree) ;
virtual void MakeDigits(TClonesArray * digits) ;
virtual void MakeDigits(TTree * digitTree) ;
virtual void MakeSDigits(TTree * sigitTree) ;
virtual void StartOfDetectorCycle() ;
- ClassDef(AliPHOSQADataMakerSim,1) // description
+private:
+ TClonesArray * fHits; //!Array of PHOS hits
+
+ ClassDef(AliPHOSQADataMakerSim,2) // description
};
// derived from STEER/AliReconstructor.
//
// --- ROOT system ---
-
+#include "TObjectTable.h"
// --- Standard library ---
// --- AliRoot header files ---
//____________________________________________________________________________
AliPHOSReconstructor::AliPHOSReconstructor() :
- fGeom(NULL)
+ fGeom(NULL),fClusterizer(NULL)
{
// ctor
fgkRecoParamCpv = AliPHOSRecoParamCpv::GetCpvDefaultParameters();
}
- fGeom = AliPHOSGeometry::GetInstance("IHEP","");
+ fGeom = AliPHOSGeometry::GetInstance("IHEP","");
+ fClusterizer = new AliPHOSClusterizerv1(fGeom);
}
//____________________________________________________________________________
{
// dtor
delete fGeom;
+ delete fClusterizer;
}
//____________________________________________________________________________
// segment maker needs access to the AliESDEvent object to retrieve the tracks reconstructed by
// the global tracking.
- AliPHOSClusterizerv1 clu(fGeom);
- clu.SetInput(digitsTree);
- clu.SetOutput(clustersTree);
+ fClusterizer->SetInput(digitsTree);
+ fClusterizer->SetOutput(clustersTree);
if ( Debug() )
- clu.Digits2Clusters("deb all") ;
+ fClusterizer->Digits2Clusters("deb all") ;
else
- clu.Digits2Clusters("") ;
+ fClusterizer->Digits2Clusters("") ;
+ gObjectTable->Print();
}
//____________________________________________________________________________
#include "AliPHOSRecoParamCpv.h"
class AliPHOSDigitizer ;
class AliPHOSClusterizer ;
+class AliPHOSClusterizerv1 ;
class AliPHOSTrackSegmentMaker ;
class AliPHOSPID ;
class AliPHOSSDigitizer ;
static AliPHOSRecoParam *fgkRecoParamEmc; // reconstruction parameters for EMC
static AliPHOSRecoParam *fgkRecoParamCpv; // reconstruction parameters for EMC
AliPHOSGeometry *fGeom; // pointer to the PHOS geometry
+ AliPHOSClusterizerv1 *fClusterizer; //! PHOS clusterizer
- ClassDef(AliPHOSReconstructor,4) // PHOS Reconstruction class
+ ClassDef(AliPHOSReconstructor,5) // PHOS Reconstruction class
};