ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/AnaTools/src/StopCTauWeight.cc
Revision: 1.1
Committed: Fri May 3 20:09:35 2013 UTC (12 years ago) by ahart
Content type: text/plain
Branch: MAIN
CVS Tags: V02-03-02, V02-03-01, V02-03-00, V02-02-00, V02-01-01, V02-01-00, V01-01-00, V01-00-01, V01-00-00, V00-01-00, HEAD
Log Message:
Moved here from DisplacedSUSY/Configuration/src/CTauWeight.cc so we can get rid of the DISPLACED_SUSY macro.

File Contents

# Content
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 }