|
|
Go to the documentation of this file.
88 constexpr
static float xmin_ = -30;
89 constexpr
static float xmax_ = +30;
113 iConfig.getParameter<
edm::
InputTag>(
"L1TrackInputTag"))),
135 produces<TkPrimaryVertexCollection>();
151 auto result = std::make_unique<TkPrimaryVertexCollection>();
169 const double mm = 0.1;
170 float zvtx_gen = -999;
176 for (HepMC::GenEvent::vertex_const_iterator ivertex = MCEvt->vertices_begin(); ivertex != MCEvt->vertices_end();
178 bool hasParentVertex =
false;
181 for (HepMC::GenVertex::particle_iterator iparent = (*ivertex)->particles_begin(
HepMC::parents);
184 if ((*iparent)->production_vertex()) {
185 hasParentVertex =
true;
193 HepMC::FourVector
pos = (*ivertex)->position();
194 zvtx_gen =
pos.z() * mm;
198 }
else if (GenParticleHandle.
isValid()) {
199 for (
const auto& genpart : *GenParticleHandle) {
200 int status = genpart.status();
203 if (genpart.numberOfMothers() == 0)
205 float part_zvertex = genpart.vz();
206 zvtx_gen = part_zvertex;
211 <<
"\nerror: try to retrieve the MC vertex (monteCarloVertex_ = True) "
212 <<
"\nbut the input file contains neither edm::HepMCProduct> nor vector<reco::GenParticle>. Exit"
218 result->push_back(genvtx);
226 if (!L1TTTrackHandle.
isValid()) {
228 <<
"\nWarning: L1TkTrackCollection with not found in the event. Exit" << std::endl;
232 for (
const auto&
track : *L1TTTrackHandle) {
233 float z =
track.POCA().z();
235 float pt =
track.momentum().perp();
262 theStubs =
track.getStubRefs();
264 int tmp_trk_nstub = (
int)theStubs.size();
265 if (tmp_trk_nstub < 0) {
267 <<
" ... could not retrieve the vector of stubs in L1TkFastVertexProducer::SumPtVertex " << std::endl;
272 for (
const auto& stub : theStubs) {
275 DetId detId(stub->getDetId());
291 int trk_nstub = (
int)
track.getStubRefs().size();
292 float chi2dof =
chi2 / (2 * trk_nstub - 4);
295 float trk_consistency =
track.stubPtConsistency();
296 if (trk_nstub == 4) {
309 htmp_weight.Fill(
z, wt);
318 int nb = htmp.GetNbinsX();
319 std::vector<int>
found;
321 for (
int ivtx = 0; ivtx <
nVtx_; ivtx++) {
325 for (
int i = 2;
i <= nb - 1;
i++) {
326 float a0 = htmp_weight.GetBinContent(
i - 1);
327 float a1 = htmp_weight.GetBinContent(
i);
328 float a2 = htmp_weight.GetBinContent(
i + 1);
329 float sigma =
a0 + a1 +
a2;
333 float z0 = htmp_weight.GetBinCenter(
i - 1);
334 float z1 = htmp_weight.GetBinCenter(
i);
335 float z2 = htmp_weight.GetBinCenter(
i + 1);
336 zvtx_sliding = (
a0 *
z0 + a1 * z1 +
a2 *
z2) / sigma;
339 found.push_back(imax);
Class to store the L1 Track Trigger tracks.
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
L1TkFastVertexProducer(const edm::ParameterSet &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
unsigned int tidRing(const DetId &id) const
constexpr static float xmin_
#define DEFINE_FWK_MODULE(type)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Class to store the L1 Track Trigger stubs.
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
const edm::EDGetTokenT< std::vector< reco::GenParticle > > genparticleToken_
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
~L1TkFastVertexProducer() override
float trkChi2dofTightChi2_
const HepMC::GenEvent * GetEvent() const
constexpr static float xmax_
bool getData(T &iHolder) const
unsigned int tobLayer(const DetId &id) const
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const edm::EDGetTokenT< edm::HepMCProduct > hepmcToken_
static constexpr auto TOB
T getParameter(std::string const &) const
Power< A, B >::type pow(const A &a, const B &b)
Abs< T >::type abs(const T &t)
std::vector< L1TTTrackType > L1TTTrackCollectionType
void addDefault(ParameterSetDescription const &psetDescription)
static constexpr float a0
static constexpr auto TID
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)