forked from h2gglobe/h2gglobe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SampleContainer.cc
52 lines (45 loc) · 1.26 KB
/
SampleContainer.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
#include "SampleContainer.h"
#include <utility>
#include <iostream>
SampleContainer::~SampleContainer()
{}
float SampleContainer::defaultextw=1.;
SampleContainer::SampleContainer(const float * extw) :
extweight(extw)
{
intweight = 1;
itype = 0;
ind = 0;
histoplotit = 1;
filesshortnam = "";
ntot = 0;
nred = 0;
lumi = 0;
xsec = 0;
kfactor= 1;
scale = 1;
lumireal = 1;
hasLumiSelection = false;
hasEventList = false;
pileup = "";
}
void SampleContainer::computeWeight(float intL) {
if(itype==0) { //this is data
intweight = 1;
} else {
std::cout << "Computing Weight for type - " << itype << ", Using " << ntot << " Processed Events" << std::endl;
intweight = kfactor*scale*xsec*intL/ntot;
}
}
// ----------------------------------------------------------------------------------------------------------------------
void SampleContainer::addGoodLumi(int run, int lumi1, int lumi2 )
{
hasLumiSelection = true;
goodLumis[run].push_back( std::make_pair(lumi1,lumi2) );
}
// ----------------------------------------------------------------------------------------------------------------------
void SampleContainer::addEventToList(int run, int lumi, int event )
{
hasEventList = true;
eventList[run].push_back( std::make_pair(lumi,event) );
}