13 #ifndef L1_TRACK_TRIGGER_CLUSTER_ASSOCIATION_FORMAT_H 14 #define L1_TRACK_TRIGGER_CLUSTER_ASSOCIATION_FORMAT_H 32 template<
typename T >
82 template<
typename T >
94 template<
typename T >
98 template<
typename T >
106 std::vector< edm::Ref< edmNew::DetSetVector< TTCluster< T > >,
TTCluster< T > > > tempVector;
111 template<
typename T >
119 std::vector< edm::Ptr< TrackingParticle > > tempVector;
147 template<
typename T >
158 if ( theseTrackingParticles.empty() )
162 unsigned int nullTPs = 0;
163 unsigned int goodDifferentTPs = 0;
164 std::vector< const TrackingParticle* > tpAddressVector;
166 std::vector<float> tp_mom;
171 for (
const auto& tp : theseTrackingParticles )
184 tp_mom.push_back(curTP.
get()->
p4().pt());
185 tp_tot+=curTP.
get()->
p4().pt();
189 if (tp_tot==0)
return false;
191 for (
unsigned int itp = 0; itp < theseTrackingParticles.size(); itp++ )
197 if ( tp_mom.at(itp) <= 0.01*tp_tot)
205 tpAddressVector.push_back( curTP.
get() );
211 std::sort( tpAddressVector.begin(), tpAddressVector.end() );
212 tpAddressVector.erase(
std::unique( tpAddressVector.begin(), tpAddressVector.end() ), tpAddressVector.end() );
213 goodDifferentTPs = tpAddressVector.size();
215 return ( goodDifferentTPs == 1 );
218 template<
typename T >
225 if ( theseTrackingParticles.empty() )
229 unsigned int goodDifferentTPs = 0;
230 std::vector< const TrackingParticle* > tpAddressVector;
233 for (
unsigned int itp = 0; itp < theseTrackingParticles.size(); itp++ )
243 tpAddressVector.push_back( curTP.
get() );
248 std::sort( tpAddressVector.begin(), tpAddressVector.end() );
249 tpAddressVector.erase(
std::unique( tpAddressVector.begin(), tpAddressVector.end() ), tpAddressVector.end() );
250 goodDifferentTPs = tpAddressVector.size();
253 return ( goodDifferentTPs == 0 );
256 template<
typename T >
263 if ( theseTrackingParticles.empty())
267 bool genuineClu = this->
isGenuine( aCluster );
268 bool unknownClu = this->
isUnknown( aCluster );
270 if (genuineClu || unknownClu)
return false;
275 unsigned int nullTPs = 0;
276 unsigned int goodDifferentTPs = 0;
277 std::vector< const TrackingParticle* > tpAddressVector;
280 for (
unsigned int itp = 0; itp < theseTrackingParticles.size(); itp++ )
294 tpAddressVector.push_back( curTP.
get() );
299 std::sort( tpAddressVector.begin(), tpAddressVector.end() );
300 tpAddressVector.erase(
std::unique( tpAddressVector.begin(), tpAddressVector.end() ), tpAddressVector.end() );
301 goodDifferentTPs = tpAddressVector.size();
306 return (goodDifferentTPs > 1);
309 template<
typename T >
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
std::vector< edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > > findTTClusterRefs(edm::Ptr< TrackingParticle > aTrackingParticle) const
Operations.
~TTClusterAssociationMap()
Destructor.
void setTrackingParticleToTTClustersMap(std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > > > aMap)
T const * get() const
Returns C++ pointer to the item.
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > > > trackingParticleToClusterVectorMap
bool isGenuine(edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > aCluster) const
MC Truth methods.
void setTTClusterToTrackingParticlesMap(std::map< edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > >, std::vector< edm::Ptr< TrackingParticle > > > aMap)
NOTE: this is needed even if it seems not.
TTClusterAssociationMap()
Constructors.
std::vector< edm::Ptr< TrackingParticle > > findTrackingParticlePtrs(edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > aCluster) const
Operations.
def unique(seq, keepstr=True)
bool isCombinatoric(edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > aCluster) const
bool isNull() const
Checks for null.
std::map< edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > >, std::vector< edm::Ptr< TrackingParticle > > > clusterToTrackingParticleVectorMap
Data members.
edm::Ptr< TrackingParticle > findTrackingParticlePtr(edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > aCluster) const
std::map< edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > >, std::vector< edm::Ptr< TrackingParticle > > > getTTClusterToTrackingParticlesMap() const
Maps.
NOTE: this is needed even if it seems not.
bool isUnknown(edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > aCluster) const
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > > > getTrackingParticleToTTClustersMap() const