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

CSC segment fit factored and smatrixed #7864

Merged
merged 19 commits into from Feb 21, 2015

Conversation

ptcox
Copy link
Contributor

@ptcox ptcox commented Feb 19, 2015

This completes the conversion of CLHEP matrices to ROOT::SMatrix in the CSC least-squares fit code of all 5 CsC segment building algorithms, as required for CMSSW multithreading compatiiblity. It does this by factoring out the fit into a base class CSCSegFit, where the SMatrix code lives. The current default segment builder algorithm, CSCSegAlgoST, uses a derived class CSCCondSegFit, which involves some sophisticated (i.e. I don't understand) conditioning passes. All 4 other algorithms use the simple base class. While making this conversion and factoring I needed to bring the old algorithms back to life - none had been run in years. This involved updating their config files (adding me42). They all now run on 73X relval samples. A number of minor bugs were fixed. My basic validation was to ensure that the default ST algorithm produces the same, identical, segments in 1000 TTbar + 25ns BX pileup events from the 73X relvals. This newly-factored seg-fit version does indeed produce identical segments to those in the ST version with the SMatrix-based seg fit embedded. I have also run the same 1000 events with valgrind and there are no errors or memory leaks detected in this code (or elsewhere in CSC local reco.) Because this version should now be multithreading compatible I have once more changed the CSCSegmentProducer to a stream::EDProducer. Finally, I ran the Reco-required "runTheMatrix.py -s --useInput all" tests in a 75X IB and they completed with no errors. I have one caveat: I know nothing about 'fillDescriptions' but I get the impression that sooner or later HLT will want that included. Because there are multiple algorithms it will be complex to write such functions and I don't plan to do it any time soon (April would be a possible timescale, if I am still around.)

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @ptcox for CMSSW_7_5_X.

CSC segment fit factored and smatrixed

It involves the following packages:

RecoLocalMuon/CSCSegment

@cmsbuild, @cvuosalo, @nclopezo, @slava77 can you please review it and eventually sign? Thanks.
@bellan 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.
@nclopezo, @ktf you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@cmsbuild
Copy link
Contributor

Pull request #7864 was updated. @cmsbuild, @cvuosalo, @nclopezo, @slava77 can you please check and sign again.

@slava77
Copy link
Contributor

slava77 commented Feb 19, 2015

@cmsbuild please test

@cmsbuild
Copy link
Contributor

The tests are being triggered in jenkins.

@slava77
Copy link
Contributor

slava77 commented Feb 20, 2015

.. I'm checking it

float Rdev( float x, float y, float z ) const;

// Other public functions are accessors
CSCSetOfHits hits(void) const { return hits_; }
Copy link
Contributor

Choose a reason for hiding this comment

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

why not return a const CSCSetOfHits& ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Slava,

The original code in several of the algorithms uses the set of hits as a cache and often manipulates it, inserting or erasing elements. My simple approach was just to make sure the CSCSegFit could satisfy their requirements, so I wanted a copy of the initial set of hits held in the CSCSegFit object.

I am not sure the existing code will work even with a reference, let alone a const reference. Maybe it can be changed, but that is an optimization for the future, not a show stopper, and somebody would have to ensure everything continues to work fine.

On a side note, Piet and I were discussing earlier in the week how to adapt this for GEM too, since the same CLHEP-based code has also been entangled in the GEM local reco. It is conceivable that the code could be extended to TrackingRecHits, and dimensions will have to be increased to at least allow 8 hits. At the same time one could attempt to clarify ownership and constness of the set of hits.

Regards, Tim

On Feb 21, 2015, at 00:05 , Slava Krutelyov notifications@github.com wrote:

In RecoLocalMuon/CSCSegment/src/CSCSegFit.h:

  • // Change scale factor of rechit x error
  • // - expert use only!
  • void setScaleXError ( double factor ) { scaleXError_ = factor; }
  • // Fit values
  • float xfit( float z ) const;
  • float yfit( float z ) const;
  • // Deviations from fit for given input (local w.r.t. chamber)
  • float xdev( float x, float z ) const;
  • float ydev ( float y, float z ) const;
  • float Rdev( float x, float y, float z ) const;
  • // Other public functions are accessors
  • CSCSetOfHits hits(void) const { return hits_; }

why not return a const CSCSetOfHits& ?


Reply to this email directly or view it on GitHub.

@slava77
Copy link
Contributor

slava77 commented Feb 21, 2015

+1

for #7864 b779fc5

checked additionally in CMSSW_7_5_X_2015-02-20-1400 /test area sign520/
The technical performance (CPU and memory) as well as the monitored physics quantities are unchanged.

The static analyzer results are clean.

Thanks, this was quite a large update.

@cmsbuild
Copy link
Contributor

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

@davidlange6
Copy link
Contributor

+1

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

4 participants