X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSv2.cxx;h=14141056bf3070532a318aedd0c1eeab08176079;hb=2cdb280f9913a1d4a34618d5cfcad2e28e6d069d;hp=91af00ff3731247a2dc52ea634ded671afb2cdf2;hpb=e04976bdcfe09230508c37ed2b82d3ef71a33df0;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSv2.cxx b/PHOS/AliPHOSv2.cxx index 91af00ff373..14141056bf3 100644 --- a/PHOS/AliPHOSv2.cxx +++ b/PHOS/AliPHOSv2.cxx @@ -12,36 +12,37 @@ * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ - /* $Id$ */ + +/* History of cvs commits: + * + * $Log$ + * Revision 1.24 2005/05/28 14:19:05 schutz + * Compilation warnings fixed by T.P. + * + */ + //_________________________________________________________________________ // Version of AliPHOSv1 which keeps all hits in TreeH // AddHit, StepManager,and FinishEvent are redefined // //*-- Author: Gines MARTINEZ (SUBATECH) - +//*-- Modified Nov. 22 2000 by Dmitri Peressounko +// All hits are stored. +// Note, that primaries will not be assigned to digits: +// because of tiny energy deposition at each step. +// // --- ROOT system --- - -#include "TBRIK.h" -#include "TNode.h" -#include "TRandom.h" +#include "TClonesArray.h" // --- Standard library --- -#include -#include -#include -#include // --- AliRoot header files --- #include "AliPHOSv2.h" #include "AliPHOSHit.h" -#include "AliPHOSDigit.h" -#include "AliPHOSReconstructioner.h" -#include "AliRun.h" -#include "AliConst.h" ClassImp(AliPHOSv2) @@ -49,8 +50,7 @@ ClassImp(AliPHOSv2) AliPHOSv2::AliPHOSv2() { // default ctor - fNTmpHits = 0 ; - fTmpHits = 0 ; + } //____________________________________________________________________________ @@ -58,79 +58,24 @@ AliPHOSv2::AliPHOSv2(const char *name, const char *title): AliPHOSv1(name,title) { // ctor - - fHits= new TClonesArray("AliPHOSHit",1000) ; } - -//____________________________________________________________________________ +//__________________________________________________________________________ AliPHOSv2::~AliPHOSv2() { // dtor - if ( fTmpHits) { - fTmpHits->Delete() ; - delete fTmpHits ; - fTmpHits = 0 ; - } - - if ( fEmcRecPoints ) { - fEmcRecPoints->Delete() ; - delete fEmcRecPoints ; - fEmcRecPoints = 0 ; - } - - if ( fPpsdRecPoints ) { - fPpsdRecPoints->Delete() ; - delete fPpsdRecPoints ; - fPpsdRecPoints = 0 ; - } - - if ( fTrackSegments ) { - fTrackSegments->Delete() ; - delete fTrackSegments ; - fTrackSegments = 0 ; - } } //____________________________________________________________________________ -void AliPHOSv2::AddHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t Id, Float_t * hits) +void AliPHOSv2::AddHit(Int_t shunt, Int_t primary, Int_t Id, Float_t * hits) { // Add a hit to the hit list. - // A PHOS hit is the sum of all hits in a single crystal - // or in a single PPSD gas cell - Int_t hitCounter ; - TClonesArray <mphits = *fTmpHits ; AliPHOSHit *newHit ; - AliPHOSHit *curHit ; - Bool_t deja = kFALSE ; - - // In any case, fills the fTmpHit TClonesArray (with "accumulated hits") - - newHit = new AliPHOSHit(shunt, primary, tracknumber, Id, hits) ; - - // We do want to save in TreeH the raw hits - TClonesArray &lhits = *fHits; - - for ( hitCounter = 0 ; hitCounter < fNTmpHits && !deja ; hitCounter++ ) { - curHit = (AliPHOSHit*) ltmphits[hitCounter] ; - if( *curHit == *newHit ) { - *curHit = *curHit + *newHit ; - deja = kTRUE ; - } - } - - if ( !deja ) { - new(ltmphits[fNTmpHits]) AliPHOSHit(*newHit) ; - fNTmpHits++ ; - } - - // We do 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). + newHit = new AliPHOSHit(shunt, primary, Id, hits) ; + + new((*fHits)[fNhits]) AliPHOSHit(*newHit) ; + fNhits++ ; delete newHit;