// @(#) $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() : fNStations(0), fStations(0) { } std::istream &operator>>( std::istream &in, AliHLTTPCCAParam &p ) { // Read settings from the file in >> p.fNStations; if(p.fStations) delete [] p.fStations; p.fStations = new ITSCAStation[p.fNStations]; in >> p.fBz; for(int i=0; i> inttmp; if( inttmp != i ) { cout << "ERROR: Settings.data format is wrong! Station: " << i-1 << endl; exit(0); } in >> p.fStations[i].x0; #ifdef PANDA_FTS in >> p.fStations[i].materialInfo.RadThick; p.fStations[i].materialInfo.logRadThick = log( p.fStations[i].materialInfo.RadThick ); float xTimesRho; in >> xTimesRho; p.fStations[i].materialInfo.thick = xTimesRho/1.39; // ~54 mum mular p.fStations[i].materialInfo.RL = p.fStations[i].materialInfo.thick/p.fStations[i].materialInfo.RadThick; #else in >> p.fStations[i].xOverX0; in >> p.fStations[i].xTimesRho; #endif float beta; in >> beta; p.fStations[i].f.sin = sin(beta); p.fStations[i].f.cos = cos(beta); in >> inttmp; p.fStations[i].NDF = inttmp; in >> inttmp; p.fStations[i].CellLength = inttmp; } #ifdef STAR_HFT p.fMaxZ = 35; p.fMaxR = 25; p.fMinR = 0; p.fMinZ = -p.fMaxZ; #elif ALICE_ITS p.fMaxZ = 60; p.fMaxR = 60; p.fMinR = 0; p.fMinZ = -p.fMaxZ; #elif PANDA_STT p.fMaxZ = 75+20; p.fMaxR = 41; p.fMinR = 0; p.fMinZ = -75+20; #elif PANDA_FTS p.fMinX = -200; // more precisely 196 p.fMaxX = 200; p.fMinY = -60; p.fMaxY = 60; p.fMinZ = 290; p.fMaxZ = 660; #endif #ifdef PANDA_FTS // p.fVtxFieldValue[0].y = p.Bz(); // p.fVtxFieldValue[1].y = p.Bz(); // p.fZVtxFieldValue[0] = 0.f; // p.fZVtxFieldValue[1] = 1.f; // for(int i=0; i> tmp; p.fZVtxFieldValue[i] = tmp; in >> tmp; p.fVtxFieldValue[i].x = tmp; in >> tmp; p.fVtxFieldValue[i].y = tmp; in >> tmp; p.fVtxFieldValue[i].z = tmp; } in >> tmp >> tmp >> tmp >> tmp; // skip one point for(int iSta = 0; iSta < p.fNStations; iSta++) { #if 0 int N; in >> N; for( int i = 0; i < N; i++ ) { in >> tmp; p.fStations[i].fieldSlice.cx[i] = tmp; } for( int i = 0; i < N; i++ ) { in >> tmp; p.fStations[i].fieldSlice.cy[i] = tmp; } for( int i = 0; i < N; i++ ) { in >> tmp; p.fStations[i].fieldSlice.cz[i] = tmp; } #else // 0 L1FieldSlice &sl = p.fStations[iSta].fieldSlice; vector &vSls = p.fStations[iSta].fieldVirtualSlice; int itmp; in >> itmp; // station if ( itmp != iSta ) { cout << "Wrong field" << endl; exit(0); } ASSERT( itmp == iSta, itmp << " = " << iSta ); in >> itmp >> p.fStations[iSta].dZVirtualStation; // n virtual stations & dz vSls.resize(itmp); in >> sl.xMin >> sl.dx >> sl.nXBins; in >> sl.yMin >> sl.dy >> sl.nYBins; const int NBins = sl.nXBins*sl.nYBins; for( unsigned int iV = 0; iV < vSls.size(); iV++ ) { L1FieldSlice &vSl = vSls[iV]; vSl.xMin = sl.xMin; vSl.dx = sl.dx; vSl.nXBins = sl.nXBins; vSl.yMin = sl.yMin; vSl.dy = sl.dy; vSl.nYBins = sl.nYBins; vSl.AlocateMemory(); for( int iB = 0; iB < NBins; iB++ ) { in >> vSl.bX[iB] >> vSl.bY[iB] >> vSl.bZ[iB]; } } sl.AlocateMemory(); for( int iB = 0; iB < NBins; iB++ ) { in >> sl.bX[iB] >> sl.bY[iB] >> sl.bZ[iB]; } #endif // 0 } } #else // PANDA_FTS p.fVtxFieldValue[0] = p.cBz(); #endif return in; } #include "BinaryStoreHelper.h" void AliHLTTPCCAParam::StoreToFile( FILE *f ) const { BinaryStoreWrite( *this, f ); } void AliHLTTPCCAParam::RestoreFromFile( FILE *f ) { BinaryStoreRead( *this, f ); }