53 static void globalEndJob(
Count const* iCount);
74 if (
type ==
"Default")
75 theTrackTransformer = std::make_unique<TrackTransformer>(trackTransformerParam);
76 else if (
type ==
"GlobalCosmicMuonsForAlignment")
77 theTrackTransformer = std::make_unique<TrackTransformerForGlobalCosmicMuons>(trackTransformerParam);
78 else if (
type ==
"CosmicMuonsForAlignment")
79 theTrackTransformer = std::make_unique<TrackTransformerForCosmicMuons>(trackTransformerParam);
82 <<
"The selected algorithm does not exist"
84 <<
"Possible choices are:"
86 <<
"Type = [Default, GlobalCosmicMuonsForAlignment, CosmicMuonsForAlignment]";
89 produces<vector<Trajectory>>(
"Refitted");
90 produces<TrajTrackAssociationCollection>(
"Refitted");
97 constexpr
char metname[] =
"Reco|TrackingTools|TracksToTrajectories";
102 if (theNFailures != 0)
103 LogWarning(
metname) <<
"During the refit there were " << theNFailures <<
" out of " << theNTracks
104 <<
" tracks, i.e. failure rate is: " << double(theNFailures) / theNTracks;
113 constexpr
char metname[] =
"Reco|TrackingTools|TracksToTrajectories";
116 theTrackTransformer->setServices(
setup);
119 auto trajectoryCollection = std::make_unique<vector<Trajectory>>();
126 event.getByToken(theTracksToken,
tracks);
129 auto trajTrackMap = std::make_unique<TrajTrackAssociationCollection>(trajectoryCollectionRefProd,
tracks);
135 for (
auto const& newTrack : *
tracks) {
136 ++(globalCache()->theNTracks);
138 auto const& trajectoriesSM = theTrackTransformer->transform(newTrack);
140 if (!trajectoriesSM.empty()) {
142 trajectoryCollection->push_back(trajectoriesSM.front());
145 trajTrackMap->insert(
Ref<vector<Trajectory>>(trajectoryCollectionRefProd, trajectoryIndex++),
148 LogTrace(
metname) <<
"Error in the Track refitting. This should not happen";
149 ++(globalCache()->theNFailures);
153 event.put(
move(trajectoryCollection),
"Refitted");
154 event.put(
move(trajTrackMap),
"Refitted");