32 namespace tracksToTrajectories {
40 using namespace tracksToTrajectories;
52 return std::make_unique<Count>();
56 static void globalEndJob(
Count const* iCount);
80 if(type ==
"Default") theTrackTransformer = std::make_unique<TrackTransformer>(trackTransformerParam);
81 else if(type ==
"GlobalCosmicMuonsForAlignment") theTrackTransformer = std::make_unique<TrackTransformerForGlobalCosmicMuons>(trackTransformerParam);
82 else if(type ==
"CosmicMuonsForAlignment") theTrackTransformer = std::make_unique<TrackTransformerForCosmicMuons>(trackTransformerParam);
85 <<
"The selected algorithm does not exist"
87 <<
"Possible choices are:"
89 <<
"Type = [Default, GlobalCosmicMuonsForAlignment, CosmicMuonsForAlignment]";
92 produces<vector<Trajectory> >(
"Refitted");
93 produces<TrajTrackAssociationCollection>(
"Refitted");
107 LogWarning(metname) <<
"During the refit there were "
108 << theNFailures <<
" out of " << theNTracks <<
" tracks, i.e. failure rate is: " << double(theNFailures)/theNTracks;
110 LogTrace(metname) <<
"Refit of the tracks done without any failure";
121 theTrackTransformer->setServices(setup);
124 unique_ptr<vector<Trajectory> > trajectoryCollection(
new vector<Trajectory>);
128 =
event.getRefBeforePut<vector<Trajectory> >(
"Refitted");
132 event.getByToken(theTracksToken, tracks);
141 for (reco::TrackCollection::const_iterator newTrack = tracks->begin();
142 newTrack != tracks->end(); ++newTrack) {
144 ++(globalCache()->theNTracks);
146 vector<Trajectory> trajectoriesSM = theTrackTransformer->transform(*newTrack);
148 if(!trajectoriesSM.empty()){
150 trajectoryCollection->push_back(trajectoriesSM.front());
153 trajTrackMap->insert(
Ref<vector<Trajectory> >(trajectoryCollectionRefProd,trajectoryIndex++),
157 LogTrace(metname) <<
"Error in the Track refitting. This should not happen";
158 ++(globalCache()->theNFailures);
161 LogTrace(metname)<<
"Load the Trajectory Collection";
162 event.put(
move(trajectoryCollection),
"Refitted");
163 event.put(
move(trajTrackMap),
"Refitted");
T getParameter(std::string const &) const
virtual ~TracksToTrajectories()
Destructor.
std::atomic< int > theNFailures
const std::string metname
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::TrackCollection > theTracksToken
TracksToTrajectories(const edm::ParameterSet &, const Count *)
Constructor.
std::unique_ptr< TrackTransformerBase > theTrackTransformer
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > > TrajTrackAssociationCollection
virtual void produce(edm::Event &, const edm::EventSetup &) override
Convert a reco::TrackCollection into std::vector<Trajectory>
static void globalEndJob(Count const *iCount)
static std::unique_ptr< Count > initializeGlobalCache(edm::ParameterSet const &)
ParameterSet const & parameterSet(Provenance const &provenance)
boost::remove_cv< typename boost::remove_reference< argument_type >::type >::type key_type
std::atomic< int > theNTracks