13 #ifndef L1_TRACK_TRIGGER_CLUSTER_ASSOCIATION_FORMAT_H
14 #define L1_TRACK_TRIGGER_CLUSTER_ASSOCIATION_FORMAT_H
45 std::map<edm::Ref<edmNew::DetSetVector<TTCluster<T> >,
TTCluster<T> >, std::vector<edm::Ptr<TrackingParticle> > >
49 std::map<edm::Ptr<TrackingParticle>, std::vector<edm::Ref<edmNew::DetSetVector<TTCluster<T> >,
TTCluster<T> > > >
79 std::map<edm::Ref<edmNew::DetSetVector<TTCluster<T> >,
TTCluster<T> >, std::vector<edm::Ptr<TrackingParticle> > >
81 std::map<edm::Ptr<TrackingParticle>, std::vector<edm::Ref<edmNew::DetSetVector<TTCluster<T> >,
TTCluster<T> > > >
100 clusterToTrackingParticleVectorMap.clear();
101 trackingParticleToClusterVectorMap.clear();
106 template <
typename T>
110 template <
typename T>
111 std::vector<edm::Ref<edmNew::DetSetVector<TTCluster<T> >,
TTCluster<T> > >
113 if (trackingParticleToClusterVectorMap.find(aTrackingParticle) != trackingParticleToClusterVectorMap.end()) {
114 return trackingParticleToClusterVectorMap.find(aTrackingParticle)->second;
117 std::vector<edm::Ref<edmNew::DetSetVector<TTCluster<T> >,
TTCluster<T> > > tempVector;
122 template <
typename T>
125 if (clusterToTrackingParticleVectorMap.find(aCluster) != clusterToTrackingParticleVectorMap.end()) {
126 return clusterToTrackingParticleVectorMap.find(aCluster)->second;
129 std::vector<edm::Ptr<TrackingParticle> > tempVector;
156 template <
typename T>
159 std::vector<edm::Ptr<TrackingParticle> > theseTrackingParticles = this->findTrackingParticlePtrs(aCluster);
162 if (theseTrackingParticles.empty())
166 unsigned int nullTPs = 0;
167 unsigned int goodDifferentTPs = 0;
168 std::vector<const TrackingParticle*> tpAddressVector;
170 std::vector<float> tp_mom;
175 for (
const auto&
tp : theseTrackingParticles) {
184 tp_mom.push_back(curTP.
get()->
p4().pt());
185 tp_tot += curTP.
get()->
p4().pt();
192 for (
unsigned int itp = 0; itp < theseTrackingParticles.size(); itp++) {
197 if (tp_mom.at(itp) <= 0.01 * tp_tot) {
202 tpAddressVector.push_back(curTP.
get());
207 std::sort(tpAddressVector.begin(), tpAddressVector.end());
208 tpAddressVector.erase(
std::unique(tpAddressVector.begin(), tpAddressVector.end()), tpAddressVector.end());
209 goodDifferentTPs = tpAddressVector.size();
211 return (goodDifferentTPs == 1);
214 template <
typename T>
217 std::vector<edm::Ptr<TrackingParticle> > theseTrackingParticles = this->findTrackingParticlePtrs(aCluster);
220 if (theseTrackingParticles.empty())
224 unsigned int goodDifferentTPs = 0;
225 std::vector<const TrackingParticle*> tpAddressVector;
228 for (
unsigned int itp = 0; itp < theseTrackingParticles.size(); itp++) {
236 tpAddressVector.push_back(curTP.
get());
241 std::sort(tpAddressVector.begin(), tpAddressVector.end());
242 tpAddressVector.erase(
std::unique(tpAddressVector.begin(), tpAddressVector.end()), tpAddressVector.end());
243 goodDifferentTPs = tpAddressVector.size();
246 return (goodDifferentTPs == 0);
249 template <
typename T>
253 std::vector<edm::Ptr<TrackingParticle> > theseTrackingParticles = this->findTrackingParticlePtrs(aCluster);
256 if (theseTrackingParticles.empty())
259 bool genuineClu = this->isGenuine(aCluster);
260 bool unknownClu = this->isUnknown(aCluster);
262 if (genuineClu || unknownClu)
268 unsigned int nullTPs = 0;
269 unsigned int goodDifferentTPs = 0;
270 std::vector<const TrackingParticle*> tpAddressVector;
273 for (
unsigned int itp = 0; itp < theseTrackingParticles.size(); itp++) {
283 tpAddressVector.push_back(curTP.
get());
288 std::sort(tpAddressVector.begin(), tpAddressVector.end());
289 tpAddressVector.erase(
std::unique(tpAddressVector.begin(), tpAddressVector.end()), tpAddressVector.end());
290 goodDifferentTPs = tpAddressVector.size();
295 return (goodDifferentTPs > 1);
298 template <
typename T>
301 if (this->isGenuine(aCluster)) {
302 return this->findTrackingParticlePtrs(aCluster).at(0);