#include "AliDetector.h"
#include "AliPHOSGeometry.h"
-
+#include "AliRecPoint.h"
+#include "AliPHOSTrackSegment.h"
+#include "AliPHOSRecParticle.h"
class AliPHOS : public AliDetector {
virtual ~AliPHOS() ;
virtual void CreateMaterials() ; // defines the material of the detector
- virtual AliPHOSGeometry * GetGeometry() = 0 ; // hands the pointer to the unique geometry object
+ virtual AliPHOSGeometry * GetGeometry() = 0 ;
+ RecPointsList* EmcRecPoints() {return fEmcClusters;} // gets Array of cluster in the crystals
+ RecParticlesList * RecParticles() { return fRecParticles ; } // gets Array of reconstructed particles
+ TrackSegmentsList * TrackSegments(){return fTrackSegments ;} // gets Array of track segments
+ virtual RecPointsList* PpsdRecPoints() = 0 ; // gets Array of clusters in the PPSD
+
+ protected:
+
+ RecPointsList * fEmcClusters ; // The RecPoints (clusters) list in EMC
+ TrackSegmentsList * fTrackSegments ; // The TrackSegment list in PHOS
+ RecParticlesList * fRecParticles ; // The reconstructed particles list in PHOS
+
ClassDef(AliPHOS,2) // Photon Spectrometer Detector (base class)
#include "AliPHOSDigit.h"
#include "AliPHOSTrackSegment.h"
#include "AliPHOSRecParticle.h"
+#include "AliPHOSIndexToObject.h"
ClassImp(AliPHOSAnalyze)
//____________________________________________________________________________
AliPHOSAnalyze::AliPHOSAnalyze(Text_t * name)
{
- // ctor: analyze events from root file: name
+ // ctor: analyze events from root file "name"
Bool_t ok = OpenRootFile(name) ;
if ( !ok ) {
{
// dtor
- fRootFile->Close() ;
+ if (fRootFile->IsOpen() )
+ fRootFile->Close() ;
delete fRootFile ;
fRootFile = 0 ;
// =========== Write the root file
- fRootFile->Write() ;
-
+ fRootFile->Close() ;
+
// =========== Finish
cout << "AnalyzeOneEvent > event # " << fEvt << " processed" << endl ;
//=========== Do the reconstruction
fPHOS->Reconstruction(fRec);
//=========== Cluster in module
- TIter nextEmc(fPHOS->EmcClusters() ) ;
+ TIter nextEmc(fPHOS->EmcRecPoints() ) ;
while((emc = (AliPHOSEmcRecPoint *)nextEmc()))
{
if ( emc->GetPHOSMod() == module )
{
fhEmcCluster->Fill( emc->GetTotalEnergy() );
- TIter nextPpsd( fPHOS->PpsdClusters()) ;
+ TIter nextPpsd( fPHOS->PpsdRecPoints()) ;
while((ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
{
if ( ppsd->GetPHOSMod() == module )
}
}
//=========== Cluster in module PPSD Down
- TIter nextPpsd(fPHOS->PpsdClusters() ) ;
+ TIter nextPpsd(fPHOS->PpsdRecPoints() ) ;
while((ppsd = (AliPHOSPpsdRecPoint *)nextPpsd()))
{
if ( ppsd->GetPHOSMod() == module )
fPHOS = (AliPHOSv0 *)gAlice->GetDetector("PHOS") ;
fGeom = AliPHOSGeometry::GetInstance( fPHOS->GetGeometry()->GetName(), fPHOS->GetGeometry()->GetTitle() );
+
} // else !ok
} // if fRootFile
if ( ok ) {
+
+ //========== Initializes the Index to Object converter
+
+ fObjGetter = AliPHOSIndexToObject::GetInstance(fPHOS) ;
+
//========== Create the Clusterizer
fClu = new AliPHOSClusterizerv1() ;
//=========== Cluster in module
- TClonesArray * emcRP = fPHOS->EmcClusters() ;
+ // TClonesArray * emcRP = fPHOS->EmcClusters() ;
+ TObjArray * emcRP = fPHOS->EmcRecPoints() ;
+
etot = 0.;
Int_t totalnClusters = 0 ;
Int_t nClusters = 0 ;
//=========== Cluster in module PPSD Down
- TClonesArray * ppsdRP = fPHOS->PpsdClusters() ;
+ // TClonesArray * ppsdRP = fPHOS->PpsdClusters() ;
+ TObjArray * ppsdRP = fPHOS->PpsdRecPoints() ;
+
etot = 0.;
TIter nextPpsd(ppsdRP) ;
AliPHOSPpsdRecPoint * ppsd ;
//=========== Cluster in module PPSD Up
- ppsdRP = fPHOS->PpsdClusters() ;
+ ppsdRP = fPHOS->PpsdRecPoints() ;
+
etot = 0.;
TIter nextPpsdUp(ppsdRP) ;
while((ppsd = (AliPHOSPpsdRecPoint *)nextPpsdUp()))
#include "AliPHOSv0.h"
#include "AliPHOSGeometry.h"
#include "AliPHOSPID.h"
+#include "AliPHOSIndexToObject.h"
class AliPHOSAnalyze : public TObject {
private:
- AliPHOSClusterizer * fClu ; // a clusterizer
- Int_t fEvt ; // the evt number being processed
- AliPHOSGeometry * fGeom ; // the PHOS Geometry object
- AliPHOSv0 * fPHOS ; // the PHOS object from the root file
- AliPHOSPID * fPID ; // a particle identifier
- AliPHOSReconstructioner * fRec ; // a reconstructioner
- TFile * fRootFile ; // the root file that contains the data
- AliPHOSTrackSegmentMaker * fTrs ; // a tracksegmentmaker ;
+ AliPHOSClusterizer * fClu ; // a clusterizer
+ Int_t fEvt ; // the evt number being processed
+ AliPHOSGeometry * fGeom ; // the PHOS Geometry object
+ AliPHOSIndexToObject * fObjGetter ; // provides methods to retrieve objects from their index in a list
+ AliPHOSv0 * fPHOS ; // the PHOS object from the root file
+ AliPHOSPID * fPID ; // a particle identifier
+ AliPHOSReconstructioner * fRec ; // a reconstructioner
+ TFile * fRootFile ; // the root file that contains the data
+ AliPHOSTrackSegmentMaker * fTrs ; // a tracksegmentmaker ;
TH1F * fhEmcDigit ; // Histo of digit energies in the Emc
TH1F * fhVetoDigit ; // Histo of digit energies in the Veto
TH1F * fhConvertorDigit ; // Histo of digit energies in the Convertor
// --- AliRoot header files ---
#include "AliPHOSDigit.h"
-
-typedef TClonesArray RecPointsList ;
-typedef TClonesArray DigitsList ;
+#include "AliPHOSRecPoint.h"
class AliPHOSClusterizer : public TObject {
AliPHOSDigit * digit ;
Bool_t notremoved = kTRUE ;
-
while ( (digit = (AliPHOSDigit *)nextdigit()) ) { // scan over the list of digits
AliPHOSRecPoint * clu ;
- int ** clusterdigitslist = new int * [dl->GetEntries()] ;
+ AliPHOSDigit ** clusterdigitslist = new AliPHOSDigit*[dl->GetEntries()] ;
Int_t index ;
if (( ( IsInEmc(digit) ) && ( Calibrate(digit->GetAmp() ) > fEmcClusteringThreshold ) ) ||
( ( !IsInEmc(digit) ) && ( Calibrate(digit->GetAmp() ) > fPpsdClusteringThreshold ) ) ) {
Int_t iDigitInCluster = 0 ;
if ( IsInEmc(digit) ) {
- new ((*emcl)[fNumberOfEmcClusters]) AliPHOSEmcRecPoint(fW0, fLocMaxCut) ; // start a new EMC RecPoint
+ // start a new EMC RecPoint
+ // new ((*emcl)[fNumberOfEmcClusters]) AliPHOSEmcRecPoint(fW0, fLocMaxCut) ; if TClonesArray
+ (*emcl)[fNumberOfEmcClusters] = new AliPHOSEmcRecPoint(fW0, fLocMaxCut) ;
+
clu = (AliPHOSEmcRecPoint *) (*emcl)[fNumberOfEmcClusters] ;
fNumberOfEmcClusters++ ;
clu->AddDigit(*digit, Calibrate(digit->GetAmp())) ;
- clusterdigitslist[iDigitInCluster] = (int* ) digit ;
+ clusterdigitslist[iDigitInCluster] = digit ;
iDigitInCluster++ ;
tempodigitslist.Remove(digit) ;
}
else {
- new ((*ppsdl)[fNumberOfPpsdClusters]) AliPHOSPpsdRecPoint() ; // start a new PPSD cluster
+
+ // start a new PPSD cluster
+ // new ((*ppsdl)[fNumberOfPpsdClusters]) AliPHOSPpsdRecPoint() ; if TClonesArray
+ (*ppsdl)[fNumberOfPpsdClusters] = new AliPHOSPpsdRecPoint() ;
+
clu = (AliPHOSPpsdRecPoint *) ppsdl->At(fNumberOfPpsdClusters) ;
fNumberOfPpsdClusters++ ;
clu->AddDigit(*digit, Calibrate(digit->GetAmp()) ) ;
- clusterdigitslist[iDigitInCluster] = (int* ) digit ;
+ clusterdigitslist[iDigitInCluster] = digit ;
iDigitInCluster++ ;
tempodigitslist.Remove(digit) ;
nextdigit.Reset() ;
AliPHOSDigit * digitN ;
index = 0 ;
while (index < iDigitInCluster){ // scan over digits already in cluster
- digit = (AliPHOSDigit *) clusterdigitslist[index] ;
+ digit = clusterdigitslist[index] ;
index++ ;
while ( (digitN = (AliPHOSDigit *)nextdigit()) ) { // scan over the reduced list of digits
Int_t ineb = AreNeighbours(digit, digitN); // call (digit,digitN) in THAT oder !!!!!
case 0 : // not a neighbour
break ;
case 1 : // are neighbours
- clu->AddDigit( *digitN, Calibrate( digitN->GetAmp() ) ) ;
- clusterdigitslist[iDigitInCluster] =(int*) digitN ;
+ clu->AddDigit(*digitN, Calibrate( digitN->GetAmp() ) ) ;
+ clusterdigitslist[iDigitInCluster] = digitN ;
iDigitInCluster++ ;
tempodigitslist.Remove(digitN) ;
break ;
} // while digit
tempodigitslist.Clear() ;
+
}
//____________________________________________________________________________
{
// default ctor
- fNprimary = 0 ;
- fPrimary1 = -1 ;
- fPrimary2 = -1 ;
- fPrimary3 = -1 ;
+ fIndexInList = -1 ;
+ fNprimary = 0 ;
+ fPrimary1 = -1 ;
+ fPrimary2 = -1 ;
+ fPrimary3 = -1 ;
}
//____________________________________________________________________________
-AliPHOSDigit::AliPHOSDigit(Int_t primary, Int_t id, Int_t DigEnergy)
+AliPHOSDigit::AliPHOSDigit(Int_t primary, Int_t id, Int_t DigEnergy, Int_t index)
{
// ctor with all data
- fId = id ;
- fAmp = DigEnergy ;
- fPrimary1 = primary ;
- fNprimary = 1 ;
+ fAmp = DigEnergy ;
+ fId = id ;
+ fIndexInList = index ;
+ fPrimary1 = primary ;
+ fNprimary = 1 ;
}
//____________________________________________________________________________
{
// copy ctor
- fId = digit.fId;
- fAmp = digit.fAmp ;
- fNprimary = digit.fNprimary ;
- fPrimary1 = digit.fPrimary1 ;
- fPrimary2 = digit.fPrimary2 ;
- fPrimary3 = digit.fPrimary3 ;
+ fAmp = digit.fAmp ;
+ fId = digit.fId;
+ fIndexInList = digit.fIndexInList ;
+ fNprimary = digit.fNprimary ;
+ fPrimary1 = digit.fPrimary1 ;
+ fPrimary2 = digit.fPrimary2 ;
+ fPrimary3 = digit.fPrimary3 ;
}
//____________________________________________________________________________
out << "ID " << digit.fId << " Energy = " << digit.fAmp << endl
<< "Primary 1 = " << digit.fPrimary1 << endl
<< "Primary 2 = " << digit.fPrimary2 << endl
- << "Primary 3 = " << digit.fPrimary3 << endl ;
-
+ << "Primary 3 = " << digit.fPrimary3 << endl
+ << "Position in list = " << digit.fIndexInList << endl ;
return out ;
}
public:
AliPHOSDigit() ;
- AliPHOSDigit(Int_t primary, Int_t id, Int_t DigEnergy) ;
+ AliPHOSDigit(Int_t primary, Int_t id, Int_t DigEnergy, Int_t index = -1) ;
AliPHOSDigit(const AliPHOSDigit & digit) ;
virtual ~AliPHOSDigit(){}
private:
- Int_t fPrimary1 ; // first primary (because I do not know how to stream *fPrimary)
- Int_t fPrimary2 ; // second primary (because I do not know how to stream *fPrimary)
- Int_t fPrimary3 ; // third primary (because I do not know how to stream *fPrimary)
+ Int_t fPrimary1 ; // first primary (because objects in a TClonesArray bust have constant length)
+ Int_t fPrimary2 ; // second primary (because objects in a TClonesArray bust have constant lengt)
+ Int_t fPrimary3 ; // third primary (because objects in a TClonesArray bust have constant lengt)
Int_t fNprimary ; // Number of primaries
-
+
ClassDef(AliPHOSDigit,1) // Digit in PHOS
} ;
#include "AliPHOSGeometry.h"
#include "AliPHOSEmcRecPoint.h"
#include "AliRun.h"
+#include "AliPHOSIndexToObject.h"
ClassImp(AliPHOSEmcRecPoint)
fW0 = W0 ;
fLocMaxCut = LocMaxCut ;
fLocPos.SetX(1000000.) ; //Local position should be evaluated
+
+}
+
+//____________________________________________________________________________
+AliPHOSEmcRecPoint::~AliPHOSEmcRecPoint()
+{
+ if ( fEnergyList )
+ delete[] fEnergyList ;
}
//____________________________________________________________________________
-void AliPHOSEmcRecPoint::AddDigit(AliDigitNew & digit, Float_t Energy)
+void AliPHOSEmcRecPoint::AddDigit(AliPHOSDigit & digit, Float_t Energy)
{
// Adds a digit to the RecPoint
// and accumulates the total amplitude and the multiplicity
if ( fMulDigit >= fMaxDigit ) { // increase the size of the lists
fMaxDigit*=2 ;
- int * tempo = new ( int[fMaxDigit] ) ;
+ Int_t * tempo = new ( Int_t[fMaxDigit] ) ;
Float_t * tempoE = new ( Float_t[fMaxDigit] ) ;
Int_t index ;
for ( index = 0 ; index < fMulDigit ; index++ ){
- tempo[index] = fDigitsList[index] ;
+ tempo[index] = fDigitsList[index] ;
tempoE[index] = fEnergyList[index] ;
}
delete [] fDigitsList ;
- fDigitsList = new ( int[fMaxDigit] ) ;
+ fDigitsList = new ( Int_t[fMaxDigit] ) ;
delete [] fEnergyList ;
fEnergyList = new ( Float_t[fMaxDigit] ) ;
delete [] tempoE ;
} // if
- fDigitsList[fMulDigit] = (int) &digit ;
- fEnergyList[fMulDigit++] = Energy ;
+ fDigitsList[fMulDigit] = digit.GetIndexInList() ;
+ fEnergyList[fMulDigit] = Energy ;
+ fMulDigit++ ;
fAmp += Energy ;
}
// static Int_t pxold, pyold;
- static TGraph * digitgraph = 0 ;
-
- if (!gPad->IsEditable()) return;
-
- TH2F * histo = 0 ;
- TCanvas * histocanvas ;
-
- switch (event) {
-
- case kButton1Down: {
- AliPHOSDigit * digit ;
- AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ;
- Int_t iDigit;
- Int_t relid[4] ;
-
- const Int_t fMulDigit = AliPHOSEmcRecPoint::GetDigitsMultiplicity() ;
- Float_t * xi = new Float_t[fMulDigit] ;
- Float_t * zi = new Float_t[fMulDigit] ;
-
- // create the histogram for the single cluster
- // 1. gets histogram boundaries
- Float_t ximax = -999. ;
- Float_t zimax = -999. ;
- Float_t ximin = 999. ;
- Float_t zimin = 999. ;
-
- for(iDigit=0; iDigit<fMulDigit; iDigit++) {
- digit = (AliPHOSDigit *) fDigitsList[iDigit];
- phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
- phosgeom->RelPosInModule(relid, xi[iDigit], zi[iDigit]);
- if ( xi[iDigit] > ximax )
- ximax = xi[iDigit] ;
- if ( xi[iDigit] < ximin )
- ximin = xi[iDigit] ;
- if ( zi[iDigit] > zimax )
- zimax = zi[iDigit] ;
- if ( zi[iDigit] < zimin )
- zimin = zi[iDigit] ;
- }
- ximax += phosgeom->GetCrystalSize(0) / 2. ;
- zimax += phosgeom->GetCrystalSize(2) / 2. ;
- ximin -= phosgeom->GetCrystalSize(0) / 2. ;
- zimin -= phosgeom->GetCrystalSize(2) / 2. ;
- Int_t xdim = (int)( (ximax - ximin ) / phosgeom->GetCrystalSize(0) + 0.5 ) ;
- Int_t zdim = (int)( (zimax - zimin ) / phosgeom->GetCrystalSize(2) + 0.5 ) ;
-
- // 2. gets the histogram title
-
- Text_t title[100] ;
- sprintf(title,"Energy=%1.2f GeV ; Digits ; %d ", GetEnergy(), GetDigitsMultiplicity()) ;
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
- if (!histo) {
- delete histo ;
- histo = 0 ;
- }
- histo = new TH2F("cluster3D", title, xdim, ximin, ximax, zdim, zimin, zimax) ;
-
- Float_t x, z ;
- for(iDigit=0; iDigit<fMulDigit; iDigit++) {
- digit = (AliPHOSDigit *) fDigitsList[iDigit];
- phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
- phosgeom->RelPosInModule(relid, x, z);
- histo->Fill(x, z, fEnergyList[iDigit] ) ;
- }
-
- if (!digitgraph) {
- digitgraph = new TGraph(fMulDigit,xi,zi);
- digitgraph-> SetMarkerStyle(5) ;
- digitgraph-> SetMarkerSize(1.) ;
- digitgraph-> SetMarkerColor(1) ;
- digitgraph-> Paint("P") ;
- }
-
- Print() ;
- histocanvas = new TCanvas("cluser", "a single cluster", 600, 500) ;
- histocanvas->Draw() ;
- histo->Draw("lego1") ;
-
- delete[] xi ;
- delete[] zi ;
-
- break;
- }
-
- case kButton1Up:
- if (digitgraph) {
- delete digitgraph ;
- digitgraph = 0 ;
- }
- break;
+ static TGraph * digitgraph = 0 ;
+
+ if (!gPad->IsEditable()) return;
+
+ TH2F * histo = 0 ;
+ TCanvas * histocanvas ;
+
+ switch (event) {
+
+ case kButton1Down: {
+ AliPHOSDigit * digit ;
+ AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ;
+ Int_t iDigit;
+ Int_t relid[4] ;
+
+ const Int_t fMulDigit = AliPHOSEmcRecPoint::GetDigitsMultiplicity() ;
+ Float_t * xi = new Float_t[fMulDigit] ;
+ Float_t * zi = new Float_t[fMulDigit] ;
+
+ // create the histogram for the single cluster
+ // 1. gets histogram boundaries
+ Float_t ximax = -999. ;
+ Float_t zimax = -999. ;
+ Float_t ximin = 999. ;
+ Float_t zimin = 999. ;
+
+ for(iDigit=0; iDigit<fMulDigit; iDigit++) {
+ digit = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[iDigit]) ) ;
+ phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
+ phosgeom->RelPosInModule(relid, xi[iDigit], zi[iDigit]);
+ if ( xi[iDigit] > ximax )
+ ximax = xi[iDigit] ;
+ if ( xi[iDigit] < ximin )
+ ximin = xi[iDigit] ;
+ if ( zi[iDigit] > zimax )
+ zimax = zi[iDigit] ;
+ if ( zi[iDigit] < zimin )
+ zimin = zi[iDigit] ;
+ }
+ ximax += phosgeom->GetCrystalSize(0) / 2. ;
+ zimax += phosgeom->GetCrystalSize(2) / 2. ;
+ ximin -= phosgeom->GetCrystalSize(0) / 2. ;
+ zimin -= phosgeom->GetCrystalSize(2) / 2. ;
+ Int_t xdim = (int)( (ximax - ximin ) / phosgeom->GetCrystalSize(0) + 0.5 ) ;
+ Int_t zdim = (int)( (zimax - zimin ) / phosgeom->GetCrystalSize(2) + 0.5 ) ;
+
+ // 2. gets the histogram title
+
+ Text_t title[100] ;
+ sprintf(title,"Energy=%1.2f GeV ; Digits ; %d ", GetEnergy(), GetDigitsMultiplicity()) ;
+
+ if (!histo) {
+ delete histo ;
+ histo = 0 ;
+ }
+ histo = new TH2F("cluster3D", title, xdim, ximin, ximax, zdim, zimin, zimax) ;
+
+ Float_t x, z ;
+ for(iDigit=0; iDigit<fMulDigit; iDigit++) {
+ digit = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[iDigit]) ) ;
+ phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
+ phosgeom->RelPosInModule(relid, x, z);
+ histo->Fill(x, z, fEnergyList[iDigit] ) ;
+ }
+
+ if (!digitgraph) {
+ digitgraph = new TGraph(fMulDigit,xi,zi);
+ digitgraph-> SetMarkerStyle(5) ;
+ digitgraph-> SetMarkerSize(1.) ;
+ digitgraph-> SetMarkerColor(1) ;
+ digitgraph-> Paint("P") ;
+ }
+
+ Print() ;
+ histocanvas = new TCanvas("cluser", "a single cluster", 600, 500) ;
+ histocanvas->Draw() ;
+ histo->Draw("lego1") ;
+
+ delete[] xi ;
+ delete[] zi ;
+
+ break;
+ }
+
+ case kButton1Up:
+ if (digitgraph) {
+ delete digitgraph ;
+ digitgraph = 0 ;
+ }
+ break;
}
}
{
// Calculates the dispersion of the shower at the origine of the RecPoint
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
+
Float_t d = 0 ;
Float_t wtot = 0 ;
Int_t iDigit;
for(iDigit=0; iDigit<fMulDigit; iDigit++) {
- digit = (AliPHOSDigit *) fDigitsList[iDigit];
+ digit = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[iDigit]) ) ;
Int_t relid[4] ;
Float_t xi ;
Float_t zi ;
void AliPHOSEmcRecPoint::GetElipsAxis(Float_t * lambda)
{
// Calculates the axis of the shower ellipsoid
-
+
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
+
Float_t wtot = 0. ;
Float_t x = 0.;
Float_t z = 0.;
Int_t iDigit;
for(iDigit=0; iDigit<fMulDigit; iDigit++) {
- digit = (AliPHOSDigit *) fDigitsList[iDigit];
+ digit = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[iDigit]) ) ;
Int_t relid[4] ;
Float_t xi ;
Float_t zi ;
void AliPHOSEmcRecPoint::GetLocalPosition(TVector3 &LPos)
{
// Calculates the center of gravity in the local PHOS-module coordinates
-
+
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
+
if( fLocPos.X() < 1000000.) { // already evaluated
LPos = fLocPos ;
return ;
for(iDigit=0; iDigit<fMulDigit; iDigit++) {
- digit = (AliPHOSDigit *) fDigitsList[iDigit];
+ digit = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[iDigit]) );
Float_t xi ;
Float_t zi ;
// Calculates the number of local maxima in the cluster using fLocalMaxCut as the minimum
// energy difference between two local maxima
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
+
AliPHOSDigit * digit ;
AliPHOSDigit * digitN ;
Int_t iDigit ;
for(iDigit = 0; iDigit < fMulDigit; iDigit++){
- maxAt[iDigit] = fDigitsList[iDigit] ;
+ maxAt[iDigit] = (Int_t) ( please->GimeDigit(fDigitsList[iDigit]) ) ;
}
for(iDigit = 0 ; iDigit < fMulDigit; iDigit++) {
if(maxAt[iDigit] != -1) {
digit = (AliPHOSDigit *) maxAt[iDigit] ;
-
+
for(iDigitN = 0; iDigitN < fMulDigit; iDigitN++) {
- digitN = (AliPHOSDigit *) fDigitsList[iDigitN] ;
+ digitN = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[iDigitN]) ) ;
if ( AreNeighbours(digit, digitN) ) {
if (fEnergyList[iDigit] > fEnergyList[iDigitN] ) {
Float_t xi ;
Float_t zi ;
Int_t relid[4] ;
-
+
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
+
for(iDigit=0; iDigit<fMulDigit; iDigit++) {
- digit = (AliPHOSDigit *) fDigitsList[iDigit];
+ digit = please->GimeDigit( fDigitsList[iDigit] ) ;
phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
phosgeom->RelPosInModule(relid, xi, zi);
cout << " Id = " << digit->GetId() ;
}
cout << " Multiplicity = " << fMulDigit << endl ;
cout << " Cluster Energy = " << fAmp << endl ;
-
+ cout << " Stored at position " << GetIndexInList() << endl ;
+
}
-
//______________________________________________________________________________
void AliPHOSEmcRecPoint::Streamer(TBuffer &R__b)
{
- // Stream an object of class AliPHOSEmcRecPoint.
- // Needed because of the array fEnergyList
-
+ // Stream an object of class AliPHOSEmcRecPoint.
+
if (R__b.IsReading()) {
Version_t R__v = R__b.ReadVersion(); if (R__v) { }
AliPHOSRecPoint::Streamer(R__b);
R__b >> fDelta;
+ fEnergyList = new Float_t[fMulDigit] ;
+ R__b.ReadFastArray(fEnergyList, fMulDigit);
R__b >> fLocMaxCut;
- R__b.ReadArray(fEnergyList);
R__b >> fW0;
} else {
R__b.WriteVersion(AliPHOSEmcRecPoint::IsA());
AliPHOSRecPoint::Streamer(R__b);
R__b << fDelta;
+ R__b.WriteFastArray(fEnergyList, fMulDigit);
R__b << fLocMaxCut;
- R__b.WriteArray(fEnergyList, GetMaximumDigitMultiplicity() );
R__b << fW0;
}
}
-
-
AliPHOSEmcRecPoint(){} ;
AliPHOSEmcRecPoint(Float_t W0, Float_t LocMaxCut) ;
- virtual ~AliPHOSEmcRecPoint(){}
+ virtual ~AliPHOSEmcRecPoint() ;
- void AddDigit(AliDigitNew & digit, Float_t Energy) ; // add a digit to the digits list
+ virtual void AddDigit(AliPHOSDigit & digit, Float_t Energy) ; // add a digit to the digits list
Int_t Compare(TObject * obj) ; // method for sorting
Float_t GetDelta (){ return fDelta ; }
Bool_t AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * digit2 ) ;
- Float_t fDelta ; // parameter used to sort the clusters
- Float_t fLocMaxCut ; // minimum energy difference to distinguish two maxima
- Float_t *fEnergyList ; // energy of digits
- Float_t fW0 ; // logarithmic weight factor for center of gravity calculation
- TArrayI *fTest ;
-
+ Float_t fDelta ; // parameter used to sort the clusters
+ Float_t *fEnergyList ; // energy of digits
+ Float_t fLocMaxCut ; // minimum energy difference to distinguish two maxima
+ Float_t fW0 ; // logarithmic weight factor for center of gravity calculation
+
ClassDef(AliPHOSEmcRecPoint,1) // EMC RecPoint (cluster)
};
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) ;
virtual void Draw(Option_t *option) ;
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py) ;
+ Int_t GetIndexInList() const { return fIndexInList ; }
virtual Int_t * GetPrimaries(Int_t & number) ;
Int_t GetType() { return fType ; }
TString Name() ;
void Print() ;
void SetPrimary(Int_t index) { fPrimary = index ; }
void SetType(Int_t type) { fType = type ; }
+ void SetIndexInList(Int_t val) { fIndexInList = val ; }
protected:
- Int_t fType ; // particle type obtained by "virtual" reconstruction
- Int_t fPrimary ; // (unique) primary particle index
+ Int_t fIndexInList ; // the index of this RecParticle in the list stored in TreeR (to be set by analysis)
+ Int_t fPrimary ; // (unique) primary particle index
+ Int_t fType ; // particle type obtained by "virtual" reconstruction
ClassDef(AliPHOSFastRecParticle,1) // Reconstructed Particle produced by the fast simulation
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/* $Id: */
+
+//_________________________________________________________________________
+// A singleton that retrieves objets from an array stored in a Tree on a disk file
+// 1. AliPHOSDigit from TreeD
+//
+//*-- Author: Yves Schutz (SUBATECH)
+//////////////////////////////////////////////////////////////////////////////
+
+// --- ROOT system ---
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+
+#include "AliPHOSIndexToObject.h"
+
+ClassImp(AliPHOSIndexToObject)
+
+ AliPHOSIndexToObject * AliPHOSIndexToObject::fObjGetter = 0 ;
+
+//____________________________________________________________________________
+AliPHOSIndexToObject::AliPHOSIndexToObject(AliPHOS * det)
+{
+ // ctor called once to initialize the detector in use
+
+ fDetector = det ;
+}
+
+//____________________________________________________________________________
+AliPHOSIndexToObject * AliPHOSIndexToObject::GetInstance()
+{
+ // Returns the pointer of the unique instance already defined
+
+ AliPHOSIndexToObject * rv = 0 ;
+ if ( fObjGetter )
+ rv = fObjGetter ;
+ else
+ cout << "AliPHOSIndexToObject::GetInstance ERROR: not yet initialized" << endl ;
+
+ return rv ;
+}
+
+//____________________________________________________________________________
+AliPHOSIndexToObject * AliPHOSIndexToObject::GetInstance(AliPHOS * det)
+{
+ // Creates and returns the pointer of the unique instance
+ // Must be called only when the environment has changed (a new event for exemple)
+
+ if ( fObjGetter ) // delete it if already exists
+ delete fObjGetter ;
+
+ fObjGetter = new AliPHOSIndexToObject(det) ;
+
+ return fObjGetter ;
+
+}
+
+//____________________________________________________________________________
+AliPHOSDigit * AliPHOSIndexToObject::GimeDigit(Int_t index)
+{
+ // returns the object AliPHOSDigit stored at array position index in TreeD
+
+ AliPHOSDigit * rv = 0 ;
+
+ if ( index >= fDetector->Digits()->GetEntries() )
+ cout << "AliPHOSIndexToObject::GimeDigit: index " << index << " larger than available entries "
+ << fDetector->Digits()->GetEntries() << endl ;
+ else if ( index != -1)
+ rv = (AliPHOSDigit *) (fDetector->Digits()->At(index) ) ;
+
+ return rv ;
+
+}
+//____________________________________________________________________________
+TParticle * AliPHOSIndexToObject::GimePrimaryParticle(Int_t index)
+{
+ // returns the object TParticle stored at array position index in TreeK
+
+ TParticle * rv = 0 ;
+
+ if ( index >= gAlice->Particles()->GetEntries() )
+ cout << "AliPHOSIndexToObject::GimePrimaryParticles: index " << index << " larger than available entries "
+ << gAlice->Particles()->GetEntries() << endl ;
+ else
+ rv = (TParticle *) (gAlice->Particles()->At(index) ) ;
+
+ return rv ;
+
+}
+
+//____________________________________________________________________________
+AliPHOSRecParticle * AliPHOSIndexToObject::GimeRecParticle(Int_t index)
+{
+ // returns the object AliPHOSRecParticle stored at array position index in TreeR/PHOSRP
+ // this one takes more work because the detetor object and the objects in TreeR are not saved at the same time
+ // therefore the links are lost
+
+ AliPHOSRecParticle * rv = 0 ;
+
+ RecParticlesList * rplist = fDetector->RecParticles() ;
+
+ Int_t rpentries = 0 ;
+
+ if (rplist)
+ rpentries = rplist->GetEntries() ;
+
+ fReconstruct = gAlice->TreeR() ;
+
+ if (!rpentries) {
+ fReconstruct->SetBranchAddress( "PHOSRP", &rplist ) ;
+ fReconstruct->GetEvent(0) ;
+ rpentries = rplist->GetEntries() ;
+ }
+
+ if ( index >= rpentries ) // ERROR
+ cout << "AliPHOSIndexToObject::GimeRecParticle: index " << index << " larger than available entries "
+ << rpentries << endl ;
+ else
+ rv = (AliPHOSRecParticle *) (fDetector->RecParticles()->At(index) ) ;
+
+ return rv ;
+
+}
+
+//____________________________________________________________________________
+AliRecPoint * AliPHOSIndexToObject::GimeRecPoint(Int_t index, TString type)
+{
+ // returns the object AliPHOSRecPoint stored at array position index in TreeR/PHOSEmcRP or TreeR/PHOSPpsdRP
+ // this one takes more work because the detetor object and the objects in TreeR are not saved at the same time
+ // therefore the links are lost
+
+ AliPHOSRecPoint * rv = 0 ;
+
+ RecPointsList * emclist = fDetector->EmcRecPoints() ;
+ RecPointsList * ppsdlist = fDetector->PpsdRecPoints() ;
+
+ Int_t emcentries = 0 ;
+ Int_t ppsdentries = 0 ;
+
+ if (emclist)
+ emcentries = emclist->GetEntries() ;
+
+ if (ppsdlist)
+ ppsdentries= ppsdlist->GetEntries() ;
+
+ fReconstruct = gAlice->TreeR() ;
+
+ if (!emcentries || !ppsdentries) {
+ fReconstruct->SetBranchAddress("PHOSEmcRP",&emclist);
+ fReconstruct->SetBranchAddress("PHOSPpsdRP",&ppsdlist);
+ fReconstruct->GetEvent(0) ;
+ emcentries = emclist->GetEntries() ;
+ ppsdentries= ppsdlist->GetEntries() ;
+ }
+
+ if ( type == "emc" ) {
+ if ( index >= emcentries )
+ cout << "AliPHOSIndexToObject::GimeRecPoint emc: index " << index << " larger than available entries "
+ << emcentries << endl ;
+ else
+ rv = (AliPHOSEmcRecPoint *) ( emclist->At(index) ) ;
+ }
+ else if ( type == "ppsd" ) {
+ if ( index >= ppsdentries )
+ cout << "AliPHOSIndexToObject::GimeRecPoint ppsd: index " << index << " larger than available entries "
+ << ppsdentries << endl ;
+ else if (index != -1)
+ rv = (AliPHOSPpsdRecPoint *) (ppsdlist->At(index) ) ;
+ } else
+ cout << "AliPHOSIndexToObject::GimeRecPoint: " << type << " is an unknown type " << endl
+ << " valid types are : emc " << endl
+ << " ppsd " << endl ;
+
+ return rv ;
+
+}
+
+//____________________________________________________________________________
+AliPHOSTrackSegment * AliPHOSIndexToObject::GimeTrackSegment(Int_t index)
+{
+ // returns the object AliPHOSTrackSegment stored at array position index in TreeR/PHOSTS
+ // this one takes more work because the detetor object and the objects in TreeR are not saved at the same time
+ // therefore the links are lost
+
+ AliPHOSTrackSegment * rv = 0 ;
+
+ TrackSegmentsList * tslist = fDetector->TrackSegments() ;
+
+ Int_t tsentries = 0 ;
+
+ if (tslist)
+ tsentries = tslist->GetEntries() ;
+
+ fReconstruct = gAlice->TreeR() ;
+
+ if (!tsentries) {
+ fReconstruct->SetBranchAddress( "PHOSTS", &tslist ) ;
+ fReconstruct->GetEvent(0) ;
+ tsentries = tslist->GetEntries() ;
+ }
+
+ if ( index >= tsentries ) // ERROR
+ cout << "AliPHOSIndexToObject::GimeTrackSegment: index " << index << " larger than available entries "
+ << tsentries << endl ;
+ else
+ rv = (AliPHOSTrackSegment *) (fTrackSegmentsList->At(index) ) ;
+
+ return rv ;
+
+}
--- /dev/null
+#ifndef ALIPHOSINDEXTOOBJECT_H
+#define ALIPHOSINDEXTOOBJECT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+//_________________________________________________________________________
+// A singleton that retrieves objets from an array stored in a Tree on a disk file
+// 1. AliPHOSDigit from TreeD
+//
+//*-- Author: Yves Schutz (SUBATECH)
+
+
+// --- ROOT system ---
+
+#include "TFile.h"
+#include "TString.h"
+#include "TParticle.h"
+
+// --- Standard library ---
+
+#include "assert.h"
+
+// --- AliRoot header files ---
+
+#include "AliPHOS.h"
+#include "AliRun.h"
+#include "AliPHOSDigit.h"
+#include "AliPHOSEmcRecPoint.h"
+#include "AliPHOSPpsdRecPoint.h"
+#include "AliPHOSTrackSegment.h"
+#include "AliPHOSRecParticle.h"
+
+class AliPHOSIndexToObject : public TObject {
+
+public:
+
+ AliPHOSIndexToObject(){ assert(0==1) ; } // should be never called
+ virtual ~AliPHOSIndexToObject(){} ; // dtor
+
+ static AliPHOSIndexToObject * GetInstance(AliPHOS * det) ;
+ static AliPHOSIndexToObject * GetInstance() ;
+
+ AliPHOSDigit * GimeDigit(Int_t index) ;
+ TParticle * GimePrimaryParticle(Int_t index) ;
+ AliPHOSRecParticle * GimeRecParticle(Int_t index) ;
+ AliRecPoint * GimeRecPoint(Int_t index, TString s) ;
+ AliPHOSTrackSegment * GimeTrackSegment(Int_t index) ;
+
+ private:
+
+ AliPHOSIndexToObject(AliPHOS * det) ;
+
+ AliPHOS * fDetector ; // the detector
+ TTree * fDigits ; // the digits tree
+ // RecPointsList * fEmcList ; // array od EMC RecPoints
+ TTree * fKine ; // the kine tree that contains primary particles
+ // RecPointsList * fPpsdList ; // array od PPSD reconstructed points
+ RecParticlesList * fRecParticlesList ; // array of reconstructed particles
+ TTree * fReconstruct ; // the reconstruction tree
+ TrackSegmentsList * fTrackSegmentsList ; // array of track segments
+
+ static AliPHOSIndexToObject * fObjGetter ; // pointer to the unique instance of the singleton
+
+ ClassDef(AliPHOSIndexToObject,1) // Algorithm class that provides methods to retrieve objects from a list knowing the index
+
+};
+
+#endif // AliPHOSINDEXTOOBJECT_H
// --- AliRoot header files ---
-#include "AliPHOSTrackSegmentMaker.h"
+#include "AliPHOSTrackSegment.h"
+#include "AliPHOSRecParticle.h"
-typedef TClonesArray RecParticlesList ;
class AliPHOSPID : public TObject {
#include "AliPHOSPIDv1.h"
#include "AliPHOSTrackSegment.h"
#include "AliPHOSRecParticle.h"
+#include "AliPHOSIndexToObject.h"
ClassImp( AliPHOSPIDv1)
while ( (tracksegment = (AliPHOSTrackSegment *)next()) ) {
new( (*rpl)[index] ) AliPHOSRecParticle(tracksegment) ;
- rp = (AliPHOSRecParticle *)(*rpl)[index] ;
+ rp = (AliPHOSRecParticle *)rpl->At(index) ;
// try to figure out the type of particle:
// 1. just looking at the PPSD information
- if( tracksegment->GetPpsdUp() == 0 ) { // Neutral
+
+ if( tracksegment->GetPpsdUpRecPoint() == 0 ) { // Neutral
- if( tracksegment->GetPpsdLow() == 0 ) // Neutral
+ if( tracksegment->GetPpsdLowRecPoint() == 0 ) // Neutral
type = kNEUTRAL ;
else { // check the shower profile
AliPHOSEmcRecPoint * recp = tracksegment->GetEmcRecPoint() ;
} // Neutral
else // Charged
type = kCHARGED ;
-
+
// 2. from the shower profile analysis
if ( type == kNEUTRAL ) {
AliPHOSEmcRecPoint * recp = tracksegment->GetEmcRecPoint() ;
// 3. from the shower dispersion
if (type == kCHARGED) {
+
if( tracksegment->GetEmcRecPoint()->GetDispersion() > fCutOnDispersion) // shower dispersion cut
type = kCHARGEDHADRON ;
- else
- type = kELECTRON ;
+ // else
+ // type = kELECTRON ;
}
rp->SetType(type) ;
index++ ;
#include "AliPHOSGeometry.h"
#include "AliPHOSPpsdRecPoint.h"
#include "AliRun.h"
+#include "AliPHOSIndexToObject.h"
ClassImp(AliPHOSPpsdRecPoint)
}
//____________________________________________________________________________
-void AliPHOSPpsdRecPoint::AddDigit(AliDigitNew & digit, Float_t Energy)
+void AliPHOSPpsdRecPoint::AddDigit(AliPHOSDigit & digit, Float_t Energy)
{
// adds a digit to the digits list
// and accumulates the total amplitude and the multiplicity
delete [] tempo ;
}
- fDigitsList[fMulDigit++] = (int) &digit ;
+ fDigitsList[fMulDigit++] = digit.GetIndexInList() ;
fAmp += Energy ;
}
{
// Calculates the local position in the PHOS-PPSD-module corrdinates
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
+
if( fLocPos.X() < 1000000.) { //allready evaluated
LPos = fLocPos ;
return ;
Int_t iDigit;
for(iDigit = 0; iDigit < fMulDigit; iDigit++) {
- digit = (AliPHOSDigit *) fDigitsList[iDigit];
+ digit = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[iDigit]) );
Float_t xi ;
Float_t zi ;
{
Int_t relid[4] ;
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
+
AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ;
- AliPHOSDigit *digit = (AliPHOSDigit *)fDigitsList[0] ;
+
+ AliPHOSDigit *digit = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[0]) ) ;
phosgeom->AbsToRelNumbering(digit->GetId(),relid);
Bool_t up ;
Float_t zi ;
Int_t relid[4] ;
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
for(iDigit=0; iDigit<fMulDigit; iDigit++) {
- digit = (AliPHOSDigit *) fDigitsList[iDigit];
- phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
- phosgeom->RelPosInModule(relid, xi, zi);
- cout << " Id = " << digit->GetId() ;
- cout << " Phos mod = " << relid[0] ;
- cout << " PPSD mod = " << relid[1] ;
- cout << " x = " << xi ;
- cout << " z = " << zi ;
- cout << " Energy = " << digit->GetAmp() << endl ;
+ digit = please->GimeDigit( fDigitsList[iDigit] ) ;
+ if (digit) {
+ phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
+ phosgeom->RelPosInModule(relid, xi, zi);
+ cout << " Id = " << digit->GetId() ;
+ cout << " Phos mod = " << relid[0] ;
+ cout << " PPSD mod = " << relid[1] ;
+ cout << " x = " << xi ;
+ cout << " z = " << zi ;
+ cout << " Energy = " << digit->GetAmp() << endl ;
+ }
}
cout << " Multiplicity = " << fMulDigit << endl ;
+ cout << " Stored at position " << fIndexInList << endl ;
}
AliPHOSPpsdRecPoint() ; // ctor
virtual ~AliPHOSPpsdRecPoint(){} // dtor
- void AddDigit(AliDigitNew & digit, Float_t Energy) ;
+ virtual void AddDigit(AliPHOSDigit & digit, Float_t Energy) ;
Int_t Compare(TObject * obj) ; // method to sort clusters
Float_t GetDelta(void) {return fDelta ;}
#include "AliPHOSRecParticle.h"
#include "TPad.h"
+#include "AliPHOSIndexToObject.h"
ClassImp(AliPHOSRecParticle)
{
// ctor
- fPHOSTrackSegment = new AliPHOSTrackSegment(*ts) ;
+ fPHOSTrackSegment = ts->GetIndexInList() ;
+ fIndexInList = -1 ;
Float_t kenergy = ts->GetEnergy() ;
TVector3 momdir = ts->GetMomentumDirection() ;
fPx = kenergy * momdir.X() ;
{
// copy ctor
- fPHOSTrackSegment = new AliPHOSTrackSegment( *( rp.GetPHOSTrackSegment()) ) ;
+ fPHOSTrackSegment = rp.fPHOSTrackSegment ;
fType = rp.fType ;
+ fIndexInList = rp.fIndexInList ;
fPdgCode = rp.fPdgCode;
fStatusCode = rp.fStatusCode;
fParticlePDG = rp.fParticlePDG;
}
-//____________________________________________________________________________
- AliPHOSRecParticle::~AliPHOSRecParticle()
-{
- // dtor
-
- if(!fPHOSTrackSegment) {
- delete fPHOSTrackSegment ;
- fPHOSTrackSegment = 0 ;
- }
-}
-
//____________________________________________________________________________
Int_t * AliPHOSRecParticle::GetPrimaries(Int_t & number)
{
// Retrieves all the primary particles at the origine of this reconstructed particle
+ AliPHOSTrackSegment * ts = GetPHOSTrackSegment() ;
+
Int_t emcnumber = 0 ;
- Int_t * emclist = fPHOSTrackSegment->GetPrimariesEmc(emcnumber) ;
+ Int_t * emclist = ts->GetPrimariesEmc(emcnumber) ;
- Int_t ppsdlnumber = 0 ;
- Int_t * ppsdllist = fPHOSTrackSegment->GetPrimariesPpsdLow(ppsdlnumber) ;
+ Int_t ppsdlnumber = 0 ;
+ Int_t * ppsdllist = ts->GetPrimariesPpsdLow(ppsdlnumber) ;
Int_t ppsdunumber = 0 ;
- Int_t * ppsdulist = fPHOSTrackSegment->GetPrimariesPpsdUp(ppsdunumber) ;
+ Int_t * ppsdulist = ts->GetPrimariesPpsdUp(ppsdunumber) ;
number = emcnumber + ppsdlnumber + ppsdunumber ;
Int_t * list = new Int_t[number] ;
index++ ;
}
- cout << "passed 6 " << endl;
-
delete emclist ;
delete ppsdllist ;
delete ppsdulist ;
return list ;
}
+
+//____________________________________________________________________________
+AliPHOSTrackSegment * AliPHOSRecParticle::GetPHOSTrackSegment() const
+{
+ // Retrieves the PHOS track segment at the origine of this reconstructed particle
+
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
+ return please->GimeTrackSegment( fPHOSTrackSegment ) ;
+
+}
+
+
+
#include "AliPHOSTrackSegment.h"
#include "AliPHOSFastRecParticle.h"
+typedef TClonesArray RecParticlesList ;
+
class AliPHOSRecParticle : public AliPHOSFastRecParticle {
public:
AliPHOSRecParticle() {}; // ctor
AliPHOSRecParticle(AliPHOSTrackSegment * ts) ; // ctor
AliPHOSRecParticle(const AliPHOSRecParticle & rp) ; // ctor
- virtual ~AliPHOSRecParticle() ; // dtor
+ virtual ~AliPHOSRecParticle(){} ; // dtor
- AliPHOSTrackSegment * GetPHOSTrackSegment() const { return fPHOSTrackSegment ; }
- virtual Int_t * GetPrimaries(Int_t & number) ;
+ AliPHOSTrackSegment * GetPHOSTrackSegment() const ;
+ Int_t * GetPrimaries(Int_t & number) ;
private:
- AliPHOSTrackSegment * fPHOSTrackSegment ; // pointer to the associated track segment in PHOS
+ Int_t fPHOSTrackSegment ; // pointer to the associated track segment in PHOS
ClassDef(AliPHOSRecParticle,1) // Reconstructed Particle
};
#include "AliPHOSGeometry.h"
#include "AliPHOSDigit.h"
#include "AliPHOSRecPoint.h"
-
-
+#include "AliPHOSIndexToObject.h"
ClassImp(AliPHOSRecPoint)
if(fPHOSMod > 0)
return fPHOSMod ;
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
+
Int_t relid[4] ;
+
AliPHOSDigit * digit ;
- digit = (AliPHOSDigit *) fDigitsList[0] ;
+ digit = (AliPHOSDigit *) ( please->GimeDigit(fDigitsList[0]) ) ;
AliPHOSGeometry * phosgeom = (AliPHOSGeometry *) fGeom ;
phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
// --- AliRoot header files ---
#include "AliRecPoint.h"
+#include "AliPHOSDigit.h"
+
+typedef TObjArray RecPointsList ;
class AliPHOSRecPoint : public AliRecPoint {
AliPHOSRecPoint() ; // ctor
virtual ~AliPHOSRecPoint(){} // dtor
- virtual void AddDigit(AliDigitNew & digit, Float_t Energy) = 0 ;
+ virtual void AddDigit(AliPHOSDigit & digit, Float_t Energy) = 0 ;
+ virtual Int_t Compare(TObject * obj) { assert(0==1) ; }
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
virtual void Draw(Option_t * option="") ;
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py) ;
virtual Int_t GetPHOSMod(void) ;
virtual Int_t * GetPrimaries(Int_t & number) ;
virtual Bool_t IsEmc(void){return kTRUE ;}
+ virtual Bool_t IsSortable() const { return kTRUE ; }
virtual void Paint(Option_t * option="");
virtual void Print(Option_t * opt = "void") {}
- virtual Int_t Compare(TObject * obj) { assert(0==1) ; }
- virtual Bool_t IsSortable() const { return kTRUE ; }
-
protected:
- Int_t fPHOSMod ; // PHOS Module number in which the RecPoint is found
+ Int_t fPHOSMod ; // PHOS Module number in which the RecPoint is found
ClassDef(AliPHOSRecPoint,1) // RecPoint for PHOS (Base Class)
}
//____________________________________________________________________________
- void AliPHOSReconstructioner::Make(TClonesArray * dl, RecPointsList * emccl, RecPointsList * ppsdl,
+ void AliPHOSReconstructioner::Make(DigitsList * dl, RecPointsList * emccl, RecPointsList * ppsdl,
TrackSegmentsList * trsl, RecParticlesList * rpl)
{
// Launches the Reconstruction process in the sequence: Make the reconstructed poins (clusterize)
// Make the track segments
// Make the reconstructed particles
+ Int_t index ;
+
cout << "Start making reconstructed points (clusterizing)" << endl;
fClusterizer->MakeClusters(dl, emccl, ppsdl);
- cout << "Start making track segments" << endl;
- fTrackSegmentMaker->MakeTrackSegments(dl, emccl, ppsdl, trsl) ;
+ // mark the position of the RecPoints in the array
+ AliPHOSEmcRecPoint * emcrp ;
+ for (index = 0 ; index < emccl->GetEntries() ; index++) {
+ emcrp = (AliPHOSEmcRecPoint * )emccl->At(index) ;
+ emcrp->SetIndexInList(index) ;
+ }
+
+ AliPHOSPpsdRecPoint * ppsdrp ;
+ for (index = 0 ; index < ppsdl->GetEntries() ; index++) {
+ ppsdrp = (AliPHOSPpsdRecPoint * )ppsdl->At(index) ;
+ ppsdrp->SetIndexInList(index) ;
+ }
+ cout << "Start making track segments" << endl;
+ fTrackSegmentMaker->MakeTrackSegments(dl, emccl, ppsdl, trsl) ;
+
+ // mark the position of the TrackSegments in the array
+ AliPHOSTrackSegment * trs ;
+ for (index = 0 ; index < trsl->GetEntries() ; index++) {
+ trs = (AliPHOSTrackSegment * )trsl->At(index) ;
+ trs->SetIndexInList(index) ;
+ }
+
cout << "Start making reconstructed particles" << endl;
fPID->MakeParticles(trsl, rpl) ;
+
+ // mark the position of the RecParticles in the array
+ AliPHOSRecParticle * rp ;
+ for (index = 0 ; index < rpl->GetEntries() ; index++) {
+ rp = (AliPHOSRecParticle * )rpl->At(index) ;
+ rp->SetIndexInList(index) ;
+ }
}
#include "AliPHOSTrackSegment.h"
#include "AliPHOSv0.h"
+#include "AliPHOSIndexToObject.h"
ClassImp(AliPHOSTrackSegment)
//____________________________________________________________________________
-AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , AliPHOSPpsdRecPoint * ppsdRP1,
- AliPHOSPpsdRecPoint * ppsdRP2 )
+AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , AliPHOSPpsdRecPoint * ppsdrp1,
+ AliPHOSPpsdRecPoint * ppsdrp2 )
{
// ctor
if( emc )
- fEmcRecPoint = emc ;
+ fEmcRecPoint = emc->GetIndexInList() ;
+ else
+ fEmcRecPoint = -1 ;
- if( ppsdRP1 )
- fPpsdUp = ppsdRP1 ;
+ if( ppsdrp1 )
+ fPpsdUpRecPoint = ppsdrp1->GetIndexInList() ;
+ else
+ fPpsdUpRecPoint = -1 ;
- if( ppsdRP2 )
- fPpsdLow = ppsdRP2 ;
+ if( ppsdrp2 )
+ fPpsdLowRecPoint = ppsdrp2->GetIndexInList() ;
+ else
+ fPpsdLowRecPoint = -1 ;
+ fIndexInList = -1 ;
}
//____________________________________________________________________________
// Copy of a track segment into another track segment
TObject::Copy(obj) ;
- ( (AliPHOSTrackSegment &)obj ).fEmcRecPointId = fEmcRecPointId ;
- ( (AliPHOSTrackSegment &)obj ).fPpsdLowId = fPpsdLowId ;
- ( (AliPHOSTrackSegment &)obj ).fPpsdUpId = fPpsdUpId ;
+ ( (AliPHOSTrackSegment &)obj ).fEmcRecPoint = fEmcRecPoint ;
+ ( (AliPHOSTrackSegment &)obj ).fPpsdLowRecPoint = fPpsdLowRecPoint ;
+ ( (AliPHOSTrackSegment &)obj ).fPpsdUpRecPoint = fPpsdUpRecPoint ;
+ ( (AliPHOSTrackSegment &)obj ).fIndexInList = fIndexInList ;
}
//____________________________________________________________________________
Int_t AliPHOSTrackSegment::DistancetoPrimitive(Int_t px, Int_t py)
// The distance is computed in pixels units.
Int_t div = 1 ;
+ Int_t dist = 9999 ;
+
TVector3 pos(0.,0.,0.) ;
- fEmcRecPoint->GetLocalPosition( pos) ;
- Float_t x = pos.X() ;
- Float_t y = pos.Z() ;
- if ( fPpsdLow ) {
- fPpsdLow->GetLocalPosition( pos ) ;
- x += pos.X() ;
- y += pos.Z() ;
- div++ ;
- }
- if ( fPpsdUp ) {
- fPpsdUp->GetLocalPosition( pos ) ;
- x += pos.X() ;
- y += pos.Z() ;
- div++ ;
- }
- x /= div ;
- y /= div ;
-
- const Int_t kMaxDiff = 10;
- Int_t pxm = gPad->XtoAbsPixel(x);
- Int_t pym = gPad->YtoAbsPixel(y);
- Int_t dist = (px-pxm)*(px-pxm) + (py-pym)*(py-pym);
+ AliPHOSEmcRecPoint * emcrp = GetEmcRecPoint() ;
+ AliPHOSPpsdRecPoint * ppsdlrp = GetPpsdLowRecPoint() ;
+ AliPHOSPpsdRecPoint * ppsdurp = GetPpsdUpRecPoint() ;
+
+ if ( emcrp != 0 ) {
+ emcrp->GetLocalPosition( pos) ;
+ Float_t x = pos.X() ;
+ Float_t y = pos.Z() ;
+ if ( ppsdlrp != 0 ) {
+ ppsdlrp->GetLocalPosition( pos ) ;
+ x += pos.X() ;
+ y += pos.Z() ;
+ div++ ;
+ }
+ if ( ppsdurp != 0 ) {
+ ppsdurp->GetLocalPosition( pos ) ;
+ x += pos.X() ;
+ y += pos.Z() ;
+ div++ ;
+ }
+ x /= div ;
+ y /= div ;
- if (dist > kMaxDiff) return 9999;
- return dist;
+ const Int_t kMaxDiff = 10;
+ Int_t pxm = gPad->XtoAbsPixel(x);
+ Int_t pym = gPad->YtoAbsPixel(y);
+ dist = (px-pxm)*(px-pxm) + (py-pym)*(py-pym);
+
+ if (dist > kMaxDiff) return 9999;
+ }
+ return dist;
}
//___________________________________________________________________________
static TPaveText* textTS = 0 ;
+ AliPHOSEmcRecPoint * emcrp = GetEmcRecPoint() ;
+
if (!gPad->IsEditable())
return;
if (!textTS) {
TVector3 pos(0.,0.,0.) ;
- fEmcRecPoint->GetLocalPosition(pos) ;
+ emcrp->GetLocalPosition(pos) ;
textTS = new TPaveText(pos.X()-10,pos.Z()+10,pos.X()+5,pos.Z()+15,"") ;
Text_t line1[40] ;
sprintf(line1,"See RecParticle for ID") ;
{
// Calculates the distance between the EMC RecPoint and PPSD RecPoint
+ AliPHOSEmcRecPoint * emcrp = GetEmcRecPoint() ;
+ AliPHOSPpsdRecPoint * ppsdlrp = GetPpsdLowRecPoint() ;
+
TVector3 vecEmc ;
- fEmcRecPoint->GetLocalPosition(vecEmc) ;
+ emcrp->GetLocalPosition(vecEmc) ;
TVector3 vecPpsd ;
- if( fPpsdLow->GetMultiplicity() )
- fPpsdLow->GetLocalPosition(vecPpsd) ;
- else {
- vecPpsd.SetX(10000.) ;
- }
- vecEmc -= vecPpsd ;
-
+ if ( ppsdlrp !=0 ) {
+ if( ppsdlrp->GetMultiplicity() )
+ ppsdlrp->GetLocalPosition(vecPpsd) ;
+ else {
+ vecPpsd.SetX(10000.) ;
+ }
+ vecEmc -= vecPpsd ;
+ }
Float_t r = vecEmc.Mag();;
return r ;
}
+//____________________________________________________________________________
+AliPHOSEmcRecPoint * AliPHOSTrackSegment::GetEmcRecPoint() const
+{
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
+ AliPHOSEmcRecPoint * rv = 0 ;
+ if ( fEmcRecPoint > -1 )
+ rv = (AliPHOSEmcRecPoint *)please->GimeRecPoint( fEmcRecPoint, TString("emc") );
+
+ return rv ;
+
+}
+
+//____________________________________________________________________________
+ Float_t AliPHOSTrackSegment::GetEnergy()
+{
+ // Returns energy in EMC
+
+ AliPHOSEmcRecPoint * emcrp = GetEmcRecPoint() ;
+
+ return emcrp->GetTotalEnergy() ;
+}
+
//____________________________________________________________________________
TVector3 AliPHOSTrackSegment::GetMomentumDirection()
{
// However because of the poor position resolution of PPSD the direction is always taken as if we were
// in case 1.
+
+ AliPHOSEmcRecPoint * emcrp = GetEmcRecPoint() ;
+ // AliPHOSPpsdRecPoint * ppsdlrp = GetPpsdLowRecPoint() ;
+ // AliPHOSPpsdRecPoint * ppsdurp = GetPpsdUpRecPoint() ;
+
TVector3 dir(0,0,0) ;
TMatrix mdummy ;
TVector3 posEmc ;
- fEmcRecPoint->GetGlobalPosition(posEmc, mdummy) ;
+ emcrp->GetGlobalPosition(posEmc, mdummy) ;
// Correction for the depth of the shower starting point (TDR p 127)
- Float_t energy = fEmcRecPoint->GetEnergy() ;
+ Float_t energy = emcrp->GetEnergy() ;
Float_t para = 0.925 ;
Float_t parb = 6.52 ;
TVector3 localpos ;
- fEmcRecPoint->GetLocalPosition(localpos) ;
+ emcrp->GetLocalPosition(localpos) ;
AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ;
Float_t radius = geom->GetIPtoOuterCoverDistance() + geom->GetOuterBoxSize(1) ;
TVector3 emcglobalpos ;
TMatrix dummy ;
- fEmcRecPoint->GetGlobalPosition(emcglobalpos, dummy) ;
+ emcrp->GetGlobalPosition(emcglobalpos, dummy) ;
emcglobalpos.SetX( emcglobalpos.X() - depthx ) ;
emcglobalpos.SetZ( emcglobalpos.Z() - depthz ) ;
// TVector3 ppsdlglobalpos ;
// TVector3 ppsduglobalpos ;
-// if( fPpsdLow ){ // certainly a photon that has concerted
+// if( fPpsdLowRecPoint ){ // certainly a photon that has concerted
-// fPpsdLow->GetGlobalPosition(ppsdlglobalpos, mdummy) ;
+// fPpsdLowRecPoint->GetGlobalPosition(ppsdlglobalpos, mdummy) ;
// dir = emcglobalpos - ppsdlglobalpos ;
-// if( fPpsdUp ){ // nop looks like a charged
+// if( fPpsdUpRecPoint ){ // nop looks like a charged
-// fPpsdUp->GetGlobalPosition(ppsduglobalpos, mdummy) ;
+// fPpsdUpRecPoint->GetGlobalPosition(ppsduglobalpos, mdummy) ;
// dir = ( dir + emcglobalpos - ppsduglobalpos ) * 0.5 ;
// }
// }
return dir ;
}
+//____________________________________________________________________________
+Int_t AliPHOSTrackSegment:: GetPHOSMod(void)
+{
+
+ AliPHOSEmcRecPoint * emcrp = GetEmcRecPoint() ;
+
+ return emcrp->GetPHOSMod();
+}
+
+//____________________________________________________________________________
+AliPHOSPpsdRecPoint * AliPHOSTrackSegment::GetPpsdLowRecPoint() const
+{
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
+ AliPHOSPpsdRecPoint * rv = 0 ;
+
+ if ( fPpsdLowRecPoint > -1 )
+ rv = (AliPHOSPpsdRecPoint *)please->GimeRecPoint( fPpsdLowRecPoint, TString("ppsd") ) ;
+
+ return rv ;
+}
+
+//____________________________________________________________________________
+AliPHOSPpsdRecPoint * AliPHOSTrackSegment::GetPpsdUpRecPoint() const
+{
+ AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
+ AliPHOSPpsdRecPoint * rv = 0 ;
+
+ if ( fPpsdUpRecPoint > -1 )
+ rv = (AliPHOSPpsdRecPoint *)please->GimeRecPoint( fPpsdUpRecPoint, TString("ppsd") ) ;
+
+ return rv ;
+}
+
//____________________________________________________________________________
Int_t * AliPHOSTrackSegment::GetPrimariesEmc(Int_t & number)
{
// Retrieves the primary particle(s) at the origin of the EMC RecPoint
-
+
+ AliPHOSEmcRecPoint * emcrp = GetEmcRecPoint() ;
+
Int_t * rv = 0 ;
number = 0 ;
- if ( fEmcRecPoint )
- rv = fEmcRecPoint->GetPrimaries(number) ;
+ if ( emcrp )
+ rv = emcrp->GetPrimaries(number) ;
return rv ;
}
{
// Retrieves the primary particle(s) at the origin of the lower PPSD RecPoint
+ AliPHOSPpsdRecPoint * ppsdlrp = GetPpsdLowRecPoint() ;
+
Int_t * rv = 0 ;
number = 0 ;
- if ( fPpsdLow )
- rv = fPpsdLow->GetPrimaries(number) ;
+ if ( ppsdlrp )
+ rv = ppsdlrp->GetPrimaries(number) ;
return rv ;
}
{
// Retrieves the primary particle(s) at the origin of the upper PPSD RecPoint
+ AliPHOSPpsdRecPoint * ppsdurp = GetPpsdUpRecPoint() ;
+
Int_t * rv = 0 ;
number = 0 ;
- if ( fPpsdUp )
- rv = fPpsdUp->GetPrimaries(number) ;
+ if ( ppsdurp )
+ rv = ppsdurp->GetPrimaries(number) ;
return rv ;
}
void AliPHOSTrackSegment::GetPosition( TVector3 & pos )
{
// Returns position of the EMC RecPoint
-
+
+ AliPHOSEmcRecPoint * emcrp = GetEmcRecPoint() ;
+
TMatrix dummy ;
- fEmcRecPoint->GetGlobalPosition(pos, dummy) ;
+ emcrp->GetGlobalPosition(pos, dummy) ;
}
//______________________________________________________________________________
void AliPHOSTrackSegment::Paint(Option_t *)
{
- // Paint this ALiPHOSTrackSegment as a TMarker with its current attributes
+ // Paint this AliPHOSTrackSegment as a TMarker with its current attributes
+
+ AliPHOSEmcRecPoint * emcrp = GetEmcRecPoint() ;
+ AliPHOSPpsdRecPoint * ppsdlrp = GetPpsdLowRecPoint() ;
+ AliPHOSPpsdRecPoint * ppsdurp = GetPpsdUpRecPoint() ;
TVector3 posemc(999., 999., 999.) ;
TVector3 posppsdl(999., 999., 999.) ;
TVector3 posppsdu(999., 999., 999.) ;
- fEmcRecPoint->GetLocalPosition(posemc) ;
- if (fPpsdLow !=0 )
- fPpsdLow->GetLocalPosition(posppsdl) ;
- if (fPpsdUp !=0 )
- fPpsdUp->GetLocalPosition(posppsdu) ;
+ emcrp->GetLocalPosition(posemc) ;
+ if (ppsdlrp !=0 )
+ ppsdlrp->GetLocalPosition(posppsdl) ;
+ if (ppsdurp !=0 )
+ ppsdurp->GetLocalPosition(posppsdu) ;
Coord_t xemc = posemc.X() ;
Coord_t yemc = posemc.Z() ;
{
// Print all information on this track Segment
- cout << "--------AliPHOSTrackSegment-------- "<<endl ;
- cout << "EMC Reconstructed Point: " << fEmcRecPoint << endl;
+ AliPHOSEmcRecPoint * emcrp = GetEmcRecPoint() ;
+ AliPHOSPpsdRecPoint * ppsdlrp = GetPpsdLowRecPoint() ;
+ AliPHOSPpsdRecPoint * ppsdurp = GetPpsdUpRecPoint() ;
TVector3 pos ;
TMatrix dummy ;
- fEmcRecPoint->GetGlobalPosition( pos, dummy ) ;
-
- cout << " position " << pos.X() << " " << pos.Y() << " " << pos.Z() << " Energy " << fEmcRecPoint->GetTotalEnergy() << endl ;
- cout << "PPSD Low Reconstructed Point: " << endl;
-
- if(fPpsdLow){
- fPpsdLow->GetGlobalPosition( pos , dummy ) ;
- cout << " position " << pos.X() << " " << pos.Y() << " " << pos.Z() << endl ;
- }
+ cout << "--------AliPHOSTrackSegment-------- "<<endl ;
- cout << "PPSD Up Reconstructed Point: " << endl;
+ if ( emcrp != 0 ) {
+ cout << "******** EMC Reconstructed Point: " << endl;
+ emcrp->Print() ;
+
+ emcrp->GetGlobalPosition( pos, dummy ) ;
+
+ cout << " Global position " << pos.X() << " " << pos.Y() << " " << pos.Z() << " Energy " << emcrp->GetTotalEnergy() << endl ;
+ }
- if(fPpsdUp ){
- fPpsdUp->GetGlobalPosition( pos, dummy ) ;
- cout << " position " << pos.X() << " " << pos.Y() << " " << pos.Z() << endl ;
+ if ( ppsdlrp != 0 ) {
+ cout << "******** PPSD Low Reconstructed Point: " << endl;
+
+ ppsdlrp->Print() ;
+ ppsdlrp->GetGlobalPosition( pos , dummy ) ;
+ cout << " position " << pos.X() << " " << pos.Y() << " " << pos.Z() << endl ;
}
+ if( ppsdurp != 0 ) {
+ cout << "******** PPSD Up Reconstructed Point: " << endl;
+
+ ppsdurp->Print() ;
+ ppsdurp->GetGlobalPosition( pos, dummy ) ;
+ cout << " position " << pos.X() << " " << pos.Y() << " " << pos.Z() << endl ;
+ }
+
}
#include "AliPHOSEmcRecPoint.h"
#include "AliPHOSPpsdRecPoint.h"
+typedef TClonesArray TrackSegmentsList ;
+
class AliPHOSTrackSegment : public TObject {
public:
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
virtual void Draw(Option_t * option="") ;
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
- Float_t GetEnergy(){ return fEmcRecPoint->GetTotalEnergy() ;} // Returns energy in EMC
+ Float_t GetEnergy() ; // Returns energy in EMC
Float_t GetDistanceInPHOSPlane(void) ; // Computes in PHOS plane the relative position between EMC and PPSD clusters
- virtual Int_t GetPHOSMod(void) {return fEmcRecPoint->GetPHOSMod(); }
+ virtual Int_t GetPHOSMod(void) ;
TVector3 GetMomentumDirection() ; // Returns the momentum direction
- void GetPosition( TVector3 & pos ) ; // Returns positions of hit
+ void GetPosition( TVector3 & pos ) ; // Returns positions of hit
Int_t * GetPrimariesEmc(Int_t & number) ;
Int_t * GetPrimariesPpsdLow(Int_t & number) ;
Int_t * GetPrimariesPpsdUp(Int_t & number) ;
- AliPHOSEmcRecPoint * GetEmcRecPoint() const { return fEmcRecPoint ; }
- AliPHOSPpsdRecPoint * GetPpsdLow() const { return fPpsdLow ; }
- AliPHOSPpsdRecPoint * GetPpsdUp() const { return fPpsdUp ; }
- virtual void Paint(Option_t * option="");
- void Print() ;
-
+ AliPHOSEmcRecPoint * GetEmcRecPoint() const ;
+ Int_t GetIndexInList() const { return fIndexInList ; }
+ AliPHOSPpsdRecPoint * GetPpsdLowRecPoint() const ;
+ AliPHOSPpsdRecPoint * GetPpsdUpRecPoint() const ;
+ virtual void Paint(Option_t * option="");
+ void Print() ;
+ void SetIndexInList(Int_t val) { fIndexInList = val ; }
+
private:
- AliPHOSEmcRecPoint * fEmcRecPoint ; //! The EMC reconstructed point
- AliPHOSPpsdRecPoint * fPpsdLow ; //! The PPSD reconstructed point from the lower layer
- AliPHOSPpsdRecPoint * fPpsdUp ; //! The PPSD reconstructed point from the upper layer
- Int_t fEmcRecPointId ; // The EMC reconstructed point Id in the list
- Int_t fPpsdLowId ; // The PPSD reconstructed point from the lower layer Id in the list
- Int_t fPpsdUpId ; // The PPSD reconstructed point from the upper layer Id in the list
+ Int_t fEmcRecPoint ; // The EMC reconstructed point index in array stored in TreeR/PHOSEmcRP
+ Int_t fIndexInList ; // the index of this TrackSegment in the list stored in TreeR (to be set by analysis)
+ Int_t fPpsdLowRecPoint ; // The PPSD reconstructed point from the lower layer index in array stored in TreeR/PHOSPpsdRP
+ Int_t fPpsdUpRecPoint ; // The PPSD reconstructed point from the upper layer index in array stored in TreeR/PHOSPpsdRP
ClassDef(AliPHOSTrackSegment,1) // Track segment in PHOS
// --- AliRoot header files ---
#include "TObjArray.h"
-#include "AliPHOSClusterizer.h"
-#include "AliPHOSEmcRecPoint.h"
-#include "AliPHOSPpsdRecPoint.h"
-
-typedef TClonesArray TrackSegmentsList ;
+#include "AliPHOSDigit.h"
+#include "AliPHOSRecPoint.h"
+#include "AliPHOSTrackSegment.h"
class AliPHOSTrackSegmentMaker : public TObject {
Int_t nEmcUnfolded = emcIn->GetEntries() ;
for(index = emcStopedAt; index < nEmcUnfolded; index++){
- emcRecPoint = (AliPHOSEmcRecPoint *) (*emcIn)[index] ;
+ emcRecPoint = (AliPHOSEmcRecPoint *) emcIn->At(index) ;
if(emcRecPoint->GetPHOSMod() != phosmod )
break ;
emcStopedAt = index ;
for(index = ppsdStopedAt; index < ppsdIn->GetEntries(); index++){
- ppsdRecPoint = (AliPHOSPpsdRecPoint *) (*ppsdIn)[index] ;
+ ppsdRecPoint = (AliPHOSPpsdRecPoint *) ppsdIn->At(index) ;
if(ppsdRecPoint->GetPHOSMod() != phosmod )
break ;
if(ppsdRecPoint->GetUp() )
if(toofar)
break ;
- if(r < fR0)
+ if(r < fR0){
new( (*linklowArray)[iLinkLow++]) AliPHOSLink(r, iEmcClu, iPpsdLow) ;
-
+ }
iPpsdLow++ ;
}
if(toofar)
break ;
- if(r < fR0)
+ if(r < fR0) {
new( (*linkupArray)[iLinkUp++]) AliPHOSLink(r, iEmcClu, iPpsdUp) ;
-
+ }
iPpsdUp++ ;
}
fPinElectronicNoise = 0.010 ;
fDigitThreshold = 1. ; // 1 GeV
- fHits = new TClonesArray("AliPHOSHit",100) ;
- gAlice->AddHitList(fHits) ;
+ // We do not want to save in TreeH the raw hits
+ // fHits = new TClonesArray("AliPHOSHit",100) ;
+ // gAlice->AddHitList(fHits) ;
+ // But save the cumulated hits instead (need to create the branch myself)
+ // It is put in the Digit Tree because the TreeH is filled after each primary
+ // and the TreeD at the end of the event (branch is set in FinishEvent() ).
+
fTmpHits= new TClonesArray("AliPHOSHit",100) ;
fNTmpHits = fNhits = 0 ;
// is used for the digitization part.
fPinElectronicNoise = 0.010 ;
- fHits = new TClonesArray("AliPHOSHit",100) ;
+
+ // We do not want to save in TreeH the raw hits
+ //fHits = new TClonesArray("AliPHOSHit",100) ;
+
fDigits = new TClonesArray("AliPHOSDigit",100) ;
fTmpHits= new TClonesArray("AliPHOSHit",100) ;
// In any case, fills the fTmpHit TClonesArray (with "accumulated hits")
newHit = new AliPHOSHit(primary, Id, hits) ;
- TClonesArray &lhits = *fHits;
+
+ // We do not want to save in TreeH the raw hits
+ // TClonesArray &lhits = *fHits;
for ( hitCounter = 0 ; hitCounter < fNTmpHits && !deja ; hitCounter++ ) {
curHit = (AliPHOSHit*) ltmphits[hitCounter] ;
- // curHit2 = (AliPHOSHit*) lhits[hitCounter] ; // ca plante dans PurifyKine !?
if( *curHit == *newHit ) {
*curHit = *curHit + *newHit ;
- // *curHit2 = *curHit2 + *newHit ;
deja = kTRUE ;
}
}
if ( !deja ) {
new(ltmphits[fNTmpHits]) AliPHOSHit(*newHit) ;
fNTmpHits++ ;
- new(lhits[fNhits]) AliPHOSHit(*newHit) ; // will be saved on disk
- fNhits++ ;
}
+ // We do not want to save in TreeH the raw hits
+ // new(lhits[fNhits]) AliPHOSHit(*newHit) ;
+ // fNhits++ ;
+
// Please note that the fTmpHits array must survive up to the
// end of the events, so it does not appear e.g. in ResetHits() (
// which is called at the end of each primary).
{
// Applies the energy calibration
- Float_t fB = 100. ; // ; 100000000. ;
+ Float_t fB = 100000000. ;
Float_t fA = 0. ;
Int_t chan = Int_t(fA + Energy*fB ) ;
return chan ;
// Adds to the energy the electronic noise
// Keeps digits with energy above fDigitThreshold
+ // Save the cumulated hits instead of raw hits (need to create the branch myself)
+ // It is put in the Digit Tree because the TreeH is filled after each primary
+ // and the TreeD at the end of the event.
+ if ( fTmpHits && gAlice->TreeD() ) {
+ char branchname[10] ;
+ sprintf(branchname, "%sCH", GetName()) ;
+ gAlice->TreeD()->Branch(branchname, &fTmpHits, fBufferSize) ;
+ } else
+ cout << "AliPHOSv0::AliPHOSv0: Failed to create branch PHOSCH in TreeD " << endl ;
+
Int_t i ;
Int_t relid[4];
Int_t j ;
}
}
+ fDigits->Compress() ;
+
+ fNdigits = fDigits->GetEntries() ;
+ for (i = 0 ; i < fNdigits ; i++) {
+ newdigit = (AliPHOSDigit *) fDigits->At(i) ;
+ newdigit->SetIndexInList(i) ;
+ }
- fDigits->Compress() ;
- fNTmpHits = 0 ;
- fTmpHits->Delete();
-
}
//____________________________________________________________________________
void AliPHOSv0::Reconstruction(AliPHOSReconstructioner * Reconstructioner)
{
// 1. Reinitializes the existing RecPoint, TrackSegment, and RecParticles Lists and
- // 2. Creates a branch in TreeR for each list
+ // 2. Creates TreeR wit a branch for each list
// 3. Steers the reconstruction processes
// 4. Saves the 3 lists in TreeR
// 5. Write the Tree to File
char branchname[10] ;
// 1.
+
+ gAlice->MakeTree("R") ;
+ Int_t splitlevel = 0 ;
if (fEmcClusters) {
fEmcClusters->Delete() ;
delete fEmcClusters ;
fEmcClusters = 0 ;
}
- fEmcClusters= new RecPointsList("AliPHOSEmcRecPoint", 100) ;
+
+ // fEmcClusters= new RecPointsList("AliPHOSEmcRecPoint", 100) ; if TClonesArray
+ fEmcClusters= new RecPointsList(100) ;
+
if ( fEmcClusters && gAlice->TreeR() ) {
- sprintf(branchname,"%sERP",GetName()) ;
- gAlice->TreeR()->Branch(branchname, &fEmcClusters, fBufferSize);
+ sprintf(branchname,"%sEmcRP",GetName()) ;
+
+ // gAlice->TreeR()->Branch(branchname, &fEmcClusters, fBufferSize); if TClonesArray
+ gAlice->TreeR()->Branch(branchname, "TObjArray", &fEmcClusters, fBufferSize, splitlevel) ;
}
if (fPpsdClusters) {
delete fPpsdClusters ;
fPpsdClusters = 0 ;
}
- fPpsdClusters = new RecPointsList("AliPHOSPpsdRecPoint", 100) ;
+
+ // fPpsdClusters = new RecPointsList("AliPHOSPpsdRecPoint", 100) ; if TClonesArray
+ fPpsdClusters = new RecPointsList(100) ;
+
if ( fPpsdClusters && gAlice->TreeR() ) {
- sprintf(branchname,"%sPRP",GetName()) ;
- gAlice->TreeR()->Branch(branchname, &fPpsdClusters, fBufferSize);
- }
+ sprintf(branchname,"%sPpsdRP",GetName()) ;
+
+ // gAlice->TreeR()->Branch(branchname, &fPpsdClusters, fBufferSize); if TClonesArray
+ gAlice->TreeR()->Branch(branchname, "TObjArray", &fPpsdClusters, fBufferSize, splitlevel);
+ }
if (fTrackSegments) {
fTrackSegments->Delete() ;
delete fTrackSegments ;
fTrackSegments = 0 ;
}
+
fTrackSegments = new TrackSegmentsList("AliPHOSTrackSegment", 100) ;
if ( fTrackSegments && gAlice->TreeR() ) {
sprintf(branchname,"%sTS",GetName()) ;
gAlice->TreeR()->Branch(branchname, &fTrackSegments, fBufferSize);
}
- if (fRecParticles) {
- fRecParticles->Delete() ;
+ if (fRecParticles) {
+ fRecParticles->Delete() ;
delete fRecParticles ;
fRecParticles = 0 ;
}
fRecParticles = new RecParticlesList("AliPHOSRecParticle", 100) ;
if ( fRecParticles && gAlice->TreeR() ) {
- sprintf(branchname,"%sRP",GetName()) ;
- gAlice->TreeR()->Branch(branchname, &fRecParticles, fBufferSize);
+ sprintf(branchname,"%sRP",GetName()) ;
+ gAlice->TreeR()->Branch(branchname, &fRecParticles, fBufferSize);
}
// 3.
fReconstructioner->Make(fDigits, fEmcClusters, fPpsdClusters, fTrackSegments, fRecParticles);
- // 4.
+ // 4. Expand or Shrink the arrays to the proper size
+
+ Int_t size ;
+
+ size = fEmcClusters->GetEntries() ;
+ fEmcClusters->Expand(size) ;
+
+ size = fPpsdClusters->GetEntries() ;
+ fPpsdClusters->Expand(size) ;
+
+ size = fTrackSegments->GetEntries() ;
+ fTrackSegments->Expand(size) ;
+
+ size = fRecParticles->GetEntries() ;
+ fRecParticles->Expand(size) ;
gAlice->TreeR()->Fill() ;
// 5.
gAlice->TreeR()->Write() ;
-
+
}
+//____________________________________________________________________________
+void AliPHOSv0::ResetDigits()
+{
+ // May sound strange, but cumulative hits are store in digits Tree
+
+ if( fTmpHits ) {
+ fTmpHits->Delete();
+ fNTmpHits = 0 ;
+ }
+}
+
//____________________________________________________________________________
void AliPHOSv0::StepManager(void)
{
void CreateGeometryforPHOS(void) ; // creates the PHOS geometry for GEANT
void CreateGeometryforPPSD(void) ; // creates the PPSD geometry for GEANT
Int_t Digitize(Float_t Energy);
- RecPointsList* EmcClusters() {return fEmcClusters;} // gets TClonesArray of cluster in the crystals
void FinishEvent(void) ; // makes the digits from the hits
virtual AliPHOSGeometry * GetGeometry() { return fGeom ; }
virtual void Init(void) ; // does nothing
Int_t IsVersion(void) const { return 0 ; }
void MakeBranch(Option_t* opt) ;
- RecPointsList* PpsdClusters() { return fPpsdClusters ; } // gets TClonesArray of clusters in the PPSD
+ virtual RecPointsList* PpsdRecPoints() { return fPpsdClusters ; } // gets Array of clusters in the PPSD
void Reconstruction(AliPHOSReconstructioner * Reconstructioner) ;
- RecParticlesList * RecParticles() { return fRecParticles ; } // gets TClonesArray of reconstructed particles
void ResetClusters(){} ;
+ virtual void ResetDigits() ;
void SetReconstructioner(AliPHOSReconstructioner& Reconstructioner) {fReconstructioner = &Reconstructioner ;}
void SetDigitThreshold(Float_t th) { fDigitThreshold = th ; }
virtual void StepManager(void) ; // does the tracking through PHOS and a preliminary digitalization
- TrackSegmentsList * TrackSegments(){return fTrackSegments ;}
protected:
Float_t fDigitThreshold ; // Threshold for the digit registration
- RecPointsList * fEmcClusters ; // The RecPoints (clusters) list in EMC
AliPHOSGeometry * fGeom ; // Geometry definition
Int_t fNTmpHits ; //! Used internally for digitalization
Float_t fPinElectronicNoise ; // Electronic Noise in the PIN
AliPHOSReconstructioner * fReconstructioner ; // Reconstrutioner of the PHOS event: Clusterization and subtracking procedures
TClonesArray * fTmpHits ; //! Used internally for digitalization
AliPHOSTrackSegmentMaker * fTrackSegmentMaker ; // Reconstructioner of the PHOS track segment: 2 x PPSD + 1 x EMC
- TrackSegmentsList * fTrackSegments ; // The TrackSegment list in PHOS
- RecParticlesList * fRecParticles ; // The reconstructed particles list in PHOS
ClassDef(AliPHOSv0,1) // Implementation of PHOS manager class for layout EMC+PPSD
AliPHOSReconstructioner.cxx AliPHOSTrackSegment.cxx \
AliPHOSTrackSegmentMaker.cxx AliPHOSTrackSegmentMakerv1.cxx \
AliPHOSRecParticle.cxx AliPHOSPID.cxx AliPHOSPIDv1.cxx \
- AliPHOSAnalyze.cxx AliPHOSvFast.cxx AliPHOSFastRecParticle.cxx
+ AliPHOSAnalyze.cxx AliPHOSvFast.cxx AliPHOSFastRecParticle.cxx \
+ AliPHOSIndexToObject.cxx \
# C++ Headers
#pragma link off all functions;
#pragma link C++ class AliPHOS ;
-#pragma link C++ class AliPHOSArray ;
#pragma link C++ class AliPHOSClusterizer ;
#pragma link C++ class AliPHOSClusterizerv1 ;
#pragma link C++ class AliPHOSDigit ;
#pragma link C++ class AliPHOSFastRecParticle ;
#pragma link C++ class AliPHOSGeometry ;
#pragma link C++ class AliPHOSHit ;
+#pragma link C++ class AliPHOSIndexToObject ;
#pragma link C++ class AliPHOSLink ;
#pragma link C++ class AliPHOSPpsdRecPoint ;
#pragma link C++ class AliPHOSReconstructioner ;
--- /dev/null
+{
+Int_t evt = 0 ;
+RecAna * t = new RecAna("junk.root");
+t->GetEvent(evt);
+TObjArray * lp = t->PHOSPpsdRP ;
+ cout << "Tree macro = " << lp << endl ;
+for (int i = 0 ; i < lp->GetEntries() ; i++ ) {
+ AliPHOSPpsdRecPoint * rpp = (AliPHOSPpsdRecPoint *)lp->At(i) ;
+ rpp.Print();
+}
+TObjArray * le = t->PHOSEmcRP ;
+for (int i = 0 ; i < le->GetEntries() ; i++ ) {
+ AliPHOSEmcRecPoint * rp = (AliPHOSEmcRecPoint *)le->At(i) ;
+ rp->Print();
+}
+
+AliPHOSIndexToObject * please = AliPHOSIndexToObject::GetInstance() ;
+
+for (int i = 0 ; i < (t->PHOSTS_-1) ; i++) {
+ cout << "TrackSegment # " << i << endl
+ << "====================" << endl ;
+ int index = t->PHOSTS_fEmcRecPoint[i] ;
+ AliPHOSEmcRecPoint * emrp = (AliPHOSEmcRecPoint *) ( please->GimeRecPoint(index, TString("emc") ) ) ;
+ emrp->Print() ;
+ index = t->PHOSTS_fPpsdLowRecPoint[i] ;
+ AliPHOSPpsdRecPoint * ppsdl = (AliPHOSPpsdRecPoint *) ( please->GimeRecPoint(index, TString("ppsd") ) ) ;
+ if (ppsdl)
+ ppsdl->Print() ;
+ index = t->PHOSTS_fPpsdUpRecPoint[i] ;
+ AliPHOSPpsdRecPoint * ppsdu = (AliPHOSPpsdRecPoint *) ( please->GimeRecPoint(index, TString("ppsd") ) ) ;
+ if (ppsdu)
+ ppsdu->Print() ;
+}
+for (int i = 0 ; i < (t->PHOSRP_-1) ; i++) {
+ cout << "RecParticles # " << i << endl
+ << "====================" << endl ;
+ cout << "type = " << t->PHOSRP_fType[i] << " energy = " << t->PHOSRP_fE[i] << endl ;
+}
+delete t ;
+}
--- /dev/null
+#define RecAna_cxx
+#include "RecAna.h"
+
+void RecAna::Loop()
+{
+ // In a Root session, you can do:
+ // Root > .L RecAna.C
+ // Root > RecAna t(filename)
+ // Root > t.GetEvent(evt); // Fill t data members with event number evt
+ // Root > t.Show(); // Show values of current event e
+ // Root > t.Show(evt); // Read and show values of entry evt
+ // Root > t.Loop(); // Loop on all entries
+ //
+
+ // This is the loop skeleton
+ // To read only selected branches, Insert statements like:
+ // METHOD1:
+ // fTree->SetBranchStatus("*",0); // disable all branches
+ // fTree->SetBranchStatus("branchname",1); // activate branchname
+ // METHOD2: replace line
+ // fTree->GetEntry(i); // read all branches
+ //by b_branchname->GetEntry(i); //read only this branch
+ if (fTree == 0) return;
+
+ Int_t nentries = Int_t(fTree->GetEntries());
+
+ Int_t nbytes = 0, nb = 0;
+ for (Int_t i=0; i<nentries;i++) {
+ if (LoadTree(i) < 0) break;
+ nb = fTree->GetEntry(i); nbytes += nb;
+ }
+}
--- /dev/null
+//////////////////////////////////////////////////////////
+// A Demo Macro that shows how to analyze the
+// reconstructed Tree
+//
+// Y. Schutz (SUBATECH)
+//////////////////////////////////////////////////////////
+
+
+#ifndef RecAna_h
+#define RecAna_h
+
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <TTree.h>
+#include <TFile.h>
+#endif
+
+const Int_t kMaxPHOSTS = 9;
+const Int_t kMaxPHOSRP = 9;
+
+class RecAna {
+ public:
+ AliPHOSv0 * fPHOS ;
+ TTree *fTree; //pointer to the analyzed TTree or TChain
+ TTree *fCurrent; //pointer to the current TTree
+ //Declaration of leaves types
+ TObjArray *PHOSEmcRP;
+ TObjArray *PHOSPpsdRP;
+ Int_t PHOSTS_;
+ Int_t PHOSTS_fEmcRecPoint[kMaxPHOSTS];
+ Int_t PHOSTS_fPpsdLowRecPoint[kMaxPHOSTS];
+ Int_t PHOSTS_fPpsdUpRecPoint[kMaxPHOSTS];
+ UInt_t PHOSTS_fUniqueID[kMaxPHOSTS];
+ UInt_t PHOSTS_fBits[kMaxPHOSTS];
+ Int_t PHOSRP_;
+ Int_t PHOSRP_fPHOSTrackSegment[kMaxPHOSRP];
+ Int_t PHOSRP_fIndexInList[kMaxPHOSRP];
+ Int_t PHOSRP_fPrimary[kMaxPHOSRP];
+ Int_t PHOSRP_fType[kMaxPHOSRP];
+ Int_t PHOSRP_fPdgCode[kMaxPHOSRP];
+ Int_t PHOSRP_fStatusCode[kMaxPHOSRP];
+ Int_t PHOSRP_fMother[2][kMaxPHOSRP];
+ Int_t PHOSRP_fDaughter[2][kMaxPHOSRP];
+ Float_t PHOSRP_fWeight[kMaxPHOSRP];
+ Double_t PHOSRP_fCalcMass[kMaxPHOSRP];
+ Double_t PHOSRP_fPx[kMaxPHOSRP];
+ Double_t PHOSRP_fPy[kMaxPHOSRP];
+ Double_t PHOSRP_fPz[kMaxPHOSRP];
+ Double_t PHOSRP_fE[kMaxPHOSRP];
+ Double_t PHOSRP_fVx[kMaxPHOSRP];
+ Double_t PHOSRP_fVy[kMaxPHOSRP];
+ Double_t PHOSRP_fVz[kMaxPHOSRP];
+ Double_t PHOSRP_fVt[kMaxPHOSRP];
+ Double_t PHOSRP_fPolarTheta[kMaxPHOSRP];
+ Double_t PHOSRP_fPolarPhi[kMaxPHOSRP];
+ UInt_t PHOSRP_fUniqueID[kMaxPHOSRP];
+ UInt_t PHOSRP_fBits[kMaxPHOSRP];
+ Short_t PHOSRP_fLineColor[kMaxPHOSRP];
+ Short_t PHOSRP_fLineStyle[kMaxPHOSRP];
+ Short_t PHOSRP_fLineWidth[kMaxPHOSRP];
+
+ //List of branches
+ TBranch *b_PHOSEmcRP;
+ TBranch *b_PHOSPpsdRP;
+ TBranch *b_PHOSTS_;
+ TBranch *b_PHOSTS_fEmcRecPoint;
+ TBranch *b_PHOSTS_fPpsdLowRecPoint;
+ TBranch *b_PHOSTS_fPpsdUpRecPoint;
+ TBranch *b_PHOSTS_fUniqueID;
+ TBranch *b_PHOSTS_fBits;
+ TBranch *b_PHOSRP_;
+ TBranch *b_PHOSRP_fPHOSTrackSegment;
+ TBranch *b_PHOSRP_fIndexInList;
+ TBranch *b_PHOSRP_fPrimary;
+ TBranch *b_PHOSRP_fType;
+ TBranch *b_PHOSRP_fPdgCode;
+ TBranch *b_PHOSRP_fStatusCode;
+ TBranch *b_PHOSRP_fMother;
+ TBranch *b_PHOSRP_fDaughter;
+ TBranch *b_PHOSRP_fWeight;
+ TBranch *b_PHOSRP_fCalcMass;
+ TBranch *b_PHOSRP_fPx;
+ TBranch *b_PHOSRP_fPy;
+ TBranch *b_PHOSRP_fPz;
+ TBranch *b_PHOSRP_fE;
+ TBranch *b_PHOSRP_fVx;
+ TBranch *b_PHOSRP_fVy;
+ TBranch *b_PHOSRP_fVz;
+ TBranch *b_PHOSRP_fVt;
+ TBranch *b_PHOSRP_fPolarTheta;
+ TBranch *b_PHOSRP_fPolarPhi;
+ TBranch *b_PHOSRP_fUniqueID;
+ TBranch *b_PHOSRP_fBits;
+ TBranch *b_PHOSRP_fLineColor;
+ TBranch *b_PHOSRP_fLineStyle;
+ TBranch *b_PHOSRP_fLineWidth;
+
+ RecAna() {};
+ RecAna(TString filename);
+ RecAna(TTree *tree) {};
+ ~RecAna() {;}
+ Int_t GetEntry(Int_t entry = 0);
+ Int_t GetEvent(Int_t evt);
+ Int_t LoadTree(Int_t entry = 0);
+ void Init(TTree *tree);
+ void Loop();
+ void Notify();
+ void Show(Int_t entry = -1);
+};
+
+#endif
+
+#ifdef RecAna_cxx
+RecAna::RecAna(TString filename)
+{
+ // connect the file used to generate this class and read the Tree.
+
+ TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
+ if (!f)
+ f = new TFile(filename);
+
+ // setup the gAlice evironment
+
+ gAlice = (AliRun*) f->Get("gAlice") ;
+
+ // get the PHOS detectector, the geometry instance and the index to object converter instance
+
+ fPHOS = (AliPHOSv0 *)gAlice->GetDetector("PHOS") ;
+ AliPHOSGeometry::GetInstance( fPHOS->GetGeometry()->GetName(), fPHOS->GetGeometry()->GetTitle() );
+ AliPHOSIndexToObject::GetInstance(fPHOS) ;
+}
+
+Int_t RecAna::GetEntry(Int_t entry)
+{
+ // Read contents of entry, always = 0.
+
+ if (!fTree)
+ return 0;
+
+ return fTree->GetEntry(entry);
+}
+
+Int_t RecAna::GetEvent(Int_t evt)
+{
+ // get the selected event
+
+ gAlice->GetEvent(evt);
+
+ // connect to the Reconstruction tree
+
+ fTree = gAlice->TreeR();
+
+ // set the branches
+
+ Init(fTree);
+
+ // gets the data
+
+ GetEntry(0);
+ cout << "macro EmcRecpoints = " << fPHOS->EmcRecPoints() << endl ;
+}
+
+Int_t RecAna::LoadTree(Int_t entry)
+{
+ // Set the environment to read one entry, always = 0.
+
+ if (!fTree)
+ return -5;
+ Int_t centry = fTree->LoadTree(entry);
+ if (centry < 0)
+ return centry;
+ if (fTree->GetTree() != fCurrent) {
+ fCurrent = fTree->GetTree();
+ Notify();
+ }
+ return centry;
+}
+
+void RecAna::Init(TTree *tree)
+{
+ // Set branch addresses
+ if (tree == 0) return;
+ fTree = tree;
+ fCurrent = 0;
+
+ fTree->SetBranchAddress("PHOSEmcRP",&PHOSEmcRP);
+ fTree->SetBranchAddress("PHOSPpsdRP",&PHOSPpsdRP);
+ fTree->SetBranchAddress("PHOSTS_",&PHOSTS_);
+ fTree->SetBranchAddress("PHOSTS.fEmcRecPoint",PHOSTS_fEmcRecPoint);
+ fTree->SetBranchAddress("PHOSTS.fPpsdLowRecPoint",PHOSTS_fPpsdLowRecPoint);
+ fTree->SetBranchAddress("PHOSTS.fPpsdUpRecPoint",PHOSTS_fPpsdUpRecPoint);
+ fTree->SetBranchAddress("PHOSTS.fUniqueID",PHOSTS_fUniqueID);
+ fTree->SetBranchAddress("PHOSTS.fBits",PHOSTS_fBits);
+ fTree->SetBranchAddress("PHOSRP_",&PHOSRP_);
+ fTree->SetBranchAddress("PHOSRP.fPHOSTrackSegment",PHOSRP_fPHOSTrackSegment);
+ fTree->SetBranchAddress("PHOSRP.fIndexInList",PHOSRP_fIndexInList);
+ fTree->SetBranchAddress("PHOSRP.fPrimary",PHOSRP_fPrimary);
+ fTree->SetBranchAddress("PHOSRP.fType",PHOSRP_fType);
+ fTree->SetBranchAddress("PHOSRP.fPdgCode",PHOSRP_fPdgCode);
+ fTree->SetBranchAddress("PHOSRP.fStatusCode",PHOSRP_fStatusCode);
+ fTree->SetBranchAddress("PHOSRP.fMother[2]",PHOSRP_fMother);
+ fTree->SetBranchAddress("PHOSRP.fDaughter[2]",PHOSRP_fDaughter);
+ fTree->SetBranchAddress("PHOSRP.fWeight",PHOSRP_fWeight);
+ fTree->SetBranchAddress("PHOSRP.fCalcMass",PHOSRP_fCalcMass);
+ fTree->SetBranchAddress("PHOSRP.fPx",PHOSRP_fPx);
+ fTree->SetBranchAddress("PHOSRP.fPy",PHOSRP_fPy);
+ fTree->SetBranchAddress("PHOSRP.fPz",PHOSRP_fPz);
+ fTree->SetBranchAddress("PHOSRP.fE",PHOSRP_fE);
+ fTree->SetBranchAddress("PHOSRP.fVx",PHOSRP_fVx);
+ fTree->SetBranchAddress("PHOSRP.fVy",PHOSRP_fVy);
+ fTree->SetBranchAddress("PHOSRP.fVz",PHOSRP_fVz);
+ fTree->SetBranchAddress("PHOSRP.fVt",PHOSRP_fVt);
+ fTree->SetBranchAddress("PHOSRP.fPolarTheta",PHOSRP_fPolarTheta);
+ fTree->SetBranchAddress("PHOSRP.fPolarPhi",PHOSRP_fPolarPhi);
+ fTree->SetBranchAddress("PHOSRP.fUniqueID",PHOSRP_fUniqueID);
+ fTree->SetBranchAddress("PHOSRP.fBits",PHOSRP_fBits);
+ fTree->SetBranchAddress("PHOSRP.fLineColor",PHOSRP_fLineColor);
+ fTree->SetBranchAddress("PHOSRP.fLineStyle",PHOSRP_fLineStyle);
+ fTree->SetBranchAddress("PHOSRP.fLineWidth",PHOSRP_fLineWidth);
+}
+
+void RecAna::Notify()
+{
+ // called by LoadTree when loading a new file
+ // get branch pointers
+ b_PHOSEmcRP = fTree->GetBranch("PHOSEmcRP");
+ b_PHOSPpsdRP = fTree->GetBranch("PHOSPpsdRP");
+ b_PHOSTS_ = fTree->GetBranch("PHOSTS_");
+ b_PHOSTS_fEmcRecPoint = fTree->GetBranch("PHOSTS.fEmcRecPoint");
+ b_PHOSTS_fPpsdLowRecPoint = fTree->GetBranch("PHOSTS.fPpsdLowRecPoint");
+ b_PHOSTS_fPpsdUpRecPoint = fTree->GetBranch("PHOSTS.fPpsdUpRecPoint");
+ b_PHOSTS_fUniqueID = fTree->GetBranch("PHOSTS.fUniqueID");
+ b_PHOSTS_fBits = fTree->GetBranch("PHOSTS.fBits");
+ b_PHOSRP_ = fTree->GetBranch("PHOSRP_");
+ b_PHOSRP_fPHOSTrackSegment = fTree->GetBranch("PHOSRP.fPHOSTrackSegment");
+ b_PHOSRP_fIndexInList = fTree->GetBranch("PHOSRP.fIndexInList");
+ b_PHOSRP_fPrimary = fTree->GetBranch("PHOSRP.fPrimary");
+ b_PHOSRP_fType = fTree->GetBranch("PHOSRP.fType");
+ b_PHOSRP_fPdgCode = fTree->GetBranch("PHOSRP.fPdgCode");
+ b_PHOSRP_fStatusCode = fTree->GetBranch("PHOSRP.fStatusCode");
+ b_PHOSRP_fMother = fTree->GetBranch("PHOSRP.fMother[2]");
+ b_PHOSRP_fDaughter = fTree->GetBranch("PHOSRP.fDaughter[2]");
+ b_PHOSRP_fWeight = fTree->GetBranch("PHOSRP.fWeight");
+ b_PHOSRP_fCalcMass = fTree->GetBranch("PHOSRP.fCalcMass");
+ b_PHOSRP_fPx = fTree->GetBranch("PHOSRP.fPx");
+ b_PHOSRP_fPy = fTree->GetBranch("PHOSRP.fPy");
+ b_PHOSRP_fPz = fTree->GetBranch("PHOSRP.fPz");
+ b_PHOSRP_fE = fTree->GetBranch("PHOSRP.fE");
+ b_PHOSRP_fVx = fTree->GetBranch("PHOSRP.fVx");
+ b_PHOSRP_fVy = fTree->GetBranch("PHOSRP.fVy");
+ b_PHOSRP_fVz = fTree->GetBranch("PHOSRP.fVz");
+ b_PHOSRP_fVt = fTree->GetBranch("PHOSRP.fVt");
+ b_PHOSRP_fPolarTheta = fTree->GetBranch("PHOSRP.fPolarTheta");
+ b_PHOSRP_fPolarPhi = fTree->GetBranch("PHOSRP.fPolarPhi");
+ b_PHOSRP_fUniqueID = fTree->GetBranch("PHOSRP.fUniqueID");
+ b_PHOSRP_fBits = fTree->GetBranch("PHOSRP.fBits");
+ b_PHOSRP_fLineColor = fTree->GetBranch("PHOSRP.fLineColor");
+ b_PHOSRP_fLineStyle = fTree->GetBranch("PHOSRP.fLineStyle");
+ b_PHOSRP_fLineWidth = fTree->GetBranch("PHOSRP.fLineWidth");
+}
+
+void RecAna::Show(Int_t entry)
+{
+ // Print contents of entry.
+ // If entry is not specified, print current entry
+ if (!fTree) return;
+ fTree->Show(entry);
+}
+#endif // #ifdef RecAna_cxx
+