Science’s cutting edge
Thanks for all the protons!
0The LHC dumped it’s last fill for the year today at 10:20. The scheduled shutdown wasn’t until 18:00, but they couldn’t get another set of lead ions spinning by then (you can see a small spike around 14:00 below when particles were injected but a “trip” dumped the beam before acceleration began). So, we won’t see new collisions until sometime in March and in the meantime there will be much repairing and updating to both the accelerator and detector.
It was a great year for the LHC and there is nothing but exciting things to expect from the coming year!
Is that dust in both my eyes?
0As I gaze over the beautiful vineyards of Switzerland cradled by French mountains forming a feathered edge in the sunset haze, and as I work into the night trying hard to fully understand one slice of the most energetic particle collisions man has ever produced, this physicist’s thoughts are unfortunately nowhere near Europe and the LHC.
In a few minutes the Fermilab Tevatron Collider (that’s the offical name it gets in all our papers) will be permanently shut down (with a live broadcast and party). I have to diverge from our regularlly scheduled CERN Love to some FNAL Love for a moment.
The Economist’s article “So long and thanks for all the quarks” is a wonderful little ride, from its Douglas Adams opening, snapping every nerd to attention, to its teary, confused, excited ending. We physicists are a very pratical lot; if we are Americans and we can only get our particle collisions in Europe, well then it’s time for more baguettes and cheese! But, from a wider view you really start to wonder if the US is going to be just a bit more lost without such Great Things such as the space shuttle program or the Tevatron.
I spent some time at FNAL, and though I will never miss its cafeteria (“cheap” is the only positive thing I was ever able say) and the lifeless surounding surburbs, it was and still is a little bit magical place. Arriving at dawn, earlier than most, for the start of a shift in the detector control room you might creep past a coyote hopping in and out of the roadside furrows on a hunt. Waiting in shot-setup, as the antiprotons that were created and carefully stored over the entire last night are finally slipped into the Tevatron ring, you tense a little as as you listen to the audio cues from the accelerator. There is a whooosh as each set of bunches load (was that a photon torpedo or an X-wing blast?), sometime later a robot voice announces “ac-cel-er-a-tion,” and finally “col-li-der state: high energy physics.” Later, maybe there will a beer at Two Brother’s Tap House or even a trip into Chicogo (with so much more to offer than Geneva). Always new details of nature to nail down. Always more plots to make. Always more data, until now.
Damn-it, did I just get something in my eye?
The Economist asks, is the future of high energy physics now “For all mankind?” I hope to God or Nature it is. What we do across the praries of Batavia or under the small towns and dairy farms of the Pays de Gex is both very human and very incredible. I wish every last person some taste of it.

That sucking sound
0
“A Chip Is Born: Inside a State-of-the-Art Clean Room” from Wired is just good clean nerd fun: bunny suits, sexy stainless steel vessels, yellow lighting so as to “avoid interference with the UV”. The cool stuff even includes a cool lack of stuff,
On the right is one of the large silver pumps used to create extreme vacuums inside the machine — as low as 10-12 atmospheres. (By comparison, the air pressure at 200 kilometers [about 124 miles] above the Earth, where the Space Shuttle orbits, is about a hundred times thicker, at about 10-10 atmospheres.)
Congratulations to them. But, have you heard that the LHC has 27 freakin’ kilometers of beam pipe at 10-10 torr, that’s 10-13 atmospheres, as well as many thousands of cubic meters of insulating vacuum at 10-6 torr (~10-9 atmospheres). Their nothing is a trifle of our nothing.
Of course the reason we need such a pure vacuum is because the proton beams will be circulating in this 27 km tube for hours at a time. Even tiny amounts of gas will lead to unwanted collisions. In small amounts this scattering contributes annoying background and in large amounts it could degrade the beam or contribute heat leading to a quench.
Just the process of creating these extreme vacuums can be pretty interesting. At right you can see a TurboMolecular Pump (diagram & combo), clearly bad-ass. Let me wikipedia that for you. You can get only so far with spinny things, though. The final stage of sweeping up troublesome molecules is accomplished by non-evaporable getter, you can call it NEG to impress your friends. It is just a chemical coating. The NEG is activated in a process called “bake-out.” Heaters temporarily raise the temperature of the vacuum vessel to 350 or 220 C. In bare metal sections the heat releases gas trapped on the surface of the metal. In other sections the heat actives the NEG and stray gas molecules are trapped. You can read a little more in an ATLAS e-News from 2008.
Chocolate bar yardstick
1Sorry about all the silence the last couple weeks. These days our day jobs are getting pretty busy.
After the question “what is 7 TeV?” came up in the comments on our imminent collisions post I though it would be fun to take a tour of some common quantities in energy physics. All of this appears in other sources such as “LHC: The Guide” (2008) and, many talks such as “LHC Status and Commission Plans”.
First of all, let’s stay humble. The size of the LHC and its experiments are often enumerated for dramatic effect with numbers like
- 27 km in circumference,
- 100 m underground,
- 8 stories high,
- 12,500 tons, etc.
But all this huge equipment is just support for the diminutive stars:
- bunches of 1011 protons,
- each 7 cm long and 1 mm in diameter (about the size of a mechanical pencil lead).
That really isn’t much stuff considering that macroscopic things contain around 1023 atoms. At rest this bunch of protons is just 1.6×10-13 g of matter. Given this tiny mass and the pencil-lead dimensions you end up with a density of roughly 4×10-7 g/m3, which is absolutely nothing considering that hydrogen gas is 200 million times denser at 90 g/m3 (the LHC can run for many months using the protons from one bottle of hydrogen gas). To increase the odds that these protons run into each other the bunches are focused to a diameter of about 16 μm just before they cross. Still, collisions are rare, with everything running well there will be at best 20 interactions per crossing (and only a tiny fraction of these interactions will be of any interest to scientists). On the otherhand, the LHC can be filled with 2808 bunches spaced about 7 m apart, and with all these bunches moving at just a hair under the speed of light we can end up with 600 million interactions each second.
So, what about this 7 TeV thing? A teraelectronvolt (TeV), or 1012 electronvolts (eV), is a unit of energy. What we are measuring is the energy available in individual proton interactions. The LHC was designed to operate up to 7 TeV per proton, or 14 TeV total. But, for the next couple years the protons will be accelerated up to a speed where each proton carries 3.5 TeV of energy, and for just a moment while two protons collide we will have 7 TeV of energy in one place ready to make new particles (a Higgs boson, dark matter, or maybe something completely new).
A TeV is actually a very tiny amount of energy. A popular analogy is to a flying mosquito, one proton has the same energy as a handful of mosquitoes,
| Energy | Amount | Notes |
|---|---|---|
| Kinetic energy of a flying mosquito | 0.81 TeV | assuming a 1.5 mg mosquito moving at 1.5 kph |
On the other hand, we have to give these protons some credit. They are a lot smaller than a mosquito. In fact, if you consider energy density these interactions are record breaking. A simple way to look at this is in terms of energy per particle interaction. Chemical energy is what runs batteries, bombs, and us; but chemical reactions involve only around one electronvolt of energy per atom. Potentially, each of the LHC protons brings 7 trillion times more energy to their little party.
| Process | Energy per particle interaction |
|---|---|
| Chemistry | ~1 eV |
| Nuclear fusion | ~20000000 eV |
| LHC collision | 7000000000000 eV |
Of course there can be quite a few protons spinning around the LHC at one time, and though only a few interact each time the bunches cross, we can wonder how much total energy is in the beam. This is important for two practical reasons that have nothing to do with the science:
- What would happen if the beam were to somehow go astray and hit the beam pipe and surrounding apparatus?
- How can we safely remove the beam in the normal course of work?
The short answer to the first question is pretty simple: bad things. The beam can punch through 2 meters of solid copper [slides 23-25]. But, it should be noted that it is essentially impossible for a person to be hit by a beam, even if they tried. This is because the beam travels in a vacuum pipe that does a very good job of keeping air out, not to mention human hands. In addition, no one can get anywhere close to tunnels with active beam without breaking safety interlocks that cause it to be dumped immediately. The danger is really only to the equipment. Of course they found exceptions to this in Soviet Russia.
When it’s time to inject a fresh beam of protons or the beam must be removed quickly for safety it is diverted toward a very large chunk of carbon that is liquid cooled and shielded in a 1000 tons of metal and concrete. A nice article about the beam dumps can be found in IEEE Spectrum.
So, to the energies…
| Energy | Amount | Notes |
|---|---|---|
| Energy in a head-on highway collision | 1 MJ | cars each 1 metric ton moving at 115 kph |
| LHC: Energy in one beam | 173 MJ | 2808 bunches, 1.1×1011 p/bunch, 3.5 TeV |
| Energy in chocolate consumed by two Swiss people per year | 244 MJ | 22.4 lbs of chocolate / year / person in Switzerland |
| Energy required to melt 1 ton of copper from room temp. | 620 MJ | Wikipedia: 63 g/mol, 24 J/mol/K, 13 kJ/mol |
| Kinetic energy of freight train moving at 60 kph | 1400 MJ | 100 cars, 100 tons each |
| LHC: Energy in the ATLAS’ toroidal magnetic field | 1600 MJ | source: ATLAS e-News |
| Chemical energy in 1 metric ton of TNT | 4600 MJ | Wikipedia: Trinitrotoluene |
| LHC: Energy in the magnetic field of all the LHC dipoles | 11000 MJ | source: slide 12 |
| Chemical energy in 1 metric ton of dark chocolate | 24000 MJ | USDA: search for ‘chocolate 60-69%’ |
You will notice that for all this crazy amount of energy in the beam (almost 200 car-accidents worth) there are even bigger energies lurking at the LHC. The magnetic field of the ATLAS toroid stores 10 times as much energy, and 10 times beyond that is the energy stored in all the LHC magnets. In fact, the average pair of Swiss people consume more energy every year in chocolate than our measly beams can provide.
(One thing I love about these numbers has nothing to do with high energy physics: you might have been surprised that there is over 5 times as much energy in chocolate as there is in TNT. What is important about an explosion is not as much that a lot of energy is released, but instead that it is released very quickly.)
Collisions imminent
5Howdy lovers,

Well, today’s the day! The LHC people have decided, along with all the experimenters, that it’s time to collide some protons at 7 TeV. Actually, the hoopla was originally scheduled to start this morning at 09h00 (CERN time). That plan was amended several times, so that physicists I talked to all had different ideas of the actual start time for colliding the beams (I heard 03h00 at some point). The initial attempts this morning to ramp the beam have both failed due to unforeseen errors in the quench protection system (QPS) and some other electronics, but they’re now saying they expect beam (and collisions!) to be ready around noon or 13h00. So, that means that our early risers in the US might be privy to all the good shit.
For your viewing pleasure, we’ve compiled a list of links to various webcasts broadcasting the day’s activities:
- LHC First Physics Webcast (be sure to click around to the various webcams, at the bottom of the page)
- Our beloved OP Vistars (Page1 is often the most informative)
- CMS cameras: One Two Three
- ATLAS public page, home to a nice feed and some pretty pictures
- ATLAS event displays
- A pretty informative CERN Twitter feed
- The LHC Announcer (this dude talks to you about the LHC activities)
So, click away. We’ll try to keep you updated, maybe copying some of the pretty photos of the day here for you to see. Let us know if you find other interesting webcasts to link here, either by commenting or by e-mailing dipole@cernlove.org.
Happy collisions!
UPDATE: We have collisions! At 13h22, the LHC people declared “STABLE BEAMS,” and we’ve been seeing 7 TeV collisions ever since. The press release is here, and the champagne is everywhere.
LHC Update – March 2010
3Some of our readers not plugged-in to the everyday scene of physics at the high energy frontier might be confused remembering that we promised you some bad-ass proton collision action somewhere around 14 February, which was over a month ago, and realizing that, indeed, the beloved 7 TeV data is still nowhere to be found. In fact, the media has been so focused on the 1-year shutdown expected for the LHC in 2012 (and seriously, it’s not because of the Mayan calendar…) that no one has really posed the obvious question: “Umm, hey… wasn’t there supposed to be stuff happening already this year?”
Have no fear, friends. Your friendly LHC scientists are simply making sure they are working with a well-oiled machine, and these kinds of delays are completely normal. January and February were used for commissioning the machine at low current, and further developing the Quench Protection System (QPS); here’s a nice article by SymmetryBreaking giving some more information about the LHC’s QPS. Having a robust protection against accidents such as the one in September 2008 is clearly a high priority. Beam was re-introduced to the LHC a few weeks ago, and the progress is steadily imrpvoing, however carefully the technicians are working.
Tonight is a special night, however. For the first time in 2010, we are witnessing the LHC dry-ramping* to the current which corresponds to a 3.5 TeV proton energy; this is the target energy for collisions in the 2010-2011 run. Of course, live coverage is brought to you by OP Vistars. In case you missed it, here’s a snapshot in the early stage of the ramp.
(*Dry-ramping implies the current in the magnets of the LHC are being ramped up, but that there is no proton beam circulating at the time.)
We here at CERN Love are as giddy as schoolgirls about this.
Where are my robot hands?
1Earlier we discussed the LHC’s current robot monorail, little TIM, but 30 years ago CERN had far loftier goals and they were all about getting grabby. What follows are some photos grudgingly requinquished by CERN’s document server. The first one is my favorite, because this fellow is clearly living the 1981 dream.
Ever wish you could just shoot your arms through an iron-impregnated concrete wall and shake some sense into that radioactive pressure vessel on the other side? In 1981 you could.
The robot arms were eventually upgraded and attached to both monorails and trucks tethered by umbilical cord. “MANTIS’ as it was known, has more photos in CDS. You can also read more at “MANTIS – a compact mobile remote-handling system for accelerator halls and tunnels”, “MANTIS 2 : a new long range remote vehicle and servo-master-slave manipulator for the CERN accelerator complex” and “Teleoperator evolution at CERN”.
Reading some of those documents, MANTIS sounds like a really handy guy. Maybe that is why he was eventually incorporated into the military-industrial complex; given complex reasoning skills; and, through some fortune, jolted into a zest for more than just the life of a radioactive science-slave or autonomous killing machine. CERN was the crucible in which was forged one who “is alive”, a crafty, cultured cowboy. We miss you, Johnny Five!
Spares
0The LHC will employ the use of 1,232 dipole magnets, which are cooled to superconducting temperatures by liquid helium at 2 Kelvin and will provide magnetic fields as strong as 8.33 Tesla. As one might imagine, these puppies are valuable. To string two of them together, without interrupting the circuits through which currents as high as 11,850 Amps will flow, requires a highly sophisticated splice mechanism which must have a resistance of less than 0.000080 Ω for the machine to work properly.
Otherwise, this happens.
Of course, since CERN decided to display these magnificent beasts prominently (including one proudly and boldly showcased on the otherwise beautiful green lawn outside CERN’s Restaurant 1), they had to find a way to protect their valuable end-connections. These are the blag end-plugs you see in this photo of the lawn dipole.
Well, I suppose CERN had a spare endcap. I would never have been creative enough to devise this plan for its fate.
It really ties the room together.
Billion dollar seismograph
1While the LHC is temporarily shutdown in preparation for more collisions in February, in the US the Tevatron collides away, cranking out top quarks, and collecting new data every day. Here’s an interesting tidbit: the tolerances of these accelerators are so tight that they make pretty good earthquake detectors. While the Tevatron was running a few nights ago the tilt sensors recorded the earthquake in Haiti happening 1800 miles away,

I’m down with OP V
3Well, the holiday season in Geneva is certainly getting off to a festive and boisterous start. From the pretty lighted trees by the lake to the yet-to-be-seen-illuminated Christmas lights in St-Genis-Pouilly, it’s clear that it’s time to get our “fête” on. Even more notable, the LHC has given us physicists an early present or two.
Needless to say, the past 10 days or so have been quite titillating at the lab. Thousands of e-mails have been exchanged, hundreds of plots have been generated, and many million cups of coffee have been consumed. As we “ramp up” for the next few weeks of beam and commissioning before CERN becomes a ghost town, I feel like it’s important to share with you, our devoted audience, a little taste of the magic.
Of course, it’s impossible to stay in the control room for one’s experiment 24/24 (or, for you ‘merkins, 24/7). So, the friendly guys down at the CERN Control Centre (CCC), the control room for the LHC, have created a web-based resource which one can use to receive up-to-the-minute updates on the status of the LHC proton beams. My friends, I present to you OP Vistars — Page 1:
If you’d like to check in every once in a while yourself, click here.
This page is a nice way to be kept in the loop about current activities along the LHC as well as its four experiments. Pay special attention to the ‘Comments’ box in the bottom left. This usually gives a good description of the plan for the immediate future. On the top, one can get some crucial beam information, including the number of protons per bunch in an LHC beam (denoted with an ‘I,’ shown for both beam 1 and beam 2), whether or not there is beam circulating (the two big green BEAM indicators), and the beam energy. The beam which was circulating for the example image was characterized by a proton energy of 450 GeV, which is equivalent to their energy at injection. Injection is quite a tricky process, and it occurs at points 2 and 8 along the LHC (hence the TI2 and TI8 acronyms).
When you really start to think about it, though, this is a masterfully designed, albeit mysterious, piece of internet. Actually, many of the individuals who gaze at this site for many hours a day are perplexed by some of its most prominent features. But the colors sure are nice! As an example of our confusion, in a survey of some 20 ATLAS physicists (my colleagues), I found that exactly 0 of them knew what the shit was going on in the four plots found in the middle of the screen. Noting the x- and y-axis labels, one might suspect that these should be showing the beam position in the x-y plane (and the left-most plot supports this), but nothing about plots (b)-(d) suggests this at all.
The ATLAS run coordinator is reputed to have said that, when one of these plots is shaped like the second plot above, the LHC is operating as a fixed-target collider interacting with someone’s head. I highly doubt it, Christophe.
Perhaps the most elusive question, however, is the following one: Does anyone know what the fuck “OP Vistars” means?
“F-you” plot
0My wife was peering over my shoulder while I made some plots yesterday,
Wife: What’s that?
Me: Some of these plots are screwed up, I need to remake them.
Wife: It looks like it’s flipping you off.
This is the life of a high energy physicist: making plots, then figuring out why they seem to hate you so much.
(I picked a simple example here. It didn’t take me long to figure out that I was plotting the track eta of photons. Problem: photons don’t leave tracks. Nearly all the photons get the default value of 0. Solution: don’t be a dumbass, plot the calorimeter eta of photons.)
Collision time
0This is a very quick update on the LHC status. About two hours ago they had both beams circulating and crossing at the experiments (see for example the CMSexperiment tweet). The experiments haven’t officially announced any collision events, though it is possible they have been recorded. If I hear more I’ll update.
For links to many different sources of up-to-date information see the “Beam time” post.
This is a nice milestone, but it should be noted that for now the beams are only at injection energy. This means that protons are accelerated to 450 GeV by a smaller (though still very impressive) accelerator, the Super Proton Synchrotron (SPS), and then are allowed to just coast around the ring of the LHC. This is about half the energy of the Tevatron at Fermilab.
Update: event displays from the first collisions are now public. There was a press release and a press conference. I’ve attached some ATLAS event displays.
Beam time
1Hey LHC lovers, does something feel freaky déjà vu-ish? Hardware commissioning of the LHC officially completed two days ago. We are on the eve of the first circulating beam. They might even spit some protons around the full ring tonight. If only this wasn’t so familiar.
I have some sad news: Tom Hanks will not be the master of ceremonies for this show. But, I will give you a few resources with which to bring the party home. You just need to provide your own big red button and Bosom Buddy. I’m sure it will be awesome. Note: we here at CERN Love take no responsibility for what you do with this information.
LHC information
- Commission schedule and updates
- News
- Monitoring – these are the high level monitoring screens that you might see around CERN. Be sure to try all the options in the top-left pull-down menu; if you like obscure acronyms, colored indicators, and mysterious plots then you will be in heaven.
- Cryogenics history (buttons on top select a sector with more details, buttons on bottom select time frame)
- CERN on Twitter
Experiment information
The reality is that the LHC experiments won’t be pushing to the frontier of knowledge, let alone creating wormhole portals to alternate dimensions, for at least another year. For now the goal is just to test what we can of the detectors and hopefully create some dramatic renderings usings beam splash or beam halo events (hopefully updated soon).
- LHCb public web page – detector status (try Page1 or LHC status)
- Alice public web page – detector status
- ATLAS public web page with detector status and live events — web cams
- CMS public web page — web cams — twitter
Updates: removed ATLAS live event link (it seems you need a login now), added twitter links, added cryogenics link, added CMS beam splash image.
“I can’t. I have shifts…”
1You thought that it was extravagant, the life of a particle physicist at CERN. You thought that daily life in Geneva was chock full of fancy watches, lavish cars, endless mounds of fondue, and the best croissants money can buy. You thought that the work being carried out here at the lab was nothing if not the most pertinent and revolutionary. You thought, “Man, I’d give anything to work at CERN.”
Think again.
Picture this: 50 sq. meters, 60 computer screens, and the guarantee that you’ll be spending the next eight hours of your life holed up here. Tonight, you are on shift. Tonight, from 11pm until 7am, you will be devoting your time to making sure that the detector is functioning properly. Don’t get too excited about this — you won’t actually have any control. Actually, if some component of your system enters a FAIL state, there are only a few options you have before you have to call a detector expert. None of those options will work, I guarantee you. So, you’ll call the Expert. And, no, she won’t be happy to help you, now that it’s 2.17am. But, you’ll survive.
Then, around 5.27am, you’ll grow tired of nodding off at your bank of PC screens. You’ve been keeping an eye on the detector (it’s fine), keeping an eye on the data coming from the detector (it’s fine), and keeping an eye on that cute girl working a few desks away (she’s fine). But, it’s all you can do to stay awake, so you have to pull a lifeline. Coffee sounds nice, so you head to the nearest coffee shop, two floors above you. Shortly after struggling your cup free from this machine’s deathgrip, you’re well on your way to an ecstasy-laden morning. Best. Coffee. Ever.
At the end of your grueling eight hour shift, you can hardly remember why you had such adverse opinions about the job. One night of pretty boring nothingness (plus a few calls to your favorite detector experts) is hardly worth quitting over. But, then, you remember: this happens again the next night. And the next. Night shifts always come in 3′s…just like the best things in life.
In actuality, being on shift at CERN is a rather important task, and it’s a great way to contribute to the various experiments conducted on the LHC. But, I mean, come on…
Okay, it’s not the worst job; it’s second only to the job of an Expert.
If you’re still interested, and want to live alongside some other shifters, have a look at these webcams:
Also, it’s important to keep in mind that even Tom Hanks has been on shift.
ROOT rants: histogram hierarchy and a little PyROOT
2I was doing some Google searching a couples days ago looking for answers to a ROOT question–I have a new one every day!– and I stumbled on a very nice rant about ROOT. It mentions the ugly default plotting style of that was the focus of my last post, and it hits on many points I would have made myself.
Sorry, if you don’t have any programming experience this post might be too technical. If so, may I instead offer you a large man on a small vehicle?
One thing I really liked is the comment about the crazy inheritance: how a 2D histogram (TH2) inherits from a 1D histogram (TH1). The reasoning for the ROOT authors seems to be that a 2D histogram can be thought of as a long 1D histogram “rasterized” onto a 2D field. In this (convoluted) way, the 2D histogram is a specific type of 1D histogram. But, as the author of that University of Minnesota page notes, there is no reason not to think of the relation going the opposite way: a 1D histogram is just a 2D histogram with only one bin in the second axis. And, this second relation seems a whole lot more obvious and fundamental. The structure the ROOT authors use doesn’t hurt them too badly because in reality most of the operations on histograms happen bin by bin. The implementation of an n-dimensional array very well may boil down to a 1D array; but, are we really doing the user any favors here?
With a TH2 inheriting from a TH1 certainly you would assume there is one advantage: the TH1 class won’t be cluttered with nonsensical methods like GetNbinsY() or GetYaxis(). Of course you would be wrong, just check it out. In fact, given the structure they’ve ended up with, I’m having a hard time coming up with a reason why they even need separate classes for 1D and 2D histograms.
And while I’m still speaking of histograms, the profusion of varieties must be noted: TH1C, TH1S, TH1I, TH1F, TH1D. When I first started using ROOT and hadn’t yet carefully read the documentation I assumed a TH1I would be used to histogram an integer valued parameter, in other words the x-axis would take integer values. Though most parameters we work with have continuous values, counts (usually called “multiplicities”) such as “how many electrons with energy greater than 10 GeV were in the event?” are also very important. Thus histograms over integer values would really fill a need. Of course, this is not what ROOT provides: all a TH1I does is promise to store each bin value (the number that defines the y-value on the graph) as an integer. This doesn’t change the fact that a TH1I can only be Fill()ed using a floating point weight. The Fill() method, and nearly every other method on this class, is defined generically using doubles in the TH1 parent class. Strangely, the functions for requesting a bin value are implemented in the integer specific TH1I class, so you might think that at least they would do the sensible thing and deal only in integers. Instead, the integer stored internally is cast as a double before being returned. As far as I can tell, there is no way to get unadulterated integers, that you know must be in there, out of this class. One might wonder if the different histogram varieties just offer different storage sizes, but then sizeof(Int_t) == sizeof(Float_t), so it’s unlikely. Maybe there is a slight speed advantage when incrementing (though it is hard to imagine this is an issue with any processor having a dedicated floating point unit, taking us back at least 20 years)? I don’t know, I give up.
I think this is enough ROOT ranting for now. Possible topics for a further post
- How histograms and TTrees are owned by the directory they are created in (whereas similar objects like graphs are not). When you are new to ROOT this is guaranteed to lead to mysterious segmentation faults.
- Code that runs without errors or warnings in both compiled and interpreted modes, but produces different results.
- The vector classes: why does the 2D vector have to use
Mag()while the 3D vector usesMod() - Painful limitations to using STL classes like
std::vector<>in interpreted mode. (The reason I gave up on doing any substantial work using interpreted ROOT code.) - Horrible crashing that refuses to let you quit even with
Ctrl-C.
Oh, and regarding my recent issue that lead me to Google for answers: I’ve been using PyROOT a lot lately, but the underlying C++ bites you in the ass now and then. One issue I ran into is functions that modify values passed by reference. Python was designed to avoid this sort of thing, at least for the fundamental types, and so you have to do some annoying array('i', [0]) machinations just to pass a reference to an integer into a function. Thankfully this doesn’t happen often, and it turns out the ROOT manual does explain the work-around well enough if you look in the PyROOT section [PDF] on TTrees. (Instead of a TTree, I was actually trying to use TColor::HLS2RGB(), mostly foolishly, I must say.) On the whole, though, I would highly recommend PyROOT if you are doing anything high-level like making plots and you have to use ROOT.
The ROOT of all my frustrations
12If you work in high energy physics (HEP) you almost certainly come in contact with some software called ROOT on a very regular basis. ROOT is a collection of tools and a framework of C++ classes developed at CERN specifically for the data collection and processing that many physicists perform. It defines a “Tree” format designed specifically for HEP data (the name is a play on the name ROOT and not much of a tree in the classic algorithms-and-data-structures sense), it produces nearly all the plots that we show each other at meetings, and it provides a C++ environment that can be used both interactively and compiled. (There is also a Python interface which I actually use more often these days.) If you use something every day you are bound to become frustrated with it in some way or another. Unfortunately, ROOT’s annoyances are very pernicious:
- Its default behavior is to produce hideous plots, and
- Every now and then you can come up with the simplest of goals (something such as “set the color of these histograms to red”) that teases you with the prospect of an easy solution but instead sucks you into a whirlwind of failure that invariably transports you to the colorful land of the ROOT source code where you search for a way home skipping from function call to function call until you find the solution didn’t make any sense at all but was right in front of you the whole time. If you are luck enough to reach this point it is probably 4am.
These issues frustrate my personality especially because
- I’m particular when it comes to aesthetics, and
- I’m a stubborn optimist always willing to stay up just a little bit longer.
This post will feature a couple examples of item 1, but the infinitely long scroll of bits that this blog could fill is just barely long enough for the further rants I may produce.
Below is an example of two fitted histograms. The left is a plot drawn with the default style and the right is using the “Plain” style. There are two main issues with the default style: the uniform gray background makes it an eyesore on almost any white page or white presentation background, and the last time the chamfering and shadow effects were cool was back in 1995. I have seen no circumstance in which the “Plain” style on the right wasn’t a clearly better choice.
What’s madding is the Plain style can be enabled with one simple line of code, and yet after I started using ROOT every day and was immediately struck by these offensive plots I went months between the stages of realizing
- The backgrounds of my plots are not just a stupid mistake on my part;
- I can fix this with five lines of boilerplate code at the top of all my programs;
- I can put this code in a configuration file that appears in every directory where I run;
- I can set a ROOT path and put this code in a single configuration file for my entire login session; and finally,
- That there are perfectly good styles build into the code called “Plain” and “Pub” that setup every as you wanted it to begin with using a single line of code.
These days when I see a presentation with these ugly gray backgrounds I presume the presenter has either not been using ROOT for very long (at least not long enough to produce a publication, since no publication would accept such plots), or they are still on stages 2 or 3 and the plots where made in a hurry. Both of these scenarios are common.
What’s even more maddening is that I didn’t reach stage 5 by reading the documentation, which really needs to begin with
In order for your ROOT plots to not suck be sure to set a Unix.*.Root.MacroPath: in your ~/.rootrc file and then add gROOT->SetStyle(“Plain”); to a rootlogon.C file somewhere in this path.
Admittedly, this style setting stuff is in the documentation, but a section called “Create or Modify a Style” is not one you would read too carefully when you are rushing to make plots for your next presentation. Instead, I came upon the “Plain” and “Pub” styles by finding them in the source code while on one of those lovely journeys mentioned in item 2 of my opening.
Finally, here is another example of crap that ROOT gives you by default. It’s possible the default plot offers some advantages to those who are color blind or to those who are 13 years old and are really trying to piss me off, but otherwise why? Why?
Mr. Electric Brushy Bear
0Science doesn’t always take place in a circle of fawning women as you tune up your Tesla coil. Sometimes there is nothing to do but sit in nature’s ventilation hood (“outside”) and scrub critical high voltage boards with acetone. But sometimes the novelty of nature and the sweet caress of solvent fumes is not enough to take away the tedium of scrubbing hundreds of boards. This is where one needs a carefully selected tool to maintain the highest scientific standards while at the same time speeding your work along.
Case in point: Mr. Brushy Bear. This cute guy (you’ll probably need to click and look closer at the photograph) brings happiness while his little condiment-colored motor does the work for us. Isn’t science great!




















Feedback