Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngrenz: code cleonup and optimization of reco track #10975

Merged
merged 7 commits into from Sep 13, 2015

Conversation

ngrenz
Copy link
Contributor

@ngrenz ngrenz commented Aug 27, 2015

Work intended to optimize the performance of tracker validation code and code cleanup.
Outputs are supposed to be unchanged.

Any comments and suggestions are welcome.
More optimizations will follow.

The changes inside the analyse function are currently not realy big:
instead of

for ( ... ) {
  if (!itTraj->updatedState().isValid()) continue;
  if (itTraj.updatedState().globalMomentum().perp() < 0.5)  continue;
}

here is used

for ( ... ) {
  if (itTraj->updatedState().isValid()) {
    if (itTraj.updatedState().globalMomentum().perp() < 0.5)    continue;
  }
}

and instead of

if (isrechitrphi > 0 || isrechitsas > 0) { 
  if (isrechitrphi > 0) { // fillMEs mono 1 } 
  if (isrechitsas > 0) { //fillMEs stereo 1 } 
  if(iLayerME != LayerMEsMap.end()){ 
    if (isrechitrphi > 0) { // fillMEs mono 2 } 
  } 
  if(iStereoAndMatchedME != StereoAndMatchedMEsMap.end()){ 
    if (isrechitsas > 0) { //fillMEs stereo 2 }
  } 
}

here is used

if (isrechitrphi > 0) { 
  // fillMEs mono 1
  if(iLayerME != LayerMEsMap.end()){ 
    // fillMEs mono 2 
  } 
}
if (isrechitsas > 0) {
  //fillMEs stereo 1
  if(iStereoAndMatchedME != StereoAndMatchedMEsMap.end()){ 
    //fillMEs stereo 2 
  }
}

these changes cover a large area.

The changes in the remaining functions are equivalent to #10973

Thanks for the help

@ngrenz ngrenz changed the title Ngrenz reco track ngrenz: code cleonup and optimization of reco track Aug 27, 2015
@ngrenz
Copy link
Contributor Author

ngrenz commented Aug 27, 2015

@boudoul FYI

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @ngrenz for CMSSW_7_6_X.

ngrenz: code cleonup and optimization of reco track

It involves the following packages:

Validation/RecoTrack

@cmsbuild, @danduggan, @deguio can you please review it and eventually sign? Thanks.
@makortel, @GiacomoSguazzoni, @rovere, @VinInn, @cerati, @wmtford, @istaslis, @dgulhan this is something you requested to watch as well.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
If you are a L2 or a release manager you can ask for tests by saying 'please test' in the first line of a comment.
@Degano you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@@ -815,6 +729,7 @@ void SiStripTrackingRecHitsValid::analyze(const edm::Event & e, const edm::Event
if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.meResolxMFRphiwclus3,sqrt(rechitpro.resolxxMF));}
if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.meResolxMFRphiwclus4,sqrt(rechitpro.resolxxMF));}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of the preexisting code.
Here is a logic error and I will correct it in the next pull request for this class.

The problem is that the max from min(rechitpro.clusiz, 4) is 4, therefore the max of the query is

if ( (4 - 1) == 4 )

so this fillME will never be executed


Page 13 from this slides list possible solutions:
https://indico.cern.ch/event/394132/session/1/contribution/5/attachments/1140008/1632665/code_cleanup.pdf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition for the next pull request:
if I am not wrong, the chronological order of the fillME is not
important as long as the first entry is different.

Therefore the result does not change if I write

fillME(simplehitsMEs.meResolxMFAngleProfile,rechitpro.trackangle, sqrt(rechitpro.resolxxMF));
fillME(simplehitsMEs.meResolxMFTrackwidthProfile,rechitpro.trackwidth, sqrt(rechitpro.resolxxMF));

or

fillME(simplehitsMEs.meResolxMFTrackwidthProfile,rechitpro.trackwidth, sqrt(rechitpro.resolxxMF));
fillME(simplehitsMEs.meResolxMFAngleProfile,rechitpro.trackangle, sqrt(rechitpro.resolxxMF));

if I am right, so I can combine some if in the next pull request

@@ -1316,19 +1249,25 @@ void SiStripTrackingRecHitsValid::createMEs(DQMStore::IBooker & ibooker,const ed
// get detids for the layer
// Keep in mind that when we are on the TID or TEC we deal with rings not wheel
int32_t lnumber = det_layer_pair.second;
std::string lname = det_layer_pair.first;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const std::string&

@deguio
Copy link
Contributor

deguio commented Sep 11, 2015

please test

@cmsbuild
Copy link
Contributor

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

Pull request #10975 was updated. @cmsbuild, @danduggan, @deguio can you please check and sign again.

@deguio
Copy link
Contributor

deguio commented Sep 11, 2015

+1
provided it passes the tests

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_6_X IBs or unless it breaks tests. This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @Degano, @smuzaffar

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_6_X IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @Degano, @smuzaffar

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_6_X IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @Degano, @smuzaffar

@davidlange6
Copy link
Contributor

+1

cmsbuild added a commit that referenced this pull request Sep 13, 2015
ngrenz: code cleonup and optimization of reco track
@cmsbuild cmsbuild merged commit e017a8d into cms-sw:CMSSW_7_6_X Sep 13, 2015
@ngrenz ngrenz deleted the ngrenz_RecoTrack branch December 18, 2015 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants