17 numOfLayersToTry_(iConfig.getParameter<int32_t>(
"layersToTry")),
18 numOfHitsToTry_(iConfig.getParameter<int32_t>(
"hitsToTry")),
19 fixedErrorRescalingForHits_(iConfig.getParameter<double>(
"fixedErrorRescaleFactorForHits")),
20 fixedErrorRescalingForHitless_(iConfig.getParameter<double>(
"fixedErrorRescaleFactorForHitless")),
21 adjustErrorsDynamicallyForHits_(iConfig.getParameter<bool>(
"adjustErrorsDynamicallyForHits")),
22 adjustErrorsDynamicallyForHitless_(iConfig.getParameter<bool>(
"adjustErrorsDynamicallyForHitless")),
23 estimatorName_(iConfig.getParameter<
std::
string>(
"estimator")),
24 minEtaForTEC_(iConfig.getParameter<double>(
"minEtaForTEC")),
25 maxEtaForTOB_(iConfig.getParameter<double>(
"maxEtaForTOB")),
26 useHitLessSeeds_(iConfig.getParameter<bool>(
"UseHitLessSeeds")),
27 useStereoLayersInTEC_(iConfig.getParameter<bool>(
"UseStereoLayersInTEC")),
31 pT1_(iConfig.getParameter<double>(
"pT1")),
32 pT2_(iConfig.getParameter<double>(
"pT2")),
33 pT3_(iConfig.getParameter<double>(
"pT3")),
34 eta1_(iConfig.getParameter<double>(
"eta1")),
35 eta2_(iConfig.getParameter<double>(
"eta2")),
36 SF1_(iConfig.getParameter<double>(
"SF1")),
37 SF2_(iConfig.getParameter<double>(
"SF2")),
38 SF3_(iConfig.getParameter<double>(
"SF3")),
39 SF4_(iConfig.getParameter<double>(
"SF4")),
40 SF5_(iConfig.getParameter<double>(
"SF5")),
41 tsosDiff_(iConfig.getParameter<double>(
"tsosDiff"))
44 produces<std::vector<TrajectorySeed> >();
65 std::unique_ptr<std::vector<TrajectorySeed> >
result(
new std::vector<TrajectorySeed>());
68 std::vector<BarrelDetLayer const*>
const& tob =
measurementTracker_->geometricSearchTracker()->tobLayers();
69 std::vector<ForwardDetLayer const*>
const& tecPositive =
measurementTracker_->geometricSearchTracker()->posTecLayers();
70 std::vector<ForwardDetLayer const*>
const& tecNegative =
measurementTracker_->geometricSearchTracker()->negTecLayers();
86 for (
unsigned int l2TrackColIndex(0);l2TrackColIndex!=l2TrackCol->size();++l2TrackColIndex){
88 std::unique_ptr<std::vector<TrajectorySeed> >
out(
new std::vector<TrajectorySeed>());
89 LogTrace(
"TSGForOI") <<
"TSGForOI::produce: L2 muon pT, eta, phi --> " << l2->pt() <<
" , " << l2->eta() <<
" , " << l2->phi() << endl;
94 LogTrace(
"TSGForOI") <<
"TSGForOI::produce: Created TSOSatIP: " << tsosAtIP << std::endl;
98 LogTrace(
"TSGForOI") <<
"TSGForOI::produce: Created TSOSatMuonSystem: " << tsosAtMuonSystem <<endl;
101 LogTrace(
"TSGForOI") <<
"TSGForOI::produce: Check the error of the L2 parameter and use hit seeds if big errors" << endl;
111 if (outerTkStateInside.isValid() && outerTkStateOutside.
isValid()){
112 float deta = outerTkStateInside.globalPosition().eta() - outerTkStateOutside.
globalPosition().
eta();
113 float dphi = outerTkStateInside.globalPosition().phi() - outerTkStateOutside.
globalPosition().
phi();
114 dist =
sqrt(deta*deta+dphi*dphi);
128 for (
auto it=tob.rbegin(); it!=tob.rend(); ++it) {
130 findSeedsOnLayer(tTopo, **it, tsosAtIP, *(propagatorAlong.get()), *(propagatorOpposite.get()), l2, out);
142 for (
auto it=tecPositive.rbegin(); it!=tecPositive.rend(); ++it) {
143 LogTrace(
"TSGForOI") <<
"TSGForOI::produce: looping in TEC+ layer " <<
layerCount_ << endl;
144 findSeedsOnLayer(tTopo, **it, tsosAtIP, *(propagatorAlong.get()), *(propagatorOpposite.get()), l2, out);
151 for (
auto it=tecNegative.rbegin(); it!=tecNegative.rend(); ++it) {
152 LogTrace(
"TSGForOI") <<
"TSGForOI::produce: looping in TEC- layer " <<
layerCount_ << endl;
153 findSeedsOnLayer(tTopo, **it, tsosAtIP, *(propagatorAlong.get()), *(propagatorOpposite.get()), l2, out);
157 for (std::vector<TrajectorySeed>::iterator it=out->begin(); it!=out->end(); ++it){
158 result->push_back(*it);
173 std::unique_ptr<std::vector<TrajectorySeed> >&
out) {
178 double errorSFHits_=1.0;
179 double errorSFHitless_=1.0;
185 LogTrace(
"TSGForOI") <<
"TSGForOI::findSeedsOnLayer: Start hitless" << endl;
186 std::vector< GeometricSearchDet::DetWithState > dets;
189 auto const& detOnLayer = dets.front().first;
190 auto const& tsosOnLayer = dets.front().second;
191 LogTrace(
"TSGForOI") <<
"TSGForOI::findSeedsOnLayer: tsosOnLayer " << tsosOnLayer << endl;
192 if (!tsosOnLayer.isValid()){
202 dets.front().second.rescaleError(errorSFHitless_);
206 LogTrace(
"TSGForOI") <<
"TSGForOI::findSeedsOnLayer: TSOD (Hitless) done " << endl;
216 LogTrace(
"TSGForOI") <<
"TSGForOI::findSeedsOnLayer: Start Hits" <<endl;
227 double abseta =
std::abs(track->eta());
229 if (track->pt()>
pT1_ && track->pt()<=
pT2_){
234 if (track->pt()>
pT2_ && track->pt()<=
pT3_){
241 LogTrace(
theCategory) <<
"TSGForOI::calculateSFFromL2: SF has been calculated as: " << theSF;
250 std::vector<TrajectorySeed> &
out,
253 const double errorSF) {
259 std::vector< GeometricSearchDet::DetWithState > dets;
263 LogTrace(
"TSGForOI") <<
"TSGForOI::findSeedsOnLayer: find measurements on each detWithState " << dets.size() << endl;
264 std::vector<TrajectoryMeasurement> meas;
265 for (std::vector<GeometricSearchDet::DetWithState>::iterator it=dets.begin(); it!=dets.end(); ++it) {
270 if (!it->second.isValid())
continue;
273 for (std::vector<TrajectoryMeasurement>::const_iterator it2 = mymeas.begin(), ed2 = mymeas.end(); it2 != ed2; ++it2) {
274 if (it2->recHit()->isValid()) meas.push_back(*it2);
280 LogTrace(
"TSGForOI") <<
"TSGForOI::findSeedsOnLayer: Update TSOS using TMs after sorting, then create Trajectory Seed, number of TM = " << meas.size() << endl;
281 unsigned int found = 0;
283 for (std::vector<TrajectoryMeasurement>::const_iterator it=meas.begin(); it!=meas.end(); ++it) {
285 LogTrace(
"TSGForOI") <<
"TSGForOI::findSeedsOnLayer: TSOS for TM " << found << endl;
286 if (not updatedTSOS.
isValid())
continue;
290 DetId detid = ((*it).recHit()->hit())->geographicalId();
297 seedHits.
push_back(*it->recHit()->hit());
300 LogTrace(
"TSGForOI") <<
"TSGForOI::findSeedsOnLayer: number of seedHits: " << seedHits.
size() << endl;
312 desc.
add<
int>(
"layersToTry",1);
313 desc.
add<
double>(
"fixedErrorRescaleFactorForHitless",2.0);
314 desc.
add<
int>(
"hitsToTry",1);
315 desc.
add<
bool>(
"adjustErrorsDynamicallyForHits",
false);
316 desc.
add<
bool>(
"adjustErrorsDynamicallyForHitless",
false);
318 desc.
add<
bool>(
"UseHitLessSeeds",
true);
319 desc.
add<
bool>(
"UseStereoLayersInTEC",
false);
320 desc.
add<
std::string>(
"estimator",
"hltESPChi2MeasurementEstimator100");
321 desc.
add<
double>(
"maxEtaForTOB",1.2);
322 desc.
add<
double>(
"minEtaForTEC",0.8);
324 desc.
add<
double>(
"fixedErrorRescaleFactorForHits",2.0);
325 desc.
add<
unsigned int>(
"maxSeeds",1);
326 desc.
add<
double>(
"pT1",13.0);
327 desc.
add<
double>(
"pT2",30.0);
328 desc.
add<
double>(
"pT3",70.0);
329 desc.
add<
double>(
"eta1",1.0);
330 desc.
add<
double>(
"eta2",1.4);
331 desc.
add<
double>(
"SF1",3.0);
332 desc.
add<
double>(
"SF2",4.0);
333 desc.
add<
double>(
"SF3",5.0);
334 desc.
add<
double>(
"SF4",7.0);
335 desc.
add<
double>(
"SF5",10.0);
336 desc.
add<
double>(
"tsosDiff",0.03);
337 descriptions.
add(
"TSGForOI",desc);
double calculateSFFromL2(const reco::TrackRef track)
Function used to calculate the dynamic error SF by analysing the L2.
const std::string estimatorName_
Estimator used to find dets and TrajectoryMeasurements.
TkRotation< Scalar > RotationType
void rescaleError(double factor)
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
std::unique_ptr< TrajectoryStateUpdator > updator_
KFUpdator defined in constructor.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::ESHandle< Propagator > propagatorAlong_
const double tsosDiff_
Distance of TSOSs to trigger using hits or not.
Geom::Phi< T > phi() const
std::vector< Track > TrackCollection
collection of Tracks
GlobalPoint globalPosition() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::ESHandle< MagneticField > magfield_
const double maxEtaForTOB_
Maximum eta value to activate searching in the TOB.
int makeSeedsFromHits(const TrackerTopology *tTopo, const GeometricSearchDet &layer, const TrajectoryStateOnSurface &state, std::vector< TrajectorySeed > &out, const Propagator &propagatorAlong, const MeasurementTrackerEvent &mte, double errorSF)
Function to find hits on layers and create seeds from updated TSOS.
uint32_t rawId() const
get the raw id
Point3DBase< Scalar, GlobalTag > PositionType
bool tecIsStereo(const DetId &id) const
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
unsigned int numSeedsMade_
const double minEtaForTEC_
Minimum eta value to activate searching in the TEC.
void findSeedsOnLayer(const TrackerTopology *tTopo, const GeometricSearchDet &layer, const TrajectoryStateOnSurface &tsosAtIP, const Propagator &propagatorAlong, const Propagator &propagatorOpposite, const reco::TrackRef l2, std::unique_ptr< std::vector< TrajectorySeed > > &seeds)
Function to find seeds on a given layer.
const double fixedErrorRescalingForHits_
How much to rescale errors from the L2 (fixed error vs pT, eta)
std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &tsos2, const Propagator &prop, const MeasurementEstimator &est) const
const bool useHitLessSeeds_
const unsigned int numOfLayersToTry_
How many layers to try.
Abs< T >::type abs(const T &t)
const bool useStereoLayersInTEC_
Switch ON to use Stereo layers instead of using every layer in TEC.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
Create L3MuonTrajectorySeeds from L2 Muons updated at vertex in an outside in manner.
const bool adjustErrorsDynamicallyForHitless_
unsigned int numOfMaxSeeds_
Maximum number of seeds for each L2.
const double pT1_
pT, eta ranges and scale factor values
GlobalPoint position() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< reco::TrackCollection > src_
Labels for input collections.
edm::ESHandle< Chi2MeasurementEstimatorBase > estimator_
bool analysedL2_
Counters and flags for the implementation.
const bool adjustErrorsDynamicallyForHits_
Whether or not to use an automatically calculated scale-factor value.
Plane::PlanePointer dummyPlane_
Surface used to make a TSOS at the PCA to the beamline.
edm::ESHandle< Propagator > propagatorOpposite_
TSGForOI(const edm::ParameterSet &iConfig)
const edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerTag_
edm::ESHandle< GlobalTrackingGeometry > geometry_
T const * product() const
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
edm::Handle< MeasurementTrackerEvent > measurementTracker_
const unsigned int numOfHitsToTry_
How many hits to try per layer.
const double fixedErrorRescalingForHitless_