CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
helper::MuonCollectionStoreManager Struct Reference

#include <MuonSelector.h>

Public Types

typedef reco::MuonCollection collection
 

Public Member Functions

template<typename I >
void cloneAndStore (const I &begin, const I &end, edm::Event &evt)
 Method to clone tracks, track extras and their hits and clusters. typename I = this is an interator over a Muon collection, **I needs to dereference into a Muon. More...
 
bool cloneClusters ()
 
 MuonCollectionStoreManager (const edm::Handle< reco::MuonCollection > &)
 
edm::OrphanHandle< reco::MuonCollectionput (edm::Event &evt)
 Put tracks, track extras and hits+clusters into the event. More...
 
void setCloneClusters (bool w)
 
size_t size () const
 Get the size. More...
 

Private Member Functions

bool clusterRefsOK (const reco::Track &track) const
 Check if all references to silicon strip/pixel clusters are available. More...
 
void processMuon (const reco::Muon &mu)
 Process a single muon. More...
 

Private Attributes

bool cloneClusters_
 Clone clusters, or not? Default: true. More...
 
ClusterStorer clusterStorer_
 
size_t hidx_
 
size_t higbdx_
 
size_t hisadx_
 
size_t id_
 
size_t idx_
 
size_t igbd_
 
size_t igbdx_
 
size_t isad_
 
size_t isadx_
 
TrackingRecHitRefProd rGBHits_
 
reco::TrackExtraRefProd rGBTrackExtras_
 
reco::TrackRefProd rGBTracks_
 
TrackingRecHitRefProd rHits_
 
reco::MuonRefProd rMuons_
 
TrackingRecHitRefProd rSAHits_
 
reco::TrackExtraRefProd rSATrackExtras_
 
reco::TrackRefProd rSATracks_
 
reco::TrackExtraRefProd rTrackExtras_
 
reco::TrackRefProd rTracks_
 
std::unique_ptr< reco::TrackCollectionselGlobalMuonTracks_
 
std::unique_ptr< reco::TrackExtraCollectionselGlobalMuonTracksExtras_
 
std::unique_ptr< TrackingRecHitCollectionselGlobalMuonTracksHits_
 
std::unique_ptr< reco::MuonCollectionselMuons_
 
std::unique_ptr< edmNew::DetSetVector< Phase2TrackerCluster1D > > selPhase2OTClusters_
 
std::unique_ptr< edmNew::DetSetVector< SiPixelCluster > > selPixelClusters_
 
std::unique_ptr< reco::TrackCollectionselStandAloneTracks_
 
std::unique_ptr< reco::TrackExtraCollectionselStandAloneTracksExtras_
 
std::unique_ptr< TrackingRecHitCollectionselStandAloneTracksHits_
 
std::unique_ptr< edmNew::DetSetVector< SiStripCluster > > selStripClusters_
 
std::unique_ptr< reco::TrackCollectionselTracks_
 
std::unique_ptr< reco::TrackExtraCollectionselTracksExtras_
 
std::unique_ptr< TrackingRecHitCollectionselTracksHits_
 

Detailed Description

Definition at line 31 of file MuonSelector.h.

Member Typedef Documentation

◆ collection

typedef reco::MuonCollection helper::MuonCollectionStoreManager::collection

Definition at line 33 of file MuonSelector.h.

Constructor & Destructor Documentation

◆ MuonCollectionStoreManager()

helper::MuonCollectionStoreManager::MuonCollectionStoreManager ( const edm::Handle< reco::MuonCollection > &  )

Definition at line 15 of file MuonSelector.cc.

29  rMuons_(),
30  rTracks_(),
31  rTrackExtras_(),
32  rHits_(),
33  rGBTracks_(),
35  rGBHits_(),
36  rSATracks_(),
38  rSAHits_(),
40  id_(0),
41  igbd_(0),
42  isad_(0),
43  idx_(0),
44  igbdx_(0),
45  isadx_(0),
46  hidx_(0),
47  higbdx_(0),
48  hisadx_(0),
49  cloneClusters_(true) {}
reco::TrackExtraRefProd rSATrackExtras_
Definition: MuonSelector.h:90
std::unique_ptr< reco::MuonCollection > selMuons_
Definition: MuonSelector.h:66
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
std::unique_ptr< reco::TrackExtraCollection > selTracksExtras_
Definition: MuonSelector.h:68
std::unique_ptr< reco::TrackCollection > selStandAloneTracks_
Definition: MuonSelector.h:73
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
bool cloneClusters_
Clone clusters, or not? Default: true.
Definition: MuonSelector.h:101
reco::TrackExtraRefProd rTrackExtras_
Definition: MuonSelector.h:82
TrackingRecHitRefProd rSAHits_
Definition: MuonSelector.h:91
std::unique_ptr< edmNew::DetSetVector< Phase2TrackerCluster1D > > selPhase2OTClusters_
Definition: MuonSelector.h:78
TrackingRecHitRefProd rHits_
Definition: MuonSelector.h:83
std::unique_ptr< reco::TrackCollection > selTracks_
Definition: MuonSelector.h:67
std::unique_ptr< TrackingRecHitCollection > selGlobalMuonTracksHits_
Definition: MuonSelector.h:72
std::unique_ptr< edmNew::DetSetVector< SiPixelCluster > > selPixelClusters_
Definition: MuonSelector.h:77
TrackingRecHitRefProd rGBHits_
Definition: MuonSelector.h:87
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:10
reco::TrackExtraRefProd rGBTrackExtras_
Definition: MuonSelector.h:86
std::unique_ptr< TrackingRecHitCollection > selTracksHits_
Definition: MuonSelector.h:69
std::unique_ptr< TrackingRecHitCollection > selStandAloneTracksHits_
Definition: MuonSelector.h:75
std::unique_ptr< reco::TrackCollection > selGlobalMuonTracks_
Definition: MuonSelector.h:70
std::unique_ptr< reco::TrackExtraCollection > selGlobalMuonTracksExtras_
Definition: MuonSelector.h:71
std::unique_ptr< reco::TrackExtraCollection > selStandAloneTracksExtras_
Definition: MuonSelector.h:74
std::unique_ptr< edmNew::DetSetVector< SiStripCluster > > selStripClusters_
Definition: MuonSelector.h:76

Member Function Documentation

◆ cloneAndStore()

template<typename I >
void helper::MuonCollectionStoreManager::cloneAndStore ( const I &  begin,
const I &  end,
edm::Event evt 
)

Method to clone tracks, track extras and their hits and clusters. typename I = this is an interator over a Muon collection, **I needs to dereference into a Muon.

Definition at line 114 of file MuonSelector.h.

References helper::ClusterStorer::clear(), clusterStorer_, hidx_, higbdx_, hisadx_, Exhume::I, mps_fire::i, id_, idx_, igbd_, igbdx_, isad_, isadx_, amptDefaultParameters_cff::mu, helper::ClusterStorer::processAllClusters(), processMuon(), rGBHits_, rGBTrackExtras_, rGBTracks_, rHits_, rMuons_, rSAHits_, rSATrackExtras_, rSATracks_, rTrackExtras_, rTracks_, selPhase2OTClusters_, selPixelClusters_, and selStripClusters_.

114  {
115  using namespace reco;
116  rHits_ = evt.template getRefBeforePut<TrackingRecHitCollection>("TrackerOnly");
117  rGBHits_ = evt.template getRefBeforePut<TrackingRecHitCollection>("GlobalMuon");
118  rSAHits_ = evt.template getRefBeforePut<TrackingRecHitCollection>("StandAlone");
119  rTrackExtras_ = evt.template getRefBeforePut<TrackExtraCollection>("TrackerOnly");
120  rGBTrackExtras_ = evt.template getRefBeforePut<TrackExtraCollection>("GlobalMuon");
121  rSATrackExtras_ = evt.template getRefBeforePut<TrackExtraCollection>("StandAlone");
122  rTracks_ = evt.template getRefBeforePut<TrackCollection>("TrackerOnly");
123  rGBTracks_ = evt.template getRefBeforePut<TrackCollection>("GlobalMuon");
124  rSATracks_ = evt.template getRefBeforePut<TrackCollection>("StandAlone");
125  rMuons_ = evt.template getRefBeforePut<MuonCollection>("SelectedMuons");
126  //--- New: save clusters too
128  evt.template getRefBeforePut<edmNew::DetSetVector<SiStripCluster>>();
129 
131  evt.template getRefBeforePut<edmNew::DetSetVector<SiPixelCluster>>();
132 
134  evt.template getRefBeforePut<edmNew::DetSetVector<Phase2TrackerCluster1D>>();
135 
136  id_ = 0;
137  igbd_ = 0;
138  isad_ = 0;
139  idx_ = 0;
140  igbdx_ = 0;
141  isadx_ = 0;
142  hidx_ = 0;
143  higbdx_ = 0;
144  hisadx_ = 0;
146 
147  for (I i = begin; i != end; ++i) {
148  const Muon &mu = **i;
149  //--- Clone this track, and store references aside
150  processMuon(mu);
151  }
152  //--- Clone the clusters and fixup refs
154  rPixelClusters,
156  rStripClusters,
158  rPhase2OTClusters);
159  }
reco::TrackExtraRefProd rSATrackExtras_
Definition: MuonSelector.h:90
reco::TrackExtraRefProd rTrackExtras_
Definition: MuonSelector.h:82
TrackingRecHitRefProd rSAHits_
Definition: MuonSelector.h:91
Definition: Muon.py:1
std::unique_ptr< edmNew::DetSetVector< Phase2TrackerCluster1D > > selPhase2OTClusters_
Definition: MuonSelector.h:78
void processMuon(const reco::Muon &mu)
Process a single muon.
Definition: MuonSelector.cc:54
const std::complex< double > I
Definition: I.h:8
TrackingRecHitRefProd rHits_
Definition: MuonSelector.h:83
void processAllClusters(edmNew::DetSetVector< SiPixelCluster > &pixelDsvToFill, edm::RefProd< edmNew::DetSetVector< SiPixelCluster > > refPixelClusters, edmNew::DetSetVector< SiStripCluster > &stripDsvToFill, edm::RefProd< edmNew::DetSetVector< SiStripCluster > > refStripClusters, edmNew::DetSetVector< Phase2TrackerCluster1D > &phase2OTDsvToFill, edm::RefProd< edmNew::DetSetVector< Phase2TrackerCluster1D > > refPhase2OTClusters)
std::unique_ptr< edmNew::DetSetVector< SiPixelCluster > > selPixelClusters_
Definition: MuonSelector.h:77
TrackingRecHitRefProd rGBHits_
Definition: MuonSelector.h:87
reco::TrackExtraRefProd rGBTrackExtras_
Definition: MuonSelector.h:86
void clear()
clear records
fixed size matrix
std::unique_ptr< edmNew::DetSetVector< SiStripCluster > > selStripClusters_
Definition: MuonSelector.h:76

◆ cloneClusters()

bool helper::MuonCollectionStoreManager::cloneClusters ( )
inline

Use these to turn off/on the cloning of clusters. The default is to clone them. To not clone (and save space in a quick local job, do: setCloneClusters(false);

Definition at line 43 of file MuonSelector.h.

References cloneClusters_.

Referenced by processMuon(), and put().

43 { return cloneClusters_; }
bool cloneClusters_
Clone clusters, or not? Default: true.
Definition: MuonSelector.h:101

◆ clusterRefsOK()

bool helper::MuonCollectionStoreManager::clusterRefsOK ( const reco::Track track) const
private

Check if all references to silicon strip/pixel clusters are available.

Definition at line 178 of file MuonSelector.cc.

References SiStripRecHit2D::cluster(), edm::Ref< C, T, F >::isAvailable(), SiStripMatchedRecHit2D::monoHit(), ProjectedSiStripRecHit2D::originalHit(), SiStripMatchedRecHit2D::stereoHit(), HLT_2024v14_cff::track, and DetId::Tracker.

Referenced by processMuon().

178  {
179  for (trackingRecHit_iterator hitIt = track.recHitsBegin(); hitIt != track.recHitsEnd(); ++hitIt) {
180  const TrackingRecHit &hit = **hitIt;
181  if (!hit.isValid() || hit.geographicalId().det() != DetId::Tracker)
182  continue;
183 
184  // So we are in the tracker - now check hit types and availability of cluster refs:
185  const std::type_info &hit_type = typeid(hit);
186  if (hit_type == typeid(SiPixelRecHit)) {
187  if (!static_cast<const SiPixelRecHit &>(hit).cluster().isAvailable())
188  return false;
189  } else if (hit_type == typeid(SiStripRecHit2D)) {
190  if (!static_cast<const SiStripRecHit2D &>(hit).cluster().isAvailable())
191  return false;
192  } else if (hit_type == typeid(SiStripRecHit1D)) {
193  if (!static_cast<const SiStripRecHit1D &>(hit).cluster().isAvailable())
194  return false;
195  } else if (hit_type == typeid(SiStripMatchedRecHit2D)) {
196  const SiStripMatchedRecHit2D &mHit = static_cast<const SiStripMatchedRecHit2D &>(hit);
197  if (!mHit.monoHit().cluster().isAvailable())
198  return false;
199  if (!mHit.stereoHit().cluster().isAvailable())
200  return false;
201  } else if (hit_type == typeid(ProjectedSiStripRecHit2D)) {
202  const ProjectedSiStripRecHit2D &pHit = static_cast<const ProjectedSiStripRecHit2D &>(hit);
203  if (!pHit.originalHit().cluster().isAvailable())
204  return false;
205  } else if (hit_type == typeid(Phase2TrackerRecHit1D)) {
206  if (!static_cast<const Phase2TrackerRecHit1D &>(hit).cluster().isAvailable())
207  return false;
208  } else {
209  // std::cout << "| It is a " << hit_type.name() << " hit !?" << std::endl;
210  // Do nothing. We might end up here for FastSim hits.
211  } // end 'switch' on hit type
212  }
213 
214  // No tracker hit with bad cluster found, so all fine:
215  return true;
216  }
SiStripRecHit2D stereoHit() const
ClusterRef cluster() const
bool isAvailable() const
Definition: Ref.h:541
SiStripRecHit2D originalHit() const
SiStripRecHit2D monoHit() const
Our base class.
Definition: SiPixelRecHit.h:23

◆ processMuon()

void helper::MuonCollectionStoreManager::processMuon ( const reco::Muon mu)
private

Process a single muon.

Definition at line 54 of file MuonSelector.cc.

References helper::ClusterStorer::addCluster(), cloneClusters(), clusterRefsOK(), clusterStorer_, reco::Muon::globalTrack(), hidx_, higbdx_, hisadx_, id_, idx_, igbd_, igbdx_, reco::Track::innerDetId(), reco::Track::innerMomentum(), reco::Track::innerOk(), reco::Track::innerPosition(), reco::Track::innerStateCovariance(), reco::Muon::innerTrack(), isad_, isadx_, edm::Ref< C, T, F >::isNonnull(), TrackingRecHit::isValid(), amptDefaultParameters_cff::mu, reco::Track::outerDetId(), reco::Track::outerMomentum(), reco::Track::outerOk(), reco::Track::outerPosition(), reco::Track::outerStateCovariance(), reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), rGBHits_, rGBTrackExtras_, rGBTracks_, rHits_, rSAHits_, rSATrackExtras_, rSATracks_, rTrackExtras_, rTracks_, reco::Track::seedDirection(), selGlobalMuonTracks_, selGlobalMuonTracksExtras_, selGlobalMuonTracksHits_, selMuons_, selStandAloneTracks_, selStandAloneTracksExtras_, selStandAloneTracksHits_, selTracks_, selTracksExtras_, selTracksHits_, reco::Track::setExtra(), reco::TrackExtraBase::setHits(), and DetId::Tracker.

Referenced by cloneAndStore().

54  {
55  if (this->cloneClusters() && ((mu.globalTrack().isNonnull() && !this->clusterRefsOK(*mu.globalTrack())) ||
56  (mu.innerTrack().isNonnull() && !this->clusterRefsOK(*mu.innerTrack()))
57  // || (mu.outerTrack(). isNonnull() && !this->clusterRefsOK(*mu.outerTrack() ))
58  )) { // outer track is muon only and has no strip clusters...
59  // At least until CMSSW_2_1_8, global muon track reconstruction assigns wrong hits in
60  // case of a track from iterative tracking. These hits are fetched from Trajectories
61  // instead of from Tracks and therefore reference temporary cluster collections.
62  // As a hack we skip these muons here - they can anyway not be refitted.
63  edm::LogError("BadRef") << "@SUB=MuonCollectionStoreManager::processMuon"
64  << "Skip muon: One of its tracks references "
65  << "non-available clusters!";
66  return;
67  }
68 
69  selMuons_->push_back(Muon(mu));
70  // only tracker Muon Track
71  selMuons_->back().setInnerTrack(TrackRef(rTracks_, id_++));
72  TrackRef trkRef = mu.track();
73  if (trkRef.isNonnull()) {
74  selTracks_->push_back(Track(*trkRef));
75 
76  Track &trk = selTracks_->back();
77 
78  selTracksExtras_->push_back(TrackExtra(trk.outerPosition(),
79  trk.outerMomentum(),
80  trk.outerOk(),
81  trk.innerPosition(),
82  trk.innerMomentum(),
83  trk.innerOk(),
85  trk.outerDetId(),
87  trk.innerDetId(),
88  trk.seedDirection()));
89 
90  TrackExtra &tx = selTracksExtras_->back();
91 
92  auto const firstHitIndex = hidx_;
93  unsigned int nHitsAdded = 0;
94  for (trackingRecHit_iterator hit = trk.recHitsBegin(); hit != trk.recHitsEnd(); ++hit, ++hidx_) {
95  selTracksHits_->push_back((*hit)->clone());
96  TrackingRecHit *newHit = &(selTracksHits_->back());
97  ++nHitsAdded;
98  if (cloneClusters() && newHit->isValid() && ((*hit)->geographicalId().det() == DetId::Tracker)) {
100  }
101  } // end of for loop over tracking rec hits on this track
102  tx.setHits(rHits_, firstHitIndex, nHitsAdded);
103 
105 
106  } // TO trkRef.isNonnull
107 
108  // global Muon Track
109  selMuons_->back().setGlobalTrack(TrackRef(rGBTracks_, igbd_++));
110  trkRef = mu.combinedMuon();
111  if (trkRef.isNonnull()) {
112  selGlobalMuonTracks_->push_back(Track(*trkRef));
113  Track &trk = selGlobalMuonTracks_->back();
114 
116  trk.outerMomentum(),
117  trk.outerOk(),
118  trk.innerPosition(),
119  trk.innerMomentum(),
120  trk.innerOk(),
121  trk.outerStateCovariance(),
122  trk.outerDetId(),
123  trk.innerStateCovariance(),
124  trk.innerDetId(),
125  trk.seedDirection()));
127  auto const firstHitIndex = higbdx_;
128  unsigned int nHitsAdded = 0;
129  for (trackingRecHit_iterator hit = trk.recHitsBegin(); hit != trk.recHitsEnd(); ++hit, ++higbdx_) {
130  selGlobalMuonTracksHits_->push_back((*hit)->clone());
131  TrackingRecHit *newHit = &(selGlobalMuonTracksHits_->back());
132  ++nHitsAdded;
133  if (cloneClusters() && newHit->isValid() && ((*hit)->geographicalId().det() == DetId::Tracker)) {
135  }
136  }
137  tx.setHits(rGBHits_, firstHitIndex, nHitsAdded);
138 
140 
141  } // GB trkRef.isNonnull()
142 
143  // stand alone Muon Track
144  selMuons_->back().setOuterTrack(TrackRef(rSATracks_, isad_++));
145  trkRef = mu.standAloneMuon();
146  if (trkRef.isNonnull()) {
147  selStandAloneTracks_->push_back(Track(*trkRef));
148  Track &trk = selStandAloneTracks_->back();
149 
151  trk.outerMomentum(),
152  trk.outerOk(),
153  trk.innerPosition(),
154  trk.innerMomentum(),
155  trk.innerOk(),
156  trk.outerStateCovariance(),
157  trk.outerDetId(),
158  trk.innerStateCovariance(),
159  trk.innerDetId(),
160  trk.seedDirection()));
162  auto const firstHitIndex = hisadx_;
163  unsigned int nHitsAdded = 0;
164  for (trackingRecHit_iterator hit = trk.recHitsBegin(); hit != trk.recHitsEnd(); ++hit) {
165  selStandAloneTracksHits_->push_back((*hit)->clone());
166  ++nHitsAdded;
167  hisadx_++;
168  }
169  tx.setHits(rSAHits_, firstHitIndex, nHitsAdded);
171 
172  } // SA trkRef.isNonnull()
173  } // end of track, and function
reco::TrackExtraRefProd rSATrackExtras_
Definition: MuonSelector.h:90
std::unique_ptr< reco::MuonCollection > selMuons_
Definition: MuonSelector.h:66
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
Definition: Track.h:68
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:62
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:65
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:51
void setHits(TrackingRecHitRefProd const &prod, unsigned firstH, unsigned int nH)
bool clusterRefsOK(const reco::Track &track) const
Check if all references to silicon strip/pixel clusters are available.
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
Definition: TrackExtraFwd.h:16
std::unique_ptr< reco::TrackExtraCollection > selTracksExtras_
Definition: MuonSelector.h:68
Log< level::Error, false > LogError
void addCluster(TrackingRecHitCollection &hits, size_t index)
add cluster of newHit to list (throws if hit is of unknown type)
std::unique_ptr< reco::TrackCollection > selStandAloneTracks_
Definition: MuonSelector.h:73
reco::TrackExtraRefProd rTrackExtras_
Definition: MuonSelector.h:82
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
Definition: Track.h:71
TrackingRecHitRefProd rSAHits_
Definition: MuonSelector.h:91
bool isValid() const
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:91
TrackingRecHitRefProd rHits_
Definition: MuonSelector.h:83
virtual TrackRef innerTrack() const
Definition: Muon.h:45
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
Definition: Track.h:82
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:88
std::unique_ptr< reco::TrackCollection > selTracks_
Definition: MuonSelector.h:67
std::unique_ptr< TrackingRecHitCollection > selGlobalMuonTracksHits_
Definition: MuonSelector.h:72
bool innerOk() const
return true if the innermost hit is valid
Definition: Track.h:53
TrackingRecHitRefProd rGBHits_
Definition: MuonSelector.h:87
const PropagationDirection & seedDirection() const
direction of how the hits were sorted in the original seed
Definition: Track.h:148
void setExtra(const TrackExtraRef &ref)
set reference to "extra" object
Definition: Track.h:136
reco::TrackExtraRefProd rGBTrackExtras_
Definition: MuonSelector.h:86
std::unique_ptr< TrackingRecHitCollection > selTracksHits_
Definition: MuonSelector.h:69
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
Definition: Track.h:79
std::unique_ptr< TrackingRecHitCollection > selStandAloneTracksHits_
Definition: MuonSelector.h:75
std::unique_ptr< reco::TrackCollection > selGlobalMuonTracks_
Definition: MuonSelector.h:70
std::unique_ptr< reco::TrackExtraCollection > selGlobalMuonTracksExtras_
Definition: MuonSelector.h:71
std::unique_ptr< reco::TrackExtraCollection > selStandAloneTracksExtras_
Definition: MuonSelector.h:74
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:59
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:56
bool outerOk() const
return true if the outermost hit is valid
Definition: Track.h:50

◆ put()

edm::OrphanHandle< reco::MuonCollection > helper::MuonCollectionStoreManager::put ( edm::Event evt)

Put tracks, track extras and hits+clusters into the event.

Put Muons, tracks, track extras and hits+clusters into the event.

Definition at line 221 of file MuonSelector.cc.

References cloneClusters(), h, eostools::move(), edm::Event::put(), selGlobalMuonTracks_, selGlobalMuonTracksExtras_, selGlobalMuonTracksHits_, selMuons_, selPhase2OTClusters_, selPixelClusters_, selStandAloneTracks_, selStandAloneTracksExtras_, selStandAloneTracksHits_, selStripClusters_, selTracks_, selTracksExtras_, and selTracksHits_.

221  {
223  h = evt.put(std::move(selMuons_), "SelectedMuons");
224  evt.put(std::move(selTracks_), "TrackerOnly");
225  evt.put(std::move(selTracksExtras_), "TrackerOnly");
226  evt.put(std::move(selTracksHits_), "TrackerOnly");
227  evt.put(std::move(selGlobalMuonTracks_), "GlobalMuon");
228  evt.put(std::move(selGlobalMuonTracksExtras_), "GlobalMuon");
229  evt.put(std::move(selGlobalMuonTracksHits_), "GlobalMuon");
230  evt.put(std::move(selStandAloneTracks_), "StandAlone");
231  evt.put(std::move(selStandAloneTracksExtras_), "StandAlone");
232  evt.put(std::move(selStandAloneTracksHits_), "StandAlone");
233  if (cloneClusters()) {
237  }
238  return h;
239  }
std::unique_ptr< reco::MuonCollection > selMuons_
Definition: MuonSelector.h:66
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
std::unique_ptr< reco::TrackExtraCollection > selTracksExtras_
Definition: MuonSelector.h:68
std::unique_ptr< reco::TrackCollection > selStandAloneTracks_
Definition: MuonSelector.h:73
std::unique_ptr< edmNew::DetSetVector< Phase2TrackerCluster1D > > selPhase2OTClusters_
Definition: MuonSelector.h:78
std::unique_ptr< reco::TrackCollection > selTracks_
Definition: MuonSelector.h:67
std::unique_ptr< TrackingRecHitCollection > selGlobalMuonTracksHits_
Definition: MuonSelector.h:72
std::unique_ptr< edmNew::DetSetVector< SiPixelCluster > > selPixelClusters_
Definition: MuonSelector.h:77
std::unique_ptr< TrackingRecHitCollection > selTracksHits_
Definition: MuonSelector.h:69
std::unique_ptr< TrackingRecHitCollection > selStandAloneTracksHits_
Definition: MuonSelector.h:75
std::unique_ptr< reco::TrackCollection > selGlobalMuonTracks_
Definition: MuonSelector.h:70
std::unique_ptr< reco::TrackExtraCollection > selGlobalMuonTracksExtras_
Definition: MuonSelector.h:71
std::unique_ptr< reco::TrackExtraCollection > selStandAloneTracksExtras_
Definition: MuonSelector.h:74
std::unique_ptr< edmNew::DetSetVector< SiStripCluster > > selStripClusters_
Definition: MuonSelector.h:76
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
def move(src, dest)
Definition: eostools.py:511

◆ setCloneClusters()

void helper::MuonCollectionStoreManager::setCloneClusters ( bool  w)
inline

Definition at line 44 of file MuonSelector.h.

References cloneClusters_, and w().

44 { cloneClusters_ = w; }
T w() const
bool cloneClusters_
Clone clusters, or not? Default: true.
Definition: MuonSelector.h:101

◆ size()

size_t helper::MuonCollectionStoreManager::size ( void  ) const
inline

Get the size.

Definition at line 54 of file MuonSelector.h.

References selMuons_.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

54 { return selMuons_->size(); }
std::unique_ptr< reco::MuonCollection > selMuons_
Definition: MuonSelector.h:66

Member Data Documentation

◆ cloneClusters_

bool helper::MuonCollectionStoreManager::cloneClusters_
private

Clone clusters, or not? Default: true.

Definition at line 101 of file MuonSelector.h.

Referenced by cloneClusters(), and setCloneClusters().

◆ clusterStorer_

ClusterStorer helper::MuonCollectionStoreManager::clusterStorer_
private

Helper to treat copies of selected clusters and make the hits refer to the output cluster collections:

Definition at line 95 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ hidx_

size_t helper::MuonCollectionStoreManager::hidx_
private

Definition at line 98 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ higbdx_

size_t helper::MuonCollectionStoreManager::higbdx_
private

Definition at line 98 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ hisadx_

size_t helper::MuonCollectionStoreManager::hisadx_
private

Definition at line 98 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ id_

size_t helper::MuonCollectionStoreManager::id_
private

Definition at line 98 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ idx_

size_t helper::MuonCollectionStoreManager::idx_
private

Definition at line 98 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ igbd_

size_t helper::MuonCollectionStoreManager::igbd_
private

Definition at line 98 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ igbdx_

size_t helper::MuonCollectionStoreManager::igbdx_
private

Definition at line 98 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ isad_

size_t helper::MuonCollectionStoreManager::isad_
private

Definition at line 98 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ isadx_

size_t helper::MuonCollectionStoreManager::isadx_
private

Definition at line 98 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ rGBHits_

TrackingRecHitRefProd helper::MuonCollectionStoreManager::rGBHits_
private

Definition at line 87 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ rGBTrackExtras_

reco::TrackExtraRefProd helper::MuonCollectionStoreManager::rGBTrackExtras_
private

Definition at line 86 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ rGBTracks_

reco::TrackRefProd helper::MuonCollectionStoreManager::rGBTracks_
private

Definition at line 85 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ rHits_

TrackingRecHitRefProd helper::MuonCollectionStoreManager::rHits_
private

Definition at line 83 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ rMuons_

reco::MuonRefProd helper::MuonCollectionStoreManager::rMuons_
private

Definition at line 80 of file MuonSelector.h.

Referenced by cloneAndStore().

◆ rSAHits_

TrackingRecHitRefProd helper::MuonCollectionStoreManager::rSAHits_
private

Definition at line 91 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ rSATrackExtras_

reco::TrackExtraRefProd helper::MuonCollectionStoreManager::rSATrackExtras_
private

Definition at line 90 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ rSATracks_

reco::TrackRefProd helper::MuonCollectionStoreManager::rSATracks_
private

Definition at line 89 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ rTrackExtras_

reco::TrackExtraRefProd helper::MuonCollectionStoreManager::rTrackExtras_
private

Definition at line 82 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ rTracks_

reco::TrackRefProd helper::MuonCollectionStoreManager::rTracks_
private

Definition at line 81 of file MuonSelector.h.

Referenced by cloneAndStore(), and processMuon().

◆ selGlobalMuonTracks_

std::unique_ptr<reco::TrackCollection> helper::MuonCollectionStoreManager::selGlobalMuonTracks_
private

Definition at line 70 of file MuonSelector.h.

Referenced by processMuon(), and put().

◆ selGlobalMuonTracksExtras_

std::unique_ptr<reco::TrackExtraCollection> helper::MuonCollectionStoreManager::selGlobalMuonTracksExtras_
private

Definition at line 71 of file MuonSelector.h.

Referenced by processMuon(), and put().

◆ selGlobalMuonTracksHits_

std::unique_ptr<TrackingRecHitCollection> helper::MuonCollectionStoreManager::selGlobalMuonTracksHits_
private

Definition at line 72 of file MuonSelector.h.

Referenced by processMuon(), and put().

◆ selMuons_

std::unique_ptr<reco::MuonCollection> helper::MuonCollectionStoreManager::selMuons_
private

Definition at line 66 of file MuonSelector.h.

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

◆ selPhase2OTClusters_

std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D> > helper::MuonCollectionStoreManager::selPhase2OTClusters_
private

Definition at line 78 of file MuonSelector.h.

Referenced by cloneAndStore(), and put().

◆ selPixelClusters_

std::unique_ptr<edmNew::DetSetVector<SiPixelCluster> > helper::MuonCollectionStoreManager::selPixelClusters_
private

Definition at line 77 of file MuonSelector.h.

Referenced by cloneAndStore(), and put().

◆ selStandAloneTracks_

std::unique_ptr<reco::TrackCollection> helper::MuonCollectionStoreManager::selStandAloneTracks_
private

Definition at line 73 of file MuonSelector.h.

Referenced by processMuon(), and put().

◆ selStandAloneTracksExtras_

std::unique_ptr<reco::TrackExtraCollection> helper::MuonCollectionStoreManager::selStandAloneTracksExtras_
private

Definition at line 74 of file MuonSelector.h.

Referenced by processMuon(), and put().

◆ selStandAloneTracksHits_

std::unique_ptr<TrackingRecHitCollection> helper::MuonCollectionStoreManager::selStandAloneTracksHits_
private

Definition at line 75 of file MuonSelector.h.

Referenced by processMuon(), and put().

◆ selStripClusters_

std::unique_ptr<edmNew::DetSetVector<SiStripCluster> > helper::MuonCollectionStoreManager::selStripClusters_
private

Definition at line 76 of file MuonSelector.h.

Referenced by cloneAndStore(), and put().

◆ selTracks_

std::unique_ptr<reco::TrackCollection> helper::MuonCollectionStoreManager::selTracks_
private

Definition at line 67 of file MuonSelector.h.

Referenced by processMuon(), and put().

◆ selTracksExtras_

std::unique_ptr<reco::TrackExtraCollection> helper::MuonCollectionStoreManager::selTracksExtras_
private

Definition at line 68 of file MuonSelector.h.

Referenced by processMuon(), and put().

◆ selTracksHits_

std::unique_ptr<TrackingRecHitCollection> helper::MuonCollectionStoreManager::selTracksHits_
private

Definition at line 69 of file MuonSelector.h.

Referenced by processMuon(), and put().