56 const vector<BPHRecoConstCandPtr>* cCollection = *
compCollectList.begin();
68 return new BPHSpecificCollection<vector<const reco::Candidate*> >(candList, list);
75 <<
"Decay product already inserted with name " <<
name <<
" , skipped";
78 rs =
new BPHRecoSource;
81 rs->selector.reserve(5);
92 <<
"Decay product already inserted with name " <<
name <<
" , skipped";
95 cs =
new BPHCompSource;
103 map<string, int>::const_iterator iter =
sourceId.find(
name);
107 rs->selector.push_back(&
sel);
112 map<string, int>::const_iterator iter =
srCompId.find(
name);
116 cs->momSelector.push_back(&
sel);
121 map<string, int>::const_iterator iter =
srCompId.find(
name);
125 cs->vtxSelector.push_back(&
sel);
130 map<string, int>::const_iterator iter =
srCompId.find(
name);
134 cs->fitSelector.push_back(&
sel);
157 for (
i = 0;
i <
n; ++
i) {
162 for (
i = 0;
i <
n; ++
i) {
167 for (
i = 0;
i <
n; ++
i) {
182 vector<ComponentSet> candList;
191 map<string, const reco::Candidate*>::const_iterator iter =
daugMap.find(
name);
192 return (iter ==
daugMap.end() ? nullptr : iter->second);
196 map<string, BPHRecoConstCandPtr>::const_iterator iter =
compMap.find(
name);
197 return (iter ==
compMap.end() ? nullptr : iter->second);
205 if ((lrcTrack !=
nullptr) && ((lrcTrack == rrcTrack) || (lrcTrack == rpfTrack)))
207 if ((lpfTrack !=
nullptr) && ((lpfTrack == rrcTrack) || (lpfTrack == rpfTrack)))
211 double pDMod = pDiff.mag2();
212 double pMMod = pMean.mag2();
213 if (((pDMod / pMMod) < minPDifference) && (lCand->
charge() == rCand->
charge()))
220 vector<BPHRecoSource*>::const_iterator r_iter,
221 vector<BPHRecoSource*>::const_iterator r_iend,
222 vector<BPHCompSource*>::const_iterator c_iter,
223 vector<BPHCompSource*>::const_iterator c_iend)
const {
224 if (r_iter == r_iend) {
225 if (c_iter == c_iend) {
227 compList.push_back(compSet);
232 vector<const BPHMomentumSelect*> momSelector =
source->momSelector;
233 vector<const BPHVertexSelect*> vtxSelector =
source->vtxSelector;
234 vector<const BPHFitSelect*> fitSelector =
source->fitSelector;
240 for (
i = 0;
i <
n; ++
i) {
245 m = momSelector.size();
246 for (
j = 0;
j <
m; ++
j) {
254 m = vtxSelector.size();
255 for (
j = 0;
j <
m; ++
j) {
263 m = fitSelector.size();
264 for (
j = 0;
j <
m; ++
j) {
273 build(compList, compSet, r_iter, r_iend, c_iter, c_iend);
286 for (
i = 0;
i <
n; ++
i) {
291 for (
j = 0;
j <
m; ++
j) {
306 build(compList, compSet, r_iter, r_iend, c_iter, c_iend);
314 map<string, BPHDecayMomentum::Component>& dMap = compSet.
daugMap;
315 map<string, BPHDecayMomentum::Component>::const_iterator d_iter;
316 map<string, BPHDecayMomentum::Component>::const_iterator d_iend = dMap.end();
317 for (d_iter = dMap.begin(); d_iter != d_iend; ++d_iter) {
328 map<string, BPHRecoConstCandPtr>::const_iterator c_iter;
329 map<string, BPHRecoConstCandPtr>::const_iterator c_iend =
compMap.end();
330 const vector<const reco::Candidate*>& dCand = cCand->daughFull();
332 int m = dCand.size();
335 for (
j = 0;
j <
m; ++
j) {
337 map<string, BPHDecayMomentum::Component>& dMap = compSet.
daugMap;
338 map<string, BPHDecayMomentum::Component>::const_iterator d_iter;
339 map<string, BPHDecayMomentum::Component>::const_iterator d_iend = dMap.end();
340 for (d_iter = dMap.begin(); d_iter != d_iend; ++d_iter) {
348 for (c_iter =
compMap.begin(); c_iter != c_iend; ++c_iter) {
351 const vector<const reco::Candidate*>& dCChk = cCChk->daughFull();
353 for (
k = 0;
k <
l; ++
k) {
static bool sameTrack(const reco::Candidate *lCand, const reco::Candidate *rCand, double minPDifference)
void setMinPDiffererence(double pMin)
static const reco::Track * getFromPF(const reco::Candidate &rc)
math::XYZVector Vector
point in the space
std::map< std::string, BPHRecoConstCandPtr > compMap
bool accept(const BPHRecoCandidate &cand) const
BPHGenericPtr< const BPHRecoCandidate >::type BPHRecoConstCandPtr
virtual ~BPHRecoBuilder()
std::vector< const BPHFitSelect * > fsList
BPHRecoBuilder(const BPHEventSetupWrapper &es)
std::map< std::string, BPHDecayMomentum::Component > daugMap
const BPHEventSetupWrapper * evSetup
std::vector< BPHCompSource * > srCompList
static BPHGenericCollection * createCollection(const edm::Handle< T > &collection, const std::string &list="cfhpmig")
std::vector< const BPHVertexSelect * > vsList
static const reco::Track * getFromRC(const reco::Candidate &rc)
std::map< std::string, const reco::Candidate * > daugMap
virtual Vector momentum() const =0
spatial momentum vector
Container::value_type value_type
bool contained(ComponentSet &compSet, const reco::Candidate *cand) const
BPHRecoConstCandPtr getComp(const std::string &name) const
void filter(const std::string &name, const BPHRecoSelect &sel) const
virtual int charge() const =0
electric charge
std::vector< BPHRecoSource * > sourceList
Log< level::Warning, true > LogPrint
std::vector< ComponentSet > build() const
build a set of combinations of particles fulfilling the selections
void add(const std::string &name, const BPHGenericCollection *collection, double mass=-1.0, double msig=-1.0)
const reco::Candidate * getDaug(const std::string &name) const
get simple or previously recontructed particle in current combination
common object to interface with edm collections
const BPHEventSetupWrapper * eventSetup() const
get the EventSetup set in the constructor
std::map< std::string, BPHRecoConstCandPtr > compMap
std::vector< const BPHMomentumSelect * > msList
std::set< const std::vector< BPHRecoConstCandPtr > * > compCollectList
std::map< std::string, int > srCompId
static std::string const source
std::map< std::string, int > sourceId