#include "TNode.h"
#include "TRandom.h"
+
// --- Standard library ---
#include <stdio.h>
// 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() ).
+ // and the TreeD at the end of the event (branch is set in FinishEvent() ).
- fTmpHits= new TClonesArray("AliPHOSHit",100) ;
+ fTmpHits= new TClonesArray("AliPHOSHit",1000) ;
fNTmpHits = fNhits = 0 ;
- fDigits = new TClonesArray("AliPHOSDigit",100) ;
+ fDigits = new TClonesArray("AliPHOSDigit",1000) ;
fIshunt = 1 ; // All hits are associated with primary particles
// 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) ;
+ fDigits = new TClonesArray("AliPHOSDigit",1000) ;
+ fTmpHits= new TClonesArray("AliPHOSHit",1000) ;
fNTmpHits = fNhits = 0 ;
{
// dtor
- fTmpHits->Delete() ;
- delete fTmpHits ;
- fTmpHits = 0 ;
+ if ( fTmpHits) {
+ fTmpHits->Delete() ;
+ delete fTmpHits ;
+ fTmpHits = 0 ;
+ }
- fEmcRecPoints->Delete() ;
- delete fEmcRecPoints ;
- fEmcRecPoints = 0 ;
+ if ( fEmcRecPoints ) {
+ fEmcRecPoints->Delete() ;
+ delete fEmcRecPoints ;
+ fEmcRecPoints = 0 ;
+ }
- fPpsdRecPoints->Delete() ;
- delete fPpsdRecPoints ;
- fPpsdRecPoints = 0 ;
+ if ( fPpsdRecPoints ) {
+ fPpsdRecPoints->Delete() ;
+ delete fPpsdRecPoints ;
+ fPpsdRecPoints = 0 ;
+ }
+
+ if ( fTrackSegments ) {
+ fTrackSegments->Delete() ;
+ delete fTrackSegments ;
+ fTrackSegments = 0 ;
+ }
- fTrackSegments->Delete() ;
- delete fTrackSegments ;
- fTrackSegments = 0 ;
}
//____________________________________________________________________________
}
} // PHOS modules
- delete rotname ;
- delete nodename ;
+ delete[] rotname ;
+ delete[] nodename ;
}
// 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];
newdigit = (AliPHOSDigit *) fDigits->At(i) ;
newdigit->SetIndexInList(i) ;
}
-
+
}
//____________________________________________________________________________
char branchname[10];
sprintf(branchname,"%s",GetName());
char *cdD = strstr(opt,"D");
-
if (fDigits && gAlice->TreeD() && cdD) {
gAlice->TreeD()->Branch(branchname, &fDigits, fBufferSize);
}
+
+ // Create new branche PHOSCH in the current Root Tree in the digit Tree for accumulated Hits
+ if ( ! (gAlice->IsLegoRun()) ) { // only when not in lego plot mode
+ if ( fTmpHits && gAlice->TreeD() && cdD) {
+ char branchname[10] ;
+ sprintf(branchname, "%sCH", GetName()) ;
+ gAlice->TreeD()->Branch(branchname, &fTmpHits, fBufferSize) ;
+ }
+ }
+
}
//____________________________________________________________________________
-RecPointsList * AliPHOSv0::PpsdRecPoints(Int_t evt)
+AliPHOSRecPoint::RecPointsList * AliPHOSv0::PpsdRecPoints(Int_t evt)
{
// returns the pointer to the PPSD RecPoints list
// if the list is empty, get it from TreeR on the disk file
- RecPointsList * rv = 0 ;
+ AliPHOSRecPoint::RecPointsList * rv = 0 ;
if ( fPpsdRecPoints )
rv = fPpsdRecPoints ;
void AliPHOSv0::Reconstruction(AliPHOSReconstructioner * Reconstructioner)
{
// 1. Reinitializes the existing RecPoint, TrackSegment, and RecParticles Lists and
- // 2. Creates TreeR wit a branch for each list
+ // 2. Creates TreeR with 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") ;
+ // gAlice->MakeTree("R") ;
Int_t splitlevel = 0 ;
if (fEmcRecPoints) {
fEmcRecPoints = 0 ;
}
- // fEmcRecPoints= new RecPointsList("AliPHOSEmcRecPoint", 100) ; if TClonesArray
- fEmcRecPoints= new RecPointsList(100) ;
+ // fEmcRecPoints= new AliPHOSRecPoint::RecPointsList("AliPHOSEmcRecPoint", 1000) ; if TClonesArray
+ fEmcRecPoints= new AliPHOSRecPoint::RecPointsList(100) ;
if ( fEmcRecPoints && gAlice->TreeR() ) {
sprintf(branchname,"%sEmcRP",GetName()) ;
fPpsdRecPoints = 0 ;
}
- // fPpsdRecPoints = new RecPointsList("AliPHOSPpsdRecPoint", 100) ; if TClonesArray
- fPpsdRecPoints = new RecPointsList(100) ;
+ // fPpsdRecPoints = new AliPHOSRecPoint::RecPointsList("AliPHOSPpsdRecPoint", 1000) ; if TClonesArray
+ fPpsdRecPoints = new AliPHOSRecPoint::RecPointsList(100) ;
if ( fPpsdRecPoints && gAlice->TreeR() ) {
sprintf(branchname,"%sPpsdRP",GetName()) ;
fTrackSegments = 0 ;
}
- fTrackSegments = new TrackSegmentsList("AliPHOSTrackSegment", 100) ;
+ fTrackSegments = new AliPHOSTrackSegment::TrackSegmentsList("AliPHOSTrackSegment", 1000) ;
if ( fTrackSegments && gAlice->TreeR() ) {
sprintf(branchname,"%sTS",GetName()) ;
gAlice->TreeR()->Branch(branchname, &fTrackSegments, fBufferSize) ;
delete fRecParticles ;
fRecParticles = 0 ;
}
- fRecParticles = new RecParticlesList("AliPHOSRecParticle", 100) ;
+ fRecParticles = new AliPHOSRecParticle::RecParticlesList("AliPHOSRecParticle", 1000) ;
if ( fRecParticles && gAlice->TreeR() ) {
sprintf(branchname,"%sRP",GetName()) ;
gAlice->TreeR()->Branch(branchname, &fRecParticles, fBufferSize) ;
fRecParticles->Expand(size) ;
gAlice->TreeR()->Fill() ;
-
+ cout << "filled" << endl ;
// 5.
gAlice->TreeR()->Write() ;
-
+ cout << "writen" << endl ;
+
+ // Deleting reconstructed objects
+ ResetReconstruction();
+
+
}
//____________________________________________________________________________
-void AliPHOSv0::ResetDigits()
-{
+void AliPHOSv0::ResetDigits()
+{
// May sound strange, but cumulative hits are store in digits Tree
-
+ AliDetector::ResetDigits();
if( fTmpHits ) {
fTmpHits->Delete();
fNTmpHits = 0 ;
}
-}
+}
+//____________________________________________________________________________
+void AliPHOSv0::ResetReconstruction()
+{
+ // Deleting reconstructed objects
+
+ if ( fEmcRecPoints ) fEmcRecPoints->Delete();
+ if ( fPpsdRecPoints ) fPpsdRecPoints->Delete();
+ if ( fTrackSegments ) fTrackSegments->Delete();
+ if ( fRecParticles ) fRecParticles->Delete();
+}
//____________________________________________________________________________
void AliPHOSv0::StepManager(void)
{