55 const vector<BPHRecoConstCandPtr>* cCollection = *
compCollectList.begin();
66 return new BPHSpecificCollection<vector<const reco::Candidate*>>(candList, list);
73 <<
"Decay product already inserted with name " << name <<
" , skipped";
76 rs =
new BPHRecoSource;
79 rs->selector.reserve(5);
86 void BPHRecoBuilder::add(
const string& name,
const vector<BPHRecoConstCandPtr>& collection) {
90 <<
"Decay product already inserted with name " << name <<
" , skipped";
93 cs =
new BPHCompSource;
101 map<string, int>::const_iterator iter =
sourceId.find(name);
105 rs->selector.push_back(&sel);
110 map<string, int>::const_iterator iter =
srCompId.find(name);
114 cs->momSelector.push_back(&sel);
119 map<string, int>::const_iterator iter =
srCompId.find(name);
123 cs->vtxSelector.push_back(&sel);
128 map<string, int>::const_iterator iter =
srCompId.find(name);
132 cs->fitSelector.push_back(&sel);
155 for (i = 0; i <
n; ++
i) {
160 for (i = 0; i <
n; ++
i) {
165 for (i = 0; i <
n; ++
i) {
180 vector<ComponentSet> candList;
193 if ((lrcTrack !=
nullptr) && ((lrcTrack == rrcTrack) || (lrcTrack == rpfTrack)))
195 if ((lpfTrack !=
nullptr) && ((lpfTrack == rrcTrack) || (lpfTrack == rpfTrack)))
199 double pDMod = pDiff.mag2();
200 double pMMod = pMean.mag2();
201 if (((pDMod / pMMod) < minPDifference) && (lCand->
charge() == rCand->
charge()))
208 vector<BPHRecoSource*>::const_iterator r_iter,
209 vector<BPHRecoSource*>::const_iterator r_iend,
210 vector<BPHCompSource*>::const_iterator c_iter,
211 vector<BPHCompSource*>::const_iterator c_iend)
const {
212 if (r_iter == r_iend) {
213 if (c_iter == c_iend) {
215 compList.push_back(compSet);
219 const vector<BPHRecoConstCandPtr>* collection = source->
collection;
220 vector<const BPHMomentumSelect*> momSelector = source->
momSelector;
221 vector<const BPHVertexSelect*> vtxSelector = source->
vtxSelector;
222 vector<const BPHFitSelect*> fitSelector = source->
fitSelector;
225 int n = collection->size();
228 for (i = 0; i <
n; ++
i) {
233 m = momSelector.size();
234 for (j = 0; j <
m; ++
j) {
235 if (!momSelector[j]->
accept(*cand)) {
242 m = vtxSelector.size();
243 for (j = 0; j <
m; ++
j) {
244 if (!vtxSelector[j]->
accept(*cand)) {
251 m = fitSelector.size();
252 for (j = 0; j <
m; ++
j) {
253 if (!fitSelector[j]->
accept(*cand)) {
261 build(compList, compSet, r_iter, r_iend, c_iter, c_iend);
268 vector<const BPHRecoSelect*>& selector = source->
selector;
271 int n = collection->
size();
272 int m = selector.size();
274 for (i = 0; i <
n; ++
i) {
279 for (j = 0; j <
m; ++
j) {
280 if (!selector[j]->
accept(cand,
this)) {
294 build(compList, compSet, r_iter, r_iend, c_iter, c_iend);
302 map<string, BPHDecayMomentum::Component>& dMap = compSet.
daugMap;
303 map<string, BPHDecayMomentum::Component>::const_iterator d_iter;
304 map<string, BPHDecayMomentum::Component>::const_iterator d_iend = dMap.end();
305 for (d_iter = dMap.begin(); d_iter != d_iend; ++d_iter) {
316 map<string, BPHRecoConstCandPtr>::const_iterator c_iter;
317 map<string, BPHRecoConstCandPtr>::const_iterator c_iend =
compMap.end();
318 const vector<const reco::Candidate*>& dCand = cCand->daughFull();
320 int m = dCand.size();
323 for (j = 0; j <
m; ++
j) {
325 map<string, BPHDecayMomentum::Component>& dMap = compSet.
daugMap;
326 map<string, BPHDecayMomentum::Component>::const_iterator d_iter;
327 map<string, BPHDecayMomentum::Component>::const_iterator d_iend = dMap.end();
328 for (d_iter = dMap.begin(); d_iter != d_iend; ++d_iter) {
336 for (c_iter =
compMap.begin(); c_iter != c_iend; ++c_iter) {
337 const pair<string, BPHRecoConstCandPtr>&
entry = *c_iter;
339 const vector<const reco::Candidate*>& dCChk = cCChk->daughFull();
341 for (k = 0; k <
l; ++
k) {
std::vector< const BPHRecoSelect * > selector
const reco::Candidate * cand
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
BPHGenericPtr< const BPHRecoCandidate >::type BPHRecoConstCandPtr
virtual ~BPHRecoBuilder()
std::vector< ComponentSet > build() const
build a set of combinations of particles fulfilling the selections
unique_ptr< ClusterSequence > cs
std::vector< const BPHFitSelect * > fsList
const std::vector< BPHRecoConstCandPtr > * collection
std::map< std::string, BPHDecayMomentum::Component > daugMap
const edm::EventSetup * evSetup
bool accept(const BPHRecoCandidate &cand) const
std::vector< BPHCompSource * > srCompList
const BPHGenericCollection * collection
const edm::EventSetup * eventSetup() const
get the EventSetup set in the constructor
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
std::vector< const BPHFitSelect * > fitSelector
virtual const reco::Candidate & get(int i) const =0
virtual int charge() const =0
electric charge
std::vector< BPHRecoSource * > sourceList
Log< level::Warning, true > LogPrint
void add(const std::string &name, const BPHGenericCollection *collection, double mass=-1.0, double msig=-1.0)
const std::string & searchList() const
virtual int size() const =0
std::vector< const BPHMomentumSelect * > momSelector
void filter(const std::string &name, const BPHRecoSelect &sel) const
std::map< std::string, BPHRecoConstCandPtr > compMap
std::vector< const BPHMomentumSelect * > msList
std::vector< const BPHVertexSelect * > vtxSelector
bool contained(ComponentSet &compSet, const reco::Candidate *cand) const
std::set< const std::vector< BPHRecoConstCandPtr > * > compCollectList
BPHRecoBuilder(const edm::EventSetup &es)
std::map< std::string, int > srCompId
static std::string const source
std::map< std::string, int > sourceId