14 #define TRGCDC_SHORT_NAMES
16 #include "framework/datastore/StoreArray.h"
17 #include "mdst/dataobjects/MCParticle.h"
18 #include "trg/cdc/Relation.h"
29 const std::map<unsigned, unsigned>& relation)
55 _pairs = (
const pair<unsigned, unsigned>**)
56 malloc(
sizeof(pair<unsigned, unsigned>) * n);
57 map<unsigned, unsigned>::const_iterator it =
_relations.begin();
61 new const pair<unsigned, unsigned>(it->first, it->second);
67 for (
unsigned k = 0; k < n - 1; k++) {
68 for (
unsigned j = i + 1; j < n; j++) {
70 const pair<unsigned, unsigned>* tmp =
_pairs[k];
86 const unsigned nMcParticles = mcParticles.
getEntries();
87 if (nMcParticles == 0) cout <<
"[Error] TRGCDCRelation::mcParticle() => There are no mc particles in MCParticle store array." <<
89 return * mcParticles[id];
102 map<unsigned, unsigned>::const_iterator it =
_relations.begin();
105 if (it->first == trkID)
110 return float(na) / float(n);
120 map<unsigned, unsigned>::const_iterator it =
_relations.begin();
123 if (it->first == trkID)
128 return float(na) / float(n);
136 unsigned nFoundTS = 0;
137 unsigned nTrueTS = 0;
140 for (
unsigned iStereoSuperLayer = 0; iStereoSuperLayer < 4; iStereoSuperLayer++) {
141 if (((this->
track()).links(2 * iStereoSuperLayer + 1)).size() > 0) nFoundTS += 1;
145 map<unsigned, unsigned>::iterator itTSF = numTSsParticle.find(trkID);
146 if (itTSF != numTSsParticle.end()) nTrueTS = itTSF->second;
154 return float(nFoundTS) / float(nTrueTS);
160 const std::string& prefix)
const
164 cout << prefix <<
"#contributions=" << n << endl;
165 const string tab = prefix +
" ";
166 for (
unsigned i = 0; i < n; i++) {
168 <<
",purity=" <<
purity(i) * 100 <<
"%"