1 |
#include "OSUT3Analysis/AnaTools/interface/StopCTauWeight.h"
|
2 |
|
3 |
StopCTauWeight::StopCTauWeight (double currentCTau, double targetCTau) :
|
4 |
currentCTau_ (currentCTau),
|
5 |
targetCTau_ (targetCTau)
|
6 |
{
|
7 |
}
|
8 |
|
9 |
StopCTauWeight::StopCTauWeight (double currentCTau, double targetCTau, edm::InputTag stops) :
|
10 |
currentCTau_ (currentCTau),
|
11 |
targetCTau_ (targetCTau),
|
12 |
stops_ (stops)
|
13 |
{
|
14 |
}
|
15 |
|
16 |
StopCTauWeight::~StopCTauWeight ()
|
17 |
{
|
18 |
}
|
19 |
|
20 |
double
|
21 |
StopCTauWeight::operator[] (const BNstopCollection &stops)
|
22 |
{
|
23 |
double weight, ctau0, ctau1;
|
24 |
|
25 |
if (stops.size () != 2)
|
26 |
cout << "Wrong number of stops!: " << stops.size () << endl;
|
27 |
ctau0 = stops.at (0).ctau;
|
28 |
ctau1 = stops.at (1).ctau;
|
29 |
|
30 |
weight = (currentCTau_ / targetCTau_) * (currentCTau_ / targetCTau_);
|
31 |
weight *= exp (-(ctau0 + ctau1) * ((1 / targetCTau_) - (1 / currentCTau_)));
|
32 |
|
33 |
return weight;
|
34 |
}
|
35 |
|
36 |
double
|
37 |
StopCTauWeight::operator[] (const edm::Event &event)
|
38 |
{
|
39 |
edm::Handle<BNstopCollection> stops;
|
40 |
event.getByLabel (stops_, stops);
|
41 |
|
42 |
return (*this)[*stops.product ()];
|
43 |
}
|