// @(#) $Id: AliHLTTPCCAParam.cxx,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. * // * // Primary Authors: Sergey Gorbunov * // Ivan Kisel * // for The ALICE HLT Project. * // * // Developed by: Igor Kulakov * // Maksym Zyzak * // * // 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. * // * //*************************************************************************** #include "AliHLTTPCCAParam.h" #include "AliHLTTPCCAMath.h" #include #include "debug.h" AliHLTTPCCAParam::AliHLTTPCCAParam():fStations(0) { } // std::ostream &operator<<( std::ostream &out, const AliHLTTPCCAParam &p ) // { // // write settings to the file // int iSl = 0; // float tmp=0; // out << iSl << std::endl; // out << p.fNRows << std::endl; // out << tmp << std::endl; // out << tmp << std::endl; // out << tmp << std::endl; // out << tmp << std::endl; // out << tmp << std::endl; // out << tmp << std::endl; // out << tmp << std::endl; // out << tmp << std::endl; // out << tmp << std::endl; // out << tmp << std::endl; // out << tmp << std::endl; // out << tmp << std::endl; // out << tmp << std::endl; // out << tmp << std::endl; // out << p.fBz << std::endl; // return out; // } istream& eatwhite(istream& is) // skip spaces { char c; while (is.get(c)) { if (isspace(c)==0) { is.putback(c); break; } } return is; } std::istream &operator>>( std::istream &in, AliHLTTPCCAParam &p ) { // TODO // Read settings from the file float geo[10000]; for (int i = 0; !in.eof(); i++){ in >> geo[i] >> eatwhite; }; int ind=0; { L1FieldValue B[3]; sfloat_v z[3]; for( int i=0; i<3; i++){ z[i] = geo[ind++]; B[i].x = geo[ind++]; B[i].y = geo[ind++]; B[i].z = geo[ind++]; } p.fVtxFieldRegion.Set(B[0], z[0], B[1], z[1], B[2], z[2] ); p.fVtxFieldValue = B[0]; } p.fNStations = static_cast(geo[ind++]); p.fNMvdStations = static_cast(geo[ind++]); if ( p.fStations ) delete[] p.fStations; p.fStations = new L1Station[p.fNStations]; for( int i=0; i( geo[ind++] ); for( int iC=0; iC( geo[ind++] ); // fMomentumCutOff = geo[ind++]; // fGhostSuppression = static_cast( geo[ind++] ); ind += 3; // don't use the parameters { sfloat_v z0 = p.fStations[p.fNStations-1].z; sfloat_v sy = 0., Sy = 0.; for( int i=p.fNStations-1; i>=0; i-- ){ L1Station &st = p.fStations[i]; sfloat_v dz = st.z-z0; sfloat_v By = p.fStations[i].fieldSlice.cy[0]; Sy += dz*sy + dz*dz*By/2.; sy += dz*By; st.Sy = Sy; z0 = st.z; } } return in; } #include "BinaryStoreHelper.h" void AliHLTTPCCAParam::StoreToFile( FILE *f ) const { BinaryStoreWrite( *this, f ); } void AliHLTTPCCAParam::RestoreFromFile( FILE *f ) { BinaryStoreRead( *this, f ); }