41 ev.
getByLabel(trackCollectionName, trackCollection);
47 std::vector<const reco::Track*>
tracks;
48 for (
unsigned int i = 0;
i < tracks_.size();
i++) {
51 tracks.push_back(&(*recTrack));
55 LogTrace(
"MinBiasTracking") <<
" [VertexProducer] selected tracks: " << tracks.size() <<
" (out of " << tracks_.size()
58 auto vertices = std::make_unique<reco::VertexCollection>();
60 if (!tracks.empty()) {
66 if (tracks.size() % 2 == 0)
67 med = (tracks[tracks.size() / 2 - 1]->vz() + tracks[tracks.size() / 2]->vz()) / 2;
69 med = tracks[tracks.size() / 2]->vz();
71 LogTrace(
"MinBiasTracking") <<
" [vertex position] median = " << med <<
" cm";
73 if (tracks.size() > 10) {
76 float halfWidth = 0.1;
79 TH1F
histo(
"histo",
"histo", nBin, -halfWidth, halfWidth);
81 for (std::vector<const reco::Track*>::const_iterator
track = tracks.begin();
track != tracks.end();
track++)
82 if (fabs((*track)->vz() - med) < halfWidth)
83 histo.Fill((*track)->vz() - med);
85 LogTrace(
"MinBiasTracking") <<
" [vertex position] most prob = " 86 << med +
histo.GetBinCenter(
histo.GetMaximumBin()) <<
" cm";
91 TF1
f1(
"f1",
"[0]*exp(-0.5 * ((x-[1])/[2])^2) + [3]");
92 f1.SetParameters(10., 0., 0.01, 1.);
96 LogTrace(
"MinBiasTracking") <<
" [vertex position] fitted = " << med +
f1.GetParameter(1) <<
" +- " 97 <<
f1.GetParError(1) <<
" cm";
101 err(2, 2) =
f1.GetParError(1) *
f1.GetParError(1);
107 err(2, 2) = 0.1 * 0.1;
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< Track > TrackCollection
collection of Tracks
math::Error< dimension >::type Error
covariance error matrix (3x3)
math::XYZPoint Point
point in the space
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T const * product() const