|
[Rivet] New CMS plugin: strangeness in UE (CMS-PAS-QCD-11-010) and UE at forward eta (CMS-PAS-FWD-11-003)Hannes Jung hannes.jung at cern.chThu Dec 13 06:19:23 GMT 2012
Dear Hendrik thanks a lot for checking so carefully new analyses which are submitted to Rivet. However, I do not understand your argumentation: for me and many others the important point is to have analyses available in Rivet, but I do not care whether they have 100 or 200 or only 10 lines of code. This might be important from an programmers point of view, but for me it is just irrelevant. Of course, the code should run and produce correct results. If the code is changed by anyone other than the author, who is then responsible for validation ? BTW, for non-expert it is not always easy to find out which tools exist already ... Cheers Hannes On 12.12.2012, at 18:00, Hendrik Hoeth wrote: Hi Albert, I've now checked the two analyses, and while the strangeness analysis was straight forward, I spent several hours and lots of cursing cleaning up the forward UE analysis. In the future I will simply send such code back, because we do expect some minimum quality control from you. You find my code in the attachment -- it is about half as long as the original code and, unlike yours, doesn't crash after ~1300 Pythia events. Some "highlights" of the original code: - A self-written selection sort algorithm to sort particle by rapidity, instead using the provided tools. Takes up 17 lines of code and scales as O(n^2). - This could be a "ParticleVector myTempParticles = sfsv.particles();". Note also the cast from Particle to Particle. ------------------------------------ ParticleVector myTempParticles; foreach (const Particle& p, sfsv.particles()) { myTempParticles.push_back(Particle(p)); } ------------------------------------ - I *love* the following one. The whole purpose of the loop is to find the hardest jet (i.e. jets[0]). And the "if (index_1 != -1)" is naturally fulfilled, because we require at least one jet: ------------------------------------ const FastJets& jetpro = applyProjection<FastJets>(event, "Jets"); const Jets& jets = jetpro.jetsByPt(1.0*GeV); if (jets.size()>0) { int index_1 = -1; // for the jet with the 1.highest pT double tempmax_1 = -100; // jet with the 1.highest pt for (size_t ijets = 0; ijets<jets.size(); ++ijets) { if (tempmax_1 == -100 || tempmax_1 < jets[ijets].momentum().pT()/GeV) { tempmax_1 = jets[ijets].momentum().pT()/GeV; index_1 = ijets; } } if (index_1 != -1) { // do something, fill a histogram } } ------------------------------------ So this code boils down to: ------------------------------------ const FastJets& jetpro = applyProjection<FastJets>(event, "Jets"); const Jets& jets = jetpro.jetsByPt(1.0*GeV); if (jets.size()<1) vetoEvent; // do something, fill a histogram, using jets[0]. ------------------------------------ - In your code all the analysis code had three identical copies: One for each energy. - I wonder what invisible particles the jet finder is supposed to use, after being given only charged particles: ------------------------------------ const ChargedFinalState fsj(-2.5,2.5,0.3*GeV); addProjection(fsj, "FSJ"); FastJets jetpro (fsj, FastJets::ANTIKT, 0.5); jetpro.useInvisibles(); addProjection(jetpro, "Jets"); ------------------------------------ - Casting a FourMomentum to a FourMomentum doesn't do much, except for rendering the code unreadable. And why the author does a manual mass-square just one line below using the mass2() method is beyond my mental capabilities. ------------------------------------ FourMomentum Xfourmom; for (int ipart=0; ipart <= deltaymax_pos; ++ipart) { Xfourmom += myRapiditySortedParticles[ipart].momentum(); } if(FourMomentum(Xfourmom).mass2() <0 ) vetoEvent; long double Mx2 = FourMomentum(Xfourmom).mass()*FourMomentum(Xfourmom).mass(); ------------------------------------ This list goes on and on. Global variables that could be local. Strange types ("signed int", "long double", ...). PLEASE have a look at the code next time before dumping it on us, because we will have to maintain it in the future -- together with several hundred other analyses. Thanks. Cheers, Hendrik -- If your dreams don't scare you, then you are not dreaming big enough. <CMS_2012_PAS_FWD_11_003.cc>_______________________________________________ Rivet mailing list Rivet at projects.hepforge.org<mailto:Rivet at projects.hepforge.org> http://www.hepforge.org/lists/listinfo/rivet *********************************************************************** Hannes Jung Email: Hannes.Jung at desy.de<mailto:Hannes.Jung at desy.de> mobile :+49 40 8998 93741 http://www.desy.de/~jung Tel: +49 (0) 40 8998 3741 Fax: +49 (0) 40 8998 3093 DESY, CMS 01B/02.213 Notkestr.85, 22603 Hamburg, FRG *********************************************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.hepforge.org/lists-archive/rivet/attachments/20121213/0302824f/attachment.html>
More information about the Rivet mailing list |