27 produces<reco::NuclearInteractionCollection>();
81 auto theNuclearInteractions = std::make_unique<reco::NuclearInteractionCollection>();
86 for(
unsigned int i = 0;
i < primaryTrajectoryCollection->size() ;
i++) {
88 TrajectoryRef trajRef( primaryTrajectoryCollection,
i );
92 if( itPrimTrack == refMap.
end() || (itPrimTrack->val).isNull() )
continue;
97 if( itSeeds == nuclMap.
end() || (itSeeds->
val).isNull())
continue;
101 std::vector<reco::TrackRef> secondary_tracks;
102 for(
unsigned int k=0;
k < secondaryTrackCollection->size();
k++) {
104 if(
isInside( currentTrk, seeds ) ) secondary_tracks.push_back(currentTrk);
116 if( additionalSecTracks.
isValid() )
119 theNuclearInteractions->push_back(
nuclInter );
121 std::ostringstream
str;
128 LogDebug(
"NuclearInteractionMaker") <<
"End of NuclearInteractionMaker - Number of nuclear interactions found :" << theNuclearInteractions->size();
134 unsigned int seedKey = track->seedRef().
key();
135 for (
unsigned int i=0;
i< seeds.
size();
i++) {
if( seeds[
i].
key() == seedKey )
return true; }
142 LogDebug(
"NuclearInteractionMaker") <<
"Check if one of the " << additionalSecTracks->size()
143 <<
" additional secondary track is compatible";
145 for(
unsigned int i=0;
i< additionalSecTracks->size();
i++) {
161 out<<
"Nuclear Interaction with vertex position : (";
166 out<<
"\tLikelihood : " << nucl.
likelihood() << std::endl;
167 out<<
"\tPrimary Track : Pt = " << primTrack->pt() <<
" - Nhits = " 168 << primTrack->numberOfValidHits() << std::endl;
169 out <<
"\tNumber of seeds : " << nucl.
seedsSize() << std::endl;
175 out <<
"\t\t Secondary track " << it <<
" : Pt = " << (*itr_)->pt()
176 <<
" - Nhits = " << (*itr_)->numberOfValidHits()
177 <<
" - Dist = " << theApproach->
distance()
178 <<
" - chi2 = " << (*itr_)->normalizedChi2() << std::endl;
181 out <<
"----------------" << std::endl;
T getParameter(std::string const &) const
std::unique_ptr< NuclearLikelihood > likelihoodCalculator
float distance() const override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
static bool isInside(const reco::TrackRef &track, const TrajectorySeedRefVector &seeds)
trackRef_iterator secondaryTracks_begin() const
first iterator over secondary tracks
edm::ESWatcher< TransientTrackRecord > transientTrackWatcher_
NuclearInteractionEDProducer(const edm::ParameterSet &)
edm::EDGetTokenT< reco::TrackCollection > token_additionalSecTracks
friend struct const_iterator
const_iterator end() const
last iterator over the map (read only)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::RefToBase< reco::Track > & primaryTrack() const
return the base reference to the primary track
const_iterator find(const key_type &k) const
find element with specified reference key
void produce(edm::Event &, const edm::EventSetup &) override
key_type key() const
Accessor for product key.
S & print(S &os, JobReport::InputFile const &f)
const Point & position() const
position
int secondaryTracksSize() const
return the number of secondary tracks
const TrajectorySeedRefVector & seeds()
return the seeds
ClosestApproachInRPhi * closestApproach(const reco::TrackRef &primTrack, const reco::TrackRef &secTrack) const
edm::EDGetTokenT< TrajTrackAssociationCollection > token_refMapH
std::unique_ptr< NuclearVertexBuilder > vertexBuilder
reco::Vertex::trackRef_iterator trackRef_iterator
edm::EDGetTokenT< TrajectoryCollection > token_primaryTrajectory
void findAdditionalSecondaryTracks(reco::NuclearInteraction &nucl, const edm::Handle< reco::TrackCollection > &additionalSecTracks) const
int seedsSize() const
return the number of seeds
double likelihood() const
return the likelihood ~ probability that the vertex is a real nuclear interaction ...
T const * product() const
~NuclearInteractionEDProducer() override
edm::ESWatcher< IdealMagneticFieldRecord > magFieldWatcher_
bool check(const edm::EventSetup &iSetup)
edm::EDGetTokenT< reco::TrackCollection > token_secondaryTrack
const reco::Vertex & vertex() const
return the vertex
size_type size() const
Size of the RefVector.
edm::EDGetTokenT< reco::TrackCollection > token_primaryTrack
edm::EDGetTokenT< TrajectoryToSeedsMap > token_nuclMapH
trackRef_iterator secondaryTracks_end() const
last iterator over secondary tracks
T const * product() const