-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_SDJpsi_CMSTOTEM_v2.cc
2296 lines (2011 loc) · 149 KB
/
data_SDJpsi_CMSTOTEM_v2.cc
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//STANDARD ROOT INCLUDES
#include <TROOT.h>
#include <TH1.h>
#include <TH2.h>
#include <TF1.h>
#include <TProfile.h>
#include <TStyle.h>
#include <TCanvas.h>
#include <TTree.h>
#include <TFile.h>
#include <TChain.h>
#include <TChainElement.h>
#include <TDirectory.h>
#include <TSystemFile.h>
#include <TSystemDirectory.h>
//OUR OWN CLASSES TO READ THE TREE
#include "MassParticles.h"
#include "MyBaseJet.h"
#include "MyBeamSpot.h"
#include "MyCaloJet.h"
#include "MyCastorDigi.h"
#include "MyCastorJet.h"
#include "MyCastorRecHit.h"
#include "MyDiJet.h"
#include "MyElectron.h"
#include "MyEvtId.h"
#include "MyFwdGap.h"
#include "MyGenJet.h"
#include "MyGenKin.h"
#include "MyGenMet.h"
#include "MyGenPart.h"
#include "MyHLTrig.h"
#include "MyJet.h"
#include "MyL1Trig.h"
#include "MyL1TrigOld.h"
//#include "MyMITEvtSel.h"
#include "MyMet.h"
#include "MyMuon.h"
#include "MyPFCand.h"
#include "MyPFJet.h"
#include "MyPUSumInfo.h"
#include "MyPart.h"
#include "MySimVertex.h"
#include "MyTracks.h"
#include "MyVertex.h"
#include "MyFSCHit.h"
#include "MyFSCDigi.h"
// TOTEM data formats
#include "T1Event.h"
#include "T2Event.h"
#include "RPRootDumpReconstructedProton.h"
#include "RPRootDumpReconstructedProtonPair.h"
#include "RPRootDumpTrackInfo.h"
#include "RPRootDumpDigiInfo.h"
#include "RPRootDumpPatternInfo.h"
#include "analysis_tools.h"
//STANDARD C++ INCLUDES
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <fstream>
#define PI 3.141592653589793
#include "deltaPhi.h"
using namespace std;
void data_SDJpsi_CMSTOTEM_v2(vector<string> const& fileNames, string const& outputFileName = "dataSDJpsi_04June.root",const Double_t t_proton_down_=0.03, const Double_t t_proton_up_=1.0,const Int_t Bin_mass=200 ,const Int_t nevt_max = -1){
bool verbose = false;
string treeName = "cms_totem";
double ptMax = 9999.0;
double etaMaxThreshold = 2.0;
bool selectBunchCrossing = false;
bool selectVertex = true;
bool selectTrack = true;
bool selectMuons = true;
bool selectEtaMax = false;
bool selectEtaMin = false;
bool selectZeroHitsT2Plus = false;
bool selectZeroHitsT2Minus = false;
bool selectSingleArmRecProton = true;
bool selectDoubleArmRecProton = false;
bool selectElastic = false;
bool selectNonElastic = false;
bool signal_left = true;
bool signal_right = true;
const Int_t nevt_max_corr = (nevt_max >= 0) ? nevt_max : 99999999;
vector<string> selectHLTPathNames;
selectHLTPathNames.push_back("HLT_L1_DoubleMu0");
//selectHLTPathNames.push_back("HLT_ZeroBias_v7");
vector<string> hltPathNames;
hltPathNames.push_back("HLT_L1DoubleEG3_FwdVeto_v1");
hltPathNames.push_back("HLT_L1DoubleMu0_v1");
hltPathNames.push_back("HLT_L1DoubleJet20_RomanPotsOR_v1");
hltPathNames.push_back("HLT_L1DoubleJet20part1_v1");
hltPathNames.push_back("HLT_L1DoubleJet24_v1");
hltPathNames.push_back("HLT_L1DoubleJet20part2_v1");
hltPathNames.push_back("HLT_L1Tech40_BPTXAND_v1");
hltPathNames.push_back("HLT_L1Tech53_MB_1_v1");
hltPathNames.push_back("HLT_L1Tech_HF9OR10_v1");
hltPathNames.push_back("HLT_T1minbias_Tech55_v1");
hltPathNames.push_back("HLT_L1Tech53_MB_2_v1");
hltPathNames.push_back("HLT_L1Tech53_MB_3_v1");
hltPathNames.push_back("HLT_RomanPots_Tech52_v1");
hltPathNames.push_back("HLT_L1Tech54_ZeroBias_v1");
hltPathNames.push_back("HLT_ZeroBias_v7");
// Declaration of histograms
map<string,TH1F*> histosTH1F;
map<string,TH2F*> histosTH2F;
vector<string> selections;
selections.push_back("All");
selections.push_back("BunchCrossing");
selections.push_back("HLT");
selections.push_back("Vertex");
selections.push_back("Muons");
selections.push_back("EtaMax");
selections.push_back("EtaMin");
selections.push_back("ZeroHitsT2Plus");
selections.push_back("ZeroHitsT2Minus");
selections.push_back("SingleArmRP");
selections.push_back("DoubleArmRP");
selections.push_back("Elastic");
selections.push_back("NonElastic");
int nBinsEventSelection = selections.size();
histosTH1F["EventSelection"] = new TH1F("EventSelection","EventSelection",nBinsEventSelection,0,nBinsEventSelection);
for(size_t k = 0; k < selections.size(); ++k)
histosTH1F["EventSelection"]->GetXaxis()->SetBinLabel( (k + 1), selections[k].c_str() );
histosTH1F["bunchCrossingNumber"] = new TH1F("bunchCrossingNumber", "bunchCrossingNumber" , 3900 , 0 , 3900);
histosTH1F["decisionPhysTrig"] = new TH1F("decisionPhysTrig", "decisionPhysTrig" , 128 , 0 , 128);
histosTH1F["decisionTechTrig"] = new TH1F("decisionTechTrig", "decisionTechTrig" , 64 , 0 , 64);
int nBinsHLT = hltPathNames.size();
histosTH1F["hltTrigFired"] = new TH1F("hltTrigFired", "hltTrigFired" , nBinsHLT , 0 , nBinsHLT);
for(size_t k = 0; k < nBinsHLT; ++k)
histosTH1F["hltTrigFired"]->GetXaxis()->SetBinLabel( (k + 1) , hltPathNames[k].c_str() );
histosTH1F["vtx_zpos"] = new TH1F("vtx_zpos", "z(vtx)" , 150 , -30. , 30.);
histosTH1F["vtx_xpos"] = new TH1F("vtx_xpos", "x(vtx)" , 150 , -1.5 , 1.5);
histosTH1F["vtx_ypos"] = new TH1F("vtx_ypos", "y(vtx)" , 150 , -1.5 , 1.5);
histosTH1F["vtx_ndof"] = new TH1F("vtx_ndof", "ndof(vtx)" , 100 , 0. , 15.);
histosTH1F["vtx_chi2"] = new TH1F("vtx_chi2", "chi2(vtx)" , 100 , 0. , 10.);
histosTH1F["vertex_multiplicity"] = new TH1F("vertex_multiplicity", "n vertices" , 30 , 0 , 30);
histosTH1F["vertex_multiplicity_after_vtx_sel"] = new TH1F("vertex_multiplicity_after_vtx_sel", "n vertices after vtx sel" , 30 , 0 , 30);
histosTH1F["prim_vtx_zpos"] = new TH1F("prim_vtx_zpos", "z(vtx)" , 150 , -30. , 30.);
histosTH1F["prim_vtx_xpos"] = new TH1F("prim_vtx_xpos", "x(vtx)" , 150 , -1.5 , 1.5);
histosTH1F["prim_vtx_ypos"] = new TH1F("prim_vtx_ypos", "y(vtx)" , 150 , -1.5 , 1.5);
histosTH1F["prim_vtx_ndof"] = new TH1F("prim_vtx_ndof", "ndof(vtx)" , 100 , 0. , 15.);
histosTH1F["prim_vtx_chi2"] = new TH1F("prim_vtx_chi2", "chi2(vtx)" , 100 , 0. , 10.);
histosTH1F["prim_vtx_chi2n"] = new TH1F("prim_vtx_chi2n", "chi2n(vtx)" , 100 , 0. , 10.);
histosTH1F["prim_vtx_ntracks"] = new TH1F("prim_vtx_ntracks", "n_{trk}(vtx)" , 30 , 0 , 30);
histosTH1F["prim_vtx_sumpt"] = new TH1F("prim_vtx_sumpt", "sum(p_{T})(vtx)" , 100 , 0. , 100.);
histosTH1F["prim_vtx_zpos_after_vtx_sel"] = new TH1F("prim_vtx_zpos_after_vtx_sel", "z(vtx)" , 150 , -30. , 30.);
histosTH1F["prim_vtx_xpos_after_vtx_sel"] = new TH1F("prim_vtx_xpos_after_vtx_sel", "x(vtx)" , 150 , -1.5 , 1.5);
histosTH1F["prim_vtx_ypos_after_vtx_sel"] = new TH1F("prim_vtx_ypos_after_vtx_sel", "y(vtx)" , 150 , -1.5 , 1.5);
histosTH1F["prim_vtx_ndof_after_vtx_sel"] = new TH1F("prim_vtx_ndof_after_vtx_sel", "ndof(vtx)" , 100 , 0. , 15.);
histosTH1F["prim_vtx_chi2_after_vtx_sel"] = new TH1F("prim_vtx_chi2_after_vtx_sel", "chi2(vtx)" , 100 , 0. , 10.);
histosTH1F["prim_vtx_chi2n_after_vtx_sel"] = new TH1F("prim_vtx_chi2n_after_vtx_sel", "chi2n(vtx)" , 100 , 0. , 10.);
histosTH1F["prim_vtx_ntracks_after_vtx_sel"] = new TH1F("prim_vtx_ntracks_after_vtx_sel", "n_{trk}(vtx)" , 30 , 0 , 30);
histosTH1F["prim_vtx_sumpt_after_vtx_sel"] = new TH1F("prim_vtx_sumpt_after_vtx_sel", "sum(p_{T})(vtx)" , 100 , 0. , 100.);
//histosTH1F["pt_gen"] = new TH1F("pt_gen" , "pt_gen;pt;nTracks" , 120 , 0 , 6);
histosTH1F["track_pt"] = new TH1F("track_pt", "p_{T}(trk)" , 150 , 0. , 15.);
histosTH1F["track_eta"] = new TH1F("track_eta", "#eta(trk)" , 200 , -5.2 , 5.2);
histosTH1F["track_phi"] = new TH1F("track_phi", "#phi(trk)" , 200 , -M_PI , M_PI);
histosTH1F["track_rapidity"] = new TH1F("track_rapidity", "#rapidity(trk)" , 100 , -5.2 , 5.2);
histosTH1F["track_multiplicity"] = new TH1F("track_multiplicity", "n tracks" , 100 , 0 , 100);
histosTH1F["muon_pt"] = new TH1F("muon_pt", "p_{T}(muon)" , 100 , 0. , 100.);
histosTH1F["muon_eta"] = new TH1F("muon_eta", "#eta(muon)" , 100 , -5.2 , 5.2);
histosTH1F["muon_phi"] = new TH1F("muon_phi", "#phi(muon)" , 100 , -1.2*M_PI , 1.2*M_PI);
histosTH1F["muon_multiplicity"] = new TH1F("muon_multiplicity", "n muons" , 100 , 0 , 100);
//Muon1 info
histosTH1F["muon1_pt"] = new TH1F("muon1_pt", "p_{T}(mu1)" , 100 , 0. , 100.);
histosTH1F["muon1_eta"] = new TH1F("muon1_eta", "#eta(mu1)" , 100 , -5.2 , 5.2);
histosTH1F["muon1_phi"] = new TH1F("muon1_phi", "#phi(muon1)" , 100 , -1.2*M_PI ,1.2*M_PI);
histosTH1F["muon1_rapidity"] = new TH1F("muon1_rapidity", "y(mu1)" , 100 , -15. , 15.);
//Muon2 info
histosTH1F["muon2_pt"] = new TH1F("muon2_pt", "p_{T}(mu2)" , 100 , 0. , 100.);
histosTH1F["muon2_eta"] = new TH1F("muon2_eta", "#eta(mu2)" , 100 , -5.2 , 5.2);
histosTH1F["muon2_phi"] = new TH1F("muon2_phi", "#phi(muon2)" , 100 , -1.2*M_PI ,1.2*M_PI);
histosTH1F["muon2_rapidity"] = new TH1F("muon2_rapidity", "y(mu2)" , 100 , -15. , 15.);
//Deltas info
histosTH1F["muonDeltaPt"] = new TH1F("muonDeltaPt", "#Deltap_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["muonDeltaEta"] = new TH1F("muonDeltaEta", "#Delta#eta(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["muonDeltaPhi"] = new TH1F("muonDeltaPhi", "#Delta#phi(mu1,mu2)" , 100 , -2.2*M_PI , 2.2*M_PI);
histosTH1F["muonDeltaY"] = new TH1F("muonDeltaY", "#Deltay(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["lorentzdphi"] = new TH1F("lorentzDPhi", "#Delta#phi(mu1,mu2)" , 100 , -2.2*M_PI , 2.2*M_PI);
//Dimuon
histosTH1F["dimuon_mass"] = new TH1F("dimuon_mass", "mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["proton_right_dimuon_mass"] = new TH1F("proton_right_dimuon_mass", "mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["proton_left_dimuon_mass"] = new TH1F("proton_left_dimuon_mass", "mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["dimuon_pt2"] = new TH1F("dimuon_pt2", "p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["dimuon_pt"] = new TH1F("dimuon_pt", "p_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["dimuon_eta"] = new TH1F("dimuon_eta", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["dimuon_rapidity"] = new TH1F("dimuon_rapidity", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["dimuon_multiplicity"] = new TH1F("dimuon_multiplicity", "n dimuons" , 100 , 0 , 100);
//jpsi mass selection
histosTH1F["jpsi_mass"] = new TH1F("jpsi_mass", "jpsi_mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["jpsi_pt"] = new TH1F("jpsi_pt", "jpsi p_{T}(mu1,mu2)" , 100 , 0. , 20.);
histosTH1F["jpsi_pt2"] = new TH1F("jpsi_pt2", "jpsi p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["jpsi_eta"] = new TH1F("jpsi_eta", "jpsi #eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["jpsi_rapidity"] = new TH1F("jpsi_rapidity", "jpsi y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["jpsi_multiplicity"] = new TH1F("jpsi_multiplicity", "n jpsi(dimuons)" , 100 , 0 , 100);
//Deltas info
histosTH1F["muonDeltaPt_jpsi"] = new TH1F("muonDeltaPt_jpsi", "#Deltap_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["muonDeltaEta_jpsi"] = new TH1F("muonDeltaEta_jpsi", "#Delta#eta(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["muonDeltaPhi_jpsi"] = new TH1F("muonDeltaPhi_jpsi", "#Delta#phi(mu1,mu2)" , 100 , -2.2*M_PI , 2.2*M_PI);
histosTH1F["muonDeltaY_jpsi"] = new TH1F("muonDeltaY_jpsi", "#Deltay(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["lorentzdphi_jpsi"] = new TH1F("lorentzDPhi_jpsi", "#Delta#phi(mu1,mu2)" , 100 , -2.2*M_PI , 2.2*M_PI);
histosTH1F["Eta_max"] = new TH1F("Eta_max", "#eta^{max}" , 82 , etaBinsHCALBoundaries);
histosTH1F["Eta_min"] = new TH1F("Eta_min", "#eta^{min}" , 82 , etaBinsHCALBoundaries);
histosTH1F["Delta_eta_maxmin"] = new TH1F("Delta_eta_maxmin", "#eta^{max} - #eta^{min}" , 20 , 0,11);
histosTH1F["xi_plus_Reco"] = new TH1F("xi_plus", "#xi^{+}" , 20 , 0,1);
histosTH1F["xi_minus_Reco"] = new TH1F("xi_minus", "#xi^{-}" , 20 , 0,1);
histosTH1F["log_xi_plus_Reco"] = new TH1F("log_xi_plus", "Log #xi^{+}" , 20 , -3,0.5);
histosTH1F["log_x_plus"] = new TH1F("log_x_plus", "Log x^{+}" , 20 , -4, 0);
histosTH1F["log_x_minus"] = new TH1F("log_x_minus", "Log x^{-}" , 20 , -4, 0);
histosTH1F["fscHit_energy"] = new TH1F("fscHit_energy", "FSC hit energy" , 150 , -100. , 200.);
histosTH1F["fscHit_time"] = new TH1F("fscHit_time", "FSC hit time" , 150 , 0. , 300.);
histosTH1F["t2_track_chi2Prob_zplus"] = new TH1F("t2_track_chi2Prob_zplus", "#chi^{2}" , 100 , 0. , 1.);
histosTH1F["t2_track_entryX_zplus"] = new TH1F("t2_track_entryX_zplus", "x_{trk}" , 160 , -160. , 160.);
histosTH1F["t2_track_entryY_zplus"] = new TH1F("t2_track_entryY_zplus", "y_{trk}" , 160 , -160. , 160.);
histosTH1F["t2_track_multiplicity_zplus"] = new TH1F("t2_track_multiplicity_zplus", "n tracks" , 100 , 0 , 100);
histosTH1F["t2_track_chi2Prob_zminus"] = new TH1F("t2_track_chi2Prob_zminus", "#chi^{2}" , 100 , 0. , 1.);
histosTH1F["t2_track_entryX_zminus"] = new TH1F("t2_track_entryX_zminus", "x_{trk}" , 160 , -160. , 160.);
histosTH1F["t2_track_entryY_zminus"] = new TH1F("t2_track_entryY_zminus", "y_{trk}" , 160 , -160. , 160.);
histosTH1F["t2_track_multiplicity_zminus"] = new TH1F("t2_track_multiplicity_zminus", "n tracks" , 100 , 0 , 100);
////// Dimuon + RP
histosTH1F["dimuon_proton_right_xi"] = new TH1F("dimuon_proton_right_xi", "#xi" , 200,-1. ,1. );
histosTH1F["dimuon_proton_right_t"] = new TH1F("dimuon_proton_right_t", "-t" , 100 , 0.,5.);
histosTH1F["muonDeltaPt_proton_right"] = new TH1F("muonDeltaPt_proton_right", "#Deltap_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["muonDeltaEta_proton_right"] = new TH1F("muonDeltaEta_proton_right", "#Delta#eta(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["muonDeltaPhi_proton_right"] = new TH1F("muonDeltaPhi_proton_right", "#Delta#phi(mu1,mu2)" , 100 , -2.2*M_PI , 2.2*M_PI);
histosTH1F["muonDeltaY_proton_right"] = new TH1F("muonDeltaY_proton_right", "#Deltay(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["dimuon_mass_proton_right"] = new TH1F("dimuon_mass_proton_right", "mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["dimuon_pt2_proton_right"] = new TH1F("dimuon_pt2_proton_right", "p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["dimuon_pt_proton_right"] = new TH1F("dimuon_pt_proton_right", "p_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["dimuon_eta_proton_right"] = new TH1F("dimuon_eta_proton_right", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["dimuon_rapidity_proton_right"] = new TH1F("dimuon_rapidity_proton_right", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["dimuon_multiplicity_proton_right"] = new TH1F("dimuon_multiplicity_proton_right", "n dimuons" , 100 , 0 , 100);
//_t_cut_proton_right
//Float_t tbins_matrix[34] = { 0.0144, 0.0256, 0.04, 0.0576, 0.0784, 0.1024, 0.1296, 0.16, 0.1936, 0.2304, 0.2704, 0.3136, 0.36, 0.4096, 0.4624, 0.5184, 0.5778, 0.64, 0.7056, 0.7744, 0.8464, 0.9216, 1., 1.0816, 1.1664, 1.2544, 1.3456, 1.44, 1.5376, 1.6384, 1.7424, 1.8496, 1.96, 2.0736};
histosTH1F["dimuon_mass_t_cut_proton_right"] = new TH1F("dimuon_mass_t_cut_proton_right", "mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["dimuon_pt2_t_cut_proton_right"] = new TH1F("dimuon_pt2_t_cut_proton_right", "p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["dimuon_pt_t_cut_proton_right"] = new TH1F("dimuon_pt_t_cut_proton_right", "p_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["dimuon_eta_t_cut_proton_right"] = new TH1F("dimuon_eta_t_cut_proton_right", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["dimuon_rapidity_t_cut_proton_right"] = new TH1F("dimuon_rapidity_t_cut_proton_right", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["dimuon_multiplicity_t_cut_proton_right"] = new TH1F("dimuon_multiplicity_t_cut_proton_right", "n dimuons" , 100 , 0 , 100);
histosTH1F["proton_right_xi_t_cut"] = new TH1F("proton_right_xi_t_selected", "#xi" , 200, -1.0 ,1.0);
histosTH1F["proton_right_t_t_cut"] = new TH1F("proton_right_t_t_selected", "-t" , 100, 0., 5.0);
//Deltas info
histosTH1F["muonDeltaPt_t_cut_proton_right"] = new TH1F("muonDeltaPt_t_cut_proton_right", "#Deltap_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["muonDeltaEta_t_cut_proton_right"] = new TH1F("muonDeltaEta_t_cut_proton_right", "#Delta#eta(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["muonDeltaPhi_t_cut_proton_right"] = new TH1F("muonDeltaPhi_t_cut_proton_right", "#Delta#phi(mu1,mu2)" , 100 ,-2.2*M_PI , 2.2*M_PI);
histosTH1F["muonDeltaY_t_cut_proton_right"] = new TH1F("muonDeltaY_t_cut_proton_right", "#Deltay(mu1,mu2)" , 100 , 0. , 10.);
//histosTH2F["DeltaPhi_vs_dimuon_pt_rpminus_accept"] = new TH2F("DeltaPhi_vs_dimuon_pt_rpminus_accept", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["dimuon_y_vs_dimuon_pt_t_cut_proton_right"] = new TH2F("dimuon_y_vs_dimuon_pt_t_cut_proton_right", "y(mu1,mu2) vs pT" , 100 , -15. , 15.,100 , 0. , 100.);
histosTH2F["dimuon_y_vs_dimuon_pt_t_cut_proton_left"] = new TH2F("dimuon_y_vs_dimuon_pt_t_cut_proton_left", "y(mu1,mu2) vs pT" , 100 , -15. , 15.,100 , 0. , 100.);
histosTH2F["jpsi_y_vs_pt_t_cut_proton_right"] = new TH2F("jpsi_y_vs_pt_t_cut_proton_right", "y(mu1,mu2) vs pT" , 100 , -15. , 15.,100 , 0. , 100.);
histosTH2F["jpsi_y_vs_pt_t_cut_proton_left"] = new TH2F("jpsi_y_vs_pt_t_cut_proton_left", "y(mu1,mu2) vs pT" , 100 , -15. , 15.,100 , 0. , 100.);
//dimuon_proton_left
histosTH1F["dimuon_proton_left_xi"] = new TH1F("dimuon_proton_left_xi", "#xi" , 200, -1.,1.);
histosTH1F["dimuon_proton_left_t"] = new TH1F("dimuon_proton_left_t", "-t" , 100, 0., 5.);
//////////
//proton_right
histosTH1F["jpsi_proton_right_xi"] = new TH1F("jpsi_proton_right_xi", "#xi" ,200, -1., 1.);
histosTH1F["jpsi_proton_right_t"] = new TH1F("jpsi_proton_right_t", "-t" , 100, 0.,5.);
histosTH1F["jpsi_mass_proton_right"] = new TH1F("jpsi_mass_proton_right", "jpsi_mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["jpsi_pt_proton_right"] = new TH1F("jpsi_pt_proton_right", "jpsi p_{T}(mu1,mu2)" , 100 , 0. , 20.);
histosTH1F["jpsi_pt2_proton_right"] = new TH1F("jpsi_pt2_proton_right", "jpsi p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["jpsi_eta_proton_right"] = new TH1F("jpsi_eta_proton_right", "jpsi #eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["jpsi_rapidity_proton_right"] = new TH1F("jpsi_rapidity_proton_right", "jpsi y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["jpsi_multiplicity_proton_right"] = new TH1F("jpsi_multiplicity_proton_right", "n jpsi(dimuons)" , 100 , 0 , 100);
//Deltas info
histosTH1F["muonDeltaPt_jpsi_proton_right"] = new TH1F("muonDeltaPt_jpsi_proton_right", "#Deltap_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["muonDeltaEta_jpsi_proton_right"] = new TH1F("muonDeltaEta_jpsi_proton_right", "#Delta#eta(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["muonDeltaPhi_jpsi_proton_right"] = new TH1F("muonDeltaPhi_jpsi_proton_right", "#Delta#phi(mu1,mu2)" , 100 , -2.2*M_PI , 2.2*M_PI);
histosTH1F["muonDeltaY_jpsi_proton_right"] = new TH1F("muonDeltaY_jpsi_proton_right", "#Deltay(mu1,mu2)" , 100 , 0. , 10.);
//proton_left
histosTH1F["jpsi_proton_left_xi"] = new TH1F("jpsi_proton_left_xi", "#xi" , 200, -1.,1. );
histosTH1F["jpsi_proton_left_t"] = new TH1F("jpsi_proton_left_t", "-t" , 100, 0.,5.);
histosTH1F["jpsi_mass_proton_left"] = new TH1F("jpsi_mass_proton_left", "jpsi_mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["jpsi_pt_proton_left"] = new TH1F("jpsi_pt_proton_left", "jpsi p_{T}(mu1,mu2)" , 100 , 0. , 20.);
histosTH1F["jpsi_pt2_proton_left"] = new TH1F("jpsi_pt2_proton_left", "jpsi p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["jpsi_eta_proton_left"] = new TH1F("jpsi_eta_proton_left", "jpsi #eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["jpsi_rapidity_proton_left"] = new TH1F("jpsi_rapidity_proton_left", "jpsi y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["jpsi_multiplicity_proton_left"] = new TH1F("jpsi_multiplicity_proton_left", "n jpsi(dimuons)" , 100 , 0 , 100);
//Deltas info
histosTH1F["muonDeltaPt_jpsi_proton_left"] = new TH1F("muonDeltaPt_jpsi_proton_left", "#Deltap_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["muonDeltaEta_jpsi_proton_left"] = new TH1F("muonDeltaEta_jpsi_proton_left", "#Delta#eta(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["muonDeltaPhi_jpsi_proton_left"] = new TH1F("muonDeltaPhi_jpsi_proton_left", "#Delta#phi(mu1,mu2)" , 100 ,-2.2*M_PI , 2.2*M_PI);
histosTH1F["muonDeltaY_jpsi_proton_left"] = new TH1F("muonDeltaY_jpsi_proton_left", "#Deltay(mu1,mu2)" , 100 , 0. , 10.);
//_t_cut_proton_right
histosTH1F["jpsi_dimuon_mass_t_cut_proton_right"] = new TH1F("jpsi_dimuon_mass_t_cut_proton_right", "jpsi_mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["jpsi_dimuon_pt_t_cut_proton_right"] = new TH1F("jpsi_dimuon_pt_t_cut_proton_right", "p_{T}(mu1,mu2)" , 100 , 0. , 20.);
histosTH1F["jpsi_dimuon_pt2_t_cut_proton_right"] = new TH1F("jpsi_dimuon_pt2_t_cut_proton_right", "p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["jpsi_dimuon_eta_t_cut_proton_right"] = new TH1F("jpsi_dimuon_eta_t_cut_proton_right", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["jpsi_dimuon_rapidity_t_cut_proton_right"] = new TH1F("jpsi_dimuon_rapidity_t_cut_proton_right", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["jpsi_dimuon_multiplicity_t_cut_proton_right"] = new TH1F("jpsi_dimuon_multiplicity_t_cut_proton_right", "n dimuons" , 100 , 0 , 20);
histosTH1F["muonDeltaPt_jpsi_t_cut_proton_right"] = new TH1F("muonDeltaPt_jpsi_t_cut_proton_right", "#Deltap_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["muonDeltaEta_jpsi_t_cut_proton_right"] = new TH1F("muonDeltaEta_jpsi_t_cut_proton_right", "#Delta#eta(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["muonDeltaPhi_jpsi_t_cut_proton_right"] = new TH1F("muonDeltaPhi_jpsi_t_cut_proton_right", "#Delta#phi(mu1,mu2)" , 100 , -2.2*M_PI , 2.2*M_PI);
histosTH1F["muonDeltaY_jpsi_t_cut_proton_right"] = new TH1F("muonDeltaY_jpsi_t_cut_proton_right", "#Deltay(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["jpsi_proton_right_xi_t_cut"] = new TH1F("jpsi_proton_right_xi_t_selected", "#xi" , 200, -1.,1.);
histosTH1F["jpsi_proton_right_t_t_cut"] = new TH1F("jpsi_proton_right_t_t_selected", "-t" , 100, 0.,5.);
histosTH1F["jpsipfxiMinus_minus_proton_right_xi_t_cut"] = new TH1F("jpsipfxiMinus_minus_proton_right_xi_t_cut", "#xi diff." , 200 , -1. , 1.);
histosTH1F["jpsiproton_t_cut_right_xi_cut"] = new TH1F("jpsiproton_t_cut_right_xi_cut", "#xi" , 200 , -1. , 1.);
Float_t tbins[13] = {0.0, 0.03, 0.06, 0.09, 0.12, 0.15, 0.18, 0.22, 0.30, 0.40, 0.50, 0.65, 1.};
float xbins = 50;
float bin2 = 20;
histosTH1F["jpsi_Eta_max_t_cut_proton_right"]= new TH1F("Jpsi_Eta_max_t_cut_proton_right", "#eta^{max}" , 82 , etaBinsHCALBoundaries);
histosTH1F["jpsi_Eta_min_t_cut_proton_right"]= new TH1F("Jpsi_Eta_min_t_cut_proton_right", "#eta^{min}" , 82 , etaBinsHCALBoundaries);
histosTH1F["jpsiproton_right_t_true"] = new TH1F("jpsiproton_right_t_true", "-t" ,12, tbins);
histosTH1F["jpsihalo_right"] = new TH1F("jpsihalo_right", "-t halo" ,12, tbins);
histosTH1F["jpsiproton_right_t_signal"] = new TH1F("jpsiproton_right_t_signal", "-t" ,12, tbins);
histosTH1F["jpsiproton_right_t_halo"] = new TH1F("jpsiproton_right_t_halo", "-t" ,12, tbins);
histosTH1F["jpsi_dimuon_xi_halo_right"] = new TH1F("jpsi_dimuon_xi_halo_right", "#xi" , 200, -1.,1.);
histosTH1F["jpsi_dimuon_t_halo_right"] = new TH1F("jpsi_dimuon_t_halo_right", "-t" , 100, 0.,5.);
histosTH1F["jpsi_dimuon_xi_true_right"] = new TH1F("jpsi_dimuon_xi_true_right", "#xi" , 200, -1.,1.);
histosTH1F["jpsi_dimuon_t_true_right"] = new TH1F("jpsi_dimuon_t_true_right", "-t" , 100, 0.,5.);
histosTH1F["jpsi_dimuon_mass_halo_right"] = new TH1F("jpsi_dimuon_mass_halo_right", "jpsi_mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["jpsi_dimuon_mass_true_right"] = new TH1F("jpsi_dimuon_mass_true_right", "jpsi_mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["jpsi_dimuon_pt_halo_right"] = new TH1F("jpsi_dimuon_pt_halo_right", "p_{T}(mu1,mu2)" , 100 , 0. , 20.);
histosTH1F["jpsi_dimuon_pt_true_right"] = new TH1F("jpsi_dimuon_pt_true_right", "p_{T}(mu1,mu2)" , 100 , 0. , 20.);
histosTH1F["jpsi_dimuon_eta_halo_right"] = new TH1F("jpsi_dimuon_eta_halo_right", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["jpsi_dimuon_eta_true_right"] = new TH1F("jpsi_dimuon_eta_true_right", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["jpsi_dimuon_rapidity_halo_right"] = new TH1F("jpsi_dimuon_rapidity_halo_right", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["jpsi_dimuon_rapidity_true_right"] = new TH1F("jpsi_dimuon_rapidity_true_right", "y(mu1,mu2)" , 100 , -15. , 15.);
//background
histosTH1F["jpsi_dimuon_mass_t_cut_proton_right_bh"] = new TH1F("jpsi_dimuon_mass_t_cut_proton_right_bh", "jpsi_mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["jpsi_dimuon_pt_t_cut_proton_right_bh"] = new TH1F("jpsi_dimuon_pt_t_cut_proton_right_bh", "p_{T}(mu1,mu2)" , 100 , 0. , 20.);
histosTH1F["jpsi_dimuon_eta_t_cut_proton_right_bh"] = new TH1F("jpsi_dimuon_eta_t_cut_proton_right_bh", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["jpsi_dimuon_rapidity_t_cut_proton_right_bh"] = new TH1F("jpsi_dimuon_rapidity_t_cut_proton_right_bh", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["jpsi_proton_right_xi_t_cut_bh"] = new TH1F("jpsi_proton_right_xi_t_selected_bh", "#xi" , 200, -1.,1.);
histosTH1F["jpsi_proton_right_t_t_cut_bh"] = new TH1F("jpsi_proton_right_t_t_selected_bh", "-t" , 100, 0.,5.);
//signal
histosTH1F["jpsi_dimuon_mass_t_cut_proton_right_sig"] = new TH1F("jpsi_dimuon_mass_t_cut_proton_right_sig", "jpsi_mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["jpsi_dimuon_pt_t_cut_proton_right_sig"] = new TH1F("jpsi_dimuon_pt_t_cut_proton_right_sig", "p_{T}(mu1,mu2)" , 100 , 0. , 20.);
histosTH1F["jpsi_dimuon_eta_t_cut_proton_right_sig"] = new TH1F("jpsi_dimuon_eta_t_cut_proton_right_sig", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["jpsi_dimuon_rapidity_t_cut_proton_right_sig"] = new TH1F("jpsi_dimuon_rapidity_t_cut_proton_right_sig", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["jpsi_proton_right_xi_t_cut_sig"] = new TH1F("jpsi_proton_right_xi_t_selected_sig", "#xi" , 200, -1.,1.);
histosTH1F["jpsi_proton_right_t_t_cut_sig"] = new TH1F("jpsi_proton_right_t_t_selected_sig", "-t" , 100, 0.,5.);
//histosTH1F["xi_all_before"] = new TH1F("xi_all_before", "#xi" ,100, -1.,1. );
//_t_cut_proton_left
histosTH1F["jpsi_dimuon_mass_t_cut_proton_left"] = new TH1F("jpsi_dimuon_mass_t_cut_proton_left", "jpsi_mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["jpsi_dimuon_pt_t_cut_proton_left"] = new TH1F("jpsi_dimuon_pt_t_cut_proton_left", "p_{T}(mu1,mu2)" , 100 , 0. , 20.);
histosTH1F["jpsi_dimuon_pt2_t_cut_proton_left"] = new TH1F("jpsi_dimuon_pt2_t_cut_proton_left", "p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["jpsi_dimuon_eta_t_cut_proton_left"] = new TH1F("jpsi_dimuon_eta_t_cut_proton_left", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["jpsi_dimuon_rapidity_t_cut_proton_left"] = new TH1F("jpsi_dimuon_rapidity_t_cut_proton_left", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["jpsi_dimuon_multiplicity_t_cut_proton_left"] = new TH1F("jpsi_dimuon_multiplicity_t_cut_proton_left", "n jpsi_dimuons" , 100 , 0 , 20);
histosTH1F["jpsi_proton_left_xi_t_cut"] = new TH1F("jpsi_proton_left_xi_t_selected", "#xi" ,200, -1.,1. );
histosTH1F["jpsi_proton_left_t_t_cut"] = new TH1F("jpsi_proton_left_t_t_selected", "-t" , 100, 0., 5.);
histosTH1F["jpsi_Eta_max_t_cut_proton_left"]= new TH1F("Jpsi_Eta_max_t_cut_proton_left", "#eta^{max}" , 82 , etaBinsHCALBoundaries);
histosTH1F["jpsi_Eta_min_t_cut_proton_left"]= new TH1F("Jpsi_Eta_min_t_cut_proton_left", "#eta^{min}" , 82 , etaBinsHCALBoundaries);
histosTH1F["jpsipfxiPlus_minus_proton_left_xi_t_cut"] = new TH1F("jpsipfxiPlus_minus_proton_left_xi_t_cut", "#xi diff." , 200 , -1. , 1.);
histosTH1F["jpsiproton_t_cut_left_xi_cut"] = new TH1F("jpsiproton_t_cut_left_xi_cut", "#xi" , 200 , -1. , 1.);
histosTH1F["jpsiproton_left_t_true"] = new TH1F("jpsiproton_left_t_true", "-t" ,12, tbins);
histosTH1F["jpsihalo_left"] = new TH1F("jpsihalo_left", "-t halo" ,12, tbins);
histosTH1F["jpsiproton_left_t_signal"] = new TH1F("jpsiproton_left_t_signal", "-t" ,12, tbins);
histosTH1F["jpsiproton_left_t_halo"] = new TH1F("jpsiproton_left_t_halo", "-t" ,12, tbins);
histosTH1F["jpsi_dimuon_xi_halo_left"] = new TH1F("jpsi_dimuon_xi_halo_left", "#xi" , 200, -1.,1.);
histosTH1F["jpsi_dimuon_t_halo_left"] = new TH1F("jpsi_dimuon_t_halo_left", "-t" , 100, 0.,5.);
histosTH1F["jpsi_dimuon_xi_true_left"] = new TH1F("jpsi_dimuon_xi_true_left", "#xi" , 200, -1.,1.);
histosTH1F["jpsi_dimuon_t_true_left"] = new TH1F("jpsi_dimuon_t_true_left", "-t" , 100, 0.,5.);
histosTH1F["jpsi_dimuon_mass_halo_left"] = new TH1F("jpsi_dimuon_mass_halo_left", "jpsi_mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["jpsi_dimuon_mass_true_left"] = new TH1F("jpsi_dimuon_mass_true_left", "jpsi_mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["jpsi_dimuon_pt_halo_left"] = new TH1F("jpsi_dimuon_pt_halo_left", "p_{T}(mu1,mu2)" , 100 , 0. , 20.);
histosTH1F["jpsi_dimuon_pt_true_left"] = new TH1F("jpsi_dimuon_pt_true_left", "p_{T}(mu1,mu2)" , 100 , 0. , 20.);
histosTH1F["jpsi_dimuon_eta_halo_left"] = new TH1F("jpsi_dimuon_eta_halo_left", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["jpsi_dimuon_eta_true_left"] = new TH1F("jpsi_dimuon_eta_true_left", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["jpsi_dimuon_rapidity_halo_left"] = new TH1F("jpsi_dimuon_rapidity_halo_left", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["jpsi_dimuon_rapidity_true_left"] = new TH1F("jpsi_dimuon_rapidity_true_left", "y(mu1,mu2)" , 100 , -15. , 15.);
//backgroun
histosTH1F["jpsi_dimuon_mass_t_cut_proton_left_bh"] = new TH1F("jpsi_dimuon_mass_t_cut_proton_left_bh", "jpsi_mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["jpsi_dimuon_pt_t_cut_proton_left_bh"] = new TH1F("jpsi_dimuon_pt_t_cut_proton_left_bh", "p_{T}(mu1,mu2)" , 100 , 0. , 20.);
histosTH1F["jpsi_dimuon_eta_t_cut_proton_left_bh"] = new TH1F("jpsi_dimuon_eta_t_cut_proton_left_bh", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["jpsi_dimuon_rapidity_t_cut_proton_left_bh"] = new TH1F("jpsi_dimuon_rapidity_t_cut_proton_left_bh", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["jpsi_proton_left_xi_t_cut_bh"] = new TH1F("jpsi_proton_left_xi_t_selected_bh", "#xi" ,200, -1.,1. );
histosTH1F["jpsi_proton_left_t_t_cut_bh"] = new TH1F("jpsi_proton_left_t_t_selected_bh", "-t" , 100, 0., 5.);
//signal
histosTH1F["jpsi_dimuon_mass_t_cut_proton_left_sig"] = new TH1F("jpsi_dimuon_mass_t_cut_proton_left_sig", "jpsi_mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["jpsi_dimuon_pt_t_cut_proton_left_sig"] = new TH1F("jpsi_dimuon_pt_t_cut_proton_left_sig", "p_{T}(mu1,mu2)" , 100 , 0. , 20.);
histosTH1F["jpsi_dimuon_eta_t_cut_proton_left_sig"] = new TH1F("jpsi_dimuon_eta_t_cut_proton_left_sig", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["jpsi_dimuon_rapidity_t_cut_proton_left_sig"] = new TH1F("jpsi_dimuon_rapidity_t_cut_proton_left_sig", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["jpsi_proton_left_xi_t_cut_sig"] = new TH1F("jpsi_proton_left_xi_t_selected_sig", "#xi" ,200, -1.,1. );
histosTH1F["jpsi_proton_left_t_t_cut_sig"] = new TH1F("jpsi_proton_left_t_t_selected_sig", "-t" , 100, 0., 5.);
//Deltas info
histosTH1F["muonDeltaPt_jpsi_t_cut_proton_left"] = new TH1F("muonDeltaPt_jpsi_t_cut_proton_left", "#Deltap_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["muonDeltaEta_jpsi_t_cut_proton_left"] = new TH1F("muonDeltaEta_jpsi_t_cut_proton_left", "#Delta#eta(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["muonDeltaPhi_jpsi_t_cut_proton_left"] = new TH1F("muonDeltaPhi_jpsi_t_cut_proton_left", "#Delta#phi(mu1,mu2)" , 100 ,-2.2*M_PI ,2.2*M_PI);
histosTH1F["muonDeltaY_jpsi_t_cut_proton_left"] = new TH1F("muonDeltaY_jpsi_t_cut_proton_left", "#Deltay(mu1,mu2)" , 100 , 0. , 10.);
//t_cut_xi_cut_proton_left
histosTH1F["jpsi_dimuon_mass_t_cut_xi_cut_proton_left"] = new TH1F("jpsi_dimuon_mass_t_cut_xi_cut_proton_left", "jpsi_mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["jpsi_dimuon_pt_t_cut_xi_cut_proton_left"] = new TH1F("jpsi_dimuon_pt_t_cut_xi_cut_proton_left", "p_{T}(mu1,mu2)" , 100 , 0. , 20.);
histosTH1F["jpsi_dimuon_pt2_t_cut_xi_cut_proton_left"] = new TH1F("jpsi_dimuon_pt2_t_cut_xi_cut_proton_left", "p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["jpsi_dimuon_eta_t_cut_xi_cut_proton_left"] = new TH1F("jpsi_dimuon_eta_t_cut_xi_cut_proton_left", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["jpsi_dimuon_rapidity_t_cut_xi_cut_proton_left"] = new TH1F("jpsi_dimuon_rapidity_t_cut_xi_cut_proton_left", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["jpsi_dimuon_multiplicity_t_cut_xi_cut_proton_left"] = new TH1F("jpsi_dimuon_multiplicity_t_cut_xi_cut_proton_left", "n jpsi_dimuons" , 100 , 0 , 20);
histosTH1F["jpsi_proton_left_xi_t_cut_xi_cut"] = new TH1F("jpsi_proton_left_xi_selected_t_and_xi ", "#xi" , 200, -1.,1. );
histosTH1F["jpsi_proton_left_t_t_cut_xi_cut"] = new TH1F("jpsi_proton_left_t_selected_t_and_xi", "-t" , 100, 0., 5.);
//Deltas info
histosTH1F["muonDeltaPt_jpsi_t_cut_xi_cut_proton_left"] = new TH1F("muonDeltaPt_jpsi_t_cut_xi_cut_proton_left", "#Deltap_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["muonDeltaEta_jpsi_t_cut_xi_cut_proton_left"] = new TH1F("muonDeltaEta_jpsi_t_cut_xi_cut_proton_left", "#Delta#eta(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["muonDeltaPhi_jpsi_t_cut_xi_cut_proton_left"] = new TH1F("muonDeltaPhi_jpsi_t_cut_xi_cut_proton_left", "#Delta#phi(mu1,mu2)" , 100 ,-2.2*M_PI ,2.2*M_PI);
histosTH1F["muonDeltaY_jpsi_t_cut_xi_cut_proton_left"] = new TH1F("muonDeltaY_jpsi_t_cut_xi_cut_proton_left", "#Deltay(mu1,mu2)" , 100 , 0. , 10.);
//
histosTH2F["DeltaPhi_vs_dimuon_pt"] = new TH2F("DeltaPhi_vs_dimuon_pt", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["jpsi_DeltaPhi_vs_dimuon_pt"] = new TH2F("jpsi_DeltaPhi_vs_dimuon_pt", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["DeltaPhi_vs_dimuon_pt_proton_right"] = new TH2F("DeltaPhi_vs_dimuon_pt_proton_right", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["DeltaPhi_vs_dimuon_pt_t_cut_proton_right"] = new TH2F("DeltaPhi_vs_dimuon_pt_t_cut_proton_right", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["DeltaPhi_vs_dimuon_pt_proton_left"] = new TH2F("DeltaPhi_vs_dimuon_pt_proton_left", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["DeltaPhi_vs_dimuon_pt_t_cut_proton_left"] = new TH2F("DeltaPhi_vs_dimuon_pt_t_cut_proton_left", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
////
//histosTH2F["jpsi_DeltaPhi_vs_dimuon_pt"] = new TH2F("jpsi_DeltaPhi_vs_dimuon_pt", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["jpsi_DeltaPhi_vs_dimuon_pt_proton_right"] = new TH2F("jpsi_DeltaPhi_vs_dimuon_pt_proton_right", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["jpsi_DeltaPhi_vs_dimuon_pt_t_cut_proton_right"] = new TH2F("jpsi_DeltaPhi_vs_dimuon_pt_t_cut_proton_right", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["jpsi_DeltaPhi_vs_dimuon_pt_proton_left"] = new TH2F("jpsi_DeltaPhi_vs_dimuon_pt_proton_left", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["jpsi_DeltaPhi_vs_dimuon_pt_t_cut_proton_left"] = new TH2F("jpsi_DeltaPhi_vs_dimuon_pt_t_cut_proton_left", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
//MC
histosTH2F["DeltaPhi_vs_dimuon_pt_rpplus_accept"] = new TH2F("DeltaPhi_vs_dimuon_pt_rpplus_accept", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["DeltaPhi_vs_dimuon_pt_rpplus_accept_tsel"] = new TH2F("DeltaPhi_vs_dimuon_pt_rpplus_accept_tsel", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["DeltaPhi_vs_dimuon_pt_rpminus_accept"] = new TH2F("DeltaPhi_vs_dimuon_pt_rpminus_accept", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["DeltaPhi_vs_dimuon_pt_rpminus_accept_tsel"] = new TH2F("DeltaPhi_vs_dimuon_pt_rpminus_accept_tsel", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["jpsi_DeltaPhi_vs_dimuon_pt_rpplus_accept"] = new TH2F("jpsi_DeltaPhi_vs_dimuon_pt_rpplus_accept", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["jpsi_DeltaPhi_vs_dimuon_pt_rpplus_accept_tsel"] = new TH2F("jpsi_DeltaPhi_vs_dimuon_pt_rpplus_accept_tsel", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["jpsi_DeltaPhi_vs_dimuon_pt_rpminus_accept"] = new TH2F("jpsi_DeltaPhi_vs_dimuon_pt_rpminus_accept", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH2F["jpsi_DeltaPhi_vs_dimuon_pt_rpminus_accept_tsel"] = new TH2F("jpsi_DeltaPhi_vs_dimuon_pt_rpminus_accept_tsel", "#Delta#phi_vs_dimuon_p_{T}" , 100, 0.0, 20.0, 100, 0.0,1.2*M_PI );
histosTH1F["pf_EPlusPz"] = new TH1F("pf_EPlusPz","sum(E + pz)",24,binningEPlusPz);
histosTH1F["pf_EMinusPz"] = new TH1F("pf_EMinusPz","sum(E - pz)",24,binningEPlusPz);
////////////////////////////////////
//dimuon
histosTH1F["dimuon_mass_t_cut_proton_right_halo"]= new TH1F("dimuon_mass_t_cut_proton_right_halo", "mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["dimuon_pt_t_cut_proton_right_halo"] = new TH1F("dimuon_pt_t_cut_proton_right_halo", "p_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["dimuon_pt2_t_cut_proton_right_halo"] = new TH1F("dimuon_pt2_t_cut_proton_right_halo", "p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["dimuon_eta_t_cut_proton_right_halo"] = new TH1F("dimuon_eta_t_cut_proton_right_halo", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["dimuon_rapidity_t_cut_proton_right_halo"] = new TH1F("dimuon_rapidity_t_cut_proton_right_halo", "y(mu1,mu2)" , 100 , - 15. , 15.);
histosTH1F["dimuon_mass_t_cut_proton_right_signal"]= new TH1F("dimuon_mass_t_cut_proton_right_signal", "mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["dimuon_pt_t_cut_proton_right_signal"] = new TH1F("dimuon_pt_t_cut_proton_right_signal", "p_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["dimuon_pt2_t_cut_proton_right_signal"] = new TH1F("dimuon_pt2_t_cut_proton_right_signal", "p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["dimuon_eta_t_cut_proton_right_signal"] = new TH1F("dimuon_eta_t_cut_proton_right_signal", "#eta(mu1,mu2)" , 100 , - 5.2 , 5.2);
histosTH1F["dimuon_rapidity_t_cut_proton_right_signal"] = new TH1F("dimuon_rapidity_t_cut_proton_right_signal", "y(mu1,mu2)" , 100 , - 15. , 15.);
//left
histosTH1F["dimuon_mass_t_cut_proton_left_halo"] = new TH1F("dimuon_mass_t_cut_proton_left_halo", "mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["dimuon_pt_t_cut_proton_left_halo"] = new TH1F("dimuon_pt_t_cut_proton_left_halo", "p_{T}(mu1,mu2)" , 100 , 0. , 100. );
histosTH1F["dimuon_pt2_t_cut_proton_left_halo"] = new TH1F("dimuon_pt2_t_cut_proton_left_halo", "p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["dimuon_eta_t_cut_proton_left_halo"] = new TH1F("dimuon_eta_t_cut_proton_left_halo", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["dimuon_rapidity_t_cut_proton_left_halo"] = new TH1F("dimuon_rapidity_t_cut_proton_left_halo", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["dimuon_mass_t_cut_proton_left_signal"] = new TH1F("dimuon_mass_t_cut_proton_left_signal", "mass(mu1,mu2)" , Bin_mass , 0. ,10.);
histosTH1F["dimuon_pt_t_cut_proton_left_signal"] = new TH1F("dimuon_pt_t_cut_proton_left_signal", "p_{T}(mu1,mu2)" , 100 , 0. , 100. );
histosTH1F["dimuon_pt2_t_cut_proton_left_signal"] = new TH1F("dimuon_pt2_t_cut_proton_left_signal", "p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["dimuon_eta_t_cut_proton_left_signal"] = new TH1F("dimuon_eta_t_cut_proton_left_signal", "#eta(mu1,mu2)" , 100 ,-5.2 , 5.2);
histosTH1F["dimuon_rapidity_t_cut_proton_left_signal"] = new TH1F("dimuon_rapidity_t_cut_proton_left_signal", "y(mu1,mu2)" , 100 , -15. , 15.);
//jpsi
histosTH1F["jpsi_dimuon_eta_t_cut_proton_right_sel"] = new TH1F("jpsi_dimuon_eta_t_cut_proton_right_sel", "#eta(mu1,mu2)" , 100 ,-5.2 , 5.2);
histosTH1F["jpsi_dimuon_eta_t_cut_proton_right_halosel"] = new TH1F("jpsi_dimuon_eta_t_cut_proton_right_halosel", "#eta(mu1,mu2)" , 100 ,-5.2 , 5.2);
histosTH1F["jpsi_dimuon_eta_t_cut_proton_left_halosel"] = new TH1F("jpsi_dimuon_eta_t_cut_proton_left_halosel", "#eta(mu1,mu2)" , 100 ,-5.2 , 5.2);
histosTH1F["jpsi_dimuon_eta_t_cut_proton_left_sel"] = new TH1F("jpsi_dimuon_eta_t_cut_proton_left_sel", "#eta(mu1,mu2)" , 100 ,-5.2 , 5.2);
//TH2
histosTH2F["etaMuonsVsetaJpsi_pright_Signal"]= new TH2F("etaMuonsVsetaJpsi_pright_Signal","dimuon_#eta_vs_jpsi_#eta" ,100 , -5.2 , 5.2, 100, -5.2,5.2 );
histosTH2F["etaMuonsVsetaJpsi_pright_Halo"]= new TH2F("etaMuonsVsetaJpsi_pright_Halo","dimuon_#eta_vs_jpsi_#eta" , 100 , -5.2 ,5.2, 100, -5.2,5.2 );
histosTH2F["etaMuonsVsetaJpsi_pleft_Signal"]= new TH2F("etaMuonsVsetaJpsi_pleft_Signal","dimuon_#eta_vs_jpsi_#eta" ,100 , -5.2 , 5.2, 100, -5.2,5.2 );
histosTH2F["etaMuonsVsetaJpsi_pleft_Halo"]= new TH2F("etaMuonsVsetaJpsi_pleft_Halo","dimuon_#eta_vs_jpsi_#eta" ,100 , -5.2 , 5.2, 100, -5.2,5.2 );
///////////////////////////////////// X scaling
histosTH1F["log_x_plus_jpsi"] = new TH1F("log_x_plus_jpsi", "Log x^{+}" , bin2 , -4, 0);
histosTH1F["log_x_minus_jpsi"] = new TH1F("log_x_minus_jpsi", "Log x^{-}" , bin2 , -4, 0);
histosTH2F["log_x_plus_vs_pT_jpsi"] = new TH2F("log_x_plus_vs_pT_jpsi", "Log x^{+}" , bin2 , -4, 0, 100 , 0. , 100.);
histosTH2F["log_x_minus_vs_pT_jpsi"] = new TH2F("log_x_minus_vs_pT_jpsi", "Log x^{-}" , bin2 , -4, 0, 100 , 0. , 100.);
histosTH2F["log_x_plus_vs_eta_jpsi"] = new TH2F("log_x_plus_vs_eta_jpsi", "Log x^{+}" , bin2 , -4, 0, 100 , -5.2 , 5.2);
histosTH2F["log_x_minus_vs_eta_jpsi"] = new TH2F("log_x_minus_vs_eta_jpsi", "Log x^{-}" , bin2 , -4, 0, 100 , -5.2 , 5.2);
histosTH2F["log_x_plus_vs_E_jpsi"] = new TH2F("log_x_plus_vs_E_jpsi", "Log x^{+}" , bin2 , -4, 0, 100 , 0. , 500.);
histosTH2F["log_x_minus_vs_E_jpsi"] = new TH2F("log_x_minus_vs_E_jpsi", "Log x^{-}" , bin2 , -4, 0, 100 , 0. , 500.);
histosTH2F["log_x_plus_vs_pz_jpsi"] = new TH2F("log_x_plus_vs_pz_jpsi", "Log x^{+}" , bin2 , -4, 0, 100 , 0. , 500.);
histosTH2F["log_x_minus_vs_pz_jpsi"] = new TH2F("log_x_minus_vs_pz_jpsi", "Log x^{-}" , bin2 , -4, 0, 100 , 0. , 500.);
histosTH1F["log_x_plus"] = new TH1F("log_x_plus_xbins", "Log x^{+}" , xbins , -4, 0);
histosTH1F["log_x_minus"] = new TH1F("log_x_minus_xbins", "Log x^{-}" , xbins , -4, 0);
histosTH1F["log_x_minus_bin2"] = new TH1F("log_x_minus_bin2", "Log x^{-}" , bin2 , -4, 0);
histosTH1F["log_x_plus_bin2"] = new TH1F("log_x_plus_bin2", "Log x^{+}" , bin2 , -4, 0);
histosTH2F["log_x_plus_vs_pT_bin2"] = new TH2F("log_x_plus_vs_pT_bin2", "Log x^{+}" , bin2 , -4, 0, 100 , 0. , 100.);
histosTH2F["log_x_minus_vs_pT_bin2"] = new TH2F("log_x_minus_vs_pT_bin2", "Log x^{-}" , bin2 , -4, 0, 100 , 0. , 100.);
histosTH2F["log_x_plus_vs_eta_bin2"] = new TH2F("log_x_plus_vs_eta_bin2", "Log x^{+}" , 20 , -4, 0, 100 , -5.2 , 5.2);
histosTH2F["log_x_minus_vs_eta_bin2"] = new TH2F("log_x_minus_vs_eta_bin2", "Log x^{-}" , bin2 , -4, 0, 100 , -5.2 , 5.2);
histosTH2F["log_x_plus_vs_E_bin2"] = new TH2F("log_x_plus_vs_E_bin2", "Log x^{+}" , bin2 , -4, 0, 100 , 0. , 500.);
histosTH2F["log_x_minus_vs_E_bin2"] = new TH2F("log_x_minus_vs_E_bin2", "Log x^{-}" , bin2 , -4, 0, 100 , 0. , 500.);
histosTH2F["log_x_plus_vs_pz_bin2"] = new TH2F("log_x_plus_vs_pz_bin2", "Log x^{+}" , bin2 , -4, 0, 100 , 0. , 500.);
histosTH2F["log_x_minus_vs_pz_bin2"] = new TH2F("log_x_minus_vs_pz_bin2", "Log x^{-}" , bin2 , -4, 0, 100 , 0. , 500.);
histosTH2F["log_x_plus_vs_xi_bin2"]= new TH2F("log_x_plus_vs_xi_bin2", "Log x^{+}" , bin2 , -4, 0, 20 , -0.1, 0.3);
histosTH2F["log_x_minus_vs_xi_bin2"]= new TH2F("log_x_minus_vs_xi_bin2", "Log x^{-}" , bin2 , -4, 0, 20 , -0.1, 0.3);
///////////////////////////////////
histosTH1F["dimuon_mass_proton_left"] = new TH1F("dimuon_mass_proton_left", "mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["dimuon_pt_proton_left"] = new TH1F("dimuon_pt_proton_left", "p_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["dimuon_pt2_proton_left"] = new TH1F("dimuon_pt2_proton_left", "p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["dimuon_eta_proton_left"] = new TH1F("dimuon_eta_proton_left", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["dimuon_rapidity_proton_left"] = new TH1F("dimuon_rapidity_proton_left", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["dimuon_multiplicity_proton_left"] = new TH1F("dimuon_multiplicity_proton_left", "n dimuons" , 100 , 0 , 100);
histosTH1F["muonDeltaPt_proton_left"] = new TH1F("muonDeltaPt_proton_left", "#Deltap_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["muonDeltaEta_proton_left"] = new TH1F("muonDeltaEta_proton_left", "#Delta#eta(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["muonDeltaPhi_proton_left"] = new TH1F("muonDeltaPhi_proton_left", "#Delta#phi(mu1,mu2)" , 100 , -2.2*M_PI , 2.2*M_PI);
histosTH1F["muonDeltaY_proton_left"] = new TH1F("muonDeltaY_proton_left", "#Deltay(mu1,mu2)" , 100 , 0. , 10.);
//_t_cut_proton_left
histosTH1F["dimuon_mass_t_cut_proton_left"] = new TH1F("dimuon_mass_t_cut_proton_left", "mass(mu1,mu2)" , Bin_mass , 0. , 10.);
histosTH1F["dimuon_pt_t_cut_proton_left"] = new TH1F("dimuon_pt_t_cut_proton_left", "p_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["dimuon_pt2_t_cut_proton_left"] = new TH1F("dimuon_pt2_t_cut_proton_left", "p_{T}^{2}(mu1,mu2)" , 100 , 0. , 1000.);
histosTH1F["dimuon_eta_t_cut_proton_left"] = new TH1F("dimuon_eta_t_cut_proton_left", "#eta(mu1,mu2)" , 100 , -5.2 , 5.2);
histosTH1F["dimuon_rapidity_t_cut_proton_left"] = new TH1F("dimuon_rapidity_t_cut_proton_left", "y(mu1,mu2)" , 100 , -15. , 15.);
histosTH1F["dimuon_multiplicity_t_cut_proton_left"] = new TH1F("dimuon_multiplicity_t_cut_proton_left", "n dimuons" , 100 , 0 , 100);
histosTH1F["proton_left_xi_t_cut"] = new TH1F("proton_left_xi_t_selected", "#xi" , 200, -1.,1.);
histosTH1F["proton_left_t_t_cut"] = new TH1F("proton_left_t_t_selected", "-t" , 100 , 0., 5.0);
//Deltas info
histosTH1F["muonDeltaPt_t_cut_proton_left"] = new TH1F("muonDeltaPt_t_cut_proton_left", "#Deltap_{T}(mu1,mu2)" , 100 , 0. , 100.);
histosTH1F["muonDeltaEta_t_cut_proton_left"] = new TH1F("muonDeltaEta_t_cut_proton_left", "#Delta#eta(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["muonDeltaPhi_t_cut_proton_left"] = new TH1F("muonDeltaPhi_t_cut_proton_left", "#Delta#phi(mu1,mu2)" , 100 ,-2.2*M_PI , 2.2*M_PI);
histosTH1F["muonDeltaY_t_cut_proton_left"] = new TH1F("muonDeltaY_t_cut_proton_left", "#Deltay(mu1,mu2)" , 100 , 0. , 10.);
histosTH1F["jpsi_cms_sumEHFminus_rpminus_accept_tsel"] = new TH1F("jpsi_cms_sumEHFminus_rpminus_accept_tsel","sumEHF-",10,0.,200.);
histosTH1F["jpsi_cms_sumEHFplus_rpminus_accept_tsel"] = new TH1F("jpsi_cms_sumEHFplus_rpminus_accept_tsel","sumEHF+",10, 0.,200.);
histosTH1F["jpsi_cms_sumEHFminus_rpplus_accept_tsel"] = new TH1F("jpsi_cms_sumEHFminus_rpplus_accept_tsel","sumEHF-",10, 0.,200.);
histosTH1F["jpsi_cms_sumEHFplus_rpplus_accept_tsel"] = new TH1F("jpsi_cms_sumEHFplus_rpplus_accept_tsel","sumEHF+",10, 0.,200.);
histosTH1F["jpsi_cms_sumEHFminus_proton_left_t_t_cut_sig"] = new TH1F("jpsi_cms_sumEHFminus_proton_left_t_t_cut_sig","sumEHF-",10, 0.,200.);
histosTH1F["jpsi_cms_sumEHFplus_proton_left_t_t_cut_sig"] = new TH1F("jpsi_cms_sumEHFplus_proton_left_t_t_cut_sig","sumEHF+",10, 0.,200.);
histosTH1F["jpsi_cms_sumEHFminus_proton_left_t_t_cut_bh"] = new TH1F("jpsi_cms_sumEHFminus_proton_left_t_t_cut_bh","sumEHF-",10, 0.,200.);
histosTH1F["jpsi_cms_sumEHFplus_proton_left_t_t_cut_bh"] = new TH1F("jpsi_cms_sumEHFplus_proton_left_t_t_cut_bh","sumEHF+",10, 0.,200.);
histosTH1F["jpsi_cms_sumEHFminus_proton_right_t_t_cut_sig"] = new TH1F("jpsi_cms_sumEHFminus_proton_right_t_t_cut_sig","sumEHF-",10, 0.,200.);
histosTH1F["jpsi_cms_sumEHFplus_proton_right_t_t_cut_sig"] = new TH1F("jpsi_cms_sumEHFplus_proton_right_t_t_cut_sig","sumEHF+",10, 0.,200.);
histosTH1F["jpsi_cms_sumEHFminus_proton_right_t_t_cut_bh"] = new TH1F("jpsi_cms_sumEHFminus_proton_right_t_t_cut_bh","sumEHF-",10, 0.,200.);
histosTH1F["jpsi_cms_sumEHFplus_proton_right_t_t_cut_bh"] = new TH1F("jpsi_cms_sumEHFplus_proton_right_t_t_cut_bh","sumEHF+",10, 0.,200.);
histosTH1F["jpsi_cms_sumEHFminus"] = new TH1F("jpsi_cms_sumEHFminus","sumEHF-",500, 0.,500.);
histosTH1F["jpsi_cms_sumEHFplus"] = new TH1F("jpsi_cms_sumEHFplus","sumEHF+",500,0.,500.);
histosTH1F["cms_sumEHFminus"] = new TH1F("cms_sumEHFminus","sumEHF-",500, 0.,500.);
histosTH1F["cms_sumEHFplus"] = new TH1F("cms_sumEHFplus","sumEHF+",500, 0.,500.);
histosTH1F["pf_xiPlus"] = new TH1F("pf_xiPlus","#xi^{+}",200,-1.,1.);
histosTH1F["pf_xiMinus"] = new TH1F("pf_xiMinus","#xi^{-}",200,-1.,1.);
histosTH1F["xi_cms_pfplus"] = new TH1F("xi_cms_pfplus","#xi^{+}",200,-1.,1.);
histosTH1F["xi_cms_pfminus"] = new TH1F("xi_cms_pfminus","#xi^{-}",200,-1.,1.);
histosTH1F["jpsi_xi_cms_pfplus"] = new TH1F("jpsi_xi_cms_pfplus","#xi^{+}",200,-1.,1.);
histosTH1F["jpsi_xi_cms_pfminus"] = new TH1F("jpsi_xi_cms_pfminus","#xi^{-}",200,-1.,1.);
histosTH1F["jpsi_Eta_max"]= new TH1F("Jpsi_Eta_max", "#eta^{max}" , 82 , etaBinsHCALBoundaries);
histosTH1F["jpsi_Eta_min"]= new TH1F("Jpsi_Eta_min", "#eta^{min}" , 82 , etaBinsHCALBoundaries);
histosTH1F["jpsi_Delta_eta_maxmin"] = new TH1F("Jpsi_Delta_eta_maxmin", "#eta^{max} - #eta^{min}" , 20 , 0,11);
//histosTH1F["xi_cms_pfminus"] = new TH1F("xi_cms_pfminus","#xi^{-}",20,0.,1.);
histosTH1F["pf_logXiPlus"] = new TH1F("pf_logXiPlus","log(#xi^{+})",20,-4.,0.);
histosTH1F["pf_logXiMinus"] = new TH1F("pf_logXiMinus","log(#xi^{-})",20,-4.,0.);
histosTH1F["rp_track_posx_020"] = new TH1F("rp_track_posx_020", "x(RP track)" , 200, -10., 10.);
histosTH1F["rp_track_posy_020"] = new TH1F("rp_track_posy_020", "y(RP track)" , 500, -50., 50.);
histosTH1F["rp_track_posx_021"] = new TH1F("rp_track_posx_021", "x(RP track)" , 200, -10., 10.);
histosTH1F["rp_track_posy_021"] = new TH1F("rp_track_posy_021", "y(RP track)" , 500, -50., 50.);
histosTH1F["rp_track_posx_022"] = new TH1F("rp_track_posx_022", "x(RP track)" , 200, -10., 10.);
histosTH1F["rp_track_posy_022"] = new TH1F("rp_track_posy_022", "y(RP track)" , 500, -50., 50.);
histosTH1F["rp_track_posx_023"] = new TH1F("rp_track_posx_023", "x(RP track)" , 200, -10., 10.);
histosTH1F["rp_track_posy_023"] = new TH1F("rp_track_posy_023", "y(RP track)" , 500, -50., 50.);
histosTH1F["rp_track_posx_024"] = new TH1F("rp_track_posx_024", "x(RP track)" , 200, -10., 10.);
histosTH1F["rp_track_posy_024"] = new TH1F("rp_track_posy_024", "y(RP track)" , 500, -50., 50.);
histosTH1F["rp_track_posx_025"] = new TH1F("rp_track_posx_025", "x(RP track)" , 200, -10., 10.);
histosTH1F["rp_track_posy_025"] = new TH1F("rp_track_posy_025", "y(RP track)" , 500, -50., 50.);
histosTH1F["rp_track_posx_120"] = new TH1F("rp_track_posx_120", "x(RP track)" , 200, -10., 10.);
histosTH1F["rp_track_posy_120"] = new TH1F("rp_track_posy_120", "y(RP track)" , 500, -50., 50.);
histosTH1F["rp_track_posx_121"] = new TH1F("rp_track_posx_121", "x(RP track)" , 200, -10., 10.);
histosTH1F["rp_track_posy_121"] = new TH1F("rp_track_posy_121", "y(RP track)" , 500, -50., 50.);
histosTH1F["rp_track_posx_122"] = new TH1F("rp_track_posx_122", "x(RP track)" , 200, -10., 10.);
histosTH1F["rp_track_posy_122"] = new TH1F("rp_track_posy_122", "y(RP track)" , 500, -50., 50.);
histosTH1F["rp_track_posx_123"] = new TH1F("rp_track_posx_123", "x(RP track)" , 200, -10., 10.);
histosTH1F["rp_track_posy_123"] = new TH1F("rp_track_posy_123", "y(RP track)" , 500, -50., 50.);
histosTH1F["rp_track_posx_124"] = new TH1F("rp_track_posx_124", "x(RP track)" , 200, -10., 10.);
histosTH1F["rp_track_posy_124"] = new TH1F("rp_track_posy_124", "y(RP track)" , 500, -50., 50.);
histosTH1F["rp_track_posx_125"] = new TH1F("rp_track_posx_125", "x(RP track)" , 200, -10., 10.);
histosTH1F["rp_track_posy_125"] = new TH1F("rp_track_posy_125", "y(RP track)" , 500, -50., 50.);
histosTH2F["Deltaxleft_x020x024_vs_posx_020"] = new TH2F("Deltaxleft_vs_rp_track_posx_020","#Deltax_vs_x020", 200, -20., 20.,100,-10,10);
histosTH2F["Deltaxright_x120x124_vs_posx_120"] = new TH2F("Deltaxright_vs_rp_track_posx_120","#Deltax_vs_x120", 200, -20., 20.,100,-10,10);
histosTH2F["Deltayleft_y020y024_vs_posy_020"] = new TH2F("Deltayleft_vs_rp_track_posy_020","#Deltay_vs_y020", 500, -50., 50.,500,-50,50);
histosTH2F["Deltayright_y120y124_vs_posy_120"] = new TH2F("Deltayright_vs_rp_track_posy_120","#Deltay_vs_y120", 500, -50., 50.,500,-50,50);
histosTH2F["proton_left_xi_vs_rp_track_posx_020"] = new TH2F("proton_left_xi_vs_rp_track_posx_020","#x_vs_xi left", 200, -10., 10.,33,-0.3,0.04);
histosTH2F["proton_left_xi_vs_rp_track_posx_021"] = new TH2F("proton_left_xi_vs_rp_track_posx_021","#x_vs_xi left", 200, -10., 10.,33,-0.3,0.04);
histosTH2F["proton_left_xi_vs_rp_track_posx_022"] = new TH2F("proton_left_xi_vs_rp_track_posx_022","#x_vs_xi left", 200, -10., 10.,33,-0.3,0.04);
histosTH2F["proton_left_xi_vs_rp_track_posx_023"] = new TH2F("proton_left_xi_vs_rp_track_posx_023","#x_vs_xi left", 200, -10., 10.,33,-0.3,0.04);
histosTH2F["proton_left_xi_vs_rp_track_posx_024"] = new TH2F("proton_left_xi_vs_rp_track_posx_024","#x_vs_xi left", 200, -10., 10.,33,-0.3,0.04);
histosTH2F["proton_left_xi_vs_rp_track_posx_025"] = new TH2F("proton_left_xi_vs_rp_track_posx_025","#x_vs_xi left", 200, -10., 10.,33,-0.3,0.04);
histosTH2F["proton_right_xi_vs_rp_track_posx_120"] = new TH2F("proton_right_xi_vs_rp_track_posx_120","#x_vs_xi rigth", 200, -10., 10.,33,-0.3,0.04);
histosTH2F["proton_right_xi_vs_rp_track_posx_121"] = new TH2F("proton_right_xi_vs_rp_track_posx_121","#x_vs_xi rigth", 200, -10., 10.,33,-0.3,0.04);
histosTH2F["proton_right_xi_vs_rp_track_posx_122"] = new TH2F("proton_right_xi_vs_rp_track_posx_122","#x_vs_xi rigth", 200, -10., 10.,33,-0.3,0.04);
histosTH2F["proton_right_xi_vs_rp_track_posx_123"] = new TH2F("proton_right_xi_vs_rp_track_posx_123","#x_vs_xi rigth", 200, -10., 10.,33,-0.3,0.04);
histosTH2F["proton_right_xi_vs_rp_track_posx_124"] = new TH2F("proton_right_xi_vs_rp_track_posx_124","#x_vs_xi rigth", 200, -10., 10.,33,-0.3,0.04);
histosTH2F["proton_right_xi_vs_rp_track_posx_125"] = new TH2F("proton_right_xi_vs_rp_track_posx_125","#x_vs_xi rigth", 200, -10., 10.,33,-0.3,0.04);
histosTH1F["proton_right_xi"] = new TH1F("proton_right_xi", "#xi" , 200 , -1. , 1.);
histosTH1F["proton_right_xi_cut"] = new TH1F("proton_right_xi_cut", "#xi" , 200 , -1. , 1.);
histosTH1F["proton_left_xi_totem"] = new TH1F("proton_left_xi_totem", "#xi" , 200 , -1. , 1.);
histosTH1F["proton_right_xi_totem"] = new TH1F("proton_right_xi_totem", "#xi" , 200 , -1. , 1.);
histosTH1F["proton_right_logXi"] = new TH1F("proton_right_logXi","log(#xi)",200,-5.,0.);
histosTH1F["proton_right_t"] = new TH1F("proton_right_t", "-t" , 100 , 0. , 5.);
histosTH1F["proton_right_chi2"] = new TH1F("proton_right_chi2", "#chi^{2}" , 100 , 0. , 100.);
histosTH1F["proton_left_xi"] = new TH1F("proton_left_xi", "#xi" , 200 , -1. , 1.);
histosTH1F["proton_left_xi_cut"] = new TH1F("proton_left_xi_cut", "#xi" , 200 , -1. , 1.);
histosTH1F["proton_left_logXi"] = new TH1F("proton_left_logXi","log(#xi)",200,-5.,0.);
histosTH1F["proton_left_t"] = new TH1F("proton_left_t", "-t" , 100 , 0. , 5.);
histosTH1F["proton_left_chi2"] = new TH1F("proton_left_chi2", "#chi^{2}" , 100 , 0. , 100.);
//Float_t tbins[13] = { 0.0,0.03, 0.06, 0.09, 0.12, 0.15, 0.18, 0.22, 0.30, 0.40, 0.50, 0.65, 1.};
//===================================================
histosTH1F["proton_right_t_sel"] = new TH1F("proton_right_t_sel", "-t" ,12, tbins);
histosTH1F["proton_right_t_kint"] = new TH1F("proton_right_t_kint", "-t" ,12, tbins);
histosTH1F["proton_right_xi_kint"] = new TH1F("proton_right_xi_kint", "#xi Right RPs" , 20 , -0.1, 0.3);
histosTH1F["proton_right_xi_sel"] = new TH1F("proton_right_xi_sel", "#xi Right RPs" , 20 , -0.1, 0.3);
histosTH1F["proton_right_t_halosel"] = new TH1F("proton_right_t_halosel", "-t" ,12, tbins);
histosTH1F["proton_right_xi_halosel"] = new TH1F("proton_right_xi_halosel", "#xi Right RPs" , 20 , -0.1, 0.3);
histosTH2F["proton_right_xi_vs_t_halosel"] = new TH2F("proton_right_xi_vs_t_halosel", "#xi_vs_t Right RPs" , 20 , -0.1, 0.3,11 , 0.03, 1.0);
histosTH2F["proton_right_xi_vs_t_sel"] = new TH2F("proton_right_xi_vs_t_sel", "#xi_vs_t Right RPs" , 20 , -0.1, 0.3,11 , 0.03, 1.0);
histosTH2F["proton_right_xi_vs_t_tsel"] = new TH2F("proton_right_xi_vs_t_tsel", "#xi_vs_t Right RPs" , 200 , -1.0, 1.0, 100 , 0. , 5.);
histosTH2F["proton_right_xi_vs_t_kin"] = new TH2F("proton_right_xi_vs_t_kin", "#xi_vs_t Right RPs" , 20 , -0.1, 0.3,11 , 0.03, 1.0);
histosTH2F["proton_right_xi_vs_t"] = new TH2F("proton_right_xi_vs_t", "#xi_vs_t Right RPs" , 200 , -1. , 1.,100 ,0., 5.0);
histosTH1F["proton_left_t_sel"] = new TH1F("proton_Left_t_sel", "-t" ,12, tbins);
histosTH1F["proton_left_t_kint"] = new TH1F("proton_left_t_kint", "-t" ,12, tbins);
histosTH1F["proton_left_t_halosel"] = new TH1F("proton_Left_t_halosel", "-t" ,12, tbins);
histosTH1F["proton_left_xi_halosel"] = new TH1F("proton_Left_xi_halosel", "#xi Left RPs" , 20 , -0.1, 0.3);
histosTH1F["proton_left_xi_kint"] = new TH1F("proton_Left_xi_kint", "#xi Left RPs" , 20 , -0.1, 0.3);
histosTH1F["proton_left_xi_sel"] = new TH1F("proton_Left_xi_sel", "#xi Left RPs" , 20 , -0.1, 0.3);
histosTH2F["proton_left_xi_vs_t_halosel"] = new TH2F("proton_left_xi_vs_t_halosel", "#xi_vs_t Left RPs" , 20 , -0.1, 0.3,11 , 0.03, 1.0);
histosTH2F["proton_left_xi_vs_t_sel"] = new TH2F("proton_left_xi_vs_t_sel", "#xi_vs_t Left RPs" , 20 , -0.1, 0.3,11 , 0.03, 1.0);
histosTH2F["proton_left_xi_vs_t_tsel"] = new TH2F("proton_left_xi_vs_t_tsel", "#xi_vs_t Left RPs" , 200 , -1.0, 1.0, 100 , 0. , 5.);
histosTH2F["proton_left_xi_vs_t_kin"] = new TH2F("proton_left_xi_vs_t_kin", "#xi_vs_t Left RPs" , 20 , -0.1, 0.3,11 , 0.03, 1.0);
histosTH2F["proton_left_xi_vs_t"] = new TH2F("proton_left_xi_vs_t", "#xi_vs_t Left RPs" , 200 , -1. , 1.,100 ,0., 5.0);
//histosTH1F["xitotem_xicms_rightRPs"] = new TH1F("xitotem_xicms_rightRPs", "Right RPs" , 20 , -0.4 , 0.4);
histosTH1F["xitotem_xicms_rightRPs_kin"] = new TH1F("xitotem_xicms_rightRPs_kin", "Right RPs" , 20 , -0.4 , 0.4);
histosTH1F["xitotem_xicms_leftRPs_kin"] = new TH1F("xitotem_xicms_leftRPs_kin", "Left RPs" , 20 , -0.4 , 0.4);
//===================================================
histosTH1F["proton_right_tbins"] = new TH1F("proton_right_tbins", "-t" ,12, tbins);
histosTH1F["proton_right_t_cut"] = new TH1F("proton_right_t_cut", "-t" ,12, tbins);
histosTH1F["proton_right_t_signal"] = new TH1F("proton_right_t_signal", "-t" ,12, tbins);
histosTH1F["proton_right_t_true"] = new TH1F("proton_right_t_true", "-t" ,12, tbins);
histosTH1F["proton_right_t_true_constbin"] = new TH1F("proton_right_t_true_constbin", "-t" , 20 , 0, 1);
histosTH1F["proton_right_t_signal_constbin"] = new TH1F("proton_right_t_sigal_constbin", "-t" , 20 , 0, 1);
histosTH1F["proton_right_t_signal_eff"] = new TH1F("proton_right_t_signal_eff", "-t" ,12, tbins);
histosTH1F["proton_right_t_signal_effweight"] = new TH1F("proton_right_t_signal_effweight", "-t" ,12, tbins);
histosTH1F["proton_right_t_signal_averagept_eff"] = new TH1F("proton_right_t_signal_averagept_eff", "-t" ,12, tbins);
histosTH1F["proton_right_t_signal_averagept_effweight"] = new TH1F("proton_right_t_signal_averagept_effweight", "-t" ,12, tbins);
histosTH1F["proton_right_t_halo"] = new TH1F("proton_right_t_halo", "-t" ,12, tbins);
histosTH1F["proton_right_t_halo_constbin"] = new TH1F("proton_right_t_halo_constbin", "-t" , 20 , 0, 1);
histosTH1F["halo_right"] = new TH1F("halo_right", "-t halo" ,12, tbins);
histosTH1F["halo_right_constbin"] = new TH1F("halo_right_constbin", "-t halo" , 20 , 0, 1);
histosTH1F["proton_right_xi_halo"] = new TH1F("proton_right_xi_halo", "#xi Right RPs" , 200 , -1., 1.0);
histosTH1F["proton_right_xi_signal"] = new TH1F("proton_right_xi_signal", "#xi Right RPs" , 200 , -1., 1.0);
histosTH1F["proton_right_xi_bin"] = new TH1F("proton_right_xi_bin", "#xi Right RPs" , 20 , -0.1, 0.3);
histosTH1F["proton_right_beta"] = new TH1F("proton_right_beta", "#beta Right RPs" , 20 , 0, 1);
histosTH1F["proton_left_tbins"] = new TH1F("proton_left_tbins", "-t" ,12, tbins);
histosTH1F["proton_left_t_cut"] = new TH1F("proton_left_t_cut", "-t" ,12, tbins);
histosTH1F["proton_left_t_signal"] = new TH1F("proton_left_t_signal", "-t" ,12, tbins);
histosTH1F["proton_left_t_true"] = new TH1F("proton_left_t_true", "-t" ,12, tbins);
histosTH1F["proton_left_t_true_constbin"] = new TH1F("proton_left_t_true_constbin", "-t" , 20 , 0, 1);
histosTH1F["proton_left_t_signal_constbin"] = new TH1F("proton_left_t_sigal_constbin", "-t" , 20 , 0, 1);
histosTH1F["proton_left_t_signal_eff"] = new TH1F("proton_left_t_signal_eff", "-t" ,12, tbins);
histosTH1F["proton_left_t_signal_effweight"] = new TH1F("proton_left_t_signal_effweight", "-t" ,12, tbins);
histosTH1F["proton_left_t_signal_averagept_eff"] = new TH1F("proton_left_t_signal_averagept_eff", "-t" ,12, tbins);
histosTH1F["proton_left_t_signal_averagept_effweight"] = new TH1F("proton_left_t_signal_averagept_effweight", "-t" ,12, tbins);
histosTH1F["proton_left_t_halo"] = new TH1F("proton_left_t_halo", "-t" ,12, tbins);
histosTH1F["proton_left_t_halo_constbin"] = new TH1F("proton_left_t_halo_constbin", "-t" , 20 , 0, 1);
histosTH1F["halo_left"] = new TH1F("halo_left", "-t halo" ,12, tbins);
histosTH1F["halo_left_constbin"] = new TH1F("halo_left_constbin", "-t halo" , 20 , 0, 1);
histosTH1F["proton_left_xi_signal"] = new TH1F("proton_left_xi_signal", "#xi Left RPs" , 200 , -1.0, 1.0);
histosTH1F["proton_left_xi_halo"] = new TH1F("proton_left_xi_halo", "#xi Left RPs" , 200 , -1.0, 1.0);
histosTH1F["proton_left_xi_bin"] = new TH1F("proton_left_xi_bin", "#xi Left RPs" , 200 , -1.0, 1.0);
histosTH1F["proton_left_beta"] = new TH1F("proton_left_beta", "#beta Left RPs" , 200 , -1.0, 1.0);
//histosTH1F["proton_left_xi_cut"] = new TH1F("proton_left_xi_tcut", "#xi Left RPs" , 250 , -1.0, 1.0);
//histosTH1F["xitotem_xicms_leftRPs"] = new TH1F("xitotem_xicms_leftRPs", "Left RPs" , 250 , -1.0 , 1.0);
//histosTH1F["xitotem_xicms_rightRPs"] = new TH1F("xitotem_xicms_rightRPs", "Right RPs" , 250 , -1.0 , 1.0);
//histosTH1F["xitotem_xicms_rightRPs"] = new TH1F("xitotem_xicms_rightRPs", "Right RPs" , 20 , -0.4 , 0.4);
//histosTH1F["xitotem_xicms_leftRPs"] = new TH1F("xitotem_xicms_leftRPs", "Left RPs" , 20 , -0.4 , 0.4);
//histosTH1F["xitotem_xicms_rightRPs_tcut"] = new TH1F("xitotem_xicms_rightRPs_tcut", "Right RPs" , 20 , -0.4 , 0.4);
//histosTH1F["xitotem_xicms_rightRPs_cut"] = new TH1F("xitotem_xicms_rightRPs_cut", "Right RPs" , 20 , -0.4 , 0.4);
histosTH1F["xi_cms_totem_background_simulated"] = new TH1F("xitotem_xicms_rightRPs_simulated", "Right RPs" , 200 , -1.0 , 1.0);
histosTH1F["xi_cms_totem_background_simulatedleft"] = new TH1F("xitotem_xicms_leftRPs_simulated", "Left RPs" , 200 , -1.0 , 1.0);
histosTH1F["proton_pair_right_xi"] = new TH1F("proton_pair_right_xi", "#xi" , 200 , -1. , 1.);
histosTH1F["proton_pair_right_logXi"] = new TH1F("proton_pair_right_logXi","log(#xi)",200,-5.,0.);
histosTH1F["proton_pair_right_t"] = new TH1F("proton_pair_right_t", "-t" , 100 , 0. , 5.);
histosTH1F["proton_pair_left_xi"] = new TH1F("proton_pair_left_xi", "#xi" , 200 , -1. , 1.);
histosTH1F["proton_pair_left_logXi"] = new TH1F("proton_pair_left_logXi","log(#xi)",200,-5.,0.);
histosTH1F["proton_pair_left_t"] = new TH1F("proton_pair_left_t", "-t" , 100 , 0. , 5.);
histosTH1F["proton_pair_chi2"] = new TH1F("proton_pair_chi2", "#chi^{2}" , 100 , 0. , 100.);
histosTH1F["pf_xiPlus_minus_proton_left_xi"] = new TH1F("pf_xiPlus_minus_proton_left_xi", "#xi diff." , 200 , -1. , 1.);
histosTH1F["pf_xiMinus_minus_proton_right_xi"] = new TH1F("pf_xiMinus_minus_proton_right_xi", "#xi diff." , 200 , -1. , 1.);
histosTH1F["pfxiMinus_minus_proton_right_xi"] = new TH1F("pfxiMinus_minus_proton_right_xi", "#xi diff." , 200 , -1. , 1.);
histosTH1F["pfxiPlus_minus_proton_left_xi"] = new TH1F("pfxiPlus_minus_proton_left_xi", "#xi diff." , 200 , -1. , 1.);
histosTH1F["jpsipfxiMinus_minus_proton_right_xi"] = new TH1F("jpsipfxiMinus_minus_proton_right_xi", "#xi diff." , 200 , -1. , 1.);
histosTH1F["jpsipfxiPlus_minus_proton_left_xi"] = new TH1F("jpsipfxiPlus_minus_proton_left_xi", "#xi diff." , 200 , -1. , 1.);
histosTH1F["random_pfxiMinus_minus_proton_right_xi"] = new TH1F("random_pfxiMinus_minus_proton_right_xi", "#xi diff." , 200 , -1. , 1.);
histosTH1F["random_pfxiPlus_minus_proton_left_xi"] = new TH1F("random_pfxiPlus_minus_proton_left_xi", "#xi diff." , 200 , -1. , 1.);
histosTH2F["t2_track_multiplicity_vs_track_multiplicity"] = new TH2F("t2_track_multiplicity_vs_track_multiplicity","t2_track_multiplicity_vs_track_multiplicity", 100 , 0 , 100, 100 , 0 , 100);
histosTH2F["t2_track_multiplicity_vs_leadingJet_pt"] = new TH2F("t2_track_multiplicity_vs_leadingJet_pt","t2_track_multiplicity_vs_leadingJet_pt", 150 , 0. , 150., 100 , 0 , 100);
histosTH2F["t2_track_entryY_vs_entryX_zplus"] = new TH2F("t2_track_entryY_vs_entryX_zplus","t2_track_entryY_vs_entryX", 160 , -160. , 160., 160 , -160. , 160.);
histosTH2F["t2_track_entryY_vs_entryX_zminus"] = new TH2F("t2_track_entryY_vs_entryX_zminus","t2_track_entryY_vs_entryX", 160 , -160. , 160., 160 , -160. , 160.);
histosTH2F["proton_right_logXi_vs_pf_logXiPlus"] = new TH2F("proton_right_logXi_vs_pf_logXiPlus","proton_right_logXi_vs_pf_logXiPlus", 200, -5., 0., 200, -5., 0.);
histosTH2F["proton_left_logXi_vs_pf_logXiMinus"] = new TH2F("proton_left_logXi_vs_pf_logXiMinus","proton_left_logXi_vs_pf_logXiMinus", 200, -5., 0., 200, -5., 0.);
histosTH2F["proton_right_logXi_vs_pf_logXiMinus"] = new TH2F("proton_right_logXi_vs_pf_logXiMinus","proton_right_logXi_vs_pf_logXiMinus", 200, -5., 0., 200, -5., 0.);
histosTH2F["proton_left_logXi_vs_pf_logXiPlus"] = new TH2F("proton_left_logXi_vs_pf_logXiPlus","proton_left_logXi_vs_pf_logXiPlus", 200, -5., 0., 200, -5., 0.);
histosTH2F["proton_right_logXi_vs_t"] = new TH2F("proton_right_logXi_vs_t","proton_right_logXi_vs_t", 200, 0., 5., 200, -5., 0.);
histosTH2F["proton_left_logXi_vs_t"] = new TH2F("proton_left_logXi_vs_t","proton_left_logXi_vs_t", 200, 0., 5., 250, -5., 0.);
histosTH2F["proton_right_xi_vs_pf_xiMinus"] = new TH2F("proton_right_xi_vs_pf_xiMinus","proton_right_xi_vs_pf_xiMinus", 125, 0., 1., 125, 0., 1.);
histosTH2F["proton_right_xi_vs_pf_xiPlus"] = new TH2F("proton_right_xi_vs_pf_xiPlus","proton_right_xi_vs_pf_xiPlus", 125, 0., 1., 125, 0., 1.);
histosTH2F["proton_left_xi_vs_pf_xiMinus"] = new TH2F("proton_left_xi_vs_pf_xiMinus","proton_left_xi_vs_pf_xiMinus", 125, 0., 1., 125, 0., 1.);
histosTH2F["proton_left_xi_vs_pf_xiPlus"] = new TH2F("proton_left_xi_vs_pf_xiPlus","proton_left_xi_vs_pf_xiPlus", 125, 0., 1., 125, 0., 1.);
histosTH2F["rp_track_pos_y_vs_x_020"] = new TH2F("rp_track_pos_y_vs_x_020", "y(RP track) vs x(RP track)" , 200, -10., 10., 500, -50., 50.);
histosTH2F["rp_track_pos_y_vs_x_021"] = new TH2F("rp_track_pos_y_vs_x_021", "y(RP track) vs x(RP track)" , 200, -10., 10., 500, -50., 50.);
histosTH2F["rp_track_pos_y_vs_x_022"] = new TH2F("rp_track_pos_y_vs_x_022", "y(RP track) vs x(RP track)" , 200, -10., 10., 500, -50., 50.);
histosTH2F["rp_track_pos_y_vs_x_023"] = new TH2F("rp_track_pos_y_vs_x_023", "y(RP track) vs x(RP track)" , 200, -10., 10., 500, -50., 50.);
histosTH2F["rp_track_pos_y_vs_x_024"] = new TH2F("rp_track_pos_y_vs_x_024", "y(RP track) vs x(RP track)" , 200, -10., 10., 500, -50., 50.);
histosTH2F["rp_track_pos_y_vs_x_025"] = new TH2F("rp_track_pos_y_vs_x_025", "y(RP track) vs x(RP track)" , 200, -10., 10., 500, -50., 50.);
histosTH2F["rp_track_pos_y_vs_x_120"] = new TH2F("rp_track_pos_y_vs_x_120", "y(RP track) vs x(RP track)" , 200, -10., 10., 500, -50., 50.);
histosTH2F["rp_track_pos_y_vs_x_121"] = new TH2F("rp_track_pos_y_vs_x_121", "y(RP track) vs x(RP track)" , 200, -10., 10., 500, -50., 50.);
histosTH2F["rp_track_pos_y_vs_x_122"] = new TH2F("rp_track_pos_y_vs_x_122", "y(RP track) vs x(RP track)" , 200, -10., 10., 500, -50., 50.);
histosTH2F["rp_track_pos_y_vs_x_123"] = new TH2F("rp_track_pos_y_vs_x_123", "y(RP track) vs x(RP track)" , 200, -10., 10., 500, -50., 50.);
histosTH2F["rp_track_pos_y_vs_x_124"] = new TH2F("rp_track_pos_y_vs_x_124", "y(RP track) vs x(RP track)" , 200, -10., 10., 500, -50., 50.);
histosTH2F["rp_track_pos_y_vs_x_125"] = new TH2F("rp_track_pos_y_vs_x_125", "y(RP track) vs x(RP track)" , 200, -10., 10., 500, -50., 50.);
//////
double energyMin = -10.;
double energyMax = 190.;
int nBinsEnergy = 1000;
histosTH2F["energyVsEtaAllTypes"] = new TH2F("energyVsEtaAllTypes","energy Vs Eta AllTypes",82,etaBinsHCALBoundaries,nBinsEnergy,energyMin,energyMax);
histosTH2F["energyVsEtaUndefined"] = new TH2F("energyVsEtaUndefined","energy Vs Eta Undefined",82,etaBinsHCALBoundaries,nBinsEnergy,energyMin,energyMax);
histosTH2F["energy Vs Eta Charged Hadron"] = new TH2F("energyVsEtaChargedHadron","energy Vs Eta Charged Hadron",82,etaBinsHCALBoundaries,nBinsEnergy,energyMin,energyMax);
histosTH2F["energyVsEtaElectron"] = new TH2F("energyVsEtaElectron","energy Vs Eta Electron",82,etaBinsHCALBoundaries,nBinsEnergy,energyMin,energyMax);
histosTH2F["energyVsEtaMuon"] = new TH2F("energyVsEtaMuon","energy Vs Eta Muon",82,etaBinsHCALBoundaries,nBinsEnergy,energyMin,energyMax);
histosTH2F["energyVsEtaGamma"] = new TH2F("energyVsEtaGamma","energy Vs Eta Gamma",82,etaBinsHCALBoundaries,nBinsEnergy,energyMin,energyMax);
histosTH2F["energyVsEtaNeutralHadron"] = new TH2F("energyVsEtaNeutralHadron","energy Vs Eta Neutral Hadron",82,etaBinsHCALBoundaries,nBinsEnergy,energyMin,energyMax);
histosTH2F["energyVsEtaHadronHF"] = new TH2F("energyVsEtaHadronHF","energy Vs Eta HadronHF",82,etaBinsHCALBoundaries,nBinsEnergy,energyMin,energyMax);
histosTH2F["energyVsEtaHadronHFEcalEnergy"] = new TH2F("energyVsEtaHadronHFEcalEnergy","energyVsEtaHadronHFEcalEnergy",82,etaBinsHCALBoundaries,nBinsEnergy,energyMin,energyMax);
histosTH2F["energyVsEtaHadronHFNoEcalEnergy"] = new TH2F("energyVsEtaHadronHFNoEcalEnergy","energyVsEtaHadronHFNoEcalEnergy",82,etaBinsHCALBoundaries,nBinsEnergy,energyMin,energyMax);
histosTH2F["energyVsEtaEGammaHF"] = new TH2F("energyVsEtaEGammaHF","energy Vs Eta GammaHF",82,etaBinsHCALBoundaries,nBinsEnergy,energyMin,energyMax);
histosTH2F["xi+Vseta_max"] = new TH2F("xi+Vseta_max","#xi^{+] Vs #eta_{max}",200,0,5.2,nBinsEnergy,0,0.5);
for(map<string,TH1F*>::const_iterator it = histosTH1F.begin(); it != histosTH1F.end(); ++it)
it->second->Sumw2();
for(map<string,TH2F*>::const_iterator it = histosTH2F.begin(); it != histosTH2F.end(); ++it)
it->second->Sumw2();
//===================
int i_tot = 0 , nevt_tot = 0;
//const char *ext=".root";
vector<TString>* vfiles = new vector<TString>;
for(size_t idx_file = 0; idx_file < fileNames.size(); ++idx_file) vfiles->push_back( fileNames[idx_file] );
/*const char *ext=".root";
vector<TString>* vdirs = new vector<TString>;
vdirs->push_back(" /storage1/eliza/TOTEM/MinimumBias/MinBias1-198902/");
vdirs->push_back(" /storage1/eliza/TOTEM/MinimumBias/MinBias1-198903/");
//vdirs->push_back("/storage1/lhuertas/Analysis/CMSTotem/data/MergedNtuples/HighBeta/198903-8372-V00-02-00/Jets1/");
//vdirs->push_back("/storage1/lhuertas/Analysis/CMSTotem/data/MergedNtuples/HighBeta/198903-8372-V00-02-00/Jets2/");
vector<TString>* vfiles = new vector<TString>;
for(vector<TString>::iterator itdirs = vdirs->begin(); itdirs != vdirs->end(); ++itdirs){
TString& dirname = *itdirs;
//vector<TString>* vfiles = new vector<TString>;
TSystemDirectory dir(dirname, dirname);
TList *files = dir.GetListOfFiles();
if (files) {
TSystemFile *file;
TString fname;
TIter next(files);
while ((file=(TSystemFile*)next())) {
fname = file->GetName();
if (!file->IsDirectory() && fname.EndsWith(ext)) {
TString root_file = dirname + string(fname.Data());
vfiles->push_back(root_file); cout<<root_file<<endl;
}
}
}
}
*/
//Declaration of tree and its branches variables
TTree* tree = NULL;
MyEvtId* evtId = NULL;
MyL1TrigOld* l1Trig = NULL;
MyHLTrig* hltTrig = NULL;
//vector<MyGenPart>* genPart = NULL;
vector<MyTracks>* track_coll = NULL;
vector<MyVertex>* vertex_coll = NULL;
vector<MyMuon>* muon_coll = NULL;
vector<MyPFCand>* pFlow_coll = NULL;
vector<MyFSCHit>* fscHits_coll = NULL;
vector<MyFSCDigi>* fscDigis_coll = NULL;
//===================
T2Event* t2_event = NULL;
RPRootDumpReconstructedProton* rec_proton_left = NULL;
RPRootDumpReconstructedProton* rec_proton_right = NULL;
RPRootDumpReconstructedProtonPair* rec_proton_pair = NULL;
map<unsigned int, RPRootDumpTrackInfo*> rp_track_info;
map<unsigned int, RPRootDumpDigiInfo*> rp_digi_info;
map<unsigned int, RPRootDumpPatternInfo*> rp_par_patterns_info;
map<unsigned int, RPRootDumpPatternInfo*> rp_nonpar_patterns_info;
map<unsigned int, std::vector<RPRootDumpTrackInfo>*> rp_multi_track_info;
TString outtxt_right = outputFileName;
TString outtxt_left = outputFileName;
outtxt_right.ReplaceAll("root","txt_right");
outtxt_left.ReplaceAll("root","txt_left");
ofstream outstring_left(outtxt_left);
ofstream outstring_right(outtxt_right);
//===================
int n_vertices_selected = 0;
int n_select_Vertex_After_vtx_cut =0;
int n_evt_selectTrack = 0;
int n_muon_selected = 0;
int n_dimuons_selected = 0;
int n_dimuons_t_selected_proton_left = 0;
int n_dimuons_t_selected_proton_right = 0;
int n_evt_PF = 0;
int n_evt_passed_threshold = 0;
int n_jpsi_selected = 0;
int n_jpsi_mass =0;
int n_jpsi_mass_p =0;
int n_jpsi_t_selected_proton_left = 0;
int n_jpsi_t_selected_proton_right = 0;
int n_jpsi_proton_left = 0;
int n_jpsi_proton_right=0;
int n_dimuons_proton_left = 0;
int n_dimuons_proton_right=0;
int nevtxisignalleft = 0;
int nevtxisignalright = 0;
int nevtxibkcgleft = 0;
int nevtxibkcgright = 0;
int nevtxibhleftjpsi = 0;
int nevtxibhrightjpsi = 0;
int nevtxisignalleftjpsi = 0;
int nevtxisignalrightjpsi = 0;
//starting Loop over files, stops at end of list of files or when reached nevt_max
for(vector<TString>::iterator itfiles = vfiles->begin(); itfiles != vfiles->end() && i_tot < nevt_max_corr; ++itfiles){
TFile* file = TFile::Open(*itfiles,"READ");
//getting the tree form the current file
tree = (TTree*) file->Get( treeName.c_str() );
//ofstream ofs;
//ofs.Open ("eff_ptJet2.txt");
//Getting number of events
int nev = int(tree->GetEntriesFast());
nevt_tot += nev;
cout <<"The current file has " << nev << " entries : "<< endl << *itfiles << endl;
//adding branches to the tree ----------------------------------------------------------------------
tree->SetBranchAddress("cmsEvtUA",&evtId);
tree->SetBranchAddress("cmsTrigUA",&l1Trig);
tree->SetBranchAddress("cmsHLTTrigUA",&hltTrig);
tree->SetBranchAddress("cmsTracksUA",&track_coll);
tree->SetBranchAddress("cmsVerticesUA",&vertex_coll);
tree->SetBranchAddress("cmsMuonsUA",&muon_coll);
tree->SetBranchAddress("cmsParticleFlowUA",&pFlow_coll);
//tree->SetBranchAddress("cmsFSCHitsUA",&fscHits_coll);
//tree->SetBranchAddress("cmsFSCDigisUA",&fscDigis_coll);
tree->SetBranchAddress("branchT2EV.",&t2_event);
tree->SetBranchAddress("rec_prot_left.",&rec_proton_left);
tree->SetBranchAddress("rec_prot_right.",&rec_proton_right);
tree->SetBranchAddress("rec_prot_pair.",&rec_proton_pair);
std::vector<unsigned int> rp_list;
rp_list.push_back(20); rp_list.push_back(21); rp_list.push_back(22); rp_list.push_back(23); rp_list.push_back(24); rp_list.push_back(25);
rp_list.push_back(120); rp_list.push_back(121); rp_list.push_back(122); rp_list.push_back(123); rp_list.push_back(124); rp_list.push_back(125);
char br_name[200];
for (unsigned int a = 0; a < 2; ++a) {
int s = 2;
for (unsigned int r = 0; r < 6; r++) {
unsigned int id = 100 * a + 10 * s + r;
if( std::find(rp_list.begin(), rp_list.end(), id) == rp_list.end() ) continue;
sprintf(br_name, "track_rp_%u.", id);
std::cout << br_name << std::endl;
tree->SetBranchAddress(br_name, &rp_track_info[id]);
}
}
//starting loop over events, stops when reached end of file or nevt_max
for(int i_evt = 0; i_evt < nev && i_tot < nevt_max_corr; ++i_evt , ++i_tot){
//printing the % of events done every 10k evts
if( ((i_tot+1) % 10000) == 0) cout <<int(double(i_tot+1)/1000)<<"k done"<<endl;
//Filling the variables defined setting branches
tree->GetEntry(i_evt);
double event_weight = 1.;
bool passed_HLTMuon= false;
string HLT_muon = "HLT_L1DoubleMu0_v1";
//string HLT_muon = "HLT_ZeroBias_v7";
bool PF_eta_max = false;
bool PF_eta_min = false;
bool mu1_selected = false;
bool mu2_selected = false;
bool select_Track = false;
bool jpsi_mass=false;
//bool select_OneVertex = false;
histosTH1F["EventSelection"]->Fill( "All", event_weight );
//AT THIS POINT ON, CAN START USING THE VARIABLES LIKE TRACKS, VERTEX ETC !
// Event selection w/o RP
//-------------------------------------------------------------------------------------------------
// HLT
for (int itrig = 0 ; itrig < 128 ; ++itrig){
if( l1Trig->PhysTrigWord[itrig] == 1)
histosTH1F["decisionPhysTrig"]->Fill( itrig, event_weight );
}