Translate

Sunday 30 November 2014

Around the world in 80 months

A new year, a new job, a new continent...
Sounds like I've read that somewhere before. Now I'm going full circle. Starting at the West coast of the USA, in San Francisco, pretty much exactly 80 months ago, I embarked on a journey to Oxfordshire, UK, on to Canton Geneve, Suisse, then to 宮城県、日本。Starting in January 2015 I will be joining the staff of the Pacific Northwest National Laboratory. I am particularly pleased by the fact that I am cast as a physicist, not a particle physicist. Of course, I will stay involved in particle physics, but the lab has many interesting projects that I hope to contribute to. I look forward to proving that the training of a particle physicist enables one to have a positive impact on a variety of other subjects as well.  At the same time, I am confident that I can take advantage of the diverse capabilities at the lab for my research in particle physics, in particular for building an ILC detector that can deliver on the promise of precision physics in the Higgs and electroweak sector.

Now I will have to change my tag line. I have graduated from my journeyman days.

LaTeX style files

Prelude

Since nearly all funding for particle physics comes from tax payers around the globe, I am proud to say that particle physicist have been steadily improving at making their work public and open to all. Since the beginning of this year, a consortium sponsors open access to publications in particle physics. This funds the important peer-review process, which is how journals maintain the quality of their contributions. Of course, everybody is free to disseminate their opinion in blog articles, twitter messages, and to upload notes of their studies to online archives, but without verification by an independent reviewer, the quality of this information is questionable. The peer review process is of course no silver bullet, but it's the best method we have to qualify research as worthy of distribution to others, so that they can build upon the results.

Bibtex in particle physics

This long-winded introduction brings me to the crux of this post: We are submitting our current draft to EPJC. They provide LaTeX templates including a bibtex style file. (It would be great if they could arrive in this decade and allow biblatex, but most of them require natbib, which precludes the use of biblatex...) We usually cite references from various sources, so being able to use a bibtex database and a style file to get them all formatted consistently is a great bonus. The journals do a reasonable job of formatting their citations consistently, and they use the right fields for author, year, edition, pages, etc. Unfortunately for us, many contributions in the linear collider community did not go through a peer review, and the online repository we use for most of our work contains both, links to peer-reviewed journal articles, as well as private uploads of notes were not subject to the same scrutiny. This also means that the bibtex entries are somewhat inconsistent, to say the least. So some adjustment of the bibtex file (easy) and the bibtex style file (not easy) is needed.

Editing the style file

Adding fields from your bibtex database

As mentioned, most of our sources, peer-reviewed or not, can be found on the online archive, which gives them an "eprint" field in the bibtex database. Unfortunately, the style file distributed by EPJC ignores this field. The first course of action is to add an "eprint" field under the ENTRY section of the bst file (most likely near the top of the file).

Adding a document type

Bibtex allows to specify individual formatting rules for each document type: For a @book, you might want to mention editors and an ISBN, while for a published @article, the journal edition and page numbers are more relevant. For our current draft submission, I decided to format peer-reviewed articles differently from non peer-reviewed ones. Bibtex uses functions with the same names as the document type to specify formatting rules, so an @article is formatted by FUNCTION{article}{...}, while a book is formatted by FUNCTION{book}{...}. Unlike the formatting of individual fields, specifying a new document type does not need to be declared anywhere, other than writing a function for it.
I came up with this for formatting my new "arxiv" document type for articles uploaded to the online repository, but not published in a journal:
 FUNCTION {arxiv}  
 { output.bibitem  
  format.authors "author" output.check  
  add.comma  
  format.date "year" output.check  
  format.eprint "eprint" output.check  
  fin.entry  
 }  
Actually, each of these lines is a call to another FUNCTION. Most of these are defined by the style file already. I just had to write the format.eprint function, which looks like this:
 FUNCTION {format.eprint}  
 { eprint "eprint" bibinfo.check  
  duplicate$ empty$ 'skip$  
   {  
    new.block  
    "arXiv:" swap$ *   
   }  
  if$  
 }  
This prints the word "arXiv:" before the eprint entry of the bibtex database. I don't want to go into more detail about the different lines here. Mostly, because I don't understand every detail of the language used. Read the docs if you are interested.

Summary

This post assumes that you have at least cursory familiarity with bibtex and are faced with a somewhat constrained problem. As you can see, it's not a lot of code that needed writing, but finding out what to put where was somewhat time-consuming.
If you start from scratch, I suggest you follow the links in this post and only use the bibtex database to collect your references. Use biblatex rather than bibtex to format them.

I haven't fully finalized my formatting, yet, but this should give you an idea of how to change an existing bst file to suit your needs. I'll be sure to submit the revised version of the bst to the journal. If they just get rid of the natbib requirement and allow the use of biblatex, this will all become much easier. In the meantime, if you want to submit an article to a journal, and are faced with a similarly incomplete template, I hope this post is useful for you. 

Friday 7 November 2014

Subversion to github

A big part of the daily routine of a particle physicist is writing code. Unfortunately, we're not particularly well trained for this, so new developments trickle through the system rather slowly. Recently a couple of colleagues and I chose to re-start development of a package that had seen only little activity in a while. The code was hosted on subversion, together with dozens of other packages. For our project, we chose to migrate to github.

So here's a little review on how we got on:

  1. create github dir
  2. checkout old code from svn
  3. check new code into git
  4. commit code
  5. start applying some patches and start coding
At this point a colleague suggested that we should preserve the old commit history from subversion when importing the code. Terrific idea! But we already started coding... I'm lazy, so starting all over is clearly not an option. So here's what I did.
  1. Import the code from subversion into github including the commit history and existing svn branches and tags
  2. checkout the repository with our developments
  3. git log #gives you the history, together with the sha for each commit
  4. git format-patch -4 HEAD # to get patches for the last 4 commits. This creates 4 patch files
  5. git checkout <new repo from github import>
  6. cd <new repo from github import>
  7. apply the patches from step 4 one by one. I think the "git am" command would do all of this in one step, so that may be a better solution. I will try that next time.
At one point, there was a conflict in the merge. I have simply copied the conflicting file over from the other repo. Again, "git am" looks like it would have worked better. I'm still on the upward path of the learning curve.

Tuesday 4 November 2014

FPCCD Neutron Damage test at Tohoku CYRIC

From afar the ILC detectors are going to have a very similar look to the LHC detectors ATLAS and CMS. They are cylindrical objects, with different sub-detectors for measuring different properties of the high-energy particles that will be produced by the collisions of bunches of electrons and positrons. Closest to the interaction point in the center of the detector will be the vertex detector for the precise measurement of the decay point of long-lived particles. Next, a tracking detector measures the momenta of charged particles from their trajectories in a magnetic field. The calorimeters outside of the tracking detectors measure the energy of the particles.
Yet, at second glance, because of much cleaner environment of the ILC detectors, particularly the inner detectors look very different from their LHC counterparts. While for the LHC detectors the requirement of radiation hardness puts a serious constraint on the achievable precision, ILC vertex detectors hope to achieve about an order of magnitude better precision on momentum and impact parameter measurements. Nevertheless, radiation damage is also a concern for ILC detectors. The beams after the collision cannot be re-used for collisions. (But we can hopefully recover at least some of their energy.) The current plan is to safely dispose of them in a beam dump. Some of the neutrons produced there can travel back up the beam pipe and enter the detector. Their energy has been studied and roughly looks like this.
 
Expected Neutron energies from the ILC beam dump.
The first layer of a vertex detector at the ILC has to deal with
up to 1010 neutrons / cm2 / year

Not a big problem compared to the factor of about 1,000 that the LHC detectors have to cope with, but nevertheless something we need to study. We have a facility at Tohoku University where we can get a neutron beam. The energy is close enough to what we would expect at the ILC.
Distribution of Neutron energies in the
Tohoku CYRIC facility. We still have to
evaluate our own measurements of
 neutron flux and energy.

After some intense preparation and frantic manufacture of beam profile monitor from scintillator bars, we now have pixel detectors with the equivalent of about 2.5 years equivalent of ILC neutron dose. Analysis of the data is underway, so I can't show anything yet. We are still not even done with the complete analysis of last year's data. Here are two plots to give you just a rough idea of what we are studying. I will try to go into more detail in some future blog posts.
Active area of the FPCCD chip. The red dot is a "hot pixel".
Similarly to a dead pixel in your LCD screen, this is bad.
In this case, we define a "hot pixel" as one that has a signal
significantly above the (blue) background.

We are measuring the number of pixels that was affected
by the neutron radiation. As you can see, measurements
at low temperatures are significantly less affected by the
damage, but the difference before and after irradiation is
obvious.

The ILC and time zones

A surprisingly big problem in a global collaboration is to find a meeting time that suits people in Asia, America and Europe equally badly well.
Usually this means getting up early at the west coast of the US, and being up late in Japan. The Europeans sacrifice their tea time or run into conflict with supper.

The fact that Europe and the US cannot agree on a common start and end of daylight savings time, adds an additional dimension of complication, because - when do you change the time of the meeting: When daylight savings time ends in Europe, or in the US, or do you change it at all? Japan, after all, does not change the clocks.
This whole conundrum leads to much confusion and conflicts. Even more confusing is the fact that some of my venerable colleagues do not seem to understand the abbreviations of time zones. Here is something that helps:
http://www.timeanddate.com/time/zones

So here's a suggestion: Since the ILC will be built in Japan, the canonical time should be JST.
For all of you that don't know what time zone they are in (and there's a few of you, don't deny it), this may help:
http://www.timeanddate.com/time/map/

Finally, our default online agenda - indico - has support for displaying the meeting time in your favorite time zone.
So please, let's all specify the time zone when we announce a meeting. And let's not miss any more meetings because of time zone confusion.