69 std::vector<reco::GenParticle>
muons_;
110 pMin_(iConfig.getParameter<
double>(
"pMin")),
111 ptMin_(iConfig.getParameter<
double>(
"ptMin")),
112 etaMin_(iConfig.getParameter<
double>(
"etaMin")),
113 etaMax_(iConfig.getParameter<
double>(
"etaMax")),
114 phiMin_(iConfig.getParameter<
double>(
"phiMin")),
115 phiMax_(iConfig.getParameter<
double>(
"phiMax")),
116 minMassPair_(iConfig.getParameter<
double>(
"minMassPair")),
117 maxMassPair_(iConfig.getParameter<
double>(
"maxMassPair")),
118 muonInfo_(minMassPair_, maxMassPair_),
119 muonInfoFromZ_(minMassPair_, maxMassPair_)
123 muonInfo_.setupTree(
"di_muon", fs);
124 muonInfoFromZ_.setupTree(
"di_muon_from_Z", fs);
144 iEvent.
getByToken(genParticlesToken_, genParticles);
146 for (
const auto& particle: *(genParticles.
product())) {
147 if (
std::abs(particle.pdgId()) != muonPdg_ || particle.status() != 1)
continue;
148 if (particle.p() < pMin_)
continue;
149 if (particle.pt() < ptMin_)
continue;
150 if (particle.eta() < etaMin_ || particle.eta() > etaMax_)
continue;
151 if (particle.phi() < phiMin_ || particle.phi() > phiMax_)
continue;
153 muonInfo_.muons().push_back(particle);
154 if (particle.mother()->pdgId() == zBosonPdg_) {
155 muonInfoFromZ_.muons().push_back(particle);
160 muonInfoFromZ_.fill();
169 desc.
setComment(
"Extract information on 'Z -> mu mu' decays.");
170 desc.
add<
double>(
"pMin", 3.0);
171 desc.
add<
double>(
"ptMin", 15.0);
172 desc.
add<
double>(
"etaMin", -3.0);
173 desc.
add<
double>(
"etaMax", 3.0);
174 desc.
add<
double>(
"phiMin", -3.1416);
175 desc.
add<
double>(
"phiMax", 3.1416);
176 desc.
add<
double>(
"minMassPair", 85.8);
177 desc.
add<
double>(
"maxMassPair", 95.8);
178 descriptions.
add(
"zMuMuMassConstraintParameterFinder", desc);
186 minMassPair_{minMass},
197 tree_ = fs->
make<TTree>(name.c_str(), name.c_str());
198 tree_->Branch(
"muons", &muons_);
199 tree_->Branch(
"di_muon_mass", &diMuonMass_);
200 tree_->Branch(
"pdg_mother", &pdgMother_);
201 tree_->Branch(
"in_mass_window", &passed_);
210 if (muons_.size() == 2) {
211 diMuonMass_ = (muons_[0].p4() + muons_[1].p4()).M();
212 pdgMother_ = muons_[0].mother()->pdgId();
213 if (diMuonMass_ > minMassPair_ && diMuonMass_ < maxMassPair_) passed_ =
true;
static const std::string kSharedResource
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
const double maxMassPair_
std::vector< reco::GenParticle > & muons()
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
T * make(const Args &...args) const
make new ROOT object
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
helper class containing information about a di-muon system
void setupTree(const std::string &, edm::Service< TFileService > &)
void setComment(std::string const &value)
virtual 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)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const double maxMassPair_
T const * product() const
~ZMuMuMassConstraintParameterFinder()
const double minMassPair_
std::vector< reco::GenParticle > muons_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
ZMuMuMassConstraintParameterFinder(const edm::ParameterSet &)
const double minMassPair_