KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVBreakUp.cpp
Go to the documentation of this file.
1 //Created by KVClassFactory on Thu Mar 25 11:25:27 2010
2 //Author: bonnet
3 
4 #include "KVBreakUp.h"
5 #include "TMath.h"
6 #include "TMethodCall.h"
7 #include "TRandom3.h"
8 
9 using namespace std;
10 
12 
13 
14 
15 
19 void KVBreakUp::init(void)
20 {
21  //Initialisation des variables
22  //appele par le constructeur
23 
24  Ztotal = 0;
25  bound = 0;
26  SetConditions(0, 0, 0);
27 
28  //generateurs de nombre aleatoire
29  alea = 0;
30  RedefineTRandom("TRandom3");
31 
32  BreakUpMethod = "BreakUsingChain";
33  SetBreakUpMethod(BreakUpMethod);
34 
35  lhisto = new KVHashList();
36  lhisto->SetOwner(kTRUE);
37  //Rempli dans les methodes type Break...()
38  hzz = new TH1F("KVBreakUp_hzz", "distri z", 200, -0.5, 199.5);
39  lhisto->Add(hzz);
40  nraffine = 0;
41 
42  lobjects = new KVHashList();
43  lobjects->SetOwner(kTRUE);
44 
45  DefineHistos();
46 
47  niter_tot = 0;
48  tstart = tstop = tellapsed = 0;
49 
50  StorePartitions();
51  current_event = new KVEvent();
52 }
53 
54 
55 
61 
63 {
64  //Constructeur, l'argument taille_max correspond
65  //a la taille maximale du tableau ou sont enregistrees
66  //les produits de la cassure (par defaut 5000)
67  //Ce qui correspond a la cassure en 5000 morceaux max
68  size_max = taille_max;
69  size = new Int_t[size_max];
70  init();
71 }
72 
73 
74 
77 
79 {
80  //Destructeur
81  delete alea;
82  delete lhisto;
83  delete lobjects;
84 
85  //delete current_event;
86 
87  if (bound) delete [] bound;
88  delete [] size;
89 
90  TCanvas* c1 = 0;
91  if ((c1 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("BreakUp_Control"))) delete c1;
92 
93 }
94 
95 
100 
102 {
103  //Remet a zero les compteurs
104  //Efface les partitions enregistrees
105  //Le contenu des histos
107  ResetTotalIterations();
108  ResetHistos();
109 
110 }
111 
112 
113 
118 
120 {
121  //Definition des histogrammes
122  //A redefinir si besoin dans les classes filles
123  //A Remplir dans la methode TreatePartition()
124 
125  hzt = new TH1F("KVBreakUp_hzt", "h ztotal", 200, -0.5, 199.5);
126  lhisto->Add(hzt);
127  hmt = new TH1F("KVBreakUp_hmt", "h mtotal", 200, -0.5, 199.5);
128  lhisto->Add(hmt);
129 }
130 
131 
132 
135 
137 {
138  //Protected method
139  if (zt != Ztotal) {
140  Ztotal = zt;
141  //zt correspond au nombre de possibles liens a casser
142  if (bound) delete bound;
143  bound = new Int_t[Ztotal];
144  for (Int_t nn = 0; nn < Ztotal; nn += 1) bound[nn] = 1;
145  nbre_nuc = Ztotal - Mtotal * Zmin;
146  }
147 }
148 
149 
150 
153 
155 {
156  //Protected method
157  if (mt > size_max) {
158  Error("SetMtot", "%d -> La multiplicite max (%d) est depassee", mt, size_max);
159  exit(EXIT_FAILURE);
160  }
161  Mtotal = mt;
162  nbre_nuc = Ztotal - Mtotal * Zmin;
163 }
164 
165 
166 
169 
171 {
172  //Protected method
173 
174  Zmin = zlim;
175  nbre_nuc = Ztotal - Mtotal * Zmin;
176 
177 }
178 
179 
180 
183 
185 {
186  //Protected method
187  BreakUpMethod = bup_method;
188 
189 }
190 
191 
192 
194 
196 {
197 
198  if (current_event) delete current_event;
199  current_event = evt;
200 
201 }
202 
203 
204 
209 
211 {
212  //Permet de definir une classe pour le tirage aleatoire pour la
213  //cassure en entiers
214  //La class doit derivee de TRandom
215 
216  if (alea) delete alea;
217  TClass* cl = new TClass(TRandom_Method.Data());
218  alea = (TRandom*)cl->New();
219  delete cl;
220 }
221 
222 
223 
227 
229 {
230  //Definition du nombre a casser (zt), en plusieurs nombres entiers (mt)
231  //avec une valeur minimale (zmin)
232  SetZtot(zt);
233  SetMtot(mt);
234  SetZmin(zmin);
235 }
236 
237 
238 
242 
244 {
245  //Permet de definir une methode
246  //de cassure
247 
248  if (bup_method == "") {
249  Info("DefineBreakUpMethod", "Available methods are");
250  cout << "BreakUsingChain" << endl;
251  cout << "BreakUsingPile" << endl;
252  cout << "BreakUsingIndividual" << endl;
253  cout << "BreakUsingLine" << endl;
254  cout << "Make your choice" << endl;
255  }
256  else {
257  SetBreakUpMethod(bup_method);
258  }
259 
260 }
261 
262 
263 
266 
268 {
269  //Retourne le nombre entier a casser
270  return Ztotal;
271 
272 }
273 
274 
275 
278 
280 {
281  //Retourne le nombre d'entiers apres cassure (la multiplicite)
282  return Mtotal;
283 
284 }
285 
286 
287 
290 
292 {
293  //Retourne la taille minimale des entiers apres cassure
294  return Zmin;
295 
296 }
297 
298 
299 
302 
304 {
305  //Retourne methode de cassure
306  return BreakUpMethod;
307 
308 }
309 
310 
311 
314 
316 {
317  //si choix=kTRUE, on enregistre les partitions
318  SetBit(kStorePartitions, choix);
319 
320 }
321 
322 
323 
328 
330 {
331  //Methode de cassure
332 
333  //Conditions de depart
334  //Mtotal clusters de taille minimale Zmin
335  for (Int_t mm = 0; mm < Mtotal; mm += 1) {
336  size[mm] = Zmin - 1;
337  }
338  //On initilise la taille a Zmin-1
339  //Le tirage aleatoire se fait
340  //sur la taille restante Ztotal_corr
341  Int_t Ztotal_corr = Ztotal - (Zmin - 1) * Mtotal;
342 
343  nl = "";
344  Int_t bb = 0;
345  Int_t mtire = 0;
346  while (mtire < Mtotal) {
347  //Tirage uniform d'entier entre 0 et Ztotal_corr - 1
348  bb = TMath::Nint(alea->Uniform(0, (Ztotal_corr) - 0.5));
349  //test si ce lien a deja ete casse
350  if (bound[bb] == 1) {
351  nl.Add(bb);
352  mtire += 1;
353  bound[bb] = 0;
354  }
355  }
356 
357  //La cassure a reussie
358  //on recupere les tailles additionelles
359  IntArray val = nl.GetArray();
360  Int_t mtot_corr = val.size();
361 
362  Int_t zc = 0;
363  //boucle sur les liens casses
364  Int_t taille = 0;
365  for (Int_t ii = 1; ii < mtot_corr; ii += 1) {
366  taille = val[ii] - val[ii - 1];
367  size[ii] += taille; //mise a jour des tailles des clusters
368  hzz->Fill(size[ii]);
369  bound[val[ii]] = 1; //Reset du lien pour le prochain tirage
370  zc += size[ii]; //incrementation de la taille totale de controle
371  }
372  taille = Ztotal_corr - val[mtot_corr - 1] + val[0];
373 
374  size[0] += taille;
375  hzz->Fill(size[0]);
376  bound[val[0]] = 1;
377  zc += size[0];
378 
379  //cout << zc << " " << Ztotal << endl;
380  if (zc == Ztotal && mtot_corr == Mtotal) return 1;
381  else return 0;
382 
383 }
384 
385 
386 
391 
393 {
394  //Methode de cassure
395 
396  //Conditions de depart
397  //Mtotal clusters de taille minimale Zmin
398  for (Int_t mm = 0; mm < Mtotal; mm += 1) {
399  size[mm] = Zmin - 1;
400  }
401  //On initilise la taille a Zmin-1
402  //Le tirage aleatoire se fait
403  //sur la taille restante Ztotal_corr
404  Int_t Ztotal_corr = Ztotal - (Zmin - 1) * Mtotal;
405 
406  nl = "";
407  Int_t bb = 0;
408  Int_t mtire = 0;
409  while (mtire < Mtotal - 1) {
410  //Tirage uniform d'entier entre 0 et Ztotal_corr - 1
411  bb = TMath::Nint(alea->Uniform(1, (Ztotal_corr - 1) - 0.5));
412  //test si ce lien a deja ete casse
413  if (bound[bb] == 1) {
414  //cout << "bb="<<bb << endl;
415  nl.Add(bb);
416  mtire += 1;
417  bound[bb] = 0;
418  }
419  }
420 
421  //cout << "mtire="<<mtire << endl;
422  //
423  nl.Add(0);
424  nl.Add(Ztotal_corr);
425  //cout << "nl="<<nl.AsString() << endl;;
426  //La cassure a reussie
427  //on recupere les tailles additionelles
428  IntArray val = nl.GetArray();
429  Int_t mtot_corr = val.size();
430  //cout << "mtot_corr="<<mtot_corr << endl;
431  Int_t zc = 0;
432  //boucle sur les liens casses
433  Int_t taille = 0;
434  for (Int_t ii = 1; ii < mtot_corr; ii += 1) {
435  taille = val[ii] - val[ii - 1];
436  //cout << "ii="<< ii <<" taille="<<taille<<endl;
437  size[ii - 1] += taille; //mise a jour des tailles des clusters
438  hzz->Fill(size[ii - 1]);
439  bound[val[ii]] = 1; //Reset du lien pour le prochain tirage
440  zc += size[ii - 1]; //incrementation de la taille totale de controle
441  }
442 
443  //cout << "zc="<<zc << " " << Ztotal << endl;
444  if (zc == Ztotal && mtot_corr - 1 == Mtotal) return 1;
445  else return 0;
446 
447 }
448 
449 
450 
455 
457 {
458  //Methode de cassure
459 
460  //Conditions de depart
461  // Mtotal clusters de taille minimale Zmin
462  for (Int_t mm = 0; mm < Mtotal; mm += 1) {
463  size[mm] = Zmin;
464  }
465  //On initilise la taille a Zmin
466  //Le tirage aleatoire se fait
467  //sur la taille restante Ztotal_corr
468  Int_t Ztotal_corr = Ztotal - (Zmin) * Mtotal;
469 
470  Double_t val[Mtotal], sum_val = 0;
471  for (Int_t mm = 0; mm < Mtotal; mm += 1) {
472  //Tirage des Mtotal valeurs entre [0; 1[
473  val[mm] = alea->Uniform(0, 1);
474  sum_val += val[mm];
475  }
476  Int_t zc = 0;
477  Int_t surplus[Mtotal];
478  //normalisation a une charge totale de Ztotal_corr
479  for (Int_t mm = 0; mm < Mtotal; mm += 1) {
480  surplus[mm] = TMath::Nint(val[mm] * Ztotal_corr / sum_val);
481  zc += surplus[mm];
482  }
483  //Test effets spurieux pasage reel -> entier
484  //Redistribution eventuelle de charge manquante ou en exces
485  if (zc != Ztotal_corr) {
486  Int_t diff = Ztotal_corr - zc;
487  nraffine += 1;
488  Int_t bb = 0;
489  if (diff > 0) {
490  for (Int_t mm = 0; mm < TMath::Abs(diff); mm += 1) {
491  bb = TMath::Nint(alea->Uniform(0, (Mtotal) - 0.5));
492  surplus[bb] += 1;
493  }
494  }
495  else {
496  for (Int_t mm = 0; mm < TMath::Abs(diff); mm += 1) {
497  bb = TMath::Nint(alea->Uniform(0, (Mtotal) - 0.5));
498  if (surplus[bb] > 0)
499  surplus[bb] -= 1;
500  else
501  mm -= 1;
502  }
503  }
504  }
505  zc = 0;
506  for (Int_t mm = 0; mm < Mtotal; mm += 1) {
507  size[mm] += surplus[mm];
508  zc += size[mm];
509  hzz->Fill(size[mm]);
510  }
511 
512  if (zc == Ztotal) return 1;
513  else return 0;
514 
515 }
516 
517 
518 
521 
523 {
524  //Methode de cassure
525  Int_t bb = 0;
526 
527  for (Int_t mm = 0; mm < Mtotal; mm += 1) {
528  size[mm] = Zmin;
529  }
530  //on distribue aleatoirement les charges
531  //disponibles une par une sur les differents fragments
532  for (Int_t mm = 0; mm < nbre_nuc; mm += 1) {
533  bb = TMath::Nint(alea->Uniform(0, (Mtotal) - 0.5));
534  size[bb] += 1;
535  }
536 
537  Int_t mc = 0, zc = 0;
538  for (Int_t mm = 0; mm < Mtotal; mm += 1) {
539  Int_t taille = size[mm];
540  hzz->Fill(taille);
541  mc += 1;
542  zc += taille;
543  }
544  if (mc == Mtotal && zc == Ztotal) return 1;
545  else return 0;
546 
547 
548 }
549 
550 
551 
559 
561 {
562  //Remplissage des histogrammes predefinis
563  //A redefinir si besoin dans les classes filles
564  //
565  //Enregistrement de la partition (si demande, via StorePartitions(kTRUE) par defaut)
566  //Si une partition identique est deja presente, on incremente sa population
567  //sinon on enregistre celle-ci, voir KVPartitionList
568  hmt->Fill(Mtotal);
569  hzt->Fill(Ztotal);
570 
571 
572  partition = new KVIntegerList();
573  partition->Fill(size, Mtotal);
574  Int_t* tab = partition->CreateTableOfValues();
575 
576  current_event->Clear();
577  for (Int_t ii = 0; ii < Mtotal; ii += 1)
578  current_event->AddParticle()->SetZ(tab[ii]);
579 
580  delete [] tab;
581 
582  if (TestBit(kStorePartitions)) {
583  if (Fill(partition))
584  delete partition;
585  }
586  else {
587  delete partition;
588  }
589 }
590 
591 
592 
593 
595 
597 {
598 
599  return current_event;
600 
601 }
602 
603 
604 
612 
614 {
615  //On realise times fois la cassure
616  //suivant les conditions definis vis la methode SetConditions et DefineBreakUpMethod
617  //Plusieurs series de cassures peuvent etre ainsi realise
618  //
619  //Si l utilisateur veut changer de conditions et ne pas melanger les partitions
620  //il faut appeler la methode Clear()
621 
622  Start();
623 
624  TMethodCall meth;
625  meth.InitWithPrototype(this->IsA(), BreakUpMethod.Data(), "");
626  Long_t ret;
627  if (meth.IsValid() && meth.ReturnType() == TMethodCall::kLong) {
628  for (Int_t nn = 0; nn < times; nn += 1) {
629  if (nn % 10000 == 0) Info("BreakNtimes", "%d partitions generees sur %d", nn, times);
630  meth.Execute(this, "", ret);
631  if (ret == 1)
632  TreatePartition();
633  else {
634  Info("BreakNtimes", "%s retourne %ld", BreakUpMethod.Data(), ret);
635  nn -= 1;
636  }
637  }
638  }
639  Info("BreakNtimes", "Tirage termine");
640  niter_tot += times;
641 
642  Stop();
643  Info("BreakNtimes", "Temps ecoule en secondes : %d", GetDeltaTime());
644 
645 }
646 
647 
648 
659 
660 void KVBreakUp::BreakNtimesOnGaussian(Int_t times, Double_t Ztot_moy, Double_t Ztot_rms, Double_t Mtot_moy, Double_t Mtot_rms, Int_t zmin)
661 {
662  //On realise times fois la cassure sur une double gaussienne
663  //la methode SetCondition n'a ici aucune influence
664  //les valeurs ztot et mtot sont tirees aleatoirement sur une gaussienne
665  //a chaque iteration
666  //
667  //Plusieurs series de cassures peuvent etre ainsi realise
668  //
669  //Si l utilisateur veut changer de conditions et ne pas melanger les partitions
670  //il faut appeler la methode Clear()
671 
672  Start();
673 
674  TMethodCall meth;
675  meth.InitWithPrototype(this->IsA(), BreakUpMethod.Data(), "");
676  Long_t ret;
677  TRandom3* gaus = new TRandom3();
678  if (meth.IsValid() && meth.ReturnType() == TMethodCall::kLong) {
679  for (Int_t nn = 0; nn < times; nn += 1) {
680  if (nn % 1000 == 0) printf("%d partitions generees sur %d\n", nn, times);
681 
682  Int_t zt = TMath::Nint(gaus->Gaus(Ztot_moy, Ztot_rms));
683  Int_t mt = TMath::Nint(gaus->Gaus(Mtot_moy, Mtot_rms));
684 
685  if (mt > 0 && zt > 0 && zt >= mt * zmin) {
686  SetConditions(zt, mt, zmin);
687  meth.Execute(this, "", ret);
688  if (ret == 1)
689  TreatePartition();
690  else {
691  //cout << BreakUpMethod << " retourne " << ret << endl;
692  }
693  }
694  else {
695  nn -= 1;
696  }
697  }
698  }
699  delete gaus;
700  niter_tot += times;
701 
702  Stop();
703  Info("BreakNtimesOnGaussian", "Temps ecoule en secondes : %d", GetDeltaTime());
704 
705 }
706 
707 
708 
716 
717 KVEvent* KVBreakUp::BreakOnGaussian(Double_t Ztot_moy, Double_t Ztot_rms, Double_t Mtot_moy, Double_t Mtot_rms, Int_t zmin)
718 {
719  //On realise la cassure sur une double gaussienne
720  //
721  //les valeurs ztot et mtot sont tirees aleatoirement sur une gaussienne
722  //
723  //Plusieurs series de cassures peuvent etre ainsi realise
724  //
725 
726  TMethodCall meth;
727  meth.InitWithPrototype(this->IsA(), BreakUpMethod.Data(), "");
728  Long_t ret;
729 
730  if (meth.IsValid() && meth.ReturnType() == TMethodCall::kLong) {
731  Int_t zt = -1;
732  Int_t mt = -1;
733  while (!(mt > 0 && zt > 0 && zt >= mt * zmin)) {
734  zt = TMath::Nint(alea->Gaus(Ztot_moy, Ztot_rms));
735  mt = TMath::Nint(alea->Gaus(Mtot_moy, Mtot_rms));
736  }
737 
738  SetConditions(zt, mt, zmin);
739  meth.Execute(this, "", ret);
740  if (ret == 1) {
741  TreatePartition();
742  return current_event;
743  }
744  else {
745  return 0;
746  }
747  }
748  return 0;
749 }
750 
751 
752 
766 
767 void KVBreakUp::BreakFromHisto(TH2F* hh_zt_VS_mt, Int_t zmin)
768 {
769  //On realise times fois la cassure suivant un histogramme a deux dimensions
770  //avec en definition :
771  // mtot -> axe X
772  // ztot -> axe Y
773  //la methode SetCondition n'a ici aucune influence
774  //les valeurs ztot et mtot sont tirees aleatoirement sur cette histogramme
775  //a chaque iteration
776  //
777  //Plusieurs series de cassures peuvent etre ainsi realise
778  //
779  //Si l utilisateur veut changer de conditions et ne pas melanger les partitions
780  //il faut appeler la methode Clear()
781 
782  TH2F* h2 = hh_zt_VS_mt;
783  if (!h2) return;
784 
785  Start();
786 
787  TMethodCall meth;
788  meth.InitWithPrototype(this->IsA(), BreakUpMethod.Data(), "");
789  Long_t ret;
790 
791  Int_t zt, mt;
792  Int_t stat_tot = Int_t(h2->Integral());
793  Int_t stat_par = 0;
794  for (Int_t nx = 1; nx <= h2->GetNbinsX(); nx += 1)
795  for (Int_t ny = 1; ny <= h2->GetNbinsY(); ny += 1) {
796  Int_t stat = TMath::Nint(h2->GetBinContent(nx, ny));
797  if (stat > 0) {
798  mt = TMath::Nint(h2->GetXaxis()->GetBinCenter(nx));
799  zt = TMath::Nint(h2->GetYaxis()->GetBinCenter(ny));
800  if (mt > 0 && zt > 0 && zt >= mt * zmin) {
801 
802  SetConditions(zt, mt, zmin);
803  for (Int_t nn = 0; nn < stat; nn += 1) {
804  meth.Execute(this, "", ret);
805  if (ret == 1)
806  TreatePartition();
807  stat_par += 1;
808  if (stat_par % 1000 == 0) printf("%d partitions generees sur %d\n", stat_par, stat_tot);
809  }
810  }
811  else {
812  cout << zt << " " << mt << endl;
813  }
814  }
815  }
816 
817  niter_tot += stat_par;
818 
819  Stop();
820  Info("BreakNtimesFromHisto", "Temps ecoule en secondes : %d", GetDeltaTime());
821 
822 }
823 
824 
825 
829 
831 {
832  //Retourne le nombre total d iterations
833  //depuis le dernier clear
834  return niter_tot;
835 
836 }
837 
838 
839 
844 
846 {
847  //Retourne la liste des histogrammes
848  //definis dans DefineHistos()
849  //si l utilisateur a utilise lhisto->Add(TObject * )
850  return lhisto;
851 
852 }
853 
854 
855 
858 
860 {
861  //Retourne la liste d'objects autres ...
862  return lobjects;
863 
864 }
865 
866 
867 
870 
872 {
873  //Comme c'est écrit
874  niter_tot = 0;
875 
876 }
877 
878 
879 
882 
884 {
885  //Met a zero le contenu des histogrammes
886  lhisto->Execute("Reset", "");
887 
888 }
889 
890 
891 
895 
897 {
898  //Trace les histos definis
899  //A redefinir si besoin dans les classes filles
900 
901  TCanvas* c1 = 0;
902  if (!(c1 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("BreakUp_Control"))) {
903 
904  c1 = new TCanvas("BreakUp_Control", "Control", 0, 0, 900, 900);
905  c1->Divide(2, 2, 0.001, 0.001, 10);
906  c1->cd(1);
907  if (hzz->GetEntries() > 0) gPad->SetLogy(1);
908  hzz->Draw();
909  c1->cd(2);
910  if (hzt->GetEntries() > 0) gPad->SetLogy(1);
911  hzt->Draw();
912  c1->cd(3);
913  if (hmt->GetEntries() > 0) gPad->SetLogy(1);
914  hmt->Draw();
915 
916  }
917 }
918 
919 
920 
931 
932 void KVBreakUp::SaveHistos(KVString filename, KVString suff, Option_t* option)
933 {
934  //Permet la sauvegarde des histogrammes
935  //dans un fichier (option est l'option classique de TFile::TFile())
936  //
937  //Si filename=="" (defaut) -> nom du fichier = "KVBreakUp_Ouput.root";
938  //Si suff=="" (defaut) -> definition d'un suffixe en utisant les arguments de SetConditions()
939  //Ce suffixe est ensuite utilise dans la redefinition des noms des histogrammes
940  //Exemple:
941  // nom de l'histogramme : histo -> histo_suff
942  //
943  if (filename == "") filename = "KVBreakUp_Ouput.root";
944  TFile* file = new TFile(filename.Data(), option);
945 
946  if (suff == "")
947  suff.Form("Zt%d_Mt%d_Zm%d_%s", GetZtot(), GetMtot(), GetZmin(), GetBreakUpMethod().Data());
948 
949  KVString snom;
950  for (Int_t nn = 0; nn < lhisto->GetEntries(); nn += 1) {
951  snom.Form("%s_%s", lhisto->At(nn)->GetName(), suff.Data());
952  lhisto->At(nn)->Write(snom.Data());
953  }
954  file->Close();
955 
956 }
957 
958 
959 
965 
967 {
968  // Comme c'est écrit
969  // Why not "Print(Option_t*)" ?
970  // - because TCollection has several 'virtual' Print methods which
971  // are overloaded (i.e. have different arguments): BAD!
972 
973  Info("Print", "Configuration for the break up");
974  printf(" Ztot=%d - Mtot=%d - Zmin=%d\n", GetZtot(), GetMtot(), GetZmin());
975  printf(" Charge to be distributed %d - Biggest possible charge %d\n", nbre_nuc, Zmin + nbre_nuc);
976  printf(" Methode de cassage aleatoire %s\n", GetBreakUpMethod().Data());
977  alea->Print();
978  printf(" Partition are stored via KVPartitionList : %d\n", Int_t(TestBit(kStorePartitions)));
979  printf("------------------------------------------------------");
980 }
981 
982 
983 
987 
989 {
990  //protected method
991  //Signal start
992  TDatime time;
993  tstart = time.GetHour() * 3600 + time.GetMinute() * 60 + time.GetSecond();
994 
995 }
996 
997 
998 
1002 
1004 {
1005  //protected method
1006  //Signal stop
1007  TDatime time;
1008  tstop = time.GetHour() * 3600 + time.GetMinute() * 60 + time.GetSecond();
1009  tellapsed = tstop - tstart;
1010 
1011 }
1012 
1013 
1014 
1018 
1020 {
1021  //Retoune le temps ecoules (en seconde)
1022  //entre un appel Start() et un appel Stop()
1023  return tellapsed;
1024 
1025 }
1026 
1027 
int Int_t
long Long_t
std::vector< Int_t > IntArray
Definition: KVNumberList.h:18
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
size_t size(const MatrixT &matrix)
bool Bool_t
double Double_t
const Bool_t kTRUE
const char Option_t
#define gROOT
#define gPad
Permet de casser aleatoirement un nombre entier (ztot) en un nombre (mtot) d'entiers plus petits d'un...
Definition: KVBreakUp.h:64
void BreakFromHisto(TH2F *hh_zt_VS_mt, Int_t zmin=1)
Definition: KVBreakUp.cpp:767
virtual void SaveHistos(KVString filename="", KVString suff="", Option_t *option="recreate")
Definition: KVBreakUp.cpp:932
Int_t GetTotalIterations(void)
Definition: KVBreakUp.cpp:830
Int_t GetDeltaTime()
Definition: KVBreakUp.cpp:1019
virtual void DrawPanel()
Definition: KVBreakUp.cpp:896
KVEvent * BreakOnGaussian(Double_t Ztot_moy, Double_t Ztot_rms, Double_t Mtot_moy, Double_t Mtot_rms, Int_t zmin)
Definition: KVBreakUp.cpp:717
virtual void ResetHistos()
Met a zero le contenu des histogrammes.
Definition: KVBreakUp.cpp:883
void DefineBreakUpMethod(KVString bup_method="")
Definition: KVBreakUp.cpp:243
virtual void TreatePartition()
Definition: KVBreakUp.cpp:560
Int_t GetZtot(void) const
Retourne le nombre entier a casser.
Definition: KVBreakUp.cpp:267
void Clear(Option_t *="")
Definition: KVBreakUp.cpp:101
Int_t BreakUsingChain()
Definition: KVBreakUp.cpp:329
Int_t BreakUsingLine()
Definition: KVBreakUp.cpp:392
KVHashList * GetObjects()
Retourne la liste d'objects autres ...
Definition: KVBreakUp.cpp:859
virtual ~KVBreakUp()
Destructeur.
Definition: KVBreakUp.cpp:78
void SetZmin(Int_t zlim)
Protected method.
Definition: KVBreakUp.cpp:170
KVString GetBreakUpMethod(void) const
Retourne methode de cassure.
Definition: KVBreakUp.cpp:303
Int_t BreakUsingPile()
Methode de cassure.
Definition: KVBreakUp.cpp:522
void Stop()
Definition: KVBreakUp.cpp:1003
Int_t BreakUsingIndividual()
Definition: KVBreakUp.cpp:456
void Start()
Definition: KVBreakUp.cpp:988
void StorePartitions(Bool_t choix=kTRUE)
si choix=kTRUE, on enregistre les partitions
Definition: KVBreakUp.cpp:315
void LinkEvent(KVEvent *)
Definition: KVBreakUp.cpp:195
void BreakNtimes(Int_t times=1000)
Definition: KVBreakUp.cpp:613
KVEvent * GetCurrentEvent()
Definition: KVBreakUp.cpp:596
void PrintConfig() const
Definition: KVBreakUp.cpp:966
void BreakNtimesOnGaussian(Int_t times, Double_t Ztot_moy, Double_t Ztot_rms, Double_t Mtot_moy, Double_t Mtot_rms, Int_t zmin=1)
Definition: KVBreakUp.cpp:660
KVBreakUp(Int_t taille_max=1000)
Definition: KVBreakUp.cpp:62
void SetZtot(Int_t zt)
Protected method.
Definition: KVBreakUp.cpp:136
Int_t GetZmin(void) const
Retourne la taille minimale des entiers apres cassure.
Definition: KVBreakUp.cpp:291
KVHashList * GetHistos()
Definition: KVBreakUp.cpp:845
void SetConditions(Int_t zt, Int_t mt, Int_t zmin=1)
Definition: KVBreakUp.cpp:228
void RedefineTRandom(KVString TRandom_Method)
Definition: KVBreakUp.cpp:210
virtual void ResetTotalIterations()
Comme c'est écrit.
Definition: KVBreakUp.cpp:871
Int_t GetMtot(void) const
Retourne le nombre d'entiers apres cassure (la multiplicite)
Definition: KVBreakUp.cpp:279
virtual void DefineHistos()
Definition: KVBreakUp.cpp:119
void SetMtot(Int_t mt)
Protected method.
Definition: KVBreakUp.cpp:154
void SetBreakUpMethod(KVString bup_method)
Protected method.
Definition: KVBreakUp.cpp:184
Base class container for multi-particle events.
Definition: KVEvent.h:176
Extended version of ROOT THashList.
Definition: KVHashList.h:28
Handle a list of positive integers (partition)
Definition: KVIntegerList.h:68
void Clear(Option_t *option="")
Mise a zero de la liste.
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
virtual Double_t GetBinCenter(Int_t bin) const
Int_t GetHour() const
Int_t GetSecond() const
Int_t GetMinute() const
virtual Int_t GetNbinsY() const
TAxis * GetXaxis()
TAxis * GetYaxis()
virtual Int_t GetNbinsX() const
virtual Double_t Integral(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Option_t *option="") const
virtual Double_t GetBinContent(Int_t bin) const
EReturnType ReturnType()
static const EReturnType kLong
void InitWithPrototype(const char *function, const char *proto, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Bool_t IsValid() const
void Execute()
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
const char * Data() const
void Form(const char *fmt,...)
return c1
const long double mm
Definition: KVUnits.h:69
const long double cl
Definition: KVUnits.h:85
void Info(const char *location, const char *va_(fmt),...)
void Error(const char *location, const char *va_(fmt),...)
Int_t Nint(T x)
Double_t Abs(Double_t d)