Stupid bug fix in new superlight mode (from Zurich airport)
[u/mrichter/AliRoot.git] / THbtp / THBTprocessor.cxx
1 #include "THBTprocessor.h"
2 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * See cxx source for full Copyright notice                               */
4
5 /* $Id$ */
6
7 //_____________________________________________________________________________
8 ///////////////////////////////////////////////////////////////////////////////
9 //                                                                           //
10 // class THBTprocessor                                                       //
11 //                                                                           //
12 // Wrapper class to HBT processor fortran code.                              //
13 // For more information see AliGenHBTprocessor class                         //
14 // HBT processor is written by Lanny Ray                                     //
15 //                                                                           //
16 // Comunication is done via COMMON BLOCKS declared in HBTprocCOMMON.h        //
17 // using cfortran.h routines                                                 //
18 // User should use class AliGenHBTprocessor and all their interface          //
19 // see there for more description                                            //
20 //                                                                           //
21 // Wrapper class written by                                                  //
22 // Piotr Krzysztof Skowronski (Piotr.Skowronski@cern.ch)                     //
23 //                                                                           //
24 ///////////////////////////////////////////////////////////////////////////////
25
26
27 #include <Riostream.h>
28 #include <TClonesArray.h>
29 #include <TMath.h>
30 #include <TParticle.h>
31
32 #include "HBTprocCOMMON.h"
33
34 #ifndef WIN32
35 # define hbtprocessor hbtprocessor_
36 # define ctest ctest_
37 # define type_of_call
38 #else
39 # define hbtprocessor HBTPROCESSOR
40 # define ctest CTEST
41 # define type_of_call _stdcall
42 #endif    
43
44 using std::cout;
45 using std::endl;
46 ClassImp(THBTprocessor)
47  
48 extern "C" void  type_of_call hbtprocessor();   
49 extern "C" void  type_of_call ctest();
50
51
52 /*************************************************/
53 THBTprocessor::THBTprocessor()// it is better not to intialize it:TGenerator("THBTprocessor","THBTprocessor")
54                               //because it allocates memmory for TObjArray::fParticles which is not used in our case
55                               //and we are using TClonesArray in import paerticles
56  {
57  //constructor
58   PARAMETERS.ALICE            = 1; //flag that we are working in AliRoot (0==STAR stand alone mode)
59   PARAMETERS.pi               = TMath::Pi();//3.141592654;
60   PARAMETERS.rad              = 180.0/TMath::Pi();
61   PARAMETERS.hbc              = 0.19732891;
62   
63   fParticles = 0;
64   Initialize(); //Enforce initialization (cleaning all commons)
65  }
66 /*****************************************************************************************/
67
68 #if ROOT_VERSION_CODE <= ROOT_VERSION(5,11,2)
69 void THBTprocessor::GenerateEvent() const
70 #else
71 void THBTprocessor::GenerateEvent()
72 #endif
73 {
74 //Starts processing
75
76   Info("GenerateEvent","Entering Fortran");
77   ctest();
78   hbtprocessor();
79   Info("GenerateEvent","Exited Fortran");
80   if(PARAMETERS.errorcode)
81     {
82       TString message("HBT Processor (fortran part) finished with errors\n");
83       message+="Error code is ";
84       message+=PARAMETERS.errorcode;
85       message+="\n";
86       message+="See hbt_simulation.out file for more detailed information.";
87       Fatal("GenerateEvent","%s",message.Data());
88     }
89   else
90     Info("GenerateEvent","GOOD ! HBT Processor finished without errors");
91 }
92 /*****************************************************************************************/
93
94 void THBTprocessor::Initialize() const
95
96   //IT RESETS ALL THE PREVIOUS SETTINGS
97   //Call this method to set default values in PARAMETERS & MESH
98   //and zero other common block
99   
100   if(gDebug) 
101    Info("Initialize","Setting Default valuses in all COMMON BLOCKS");
102   
103   PARAMETERS.ref_control      = 2;
104   PARAMETERS.switch_1d        = 3;
105   PARAMETERS.switch_3d        = 1;
106   PARAMETERS.switch_type      = 3;
107   PARAMETERS.switch_coherence = 0;
108   PARAMETERS.switch_coulomb   = 3;
109   PARAMETERS.switch_fermi_bose= 1;
110   PARAMETERS.trk_accep        = 1.0;
111   PARAMETERS.print_full       = 1;
112   PARAMETERS.print_sector_data= 1;
113
114   PARAMETERS.n_pid_types      = 2;
115   PARAMETERS.pid[0]           = 8;
116   PARAMETERS.pid[1]           = 9;
117   PARAMETERS.deltap           = 0.1;
118   PARAMETERS.maxit            = 50;
119   PARAMETERS.delchi           = 1.0;
120   PARAMETERS.irand            = 76564;
121   PARAMETERS.lambda           = 0.6;
122   PARAMETERS.R_1d             = 7.0;
123   PARAMETERS.Rside            = 6.0;
124
125   PARAMETERS.Rout             = 7.0;
126   PARAMETERS.Rlong            = 4.0;
127   PARAMETERS.Rperp            = 6.0;
128   PARAMETERS.Rparallel        = 4.0;
129   PARAMETERS.R0               = 4.0;
130   PARAMETERS.Q0               = 9.0;
131
132   PARAMETERS.n_part_1_trk         = 0;
133   PARAMETERS.n_part_2_trk         = 0;
134   PARAMETERS.n_part_tot_trk       = 0;
135   PARAMETERS.n_part_used_1_trk    = 0;
136
137   PARAMETERS.n_part_used_2_trk    = 0;
138   PARAMETERS.n_part_1_trk2        = 0;
139   PARAMETERS.n_part_2_trk2        = 0;
140   PARAMETERS.n_part_tot_trk2      = 0;
141   PARAMETERS.n_part_used_1_trk2   = 0;
142   PARAMETERS.n_part_used_2_trk2   = 0;
143   PARAMETERS.n_part_used_1_ref    = 0;
144   PARAMETERS.n_part_used_2_ref    = 0;
145   PARAMETERS.n_part_used_1_inc    = 0;
146   PARAMETERS.n_part_used_2_inc    = 0;
147  
148   PARAMETERS.num_pairs_like       = 0;
149   PARAMETERS.num_pairs_unlike     = 0;
150   PARAMETERS.num_pairs_like_ref   = 0;
151   PARAMETERS.num_pairs_like_inc   = 0;
152   PARAMETERS.num_pairs_unlike_inc = 0;
153   PARAMETERS.event_line_counter   = 0;
154   PARAMETERS.file10_line_counter  = 0;
155
156   PARAMETERS.chisq_wt_like_1d         = 1.0;
157   PARAMETERS.chisq_wt_unlike_1d       = 1.0;
158   PARAMETERS.chisq_wt_like_3d_fine    = 1.0;
159
160   PARAMETERS.chisq_wt_unlike_3d_fine  = 1.0;
161   PARAMETERS.chisq_wt_like_3d_coarse  = 1.0;
162   PARAMETERS.chisq_wt_unlike_3d_coarse= 1.0;
163   PARAMETERS.chisq_wt_hist1_1         = 1.0;
164   PARAMETERS.chisq_wt_hist1_2         = 1.0; // /////internal comment 25 fields
165
166 /*********************************************/
167
168  
169   MESH.n_pt_bins        = 50;                            //OK
170   MESH.pt_min           = 0.1;  //Pt in GeV/c            //OK
171   MESH.pt_max           = 0.98; //Pt in GeV/c
172   MESH.n_phi_bins       = 50;                          //OK
173   MESH.phi_min          = 0.0;                              //OK
174   MESH.phi_max          = 360.0;                          //OK
175   MESH.n_eta_bins       = 50;                          //OK
176   MESH.eta_min          =-1.5;                          //OK
177   MESH.eta_max          = 1.5;                          //OK
178   MESH.n_1d_fine        = 10;                          //OK
179   MESH.binsize_1d_fine  = 0.01;                         //ok 
180   MESH.n_1d_coarse      = 2;                          //O
181   MESH.binsize_1d_coarse= 0.05;                       //ok
182   MESH.n_3d_fine        = 8;                          //OK
183   MESH.binsize_3d_fine  = 0.01;                       //ok
184   MESH.n_3d_coarse      = 2;                          //OK
185   MESH.binsize_3d_coarse= 0.08;                       //ok
186   MESH.n_3d_fine_project= 3;                          //OK
187   MESH.n_px_bins        = 20;                          //OK
188   MESH.px_min           =-1.0;                          //OK
189   MESH.px_max           = 1.0;                          //OK
190   MESH.n_py_bins        = 20;                          //OK
191   MESH.py_min           =-1.0;                          //OK
192   MESH.py_max           = 1.0;                          //OK
193   MESH.n_pz_bins        = 70;                          //OK
194   MESH.pz_min           =-3.6;                          //OK
195   MESH.pz_max           = 3.6;                          //OK
196   
197 /*********************************************/
198
199   Int_t i; //loop variable
200   
201   for (i =0; i<TRK_MAXLEN;i++)
202    {
203     TRACK1.trk_id[i] = 0;
204     TRACK1.trk_px_sec[i] = 0; 
205     TRACK1.trk_py_sec[i] = 0;
206     TRACK1.trk_pz_sec[i] = 0;
207     TRACK1.trk_sector[i] = 0;
208     TRACK1.trk_flag[i] = 0;
209     TRACK1.trk_out_flag[i] = 0;
210     TRACK1.trk_merge_flag[i] = 0;
211     TRACK1.trk_ge_pid[i] = 0;
212     TRACK1.trk_start_vertex[i] = 0;
213     TRACK1.trk_stop_vertex[i] = 0;
214     TRACK1.trk_event_line[i] = 0;
215     TRACK1.trk_px[i] = 0;
216     TRACK1.trk_py[i] = 0;
217     TRACK1.trk_pz[i] = 0;
218     TRACK1.trk_E[i] = 0;
219     TRACK1.trk_pt[i] = 0;
220     TRACK1.trk_phi[i] = 0;
221     TRACK1.trk_eta[i] = 0; 
222    }
223   
224 /*********************************************/
225
226   for (i =0; i<TRK2_MAXLEN;i++)
227    {
228     TRACK2.trk2_id[i] = 0;
229     TRACK2.trk2_px_sec[i] = 0; 
230     TRACK2.trk2_py_sec[i] = 0;
231     TRACK2.trk2_pz_sec[i] = 0;
232     TRACK2.trk2_sector[i] = 0;
233     TRACK2.trk2_flag[i] = 0;
234     TRACK2.trk2_out_flag[i] = 0;
235     TRACK2.trk2_merge_flag[i] = 0;
236     TRACK2.trk2_ge_pid[i] = 0;
237     TRACK2.trk2_start_vertex[i] = 0;
238     TRACK2.trk2_stop_vertex[i] = 0;
239     TRACK2.trk2_event_line[i] = 0;
240     TRACK2.trk2_px[i] = 0;
241     TRACK2.trk2_py[i] = 0;
242     TRACK2.trk2_pz[i] = 0;
243     TRACK2.trk2_E[i] = 0;
244     TRACK2.trk2_pt[i] = 0;
245     TRACK2.trk2_phi[i] = 0;
246     TRACK2.trk2_eta[i] = 0; 
247    }
248
249 /*********************************************/
250
251   for (i =0; i<SEC_MAXLEN;i++)
252    {
253     SEC_TRK_MAP.stm_sec_id [i] = 0;
254     SEC_TRK_MAP.stm_n_trk_sec[i] = 0; 
255     SEC_TRK_MAP.stm_flag[i] = 0;
256     
257     for (Int_t j=0; j<MAX_TRK_SEC;j++)
258        SEC_TRK_MAP.stm_track_id[i][j] = 0;
259    }
260
261 /*********************************************/
262
263   for (i =0; i<SEC_MAXLEN2;i++)
264    {
265     SEC_TRK_MAP2.stm_sec_id2[i] = 0;
266     SEC_TRK_MAP2.stm_n_trk_sec2[i] = 0; 
267     SEC_TRK_MAP2.stm_flag2[i] = 0;
268     
269     for (Int_t j=0; j<MAX_TRK_SEC;j++)
270        SEC_TRK_MAP2.stm_track_id2[i][j] = 0;
271    }
272
273 /*********************************************/
274
275   for (i =0; i<PART_MAXLEN;i++)
276    {
277      PARTICLE.part_id[i] = 0;
278      PARTICLE.part_charge[i] = 0;
279      PARTICLE.part_mass[i] = 0;
280      PARTICLE.part_lifetime[i] = 0;
281    }
282
283
284 /*********************************************/
285   for (i =0; i<MAX_C2_1D;i++)
286    {
287      CORRELATIONS.c2mod_like_1d[i] = 0; 
288      CORRELATIONS.c2mod_unlike_1d[i] = 0;
289      CORRELATIONS.c2fit_like_1d[i] = 0;
290      CORRELATIONS.c2fit_unlike_1d[i] = 0;
291      CORRELATIONS.c2err_like_1d[i] = 0;
292      CORRELATIONS.c2err_unlike_1d[i] = 0;
293    }
294 /*********************************************/
295   for (i =0; i<MAX_C2_3D;i++)
296    for (Int_t j =0; j<MAX_C2_3D;j++)
297     for (Int_t k =0; k<MAX_C2_3D;k++)
298      {
299       CORRELATIONS.c2mod_like_3d_fine[i][j][k] = 0.0;
300       CORRELATIONS.c2mod_unlike_3d_fine[i][j][k] = 0.0;
301       CORRELATIONS.c2mod_like_3d_coarse[i][j][k] = 0.0;
302       CORRELATIONS.c2mod_unlike_3d_coarse[i][j][k] = 0.0;
303       CORRELATIONS.c2fit_like_3d_fine[i][j][k] = 0.0;
304       CORRELATIONS.c2fit_unlike_3d_fine[i][j][k] = 0.0;
305       CORRELATIONS.c2fit_like_3d_coarse[i][j][k] = 0.0;
306       CORRELATIONS.c2fit_unlike_3d_coarse[i][j][k] = 0.0;
307       CORRELATIONS.c2err_like_3d_fine[i][j][k] = 0.0;
308       CORRELATIONS.c2err_unlike_3d_fine[i][j][k] = 0.0;
309       CORRELATIONS.c2err_like_3d_coarse[i][j][k] = 0.0;
310       CORRELATIONS.c2err_unlike_3d_coarse[i][j][k] = 0.0;
311      }
312 /*********************************************/
313
314    EVENT_SUMMARY.niter_mean = 0.0; 
315    EVENT_SUMMARY.niter_rms = 0.0;
316  
317    EVENT_SUMMARY.npart1_mean = 0.0; 
318    EVENT_SUMMARY.npart1_rms = 0.0;
319  
320    EVENT_SUMMARY.npart2_mean = 0.0; 
321    EVENT_SUMMARY.npart2_rms = 0.0;
322  
323    EVENT_SUMMARY.npart_tot_mean = 0.0; 
324    EVENT_SUMMARY.npart_tot_rms = 0.0;
325  
326    EVENT_SUMMARY.nsec_flag_mean = 0.0; 
327    EVENT_SUMMARY.nsec_flag_rms = 0.0;
328  
329    EVENT_SUMMARY.frac_trks_out_mean = 0.0;
330    EVENT_SUMMARY.frac_trks_out_rms = 0.0;
331  
332    EVENT_SUMMARY.frac_trks_flag_mean = 0.0;
333    EVENT_SUMMARY.frac_trks_flag_rms = 0.0;
334  
335    EVENT_SUMMARY.chi_l1d_mean = 0.0;
336    EVENT_SUMMARY.chi_l1d_rms = 0.0;
337
338    EVENT_SUMMARY.chi_u1d_mean = 0.0;
339    EVENT_SUMMARY.chi_u1d_rms = 0.0;
340
341  for (i =0; i<MAX_EVENTS;i++) 
342   {
343     EVENT_SUMMARY.n_part_used_1_store[i] = 0.0; 
344     EVENT_SUMMARY.n_part_used_2_store[i] = 0.0; 
345     EVENT_SUMMARY.n_part_tot_store[i] = 0.0; 
346     EVENT_SUMMARY.num_sec_flagged_store[i] = 0.0; 
347     EVENT_SUMMARY.frac_trks_out[i] = 0.0; 
348     EVENT_SUMMARY.frac_trks_flag[i] = 0.0;
349     EVENT_SUMMARY.chisq_like_1d_store[i] = 0.0;         
350     EVENT_SUMMARY.num_iter[i] = 0.0; 
351     EVENT_SUMMARY.chisq_unlike_1d_store[i] = 0.0;       
352   } 
353 /*********************************************/
354  for (i =0; i<MAX_C2_COUL;i++) 
355   {
356       COULMB.c2_coul_like[i] = 0.0;
357       COULMB.c2_coul_unlike[i] = 0.0;
358       COULMB.q_coul[i] = 0.0; 
359  
360   }
361 /*********************************************/
362  for (i =0; i<MAX_H_1D;i++) 
363    {  
364       HISTOGRAMS.hist1_pt_1[i] = 0;
365       HISTOGRAMS.hist1_phi_1[i] = 0;
366       HISTOGRAMS.hist1_eta_1[i] = 0;
367       HISTOGRAMS.hist1_pt_2[i] = 0;
368       HISTOGRAMS.hist1_phi_2[i] = 0;
369       HISTOGRAMS.hist1_eta_2[i] = 0;
370       HISTOGRAMS.htmp1_pt_1[i] = 0;
371       HISTOGRAMS.htmp1_phi_1[i] = 0;
372       HISTOGRAMS.htmp1_eta_1[i] = 0;
373       HISTOGRAMS.htmp1_pt_2[i] = 0;
374       HISTOGRAMS.htmp1_phi_2[i] = 0;
375       HISTOGRAMS.htmp1_eta_2[i] = 0;
376       HISTOGRAMS.href1_pt_1[i] = 0;
377       HISTOGRAMS.href1_phi_1[i] = 0;
378       HISTOGRAMS.href1_eta_1[i] = 0;
379       HISTOGRAMS.href1_pt_2[i] = 0;
380       HISTOGRAMS.href1_phi_2[i] = 0;
381       HISTOGRAMS.href1_eta_2[i] = 0;
382       HISTOGRAMS.hinc1_pt_1[i] = 0;
383       HISTOGRAMS.hinc1_phi_1[i] = 0;
384       HISTOGRAMS.hinc1_eta_1[i] = 0;
385       HISTOGRAMS.hinc1_pt_2[i] = 0;
386       HISTOGRAMS.hinc1_phi_2[i] = 0;
387       HISTOGRAMS.hinc1_eta_2[i] = 0;
388       HISTOGRAMS.hist_like_1d[i] = 0;
389       HISTOGRAMS.hist_unlike_1d[i] = 0;
390       HISTOGRAMS.htmp_like_1d[i] = 0;
391       HISTOGRAMS.htmp_unlike_1d[i] = 0;
392       HISTOGRAMS.href_like_1d[i] = 0;
393       HISTOGRAMS.href_unlike_1d[i] = 0;
394       HISTOGRAMS.hinc_like_1d[i] = 0;
395       HISTOGRAMS.hinc_unlike_1d[i] = 0;
396   }
397
398  for (i =0; i<MAX_H_3D;i++) 
399    for (Int_t j =0; j<MAX_H_3D;j++) 
400      for (Int_t k =0; k<MAX_H_3D;k++) 
401        {
402           HISTOGRAMS.hist_like_3d_fine[i][j][k] = 0;
403           HISTOGRAMS.hist_unlike_3d_fine[i][j][k] = 0;
404           HISTOGRAMS.hist_like_3d_coarse[i][j][k] = 0;
405           HISTOGRAMS.hist_unlike_3d_coarse[i][j][k] = 0;
406           HISTOGRAMS.htmp_like_3d_fine[i][j][k] = 0;
407           HISTOGRAMS.htmp_unlike_3d_fine[i][j][k] = 0;
408           HISTOGRAMS.htmp_like_3d_coarse[i][j][k] = 0;
409           HISTOGRAMS.htmp_unlike_3d_coarse[i][j][k] = 0;
410           HISTOGRAMS.href_like_3d_fine[i][j][k] = 0;
411           HISTOGRAMS.href_unlike_3d_fine[i][j][k] = 0;
412           HISTOGRAMS.href_like_3d_coarse[i][j][k] = 0;
413           HISTOGRAMS.href_unlike_3d_coarse[i][j][k] = 0;
414           HISTOGRAMS.hinc_like_3d_fine[i][j][k] = 0;
415           HISTOGRAMS.hinc_unlike_3d_fine[i][j][k] = 0;
416           HISTOGRAMS.hinc_like_3d_coarse[i][j][k] = 0;
417           HISTOGRAMS.hinc_unlike_3d_coarse[i][j][k] = 0;
418        }
419 /*********************************************/
420
421
422 /*********************************************/
423
424 //  cout<<" FINISHED"<<endl;
425   
426 }
427
428
429 /*****************************************************************************************/
430
431
432 Int_t THBTprocessor::ImportParticles(TClonesArray *particles, Option_t */*option*/)
433  {
434   //Copy particle data into TClonesArray
435   if (particles == 0) return 0;
436   TClonesArray &rparticles = *particles;
437   rparticles.Clear();
438  
439   Int_t nrpart = 0;
440   for (Int_t i=0; i < TRK_MAXLEN; i++) 
441    {
442    
443     
444       if (TRACK1.trk_E[i] == 0.) continue;
445     
446       Float_t px   = TRACK1.trk_px[i];
447       Float_t py   = TRACK1.trk_py[i];
448       Float_t pz   = TRACK1.trk_pz[i];
449 //    Float_t pE   = TRACK.trk_E[i];
450       Float_t mass = PARTICLE.part_mass[TRACK1.trk_ge_pid[i]];
451     
452       new(rparticles[nrpart++]) TParticle(0,0,0,0,0,0,px,py,pz,
453                                          TMath::Sqrt(mass*mass+px*px+py*py+pz*pz),
454                                          0,0,0,0);
455    }
456   return nrpart;        
457  }
458
459 /*****************************************************************************************/
460 TObjArray * THBTprocessor::ImportParticles(Option_t */*option*/)
461  {
462   //Copy particle data into TObjArray
463   fParticles->Clear();
464  
465   for (Int_t i=0; i < TRK_MAXLEN; i++) 
466    {
467    
468     
469       if (TRACK1.trk_E[i] == 0.) continue;
470     
471       Float_t px   = TRACK1.trk_px[i];
472       Float_t py   = TRACK1.trk_py[i];
473       Float_t pz   = TRACK1.trk_pz[i];
474 //    Float_t pE   = TRACK.trk_E[i];
475       Float_t mass = PARTICLE.part_mass[TRACK1.trk_ge_pid[i]];
476     
477       TParticle * p =new TParticle(0,0,0,0,0,0,px,py,pz,
478                                    TMath::Sqrt(mass*mass+px*px+py*py+pz*pz),
479                                    0,0,0,0);
480       fParticles->Add(p);
481    }
482   return fParticles;        
483  }
484
485 /*****************************************************************************************/
486
487 void THBTprocessor::PrintEvent() const
488  {
489  //Prints all particles (common block data)  
490    cout<<"Print Event"<<endl;
491    for (Int_t i=0; i<TRK_MAXLEN;i++)
492     {
493       if(TRACK1.trk_E[i]==0.) continue;
494
495       cout<<"trk_id: "<<TRACK1.trk_id[i]<<"  trk_px :"<<TRACK1.trk_px[i]<<"  trk_py :"<<TRACK1.trk_py[i]<<"  trk_pz :"<<TRACK1.trk_pz[i]<<endl;
496       cout<<"                trk_E: "<<TRACK1.trk_E[i]<<"  trk_pt: "<<TRACK1.trk_pt[i]<<"  trk_phi: "<<TRACK1.trk_phi[i]<<"  trk_eta: "<<TRACK1.trk_eta[i]<<endl;
497     }
498  }
499
500
501 /*****************************************************************************************/
502 void THBTprocessor::DumpSettings() const
503 {
504  //prints values set in common blocks
505   ctest();
506 }
507 void THBTprocessor::SetTrackRejectionFactor(Float_t trf) const 
508 {
509  //setter
510  PARAMETERS.trk_accep = trf;
511 }
512 void THBTprocessor::SetRefControl(Int_t rc) const 
513 {
514  //setter
515  PARAMETERS.ref_control = rc;
516 }
517 void THBTprocessor::SetPIDs(Int_t pid1,Int_t pid2) const 
518 {
519  //setter
520  PARAMETERS.pid[0]=pid1; PARAMETERS.pid[1]=pid2;
521 }
522 void THBTprocessor::SetNPIDtypes(Int_t npidt)const 
523 {
524  //setter
525  PARAMETERS.n_pid_types = npidt;
526 }
527 void THBTprocessor::SetDeltap(Float_t deltp) const 
528 {
529  //setter
530  PARAMETERS.deltap=deltp; 
531 }
532 void THBTprocessor::SetMaxIterations(Int_t maxiter) const 
533 {
534  //setter
535  PARAMETERS.maxit = maxiter;
536 }
537 void THBTprocessor::SetDelChi(Float_t dc)const 
538 {
539  //setter
540  PARAMETERS.delchi = dc;
541 }
542 void THBTprocessor::SetIRand(Int_t irnd) const 
543 {
544  //setter
545  PARAMETERS.irand = irnd;
546 }
547 void THBTprocessor::SetLambda(Float_t lam) const 
548
549  //setter
550  PARAMETERS.lambda = lam;
551 }
552 void THBTprocessor::SetR1d(Float_t r) const 
553 {
554  //setter
555  PARAMETERS.R_1d=r;
556 }
557 void THBTprocessor::SetRSide(Float_t rs) const 
558 {
559  //setter
560  PARAMETERS.Rside=rs;
561 }
562 void THBTprocessor::SetROut(Float_t ro) const 
563 {
564  //setter
565  PARAMETERS.Rout=ro;
566 }
567 void THBTprocessor::SetRLong(Float_t rl) const 
568 {
569  //setter
570  PARAMETERS.Rlong=rl;
571 }
572 void THBTprocessor::SetRPerp(Float_t rp) const 
573 {
574  //setter
575  PARAMETERS.Rperp=rp;
576 }
577 void THBTprocessor::SetRParallel(Float_t rprl) const 
578 {
579  //setter
580  PARAMETERS.Rparallel=rprl;
581 }
582 void THBTprocessor::SetR0(Float_t r0) const 
583 {
584  //setter
585  PARAMETERS.R0=r0;
586 }
587 void THBTprocessor::SetQ0(Float_t q0) const 
588 {
589  //setter
590 PARAMETERS.Q0=q0;
591 }
592 void THBTprocessor::SetSwitch1D(Int_t s1d) const 
593 {
594  //setter
595  PARAMETERS.switch_1d = s1d;
596 }
597 void THBTprocessor::SetSwitch3D(Int_t s3d) const 
598 {
599  //setter
600  PARAMETERS.switch_3d = s3d;
601 }
602 void THBTprocessor::SetSwitchType(Int_t st) const 
603 {
604  //setter
605  PARAMETERS.switch_type = st;
606 }
607
608 void THBTprocessor::SetSwitchCoherence(Int_t sc) const 
609 {
610  //setter
611  PARAMETERS. switch_coherence = sc;
612 }
613 void THBTprocessor::SetSwitchCoulomb(Int_t scol) const 
614 {
615  //setter
616  PARAMETERS. switch_coulomb = scol;
617 }
618 void THBTprocessor::SetSwitchFermiBose(Int_t sfb) const 
619 {
620  //setter
621  PARAMETERS.switch_fermi_bose = sfb;
622 }
623       
624 void THBTprocessor::SetPtRange(Float_t ptmin, Float_t ptmax)const  //Pt in GeV/c
625
626  //setter
627   MESH.pt_min=ptmin;MESH.pt_max=ptmax;
628 }
629
630 void THBTprocessor::SetPxRange(Float_t pxmin, Float_t pxmax) const
631
632  //setter
633  MESH.px_min=pxmin;MESH.px_max=pxmax;
634 }
635
636 void THBTprocessor::SetPyRange(Float_t pymin, Float_t pymax)const 
637
638  //setter
639  MESH.py_min=pymin;MESH.py_max=pymax;
640 }
641
642 void THBTprocessor::SetPzRange(Float_t pzmin, Float_t pzmax) const
643
644  //setter
645  MESH.pz_min=pzmin;MESH.pz_max=pzmax;
646 }
647
648 void THBTprocessor::SetPhiRange(Float_t phimin, Float_t phimax)const //Angle in degrees
649
650  //setter
651  MESH.phi_min=phimin;MESH.phi_max=phimax;
652 }
653
654 void THBTprocessor::SetEtaRange(Float_t etamin, Float_t etamax)const //Pseudorapidity  !!!!!!!!!
655
656  //setter
657  MESH.eta_min=etamin;MESH.eta_max=etamax;
658 }
659
660 void THBTprocessor::SetNPtBins(Int_t nptbin)const
661 {
662 //setter
663 MESH.n_pt_bins=nptbin;
664 }
665 void THBTprocessor::SetNPhiBins(Int_t nphibin)const
666 {
667 //setter
668 MESH.n_phi_bins=nphibin;
669 }
670 void THBTprocessor::SetNEtaBins(Int_t netabin)const
671 {
672 //setter
673 MESH.n_eta_bins=netabin;
674 }
675       
676 void THBTprocessor::SetNPxBins(Int_t npxbin)const
677 {
678 //setter
679 MESH.n_px_bins=npxbin;
680 }
681 void THBTprocessor::SetNPyBins(Int_t npybin)const
682 {
683 //setter
684 MESH.n_py_bins=npybin;
685 }
686 void THBTprocessor::SetNPzBins(Int_t npzbin)const
687 {
688 //setter
689 MESH.n_pz_bins=npzbin;
690 }
691
692 void THBTprocessor::SetNBins1DFineMesh(Int_t n)const
693 {
694 //setter
695 MESH.n_1d_fine=n;
696 }
697 void THBTprocessor::SetBinSize1DFineMesh(Float_t x)const
698 {
699 //setter
700 MESH.binsize_1d_fine=x;
701 }
702       
703 void THBTprocessor::SetNBins1DCoarseMesh(Int_t n)const
704 {
705 //setter
706 MESH.n_1d_coarse =n;
707 }
708 void THBTprocessor::SetBinSize1DCoarseMesh(Float_t x)const
709 {
710 //setter
711 MESH.binsize_1d_coarse=x;
712 }
713       
714 void THBTprocessor::SetNBins3DFineMesh(Int_t n)const
715 {
716 //setter
717 MESH.n_3d_fine =n;
718 }
719 void THBTprocessor::SetBinSize3DFineMesh(Float_t x)const
720 {
721 //setter
722 MESH.binsize_3d_fine=x;
723 }
724       
725 void THBTprocessor::SetNBins3DCoarseMesh(Int_t n)const
726 {
727 //setter
728 MESH.n_3d_coarse=n;
729 }
730 void THBTprocessor::SetBinSize3DCoarseMesh(Float_t x)const
731 {
732 //setter
733 MESH.binsize_3d_coarse=x;
734 }      
735       
736 void THBTprocessor::SetNBins3DFineProjectMesh(Int_t n )const
737 {
738 //setter
739 MESH.n_3d_fine_project=n;
740 }
741
742 void THBTprocessor::SetPrintFull(Int_t flag) const 
743 {
744  //setter
745  PARAMETERS.print_full=flag;
746