From 2a33668de6934fa65025ece46746a0fafd5ed6f7 Mon Sep 17 00:00:00 2001 From: fca Date: Fri, 17 Dec 1999 09:01:14 +0000 Subject: [PATCH] Y.Schutz new classes for reconstruction --- STEER/AliDigitNew.cxx | 35 +++++++++ STEER/AliDigitNew.h | 32 ++++++++ STEER/AliGeometry.cxx | 47 ++++++++++++ STEER/AliGeometry.h | 49 +++++++++++++ STEER/AliRecPoint.cxx | 166 ++++++++++++++++++++++++++++++++++++++++++ STEER/AliRecPoint.h | 79 ++++++++++++++++++++ STEER/Makefile | 10 +-- STEER/STEERLinkDef.h | 3 + 8 files changed, 416 insertions(+), 5 deletions(-) create mode 100644 STEER/AliDigitNew.cxx create mode 100644 STEER/AliDigitNew.h create mode 100644 STEER/AliGeometry.cxx create mode 100644 STEER/AliGeometry.h create mode 100644 STEER/AliRecPoint.cxx create mode 100644 STEER/AliRecPoint.h diff --git a/STEER/AliDigitNew.cxx b/STEER/AliDigitNew.cxx new file mode 100644 index 00000000000..387497f6f27 --- /dev/null +++ b/STEER/AliDigitNew.cxx @@ -0,0 +1,35 @@ +/************************************************************************** + * 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. * + **************************************************************************/ + +/* +$Log$ +*/ + +#include "AliDigitNew.h" + +ClassImp(AliDigitNew) + +AliDigitNew::AliDigitNew() +{ +} + +AliDigitNew::AliDigitNew(Int_t *tracks) +{ + fTracks[0] = tracks[0]; + fTracks[1] = tracks[1]; + fTracks[2] = tracks[2]; +} + + diff --git a/STEER/AliDigitNew.h b/STEER/AliDigitNew.h new file mode 100644 index 00000000000..e2cf9102faa --- /dev/null +++ b/STEER/AliDigitNew.h @@ -0,0 +1,32 @@ +#ifndef ALIDIGITNEW_H +#define ALIDIGITNEW_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +//////////////////////////////////////////////// +// Base class for Alice Digits // +//////////////////////////////////////////////// + +#include "TObject.h" + +class AliDigitNew : public TObject { + public: + Int_t fTracks[3]; //tracks number making this digit (up to 3) + + public: + AliDigitNew() ; + AliDigitNew(Int_t *track); + ~AliDigitNew() {;} + inline virtual int *GetTracks() {return &fTracks[0];} + inline virtual Int_t GetAmp() = 0 ; + + private: + + + public: + ClassDef(AliDigitNew,1) //Base class for all Alice digits + +} ; +#endif // ALIDIGITNEW_H diff --git a/STEER/AliGeometry.cxx b/STEER/AliGeometry.cxx new file mode 100644 index 00000000000..0aa25bd7a7e --- /dev/null +++ b/STEER/AliGeometry.cxx @@ -0,0 +1,47 @@ +/************************************************************************** + * 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. * + **************************************************************************/ + +/* +$Log$ +*/ + +//-*-C++-*- +//_________________________________________________________________________ +// AliGeometry base class is pABC +//*-- Author : Yves Schutz SUBATECH +////////////////////////////////////////////////////////////////////////////// + +// --- ROOT system --- + +// --- Standard library --- + +// --- AliRoot header files --- + +#include "AliGeometry.h" + +ClassImp(AliGeometry) + +//____________________________________________________________________________ +AliGeometry::AliGeometry() +{ + // ctor +} + +//____________________________________________________________________________ +AliGeometry::~AliGeometry() +{ + // dtor +} + diff --git a/STEER/AliGeometry.h b/STEER/AliGeometry.h new file mode 100644 index 00000000000..8ffcc3b1f31 --- /dev/null +++ b/STEER/AliGeometry.h @@ -0,0 +1,49 @@ +#ifndef ALIGEOMETRY_H +#define ALIGEOMETRY_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +//////////////////////////////////////////////// +// AliGeometry Base Class pABC // +// // +// Author Yves Schutz SUBATECH // +// // +// // +//////////////////////////////////////////////// + +// --- ROOT system --- + +#include "TNamed.h" +#include "TVector3.h" + +// --- Standard library --- + +// --- AliRoot header files --- + +#include "AliRecPoint.h" + +class AliRecPoint; + +class AliGeometry : public TNamed { + +public: + + AliGeometry() ; // ctor + virtual ~AliGeometry() ; // dtor + + virtual void GetGlobal(const AliRecPoint * p, TVector3 & pos, TMatrix & mat) = 0 ; + virtual void GetGlobal(const AliRecPoint * p, TVector3 & pos) = 0 ; + +protected: + + AliGeometry(const Text_t* name, const Text_t* title) : TNamed (name,title) {} + +public: + + ClassDef(AliGeometry,1) // description , version 1 + +}; + +#endif // ALIGEOMETRY_H diff --git a/STEER/AliRecPoint.cxx b/STEER/AliRecPoint.cxx new file mode 100644 index 00000000000..6197a0ad0d0 --- /dev/null +++ b/STEER/AliRecPoint.cxx @@ -0,0 +1,166 @@ +/************************************************************************** + * 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. * + **************************************************************************/ + +/* +$Log$ +*/ + +//-*-C++-*- +//_________________________________________________________________________ +// Base Class of Cluster (empty cxx needed by Root) +//*-- Author : Yves Schutz SUBATECH +////////////////////////////////////////////////////////////////////////////// + +// --- ROOT system --- + +#include "TObjArray.h" + +// --- Standard library --- + +// --- AliRoot header files --- + +#include "AliRecPoint.h" + +ClassImp(AliRecPoint) + + +//____________________________________________________________________________ +AliRecPoint::AliRecPoint() +{ + // ctor + fAmp = 0.0 ; + + fLocPos.SetXYZ(0., 0., 0.) ; + fLocPosM = new TMatrix(3,3) ; + fMaxDigit = 100 ; + fMulDigit = 0 ; + fDigitsList = new int[fMaxDigit]; ; + fMaxTrack = 5 ; + fMulTrack = 0 ; + fTracksList = new int[fMaxTrack]; ; +} + +//____________________________________________________________________________ +AliRecPoint::~AliRecPoint() +{ + // dtor + + delete fLocPosM ; + if ( fDigitsList ) delete fDigitsList ; + if ( fTracksList ) delete fTracksList ; + +} + +//____________________________________________________________________________ +void AliRecPoint::AddDigit(AliDigitNew & digit) +{ + // adds a digit to the digits list + // and accumulates the total amplitude and the multiplicity + + + if ( fMulDigit >= fMaxDigit ) { // increase the size of the list + int * tempo = new ( int[fMaxDigit*=2] ) ; + + Int_t index ; + + for ( index = 0 ; index < fMulDigit ; index++ ) + tempo[index] = fDigitsList[index] ; + + delete fDigitsList ; + fDigitsList = tempo ; + } + + fDigitsList[fMulDigit++]= (int) &digit ; + fAmp += digit.GetAmp() ; +} + +//____________________________________________________________________________ +// void AliRecPoint::AddTrack(AliTrack & track) +// { +// // adds a digit to the digits list +// // and accumulates the total amplitude and the multiplicity + + +// if ( fMulTrack >= fMaxTrack ) { // increase the size of the list +// int * tempo = new int[fMaxTrack*=2] ; +// Int_t index ; +// for ( index = 0 ; index < fMulTrack ; index++ ) +// tempo[index] = fTracksList[index] ; +// delete fTracksList ; +// fTracksList = tempo ; +// } + +// fTracksList[fMulTrack++]= (int) &Track ; +// } + +//____________________________________________________________________________ +void AliRecPoint::GetCovarianceMatrix(TMatrix & mat) +{ + // returns the covariant matrix for the local position + + mat = *fLocPosM ; + +} + +//____________________________________________________________________________ +void AliRecPoint::GetLocalPosition(TVector3 & pos) +{ + // returns the position of the cluster in the local reference system of the sub-detector + + pos = fLocPos; + + +} + +//____________________________________________________________________________ +void AliRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat) +{ + // returns the position of the cluster in the global reference system of ALICE + // and the uncertainty on this position + + + fGeom->GetGlobal(this, gpos, gmat) ; + +} + +//______________________________________________________________________________ +void AliRecPoint::Streamer(TBuffer &R__b) +{ + // Stream an object of class AliRecPoint. + + if (R__b.IsReading()) { + Version_t R__v = R__b.ReadVersion(); if (R__v) { } + TObject::Streamer(R__b); + R__b >> fAmp; + R__b.ReadArray(fDigitsList); + R__b >> fGeom; + fLocPos.Streamer(R__b); + R__b >> fLocPosM; + R__b >> fMulDigit; + R__b >> fMulTrack; + R__b.ReadArray(fTracksList); + } else { + R__b.WriteVersion(AliRecPoint::IsA()); + TObject::Streamer(R__b); + R__b << fAmp; + R__b.WriteArray(fDigitsList, fMaxDigit); + R__b << fGeom; + fLocPos.Streamer(R__b); + R__b << fLocPosM; + R__b << fMulDigit; + R__b << fMulTrack; + R__b.WriteArray(fTracksList, fMaxTrack); + } +} diff --git a/STEER/AliRecPoint.h b/STEER/AliRecPoint.h new file mode 100644 index 00000000000..378b2bf219c --- /dev/null +++ b/STEER/AliRecPoint.h @@ -0,0 +1,79 @@ +#ifndef ALIRECPOINT_H +#define ALIRECPOINT_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +//////////////////////////////////////////////// +// Base class for Reconstructed Point // +// Version 0.1 // +// Author Yves Schutz SUBATECH // +// // +// // +//////////////////////////////////////////////// + +// --- ROOT system --- + +#include "TObject.h" +#include "TVector3.h" +#include "TMatrix.h" + +// --- Standard library --- + +#include "assert.h" +#include "iostream.h" + +// --- AliRoot header files --- + +#include "AliDigitNew.h" +#include "AliGeometry.h" +//#include "AliTrack.h" + + +class AliGeometry; + +class AliRecPoint : public TObject { + +public: + + AliRecPoint() ; // ctor + virtual ~AliRecPoint() ; // dtor + + virtual void AddDigit(AliDigitNew & digit) ; // add a digit to the digits list + // virtual void AddTrack(AliTrack & track) ; // add a track to the tracks list + virtual void GetCovarianceMatrix(TMatrix & mat) ; + virtual AliGeometry * GetGeom() const { return fGeom; } + virtual void GetGlobalPosition(TVector3 & gpos, TMatrix & gmat) ; // return the global position in ALICE + virtual int * GetDigitsList(void) const { return fDigitsList ; } + // virtual int * GetTracksList(void) const { return fTracksList ; } + virtual Float_t GetEnergy() {return fAmp; } + virtual void GetLocalPosition(TVector3 & pos) ; + virtual Int_t GetDigitsMultiplicity(void) const { return fMulDigit ; } + virtual Int_t GetMaximumDigitMultiplicity() const { return fMaxDigit; } + virtual Int_t GetMaximumTrackMultiplicity() const { return fMaxTrack; } + virtual Int_t GetTracksMultiplicity(void) const { return fMulTrack ; } + virtual void Print(Option_t * opt = "void") = 0 ; + + +protected: + + Float_t fAmp ; // summed amplitude of digits + int * fDigitsList ; // list of digits from which the point was reconstructed + AliGeometry * fGeom ; // pointer to the geometry class + TVector3 fLocPos ; // local position in the sub-detector coordinate + TMatrix * fLocPosM ; // covariance matrix ; + Int_t fMaxDigit ; //! max initial size of digits array (not saved) + Int_t fMulDigit ; // total multiplicity of digits + Int_t fMaxTrack ; //! max initial size of tracks array (not saved) + Int_t fMulTrack ; // total multiplicity of tracks + int * fTracksList ; // list of tracks to which the point was assigned + +public: + + + ClassDef(AliRecPoint,1) + +}; + +#endif // ALIRECPOINT_H diff --git a/STEER/Makefile b/STEER/Makefile index 70f8025ef80..95818752065 100644 --- a/STEER/Makefile +++ b/STEER/Makefile @@ -9,11 +9,11 @@ PACKAGE = STEER # C++ sources -SRCS = AliDetector.cxx AliHeader.cxx AliMagF.cxx \ - AliDigit.cxx AliHit.cxx AliPoints.cxx \ - AliDisplay.cxx AliMC.cxx AliRun.cxx AliGenerator.cxx \ - AliLego.cxx AliModule.cxx - +SRCS = AliDetector.cxx AliHeader.cxx AliMagF.cxx \ + AliDigit.cxx AliHit.cxx AliPoints.cxx \ + AliDisplay.cxx AliMC.cxx AliRun.cxx AliGenerator.cxx \ + AliLego.cxx AliModule.cxx AliDigitNew.cxx \ + AliGeometry.cxx AliRecPoint.cxx # C++ Headers diff --git a/STEER/STEERLinkDef.h b/STEER/STEERLinkDef.h index 75bd4d64f81..2270407fd21 100644 --- a/STEER/STEERLinkDef.h +++ b/STEER/STEERLinkDef.h @@ -28,5 +28,8 @@ #pragma link C++ class AliMagFCM; #pragma link C++ class AliMC; #pragma link C++ class AliLego; +#pragma link C++ class AliDigitNew; +#pragma link C++ class AliGeometry; +#pragma link C++ class AliRecPoint-; #endif -- 2.39.3