23 #include "TLorentzVector.h"
38 produces<edm::ValueMap<float>>(
"costheta");
39 produces<edm::ValueMap<float>>(
"sin2theta");
40 produces<edm::ValueMap<float>>(
"tanphi");
54 std::vector<float> values2;
55 std::vector<float> values3;
58 double costheta = -10.0;
59 double sin2theta = -10.0;
60 double tanphi = -10.0;
64 TLorentzVector
mu(0., 0., 0., 0.);
65 TLorentzVector
mubar(0., 0., 0., 0.);
67 int charge1 = 0, charge2 = 0;
68 double res[3] = {-10., -10., -10.};
72 for (boson = bosons->begin(); boson != endbosons; ++boson) {
73 daughter1 = boson->daughter(0);
74 daughter2 = boson->daughter(1);
76 if (!(
nullptr == daughter1 ||
nullptr == daughter2)) {
78 charge1 = daughter1->charge();
79 charge2 = daughter2->charge();
80 isOS = charge1 * charge2 < 0;
81 if (isOS && charge1 < 0) {
82 mu.SetPxPyPzE(daughter1->px(), daughter1->py(), daughter1->pz(), daughter1->energy());
83 mubar.SetPxPyPzE(daughter2->px(), daughter2->py(), daughter2->pz(), daughter2->energy());
85 if (isOS && charge1 > 0) {
86 mu.SetPxPyPzE(daughter2->px(), daughter2->py(), daughter2->pz(), daughter2->energy());
87 mubar.SetPxPyPzE(daughter1->px(), daughter1->py(), daughter1->pz(), daughter1->energy());
97 values.push_back(costheta);
98 values2.push_back(sin2theta);
99 values3.push_back(tanphi);
103 auto valMap = std::make_unique<ValueMap<float>>();
110 auto valMap2 = std::make_unique<ValueMap<float>>();
112 filler2.insert(bosons, values2.begin(), values2.end());
117 auto valMap3 = std::make_unique<ValueMap<float>>();
119 filler3.insert(bosons, values3.begin(), values3.end());
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
ColinsSoperVariablesComputer(const edm::ParameterSet &iConfig)
edm::EDGetTokenT< edm::View< reco::Candidate > > parentBosonToken_
void calCSVariables(TLorentzVector mu, TLorentzVector mubar, double *res, bool swap)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
~ColinsSoperVariablesComputer() override