|
void | addEvent (float mass, float me, float me2, float weight=1) |
|
void | sift () |
|
void | adjustWeights (float refth=3.) |
|
void | mergeBin (const ExtBin &other) |
|
void | addEvent (SimpleEntry evt) |
|
void | addEvent (int ev, float trueval, float recoval, float recotrackval=0, float weight=1) |
|
void | sortByRecoMinusTrueVals (vector< pair< float, int >> &res) |
|
void | sortByRecoVals (vector< pair< float, int >> &res) |
|
void | sift (double threshold=0.998, bool use_recominustrue=false) |
|
void | adjustWeights (float refth=-1) |
|
void | mergeBin (const ExtBin &other) |
|
Definition at line 111 of file calcC_lintolog.c.
◆ addEvent() [1/3]
void ExtBin::addEvent |
( |
float |
mass, |
|
|
float |
me, |
|
|
float |
me2, |
|
|
float |
weight = 1 |
|
) |
| |
|
inline |
◆ addEvent() [2/3]
void ExtBin::addEvent |
( |
int |
ev, |
|
|
float |
trueval, |
|
|
float |
recoval, |
|
|
float |
recotrackval = 0 , |
|
|
float |
weight = 1 |
|
) |
| |
|
inline |
◆ addEvent() [3/3]
◆ adjustWeights() [1/2]
void ExtBin::adjustWeights |
( |
float |
refth = -1 | ) |
|
|
inline |
Definition at line 228 of file getResolution.c.
231 vector<pair<float, int>> weight_entry;
233 int bin=weight_entry.size()-1;
235 int at99p0ev = (float(weight_entry.size()))*0.99;
236 if (at99p0ev==(
int)weight_entry.size()) at99p0ev--;
237 float threshold = weight_entry.at(at99p0ev).first;
238 while (bin>at99p0ev){
240 threshold*2.<weight_entry.at(bin).first
242 if (weight_entry.at(bin).first==0.) cerr <<
"Weight=0!" << endl;
243 collection.at(weight_entry.at(bin).second).weight = pow(threshold, 2)/weight_entry.at(bin).first;
244 cout <<
"Adjusting weight for event " << bin << endl;
253 if (sum[0]==0. || sum[1]==0.) cerr <<
"sum[0]=" << sum[0] <<
" or sum[1]=" << sum[1] <<
" is invalid." << endl;
◆ adjustWeights() [2/2]
void ExtBin::adjustWeights |
( |
float |
refth = 3. | ) |
|
|
inline |
Definition at line 158 of file calcC_lintolog.c.
159 if (
masses.size()==0)
return;
161 vector<pair<float, int>> weight_entry;
163 int bin=weight_entry.size()-1;
165 int at99p0ev = (float(weight_entry.size()))*0.99;
166 if (at99p0ev==(
int)weight_entry.size()) at99p0ev--;
167 float threshold = weight_entry.at(at99p0ev).first;
168 while (bin>at99p0ev){
170 threshold*2.<weight_entry.at(bin).first
172 weights.at(weight_entry.at(bin).second) = pow(threshold, 2)/weight_entry.at(bin).first;
173 cout <<
"Adjusting weight for event " << bin << endl;
◆ mergeBin() [1/2]
void ExtBin::mergeBin |
( |
const ExtBin & |
other | ) |
|
|
inline |
Definition at line 190 of file calcC_lintolog.c.
200 cerr <<
"Size of the following elements are not the same:" << endl;
201 cerr <<
"\t- Events: " << other.
events.size() << endl;
202 cerr <<
"\t- Masses: " << other.
masses.size() << endl;
203 cerr <<
"\t- MEs: " << other.
mevals.size() << endl;
204 cerr <<
"\t- MEs (2): " << other.
me2vals.size() << endl;
205 cerr <<
"\t- Weights: " << other.
weights.size() << endl;
◆ mergeBin() [2/2]
void ExtBin::mergeBin |
( |
const ExtBin & |
other | ) |
|
|
inline |
◆ sift() [1/2]
Definition at line 126 of file calcC_lintolog.c.
127 if (
masses.size()==0)
return;
129 vector<int> take_out;
130 vector<pair<float, int>> me_entry[2];
132 addByLowest<float, int>(me_entry[0],
mevals.at(
ev),
ev);
133 addByLowest<float, int>(me_entry[1],
me2vals.at(
ev),
ev);
135 for (
unsigned int im=0; im<2; im++){
136 int at99p8ev = (float(me_entry[im].size()))*0.998;
137 if (at99p8ev==(
int)me_entry[im].size()) at99p8ev--;
138 int bin=me_entry[im].size()-1;
139 while (bin>at99p8ev){
141 me_entry[im].at(at99p8ev).first*2.<me_entry[im].at(bin).first
142 ) addByLowest<int>(take_out, me_entry[im].at(bin).second,
true);
146 for (
int bin=take_out.size()-1; bin>=0; bin--){
147 int t_ev = take_out.at(bin);
148 cout <<
"Discarding event " <<
events.at(t_ev) << endl;
149 vector<int>::iterator itev;
150 vector<float>::iterator it;
◆ sift() [2/2]
void ExtBin::sift |
( |
double |
threshold = 0.998 , |
|
|
bool |
use_recominustrue = false |
|
) |
| |
|
inline |
Definition at line 200 of file getResolution.c.
203 vector<int> take_out;
204 vector<pair<float, int>> theEntries;
207 for (
unsigned int im=0; im<2; im++){
208 int at99p8ev = std::floor((
float(theEntries.size()))*threshold);
209 int bin=theEntries.size()-1;
210 while (bin>at99p8ev){
212 theEntries.at(at99p8ev).first*2.<theEntries.at(bin).first
213 ) addByLowest<int>(take_out, theEntries.at(bin).second,
true);
217 for (
int bin=take_out.size()-1; bin>=0; bin--){
218 int t_ev = take_out.at(bin);
219 cout <<
"Attempting to discard event at position " << t_ev << endl;
220 if (t_ev>=(
int)
collection.size()) cerr <<
"Collection size " <<
collection.size() <<
" >= " << t_ev << endl;
222 cout <<
"Discarding event " <<
collection.at(t_ev).id <<
" at position " << t_ev << endl;
223 vector<SimpleEntry>::iterator it;
◆ sortByRecoMinusTrueVals()
void ExtBin::sortByRecoMinusTrueVals |
( |
vector< pair< float, int >> & |
res | ) |
|
|
inline |
◆ sortByRecoVals()
void ExtBin::sortByRecoVals |
( |
vector< pair< float, int >> & |
res | ) |
|
|
inline |
◆ binhigh
◆ binlow
◆ collection
◆ events
vector<int> ExtBin::events |
◆ masses
vector<float> ExtBin::masses |
◆ me2vals
vector<float> ExtBin::me2vals |
◆ mevals
vector<float> ExtBin::mevals |
◆ weights
vector<float> ExtBin::weights |
The documentation for this struct was generated from the following files:
vector< SimpleEntry > collection
void sortByRecoVals(vector< pair< float, int >> &res)
void addEvent(float mass, float me, float me2, float weight=1)
void sortByRecoMinusTrueVals(vector< pair< float, int >> &res)