Exactly two weeks after terrorists ambushed New York and Washington, killed more than 5,000 of us and changed everything, and nothing, Aaron Sorkin, creator of ''The West Wing,'' leans anxiously against a long table filled with actors and production assistants. This is the high-tech briefing area where the show's main character, President Josiah Bartlet, huddles with the military brass when make-believe blips on the radar grow alarming. In the conspicuously insider patois of the show, the space is called ''The Sit Room,'' and this is roughly the situation: for the last two years, ''West Wing'' has become one of the most popular shows in America because, among other things, Sorkin has been able to give his kinder, gentler, nobler White House enough verisimilitude to seem tantalizingly possible. ''The only reason it's not 'Touched by an Angel,''' Sorkin says, ''is that it imitates just enough the sounds and appearance of reality. And the way I do it is by saying words you don't normally hear on television shows, like 'Democrat' and 'Republican,' and having the place look real and the hardware look real and abbreviations be right. If I can do just enough of that, then hopefully we're on board.''
To maintain his elusive parallel universe, one that feels contemporary but is also impossible to pin down in time, Sorkin employs a half-dozen former high-ranking politicos and keeps a close watch ''on the dials and gauges.'' To come up with the four or five story lines the show burns through each episode, the staff reheats old issues from the archives or imagines something plausible enough to have actually happened. What they do not do, however, is dramatize recent headlines. They try to never mention any president after Eisenhower, and according to a co-executive producer, Kevin Falls, who runs the writers' room, ''When we talk about the Kennedy Center on 'West Wing,' we're referring to George Kennedy.''
But on Sept. 11, the world lurched violently in one very particular direction, and producers, who had already shot the first five episodes of their third season, were in a quandary. Sorkin became convinced that his show's subtle connection to reality had been severed and that unless he could find a way to let viewers know that his characters had suffered the same trauma as everyone else, the show would forever clink hollow.
''We have these eight characters who have been our friends for two years, and we want them to live,'' Sorkin says. ''And in order to do that, they have to bow their heads for a moment to what concerns the rest of the world. Once we've done that, it will give us permission to go back to telling the kind of relatively trivial stories I like about the N.E.A. and soft money and big tobacco.''
Less than a week before the scheduled broadcast of the splashy two-part season premiere, Sorkin began writing a new episode that for the first time directly addressed the news. And he insisted that the premiere be delayed so that this new stand-alone episode could run first as a back story for the whole season. Because of all the time and money that had already gone into promoting the original premiere and the fact that NBC could only charge advertisers half price for time on the rerun they had to air instead, the network's decision to accommodate Sorkin was a $10 million act of largess, proffered to a man who barely four months before had been arrested at the Burbank airport with a carry-on bag containing marijuana, hallucinogenic mushrooms and crack cocaine. And Sorkin, who was in rehab six years before, admitted that this was not the first time he had fallen off the wagon.
Sorkin listens through headphones as Richard Schiff, who plays Toby Ziegler, White House director of communications, struggles with his speech about the history of terrorism, trying to explain how teenagers in the 11th century were tricked into committing heinous acts of violence by being drugged with hashish and taken to a staged paradise stocked with concubines. As the speech is ending, Ziegler's deputy, played by Rob Lowe, enters and caps the scene with one of Sorkin's characteristic over-the-top verbal flourishes: ''Ahhh, temptation I have seen thee and thy name is woman.'' As he listens and watches, Sorkin displays a level of anxiety appropriate to the occasion, although it is no higher or lower than what he radiates every waking moment.
Sorkin, 40, is rabidly unhip, and not just in the way he dresses, which today is like a middle-school student. He talks too fast and too urgently, as if he is on trial and every moment might be his last chance to testify in his defense. He eats too voraciously. He tries too hard. And while all these things make him likable, his saving grace is that he listens hard too.
As Sorkin strains to compare Lowe's delivery with the beats he heard in his head when he wrote the words, he taps one foot spastically and works the muscles around his mouth as if he is trying to dislodge a bit of food. His cheeks are shaded with stubble, and his eyes are sunk deep in his head behind graying Stephanopoulos-like bangs. He says he has the flu. He feels clammy.
There is a break in the shooting, and Lowe, whose character is addressing a group of brainy high-school students who have won a visit to the White House and find themselves stuck in the kitchen when there is a security ''crash,'' steps off the set to confer with Sorkin. Lowe wears a white dress shirt and dark slacks and seems to have been painted in black and white with just a touch of red in the cheeks. According to Bradley Whitford, who plays Josh Lyman, the deputy chief of staff, considered by show insiders to be the voice of Sorkin, ''I think Aaron would like to have my character's job and look like Rob.''
Sorkin gives Lowe a couple of notes: ''You don't have to be so somber and funereal. It's not a wake.'' He snaps his fingers to demonstrate the brisker delivery he has in mind and adds: ''You're smart. You know these things. Here they are.''
Soon after Lowe leaves the set, there is a stir as two real-life Hollywood generals -- Jeff Zucker, the president of NBC Entertainment, and Peter Roth, the president of Warner Brothers Television, both clad in black -- step into the Sit Room. In defiance of the current Hollywood dictate that people act as though everything they do is suddenly irrelevant, the baldheaded Zucker, who was in his dermatologist's office in the Empire State Building on the morning of Sept. 11 -- When the second plane hit the tower, I was out of there'' -- is openly jazzed.
Squeezing his tiny palms together and shaking them loosely at the wrist as if rattling lucky dice, he extends to Sorkin that particularly hospitable strain of Jewish anxiety that says, ''Isn't it a privilege and a joy and a disease to be doing something that makes us so uptight?''
Sorkin, bobbing his head and smiling maniacally at the floor, confesses to Zucker that he is sure the episode will be a colossal disaster. (When it is broadcast eight days later, the critics will essentially concur.) But Zucker, who never thought the episode was even remotely necessary, with all the numbers showing that Americans were flocking back with relief to the safety of their belovedly familiar TV worlds, and yet obliged him anyway, shushes him.
''You're crazy -- it's going to be great,'' Zucker says. ''It's going to be landmark television.''
Then Zucker purses his lips and makes another giddy little move with his hand, sending it diving off his right shoulder. The gesture manages to simultaneously convey someone heroically taking off into the stratosphere and stepping blindly off the edge of a cliff.
Fifteen years ago in a small Manhattan apartment, Sorkin, an underemployed actor whose closest thing to steady work was occasionally touring small Southern towns with the Traveling Playhouse and who had never considered writing anything other than ''a chore to be gotten through for some class,'' fed a blank sheet into a friend's throbbing I.B.M. Selectric. Four and a half pages later, he had a journalist named Shepherd throw down in disgust the script he had been given by his actor friend Danny and launch into a wordy speech about ''why you can't write about a bunch of actors in the South playing poker on a hot summer night just because it really happened.''
As he tapped out the dialogue, Sorkin, whose older sister and brother are both lawyers like their father and who, growing up, always considered himself the dumbest person in the room, says that he ''felt a phenomenal confidence and a kind of joy that I had never experienced before in my life.''
Around that time, maybe a year later but it might as well have been the end of the same night, Sorkin started experimenting with marijuana and cocaine. Later, a friend instructed Sorkin how to cook cocaine powder with baking soda and water, stick it in a pipe and smoke it. The result, he says, ''was that I found a drug I absolutely love and that gave me a real break from a certain nervous tension that I kind of carry with me moment to moment.''
Both writing and freebasing have proved devastatingly addictive to Sorkin, and since those fateful nights, Sorkin has never stopped doing either for very long.
It took Sorkin four and a half pages to find his voice and three plays to find his commercial groove. His third play, ''A Few Good Men,'' whose percussive courtroom exchange (''I want the truth.'' ''You can't handle the truth.'') has left a stubborn ding in the culture, was bought for the movies by the director Rob Reiner before it reached Broadway. Leftover bits from ''The American President,'' the second script he wrote for Reiner, became ''The West Wing,'' a show that won nine Emmys last year and attracts upward of 20 million viewers a night. If Sorkin can keep it going for a couple of more years, the series will earn him hundreds of millions dollars in syndication fees. In the last three years, he has written every buffed and burnished word of dialogue for 98 episodes of network television (including ''West Wing'' and the critically praised, though short-lived, ''Sports Night''). It may well be some kind of record.
Through all of it, Sorkin has strained to maintain some kind of coherent personal life. When he first moved to Los Angeles in 1993, he lived in the Four Seasons Hotel, where he worked on the screenplay for ''The American President.'' When his drug use became increasingly hard to manage, his girlfriend, Julia Bingham, an entertainment lawyer he met through work, helped him into rehab. Shortly after, they were married at the Four Seasons, and less than a year ago had their first child, a girl they named Roxy.
The drugs, however, never vanished from Sorkin's life, as was made clear this spring when his $4 pipe was discovered in the X-ray machine at the Burbank airport. For Sorkin, freebasing is as solitary a pursuit as writing. He says that he never does drugs with friends and that he is most vulnerable after completing a long stretch of work. When he was arrested, he was on his way to Las Vegas, where he went every six weeks or so, usually alone.
''Sometimes I like to go with friends,'' he says. ''But honestly, I just like the feeling of being myself in a very crowded place with that kind of energy.'' He would take about $2,000 in cash and play craps and blackjack. ''It wasn't Bruce Willis stakes. I'd play at the $50 table.''
He would leave on a Friday night and return the next morning. ''I kind of have a hotel fetish,'' he says. ''I love walking into a new hotel room. But then I realized every hotel room in Vegas is exactly the same, so after a while, I just stayed at the Bellagio, which is the closest to the airport.''
Sorkin says that the most humiliating aspect of his arrest was that it reinforced the exact sense of himself he has been trying to write away for 15 years. When he recalls the moments at the metal detector, his memories have a compressed hyperreality, as if the metal detector hadn't just detected the pipe but had also found him out.
''In my head, I was calm -- I wasn't shaken,'' he says. ''But my body had completely lapped my brain. I was saying to myself: This is happening. This has just happened, and now the important thing is not do anything stupid. Don't lie. Don't bolt. Don't go, 'Oh, my God, how did that get there?' But as I was saying this, this thing just started rising up from my feet. It's difficult to describe. So I just started talking to myself in my head louder. This is fine. Relax. The worst just happened, and you're still here. So I was sort of talking to my legs, but it just kept rising up and rising up to the extent that I had no choice but to lean against the metal table. The last thing I remember was hearing one of the bag-search people saying, 'Please don't lean against the table.'''
Then he fainted. The police picked him off the ground and put him in handcuffs.
Soon after his arrest, Sorkin and his wife separated. Since June, he has been back where he started, alone in his room at the Four Seasons. ''It's not the identical room,'' he says. ''But it's the identical room on a different floor.''
When I ask him why he doesn't rent a house, he says that after a couple of weeks he called a real-estate broker, who took him around to look at some rentals. ''I looked at five,'' he says. ''They were all great, and I could afford them. But I didn't want any of them. I'm just not ready.''
While Sorkin seems to derive a very similar kind of relief from writing hyperarticulate dialogue and from inhaling crack, he keeps his two worlds separate. That is not to say that he never writes about drugs. His teleplays are sprinkled with roach clips and bong pipes, and all the references are slyly appreciative. Five minutes into the ''West Wing'' pilot, a high-priced call girl, whom we will soon come to appreciate for her intelligence and strength of character, greets the day by lighting up a joint and saying: ''It's not like I'm a drug person. I just love pot.'' And in one of the best bits in two years, Bartlet, after accidentally treating his bad back with a Percodan and a Vicodin, meanders back into the Oval Office and informs his assembled staff, ''I've been seriously thinking of getting a dog.''
But the overwhelming thrust of ''West Wing,'' and of Sorkin's work in general, has nothing do with the darkness so apparent in his life or what he calls ''the whole black world of addiction.'' His show is a tour de force of Hollywood professionalism. Every piece of dialogue is spit-polished within an inch of its life. The story lines, worked over by a roomful of Ivy League graduates, land softly with just that right little narrative twist. The acting is gracefully understated, and the lighting and direction are all far better than in most movies. With references to Shakespeare and Graham Greene, visits to rare-book stores and oblique Latin episode titles like ''Post Hoc Ergo Propter Hoc,'' the show is so achingly high end that you almost expect the warning ''Quality Television'' to start flashing below the picture.
The characters themselves are just as highly produced. From the pot-smoking hooker who soon graduates from law school to President Bartlet with his Nobel in economics, everyone is brilliant -- and they're even better people. In an episode that won an Emmy last year, Toby, the communications director, arranges a military honor guard funeral for a homeless war veteran who happens to die in a coat the White House aide had given to Goodwill, one act of kindness begetting another. But that is nothing compared with what they will do for one another. When they huddle in offices or convene in hallways, Josh looks at Sam, Toby looks at C.J. and Leo looks at Josiah as if they are each other's newborns.
In fact, the only time they go slightly astray is when their Talmudic sense of right and wrong is blinded by that awful failing: loyalty. When that happens, they burn with shame, then march right back and apologize, and you can tell by the lump in your throat as you watch that they will never, ever, do it again.
It is well done, and someone has to do it, but why Sorkin? Why is this twisted, second-generation Portnoy, who has apparently seen things in his head that might have made William Burroughs wince, the one to be offering America such a glittering lie about itself? It would be one thing if Sorkin were indulging a private fascination with the corridors of power. But he has never worked on a campaign or ever felt a desire to do so. Left to his own devices, he would rather watch ''Sports Reporters'' than ''Crossfire.''
For Sorkin, subject matter is beside the point. When he started writing ''A Few Good Men,'' with its trumpeting speeches about ''code reds'' and honor and the hard choices facing battle-scarred men, he was a 26-year-old slouch who had never spent a day in fatigues and who, at Scarsdale High School, hung out in the drama club.
''Early on, like after 'A Few Good Men,' people were very surprised when they met me,'' Sorkin says. ''Their assumption was that I was a 50-year-old ex-marine who had decided to write about his experiences. And I didn't like that. I understood what they were saying : 'Boy, you've done a great imitation. You're a guy who has obviously spent a lot of time in theater and read a lot of plays and has absorbed how to sort of craft a flashy product with some snap and you can make drama happen. But it doesn't seem to have anything to do with a guy who is living in New York and is about to start a life of drugs and God knows what else and who had a strange first 18 years.'''
When I circle back, it becomes clear that the same question vexes Sorkin himself. ''Yeah, I often wonder to myself why the things I write about are pretty much disconnected from the things I think about,'' he says. ''I will think about politics, but it's only because I enjoy writing about it so much.'' Most of his real life, including all the time he has spent ''sitting alone in a room being high,'' as well as the ''other darker things that I'm not going to talk about,'' don't come out on the page -- not because he willfully suppresses them but because he lacks the capacity to express them. ''I can't connect with those things to the extent that I can write about them,'' he says.
When I ask others involved in the show about this apparent gulf between Sorkin's experience and his work, they quickly get defensive and object to the media's radical-chic bias for vicarious darkness. ''Ooh, violence -- I went to prep school but I'm down with that,'' mocks Bradley Whitford. ''Aaron is pushing the envelope of intelligence and hope, and that's so much more radical than the envelope of violence and sex. A mobster going to a shrink, that's not a fantasy?''
Thomas Schlamme, an executive producer of ''West Wing,'' wonders whether, if Frank Capra were making movies now, he would have to endure the same condescending assumptions that exploring the darkness in people is better art than celebrating the good in them.
Sorkin protests far less. ''I'm telling you, I get the difference,'' he says. ''I would love to throw myself into a project that is dark. I just don't think I know how.''
The connection between his life and his work, to the extent there is one, may in fact be inverse -- the bleaker his moods, the brighter and more upbeat his scripts. From 1993 to 1995, when he was at the depth of his addiction and would sometimes go six weeks before letting the maids at the Four Seasons into his room, he wrote ''The American President,'' a White House fairy tale that makes ''The West Wing'' seem like ''Notes From the Underground.''
The week I visit Sorkin in Los Angeles, a fierce late-September sun pushes the temperature into the mid-90's. Sorkin sits in his large, shades-drawn office on the second floor of a low-slung, unmarked stucco building. The vast, hushed studio lot has the feel of a military complex, with the guards at the gate peering into every car. But the wariness around Building 146, which houses the ''West Wing'' writers, is caused less by fear of terrorists than by the bad press that has dogged the show all summer.
Much of it was brought on by Sorkin's arrest, but a good deal also came from ex-writers of the show who claimed that even by the spotlight-hogging standards of Hollywood, Sorkin has been exceptionally ungenerous in his sharing of writing credit. ''You know when you go to your uncle's for Thanksgiving and the kids are kept at one table,'' says a former staff member. ''For the writers on 'West Wing,' every day is Thanksgiving.''
One of them, Rick Cleveland, was livid about not being able to make any remarks at last year's Emmy ceremony at which an episode he wrote with Sorkin (the one about the homeless war veteran) was honored. What made the exclusion all the more galling to Cleveland was that the story was based on his father, a Korean war veteran who spent the last years of his life on the street.
Characteristically, Sorkin couldn't leave the matter alone. Immediately after the dispute was reported in The New York Times, he trashed Cleveland online in a ''West Wing'' chat room. (He habitually visits such Web sites after a show airs.) In a signed tirade, he insisted that Cleveland's contributions were so minor that he should have counted himself lucky to have won an Emmy at all. But as Cleveland points out, the co-writing credit was not offered by Sorkin but dictated by the Writer's Guild.
Sorkin's intense reluctance to share writing credit and his need to create such uniformly positive characters seem to come from the same place. If the reason that you are writing scripts in the first place is to undo the terrible impression you believe others have of you, you would want to make sure that people know exactly who wrote them. ''I don't want to analyze myself or anything, but I think, in fact I know this to be true, that I enter the world through what I write. I grew up believing, and continue to believe, that I am a screw-up, that growing up with my family and friends, I had nothing to offer in any conversation. But when I started writing, suddenly there was something that I brought to the party that was at a high-enough level.''
When I ask about the heinous crimes of his Scarsdale youth, they turn out to be heartbreakingly minor. As a kid, he left his coat at the playground a lot and his room was a mess. In high school, he got his diploma a few months late because he didn't go to phys. ed. At Syracuse, where he received a degree in theater, he once accumulated $237 in parking tickets.
Sorkin doesn't criticize his parents, at least not in my company, but it is obvious that those misdemeanors were, at the time they were committed, held up as evidence of much deeper failings. ''I used to think that I could never be a writer because my childhood was just too normal,'' he says. ''I realize now it wasn't normal at all.''
Sorkin grabs a Merit, sticks it between his lips, then throws it back on the table without lighting it. ''In other words,'' he says, ''it isn't enough for me to write something that people like. It's helpful for me personally for people to get their sense of me from what I write. I think the young men in my scripts have to be in some shape or form the husbands and boyfriends that women want. I think the fathers have to be the fathers that sons and daughters want. I think the bosses have to be the bosses employees want. And believe me, I don't do this on a conscious level.''
Mainstream television, the sitcom particularly, has often served up idealized surrogate families, but Sorkin's illusion is much more compulsive and personal. He is singing for his supper every line.
Sorkin's insecurities influence the show in other fundamental ways. Unlike ''The Sopranos,'' which takes shape in the off-season when David Chase, the hit show's creator, lays out the destinies of each of his major characters, ''West Wing'' is never plotted out for more than a few weeks ahead and has no major story lines. With characters who have no flaws, it is impossible to give them significant arcs, and so as engaging as ''West Wing'' is minute to minute, it has no cumulative power. ''Aaron doesn't trust the idea that he's writing a play in 23 acts,'' Schlamme says.
What limits it dramatically makes it all the more commercial. Because there is no arc or any concern for sequence, a viewer can stumble onto the show at any point in the season, or even in the middle of a show, and get hooked. To Zucker, all this makes Sorkin more, not less, of a genius. ''Aaron makes you laugh,'' Zucker says when I talk to him in his office the day after his visit to the set. ''He makes you cry. He makes you think. And he makes you want to come back.''
As acclaimed and watched as ''West Wing'' is, it has spent its life in the shadow of the far more critically acclaimed and fervently watched ''Sopranos.'' For those involved with the show, it has been a little like being Patrick Ewing in the era of Michael Jordan. Kevin Falls says that every Monday, staff writers spend a good part of the morning dissecting the ''Sopranos'' episode of the night before. And although Sorkin and others have often praised their Emmy rival, there is no evidence on record that the respect is mutual. ''The silence is deafening,'' Falls says.
Zucker is the only person I talk to associated with ''West Wing'' who isn't the slightest bit defensive about the ''The Sopranos.'' ''You want me to stoke the rivalry?'' Zucker says a week before the postponed Emmys are canceled for the second time. ''I'll stoke it.''
For him, the difference between the shows is the difference between the work of a bona fide pro and that of an inspired amateur. ''Look, Aaron gives us 22 episodes a year, not 13, and he gives it to us at a schedule that we set.'' (This is a reference to the creative delays that have pushed back the next batch of ''Sopranos'' shows until at least next September.) As much as Zucker might dread that call from the lawyer or the cops, it is not nearly as scary as the one that could come from Sorkin's agent informing him that Aaron just isn't feeling it at the moment and needs another six months.
As Sorkin puts it himself in one of his less self-flagellating moments: ''I never missed a day of work. I never missed a single meeting. The work has won every award. So sometimes I'm not so sure how I let the whole world down.''
Sorkin's commercial instincts will be tested in the months ahead as ''West Wing'' adapts to the changing political environment. For the first two years of its life, the show's depiction of an executive branch truly populated by the best and brightest was a balm to the millions of viewers weary of the endless frustrations and scandals of the Clinton era. The political operatives that Sorkin summoned from his imagination were so smart and scrupulous and impassioned that they were irresistible in a moment when real-life politics seemed trivial.
That moment, however, has passed, and it is not at all clear whether the fantasy will be as alluring now that events have brought the actual White House closer to the imagined one on ''West Wing.'' Washington is a serious, meaningful place again. The week before I visited Sorkin in Los Angeles, he told me over the phone that he is not certain the show will have to permanently change. He has ''a sense that our perception will return to normal'' and that the real government will ''go back to being annoying.''
Sorkin described to me the episode that they were about to film when the terrorists struck. A foreign correspondent, deeply disappointed about being reassigned to the White House, goes off with typically Sorkinian bombast about about how ''with the Larry King-ization of everything from Monica to Gary Condit to shark attacks, television has abandoned the notion of reporting altogether. He talks about a mother taking her kids to school in Bosnia, and the implication is that real news is something that happens somewhere else, not here.'' Sorkin pauses. ''Well, now Bosnia has come to our front yard.''
Still, after shoehorning in that one episode, Sorkin is not planning on overhauling the formula for ''West Wing.'' Zucker would not want him to. The NBC executive slipped Sorkin that $10 million tip because he knows that Sorkin is the real deal, a Hollywood money-minting freak of nature. Marines, sports reporters, White House staffers, small pet veterinarians, you could pick the subject of his next workplace drama with a ouija board and Sorkin will churn out 22 episodes a year that will make you laugh and make you cry and make you want to come back. And he will do it year after year until the billion-dollar residual check is in the mail. Not because he wants to, but because he can't help himself.
Photos: Aaron Sorkin (Gail Albert Halaban); President Josiah Bartlet, played by Martin Sheen, presides over the Sorkin White House. (Warner Brothers Television); Sorkin and the actor Rob Lowe, a ''West Wing'' star, celebrating last year's Emmys. (Milan Ryba/Globe Photos)