1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 //_________________________________________________________________________
18 // Version of AliPHOSv1 which keeps all hits in TreeH
19 // AddHit, StepManager,and FinishEvent are redefined
21 //*-- Author: Gines MARTINEZ (SUBATECH)
24 // --- ROOT system ---
30 // --- Standard library ---
35 #include <strstream.h>
37 // --- AliRoot header files ---
39 #include "AliPHOSv2.h"
40 #include "AliPHOSHit.h"
41 #include "AliPHOSDigit.h"
42 #include "AliPHOSReconstructioner.h"
48 //____________________________________________________________________________
49 AliPHOSv2::AliPHOSv2()
56 //____________________________________________________________________________
57 AliPHOSv2::AliPHOSv2(const char *name, const char *title):
62 fHits= new TClonesArray("AliPHOSHit",1000) ;
65 //____________________________________________________________________________
66 AliPHOSv2::~AliPHOSv2()
75 if ( fEmcRecPoints ) {
76 fEmcRecPoints->Delete() ;
77 delete fEmcRecPoints ;
81 if ( fPpsdRecPoints ) {
82 fPpsdRecPoints->Delete() ;
83 delete fPpsdRecPoints ;
87 if ( fTrackSegments ) {
88 fTrackSegments->Delete() ;
89 delete fTrackSegments ;
94 //____________________________________________________________________________
95 void AliPHOSv2::AddHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t Id, Float_t * hits)
97 // Add a hit to the hit list.
98 // A PHOS hit is the sum of all hits in a single crystal
99 // or in a single PPSD gas cell
102 TClonesArray <mphits = *fTmpHits ;
105 Bool_t deja = kFALSE ;
107 // In any case, fills the fTmpHit TClonesArray (with "accumulated hits")
109 newHit = new AliPHOSHit(shunt, primary, tracknumber, Id, hits) ;
111 // We do want to save in TreeH the raw hits
112 TClonesArray &lhits = *fHits;
114 for ( hitCounter = 0 ; hitCounter < fNTmpHits && !deja ; hitCounter++ ) {
115 curHit = (AliPHOSHit*) ltmphits[hitCounter] ;
116 if( *curHit == *newHit ) {
117 *curHit = *curHit + *newHit ;
123 new(ltmphits[fNTmpHits]) AliPHOSHit(*newHit) ;
127 // We do want to save in TreeH the raw hits
128 new(lhits[fNhits]) AliPHOSHit(*newHit) ;
131 // Please note that the fTmpHits array must survive up to the
132 // end of the events, so it does not appear e.g. in ResetHits() (
133 // which is called at the end of each primary).