14 elements_.push_back(element->
clone());
17 void PFBlock::bookLinkData() {}
30 l.test |= (1 <<
test);
33 LinkData::iterator it = linkData.find(
index);
34 if (it != linkData.end())
60 void PFBlock::associatedElements(
unsigned i,
62 multimap<double, unsigned>& sortedAssociates,
65 sortedAssociates.clear();
68 if (
i > elements_.size())
72 for (
unsigned ie = 0; ie < elements_.size(); ie++) {
85 if (!matrix2vector(
i, ie,
index))
89 LinkData::const_iterator it = linkData.find(
index);
90 if (it != linkData.end() && (((1 <<
test) & it->second.test) != 0 || (
test == LINKTEST_ALL)))
91 c2 = it->second.distance;
98 sortedAssociates.insert(pair<double, unsigned>(c2, ie));
102 bool PFBlock::matrix2vector(
unsigned iindex,
unsigned jindex,
unsigned&
index)
const {
103 unsigned size = elements_.size();
104 if (iindex == jindex || iindex >= size || jindex >= size) {
111 index = jindex - iindex - 1;
114 index += iindex * size;
115 unsigned missing = iindex * (iindex + 1) / 2;
122 double PFBlock::dist(
unsigned ie1,
unsigned ie2,
const LinkData& linkData)
const {
126 if (!matrix2vector(ie1, ie2,
index))
128 LinkData::const_iterator it = linkData.find(
index);
129 if (it != linkData.end())
130 Dist = it->second.distance;
139 out <<
"\t--- PFBlock --- " << endl;
140 out <<
"\tnumber of elements: " <<
elements.size() << endl;
164 std::vector<bool> toPrint(
elements.size(),
static_cast<bool>(
true));
165 for (
unsigned ie = 0; ie <
elements.size(); ie++) {
167 std::multimap<double, unsigned> ecalElems;
169 case PFBlockElement::TRACK:
173 case PFBlockElement::GSF:
177 case PFBlockElement::BREM:
178 block.associatedElements(
181 if (!ecalElems.empty()) {
187 case PFBlockElement::SC:
193 int layer = clusterref->layer();
229 ss <<
"FH" << iHFHAD;
251 if (!
block.linkData().empty()) {
252 out << endl <<
"\tlink data (distance x 1000): " << endl;
253 out << setiosflags(ios::right);
255 for (
unsigned ie = 0; ie < elid.size(); ie++)
260 out << setprecision(1);
262 for (
unsigned i = 0;
i <
block.elements().size();
i++) {
267 for (
unsigned j = 0;
j <
block.elements().size();
j++) {
281 out << endl <<
"\tlink data (distance x 1000) for tracking links : " << endl;
282 out << setiosflags(ios::right);
284 for (
unsigned ie = 0; ie < elid.size(); ie++)
286 (
block.elements()[ie].type() == PFBlockElement::TRACK ||
block.elements()[ie].type() == PFBlockElement::GSF))
290 out << setprecision(1);
292 for (
unsigned i = 0;
i <
block.elements().size();
i++) {
294 (
block.elements()[
i].type() != PFBlockElement::TRACK &&
block.elements()[
i].type() != PFBlockElement::GSF))
298 for (
unsigned j = 0;
j <
block.elements().size();
j++) {
300 (
block.elements()[
j].type() != PFBlockElement::TRACK &&
block.elements()[
j].type() != PFBlockElement::GSF))
313 out << setprecision(3);
317 out <<
"\tno links." << endl;
323 unsigned PFBlock::linkDataSize()
const {
324 unsigned n = elements_.size();
329 return n * (
n - 1) / 2;
Abstract base class for a PFBlock element (track, cluster...)
std::map< unsigned int, Link > LinkData
void swap(Association< C > &lhs, Association< C > &rhs)
virtual PFBlockElement * clone() const =0
necessary to have the edm::OwnVector<PFBlockElement> working
std::ostream & operator<<(std::ostream &, BeamSpot beam)
void setIndex(unsigned index)
set index