65 std::vector<reco::GenParticle>
muons_;
104 pMin_(iConfig.getParameter<
double>(
"pMin")),
105 ptMin_(iConfig.getParameter<
double>(
"ptMin")),
106 etaMin_(iConfig.getParameter<
double>(
"etaMin")),
107 etaMax_(iConfig.getParameter<
double>(
"etaMax")),
108 phiMin_(iConfig.getParameter<
double>(
"phiMin")),
109 phiMax_(iConfig.getParameter<
double>(
"phiMax")),
110 minMassPair_(iConfig.getParameter<
double>(
"minMassPair")),
111 maxMassPair_(iConfig.getParameter<
double>(
"maxMassPair")),
112 muonInfo_(minMassPair_, maxMassPair_),
113 muonInfoFromZ_(minMassPair_, maxMassPair_) {
116 muonInfo_.setupTree(
"di_muon",
fs);
117 muonInfoFromZ_.setupTree(
"di_muon_from_Z",
fs);
129 for (
const auto& particle : *(
genParticles.product())) {
132 if (particle.p() <
pMin_)
134 if (particle.pt() <
ptMin_)
142 if (particle.mother()->pdgId() ==
zBosonPdg_) {
154 desc.setComment(
"Extract information on 'Z -> mu mu' decays.");
155 desc.add<
double>(
"pMin", 3.0);
156 desc.add<
double>(
"ptMin", 15.0);
157 desc.add<
double>(
"etaMin", -3.0);
158 desc.add<
double>(
"etaMax", 3.0);
161 desc.add<
double>(
"minMassPair", 85.8);
162 desc.add<
double>(
"maxMassPair", 95.8);
163 descriptions.
add(
"zMuMuMassConstraintParameterFinder",
desc);
167 ZMuMuMassConstraintParameterFinder ::DiMuonInfo ::DiMuonInfo(
double minMass,
double maxMass)
170 void ZMuMuMassConstraintParameterFinder ::DiMuonInfo ::setupTree(
const std::string&
name,
172 tree_ =
fs->make<TTree>(
name.c_str(),
name.c_str());
173 tree_->Branch(
"muons", &muons_);
174 tree_->Branch(
"di_muon_mass", &diMuonMass_);
175 tree_->Branch(
"pdg_mother", &pdgMother_);
176 tree_->Branch(
"in_mass_window", &passed_);
180 if (muons_.size() == 2) {
181 diMuonMass_ = (muons_[0].p4() + muons_[1].p4()).M();
182 pdgMother_ = muons_[0].mother()->pdgId();
static const std::string kSharedResource
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
const double maxMassPair_
std::vector< reco::GenParticle > & muons()
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
helper class containing information about a di-muon system
void setupTree(const std::string &, edm::Service< TFileService > &)
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< reco::GenParticleCollection > genParticlesToken_
DiMuonInfo(double, double)
DiMuonInfo muonInfoFromZ_
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
const double maxMassPair_
~ZMuMuMassConstraintParameterFinder() override=default
const double minMassPair_
std::vector< reco::GenParticle > muons_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
ZMuMuMassConstraintParameterFinder(const edm::ParameterSet &)
const double minMassPair_