@@ -259,7 +259,7 @@ class Primary4DVertexValidation : public DQMEDAnalyzer {
259259 const bool trkRecSel (const reco::TrackBase&);
260260
261261 // ----------member data ---------------------------
262-
262+
263263 const edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> theTTBToken;
264264 TrackFilterForPVFindingBase* theTrackFilter;
265265 const std::string folder_;
@@ -293,7 +293,7 @@ class Primary4DVertexValidation : public DQMEDAnalyzer {
293293
294294 bool use_only_charged_tracks_;
295295 bool optionalPlots_;
296- bool use3dNoTime_;
296+ bool use3dNoTime_;
297297 const double minProbHeavy_;
298298 const double trackweightTh_;
299299 const double mvaTh_;
@@ -303,7 +303,7 @@ class Primary4DVertexValidation : public DQMEDAnalyzer {
303303 edm::EDGetTokenT<reco::TrackCollection> RecTrackToken_;
304304
305305 edm::EDGetTokenT<std::vector<PileupSummaryInfo>> vecPileupSummaryInfoToken_;
306-
306+
307307 edm::EDGetTokenT<reco::TrackCollection> trkToken;
308308 edm::EDGetTokenT<TrackingParticleCollection> trackingParticleCollectionToken_;
309309 edm::EDGetTokenT<TrackingVertexCollection> trackingVertexCollectionToken_;
@@ -530,8 +530,8 @@ class Primary4DVertexValidation : public DQMEDAnalyzer {
530530
531531// constructors and destructor
532532Primary4DVertexValidation::Primary4DVertexValidation (const edm::ParameterSet& iConfig)
533- : theTTBToken(esConsumes(edm::ESInputTag(" " , " TransientTrackBuilder" ))),
534- folder_(iConfig.getParameter<std::string>(" folder" )),
533+ : theTTBToken(esConsumes(edm::ESInputTag(" " , " TransientTrackBuilder" ))),
534+ folder_(iConfig.getParameter<std::string>(" folder" )),
535535 use_only_charged_tracks_(iConfig.getParameter<bool >(" useOnlyChargedTracks" )),
536536 optionalPlots_(iConfig.getUntrackedParameter<bool >(" optionalPlots" )),
537537 use3dNoTime_(iConfig.getParameter<bool >(" use3dNoTime" )),
@@ -573,8 +573,9 @@ Primary4DVertexValidation::Primary4DVertexValidation(const edm::ParameterSet& iC
573573 theTrackFilter = new TrackFilterForPVFinding (iConfig.getParameter <edm::ParameterSet>(" TkFilterParameters" ));
574574 } else if (trackSelectionAlgorithm == " filterWithThreshold" ) {
575575 theTrackFilter = new HITrackFilterForPVFinding (iConfig.getParameter <edm::ParameterSet>(" TkFilterParameters" ));
576- } else {
577- edm::LogWarning (" MVATrainingNtuple: unknown track selection algorithm: " + trackSelectionAlgorithm);
576+ } else {
577+ edm::LogWarning (" Primary4DVertexValidation" )
578+ << " unknown track selection algorithm: " + trackSelectionAlgorithm << std::endl;
578579 }
579580}
580581
@@ -724,7 +725,7 @@ void Primary4DVertexValidation::bookHistograms(DQMStore::IBooker& ibook,
724725 meSimPVZ_ = ibook.book1D (" simPVZ" , " #Sim vertices/10 mm" , 30 , -15 ., 15 .);
725726 meSimPVT_ = ibook.book1D (" simPVT" , " #Sim vertices/50 ps" , 30 , -0.75 , 0.75 );
726727 meSimPVTvsZ_ = ibook.bookProfile (" simPVTvsZ" , " PV Time vs Z" , 30 , -15 ., 15 ., 30 , -0.75 , 0.75 );
727-
728+
728729 meVtxTrackMult_ = ibook.book1D (" VtxTrackMult" , " Log10(Vertex track multiplicity)" , 80 , 0.5 , 2.5 );
729730 meVtxTrackW_ = ibook.book1D (" VtxTrackW" , " Vertex track weight (all)" , 50 , 0 ., 1 .);
730731 meVtxTrackWnt_ = ibook.book1D (" VtxTrackWnt" , " Vertex track Wnt" , 50 , 0 ., 1 .);
@@ -2090,31 +2091,32 @@ void Primary4DVertexValidation::analyze(const edm::Event& iEvent, const edm::Eve
20902091
20912092 t_tks = (*theB).build (tks, beamSpot, t0Safe, sigmat0Safe);
20922093
2093- // track filter
2094+ // track filter
20942095 std::vector<reco::TransientTrack>&& seltks = theTrackFilter->select (t_tks);
20952096
20962097 int unassociatedCount = 0 ;
20972098 for (std::vector<reco::TransientTrack>::const_iterator itk = seltks.begin (); itk != seltks.end (); itk++) {
2098- reco::TrackBaseRef trackref = (*itk).trackBaseRef ();
2099+ reco::TrackBaseRef trackref = (*itk).trackBaseRef ();
20992100 bool isAssociated = false ;
21002101 for (unsigned int iv = 0 ; iv < recopv.size (); iv++) {
2101- const reco::Vertex* vertex = recopv.at (iv).recVtx ;
2102- for (auto iTrack = vertex->tracks_begin (); iTrack != vertex->tracks_end (); ++iTrack) {
2103- if (*iTrack == trackref) {
2104- isAssociated = true ;
2105- break ;
2106- }
2102+ const reco::Vertex* vertex = recopv.at (iv).recVtx ;
2103+ for (auto iTrack = vertex->tracks_begin (); iTrack != vertex->tracks_end (); ++iTrack) {
2104+ if (*iTrack == trackref) {
2105+ isAssociated = true ;
2106+ break ;
21072107 }
2108- if (isAssociated) break ;
2108+ }
2109+ if (isAssociated)
2110+ break ;
21092111 }
21102112
21112113 if (!isAssociated) {
2112- unassociatedCount++;
2113- }
2114+ unassociatedCount++;
21142115 }
2115- double fraction = double (unassociatedCount)/(seltks.size ());
2116- meUnAssocTracks_->Fill (log10 (unassociatedCount));
2117- meFractionUnAssocTracks_->Fill (fraction);
2116+ }
2117+ double fraction = double (unassociatedCount) / (seltks.size ());
2118+ meUnAssocTracks_->Fill (log10 (unassociatedCount));
2119+ meFractionUnAssocTracks_->Fill (fraction);
21182120
21192121 // Loop on tracks
21202122 for (unsigned int iv = 0 ; iv < recopv.size (); iv++) {
0 commit comments