33 for (Long64_t jentry=0; jentry<
nentries;jentry++) {
36 Long64_t centry =
tree.LoadTree(jentry);
37 if (centry < 0)
return;
38 tree.GetEntry(jentry);
41 if( jentry%1000 == 0 ){
42 if (
log.level()<=MSG::INFO) {
43 log << MSG::INFO <<
" new event " << jentry <<
endmsg;
50 typedef std::map<int,std::vector<int> > TrackMap;
51 auto fillTrackMap = [](
const std::vector<int>& trkids, TrackMap& trackMap ){
52 for(
unsigned int i=0;
i<trkids.size();++
i){
53 trackMap[ trkids[
i] ].push_back(
i);
57 TrackMap track_seg_map;
60 TrackMap track_hough_map;
63 TrackMap track_hit_map;
66 TrackMap track_time_map;
69 TrackMap track_candidate_map;
74 TrackPlots* trackPlots =
nullptr;
86 for(
int ii=0;ii<3;++ii ){
105 unsigned int ntruth = 0;
106 unsigned int nseg = 0;
107 unsigned int nseg1 = 0;
108 unsigned int nseg2 = 0;
109 unsigned int nseg3 = 0;
110 unsigned int nhough = 0;
114 if(
pos != track_seg_map.end() ) {
115 nseg =
handleSegments(ntuple,
i,
pos->second,0, matchingStrategy, trackPlots->segments);
116 nseg1 =
handleSegments(ntuple,
i,
pos->second,1, matchingStrategy, trackPlots->segments1);
117 nseg2 =
handleSegments(ntuple,
i,
pos->second,2, matchingStrategy, trackPlots->segments2);
118 nseg3 =
handleSegments(ntuple,
i,
pos->second,3, matchingStrategy, trackPlots->segments3);
122 pos = track_hough_map.find(
i);
123 if(
pos != track_hough_map.end() ) {
124 nhough =
handleHough(ntuple,
i,
pos->second, matchingStrategy, trackPlots->hough);
128 pos = track_hit_map.find(
i);
129 if(
pos != track_hit_map.end() ) {
130 ntruth =
handleHits(ntuple,
i,
pos->second, matchingStrategy, trackPlots->hits);
134 pos = track_time_map.find(
i);
135 if(
pos != track_time_map.end() ) {
141 if( matchingStrategy ==
SameTrack || matchingStrategy ==
All ) {
143 trackPlots->fill(ntruth,nseg,nseg1,nseg2,nseg3,nhough);
145 pos = track_candidate_map.find(
i);
148 for(
unsigned int si=0;si<trackPlots->candidateStages.size();++si ){
149 StageSummaryPlots&
plots = trackPlots->candidateStages[si];
150 std::pair<unsigned int,unsigned int> candidateCounts(0,0);
152 if( candidateCounts.first == 0 ) {
153 plots.etaMissed->Fill(eta);
154 plots.etaBetaMissed->Fill(eta,betaTruth);
155 plots.betaMissed->Fill(betaTruth);
157 if( candidateCounts.second == 0 ) {
158 plots.etaMissedCombined->Fill(eta);
159 plots.betaMissedCombined->Fill(betaTruth);
161 plots.ncandidates->Fill(candidateCounts.first);
162 plots.ncombinedCandidates->Fill(candidateCounts.second);
165 if( nseg3 < 2 )
continue;
167 pos = track_time_map.find(
i);
168 if(
pos != track_time_map.end() ) {
170 BetaFitRegionPlots& betaRegionPlots =
isBarrel ? trackPlots->barrel : trackPlots->endcap;
173 for(
unsigned int co=0;co<2;++co ){
177 if( betaFitResult.status != 0 ) betaRegionPlots.mdt.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
182 if( betaFitResult.status != 0 ) betaRegionPlots.rpc.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
186 if( betaFitResult.status != 0 ) betaRegionPlots.rpct.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
190 if( betaFitResult.status != 0 ) betaRegionPlots.all.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
194 if( betaFitResult.status != 0 ) {
195 betaRegionPlots.allt.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
196 if( betaFitResult.ndof > 9 ) betaRegionPlots.allt_good.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
202 if( betaFitResult.status != 0 ) {
203 betaRegionPlots.mdtt.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
204 if( betaFitResult.ndof > 9 ) betaRegionPlots.mdtt_good.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );