-
-#include <TGenerator.h>
#include "THBTprocessor.h"
+//_____________________________________________________________________________
+///////////////////////////////////////////////////////////////////////////////
+// //
+// class THBTprocessor //
+// //
+// Wrapper class to HBT processor fortran code. //
+// For more information see AliGenHBTprocessor class //
+// HBT processor is written by Lanny Ray //
+// //
+// Comunication is done via COMMON BLOCKS declared in HBTprocCOMMON.h //
+// using cfortran.h routines //
+// User should use class AliGenHBTprocessor and all their interface //
+// see there for more description //
+// //
+// Wrapper class written by //
+// Piotr Krzysztof Skowronski (Piotr.Skowronski@cern.ch) //
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+
#include <TParticle.h>
#include <TMath.h>
-#include <iostream.h>
+#include <Riostream.h>
#ifndef WIN32
# define hbtprocessor hbtprocessor_
# define ctest ctest_
extern "C" void type_of_call hbtprocessor();
extern "C" void type_of_call ctest();
-//Wrapper class to HBT processor fortran code.
-//For more information see AliGenHBTprocessor class
-//HBT processor is written by Lanny Ray
-//Wrapper class written by Piotr Krzysztof Skowronski (Piotr.Skowronski@cern.ch)
-//
/*************************************************/
THBTprocessor::THBTprocessor()// it is better not to intialize it:TGenerator("THBTprocessor","THBTprocessor")
fParticles = 0;
Initialize(); //Enforce initialization (cleaning all commons)
}
+/*****************************************************************************************/
-void THBTprocessor::GenerateEvent()
+void THBTprocessor::GenerateEvent() const
{
//Starts processing
- cout<<endl<<"Entering Fortran"<<endl;
+ Info("GenerateEvent","Entering Fortran");
ctest();
hbtprocessor();
- cout<<endl<<"Exited Fortran"<<endl;
+ Info("GenerateEvent","Exited Fortran");
if(PARAMETERS.errorcode)
{
- Fatal("THBTprocessor::GenerateEvent()","HBT Processor (fortran part) finished with errors\n \
- See hbt_simulation.out file for more detailed information");
+ TString message("HBT Processor (fortran part) finished with errors\n");
+ message+="Error code is ";
+ message+=PARAMETERS.errorcode;
+ message+="\n";
+ message+="See hbt_simulation.out file for more detailed information.";
+ Fatal("GenerateEvent","%s",message.Data());
}
else
- cout<<endl<<"GOOD ! HBT Processor finished without errors"<<endl;
- cout<<"PARAMETERS.errorcode= "<<PARAMETERS.errorcode<<endl;
-
+ Info("GenerateEvent","GOOD ! HBT Processor finished without errors");
}
/*****************************************************************************************/
-void THBTprocessor::Initialize()
-{
+
+void THBTprocessor::Initialize() const
+{
+ //IT RESETS ALL THE PREVIOUS SETTINGS
//Call this method to set default values in PARAMETERS & MESH
//and zero other common block
- cout<<"\nHBT PROCESSOR::Initialize() Setting Default valuses in all COMMON BLOCKS"<<endl;
+ if(gDebug)
+ Info("Initialize","Setting Default valuses in all COMMON BLOCKS");
PARAMETERS.ref_control = 2;
PARAMETERS.switch_1d = 3;
MESH.pz_max = 3.6; //OK
/*********************************************/
+
+ Int_t i; //loop variable
- for (Int_t i =0; i<TRK_MAXLEN;i++)
+ for (i =0; i<TRK_MAXLEN;i++)
{
TRACK1.trk_id[i] = 0;
TRACK1.trk_px_sec[i] = 0;
/*********************************************/
- for (Int_t i =0; i<TRK2_MAXLEN;i++)
+ for (i =0; i<TRK2_MAXLEN;i++)
{
TRACK2.trk2_id[i] = 0;
TRACK2.trk2_px_sec[i] = 0;
/*********************************************/
- for (Int_t i =0; i<SEC_MAXLEN;i++)
+ for (i =0; i<SEC_MAXLEN;i++)
{
SEC_TRK_MAP.stm_sec_id [i] = 0;
SEC_TRK_MAP.stm_n_trk_sec[i] = 0;
/*********************************************/
- for (Int_t i =0; i<SEC_MAXLEN2;i++)
+ for (i =0; i<SEC_MAXLEN2;i++)
{
SEC_TRK_MAP2.stm_sec_id2[i] = 0;
SEC_TRK_MAP2.stm_n_trk_sec2[i] = 0;
/*********************************************/
- for (Int_t i =0; i<PART_MAXLEN;i++)
+ for (i =0; i<PART_MAXLEN;i++)
{
PARTICLE.part_id[i] = 0;
PARTICLE.part_charge[i] = 0;
/*********************************************/
- for (Int_t i =0; i<MAX_C2_1D;i++)
+ for (i =0; i<MAX_C2_1D;i++)
{
CORRELATIONS.c2mod_like_1d[i] = 0;
CORRELATIONS.c2mod_unlike_1d[i] = 0;
CORRELATIONS.c2err_unlike_1d[i] = 0;
}
/*********************************************/
- for (Int_t i =0; i<MAX_C2_3D;i++)
+ for (i =0; i<MAX_C2_3D;i++)
for (Int_t j =0; j<MAX_C2_3D;j++)
for (Int_t k =0; k<MAX_C2_3D;k++)
{
EVENT_SUMMARY.chi_u1d_mean = 0.0;
EVENT_SUMMARY.chi_u1d_rms = 0.0;
- for (Int_t i =0; i<MAX_EVENTS;i++)
+ for (i =0; i<MAX_EVENTS;i++)
{
EVENT_SUMMARY.n_part_used_1_store[i] = 0.0;
EVENT_SUMMARY.n_part_used_2_store[i] = 0.0;
EVENT_SUMMARY.chisq_unlike_1d_store[i] = 0.0;
}
/*********************************************/
- for (Int_t i =0; i<MAX_C2_COUL;i++)
+ for (i =0; i<MAX_C2_COUL;i++)
{
COULMB.c2_coul_like[i] = 0.0;
COULMB.c2_coul_unlike[i] = 0.0;
}
/*********************************************/
- for (Int_t i =0; i<MAX_H_1D;i++)
+ for (i =0; i<MAX_H_1D;i++)
{
HISTOGRAMS.hist1_pt_1[i] = 0;
HISTOGRAMS.hist1_phi_1[i] = 0;
HISTOGRAMS.hinc_unlike_1d[i] = 0;
}
- for (Int_t i =0; i<MAX_H_3D;i++)
+ for (i =0; i<MAX_H_3D;i++)
for (Int_t j =0; j<MAX_H_3D;j++)
for (Int_t k =0; k<MAX_H_3D;k++)
{
/*****************************************************************************************/
-Int_t THBTprocessor::ImportParticles(TClonesArray *particles, Option_t *option)
+Int_t THBTprocessor::ImportParticles(TClonesArray *particles, Option_t */*option*/)
{
//Copy particle data into TClonesArray
if (particles == 0) return 0;
- TClonesArray &Particles = *particles;
- Particles.Clear();
+ TClonesArray &rparticles = *particles;
+ rparticles.Clear();
Int_t nrpart = 0;
for (Int_t i=0; i < TRK_MAXLEN; i++)
// Float_t pE = TRACK.trk_E[i];
Float_t mass = PARTICLE.part_mass[TRACK1.trk_ge_pid[i]];
- new(Particles[nrpart++]) TParticle(0,0,0,0,0,0,px,py,pz,
+ new(rparticles[nrpart++]) TParticle(0,0,0,0,0,0,px,py,pz,
TMath::Sqrt(mass*mass+px*px+py*py+pz*pz),
0,0,0,0);
}
/*****************************************************************************************/
-void THBTprocessor::PrintEvent()
+void THBTprocessor::PrintEvent() const
{
//Prints all particles (common block data)
cout<<"Print Event"<<endl;
/*****************************************************************************************/
+void THBTprocessor::DumpSettings() const
+{
+ //prints values set in common blocks
+ ctest();
+}