//-*- Mode: C++ -*- // @(#) $Id: AliHLTTPCCAParam.h,v 1.4 2011/10/01 00:23:44 perev Exp $ // ************************************************************************ // This file is property of and copyright by the ALICE HLT Project * // ALICE Experiment at CERN, All rights reserved. * // See cxx source for full Copyright notice * // * //************************************************************************* #ifndef ALIHLTTPCCAPARAM_H #define ALIHLTTPCCAPARAM_H #include "AliHLTTPCCADef.h" #include "AliHLTVector.h" #include "AliHLTTPCCAMath.h" #include "AliHLTTPCCATrackParam.h" #include "AliHLTTPCCAParameters.h" #include "ITSCAStation.h" #include "CAFieldValue.h" #include /** * @class ALIHLTTPCCAParam * parameters of the AliHLTTPCCATracker, including geometry information * and some reconstructon constants. * * The class is under construction. * */ class AliHLTTPCCAParam { friend std::istream &operator>>( std::istream &, AliHLTTPCCAParam & ); public: AliHLTTPCCAParam(); ~AliHLTTPCCAParam(){ if(fStations) delete [] fStations; } int NStations() const { return fNStations;} const ITSCAStation& Station( short i ) const { return fStations[i];} float Bz() const { return fBz;} float cBz() const { return fBz*0.000299792458f;} void SetBz( float v ) { fBz = v;} // void SetBoundaries( float z, float r ){ fMaxZ = z; fMaxR = r; } float GetBz() const { return fBz;} float GetBz( float x, float y, float z ) const; sfloat_v GetBz( sfloat_v x, sfloat_v y, sfloat_v z ) const; float GetBz( const AliHLTTPCCATrackParam &t ) const; sfloat_v GetBz( const AliHLTTPCCATrackParamVector &t ) const; float GetX0( short iSt ) const { return fStations[iSt].x0; }; sfloat_v GetX0( short_v iSt, const sfloat_m& mask ) const { sfloat_v r; r.gather( fStations, &ITSCAStation::x0, static_cast(iSt), mask ); return r; } #ifndef PANDA_FTS float GetXOverX0( short iSt) const { return fStations[iSt].xOverX0; }; float GetXTimesRho( short iSt) const { return fStations[iSt].xTimesRho; }; sfloat_v GetXOverX0( short_v iSt, sfloat_m mask ) const { sfloat_v r; r.gather( fStations, &ITSCAStation::xOverX0, static_cast(iSt), mask ); return r; }; sfloat_v GetXTimesRho( short_v iSt, sfloat_m mask ) const { sfloat_v r; r.gather( fStations, &ITSCAStation::xTimesRho, static_cast(iSt), mask ); return r; }; #else CAFieldValue GetFieldValue( short_v iSt, sfloat_v x1, sfloat_v x2, sfloat_m mask ) const { CAFieldValue r; foreach_bit( int iV, mask ) { CAFieldValue b; fStations[iSt[iV]].fieldSlice.GetFieldValue( x1, x2, b, mask ); r.x[iV] = b.x[iV]; r.y[iV] = b.y[iV]; r.z[iV] = b.z[iV]; } return r; } CAFieldValue GetFieldValue( short_v iSt, short_v iVSt, sfloat_v x1, sfloat_v x2, sfloat_m mask ) const { CAFieldValue r; foreach_bit( int iV, mask ) { CAFieldValue b; fStations[iSt[iV]].fieldVirtualSlice[iVSt[iV]].GetFieldValue( x1, x2, b, mask ); r.x[iV] = b.x[iV]; r.y[iV] = b.y[iV]; r.z[iV] = b.z[iV]; } return r; } short_v GetNVirtualStations( short_v iSt, sfloat_m mask ) const { short_v r; foreach_bit( int iV, mask ) { r[iV] = fStations[iSt[iV]].fieldVirtualSlice.size(); } return r; } #endif float MinZ() const { return fMinZ; } float MaxZ() const { return fMaxZ; } #ifdef PANDA_FTS float MinX() const { return fMinX; } float MaxX() const { return fMaxX; } float MinY() const { return fMinY; } float MaxY() const { return fMaxY; } #else float MinR() const { return fMinR; } float MaxR() const { return fMaxR; } #endif void StoreToFile( FILE *f ) const; void RestoreFromFile( FILE *f ); const CAFieldValue &VtxFieldValue( int i = 0 ) const { return fVtxFieldValue[i]; } const sfloat_v &ZVtxFieldValue( int i ) const { return fZVtxFieldValue[i]; } protected: int fNStations; ITSCAStation *fStations; float fBz; CAFieldValue fVtxFieldValue[2]; // field at fZVtxFieldValue position to transport from vertex to station. sfloat_v fZVtxFieldValue[2]; float fMinZ, fMaxZ; #ifdef PANDA_FTS float fMinX, fMaxX; float fMinY, fMaxY; #else float fMinR, fMaxR; #endif }; std::istream &operator>>( std::istream &, AliHLTTPCCAParam & ); std::ostream &operator<<( std::ostream &, const AliHLTTPCCAParam & ); #endif