CMS 3D CMS Logo

TrackingSeedCandidates.cc
Go to the documentation of this file.
2 
4  // operation mode
5  //
6  std::string seedingModeString = regPSet.getParameter<std::string>("seedingMode");
7  if (seedingModeString == "Candidate") m_seedingMode = SeedingMode::CANDIDATE_SEEDED;
8  else if (seedingModeString == "Global") m_seedingMode = SeedingMode::GLOBAL;
9  else throw edm::Exception(edm::errors::Configuration) << "Unknown seeding mode string: "<<seedingModeString;
10 
11  m_deltaEta_Cand = regPSet.getParameter<double>("deltaEta_Cand");
12  m_deltaPhi_Cand = regPSet.getParameter<double>("deltaPhi_Cand");
13 
14  // basic inputs
17  if (m_deltaEta_Cand<0 || m_deltaPhi_Cand<0) throw edm::Exception(edm::errors::Configuration) << "Delta eta and phi parameters must be set for candidates in candidate seeding mode";
18  }
19 }
20 
22  desc.add<std::string>("seedingMode", "Global");
23  desc.add<edm::InputTag>("input",edm::InputTag());
24  desc.add<double>("deltaEta_Cand", -1.);
25  desc.add<double>("deltaPhi_Cand", -1.);
26 }
27 
29 
31  std::pair <float,float> dimensions = std::make_pair(m_deltaEta_Cand,m_deltaPhi_Cand);
33 
35  iEvent.getByToken( m_token_input, objects );
36  result = std::make_pair(objects.product(),dimensions);
37  }
38  else result = std::make_pair(nullptr,dimensions);
39  return result;
40 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
int iEvent
Definition: GenABIO.cc:230
TrackingSeedCandidates(const edm::ParameterSet &regPSet, edm::ConsumesCollector &&iC)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
T const * product() const
Definition: Handle.h:81
static void fillDescriptions(edm::ParameterSetDescription &desc)
edm::EDGetTokenT< reco::CandidateView > m_token_input
Objects objects(const edm::Event &iEvent) const
std::pair< const reco::CandidateView *, std::pair< float, float > > Objects