CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

helper::GsfElectronCollectionStoreManager Struct Reference

#include <GsfElectronSelector.h>

List of all members.

Public Types

typedef reco::GsfElectronCollection collection

Public Member Functions

template<typename I >
void cloneAndStore (const I &begin, const I &end, edm::Event &evt)
 GsfElectronCollectionStoreManager (const edm::Handle< reco::GsfElectronCollection > &)
edm::OrphanHandle
< reco::GsfElectronCollection
put (edm::Event &evt)
size_t size () const

Private Attributes

std::auto_ptr
< reco::GsfElectronCoreCollection
selElectronCores_
std::auto_ptr
< reco::GsfElectronCollection
selElectrons_
std::auto_ptr
< reco::GsfTrackExtraCollection
selGsfTrackExtras_
std::auto_ptr
< TrackingRecHitCollection
selHits_
std::auto_ptr
< reco::SuperClusterCollection
selSuperClusters_
std::auto_ptr
< reco::TrackExtraCollection
selTrackExtras_
std::auto_ptr
< reco::GsfTrackCollection
selTracks_

Detailed Description

Definition at line 25 of file GsfElectronSelector.h.


Member Typedef Documentation

Definition at line 26 of file GsfElectronSelector.h.


Constructor & Destructor Documentation

helper::GsfElectronCollectionStoreManager::GsfElectronCollectionStoreManager ( const edm::Handle< reco::GsfElectronCollection > &  ) [inline]

Member Function Documentation

template<typename I >
void helper::GsfElectronCollectionStoreManager::cloneAndStore ( const I &  begin,
const I &  end,
edm::Event evt 
) [inline]

Definition at line 37 of file GsfElectronSelector.h.

References reco::TrackExtraBase::add(), reco::GsfElectron::core(), end, reco::GsfTrack::gsfExtra(), reco::GsfElectron::gsfTrack(), Exhume::I, i, UserOptions_cff::idx, reco::Track::innerDetId(), reco::Track::innerMomentum(), reco::Track::innerOk(), reco::Track::innerPosition(), reco::Track::innerStateCovariance(), edm::Ref< C, T, F >::isNonnull(), reco::Track::outerDetId(), reco::Track::outerMomentum(), reco::Track::outerOk(), reco::Track::outerPosition(), reco::Track::outerStateCovariance(), reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), dt_dqm_sourceclient_common_cff::reco, reco::Track::seedDirection(), selElectronCores_, selElectrons_, selGsfTrackExtras_, selHits_, selSuperClusters_, selTrackExtras_, selTracks_, reco::Track::setExtra(), reco::GsfTrack::setGsfExtra(), and reco::GsfElectron::superCluster().

                                                                         {
      using namespace reco;
      TrackingRecHitRefProd rHits = evt.template getRefBeforePut<TrackingRecHitCollection>();
      TrackExtraRefProd rTrackExtras = evt.template getRefBeforePut<TrackExtraCollection>();
      GsfTrackExtraRefProd rGsfTrackExtras = evt.template getRefBeforePut<GsfTrackExtraCollection>();
      GsfTrackRefProd rTracks = evt.template getRefBeforePut<GsfTrackCollection>();      
      GsfElectronCoreRefProd rElectronCores = evt.template getRefBeforePut<GsfElectronCoreCollection>();      
      GsfElectronRefProd rElectrons = evt.template getRefBeforePut<GsfElectronCollection>();      
      SuperClusterRefProd rSuperClusters = evt.template getRefBeforePut<SuperClusterCollection>();      
      size_t idx = 0, tidx = 0, hidx = 0;
      for( I i = begin; i != end; ++ i ) {
        const GsfElectron & ele = * * i;
        selElectronCores_->push_back( GsfElectronCore( *(ele.core()) ) );
        selElectronCores_->back().setGsfTrack( GsfTrackRef( rTracks, idx ) );
        selElectronCores_->back().setSuperCluster( SuperClusterRef( rSuperClusters, idx ) );
        selSuperClusters_->push_back( SuperCluster( * ( ele.superCluster() ) ) );
        selElectrons_->push_back(GsfElectron(ele,GsfElectronCoreRef(rElectronCores,idx++),CaloClusterPtr(),TrackRef(),TrackBaseRef(),GsfTrackRefVector()));
        GsfTrackRef trkRef = ele.gsfTrack();
        if ( trkRef.isNonnull() ) {
          selTracks_->push_back( GsfTrack( * trkRef ) );
          GsfTrack & trk = selTracks_->back();
          selTrackExtras_->push_back( TrackExtra( trk.outerPosition(), trk.outerMomentum(), trk.outerOk(),
                                                  trk.innerPosition(), trk.innerMomentum(), trk.innerOk(),
                                                  trk.outerStateCovariance(), trk.outerDetId(),
                                                  trk.innerStateCovariance(), trk.innerDetId(),
                                                  trk.seedDirection() ) );
          selGsfTrackExtras_->push_back( GsfTrackExtra( *(trk.gsfExtra()) ) );
          TrackExtra & tx = selTrackExtras_->back();
          for( trackingRecHit_iterator hit = trk.recHitsBegin(); hit != trk.recHitsEnd(); ++ hit ) {
            selHits_->push_back( (*hit)->clone() );
            tx.add( TrackingRecHitRef( rHits, hidx ++ ) );
          }
          trk.setGsfExtra( GsfTrackExtraRef( rGsfTrackExtras, tidx ) ); 
          trk.setExtra( TrackExtraRef( rTrackExtras, tidx ++ ) ); 
        } 
      }
    }
edm::OrphanHandle<reco::GsfElectronCollection> helper::GsfElectronCollectionStoreManager::put ( edm::Event evt) [inline]
size_t helper::GsfElectronCollectionStoreManager::size ( void  ) const [inline]

Definition at line 86 of file GsfElectronSelector.h.

References selElectrons_.

{ return selElectrons_->size(); }

Member Data Documentation

Definition at line 89 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

Definition at line 88 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), put(), and size().

Definition at line 93 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

Definition at line 94 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

Definition at line 90 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

Definition at line 92 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

Definition at line 91 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().