13 #include "TCollection.h" 19 #include "TSystemDirectory.h" 20 #include "TSystemFile.h" 26 #include "cross_sections.hh" 27 #include "utilities.hh" 33 vector<vector<TString> > var_val,
int totentries){
35 if(var_type.size()!=var.size() || var_type.size()!=var_val.size())
36 { cout<<
"[Change Branch One] ERROR: Branch vectors are not the same size"<<endl; exit(0); }
38 const int nvar = var.size();
41 vector<varType> ivar_type;
42 vector<bool> isLep(nvar,
false);
43 vector<vector<bool> > multiply(nvar);
44 for(
int isetup=0; isetup<nvar; isetup++){
45 size_t vlength(var_val[isetup].size());
46 multiply[isetup] = vector<bool>(vlength,
false);
48 for(
unsigned int idx=0; idx<vlength; idx++){
49 if(var_val[isetup][idx].BeginsWith(
"*") || var_val[isetup][idx].EndsWith(
"*")){
50 var_val[isetup][idx].Remove(TString::kBoth,
'*');
51 multiply[isetup][idx]=
true;
56 if(var_type[isetup]==
"bool" || var_type[isetup]==
"vbool"){
57 for(
unsigned int idx=0; idx<var_val[isetup].size(); idx++){
58 if(var_val[isetup][idx]==
"true")
59 var_val[isetup][idx]=
"1";
60 else if(var_val[isetup][idx]==
"false")
61 var_val[isetup][idx]=
"0";
66 if(var[isetup].
Contains(
"_lep")) isLep[isetup] =
true;
68 if(var_type[isetup]==
"int") ivar_type.push_back(
kInt);
69 else if(var_type[isetup]==
"float") ivar_type.push_back(
kFloat);
70 else if(var_type[isetup]==
"double") ivar_type.push_back(
kDouble);
71 else if(var_type[isetup]==
"bool") ivar_type.push_back(
kBool);
72 else if(var_type[isetup]==
"vint") ivar_type.push_back(
kvInt);
73 else if(var_type[isetup]==
"vfloat") ivar_type.push_back(
kvFloat);
74 else if(var_type[isetup]==
"vdouble") ivar_type.push_back(
kvDouble);
75 else if(var_type[isetup]==
"vbool") ivar_type.push_back(
kvBool);
77 cout<<
"var_type "<<var_type[isetup]<<
" not supported. Exiting"<<endl;
83 TFile* oldfile =
new TFile(indir+name);
84 TTree* oldtree =
static_cast<TTree*
>(oldfile->Get(
"tree"));
85 TTree* oldtreeglobal =
static_cast<TTree*
>(oldfile->Get(
"treeglobal"));
87 vector<int> new_var_int_(nvar,-999);
88 vector<float> new_var_flt_(nvar,-999);
89 vector<double> new_var_dbl_(nvar,-999);
90 deque<bool> new_var_bool_(nvar,
false);
91 vector<vector<int> * > new_var_vint_(nvar);
92 vector<vector<float> * > new_var_vflt_(nvar);
93 vector<vector<double> * > new_var_vdbl_(nvar);
94 vector<vector<bool> * > new_var_vbool_(nvar);
97 float w_lumi(1.), w_lumi_old(1.), w_lep(1.), w_fs_lep(1.), w_btag_old(1.), w_corr(1.);
98 float w_isr_old=1., w_pu_old=1.;
100 int nleps_=0, mgluino_(0);
101 float eff_trig_(0), eff_jetid_(0), nisr_(0);
102 oldtree->SetBranchAddress(
"eff_jetid",&eff_jetid_);
103 oldtree->SetBranchAddress(
"eff_trig",&eff_trig_);
104 oldtree->SetBranchAddress(
"nleps",&nleps_);
105 oldtree->SetBranchAddress(
"nisr",&nisr_);
106 oldtree->SetBranchAddress(
"mgluino",&mgluino_);
108 for(
int ibch=0; ibch<nvar; ibch++){
109 switch (ivar_type[ibch]){
112 new_var_int_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_int_[ibch]);
break;
114 new_var_flt_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_flt_[ibch]);
break;
116 new_var_dbl_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_dbl_[ibch]);
break;
118 new_var_bool_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_bool_[ibch]);
break;
120 new_var_vint_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_vint_[ibch]);
break;
122 new_var_vflt_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_vflt_[ibch]);
break;
124 new_var_vdbl_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_vdbl_[ibch]);
break;
126 new_var_vbool_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_vbool_[ibch]);
break;
131 name.ReplaceAll(
".root",
"_renorm.root");
132 TFile* newfile =
new TFile(outdir+name,
"recreate");
133 TTree* newtree = oldtree->CloneTree(0);
136 int nentries = oldtree->GetEntries();
137 time_t begtime, endtime;
139 for(
int i=0; i<nentries; i++){
141 oldtree->GetEntry(i);
144 if(i%500000==0 || i==nentries-1) {
146 int seconds(difftime(endtime,begtime));
148 <<
" Took "<<setw(6)<<seconds<<
" seconds at " 149 <<setw(4)<<
roundNumber(i,1,seconds*1000.)<<
" kHz"<<endl;
155 for(
int iset=0; iset<nvar; iset++){
163 if(isLep[iset] && nleps_!=0) {
165 if(var[iset].
Contains(
"w_lep")) w_lep =
noNaN(new_var_flt_[iset]);
166 if(var[iset].
Contains(
"w_fs_lep")) w_fs_lep =
noNaN(new_var_flt_[iset]);
171 if(var[iset].
Contains(
"w_pu")) {w_pu_old =
noNaN(new_var_flt_[iset]); w_corr *= var_val[iset][0].Atof(); }
172 if(var[iset].
Contains(
"w_isr")) {w_isr_old =
noNaN(new_var_flt_[iset]); w_corr *= var_val[iset][0].Atof(); }
174 if(var[iset].
Contains(
"w_btag")) {w_btag_old =
noNaN(new_var_flt_[iset]); w_corr *= var_val[iset][0].Atof(); }
175 if(var[iset].
Contains(
"w_lumi")) {w_lumi_old =
noNaN(new_var_flt_[iset]); }
192 for(
unsigned int vidx=0; vidx<var_val[iset].size(); vidx++){
193 if(!multiply[iset][vidx]){
194 switch (ivar_type[iset]){
196 case kInt: new_var_int_[iset] = var_val[iset][vidx].Atoi();
break;
197 case kFloat: new_var_flt_[iset] = var_val[iset][vidx].Atof();
break;
198 case kDouble: new_var_dbl_[iset] =
static_cast<double>(var_val[iset][vidx].Atof());
break;
199 case kBool: new_var_bool_[iset] = var_val[iset][vidx].Atoi();
break;
200 case kvInt: new_var_vint_[iset]->at(vidx) = var_val[iset][vidx].Atoi();
break;
201 case kvFloat: new_var_vflt_[iset]->at(vidx) = var_val[iset][vidx].Atof();
break;
202 case kvDouble: new_var_vdbl_[iset]->at(vidx) =
static_cast<double>(var_val[iset][vidx].Atof());
break;
203 case kvBool: new_var_vbool_[iset]->at(vidx) = var_val[iset][vidx].Atoi();
break;
206 switch (ivar_type[iset]){
208 case kInt: new_var_int_[iset] *= var_val[iset][vidx].Atoi();
break;
209 case kFloat: new_var_flt_[iset] *= var_val[iset][vidx].Atof();
break;
210 case kDouble: new_var_dbl_[iset] *=
static_cast<double>(var_val[iset][vidx].Atof());
break;
211 case kvInt: new_var_vint_[iset]->at(vidx) *= var_val[iset][vidx].Atoi();
break;
212 case kvFloat: new_var_vflt_[iset]->at(vidx) *= var_val[iset][vidx].Atof();
break;
213 case kvDouble: new_var_vdbl_[iset]->at(vidx) *=
static_cast<double>(var_val[iset][vidx].Atof());
break;
216 cout<<
"[Change Branch One] WARNING: You cannot multiply Booleans. Skipping branch"<<endl;
220 if(ivar_type[iset] ==
kFloat) {
221 if(isnan(new_var_flt_[iset])) {
222 new_var_flt_[iset] = 1.;
223 if(i==0) cout<<endl<<
"==== WARNING: Branch \""<<var[iset]<<
"\" is NaN ====="<<endl<<endl;
224 }
else new_var_flt_[iset] =
noNaN(new_var_flt_[iset]);
226 if(ivar_type[iset] ==
kvFloat) new_var_vflt_[iset]->at(vidx) =
noNaN(new_var_vflt_[iset]->at(vidx));
227 if (name.Contains(
"SMS") && !name.Contains(
"TChi")){
228 vector<float> sys_isr;
229 w_isr_old =
wISR(nisr_, sys_isr);
230 if(var[iset].
Contains(
"sys_isr")) new_var_vflt_[iset]->at(vidx) = sys_isr[vidx] * var_val[iset][vidx].Atof();
232 new_var_flt_[iset] = w_isr_old * var_val[iset][vidx].Atof();
241 if(var[iset].
Contains(
"w_lep")) {w_lep = new_var_flt_[iset]; w_corr *= var_val[iset][0].Atof(); }
242 if(var[iset].
Contains(
"w_fs_lep")) {w_fs_lep = new_var_flt_[iset]; w_corr *= var_val[iset][0].Atof(); }
244 w_lumi = new_var_flt_[iset];
247 new_var_flt_[iset] *= -1;
249 w_corr *= w_lumi/w_lumi_old;
253 for(
int iset=0; iset<nvar; iset++)
255 new_var_flt_[iset] = w_lep * w_fs_lep * w_btag_old * w_isr_old * w_pu_old * w_lumi * eff_jetid_
256 * var_val[iset][0].Atof();
261 unsigned int new_nev_sample(0);
263 float xsec(0.), exsec(0.);
264 oldtreeglobal->SetBranchAddress(
"nev_sample", &new_nev_sample);
265 if(mgluino_>0) oldtreeglobal->SetBranchAddress(
"xsec", &new_xsec);
266 TTree* newtreeglobal = oldtreeglobal->CloneTree(0);
267 long nentriesg = oldtreeglobal->GetEntries();
268 for(
int i=0; i<nentriesg; i++){
269 oldtreeglobal->GetEntry(i);
270 new_nev_sample = totentries;
276 newtreeglobal->Fill();
280 newtreeglobal->AutoSave();
288 const TString &inname,
290 TRegexp regex_tag(tag,
true), regex_inname(inname,
true);
291 TString pwd(gSystem->pwd());
292 vector<TString> v_dirs;
293 TSystemDirectory dir(folder, folder);
294 TList *
files = dir.GetListOfFiles();
299 while ((file=static_cast<TSystemFile*>(next()))) {
300 fname = file->GetName();
302 if ((file->IsDirectory() && !fname.Contains(
".") && fname.Contains(regex_tag))) v_dirs.push_back(fname);
303 }
else if(fname.Contains(regex_inname)) v_dirs.push_back(fname);
311 vector<TString> var_val, TString newname){
313 if(var_type.size()!=var.size() || var_type.size()!=var_val.size())
314 { cout<<
"[Change Branch One] Error: Branch vectors are not the same size"<<endl; exit(0); }
316 const int nvar = var.size();
317 bool verbose =
false;
320 vector<bool> multiply(nvar,
false);
321 for(
int isetup=0; isetup<nvar; isetup++){
323 if(var_val[isetup].BeginsWith(
"*") || var_val[isetup].EndsWith(
"*")){
324 var_val[isetup].Remove(TString::kBoth,
'*');
325 multiply[isetup]=
true;
329 if(var_val[isetup]==
"true")
331 else if(var_val[isetup]==
"false")
336 TFile* oldfile =
new TFile(indir+
"/"+name);
337 TTree* oldtree =
static_cast<TTree*
>(oldfile->Get(
"tree"));
338 TTree* oldtreeglobal =
static_cast<TTree*
>(oldfile->Get(
"treeglobal"));
340 vector<int> new_var_int_(nvar,-999);
341 vector<float> new_var_flt_(nvar,-999);
342 vector<double> new_var_dbl_(nvar,-999);
343 deque<bool> new_var_bool_(nvar,
false);
344 vector<vector<int> * > new_var_vint_(nvar);
345 vector<vector<float> * > new_var_vflt_(nvar);
346 vector<vector<double> * > new_var_vdbl_(nvar);
347 vector<vector<bool> * > new_var_vbool_(nvar);
351 oldtree->SetBranchAddress(
"nleps",&nleps_);
353 for(
int ibch=0; ibch<nvar; ibch++){
354 if(var_type[ibch]==
"int") { new_var_int_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_int_[ibch]); }
355 else if(var_type[ibch]==
"float") { new_var_flt_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_flt_[ibch]); }
356 else if(var_type[ibch]==
"double") { new_var_dbl_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_dbl_[ibch]); }
357 else if(var_type[ibch]==
"bool") { new_var_bool_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_bool_[ibch]);
358 if(multiply[ibch]) cout<<
"[Change Branch One] Warning: Multiplying branch of type \"bool\". Skipping branch."<<endl; }
359 else if(var_type[ibch]==
"vint") { new_var_vint_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_vint_[ibch]); }
360 else if(var_type[ibch]==
"vfloat") { new_var_vflt_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_vflt_[ibch]); }
361 else if(var_type[ibch]==
"vdouble") { new_var_vdbl_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_vdbl_[ibch]); }
362 else if(var_type[ibch]==
"vbool") { new_var_vbool_[ibch] = 0; oldtree->SetBranchAddress(var[ibch], &new_var_vbool_[ibch]);
363 if(multiply[ibch]) cout<<
"[Change Branch One] Warning: Multiplying branch of type \"vbool\". Skipping branch."<<endl; }
365 else {cout<<
"[Change Branch One] Error: Branch type invalid. Use only \"int\", \"float\", \"double\", \"bool\", \"vint\", \"vfloat\", \"vdouble\", or\"vbool\""<<endl; exit(0);}
369 if(newname==
"empty"){
371 newname.ReplaceAll(
".root",
"_mod.root");
373 TFile* newfile =
new TFile(outdir+newname,
"recreate");
374 TTree* newtree = oldtree->CloneTree(0);
375 TTree* newtreeglobal = oldtreeglobal->CloneTree();
378 int nentries = oldtree->GetEntries();
379 for(
int i=0; i<nentries; i++){
380 oldtree->GetEntry(i);
382 if(verbose && ((i<100&&i%10==0) || (i<1000&&i%100==0) || (i<10000&&i%1000==0) || (i%10000==0))){
384 printf(
"\r[Change Branch One] Processsing File: %i / %i (%i%%)",i,nentries,static_cast<int>((i*100./nentries)));
386 if((i<100&&i+10>=nentries) || (i<1000&&i+100>=nentries) || (i<10000&&i+1000>=nentries) || (i>=10000&&i+10000>=nentries)) printf(
"\n");
391 for(
int iset=0; iset<nvar; iset++){
392 if(var[iset].
Contains(
"_lep")&&nleps_!=0)
continue;
394 if(var_type[iset]==
"int") new_var_int_[iset] = var_val[iset].Atoi();
395 else if(var_type[iset]==
"float") new_var_flt_[iset] = var_val[iset].Atof();
396 else if(var_type[iset]==
"double") new_var_dbl_[iset] =
static_cast<double>(var_val[iset].Atof());
397 else if(var_type[iset]==
"bool") new_var_bool_[iset] = var_val[iset].Atoi();
398 else if(var_type[iset]==
"vint")
399 for(
unsigned int vidx=0; vidx<new_var_vint_[iset]->size(); vidx++)
400 new_var_vint_[iset]->at(vidx) = var_val[iset].Atoi();
401 else if(var_type[iset]==
"vfloat")
402 for(
unsigned int vidx=0; vidx<new_var_vflt_[iset]->size(); vidx++)
403 new_var_vflt_[iset]->at(vidx) = var_val[iset].Atof();
404 else if(var_type[iset]==
"vdouble")
405 for(
unsigned int vidx=0; vidx<new_var_vdbl_[iset]->size(); vidx++)
406 new_var_vdbl_[iset]->at(vidx) =
static_cast<double>(var_val[iset].Atof());
407 else if(var_type[iset]==
"vbool")
408 for(
unsigned int vidx=0; vidx<new_var_vbool_[iset]->size(); vidx++)
409 new_var_vbool_[iset]->at(vidx) = var_val[iset].Atoi();
412 if(var_type[iset]==
"int") new_var_int_[iset] *= var_val[iset].Atoi();
413 else if(var_type[iset]==
"float") new_var_flt_[iset] *= var_val[iset].Atof();
414 else if(var_type[iset]==
"double") new_var_dbl_[iset] *= var_val[iset].Atof();
415 else if(var_type[iset]==
"vint")
416 for(
unsigned int vidx=0; vidx<new_var_vint_[iset]->size(); vidx++)
417 new_var_vint_[iset]->at(vidx) *= var_val[iset].Atoi();
418 else if(var_type[iset]==
"vfloat")
419 for(
unsigned int vidx=0; vidx<new_var_vflt_[iset]->size(); vidx++)
420 new_var_vflt_[iset]->at(vidx) *= var_val[iset].Atof();
421 else if(var_type[iset]==
"vdouble")
422 for(
unsigned int vidx=0; vidx<new_var_vdbl_[iset]->size(); vidx++)
423 new_var_vdbl_[iset]->at(vidx) *=
static_cast<double>(var_val[iset].Atof());
431 newtreeglobal->AutoSave();
437 bool eigen2x2(
float matrix[2][2],
float &eig1,
float &eig2){
438 float root = pow(matrix[0][0],2) + pow(matrix[1][1],2)-2*matrix[0][0]*matrix[1][1]+4*matrix[0][1]*matrix[1][0];
439 if(root<0)
return false;
441 eig1 = (matrix[0][0]+matrix[1][1]+sqrt(root))/2.;
442 eig2 = (matrix[0][0]+matrix[1][1]-sqrt(root))/2.;
447 return left.second > right.second;
451 return left.first < right.first;
455 return left.first > right.first;
458 long double DeltaPhi(
long double phi1,
long double phi2){
459 long double dphi = fmod(fabs(phi2-phi1), 2.L*
PI);
460 return dphi>PI ? 2.L*PI-dphi : dphi;
464 long double dphi = fmod(phi2-phi1, 2.L*
PI);
474 float dR(
float eta1,
float eta2,
float phi1,
float phi2) {
479 if(denom==0)
return " - ";
480 double neg = 1;
if(num*denom<0) neg = -1;
481 num /= neg*denom; num += 0.5*pow(10.,-decimals);
482 long num_int =
static_cast<long>(num);
483 long num_dec =
static_cast<long>((1+num-num_int)*pow(10.,decimals));
484 TString s_dec =
""; s_dec += num_dec; s_dec.Remove(0,1);
486 if(neg<0) result+=
"-";
489 result+=
"."; result+=s_dec;
492 TString afterdot = result;
493 afterdot.Remove(0,afterdot.First(
".")+1);
494 for(
int i=0; i<decimals-afterdot.Length(); i++)
500 TString result(
""); result += num;
501 int posdot(result.First(
'.'));
502 if(posdot==-1) posdot = result.Length();
503 for(
int ind(posdot-3);
ind > 0;
ind -= 3)
504 result.Insert(
ind,
",");
510 const long double temp = y;
515 const long double rat=y/x;
516 return fabs(x)*sqrt(1.0L+rat*rat);
519 long double GetMass(
long double e,
long double px,
long double py,
long double pz){
521 return fabs(e)*sqrt(1.0L-px*px-py*py-pz*pz);
524 long double GetMT(
long double m1,
long double pt1,
long double phi1,
525 long double m2,
long double pt2,
long double phi2){
526 return sqrt(m1*m1+m2*m2+2.L*(sqrt((m1*m1+pt1*pt1)*(m2*m2+pt2*pt2))-pt1*pt2*cos(phi2-phi1)));
529 long double GetMT(
long double pt1,
long double phi1,
530 long double pt2,
long double phi2){
532 return sqrt(2.L*pt1*pt2*(1.L-cos(phi2-phi1)));
535 bool Contains(
const string& text,
const string& pattern){
536 return text.find(pattern) != string::npos;
540 const string& tokens){
541 char* ipt(
new char[input.size()+1]);
542 memcpy(ipt, input.data(), input.size());
543 ipt[input.size()]=
static_cast<char>(0);
544 char* ptr(strtok(ipt, tokens.c_str()));
545 vector<string> output(0);
547 output.push_back(ptr);
548 ptr=strtok(NULL, tokens.c_str());
556 double& uncertainty){
557 const string hist_name(
"temp");
558 TH1D temp(hist_name.c_str(),
"", 1, -1.0, 1.0);
559 tree.Project(hist_name.c_str(),
"0.0", cut.c_str());
560 count=temp.IntegralAndError(0,2,uncertainty);
564 graph.SetPoint(graph.GetN(), x, y);
568 FILE *pipe = popen(cmd.c_str(),
"r");
569 if(!pipe)
throw runtime_error(
"Could not open pipe.");
570 const size_t buffer_size = 128;
571 char buffer[buffer_size];
574 if(fgets(buffer, buffer_size, pipe) != NULL) result += buffer;
582 while(!str.empty() && str.at(str.length()-1) ==
'\n'){
583 str.erase(str.length()-1);
589 vector<double> pts(npts,low+0.5*(high-low));
591 double gap = (high-low)/(npts-1.0);
592 for(
size_t pt = 0; pt < npts; ++pt){
593 pts.at(pt) = low+pt*gap;
600 int minutes((seconds/60)%60), hours(seconds/3600);
602 if(hours<10) hhmmss +=
"0";
603 hhmmss += hours; hhmmss +=
":";
604 if(minutes<10) hhmmss +=
"0";
605 hhmmss += minutes; hhmmss +=
":";
606 if((seconds%60)<10) hhmmss +=
"0";
607 hhmmss += seconds%60;
612 float wISR(
int nisr, vector<float> & sys_isr){
613 float isr_wgt = -999.;
614 const float isr_norm_tt = 1.117;
615 if (nisr==0) isr_wgt = 1.;
616 else if (nisr==1) isr_wgt = 0.882;
617 else if (nisr==2) isr_wgt = 0.792;
618 else if (nisr==3) isr_wgt = 0.702;
619 else if (nisr==4) isr_wgt = 0.648;
620 else if (nisr==5) isr_wgt = 0.601;
621 else if (nisr>=6) isr_wgt = 0.515;
624 float absolute_unc = (1-isr_wgt)/2.;
626 sys_isr[0] = isr_norm_tt*(isr_wgt+absolute_unc);
627 sys_isr[1] = isr_norm_tt*(isr_wgt-absolute_unc);
629 return isr_wgt*isr_norm_tt;
635 TChain chain(
"tree");
636 for(
size_t ind=0;
ind<ntuples.size();
ind++) chain.Add(ntuples[
ind]);
637 chain.Merge(outname);
640 TChain chaing(
"treeglobal");
641 for(
size_t ind=0; ind<ntuples.size(); ind++) chaing.Add(ntuples[ind]);
642 TTree *tglobal = chaing.CopyTree(
"1");
643 tglobal->SetDirectory(0);
TString addCommas(double num)
void AddPoint(TGraph &graph, const double x, const double y)
vector< double > LinearSpacing(size_t npts, double low, double high)
int change_branch_one(TString indir, TString name, TString outdir, vector< TString > var_type, vector< TString > var, vector< vector< TString > > var_val, int totentries)
string execute(const string &cmd)
void stopCrossSection(int stop_mass, float &xsec, float &xsec_unc)
TString roundNumber(double num, int decimals, double denom)
void get_count_and_uncertainty(TTree &tree, const string &cut, double &count, double &uncertainty)
string RemoveTrailingNewlines(string str)
float dR(float eta1, float eta2, float phi1, float phi2)
std::pair< int, double > int_double
void signalCrossSection(int glu_mass, float &xsec, float &xsec_unc)
vector< TString > dirlist(const TString &folder, const TString &inname, const TString &tag)
T noNaN(T val, T defval=1.)
bool dd_big2small(const double_double &left, const double_double &right)
vector< string > Tokenize(const string &input, const string &tokens)
void mergeNtuples(vector< TString > ntuples, TString outname)
bool Contains(const string &text, const string &pattern)
long double AddInQuadrature(long double x, long double y)
long double GetMT(long double m1, long double pt1, long double phi1, long double m2, long double pt2, long double phi2)
bool id_big2small(const int_double &left, const int_double &right)
bool eigen2x2(float matrix[2][2], float &eig1, float &eig2)
long double GetMass(long double e, long double px, long double py, long double pz)
float wISR(int nisr, vector< float > &sys_isr)
TString hoursMinSec(long seconds)
long double SignedDeltaPhi(long double phi1, long double phi2)
long double DeltaPhi(long double phi1, long double phi2)
bool dd_small2big(const double_double &left, const double_double &right)
std::pair< double, double > double_double