54 static void globalEndJob(
Count const* iCount);
75 if (
type ==
"Default")
76 theTrackTransformer = std::make_unique<TrackTransformer>(trackTransformerParam, consumesCollector());
77 else if (
type ==
"GlobalCosmicMuonsForAlignment")
78 theTrackTransformer = std::make_unique<TrackTransformerForGlobalCosmicMuons>(trackTransformerParam);
79 else if (
type ==
"CosmicMuonsForAlignment")
80 theTrackTransformer = std::make_unique<TrackTransformerForCosmicMuons>(trackTransformerParam);
83 <<
"The selected algorithm does not exist"
85 <<
"Possible choices are:"
87 <<
"Type = [Default, GlobalCosmicMuonsForAlignment, CosmicMuonsForAlignment]";
90 produces<vector<Trajectory>>(
"Refitted");
91 produces<TrajTrackAssociationCollection>(
"Refitted");
98 constexpr
char metname[] =
"Reco|TrackingTools|TracksToTrajectories";
103 if (theNFailures != 0)
104 LogWarning(
metname) <<
"During the refit there were " << theNFailures <<
" out of " << theNTracks
105 <<
" tracks, i.e. failure rate is: " << double(theNFailures) / theNTracks;
114 constexpr
char metname[] =
"Reco|TrackingTools|TracksToTrajectories";
117 theTrackTransformer->setServices(
setup);
120 auto trajectoryCollection = std::make_unique<vector<Trajectory>>();
127 event.getByToken(theTracksToken,
tracks);
130 auto trajTrackMap = std::make_unique<TrajTrackAssociationCollection>(trajectoryCollectionRefProd,
tracks);
136 for (
auto const& newTrack : *
tracks) {
137 ++(globalCache()->theNTracks);
139 auto const& trajectoriesSM = theTrackTransformer->transform(newTrack);
141 if (!trajectoriesSM.empty()) {
143 trajectoryCollection->push_back(trajectoriesSM.front());
146 trajTrackMap->insert(
Ref<vector<Trajectory>>(trajectoryCollectionRefProd, trajectoryIndex++),
149 LogTrace(
metname) <<
"Error in the Track refitting. This should not happen";
150 ++(globalCache()->theNFailures);
154 event.put(
move(trajectoryCollection),
"Refitted");
155 event.put(
move(trajTrackMap),
"Refitted");