41 #define SET_PAR(TYPE, NAME, PSET) (NAME = PSET.getParameter<TYPE>(#NAME)) 124 for (iSel = 0; iSel < nSel; ++iSel)
180 produces<pat::CompositeCandidateCollection>(
oniaName);
182 produces<pat::CompositeCandidateCollection>(
sdName);
184 produces<pat::CompositeCandidateCollection>(
ssName);
186 produces<pat::CompositeCandidateCollection>(
buName);
188 produces<pat::CompositeCandidateCollection>(
bdName);
190 produces<pat::CompositeCandidateCollection>(
bsName);
192 produces<pat::CompositeCandidateCollection>(
k0Name);
194 produces<pat::CompositeCandidateCollection>(
l0Name);
196 produces<pat::CompositeCandidateCollection>(
b0Name);
198 produces<pat::CompositeCandidateCollection>(
lbName);
200 produces<pat::CompositeCandidateCollection>(
bcName);
202 produces<pat::CompositeCandidateCollection>(
x3872Name);
207 desc.add<
string>(
"pVertexLabel",
"");
208 desc.add<
string>(
"patMuonLabel",
"");
209 desc.add<
string>(
"ccCandsLabel",
"");
210 desc.add<
string>(
"pfCandsLabel",
"");
211 desc.add<
string>(
"pcCandsLabel",
"");
212 desc.add<
string>(
"gpCandsLabel",
"");
213 desc.add<
string>(
"k0CandsLabel",
"");
214 desc.add<
string>(
"l0CandsLabel",
"");
215 desc.add<
string>(
"kSCandsLabel",
"");
216 desc.add<
string>(
"lSCandsLabel",
"");
217 desc.add<
string>(
"oniaName",
"oniaCand");
218 desc.add<
string>(
"sdName",
"kx0Cand");
219 desc.add<
string>(
"ssName",
"phiCand");
220 desc.add<
string>(
"buName",
"buFitted");
221 desc.add<
string>(
"bdName",
"bdFitted");
222 desc.add<
string>(
"bsName",
"bsFitted");
223 desc.add<
string>(
"k0Name",
"k0Fitted");
224 desc.add<
string>(
"l0Name",
"l0Fitted");
225 desc.add<
string>(
"b0Name",
"b0Fitted");
226 desc.add<
string>(
"lbName",
"lbFitted");
227 desc.add<
string>(
"bcName",
"bcFitted");
228 desc.add<
string>(
"x3872Name",
"x3872Fitted");
229 desc.add<
bool>(
"writeVertex",
true);
230 desc.add<
bool>(
"writeMomentum",
true);
232 dpar.
add<
string>(
"name");
233 dpar.add<
double>(
"ptMin", -2.0e35);
234 dpar.add<
double>(
"etaMax", -2.0e35);
235 dpar.add<
double>(
"mJPsiMin", -2.0e35);
236 dpar.add<
double>(
"mJPsiMax", -2.0e35);
237 dpar.add<
double>(
"mKx0Min", -2.0e35);
238 dpar.add<
double>(
"mKx0Max", -2.0e35);
239 dpar.add<
double>(
"mPhiMin", -2.0e35);
240 dpar.add<
double>(
"mPhiMax", -2.0e35);
241 dpar.add<
double>(
"mK0sMin", -2.0e35);
242 dpar.add<
double>(
"mK0sMax", -2.0e35);
243 dpar.add<
double>(
"mLambda0Min", -2.0e35);
244 dpar.add<
double>(
"mLambda0Max", -2.0e35);
245 dpar.add<
double>(
"massMin", -2.0e35);
246 dpar.add<
double>(
"massMax", -2.0e35);
247 dpar.add<
double>(
"probMin", -2.0e35);
248 dpar.add<
double>(
"massFitMin", -2.0e35);
249 dpar.add<
double>(
"massFitMax", -2.0e35);
250 dpar.add<
double>(
"constrMass", -2.0e35);
251 dpar.add<
double>(
"constrSigma", -2.0e35);
252 dpar.add<
bool>(
"constrMJPsi",
true);
253 dpar.add<
bool>(
"writeCandidate",
true);
254 vector<edm::ParameterSet> rpar;
255 desc.addVPSet(
"recoSelect", dpar, rpar);
256 descriptions.
add(
"bphWriteSpecificDecay",
desc);
319 int npv = pVertices->size();
327 nrc = pfCands->size();
337 nrc = pcCands->size();
344 nrc = gpCands->size();
379 vector<const reco::Candidate*> muDaugs;
380 set<const pat::Muon*> muonSet;
381 typedef multimap<const reco::Candidate*, const pat::CompositeCandidate*> mu_cc_map;
386 int n = ccCands->size();
390 set<const pat::Muon*>::const_iterator iter;
391 set<const pat::Muon*>::const_iterator iend;
393 for (
i = 0;
i <
n; ++
i) {
397 for (
j = 0;
j <
m; ++
j) {
400 iter = muonSet.
begin();
401 iend = muonSet.end();
402 bool add = (mp !=
nullptr) && (muonSet.find(mp) == iend);
403 while (
add && (iter != iend)) {
410 muCCMap.insert(pair<const reco::Candidate*, const pat::CompositeCandidate*>(
dp, &cc));
413 iter = muonSet.begin();
414 iend = muonSet.end();
416 muDaugs.push_back(*iter++);
419 map<recoType, map<parType, double>>::const_iterator rIter =
parMap.begin();
420 map<recoType, map<parType, double>>::const_iterator rIend =
parMap.end();
434 if (onia !=
nullptr) {
435 while (rIter != rIend) {
436 const map<recoType, map<parType, double>>
::value_type& rEntry = *rIter++;
438 const map<parType, double>&
pMap = rEntry.second;
465 map<parType, double>::const_iterator pIter =
pMap.begin();
466 map<parType, double>::const_iterator pIend =
pMap.end();
467 while (pIter != pIend) {
470 double pv = pEntry.second;
504 int nFull =
lFull.size();
505 map<const BPHRecoCandidate*, const reco::Vertex*> oniaVtxMap;
507 typedef mu_cc_map::const_iterator mu_cc_iter;
508 for (iFull = 0; iFull < nFull; ++iFull) {
512 const std::vector<const reco::Candidate*>& daugs = ptr->
daughters();
516 pair<mu_cc_iter, mu_cc_iter> cc0 = muCCMap.equal_range(ptr->
originalReco(daugs[0]));
517 pair<mu_cc_iter, mu_cc_iter> cc1 = muCCMap.equal_range(ptr->
originalReco(daugs[1]));
518 mu_cc_iter iter0 = cc0.first;
519 mu_cc_iter iend0 = cc0.second;
520 mu_cc_iter iter1 = cc1.first;
521 mu_cc_iter iend1 = cc1.second;
522 while ((iter0 != iend0) && (pVtx ==
nullptr)) {
524 while (iter1 != iend1) {
525 if (ccp != iter1++->
second)
530 float dMin = 999999.;
532 for (ipv = 0; ipv < npv; ++ipv) {
535 float dist =
pow(pPos.x() - tPos.x(), 2) +
pow(pPos.y() - tPos.y(), 2) +
pow(pPos.z() - tPos.z(), 2);
549 if (pVtx ==
nullptr) {
559 float minDz = 999999.;
560 float extrapZ = (
state ? ttmd.
points().first.z() : -9e20);
562 for (ipv = 0; ipv < npv; ++ipv) {
573 oniaVtxMap[ptr] = pVtx;
583 int nJPsi =
lJPsi.size();
593 int nj =
lJPsi.size();
594 int no =
lFull.size();
595 for (ij = 0; ij < nj; ++ij) {
597 for (io = 0; io < no; ++io) {
621 if (rIter != rIend) {
622 const map<parType, double>&
pMap = rIter->second;
623 map<parType, double>::const_iterator pIter =
pMap.begin();
624 map<parType, double>::const_iterator pIend =
pMap.end();
625 while (pIter != pIend) {
628 double pv = pEntry.second;
674 vector<BPHPlusMinusConstCandPtr> lKx0;
688 if (kx0 !=
nullptr) {
690 if (rIter != rIend) {
691 const map<parType, double>&
pMap = rIter->second;
692 map<parType, double>::const_iterator pIter =
pMap.begin();
693 map<parType, double>::const_iterator pIend =
pMap.end();
694 while (pIter != pIend) {
697 double pv = pEntry.second;
726 int nKx0 = lKx0.size();
733 if (rIter != rIend) {
734 const map<parType, double>&
pMap = rIter->second;
735 map<parType, double>::const_iterator pIter =
pMap.begin();
736 map<parType, double>::const_iterator pIend =
pMap.end();
737 while (pIter != pIend) {
740 double pv = pEntry.second;
743 bd->setJPsiMassMin(
pv);
746 bd->setJPsiMassMax(
pv);
749 bd->setKxMassMin(
pv);
752 bd->setKxMassMax(
pv);
764 bd->setMassFitMin(
pv);
767 bd->setMassFitMax(
pv);
770 bd->setConstr(
pv > 0);
784 set<BPHRecoConstCandPtr> sKx0;
786 int nBd =
lBd.size();
787 for (iBd = 0; iBd < nBd; ++iBd)
788 sKx0.insert(
lBd[iBd]->getComp(
"Kx0"));
789 set<BPHRecoConstCandPtr>::const_iterator iter = sKx0.begin();
790 set<BPHRecoConstCandPtr>::const_iterator iend = sKx0.end();
792 lSd.push_back(*iter++);
797 vector<BPHPlusMinusConstCandPtr> lPhi;
811 if (
phi !=
nullptr) {
813 if (rIter != rIend) {
814 const map<parType, double>&
pMap = rIter->second;
815 map<parType, double>::const_iterator pIter =
pMap.begin();
816 map<parType, double>::const_iterator pIend =
pMap.end();
817 while (pIter != pIend) {
820 double pv = pEntry.second;
849 int nPhi = lPhi.size();
856 if (rIter != rIend) {
857 const map<parType, double>&
pMap = rIter->second;
858 map<parType, double>::const_iterator pIter =
pMap.begin();
859 map<parType, double>::const_iterator pIend =
pMap.end();
860 while (pIter != pIend) {
863 double pv = pEntry.second;
866 bs->setJPsiMassMin(
pv);
869 bs->setJPsiMassMax(
pv);
872 bs->setPhiMassMin(
pv);
875 bs->setPhiMassMax(
pv);
887 bs->setMassFitMin(
pv);
890 bs->setMassFitMax(
pv);
893 bs->setConstr(
pv > 0);
907 set<BPHRecoConstCandPtr> sPhi;
909 int nBs =
lBs.size();
910 for (iBs = 0; iBs < nBs; ++iBs)
911 sPhi.insert(
lBs[iBs]->getComp(
"Phi"));
912 set<BPHRecoConstCandPtr>::const_iterator iter = sPhi.begin();
913 set<BPHRecoConstCandPtr>::const_iterator iend = sPhi.end();
915 lSs.push_back(*iter++);
927 if (k0s !=
nullptr) {
929 if (rIter != rIend) {
930 const map<parType, double>&
pMap = rIter->second;
931 map<parType, double>::const_iterator pIter =
pMap.begin();
932 map<parType, double>::const_iterator pIend =
pMap.end();
933 while (pIter != pIend) {
936 double pv = pEntry.second;
965 int nK0 =
lK0.size();
976 if (l0s !=
nullptr) {
978 if (rIter != rIend) {
979 const map<parType, double>&
pMap = rIter->second;
980 map<parType, double>::const_iterator pIter =
pMap.begin();
981 map<parType, double>::const_iterator pIend =
pMap.end();
982 while (pIter != pIend) {
985 double pv = pEntry.second;
1014 int nL0 =
lL0.size();
1021 if (rIter != rIend) {
1022 const map<parType, double>&
pMap = rIter->second;
1023 map<parType, double>::const_iterator pIter =
pMap.begin();
1024 map<parType, double>::const_iterator pIend =
pMap.end();
1025 while (pIter != pIend) {
1028 double pv = pEntry.second;
1031 b0->setJPsiMassMin(
pv);
1034 b0->setJPsiMassMax(
pv);
1037 b0->setK0MassMin(
pv);
1040 b0->setK0MassMax(
pv);
1052 b0->setMassFitMin(
pv);
1055 b0->setMassFitMax(
pv);
1058 b0->setConstr(
pv > 0);
1070 const map<const BPHRecoCandidate*, const BPHRecoCandidate*>& b0Map =
b0->daughMap();
1071 daughMap.insert(b0Map.begin(), b0Map.end());
1080 if (rIter != rIend) {
1081 const map<parType, double>&
pMap = rIter->second;
1082 map<parType, double>::const_iterator pIter =
pMap.begin();
1083 map<parType, double>::const_iterator pIend =
pMap.end();
1084 while (pIter != pIend) {
1087 double pv = pEntry.second;
1129 const map<const BPHRecoCandidate*, const BPHRecoCandidate*>& ldMap = lb->
daughMap();
1130 daughMap.insert(ldMap.begin(), ldMap.end());
1146 if (bc !=
nullptr) {
1148 if (rIter != rIend) {
1149 const map<parType, double>&
pMap = rIter->second;
1150 map<parType, double>::const_iterator pIter =
pMap.begin();
1151 map<parType, double>::const_iterator pIend =
pMap.end();
1152 while (pIter != pIend) {
1155 double pv = pEntry.second;
1214 if (x3872 !=
nullptr) {
1216 if (rIter != rIend) {
1217 const map<parType, double>&
pMap = rIter->second;
1218 map<parType, double>::const_iterator pIter =
pMap.begin();
1219 map<parType, double>::const_iterator pIend =
pMap.end();
1220 while (pIter != pIend) {
1223 double pv = pEntry.second;
1335 map<string, parType>::const_iterator pIter =
pMap.begin();
1336 map<string, parType>::const_iterator pIend =
pMap.end();
1337 while (pIter != pIend) {
1339 const string& pn =
entry.first;
1343 edm::LogVerbatim(
"Configuration") <<
"BPHWriteSpecificDecay::setRecoParameters: set " << pn <<
" for " <<
name 1347 map<string, parType>::const_iterator fIter =
fMap.begin();
1348 map<string, parType>::const_iterator fIend =
fMap.end();
1349 while (fIter != fIend) {
1351 const string&
fn =
entry.first;
1353 edm::LogVerbatim(
"Configuration") <<
"BPHWriteSpecificDecay::setRecoParameters: set " <<
fn <<
" for " <<
name BPHTokenWrapper< std::vector< reco::VertexCompositeCandidate > > l0CandsToken
const std::map< const BPHRecoCandidate *, const BPHRecoCandidate * > & daughMap() const
get original daughters map
virtual const reco::Candidate * originalReco(const reco::Candidate *daug) const
get the original particle from the clone
Analysis-level particle class.
Log< level::Info, true > LogVerbatim
static bool sameTrack(const reco::Candidate *lCand, const reco::Candidate *rCand, double minPDifference)
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
T getParameter(std::string const &) const
void setMassMin(double m)
BPHTokenWrapper< std::vector< reco::Vertex > > pVertexToken
void setMassMax(double m)
std::vector< BPHRecoConstCandPtr > build()
build candidates
std::vector< BPHPlusMinusConstCandPtr > lJPsi
BPHTokenWrapper< std::vector< reco::VertexCompositePtrCandidate > > kSCandsToken
std::vector< BPHPlusMinusConstCandPtr > lK0
std::vector< BPHPlusMinusConstCandPtr > build()
build candidates
edm::Ref< std::vector< reco::Vertex > > vertex_ref
void setMassMax(oniaType type, double m)
std::map< const BPHRecoCandidate *, compcc_ref > ccRefMap
void setPiEtaMax(double eta)
std::vector< BPHPlusMinusConstCandPtr > lFull
std::map< std::string, recoType > rMap
#define DEFINE_FWK_MODULE(type)
const Point & position() const
position
void setMassFitMin(double m)
void setJPsiMassMin(double m)
T const * product() const
void setKPtMin(double pt)
set cuts
void setPiPtMin(double pt)
set cuts
std::vector< BPHRecoConstCandPtr > lBs
bool get(const edm::Event &ev, edm::Handle< Obj > &obj)
BPHTokenWrapper< std::vector< BPHTrackReference::candidate > > pcCandsToken
void setKEtaMax(double eta)
void setJPsiMassMax(double m)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define SET_PAR(TYPE, NAME, PSET)
const pat::CompositeCandidate & composite() const override
get a composite by the simple sum of simple particles
virtual void fill(edm::Event &ev, const edm::EventSetup &es)
void setLambda0MassMin(double m)
void setJPsiMassMax(double m)
std::map< const BPHRecoCandidate *, const BPHRecoCandidate * > daughMap
void setProbMin(oniaType type, double p)
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
std::map< std::string, parType > pMap
static BPHGenericCollection * createCollection(const edm::Handle< T > &collection, const std::string &list="cfhpmig")
void setMassFitMax(double m)
std::vector< BPHRecoConstCandPtr > lSs
std::vector< BPHRecoConstCandPtr > build()
build candidates
U second(std::pair< T, U > const &p)
deep_tau::DeepTauBase::BasicDiscriminator bd
double getConstrSigma(oniaType type) const
virtual const reco::Candidate * getDaug(const std::string &name) const
BPHTokenWrapper< std::vector< reco::VertexCompositeCandidate > > k0CandsToken
Container::value_type value_type
BPHWriteSpecificDecay(const edm::ParameterSet &ps)
void setEtaMax(double eta)
std::vector< BPHPlusMinusConstCandPtr > getList(oniaType type, BPHRecoSelect *dSel=nullptr, BPHMomentumSelect *mSel=nullptr, BPHVertexSelect *vSel=nullptr, BPHFitSelect *kSel=nullptr)
BPHTokenWrapper< pat::MuonCollection > patMuonToken
void setEtaMax(double eta)
BPHTokenWrapper< std::vector< reco::PFCandidate > > pfCandsToken
void setMassMax(double m)
void setProbMin(double p)
void setJPsiMassMin(double m)
set cuts
BPHTokenWrapper< std::vector< reco::VertexCompositePtrCandidate > > lSCandsToken
void setMassMin(double m)
set cuts
math::XYZPoint Point
point in the space
void setConstr(bool flag)
BPHTokenWrapper< std::vector< pat::CompositeCandidate > > ccCandsToken
bool getData(T &iHolder) const
std::pair< GlobalPoint, GlobalPoint > points() const override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< BPHRecoConstCandPtr > lSd
void setMassFitMin(double m)
double getConstrMass(oniaType type) const
const T * userData(const std::string &key) const
Returns user-defined data. Returns NULL if the data is not present, or not of type T...
void setMassFitMax(double m)
virtual const reco::Vertex & vertex(VertexFitter< 5 > *fitter=nullptr, const reco::BeamSpot *bs=nullptr, const GlobalPoint *priorPos=nullptr, const GlobalError *priorError=nullptr) const
get reconstructed vertex
void setLambda0MassMax(double m)
BPHTokenWrapper< std::vector< pat::GenericParticle > > gpCandsToken
edm::OrphanHandle< pat::CompositeCandidateCollection > write(edm::Event &ev, const std::vector< T > &list, const std::string &name)
size_type numberOfDaughters() const override
number of daughters
void setPiEtaMax(double eta)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::map< const BPHRecoCandidate *, vertex_ref > pvRefMap
std::vector< BPHPlusMinusConstCandPtr > lL0
std::vector< BPHRecoConstCandPtr > build()
build X3872 candidates
std::vector< BPHRecoConstCandPtr > lBu
std::vector< BPHRecoConstCandPtr > lLb
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken
void add(std::map< std::string, TH1 *> &h, TH1 *hist)
std::vector< BPHPlusMinusConstCandPtr > build()
build resonance candidates
void setJPsiMassMin(double m)
void setConstr(oniaType type, double mass, double sigma)
void setEtaMax(oniaType type, double eta)
void setPtMin(double pt)
set cuts
std::map< recoType, std::map< parType, double > > parMap
virtual const std::vector< const reco::Candidate * > & daughters() const
std::map< const BPHRecoCandidate *, const BPHRecoCandidate * > jPsiOMap
static constexpr float b0
void setJPsiMassMin(double m)
set cuts
std::vector< BPHRecoConstCandPtr > lB0
void setMassMin(oniaType type, double m)
std::vector< BPHRecoConstCandPtr > lBc
std::vector< BPHRecoConstCandPtr > lX3872
void produce(edm::Event &ev, const edm::EventSetup &es) override
void setConstr(bool flag)
std::vector< BPHPlusMinusConstCandPtr > build()
build candidates
std::vector< BPHRecoConstCandPtr > lBd
Analysis-level muon class.
void setJPsiMassMax(double m)
void setRecoParameters(const edm::ParameterSet &ps)
std::map< std::string, parType > fMap
Power< A, B >::type pow(const A &a, const B &b)
void setPtMin(oniaType type, double pt)
set cuts
void setJPsiMassMax(double m)
void setProbMin(double p)
const_iterator begin() const
first daughter const_iterator
void setPiPtMin(double pt)
set cuts