<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Dear Hendrik
<div><br>
</div>
<div>thanks a lot for checking so carefully new analyses which are submitted to Rivet.</div>
<div><br>
</div>
<div>However, I do not understand your argumentation: for me and many others</div>
<div>the important point is to have analyses available in Rivet, but I do not care</div>
<div>whether they have 100 or 200 or only 10 lines of code. This might be</div>
<div>important from an programmers point of view, but for me it is just irrelevant.</div>
<div>Of course, the code should run and produce correct results.</div>
<div><br>
</div>
<div>If the code is changed by anyone other than the author, who is then </div>
<div>responsible for validation ?</div>
<div><br>
</div>
<div>BTW, for non-expert it is not always easy to find out which tools</div>
<div>exist already ...</div>
<div><br>
</div>
<div>Cheers</div>
<div><br>
</div>
<div>Hannes</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>
<div>On 12.12.2012, at 18:00, Hendrik Hoeth wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div>Hi Albert,<br>
<br>
I've now checked the two analyses, and while the strangeness analysis<br>
was straight forward, I spent several hours and lots of cursing cleaning<br>
up the forward UE analysis. In the future I will simply send such code<br>
back, because we do expect some minimum quality control from you.<br>
<br>
You find my code in the attachment -- it is about half as long as the<br>
original code and, unlike yours, doesn't crash after ~1300 Pythia events.<br>
<br>
Some "highlights" of the original code:<br>
<br>
<br>
- A self-written selection sort algorithm to sort particle by rapidity,<br>
instead using the provided tools. Takes up 17 lines of code and scales<br>
as O(n^2).<br>
<br>
<br>
- This could be a "ParticleVector myTempParticles = sfsv.particles();".<br>
Note also the cast from Particle to Particle.<br>
------------------------------------<br>
ParticleVector myTempParticles;<br>
foreach (const Particle& p, sfsv.particles()) {<br>
myTempParticles.push_back(Particle(p));<br>
}<br>
------------------------------------<br>
<br>
<br>
- I *love* the following one. The whole purpose of the loop is to find<br>
the hardest jet (i.e. jets[0]). And the "if (index_1 != -1)" is<br>
naturally fulfilled, because we require at least one jet:<br>
------------------------------------<br>
const FastJets& jetpro = applyProjection<FastJets>(event, "Jets");<br>
const Jets& jets = jetpro.jetsByPt(1.0*GeV);<br>
<br>
if (jets.size()>0) {<br>
<br>
int index_1 = -1; // for the jet with the 1.highest pT<br>
double tempmax_1 = -100;<br>
<br>
// jet with the 1.highest pt<br>
for (size_t ijets = 0; ijets<jets.size(); ++ijets) {<br>
if (tempmax_1 == -100 || tempmax_1 < jets[ijets].momentum().pT()/GeV) {<br>
tempmax_1 = jets[ijets].momentum().pT()/GeV;<br>
index_1 = ijets;<br>
}<br>
}<br>
<br>
if (index_1 != -1) {<br>
// do something, fill a histogram<br>
}<br>
}<br>
------------------------------------<br>
So this code boils down to:<br>
------------------------------------<br>
const FastJets& jetpro = applyProjection<FastJets>(event, "Jets");<br>
const Jets& jets = jetpro.jetsByPt(1.0*GeV);<br>
if (jets.size()<1) vetoEvent;<br>
// do something, fill a histogram, using jets[0].<br>
------------------------------------<br>
<br>
<br>
- In your code all the analysis code had three identical copies: One<br>
for each energy.<br>
<br>
<br>
- I wonder what invisible particles the jet finder is supposed to use,<br>
after being given only charged particles:<br>
------------------------------------<br>
const ChargedFinalState fsj(-2.5,2.5,0.3*GeV);<br>
addProjection(fsj, "FSJ");<br>
<br>
FastJets jetpro (fsj, FastJets::ANTIKT, 0.5);<br>
jetpro.useInvisibles();<br>
addProjection(jetpro, "Jets");<br>
------------------------------------<br>
<br>
<br>
- Casting a FourMomentum to a FourMomentum doesn't do much, except for<br>
rendering the code unreadable. And why the author does a manual<br>
mass-square just one line below using the mass2() method is beyond my<br>
mental capabilities.<br>
------------------------------------<br>
FourMomentum Xfourmom;<br>
<br>
for (int ipart=0; ipart <= deltaymax_pos; ++ipart) {<br>
Xfourmom += myRapiditySortedParticles[ipart].momentum();<br>
}<br>
if(FourMomentum(Xfourmom).mass2() <0 ) vetoEvent;<br>
<br>
long double Mx2 = FourMomentum(Xfourmom).mass()*FourMomentum(Xfourmom).mass();<br>
------------------------------------<br>
<br>
<br>
This list goes on and on. Global variables that could be local. Strange<br>
types ("signed int", "long double", ...). PLEASE have a look at the code<br>
next time before dumping it on us, because we will have to maintain it<br>
in the future -- together with several hundred other analyses. Thanks.<br>
<br>
Cheers,<br>
<br>
Hendrik<br>
<br>
-- <br>
If your dreams don't scare you, then you are not dreaming big enough.<br>
<span><CMS_2012_PAS_FWD_11_003.cc></span>_______________________________________________<br>
Rivet mailing list<br>
<a href="mailto:Rivet@projects.hepforge.org">Rivet@projects.hepforge.org</a><br>
http://www.hepforge.org/lists/listinfo/rivet</div>
</blockquote>
</div>
<br>
<div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div><span class="Apple-style-span" style="font-size: 12px; ">***********************************************************************</span></div>
<div><span class="Apple-style-span" style="font-size: 12px; ">
<div>Hannes Jung </div>
<div>Email: <a href="mailto:Hannes.Jung@desy.de">Hannes.Jung@desy.de</a> </div>
<div>mobile :+49 40 8998 93741</div>
<div><a href="http://www.desy.de/~jung">http://www.desy.de/~jung</a> </div>
<div>Tel: +49 (0) 40 8998 3741 </div>
<div>Fax: +49 (0) 40 8998 3093 </div>
</span></div>
</div>
</span><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div><span class="Apple-style-span" style="font-size: 12px; ">
<div>DESY, CMS 01B/02.213</div>
<div>Notkestr.85, 22603 Hamburg, FRG </div>
<div>***********************************************************************</div>
<br class="Apple-interchange-newline">
</span></div>
</div>
</span><br class="Apple-interchange-newline">
</span><br class="Apple-interchange-newline">
</div>
<br>
</div>
</body>
</html>