It's the morning of Thursday, Aug. 24. The Chicago Cubs are more than nine hours from taking the field for the finale of their three-game series against the Reds.

In a hotel suite high above downtown Cincinnati, Joe Maddon -- dressed in an orange pullover, with a pencil and his morning coffee sitting next to him and light music playing in the background -- sits down at a conference table and pulls open the program Good Notes on his iPad to produce his lineup for the night ahead.

For a man who has concocted 112 different batting orders this season (excluding pitchers), the game-day ritual is not a quick exercise -- though the information available to Maddon streamlines a process that used to take "four-five hours" for managers when he was a bench coach.

Maddon invited ESPN.com to his room to watch the lineup-building process unfold.

How the process begins

Some of Joe Maddon's lineup decisions might leave fans scratching their heads, but there is a reason behind every choice the Cubs manager makes. Jesse Rogers/ESPN.com

"Today's lineup actually starts the day before," Maddon begins. "On the right side here [pointing to his iPad, where Wednesday's lineup is written on the left side], I'll write down who's going to play the next day."

The day before, Maddon fills out a grid of his starting nine, without a batting order, on the right-hand side of the iPad. In this case, he left question marks at third base, as Kris Bryant was injured in the first game of the series and Maddon wasn't sure if he would play in the finale. He color coded different sections on the page; these names are in white.

For Thursday's game, Maddon wrote in the names Schwarber, Happ and Heyward across the outfield. Then he put a question mark at third base, followed by Baez, Zo (Zobrist) and Rizzo in the infield and Rivera behind the plate.

This information is given to first-base coach Brandon Hyde and bench coach Dave Martinez after Wednesday's game, so players know if they're starting the next day. Where they bat isn't decided by Maddon until now, Thursday morning.

The obvious choices

Ian Happ batting fifth might've seemed surprising when the Cubs lineup came out, but the move worked out in Cincinnati. Courtesy of Chicago Cubs

The Cubs are facing rookie righty Sal Romano, who has never pitched against them.

Maddon begins writing down the above names, using different colors. He starts at the top of the lineup.

"Zobrist is a switch-hitter, so he goes in red," Maddon says. "Among all these guys, because Jon Jay is not in there, he has the best ability to see a pitch, work an at-bat, etc. Plus, it starts this back and forth [lefty/righty] that I like. So Schwarber is next in blue because he's a lefty. Black is right-handed, so then comes Bryant."

Maddon writes Rizzo's name in the cleanup spot but then jumps down to Heyward batting seventh.

"I like Heyward in the 7-hole. He's been really productive," Maddon says.

Now the fun begins

With the easiest calls out of the way, he has some decisions to make -- beginning with who hits behind Rizzo.

"I think a good spot for Happ is going to be in the 5-hole," Maddon says. "Our geeks really like him today versus this pitcher. The 'cocktail' projects Happ well against this pitcher."

The "cocktail" Maddon refers to is the Cubs' own formula to measure their players and the opponent. The manager has a small grid at the bottom right corner of his page given to him by his numbers people in the front office.

"This is reflective of our information," Maddon says. "The number itself is an accumulation of different items we put into it. That's our own little cocktail. And part of the original concept is to make it .300 still a good thing and .200 still a bad thing. So your mind still works in that way."

No number reflects an actual batting average or any stat fans would easily recognize; the cocktail is mixed, so it spits out something Maddon can interpret right away. A .300 doesn't mean a .300 average, but it still means something good. Based on this information, Maddon writes Happ's name in the fifth spot in red (switch-hitter).

"He was going to play anyway, but I feel really good about him there, based on the projection of this pitcher," Maddon said. "That's kind of an asterisk or highlight from the geeks today. Happ projects well against this pitcher."

A reminder: Maddon said this about Happ at 10 a.m. local time. Hours later, the rookie belted Romano's first pitch -- a 94 mph four-seam fastball -- over the right-field wall. The geeks were right on the money.

"Our geeks really like him today versus this pitcher. The 'cocktail' projects Happ well against this pitcher."

That's not to say it always works. Later in the night, the Cubs played pinch-hitter Jose Peraza shallow and shaded to right field -- and he drove a ball deep to left-center to help win the game for the Reds. In any case, the formula spit out a potential good at-bat for Happ against Romano, and it worked to perfection.

With the rest of the lineup in place, Maddon decides to move Baez up from No. 8 to No. 6 -- mostly because Maddon has his weaker offensive catcher starting, the recently claimed Rene Rivera. He bats eighth after Heyward, who is followed by starter Jake Arrieta.

"I've gotten away from the pitcher in the 8-hole," Maddon says. "I'm liking how this is playing out well."

The power of technology

As Maddon mulls over his batting order, he wants a second look at Romano. At the touch of his fingertips, on the iPad, he can bring up stats and video of just about anything he needs. He can instantly see the recent trends from opposing pitchers. Maddon looks at the past seven days, then 30 days and notices how the Reds rookie pitches against different parts of a lineup.

Finally, Maddon decides he wants to see parts of Romano's last game in which he gave up five hits. Maddon punches a button, and videos of all five are played consecutively.

"It helps me round it out mentally, especially a guy I haven't seen before," Maddon says. "[Albert] Almora isn't a bad matchup for this guy, but I'm not starting him today."

As video of the young Cincinnati pitcher plays in front of his eyes, Maddon sees something interesting and files it away for later.

"You get these tidbits, and I can mentally paint a picture," he says.

With the night's lineup now set, the left side of the Good Notes page is Thursday's batting order. At the bottom of that side, Maddon writes his own pitchers for the next four days "just to keep track." The bottom right is his proprietary information -- a series of statistics available with just a glance at his screen -- and above that, the process for the following day begins as he starts the grid for Friday's game in Philadelphia -- minus the batting order, of course.

"With this thing, I don't need to be at the ballpark way early," Maddon said. "I have everything I need to see, including all the video I need. ... Just imagine 15-20 years ago: I'm sitting here in the same room [and] I have a laptop, but none of this is available to me."

The finishing touch

Maddon hits save on his page. He types in the first name on a group email in which he'll send the lineup, and the whole group shows up: front-office personnel including Theo Epstein and Jed Hoyer, Cubs PR and first-base coach Brandon Hyde get the email late in the morning. Hyde then sends a mass text to the team so everyone knows the batting order before getting to the park.

"Then I'll export the page to our group," Maddon says. "I like to include something in there as well: a saying or a picture or an article or something. Today, I'll include a picture, but I won't say who it is. Let's see if they know."

Being on the send list for Joe Maddon's lineup means receiving the day's batting order -- and knowing to be on alert for Maddon's daily attachment, which could be anything from guessing this president to motivational reading. Bachrach/Getty Images

The picture is of former President Lyndon Johnson. Later, Hyde is asked if he knew who it was.

"I never opened the picture that day, only the lineup," Hyde says with a laugh. "But I would have known. Joe likes to send articles or off-the-wall pictures or stuff from his hometown. Almost never about baseball."

Maddon does all this baseball work on his tablet from his hotel room, but he used to do it mostly by hand as a bench coach. Before he became a manager, he wanted to define what a bench coach's job consisted of and figured giving his team an edge in any way possible was paramount.

"Prior to each series, I would print out each chart for each player, then scan it into my computer," he says. "Three players per sheet. ... I really liked looking at 'action' pitches. When something would happen in an at-bat, then I could position my defense accordingly. It was a lot of work. Now I have all this to use.

"When I do crazy s--- now, it's rooted in something I've seen, and I have the numbers."

With that, Maddon turns up the music, takes a sip of his coffee and hits send on his iPad. His work is done until he leaves for the ballpark.