CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HSCParticleProducer Class Reference

#include <SUSYBSMAnalysis/HSCParticleProducer/interface/HSCParticleProducer.h>

Inheritance diagram for HSCParticleProducer:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HSCParticleProducer (const edm::ParameterSet &)
 
 ~HSCParticleProducer () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
bool filter (edm::Event &, const edm::EventSetup &) override
 
std::vector< susybsm::HSCParticlegetHSCPSeedCollection (edm::Handle< reco::TrackCollection > &trackCollectionHandle, edm::Handle< reco::MuonCollection > &muonCollectionHandle, edm::Handle< reco::MuonCollection > &MTmuonCollectionHandle)
 

Private Attributes

BetaCalculatorECALbeta_calculator_ECAL
 
BetaCalculatorMUONbeta_calculator_MUON
 
BetaCalculatorRPCbeta_calculator_RPC
 
BetaCalculatorTKbeta_calculator_TK
 
bool Filter_
 
edm::EDGetTokenT< reco::MuonCollectionm_MTmuonsToken
 
edm::EDGetTokenT< reco::MuonCollectionm_muonsToken
 
edm::EDGetTokenT< reco::TrackCollectionm_trackIsoToken
 
edm::EDGetTokenT< reco::TrackCollectionm_trackToken
 
float maxInvPtDiff
 
float maxTkChi2
 
float minDR
 
float minMTDR
 
float minMTMuPt
 
float minMuP
 
float minSAMuPt
 
unsigned int minTkHits
 
float minTkP
 
std::vector< CandidateSelector * > Selectors
 
bool useBetaFromEcal
 
bool useBetaFromMuon
 
bool useBetaFromRpc
 
bool useBetaFromTk
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: Producer for HSCP candidates, merging tracker dt information and rpc information

Implementation: <Notes on="" implementation>="">

Definition at line 52 of file HSCParticleProducer.h.

Constructor & Destructor Documentation

◆ HSCParticleProducer()

HSCParticleProducer::HSCParticleProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 25 of file HSCParticleProducer.cc.

25  {
26  using namespace edm;
27  using namespace std;
28 
29  // the Act as Event filter
30  Filter_ = iConfig.getParameter<bool>("filter");
31 
32  // the input collections
33  m_trackToken = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracks"));
34  m_muonsToken = consumes<reco::MuonCollection>(iConfig.getParameter<edm::InputTag>("muons"));
35  m_MTmuonsToken = consumes<reco::MuonCollection>(iConfig.getParameter<edm::InputTag>("MTmuons"));
36  m_trackIsoToken = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracksIsolation"));
37 
38  useBetaFromTk = iConfig.getParameter<bool>("useBetaFromTk");
39  useBetaFromMuon = iConfig.getParameter<bool>("useBetaFromMuon");
40  useBetaFromRpc = iConfig.getParameter<bool>("useBetaFromRpc");
41  useBetaFromEcal = iConfig.getParameter<bool>("useBetaFromEcal");
42 
43  // the parameters
44  minTkP = iConfig.getParameter<double>("minTkP"); // 30
45  maxTkChi2 = iConfig.getParameter<double>("maxTkChi2"); // 5
46  minTkHits = iConfig.getParameter<uint32_t>("minTkHits"); // 9
47  minMuP = iConfig.getParameter<double>("minMuP"); // 30
48  minDR = iConfig.getParameter<double>("minDR"); // 0.1
49  minSAMuPt = iConfig.getParameter<double>("minSAMuPt"); // 70
50  minMTMuPt = iConfig.getParameter<double>("minMTMuPt"); // 70
51  minMTDR = iConfig.getParameter<double>("minMTDR"); // 0.3
52  maxInvPtDiff = iConfig.getParameter<double>("maxInvPtDiff"); // 0.005
53 
54  if (useBetaFromTk)
56  if (useBetaFromMuon)
58  if (useBetaFromRpc)
60  if (useBetaFromEcal)
62 
63  // Load all the selections
64  std::vector<edm::ParameterSet> SelectionParameters =
65  iConfig.getParameter<std::vector<edm::ParameterSet> >("SelectionParameters");
66  for (unsigned int i = 0; i < SelectionParameters.size(); i++) {
68  }
69 
70  // what I produce
71  produces<susybsm::HSCParticleCollection>();
72  if (useBetaFromEcal)
73  produces<susybsm::HSCPCaloInfoCollection>();
74 }

References edm::ParameterSet::getParameter(), mps_fire::i, PDWG_EXOHSCP_cff::maxInvPtDiff, HSCParticleProducer_cff::maxTkChi2, PDWG_EXOHSCP_cff::minDR, HSCParticleProducer_cff::minMTDR, HSCParticleProducer_cff::minMTMuPt, HSCParticleProducer_cff::minMuP, HSCParticleProducer_cff::minSAMuPt, HSCParticleProducer_cff::minTkHits, HSCParticleProducer_cff::minTkP, HSCParticleProducer_cff::SelectionParameters, HSCParticleProducer_cff::useBetaFromEcal, HSCParticleProducer_cff::useBetaFromMuon, HSCParticleProducer_cff::useBetaFromRpc, and HSCParticleProducer_cff::useBetaFromTk.

◆ ~HSCParticleProducer()

HSCParticleProducer::~HSCParticleProducer ( )
override

Definition at line 76 of file HSCParticleProducer.cc.

76  {
77  // do anything here that needs to be done at desctruction time
78  // (e.g. close files, deallocate resources etc.)
79 }

Member Function Documentation

◆ beginJob()

void HSCParticleProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 216 of file HSCParticleProducer.cc.

216 {}

◆ endJob()

void HSCParticleProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 219 of file HSCParticleProducer.cc.

219 {}

◆ filter()

bool HSCParticleProducer::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDFilter.

Definition at line 86 of file HSCParticleProducer.cc.

86  {
87  using namespace edm;
88  using namespace reco;
89  using namespace std;
90  using namespace susybsm;
91 
92  // information from the muons
93  edm::Handle<reco::MuonCollection> muonCollectionHandle;
94  iEvent.getByToken(m_muonsToken, muonCollectionHandle);
95 
96  //information from the mean timer muons
97  edm::Handle<reco::MuonCollection> MTmuonCollectionHandle;
98  iEvent.getByToken(m_MTmuonsToken, MTmuonCollectionHandle);
99 
100  // information from the tracks
101  edm::Handle<reco::TrackCollection> trackCollectionHandle;
102  iEvent.getByToken(m_trackToken, trackCollectionHandle);
103 
104  // information from the tracks iso
105  edm::Handle<reco::TrackCollection> trackIsoCollectionHandle;
106  iEvent.getByToken(m_trackIsoToken, trackIsoCollectionHandle);
107 
108  // creates the output collection
110  std::unique_ptr<susybsm::HSCParticleCollection> result(hscp);
111 
113  std::unique_ptr<susybsm::HSCPCaloInfoCollection> caloInfoCollaptr(caloInfoColl);
114 
115  // Fill the output collection with HSCP Candidate (the candiate only contains ref to muon AND/OR track object)
116  *hscp = getHSCPSeedCollection(trackCollectionHandle, muonCollectionHandle, MTmuonCollectionHandle);
117 
118  // find the track ref for isolation purposed (main track is supposed to be the Iso track after refitting)
119  for (susybsm::HSCParticleCollection::iterator hscpcandidate = hscp->begin(); hscpcandidate != hscp->end();
120  ++hscpcandidate) {
121  // Matching is needed because input track collection and muon inner track may lightly differs due to track refit
122  reco::TrackRef track = hscpcandidate->trackRef();
123  if (track.isNull())
124  continue;
125  float dRMin = 1000;
126  int found = -1;
127  for (unsigned int t = 0; t < trackIsoCollectionHandle->size(); t++) {
128  reco::TrackRef Isotrack = reco::TrackRef(trackIsoCollectionHandle, t);
129  if (fabs((1.0 / track->pt()) - (1.0 / Isotrack->pt())) > maxInvPtDiff)
130  continue;
131  float dR = deltaR(track->momentum(), Isotrack->momentum());
132  if (dR <= minDR && dR < dRMin) {
133  dRMin = dR;
134  found = t;
135  }
136  }
137  if (found >= 0)
138  hscpcandidate->setTrackIso(reco::TrackRef(trackIsoCollectionHandle, found));
139  }
140 
141  // compute the TRACKER contribution
142  if (useBetaFromTk) {
143  for (susybsm::HSCParticleCollection::iterator hscpcandidate = hscp->begin(); hscpcandidate != hscp->end();
144  ++hscpcandidate) {
145  beta_calculator_TK->addInfoToCandidate(*hscpcandidate, iEvent, iSetup);
146  }
147  }
148 
149  // compute the MUON contribution
150  if (useBetaFromMuon) {
151  for (susybsm::HSCParticleCollection::iterator hscpcandidate = hscp->begin(); hscpcandidate != hscp->end();
152  ++hscpcandidate) {
153  beta_calculator_MUON->addInfoToCandidate(*hscpcandidate, iEvent, iSetup);
154  }
155  }
156 
157  // compute the RPC contribution
158  if (useBetaFromRpc) {
159  for (susybsm::HSCParticleCollection::iterator hscpcandidate = hscp->begin(); hscpcandidate != hscp->end();
160  ++hscpcandidate) {
161  beta_calculator_RPC->addInfoToCandidate(*hscpcandidate, iEvent, iSetup);
162  }
163  }
164 
165  // compute the ECAL contribution
166  if (useBetaFromEcal) {
167  int Index = 0;
168  caloInfoColl->resize(hscp->size());
169  for (susybsm::HSCParticleCollection::iterator hscpcandidate = hscp->begin(); hscpcandidate != hscp->end();
170  ++hscpcandidate, Index++) {
172  *hscpcandidate, trackCollectionHandle, iEvent, iSetup, (*caloInfoColl)[Index]);
173  }
174  }
175 
176  // cleanup the collection based on the input selection
177  for (int i = 0; i < (int)hscp->size(); i++) {
178  susybsm::HSCParticleCollection::iterator hscpcandidate = hscp->begin() + i;
179  bool decision = false;
180  for (unsigned int s = 0; s < Selectors.size(); s++) {
181  decision |= Selectors[s]->isSelected(*hscpcandidate);
182  }
183  if (!decision) {
184  hscp->erase(hscpcandidate);
185  if (useBetaFromEcal)
186  caloInfoColl->erase(caloInfoColl->begin() + i);
187  i--;
188  }
189  }
190  bool filterResult = !Filter_ || (Filter_ && !hscp->empty());
191 
192  // output result
193  if (useBetaFromEcal) {
194  edm::OrphanHandle<susybsm::HSCPCaloInfoCollection> caloInfoHandle = iEvent.put(std::move(caloInfoCollaptr));
195  // adding the reftoCaloInfoObject to the HSCP Object
196  for (int i = 0; i < (int)hscp->size(); i++) {
197  susybsm::HSCParticleCollection::iterator hscpcandidate = hscp->begin() + i;
198  hscpcandidate->setCaloInfo(HSCPCaloInfoRef(caloInfoHandle, i));
199  }
200  }
201 
202  // output result
203 
205  // if(useBetaFromEcal){
206  // edm::RefProd<susybsm::HSCParticleCollection> hscpCollectionHandle = iEvent.getRefBeforePut<susybsm::HSCParticleCollection>();
207  // filler.insert(putHandle, CaloInfoColl.begin(), CaloInfoColl.end());
208  // filler.fill();
209  // iEvent.put(std::move(CaloInfoMap));
210  // }
211 
212  return filterResult;
213 }

References PbPb_ZMuSkimMuonDPG_cff::deltaR, HGC3DClusterGenMatchSelector_cfi::dR, HLT_2018_cff::dRMin, newFWLiteAna::found, mps_fire::i, iEvent, createfilelist::int, PDWG_EXOHSCP_cff::maxInvPtDiff, PDWG_EXOHSCP_cff::minDR, eostools::move(), mps_fire::result, alignCSCRings::s, OrderedSet::t, HLT_2018_cff::track, HSCParticleProducer_cff::useBetaFromEcal, HSCParticleProducer_cff::useBetaFromMuon, HSCParticleProducer_cff::useBetaFromRpc, and HSCParticleProducer_cff::useBetaFromTk.

◆ getHSCPSeedCollection()

std::vector< HSCParticle > HSCParticleProducer::getHSCPSeedCollection ( edm::Handle< reco::TrackCollection > &  trackCollectionHandle,
edm::Handle< reco::MuonCollection > &  muonCollectionHandle,
edm::Handle< reco::MuonCollection > &  MTmuonCollectionHandle 
)
private

Definition at line 221 of file HSCParticleProducer.cc.

224  {
225  std::vector<HSCParticle> HSCPCollection;
226 
227  // Store a local vector of track ref (that can be modified if matching)
228  std::vector<reco::TrackRef> tracks;
229  for (unsigned int i = 0; i < trackCollectionHandle->size(); i++) {
230  TrackRef track = reco::TrackRef(trackCollectionHandle, i);
231 
232  //If track is from muon always keep it
233  bool isMuon = false;
234  for (unsigned int m = 0; m < muonCollectionHandle->size(); m++) {
235  reco::MuonRef muon = reco::MuonRef(muonCollectionHandle, m);
236  TrackRef innertrack = muon->innerTrack();
237  if (innertrack.isNull())
238  continue;
239  if (fabs((1.0 / innertrack->pt()) - (1.0 / track->pt())) > maxInvPtDiff)
240  continue;
241  float dR = deltaR(innertrack->momentum(), track->momentum());
242  if (dR <= minDR)
243  isMuon = true;
244  }
245 
246  if ((track->p() < minTkP || (track->chi2() / track->ndof()) > maxTkChi2 || track->found() < minTkHits) && !isMuon)
247  continue;
248  tracks.push_back(track);
249  }
250 
251  // Loop on muons with inner track ref and create Muon HSCP Candidate
252  for (unsigned int m = 0; m < muonCollectionHandle->size(); m++) {
253  reco::MuonRef muon = reco::MuonRef(muonCollectionHandle, m);
254  double SApt = -1;
255  if (muon->isStandAloneMuon())
256  SApt = muon->standAloneMuon()->pt();
257  if (muon->p() < minMuP && SApt < minSAMuPt)
258  continue;
259  TrackRef innertrack = muon->innerTrack();
260  if (innertrack.isNull())
261  continue;
262 
263  // Check if the inner track match any track in order to create a Muon+Track HSCP Candidate
264  // Matching is needed because input track collection and muon inner track may lightly differs due to track refit
265  float dRMin = 1000;
266  int found = -1;
267  for (unsigned int t = 0; t < tracks.size(); t++) {
269  if (fabs((1.0 / innertrack->pt()) - (1.0 / track->pt())) > maxInvPtDiff)
270  continue;
271  float dR = deltaR(innertrack->momentum(), track->momentum());
272  if (dR <= minDR && dR < dRMin) {
273  dRMin = dR;
274  found = t;
275  }
276  }
277 
278  HSCParticle candidate;
279  candidate.setMuon(muon);
280  if (found >= 0) {
281  // printf("MUON with Inner Track Matching --> DR = %6.2f (%6.2f %+6.2f %+6.2f):(%6.2f %+6.2f %+6.2f) vs (%6.2f %+6.2f %+6.2f)\n",dRMin,muon->pt(), muon->eta(), muon->phi(), innertrack->pt(), innertrack->eta(), innertrack->phi(), tracks[found]->pt(), tracks[found]->eta(), tracks[found]->phi() );
282  candidate.setTrack(tracks[found]);
283  tracks.erase(tracks.begin() + found);
284  }
285  HSCPCollection.push_back(candidate);
286  }
287 
288  // Loop on muons without inner tracks and create Muon HSCP Candidate
289  for (unsigned int m = 0; m < muonCollectionHandle->size(); m++) {
290  reco::MuonRef muon = reco::MuonRef(muonCollectionHandle, m);
291  double SApt = -1;
292  if (muon->isStandAloneMuon())
293  SApt = muon->standAloneMuon()->pt();
294  if (muon->p() < minMuP && SApt < minSAMuPt)
295  continue;
296  TrackRef innertrack = muon->innerTrack();
297  if (innertrack.isNonnull())
298  continue;
299 
300  // Check if the muon match any track in order to create a Muon+Track HSCP Candidate
301  float dRMin = 1000;
302  int found = -1;
303  for (unsigned int t = 0; t < tracks.size(); t++) {
305  if (fabs((1.0 / muon->pt()) - (1.0 / track->pt())) > maxInvPtDiff)
306  continue;
307  float dR = deltaR(muon->momentum(), track->momentum());
308  if (dR <= minDR && dR < dRMin) {
309  dRMin = dR;
310  found = t;
311  }
312  }
313 
314  HSCParticle candidate;
315  candidate.setMuon(muon);
316  if (found >= 0) {
317  // printf("MUON without Inner Track Matching --> DR = %6.2f (%6.2f %+6.2f %+6.2f) vs (%6.2f %+6.2f %+6.2f)\n",dRMin,muon->pt(), muon->eta(), muon->phi(), tracks[found]->pt(), tracks[found]->eta(), tracks[found]->phi() );
318  candidate.setTrack(tracks[found]);
319  tracks.erase(tracks.begin() + found);
320  }
321  HSCPCollection.push_back(candidate);
322  }
323 
324  //Loop on MT muons and add to collection
325  for (unsigned int m = 0; m < MTmuonCollectionHandle->size(); m++) {
326  reco::MuonRef MTmuon = reco::MuonRef(MTmuonCollectionHandle, m);
327  if (MTmuon->pt() < minMTMuPt)
328  continue;
329 
330  //Check if matches muon HSCP candidate and add reference
331  float dRMin = 1000;
332  int found = -1;
333  for (unsigned int i = 0; i < HSCPCollection.size(); i++) {
334  if (!HSCPCollection[i].hasMuonRef())
335  continue;
336  reco::MuonRef muon = HSCPCollection[i].muonRef();
337  float dR = deltaR(muon->momentum(), MTmuon->momentum());
338  if (dR <= minMTDR && dR < dRMin) {
339  dRMin = dR;
340  found = i;
341  }
342  }
343  if (found > -1)
344  HSCPCollection[found].setMTMuon(MTmuon);
345  else {
346  HSCParticle candidate;
347  candidate.setMTMuon(MTmuon);
348  HSCPCollection.push_back(candidate);
349  }
350  }
351 
352  // Loop on tracks not matching muon and create Track HSCP Candidate
353  for (unsigned int i = 0; i < tracks.size(); i++) {
354  HSCParticle candidate;
355  candidate.setTrack(tracks[i]);
356  HSCPCollection.push_back(candidate);
357  }
358 
359  return HSCPCollection;
360 }

References PbPb_ZMuSkimMuonDPG_cff::deltaR, HGC3DClusterGenMatchSelector_cfi::dR, HLT_2018_cff::dRMin, newFWLiteAna::found, mps_fire::i, reco::isMuon(), edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::isNull(), visualization-live-secondInstance_cfg::m, PDWG_EXOHSCP_cff::maxInvPtDiff, HSCParticleProducer_cff::maxTkChi2, PDWG_EXOHSCP_cff::minDR, HSCParticleProducer_cff::minMTDR, HSCParticleProducer_cff::minMTMuPt, HSCParticleProducer_cff::minMuP, HSCParticleProducer_cff::minSAMuPt, HSCParticleProducer_cff::minTkHits, HSCParticleProducer_cff::minTkP, susybsm::HSCParticle::setMTMuon(), susybsm::HSCParticle::setMuon(), susybsm::HSCParticle::setTrack(), OrderedSet::t, HLT_2018_cff::track, and PDWG_EXOHSCP_cff::tracks.

Member Data Documentation

◆ beta_calculator_ECAL

BetaCalculatorECAL* HSCParticleProducer::beta_calculator_ECAL
private

Definition at line 92 of file HSCParticleProducer.h.

◆ beta_calculator_MUON

BetaCalculatorMUON* HSCParticleProducer::beta_calculator_MUON
private

Definition at line 90 of file HSCParticleProducer.h.

◆ beta_calculator_RPC

BetaCalculatorRPC* HSCParticleProducer::beta_calculator_RPC
private

Definition at line 91 of file HSCParticleProducer.h.

◆ beta_calculator_TK

BetaCalculatorTK* HSCParticleProducer::beta_calculator_TK
private

Definition at line 89 of file HSCParticleProducer.h.

◆ Filter_

bool HSCParticleProducer::Filter_
private

Definition at line 67 of file HSCParticleProducer.h.

◆ m_MTmuonsToken

edm::EDGetTokenT<reco::MuonCollection> HSCParticleProducer::m_MTmuonsToken
private

Definition at line 72 of file HSCParticleProducer.h.

◆ m_muonsToken

edm::EDGetTokenT<reco::MuonCollection> HSCParticleProducer::m_muonsToken
private

Definition at line 71 of file HSCParticleProducer.h.

◆ m_trackIsoToken

edm::EDGetTokenT<reco::TrackCollection> HSCParticleProducer::m_trackIsoToken
private

Definition at line 70 of file HSCParticleProducer.h.

◆ m_trackToken

edm::EDGetTokenT<reco::TrackCollection> HSCParticleProducer::m_trackToken
private

Definition at line 69 of file HSCParticleProducer.h.

◆ maxInvPtDiff

float HSCParticleProducer::maxInvPtDiff
private

Definition at line 87 of file HSCParticleProducer.h.

◆ maxTkChi2

float HSCParticleProducer::maxTkChi2
private

Definition at line 80 of file HSCParticleProducer.h.

◆ minDR

float HSCParticleProducer::minDR
private

Definition at line 85 of file HSCParticleProducer.h.

◆ minMTDR

float HSCParticleProducer::minMTDR
private

Definition at line 86 of file HSCParticleProducer.h.

◆ minMTMuPt

float HSCParticleProducer::minMTMuPt
private

Definition at line 84 of file HSCParticleProducer.h.

◆ minMuP

float HSCParticleProducer::minMuP
private

Definition at line 82 of file HSCParticleProducer.h.

◆ minSAMuPt

float HSCParticleProducer::minSAMuPt
private

Definition at line 83 of file HSCParticleProducer.h.

◆ minTkHits

unsigned int HSCParticleProducer::minTkHits
private

Definition at line 81 of file HSCParticleProducer.h.

◆ minTkP

float HSCParticleProducer::minTkP
private

Definition at line 79 of file HSCParticleProducer.h.

◆ Selectors

std::vector<CandidateSelector*> HSCParticleProducer::Selectors
private

Definition at line 94 of file HSCParticleProducer.h.

◆ useBetaFromEcal

bool HSCParticleProducer::useBetaFromEcal
private

Definition at line 77 of file HSCParticleProducer.h.

◆ useBetaFromMuon

bool HSCParticleProducer::useBetaFromMuon
private

Definition at line 75 of file HSCParticleProducer.h.

◆ useBetaFromRpc

bool HSCParticleProducer::useBetaFromRpc
private

Definition at line 76 of file HSCParticleProducer.h.

◆ useBetaFromTk

bool HSCParticleProducer::useBetaFromTk
private

Definition at line 74 of file HSCParticleProducer.h.

susybsm::HSCParticle::setTrack
void setTrack(const reco::TrackRef &data)
Definition: HSCParticle.h:58
susybsm::HSCParticle
Definition: HSCParticle.h:42
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
HSCParticleProducer::minTkHits
unsigned int minTkHits
Definition: HSCParticleProducer.h:81
mps_fire.i
i
Definition: mps_fire.py:355
muon
Definition: MuonCocktails.h:17
BetaCalculatorTK::addInfoToCandidate
void addInfoToCandidate(susybsm::HSCParticle &candidate, edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: BetaCalculatorTK.cc:24
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
edm
HLT enums.
Definition: AlignableModifier.h:19
susybsm::HSCParticle::setMuon
void setMuon(const reco::MuonRef &data)
Definition: HSCParticle.h:56
BetaCalculatorRPC::addInfoToCandidate
void addInfoToCandidate(susybsm::HSCParticle &candidate, const edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: BetaCalculatorRPC.cc:112
HSCParticleProducer::m_MTmuonsToken
edm::EDGetTokenT< reco::MuonCollection > m_MTmuonsToken
Definition: HSCParticleProducer.h:72
susybsm
Definition: HSCParticle.h:16
HSCParticleProducer::minMuP
float minMuP
Definition: HSCParticleProducer.h:82
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:71
HSCParticleProducer::minTkP
float minTkP
Definition: HSCParticleProducer.h:79
susybsm::HSCParticleCollection
std::vector< HSCParticle > HSCParticleCollection
Definition: HSCParticle.h:86
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::Handle< reco::MuonCollection >
HSCParticleProducer::Selectors
std::vector< CandidateSelector * > Selectors
Definition: HSCParticleProducer.h:94
edm::Ref< TrackCollection >
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HSCParticleProducer::m_trackToken
edm::EDGetTokenT< reco::TrackCollection > m_trackToken
Definition: HSCParticleProducer.h:69
BetaCalculatorECAL::addInfoToCandidate
void addInfoToCandidate(susybsm::HSCParticle &candidate, edm::Handle< reco::TrackCollection > &tracks, edm::Event &iEvent, const edm::EventSetup &iSetup, susybsm::HSCPCaloInfo &caloInfo)
Definition: BetaCalculatorECAL.cc:29
HSCParticleProducer::beta_calculator_RPC
BetaCalculatorRPC * beta_calculator_RPC
Definition: HSCParticleProducer.h:91
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
reco::MuonRef
edm::Ref< MuonCollection > MuonRef
presistent reference to a Muon
Definition: MuonFwd.h:13
HSCParticleProducer::beta_calculator_TK
BetaCalculatorTK * beta_calculator_TK
Definition: HSCParticleProducer.h:89
HLT_2018_cff.dRMin
dRMin
Definition: HLT_2018_cff.py:7352
susybsm::HSCPCaloInfoRef
edm::Ref< HSCPCaloInfoCollection > HSCPCaloInfoRef
Definition: HSCPCaloInfo.h:57
OrderedSet.t
t
Definition: OrderedSet.py:90
HSCParticleProducer::maxInvPtDiff
float maxInvPtDiff
Definition: HSCParticleProducer.h:87
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
HSCParticleProducer::maxTkChi2
float maxTkChi2
Definition: HSCParticleProducer.h:80
HSCParticleProducer_cff.SelectionParameters
SelectionParameters
Definition: HSCParticleProducer_cff.py:89
reco::TrackRef
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
HSCParticleProducer::minMTDR
float minMTDR
Definition: HSCParticleProducer.h:86
HSCParticleProducer::minSAMuPt
float minSAMuPt
Definition: HSCParticleProducer.h:83
HSCParticleProducer::useBetaFromMuon
bool useBetaFromMuon
Definition: HSCParticleProducer.h:75
BetaCalculatorMUON
Definition: BetaCalculatorMUON.h:22
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
HSCParticleProducer::useBetaFromRpc
bool useBetaFromRpc
Definition: HSCParticleProducer.h:76
HSCParticleProducer::beta_calculator_ECAL
BetaCalculatorECAL * beta_calculator_ECAL
Definition: HSCParticleProducer.h:92
HSCParticleProducer::m_muonsToken
edm::EDGetTokenT< reco::MuonCollection > m_muonsToken
Definition: HSCParticleProducer.h:71
HSCParticleProducer::minDR
float minDR
Definition: HSCParticleProducer.h:85
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CandidateSelector
Definition: CandidateSelector.h:18
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
edm::OrphanHandle
Definition: EDProductfwd.h:39
susybsm::HSCParticle::setMTMuon
void setMTMuon(const reco::MuonRef &data)
Definition: HSCParticle.h:57
HSCParticleProducer::minMTMuPt
float minMTMuPt
Definition: HSCParticleProducer.h:84
HSCParticleProducer::useBetaFromTk
bool useBetaFromTk
Definition: HSCParticleProducer.h:74
HSCParticleProducer::Filter_
bool Filter_
Definition: HSCParticleProducer.h:67
BetaCalculatorTK
Definition: BetaCalculatorTK.h:21
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
HSCParticleProducer::useBetaFromEcal
bool useBetaFromEcal
Definition: HSCParticleProducer.h:77
mps_fire.result
result
Definition: mps_fire.py:303
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
BetaCalculatorRPC
Definition: BetaCalculatorRPC.h:29
HSCParticleProducer::getHSCPSeedCollection
std::vector< susybsm::HSCParticle > getHSCPSeedCollection(edm::Handle< reco::TrackCollection > &trackCollectionHandle, edm::Handle< reco::MuonCollection > &muonCollectionHandle, edm::Handle< reco::MuonCollection > &MTmuonCollectionHandle)
Definition: HSCParticleProducer.cc:221
BetaCalculatorMUON::addInfoToCandidate
void addInfoToCandidate(susybsm::HSCParticle &candidate, edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: BetaCalculatorMUON.cc:13
HSCParticleProducer::beta_calculator_MUON
BetaCalculatorMUON * beta_calculator_MUON
Definition: HSCParticleProducer.h:90
HSCParticleProducer::m_trackIsoToken
edm::EDGetTokenT< reco::TrackCollection > m_trackIsoToken
Definition: HSCParticleProducer.h:70
edm::InputTag
Definition: InputTag.h:15
BetaCalculatorECAL
Definition: BetaCalculatorECAL.h:33
susybsm::HSCPCaloInfoCollection
std::vector< HSCPCaloInfo > HSCPCaloInfoCollection
Definition: HSCPCaloInfo.h:55
reco::isMuon
bool isMuon(const Candidate &part)
Definition: pdgIdUtils.h:9