{ //================================================================= // If the library is already loaded, no need to load it again. if(!TClassTable::GetDict("TCollimator")) { gSystem->Load("libTHR.so"); } TCP = new TCollimator(); TCP.Init("DATA/COLLIMATORS/TCP_IR3"); BLM = new TBlm(); BLM.Init("DATA/BLM/IC_COLLIMATOR_v01"); Double_t Nprot=TCP.GetEdepLimit(0.45,BLM.GetIntegrationTime(11)); Double_t Sig=BLM.GetBlmResponse_BITS(0.45,11); Long64_t thr; Long64_t thrf; Double_t Ebeam; Double_t Itime; cout << " test: " << endl; thr = Long64_t(Nprot*Sig); cout << Nprot*Sig << " " << Long64_t(Nprot*Sig) << " " << thr << endl; cout << " test passed OK! " << endl; FILE *outf; outf = fopen("outputfile.dat","w+"); for(Int_t ie=0; ie<32; ie++) { Ebeam = BLM.GetBeamEnergy(ie); for(Int_t it=0; it<12; it++) { thr=0LL; Itime = BLM.GetIntegrationTime(it); Nprot=TCP.GetEdepLimit(Ebeam,Itime); Sig=BLM.GetBlmResponse_BITS(Ebeam,it); thr = Long64_t(Nprot*Sig); // HERE SITS THE BUG if(it==11 && ie==0) { cout << "in the loop: " << endl; cout << " --->>> " << Nprot << " * " << Sig << " = " << Nprot*Sig << " or " << thr << endl; cout << "NOT OK! why?" << endl; } fprintf(outf,"%Ld, ",thr); } fprintf(outf,"\n"); } fclose(outf); }