14 #include "TLorentzVector.h" 42 muonsToken{consumes<std::vector<reco::Muon>>(iConfig.getParameter<
edm::InputTag>(
"matchMuons"))},
43 PrimVtxToken{consumes<reco::VertexCollection>(iConfig.getParameter<
edm::InputTag>(
"PrimaryVertex"))},
45 matchInDr{iConfig.getParameter<
double>(
"requiredDr")},
47 debug{iConfig.getParameter<
bool>(
"debug")},
48 minPt{iConfig.getParameter<
double>(
"minPt")},
49 maxEta{iConfig.getParameter<
double>(
"maxEta")},
50 maxDxy{iConfig.getParameter<
double>(
"maxDxy")},
51 maxDz{iConfig.getParameter<
double>(
"maxDz")} {
52 produces<reco::TrackCollection>(
"").setBranchAlias(
"");
65 <<
"Input track collection is not valid.\n Returning empty output track collection.";
73 <<
"Input muon collection is not valid.\n Returning empty output track collection.";
81 <<
"Input vertex collection is not valid.\n Returning empty output track collection.";
88 std::vector<reco::Track> selTracks;
90 unsigned int tMuon = 0;
96 double chiNdof =
track.normalizedChi2();
107 if (
muon.isTrackerMuon()) {
123 edm::LogPrint(
"SingleLongTrackProducer") <<
"deltaR2 (general) track to matched Track: " << dR2min
124 <<
" chi2Ndof: " << chiNdof <<
" best Track chi2Ndof: " << fitProb;
130 selTracks.push_back(bestTrack);
135 <<
" number of Tracker Muons: " << tMuon <<
", thereof " << selTracks.size() <<
" tracks passed preselection.";
138 bool hitIsNotValid{
false};
140 for (
const auto &
track : selTracks) {
142 if (
track.recHitsOk()) {
144 auto hb =
track.recHitsBegin();
147 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
151 hitIsNotValid =
true;
156 if (hitIsNotValid ==
true)
160 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
164 edm::LogPrint(
"SingleLongTrackProducer") <<
"hit not valid: " <<
h;
174 auto const &moduleType = moduleDescription().moduleName();
175 auto const &
moduleLabel = moduleDescription().moduleLabel();
177 <<
" output track size: " <<
goodTracks.get()->size();
189 ->setComment(
"input primary vertex collection");
190 desc.add<
int>(
"minNumberOfLayers", 10)->setComment(
"minimum number of layers");
191 desc.add<
double>(
"requiredDr", 0.01)->setComment(
"matching muons deltaR. If negative do not match");
192 desc.add<
bool>(
"onlyValidHits",
true)->setComment(
"use only valid hits");
193 desc.add<
bool>(
"debug",
false)->setComment(
"verbose?");
194 desc.add<
double>(
"minPt", 15.0)->setComment(
"minimum pT");
195 desc.add<
double>(
"maxEta", 2.2)->setComment(
"maximum pseudorapidity (absolute value)");
196 desc.add<
double>(
"maxDxy", 0.02)->setComment(
"maximum transverse impact parameter");
197 desc.add<
double>(
"maxDz", 0.5)->setComment(
"maximum longitudinal impact parameter");
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
const edm::EDGetTokenT< std::vector< reco::Track > > tracksToken
int trackerLayersWithMeasurement() const
SingleLongTrackProducer(const edm::ParameterSet &)
const edm::EDGetTokenT< std::vector< reco::Muon > > muonsToken
std::vector< Track > TrackCollection
collection of Tracks
Log< level::Error, false > LogError
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
static bool validHitFilter(uint16_t pattern)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
Log< level::Warning, true > LogPrint
~SingleLongTrackProducer() override=default
uint16_t getHitPattern(HitCategory category, int position) const
const edm::EDGetTokenT< reco::VertexCollection > PrimVtxToken
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
void produce(edm::Event &, const edm::EventSetup &) override
const int minNumberOfLayers
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.