65 iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"SelectionParameters");
66 for (
unsigned int i = 0;
i < SelectionParameters.size();
i++) {
71 produces<susybsm::HSCParticleCollection>();
73 produces<susybsm::HSCPCaloInfoCollection>();
94 iEvent.
getByToken(m_muonsToken, muonCollectionHandle);
98 iEvent.
getByToken(m_MTmuonsToken, MTmuonCollectionHandle);
102 iEvent.
getByToken(m_trackToken, trackCollectionHandle);
106 iEvent.
getByToken(m_trackIsoToken, trackIsoCollectionHandle);
110 std::unique_ptr<susybsm::HSCParticleCollection>
result(hscp);
113 std::unique_ptr<susybsm::HSCPCaloInfoCollection> caloInfoCollaptr(caloInfoColl);
116 *hscp = getHSCPSeedCollection(trackCollectionHandle, muonCollectionHandle, MTmuonCollectionHandle);
119 for (susybsm::HSCParticleCollection::iterator hscpcandidate = hscp->begin(); hscpcandidate != hscp->end();
127 for (
unsigned int t = 0;
t < trackIsoCollectionHandle->size();
t++) {
129 if (fabs((1.0 / track->pt()) - (1.0 / Isotrack->pt())) >
maxInvPtDiff)
131 float dR =
deltaR(track->momentum(), Isotrack->momentum());
132 if (dR <=
minDR && dR < dRMin) {
138 hscpcandidate->setTrackIso(
reco::TrackRef(trackIsoCollectionHandle, found));
143 for (susybsm::HSCParticleCollection::iterator hscpcandidate = hscp->begin(); hscpcandidate != hscp->end();
145 beta_calculator_TK->addInfoToCandidate(*hscpcandidate, iEvent, iSetup);
151 for (susybsm::HSCParticleCollection::iterator hscpcandidate = hscp->begin(); hscpcandidate != hscp->end();
153 beta_calculator_MUON->addInfoToCandidate(*hscpcandidate, iEvent, iSetup);
159 for (susybsm::HSCParticleCollection::iterator hscpcandidate = hscp->begin(); hscpcandidate != hscp->end();
161 beta_calculator_RPC->addInfoToCandidate(*hscpcandidate, iEvent, iSetup);
168 caloInfoColl->resize(hscp->size());
169 for (susybsm::HSCParticleCollection::iterator hscpcandidate = hscp->begin(); hscpcandidate != hscp->end();
170 ++hscpcandidate, Index++) {
171 beta_calculator_ECAL->addInfoToCandidate(
172 *hscpcandidate, trackCollectionHandle, iEvent, iSetup, (*caloInfoColl)[Index]);
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);
184 hscp->erase(hscpcandidate);
186 caloInfoColl->erase(caloInfoColl->begin() +
i);
190 bool filterResult = !Filter_ || (Filter_ && !hscp->empty());
196 for (
int i = 0;
i < (
int)hscp->size();
i++) {
197 susybsm::HSCParticleCollection::iterator hscpcandidate = hscp->begin() +
i;
225 std::vector<HSCParticle> HSCPCollection;
228 std::vector<reco::TrackRef>
tracks;
229 for (
unsigned int i = 0;
i < trackCollectionHandle->size();
i++) {
234 for (
unsigned int m = 0;
m < muonCollectionHandle->size();
m++) {
236 TrackRef innertrack = muon->innerTrack();
239 if (fabs((1.0 / innertrack->pt()) - (1.0 / track->pt())) >
maxInvPtDiff)
241 float dR =
deltaR(innertrack->momentum(), track->momentum());
248 tracks.push_back(track);
252 for (
unsigned int m = 0;
m < muonCollectionHandle->size();
m++) {
255 if (muon->isStandAloneMuon())
256 SApt = muon->standAloneMuon()->pt();
259 TrackRef innertrack = muon->innerTrack();
267 for (
unsigned int t = 0;
t < tracks.size();
t++) {
269 if (fabs((1.0 / innertrack->pt()) - (1.0 / track->pt())) >
maxInvPtDiff)
271 float dR =
deltaR(innertrack->momentum(), track->momentum());
272 if (dR <=
minDR && dR < dRMin) {
283 tracks.erase(tracks.begin() +
found);
285 HSCPCollection.push_back(candidate);
289 for (
unsigned int m = 0;
m < muonCollectionHandle->size();
m++) {
292 if (muon->isStandAloneMuon())
293 SApt = muon->standAloneMuon()->pt();
296 TrackRef innertrack = muon->innerTrack();
303 for (
unsigned int t = 0;
t < tracks.size();
t++) {
305 if (fabs((1.0 / muon->pt()) - (1.0 / track->pt())) >
maxInvPtDiff)
307 float dR =
deltaR(muon->momentum(), track->momentum());
308 if (dR <=
minDR && dR < dRMin) {
319 tracks.erase(tracks.begin() +
found);
321 HSCPCollection.push_back(candidate);
325 for (
unsigned int m = 0;
m < MTmuonCollectionHandle->size();
m++) {
333 for (
unsigned int i = 0;
i < HSCPCollection.size();
i++) {
334 if (!HSCPCollection[
i].hasMuonRef())
337 float dR =
deltaR(muon->momentum(), MTmuon->momentum());
338 if (dR <=
minMTDR && dR < dRMin) {
344 HSCPCollection[
found].setMTMuon(MTmuon);
348 HSCPCollection.push_back(candidate);
353 for (
unsigned int i = 0;
i < tracks.size();
i++) {
356 HSCPCollection.push_back(candidate);
359 return HSCPCollection;
void setMuon(const reco::MuonRef &data)
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool isNonnull() const
Checks for non-null.
bool isMuon(const Candidate &part)
std::vector< HSCPCaloInfo > HSCPCaloInfoCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setMTMuon(const reco::MuonRef &data)
edm::Ref< HSCPCaloInfoCollection > HSCPCaloInfoRef
std::vector< HSCParticle > HSCParticleCollection
#define DEFINE_FWK_MODULE(type)
edm::Ref< MuonCollection > MuonRef
presistent reference to a Muon
bool filter(edm::Event &, const edm::EventSetup &) override
bool isNull() const
Checks for null.
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
~HSCParticleProducer() override
std::vector< susybsm::HSCParticle > getHSCPSeedCollection(edm::Handle< reco::TrackCollection > &trackCollectionHandle, edm::Handle< reco::MuonCollection > &muonCollectionHandle, edm::Handle< reco::MuonCollection > &MTmuonCollectionHandle)
HSCParticleProducer(const edm::ParameterSet &)
void setTrack(const reco::TrackRef &data)