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