+
/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
//////////////////////////////////////////////////////////////////////////////
// --- ROOT system ---
+class TFile;
+#include "TTree.h"
// --- Standard library ---
#include "AliPHOS.h"
#include "AliMC.h"
#include "AliRun.h"
+#include "AliMagF.h"
ClassImp(AliPHOS)
+//____________________________________________________________________________
+AliPHOS::AliPHOS():AliDetector()
+{
+ // ctor
+ //We do not create objects, because these pointers will be overwritten durin reading from file.
+ fDigits = 0 ;
+ fEmcRecPoints = 0 ;
+ fPpsdRecPoints = 0 ;
+ fTrackSegments = 0 ;
+ fRecParticles = 0 ;
+
+}
+//____________________________________________________________________________
+AliPHOS::AliPHOS(const char* name, const char* title): AliDetector(name,title)
+{
+ // ctor
+
+ fDigits = 0 ;
+ fEmcRecPoints = 0 ;
+ fPpsdRecPoints = 0 ;
+ fTrackSegments = 0 ;
+ fRecParticles = 0 ;
+
+}
//____________________________________________________________________________
AliPHOS::~AliPHOS()
{
+ // dtor
+ if(fEmcRecPoints)
+ fEmcRecPoints->Delete() ;
+ delete fEmcRecPoints ;
+ if(fPpsdRecPoints)
+ fPpsdRecPoints->Delete() ;
+ delete fPpsdRecPoints ;
+ if(fTrackSegments)
+ fTrackSegments->Delete() ;
+ delete fTrackSegments ;
+ if(fRecParticles)
+ fRecParticles->Delete() ;
+ delete fRecParticles ;
delete fHits ;
delete fDigits ;
}
AliMixture(16, "ArCO2$", aGM, zGM, dGM, 2, wGM) ;
+ // --- Stainless steel (let it be pure iron) ---
+ AliMaterial(17, "Steel$", 55.845, 26, 7.87, 1.76, 0., 0, 0) ;
// --- Air ---
AliMaterial(99, "Air$", 14.61, 7.3, 0.001205, 30420., 67500., 0, 0) ;
AliMedium(16, "ArCo2 $", 16, 1,
isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.01, 0, 0) ;
+ // Stainless steel -> idtmed[716]
+ AliMedium(17, "Steel $", 17, 0,
+ isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.0001, 0, 0) ;
+
// Air -> idtmed[798]
AliMedium(99, "Air $", 99, 0,
isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
gMC->Gstpar(idtmed[715], "STRA",2.) ;
}
-
//____________________________________________________________________________
-RecPointsList * AliPHOS::EmcRecPoints(Int_t evt)
-{
- // returns the pointer to the EMCA RecPoints list
- // if the list is empty, get it from TreeR on the disk file
-
- RecPointsList * rv = 0 ;
+void AliPHOS::SetTreeAddress()
+{
+ // TBranch *branch;
+ AliDetector::SetTreeAddress();
+
+ TBranch * branch ;
+
+ if(fDigits)
+ fDigits->Clear();
+ else
+ fDigits = new TClonesArray("AliPHOSDigit",1) ;
+
+ if (gAlice->TreeD() && fDigits ) {
+ branch = gAlice->TreeD()->GetBranch("PHOS");
+ if (branch) branch->SetAddress(&fDigits) ;
+ }
+
+ TTree *treeR = gAlice->TreeR();
+
+ //Branch address for TreeR: EmcRecPoint
- if ( fEmcRecPoints )
- rv = fEmcRecPoints ;
-
- else {
- fEmcRecPoints = new TClonesArray("AliPHOSEmcRecPoint", 100) ;
- gAlice->GetEvent(evt) ;
- TTree * fReconstruct = gAlice->TreeR() ;
- fReconstruct->SetBranchAddress( "PHOSEmcRP", &fEmcRecPoints) ;
- fReconstruct->GetEvent(0) ;
- fEmcRecPoints->Expand( fEmcRecPoints->GetEntries() ) ;
- rv = fEmcRecPoints ;
+ if(fEmcRecPoints)
+ fEmcRecPoints->Delete();
+ else
+ fEmcRecPoints = new AliPHOSRecPoint::RecPointsList(1) ;
+
+ if ( treeR && fEmcRecPoints ) {
+ branch = treeR->GetBranch("PHOSEmcRP");
+ if (branch) branch->SetAddress(&fEmcRecPoints) ;
}
-
- return rv ;
-
-}
-//____________________________________________________________________________
-RecParticlesList * AliPHOS::RecParticles(Int_t evt)
-{
- // returns the pointer to the RecParticles list
- // if the list is empty, get it from TreeR on the disk file
+ //Branch address for TreeR: PPSDRecPoint
+ if(fPpsdRecPoints)
+ fPpsdRecPoints->Delete();
+ else
+ fPpsdRecPoints = new AliPHOSRecPoint::RecPointsList(1) ;
- RecParticlesList * rv = 0 ;
-
- if ( fRecParticles )
- rv = fRecParticles ;
-
- else {
- fRecParticles = new TClonesArray("AliPHOSRecParticle", 100) ;
- gAlice->GetEvent(evt) ;
- TTree * fReconstruct = gAlice->TreeR() ;
- fReconstruct->SetBranchAddress( "PHOSRP", &fRecParticles) ;
- fReconstruct->GetEvent(0) ;
- fRecParticles->Expand( fRecParticles->GetEntries() ) ;
- rv = fRecParticles ;
+ if ( treeR && fPpsdRecPoints ) {
+ branch = treeR->GetBranch("PHOSPpsdRP");
+ if (branch) branch->SetAddress(&fPpsdRecPoints) ;
}
-
- return rv ;
-
-}
-//____________________________________________________________________________
-RecParticlesList * AliPHOS::TrackSegments(Int_t evt)
-{
- // returns the pointer to the TrackSegments list
- // if the list is empty, get it from TreeR on the disk file
-
- TrackSegmentsList * rv = 0 ;
+ //Branch address for TreeR: TrackSegments
+ if(fTrackSegments)
+ fTrackSegments->Clear() ;
+ else
+ fTrackSegments = new AliPHOSTrackSegment::TrackSegmentsList("AliPHOSTrackSegment", 1) ;
- if ( fTrackSegments )
- rv = fTrackSegments ;
-
- else {
- fTrackSegments = new TClonesArray("AliPHOSTrackSegment", 100) ;
- gAlice->GetEvent(evt) ;
- TTree * fReconstruct = gAlice->TreeR() ;
- fReconstruct->SetBranchAddress( "PHOSTS", &fTrackSegments) ;
- fReconstruct->GetEvent(0) ;
- fTrackSegments->Expand( fTrackSegments->GetEntries() ) ;
- rv = fTrackSegments ;
+ if ( treeR && fTrackSegments ) {
+ branch = treeR->GetBranch("PHOSTS");
+ if (branch) branch->SetAddress(&fTrackSegments) ;
}
-
- return rv ;
+ //Branch address for TreeR: RecParticles
+ if(fRecParticles)
+ fRecParticles->Clear() ;
+ else
+ fRecParticles = new AliPHOSRecParticle::RecParticlesList("AliPHOSRecParticle", 1) ;
+
+ if ( treeR && fRecParticles ) {
+ branch = treeR->GetBranch("PHOSRP");
+ if (branch) branch->SetAddress(&fRecParticles) ;
+ }
+
}
+
+