1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
|
#include "iostream.h"
#include "stdio.h"
#include "TH1F.h"
#include "iostream.h"
#include "TH2F.h"
#include "TAxis.h"
#include "fstream.h"
#include "TGraph.h"
#include "stdio.h"
#include "TGraphErrors.h"
#include "TMultiGraph.h"
#include "TLegend.h"
#include "TF1.h"
#include "TGraph.h"
#include "TMath.h"
#include "TCanvas.h"
#include "TVirtualFitter.h"
#include "THStack.h"
void CSBRs_processus() {
// Declaration de la structure even avec ses variables internes
struct event_t {
Double_t mass_DM_particle;
/*Double_t Mh1;
Double_t Mh2;
Double_t Mh3;*/
/*first file*/
Double_t first_CSBR;
Double_t second_CSBR;
Double_t third_CSBR;
Double_t fourth_CSBR;
Double_t fifth_CSBR;
Double_t sixth_CSBR;
Double_t seventh_CSBR;
Double_t eighth_CSBR;
/* Double_t nineth_CSBR;
Double_t tenth_CSBR;
Double_t eleventh_CSBR;
Double_t twelveth_CSBR;
Double_t thirteenth_CSBR;
Double_t fourteenth_CSBR;
Double_t fifteenth_CSBR;
Double_t sixteenth_CSBR;*/
};
// Declaration de variables additionnelles qui seront "plottées".
event_t event;
Double_t RATIOh1;
Double_t RATIOh2;
Double_t chi2h1G=0;
Double_t chi2h2G=0;
//Déclaration de la variable de lecture de ligne de fichier
Int_t i=0.;
//OUverture du fichier de données
FILE *fp_1=fopen("BRtimesCS_x2X2.txt","r");
char line[200];
// Declaration des histogrammes pour le scatterplot la structure est TH2F("string_name","",Nb_points_x,x_min,x_mx,Nb_points_y,y_min,y_max)
TH2F * CSBR_1 = new TH2F("CSBR_1","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_2 = new TH2F("CSBR_2","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_3 = new TH2F("CSBR_3","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_4 = new TH2F("CSBR_4","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_5 = new TH2F("CSBR_5","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_6 = new TH2F("CSBR_6","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_7 = new TH2F("CSBR_7","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_8 = new TH2F("CSBR_8","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_9 = new TH2F("CSBR_9","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_10 = new TH2F("CSBR_10","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_11 = new TH2F("CSBR_11","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_12 = new TH2F("CSBR_12","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_13 = new TH2F("CSBR_13","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_14 = new TH2F("CSBR_14","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_15 = new TH2F("CSBR_15","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_16 = new TH2F("CSBR_16","",6300,20,2100,6300,0.,1E-4);
TH2F * CSBR_17 = new TH2F("CSBR_17","",6300,20,2100,6300,0.,1E-4);
/*TH2F * BR_1 = new TH2F("BR_1","",6300,-1100,2100,6300,0.,1.1);
TH2F * BR_2 = new TH2F("BR_2","",6300,-1100,2100,6300,0.,1.1);
TH2F * BR_3 = new TH2F("BR_3","",6300,-1100,2100,6300,0.,1.1);
TH2F * BR_4 = new TH2F("BR_4","",6300,-1100,2100,6300,0.,1.1);
TH2F * BR_5 = new TH2F("BR_5","",6300,-1100,2100,6300,0.,1.1);
TH2F * BR_6 = new TH2F("BR_6","",6300,-1100,2100,6300,0.,1.1);*/
/*TH2F * BR_1 = new TH2F("BR_1","",5700,-10,2100,5700,0.,1.1);
TH2F * BR_2 = new TH2F("BR_2","",5700,-10,2100,5700,0.,1.1);
TH2F * BR_3 = new TH2F("BR_3","",5700,-10,2100,5700,0.,1.1);
TH2F * BR_4 = new TH2F("BR_4","",5700,-10,2100,5700,0.,1.1);*/
// Declaration des lignes horizontales du plot
TLine * l = new TLine(0.,0.,1.,0.);
TLine * l10 = new TLine(0.,10.,1.,10.);
TLine * l10m = new TLine(0.,-10.,1.,-10.);
TLine * l20m = new TLine(0.,-20.,1.,-20.);
TLine * l20 = new TLine(0.,20.,1.,20.);
TLine * l30m = new TLine(0.,-30.,1.,-30.);
TLine * l30 = new TLine(0.,30.,1.,30.);
TLine * l40m = new TLine(0.,-40.,1.,-40.);
TLine * l40 = new TLine(0.,40.,1.,40.);
//Lecture du fichier de données
while ((i<=100) &&((fscanf(fp_1,"%lf %le %le %le %le %le %le %le %le",&event.mass_DM_particle, &event.first_CSBR, &event.second_CSBR, &event.third_CSBR, &event.fourth_CSBR, &event.fifth_CSBR, &event.sixth_CSBR, &event.seventh_CSBR, &event.eighth_CSBR)>0)))
{
//Remplissage des histos
CSBR_1->Fill(event.mass_DM_particle,event.first_CSBR);
CSBR_2->Fill(event.mass_DM_particle,event.second_CSBR);
CSBR_3->Fill(event.mass_DM_particle,event.third_CSBR);
CSBR_4->Fill(event.mass_DM_particle,event.fourth_CSBR);
CSBR_5->Fill(event.mass_DM_particle,event.fifth_CSBR);
CSBR_6->Fill(event.mass_DM_particle,event.sixth_CSBR);
CSBR_7->Fill(event.mass_DM_particle,event.seventh_CSBR);
CSBR_8->Fill(event.mass_DM_particle,event.eighth_CSBR);
}
//std::cout << " chi2h1G fin = " << chi2h1G << std::endl;
//std::cout << " chi2h2G fin = " << chi2h2G << std::endl;
//Options d'affichage root
gROOT->SetStyle("Plain");
gStyle->SetOptStat(0000000);
gStyle->SetOptFit(0000);
gStyle->SetPalette(1);
//Fermeture fichier
fclose(fp_1);
//Création du canvas ou le scatterplot va être affiché
TCanvas * c1 = new TCanvas("c1","c1",1100,1320);
c1->ToggleToolBar();
c1->ToggleEditor();
//Options d'affichage
CSBR_1->SetMarkerStyle(26);
CSBR_1->SetMarkerColor(kRed);
CSBR_1->Draw();
CSBR_1->GetYaxis()->SetTitle("Cross section times Branching ratios for x2X2");
CSBR_1->GetXaxis()->SetTitle("Mass of x_{2}(in GeV)");
CSBR_1->GetYaxis()->CenterTitle(true);
CSBR_1->GetXaxis()->CenterTitle(true);
CSBR_2->SetMarkerStyle(20);
CSBR_2->SetMarkerColor(kBlue);
CSBR_2->Draw("same");
CSBR_3->SetMarkerStyle(21);
CSBR_3->SetMarkerColor(kGreen);
CSBR_3->Draw("same");
CSBR_4->SetMarkerStyle(22);
CSBR_4->SetMarkerColor(kBlack);
CSBR_4->Draw("same");
CSBR_5->SetMarkerStyle(23);
CSBR_5->SetMarkerColor(kViolet);
CSBR_5->Draw("same");
CSBR_6->SetMarkerStyle(24);
CSBR_6->SetMarkerColor(kPink);
CSBR_6->Draw("same");
CSBR_7->SetMarkerStyle(25);
CSBR_7->SetMarkerColor(kTeal);
CSBR_7->Draw("same");
CSBR_8->SetMarkerStyle(26);
CSBR_8->SetMarkerColor(kAzure);
CSBR_8->Draw("same");
CSBR_9->SetMarkerStyle(27);
CSBR_9->SetMarkerColor(kSpring);
CSBR_9->Draw("same");
l->SetLineStyle(3);
l10->SetLineStyle(3);
l10m->SetLineStyle(3);
l20->SetLineStyle(3);
l20m->SetLineStyle(3);
l30->SetLineStyle(3);
l30m->SetLineStyle(3);
l40->SetLineStyle(3);
l40m->SetLineStyle(3);
l->Draw("same");
l10->Draw("same");
l10m->Draw("same");
l20->Draw("same");
l20m->Draw("same");
l30->Draw("same");
l30m->Draw("same");
l40->Draw("same");
l40m->Draw("same");
//Déclaration et affichage de la légende
TLegend * legend = new TLegend(0.9,0.9,1.0,1.0);
legend->AddEntry(CSBR_1,"CSx2X2 BRZ0x1","p");
legend->AddEntry(CSBR_2,"CSx2X2 BRX1X1 ","p");
legend->AddEntry(CSBR_3,"CSx2X2 BRhx1","p");
legend->AddEntry(CSBR_4,"CSx2X2 BRW-H+ ","p");
legend->AddEntry(CSBR_5,"CSx2X2 BRZ0X1 ","p");
legend->AddEntry(CSBR_6,"CSx2X2 BRx1x1","p");
legend->AddEntry(CSBR_7,"CSx2X2 BRhX1","p");
legend->AddEntry(CSBR_8,"CSx2X2 BRW+H-","p");
legend->Draw();
/*libération de la mémoire*/
delete(CSBR_1);
delete(CSBR_2);
delete(CSBR_3);
delete(CSBR_4);
delete(CSBR_5);
delete(CSBR_6);
delete(CSBR_7);
delete(CSBR_8);
delete(CSBR_9);
delete(CSBR_10);
delete(CSBR_11);
delete(CSBR_12);
delete(CSBR_13);
delete(CSBR_14);
delete(CSBR_15);
delete(CSBR_16);
delete(CSBR_17);
delete(legend);
delete(c1);
delete(l);
delete(l10);
delete(l10m);
delete(l20);
delete(l20m);
delete(l30);
delete(l30m);
delete(l40);
delete(l40m);
} |
Partager