Atlfast::AssocTypeConverter< T > Class Template Reference

Converts association type. More...

#include <AssocTypeConverter.h>

Collaboration diagram for Atlfast::AssocTypeConverter< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AssocTypeConverter (const T &)
 AssocTypeConverter (const T *)
 AssocTypeConverter (const DataVector< T > &t)
 ~AssocTypeConverter ()
ITwoCptCellCollectioncells ()
 Returns ITwoCptCells.
ClusterCollectionclusters ()
 Returns Clusters.
JetCollectionjets ()
 Returns Jets.
ReconstructedParticleCollectionreconstructedParticles ()
 Returns ReconstructedParticles.
SimpleKinematicCollectionsimpleKinematics ()
 Returns SimpleKinematics.
TrackCollectiontracks ()
 Returns Tracks.
IKinematicCollectionallAsIKinematics ()
 Returns IKinematics.
std::vector< IKinematic * > * vectorOfIKinematics ()
 Returns IKinematics.

Private Attributes

IAOOm_am
 Pointer to basic object that holds original associations.

Detailed Description

template<class T>
class Atlfast::AssocTypeConverter< T >

Converts association type.

Given an object or collection with any type of associations (IAOO), the methods return those associations as the specified type

Definition at line 33 of file AssocTypeConverter.h.


Constructor & Destructor Documentation

template<class T>
Atlfast::AssocTypeConverter< T >::AssocTypeConverter ( const T &   )  [inline]

Reference constructor

Definition at line 103 of file AssocTypeConverter.h.

00103                                                        {
00104     m_am = new SimpleKinematic;
00105     std::for_each(t.begin(), t.end(), Associator2(m_am) );     
00106   }

template<class T>
Atlfast::AssocTypeConverter< T >::AssocTypeConverter ( const T *   )  [inline]

Pointer constructor

Definition at line 110 of file AssocTypeConverter.h.

00110                                                        {
00111     m_am = new SimpleKinematic;
00112     std::for_each(t->begin(), t->end(), Associator2(m_am) );     
00113   }

template<class T>
Atlfast::AssocTypeConverter< T >::AssocTypeConverter ( const DataVector< T > &  t  )  [inline]

DataVector constructor

Definition at line 96 of file AssocTypeConverter.h.

00096                                                                    {
00097     m_am = new SimpleKinematic;
00098     std::for_each(t.begin(), t.end(), Associator2(m_am) );     
00099   }

template<class T>
Atlfast::AssocTypeConverter< T >::~AssocTypeConverter (  )  [inline]

Destructor, deletes member association pointer

Definition at line 45 of file AssocTypeConverter.h.

00045 {delete m_am;}


Member Function Documentation

template<class T>
ITwoCptCellCollection * Atlfast::AssocTypeConverter< T >::cells (  )  [inline]

Returns ITwoCptCells.

Definition at line 117 of file AssocTypeConverter.h.

00117                                                        { 
00118     SimpleKinematic y;
00119     TwoCptCell x;
00120     std::vector<const TwoCptCell*> temp = m_am->associations(x);
00121     ITwoCptCellCollection* collection = new ITwoCptCellCollection;
00122     std::transform(
00123                    temp.begin(), temp.end(), std::back_inserter(*collection),
00124                    NewNoConst<TwoCptCell>()
00125                    );
00126     
00127     return collection;
00128   }

template<class T>
ClusterCollection * Atlfast::AssocTypeConverter< T >::clusters (  )  [inline]

Returns Clusters.

Definition at line 132 of file AssocTypeConverter.h.

00132                                                       {
00133     std::vector<const Cluster*> temp = m_am->associations(x);
00134 
00135     ClusterCollection* collection = new ClusterCollection;
00136     std::transform(
00137                    temp.begin(), temp.end(), std::back_inserter(*collection),
00138                    NewNoConst<Cluster>()
00139                    );
00140 
00141     return collection;
00142   }

template<class T>
JetCollection * Atlfast::AssocTypeConverter< T >::jets (  )  [inline]

Returns Jets.

Definition at line 146 of file AssocTypeConverter.h.

00146                                               {
00147     Jet x;
00148     std::vector<const Jet*> temp = m_am->associations(x);
00149 
00150     JetCollection* collection = new JetCollection;
00151     std::transform(
00152                    temp.begin(), temp.end(), std::back_inserter(*collection),
00153                    NewNoConst<Jet>()
00154                    );
00155 
00156     return collection;
00157   }

template<class T>
ReconstructedParticleCollection * Atlfast::AssocTypeConverter< T >::reconstructedParticles (  )  [inline]

Returns ReconstructedParticles.

Definition at line 162 of file AssocTypeConverter.h.

00162                                                  {
00163     ReconstructedParticle x;
00164     std::vector<const ReconstructedParticle*> temp = m_am->associations(x);
00165 
00166     ReconstructedParticleCollection* collection = 
00167       new ReconstructedParticleCollection;
00168     std::transform(
00169                    temp.begin(), temp.end(), std::back_inserter(*collection),
00170                    NewNoConst<ReconstructedParticle>()
00171                    );
00172 
00173     return collection;
00174   }

template<class T>
SimpleKinematicCollection * Atlfast::AssocTypeConverter< T >::simpleKinematics (  )  [inline]

Returns SimpleKinematics.

Definition at line 178 of file AssocTypeConverter.h.

00178                                                                       {  
00179     SimpleKinematic x;
00180     std::vector<const SimpleKinematic*> temp = m_am->associations(x);
00181 
00182     SimpleKinematicCollection* collection = new SimpleKinematicCollection;
00183     std::transform(
00184                    temp.begin(), temp.end(), std::back_inserter(*collection),
00185                    NewNoConst<SimpleKinematic>()
00186                    );
00187 
00188     return collection;
00189   }

template<class T>
TrackCollection * Atlfast::AssocTypeConverter< T >::tracks (  )  [inline]

Returns Tracks.

Definition at line 193 of file AssocTypeConverter.h.

00193                                                   {  
00194     Track x;
00195     std::vector<const Track*> temp = m_am->associations(x);
00196 
00197     TrackCollection* collection = new TrackCollection;
00198     std::transform(
00199                    temp.begin(), temp.end(), std::back_inserter(*collection),
00200                    NewNoConst<Track>()
00201                    );
00202 
00203     return collection;
00204   }

template<class T>
IKinematicCollection * Atlfast::AssocTypeConverter< T >::allAsIKinematics (  )  [inline]

Returns IKinematics.

Definition at line 208 of file AssocTypeConverter.h.

00208                                                                  {  
00209     std::vector<const IKinematic*> temp = m_am->ikinematics();
00210 
00211     IKinematicCollection* collection = new IKinematicCollection;
00212     
00213     std::transform(
00214                    temp.begin(), temp.end(), std::back_inserter(*collection),
00215                    NewNoConst<IKinematic>()
00216                    );
00217 
00218     return collection;
00219   }

template<class T>
std::vector< IKinematic * > * Atlfast::AssocTypeConverter< T >::vectorOfIKinematics (  )  [inline]

Returns IKinematics.

Definition at line 223 of file AssocTypeConverter.h.

00223                                                                       {  
00224     std::vector<const IKinematic*> temp = m_am->ikinematics();
00225 
00226     std::vector<IKinematic*>* collection = new std::vector<IKinematic*>;
00227     
00228     std::transform(
00229                    temp.begin(), temp.end(), std::back_inserter(*collection),
00230                    NewNoConst<IKinematic>()
00231                    );
00232 
00233     return collection;
00234   }


Member Data Documentation

template<class T>
IAOO* Atlfast::AssocTypeConverter< T >::m_am [private]

Pointer to basic object that holds original associations.

Definition at line 58 of file AssocTypeConverter.h.


The documentation for this class was generated from the following file:
Generated on Mon Sep 24 14:19:32 2007 for AtlfastAlgs by  doxygen 1.5.1