// ***************************************************************************** // This file is property of and copyright by the CBM and the ALICE HLT Project * // All rights reserved. * // * // Primary Authors: Ivan Kisel * // Igor Kulakov * // Maksym Zyzak * // GSI, Uni Frankfurt and HICforFAIR. * // * // 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 #include #include #include #include "AliHLTTPCCAFitter.h" #include "FitPerformance.h" #include "AliHLTTPCCAParamArBB.h" #include "TStopwatch.h" using namespace std; using std::fstream; #ifndef DO_TPCCATRACKER_EFF_PERFORMANCE #define HLTCA_STANDALONE #endif //DO_TPCCATRACKER_EFF_PERFORMANCE #ifndef HLTCA_STANDALONE //#include #include "TFile.h" #endif static bool file_exists( const char *filename ) { FILE *f = 0; if ( ( f = std::fopen( filename, "r" ) ) != NULL ) { std::fclose( f ); return true; } return false; } static void usage(const char *execName) { std::cout << "Usage: " << execName << " [OPTION] [event number]\n" "Reconstruct slice tracks and merge them from cluster data read from the Events directory.\n\n" " -h, --help print this message\n" #ifdef MAIN_DRAW " -links let it draw every vector of links the NeighboursFinder found.\n" #else " -single force tracker to run on only one core. Per default all available cores will be used\n" #endif " -save dump result of the tracker/merger into a file for later analysis\n" #ifndef HLTCA_STANDALONE " -perf do a performance analysis against Monte-Carlo information right after reconstruction\n\n" #endif "You may specify a specific event to reconstruct if there is more than one available in the Events directory" << std::endl; } int main(int argc, char **argv) { string filePrefix = "./data/"; bool fullTiming = false; int repetitions = 1; #ifndef HLTCA_STANDALONE TFile* perfHistoFile = new TFile("HLTTPCCATrackerPerformance.root","RECREATE"); FitPerformance *perf=0; #endif for( int i=1; i < argc; i++ ){ if ( !std::strcmp( argv[i], "-h" ) || !std::strcmp( argv[i], "--help" ) || !std::strcmp( argv[i], "-help" ) ) { usage(argv[0]); return 0; #ifndef HLTCA_STANDALONE } else if ( !std::strcmp( argv[i], "-perf" ) ) { perf = &FitPerformance::Instance(); #endif } else if ( !std::strcmp( argv[i], "-time" ) ) { fullTiming = true; } else if ( !std::strcmp( argv[i], "-repeat" ) && ++i < argc ) { repetitions = atoi( argv[i] ); } else if ( !std::strcmp( argv[i], "-dir" ) && ++i < argc ) { filePrefix = argv[i]; } } filePrefix += "/"; string FParameters = filePrefix + "Parameters.txt"; fstream Parameters; Parameters.open(FParameters.data(), fstream::in); AliHLTTPCCAParamArBB SectorParamArBB; dense SectorAlpha; SectorAlpha = arbb::fill(0.f, AliHLTTPCCAParameters::NumberOfSectors); arbb::range SectorAlphaRange = SectorAlpha.write_only_range(); float cBz; int NTracks = 0, NClusters = 0; string tmpstring; Parameters >> tmpstring >> cBz; SectorParamArBB.SetcBz(cBz); for(int i=0; i<6; i++) { float tmp0=0.f, tmp1=0.f; int num = 0; Parameters >> tmpstring >> num >> tmp0 >> tmp1; SectorParamArBB.SetS0Par( num, tmp0, tmp1 ); } Parameters >> tmpstring; for(int i=0; i> SectorAlphaRange[i]; Parameters >> tmpstring >> NTracks; Parameters >> tmpstring >> NClusters; Parameters.close(); string FileInputTracks = filePrefix + "FitInputTracks.txt"; fstream FitTracksInput; FitTracksInput.open(FileInputTracks.data(), fstream::in); NTracks = 20000; AliHLTTPCCAFitter fitter; fitter.SetSectorParam(SectorParamArBB); fitter.SetSectorAlpha(SectorAlpha); fitter.ReadData(FitTracksInput, NTracks, NClusters); FitTracksInput.close(); fitter.FitTrack(); TStopwatch timer; timer.Start(); int NTimes = 100; for(int iTimes=0; iTimesReadData(FitTracksInputMC, NTracks); FitTracksInputMC.close(); perf->FitQualityCheck(fitter); perf->SetOutputFile(perfHistoFile); perf->WriteHistos(); } perfHistoFile->Close(); #endif return 0; }