]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/JetTasks/AliPWG4HighPtSpectra.cxx
reduced number of bins in histgrams (M. Verweij)
[u/mrichter/AliRoot.git] / PWG4 / JetTasks / AliPWG4HighPtSpectra.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 //-----------------------------------------------------------------------
17 // Efficiency between different steps of the procedure.
18 // The ouptut of the task is a AliCFContainer from which the efficiencies
19 // can be calculated
20 //-----------------------------------------------------------------------
21 // Author : Marta Verweij - UU
22 //-----------------------------------------------------------------------
23
24
25 #ifndef ALIPWG4HIGHPTSPECTRA_CXX
26 #define ALIPWG4HIGHPTSPECTRA_CXX
27
28 #include "AliPWG4HighPtSpectra.h"
29
30 #include "TVector3.h"
31 #include <iostream>
32 #include "TH1.h"
33 #include "TH2.h"
34 #include "TH3.h"
35 #include "TProfile.h"
36 #include "TList.h"
37 #include "TChain.h"
38 #include "TKey.h"
39 #include "TSystem.h"
40 #include "TFile.h"
41
42 #include "AliAnalysisManager.h"
43 #include "AliESDInputHandler.h"
44 #include "AliESDtrack.h"
45 #include "AliESDtrackCuts.h"
46 #include "AliExternalTrackParam.h"
47 #include "AliCentrality.h"
48
49 #include "AliLog.h"
50
51 #include "AliStack.h"
52 #include "TParticle.h"
53 #include "AliMCEvent.h"
54 #include "AliMCEventHandler.h"
55 #include "AliCFContainer.h"
56 #include "AliGenPythiaEventHeader.h"
57 #include "AliGenCocktailEventHeader.h"
58 //#include "$ALICE_ROOT/PWG4/JetTasks/AliAnalysisHelperJetTasks.h"
59
60 //#include <iostream>
61 using namespace std; //required for resolving the 'cout' symbol
62
63 ClassImp(AliPWG4HighPtSpectra)
64
65 //__________________________________________________________________________
66 AliPWG4HighPtSpectra::AliPWG4HighPtSpectra() : AliAnalysisTask("AliPWG4HighPtSpectra", ""), 
67   fReadAODData(0),
68   fCFManagerPos(0x0),
69   fCFManagerNeg(0x0),
70   fESD(0x0),
71   fMC(0x0),
72   fStack(0x0),
73   fVtx(0x0),
74   fIsPbPb(0),
75   fCentClass(10),
76   fTrackType(0),
77   fTrackCuts(0x0),
78   fSigmaConstrainedMax(5.),
79   fAvgTrials(1),
80   fHistList(0),
81   fNEventAll(0),
82   fNEventSel(0),
83   fNEventReject(0),
84   fh1Centrality(0x0),
85   fh1Xsec(0),
86   fh1Trials(0),
87   fh1PtHard(0),
88   fh1PtHardTrials(0)
89 {
90   //
91   //Default ctor
92   //
93 }
94 //___________________________________________________________________________
95 AliPWG4HighPtSpectra::AliPWG4HighPtSpectra(const Char_t* name) :
96   AliAnalysisTask(name,""),
97   fReadAODData(0),
98   fCFManagerPos(0x0),
99   fCFManagerNeg(0x0),
100   fESD(0x0),
101   fMC(0x0),
102   fStack(0x0),
103   fVtx(0x0),
104   fIsPbPb(0),
105   fCentClass(10),
106   fTrackType(0),
107   fTrackCuts(0x0),
108   fSigmaConstrainedMax(5.),
109   fAvgTrials(1),
110   fHistList(0),
111   fNEventAll(0),
112   fNEventSel(0),
113   fNEventReject(0),
114   fh1Centrality(0x0),
115   fh1Xsec(0),
116   fh1Trials(0),
117   fh1PtHard(0),
118   fh1PtHardTrials(0)
119 {
120   //
121   // Constructor. Initialization of Inputs and Outputs
122   //
123   AliDebug(2,Form("AliPWG4HighPtSpectra Calling Constructor"));
124   // Input slot #0 works with a TChain ESD
125   DefineInput(0, TChain::Class());
126   // Output slot #0 writes into a TList
127   DefineOutput(0,TList::Class());
128   // Output slot #1, #2 writes into a AliCFContainer
129   DefineOutput(1,AliCFContainer::Class());
130   DefineOutput(2,AliCFContainer::Class());
131   // Output slot #3 writes into a AliESDtrackCuts
132   DefineOutput(3, AliESDtrackCuts::Class());
133   DefineOutput(4, AliESDtrackCuts::Class());
134 }
135
136 //________________________________________________________________________
137 void AliPWG4HighPtSpectra::LocalInit()
138 {
139   //
140   // Only called once at beginning
141   //
142   PostData(3,fTrackCuts);
143 }
144
145 //________________________________________________________________________
146 void AliPWG4HighPtSpectra::ConnectInputData(Option_t *) 
147 {
148   // Connect ESD here
149   // Called once
150   AliDebug(2,Form(">> AliPWG4HighPtSpectra::ConnectInputData \n"));
151
152   TTree* tree = dynamic_cast<TTree*> (GetInputData(0));
153   if (!tree) {
154     AliDebug(2,Form( "ERROR: Could not read chain from input slot 0 \n"));
155     return;
156   }
157
158   AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
159
160   if (!esdH) {
161     AliDebug(2,Form("ERROR: Could not get ESDInputHandler"));
162     return;
163   } else
164     fESD = esdH->GetEvent();
165   
166   AliMCEventHandler *eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
167   if (!eventHandler) {
168     AliDebug(2,Form( "ERROR: Could not retrieve MC event handler \n"));
169   }
170   else
171     fMC = eventHandler->MCEvent();
172
173 }
174
175 //________________________________________________________________________
176 Bool_t AliPWG4HighPtSpectra::SelectEvent() {
177   //
178   // Decide if event should be selected for analysis
179   //
180
181   // Checks following requirements:
182   // - fESD available
183   // - trigger info from AliPhysicsSelection
184   // - number of reconstructed tracks > 1
185   // - primary vertex reconstructed
186   // - z-vertex < 10 cm
187
188   Bool_t selectEvent = kTRUE;
189
190   //fESD object available?
191   if (!fESD) {
192     AliDebug(2,Form("ERROR: fInputEvent not available\n"));
193     fNEventReject->Fill("noESD",1);
194     selectEvent = kFALSE;
195     return selectEvent;
196   }
197
198   //Trigger
199   UInt_t isSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
200   if(!(isSelected&AliVEvent::kMB)) { //Select collison candidates
201     AliDebug(2,Form(" Trigger Selection: event REJECTED ... "));
202     fNEventReject->Fill("Trigger",1);
203     selectEvent = kFALSE;
204     return selectEvent;
205   }
206
207   //Check if number of reconstructed tracks is larger than 1
208   if(!fESD->GetNumberOfTracks() || fESD->GetNumberOfTracks()<2)  {
209     fNEventReject->Fill("NTracks<2",1);
210     selectEvent = kFALSE;
211     return selectEvent;
212   }
213
214   //Check if vertex is reconstructed
215   fVtx = fESD->GetPrimaryVertexSPD();
216
217   if(!fVtx) {
218     fNEventReject->Fill("noVTX",1);
219     selectEvent = kFALSE;
220     return selectEvent;
221   }
222
223   if(!fVtx->GetStatus()) {
224     fNEventReject->Fill("VtxStatus",1);
225     selectEvent = kFALSE;
226     return selectEvent;
227   }
228
229   // Need vertex cut
230   //  TString vtxName(fVtx->GetName());
231   if(fVtx->GetNContributors()<2) {
232     fNEventReject->Fill("NCont<2",1);
233     selectEvent = kFALSE;
234     return selectEvent;
235   }
236
237   //Check if z-vertex < 10 cm
238   double primVtx[3];
239   fVtx->GetXYZ(primVtx);
240   if(TMath::Sqrt(primVtx[0]*primVtx[0] + primVtx[1]*primVtx[1])>1. || TMath::Abs(primVtx[2]>10.)){
241     fNEventReject->Fill("ZVTX>10",1);
242     selectEvent = kFALSE;
243     return selectEvent;
244   }
245
246   //Centrality selection should only be done in case of PbPb
247   if(IsPbPb()) {
248     Float_t cent = 0.;
249     if(fCentClass!=CalculateCentrality(fESD) && fCentClass!=10) {
250       fNEventReject->Fill("cent",1);
251       selectEvent = kFALSE;
252       return selectEvent;
253     }
254     else {
255       if(dynamic_cast<AliESDEvent*>(fESD)->GetCentrality()) {
256         cent = dynamic_cast<AliESDEvent*>(fESD)->GetCentrality()->GetCentralityPercentile("V0M");
257       }
258       if(cent>90.) {
259         fNEventReject->Fill("cent>90",1);
260         selectEvent = kFALSE;
261         return selectEvent;     
262       }
263       fh1Centrality->Fill(cent);
264     }
265   }
266
267   return selectEvent;
268
269 }
270
271 //________________________________________________________________________
272 Int_t AliPWG4HighPtSpectra::CalculateCentrality(AliESDEvent *esd){
273
274
275   Float_t cent = 999;
276
277   if(esd){
278     if(esd->GetCentrality()){
279       cent = esd->GetCentrality()->GetCentralityPercentile("V0M");
280     }
281   }
282
283   if(cent<0)  return 5;
284   if(cent>80)return 4;
285   if(cent>50)return 3;
286   if(cent>30)return 2;
287   if(cent>10)return 1;
288   return 0;
289
290 }
291
292 //_________________________________________________
293 void AliPWG4HighPtSpectra::Exec(Option_t *)
294 {
295   //
296   // Main loop function
297   //
298   AliDebug(2,Form(">> AliPWG4HighPtSpectra::Exec \n"));  
299
300   // All events without selection
301   fNEventAll->Fill(0.);
302
303   if(!SelectEvent()) {
304     fNEventReject->Fill("NTracks<2",1);
305     // Post output data
306     PostData(0,fHistList);
307     PostData(1,fCFManagerPos->GetParticleContainer());
308     PostData(2,fCFManagerNeg->GetParticleContainer());
309     return;
310   }
311
312   //MCEvent available? 
313   //if yes: get stack
314   if(fMC) {
315     AliDebug(2,Form("MC particles: %d", fMC->GetNumberOfTracks()));
316     fStack = fMC->Stack();                //Particles Stack
317     AliDebug(2,Form("MC particles stack: %d", fStack->GetNtrack()));
318   }
319
320   // ---- Get MC Header information (for MC productions in pThard bins) ----
321   Double_t ptHard = 0.;
322   Double_t nTrials = 1; // trials for MC trigger weight for real data
323   
324   if(fMC){
325     AliGenPythiaEventHeader*  pythiaGenHeader = GetPythiaEventHeader(fMC);
326      if(pythiaGenHeader){
327        nTrials = pythiaGenHeader->Trials();
328        ptHard  = pythiaGenHeader->GetPtHard();
329        
330        fh1PtHard->Fill(ptHard);
331        fh1PtHardTrials->Fill(ptHard,nTrials);
332        
333        fh1Trials->Fill("#sum{ntrials}",fAvgTrials);
334      }
335   }
336   
337   Int_t nTracks = fESD->GetNumberOfTracks();
338   AliDebug(2,Form("nTracks %d", nTracks));
339
340   if(!fTrackCuts) { 
341     fNEventReject->Fill("noTrackCuts",1);
342     // Post output data
343     PostData(0,fHistList);
344     PostData(1,fCFManagerPos->GetParticleContainer());
345     PostData(2,fCFManagerNeg->GetParticleContainer());
346     return;
347   }
348
349   // Selected events for analysis
350   fNEventSel->Fill(0.);
351   
352   
353   Double_t containerInputRec[3]       = {0.,0.,0.};
354   Double_t containerInputMC[3]        = {0.,0.,0.};
355   Double_t containerInputRecMC[3]     = {0.,0.,0.}; //reconstructed yield as function of MC variable
356
357   //Now go to rec level
358   for (Int_t iTrack = 0; iTrack<nTracks; iTrack++) 
359     {   
360       //Get track for analysis
361       AliESDtrack *track = 0x0;
362       AliESDtrack *esdtrack = fESD->GetTrack(iTrack);
363       if(!esdtrack) continue;
364
365       if(fTrackType==1)
366         track = AliESDtrackCuts::GetTPCOnlyTrack(fESD,esdtrack->GetID());
367       else if(fTrackType==2) {
368         track = AliESDtrackCuts::GetTPCOnlyTrack(fESD,esdtrack->GetID());
369         if(!track) continue;
370
371         AliExternalTrackParam exParam;
372         Bool_t relate = track->RelateToVertexTPC(fVtx,fESD->GetMagneticField(),kVeryBig,&exParam);
373         if( !relate ) {
374           delete track;
375           continue;
376         }
377         track->Set(exParam.GetX(),exParam.GetAlpha(),exParam.GetParameter(),exParam.GetCovariance());
378       }
379       else
380         track = esdtrack;
381     
382       if(!track) {
383         if(fTrackType==1 || fTrackType==2) delete track;
384         continue;
385       }
386  
387       if(fTrackType==2) {
388         //Cut on chi2 of constrained fit
389         if(track->GetConstrainedChi2TPC() > fSigmaConstrainedMax*fSigmaConstrainedMax) {
390           delete track;
391           continue;
392         }
393       }
394
395
396       //fill the container
397       containerInputRec[0] = track->Pt();
398       containerInputRec[1] = track->Phi();
399       containerInputRec[2] = track->Eta();
400     
401       if (fTrackCuts->AcceptTrack(track)) {
402         if(track->GetSign()>0.) fCFManagerPos->GetParticleContainer()->Fill(containerInputRec,kStepReconstructed);
403         if(track->GetSign()<0.) fCFManagerNeg->GetParticleContainer()->Fill(containerInputRec,kStepReconstructed);
404
405         
406         //Only fill the MC containers if MC information is available
407         if(fMC) {
408           Int_t label = TMath::Abs(track->GetLabel());
409           TParticle *particle = fStack->Particle(label) ;
410           if(!particle) {
411             if(fTrackType==1 || fTrackType==2)
412               delete track;
413             continue;
414           }
415           containerInputRecMC[0] = particle->Pt();      
416           containerInputRecMC[1] = particle->Phi();      
417           containerInputRecMC[2] = particle->Eta();  
418
419           //Container with primaries
420           if(fStack->IsPhysicalPrimary(label)) {
421             if(particle->GetPDG()->Charge()>0.) {
422               fCFManagerPos->GetParticleContainer()->Fill(containerInputRecMC,kStepReconstructedMC);
423             }
424             if(particle->GetPDG()->Charge()<0.) {
425               fCFManagerNeg->GetParticleContainer()->Fill(containerInputRecMC,kStepReconstructedMC);
426             }
427           }
428
429           //Container with secondaries
430           if (!fStack->IsPhysicalPrimary(label) ) {
431             if(particle->GetPDG()->Charge()>0.) {
432               fCFManagerPos->GetParticleContainer()->Fill(containerInputMC,kStepSecondaries);
433             }
434             if(particle->GetPDG()->Charge()<0.) {
435               fCFManagerNeg->GetParticleContainer()->Fill(containerInputMC,kStepSecondaries);
436             }
437           }
438         }
439         
440       }//trackCuts global tracks
441
442       if(fTrackType==1 || fTrackType==2)
443         delete track;
444     }//track loop
445   
446
447   //Fill MC containters if particles are findable
448   if(fMC) {
449     for(int iPart = 1; iPart<(fMC->GetNumberOfPrimaries()); iPart++) {
450       AliMCParticle *mcPart  = (AliMCParticle*)fMC->GetTrack(iPart);
451       if(!mcPart) continue;
452       //fill the container
453       containerInputMC[0] = mcPart->Pt();
454       containerInputMC[1] = mcPart->Phi();      
455       containerInputMC[2] = mcPart->Eta();  
456       
457       if(fStack->IsPhysicalPrimary(iPart)) {
458         if(mcPart->Charge()>0. && fCFManagerPos->CheckParticleCuts(kStepMCAcceptance,mcPart)) fCFManagerPos->GetParticleContainer()->Fill(containerInputMC,kStepMCAcceptance);
459         if(mcPart->Charge()<0. && fCFManagerNeg->CheckParticleCuts(kStepMCAcceptance,mcPart)) fCFManagerNeg->GetParticleContainer()->Fill(containerInputMC,kStepMCAcceptance);
460       }
461     }
462   }
463   
464   PostData(0,fHistList);
465   PostData(1,fCFManagerPos->GetParticleContainer());
466   PostData(2,fCFManagerNeg->GetParticleContainer());
467   
468 }
469 //________________________________________________________________________
470 Bool_t AliPWG4HighPtSpectra::PythiaInfoFromFile(const char* currFile,Float_t &fXsec,Float_t &fTrials){
471   //
472   // get the cross section and the trails either from pyxsec.root or from pysec_hists.root
473   // This is to called in Notify and should provide the path to the AOD/ESD file
474   // Copied from AliAnalysisTaskJetSpectrum2
475   //
476
477   TString file(currFile);  
478   fXsec = 0;
479   fTrials = 1;
480
481   if(file.Contains("root_archive.zip#")){
482     Ssiz_t pos1 = file.Index("root_archive",12,TString::kExact);
483     Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
484     file.Replace(pos+1,20,"");
485   }
486   else {
487     // not an archive take the basename....
488     file.ReplaceAll(gSystem->BaseName(file.Data()),"");
489   }
490   //  Printf("%s",file.Data());
491    
492   TFile *fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec.root")); // problem that we cannot really test the existance of a file in a archive so we have to lvie with open error message from root
493   if(!fxsec){
494     // next trial fetch the histgram file
495     fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root"));
496     if(!fxsec){
497         // not a severe condition but inciate that we have no information
498       return kFALSE;
499     }
500     else{
501       // find the tlist we want to be independtent of the name so use the Tkey
502       TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0); 
503       if(!key){
504         fxsec->Close();
505         return kFALSE;
506       }
507       TList *list = dynamic_cast<TList*>(key->ReadObj());
508       if(!list){
509         fxsec->Close();
510         return kFALSE;
511       }
512       fXsec = ((TProfile*)list->FindObject("h1Xsec"))->GetBinContent(1);
513       fTrials  = ((TH1F*)list->FindObject("h1Trials"))->GetBinContent(1);
514       fxsec->Close();
515     }
516   } // no tree pyxsec.root
517   else {
518     TTree *xtree = (TTree*)fxsec->Get("Xsection");
519     if(!xtree){
520       fxsec->Close();
521       return kFALSE;
522     }
523     UInt_t   ntrials  = 0;
524     Double_t  xsection  = 0;
525     xtree->SetBranchAddress("xsection",&xsection);
526     xtree->SetBranchAddress("ntrials",&ntrials);
527     xtree->GetEntry(0);
528     fTrials = ntrials;
529     fXsec = xsection;
530     fxsec->Close();
531   }
532   return kTRUE;
533 }
534 //________________________________________________________________________
535 Bool_t AliPWG4HighPtSpectra::Notify()
536 {
537   //
538   // Implemented Notify() to read the cross sections
539   // and number of trials from pyxsec.root
540   // Copied from AliAnalysisTaskJetSpectrum2
541   // 
542
543   TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
544   Float_t xsection = 0;
545   Float_t ftrials  = 1;
546
547   fAvgTrials = 1;
548   if(tree){
549     TFile *curfile = tree->GetCurrentFile();
550     if (!curfile) {
551       Error("Notify","No current file");
552       return kFALSE;
553     }
554     if(!fh1Xsec||!fh1Trials){
555       //      Printf("%s%d No Histogram fh1Xsec",(char*)__FILE__,__LINE__);
556       return kFALSE;
557     }
558      PythiaInfoFromFile(curfile->GetName(),xsection,ftrials);
559     fh1Xsec->Fill("<#sigma>",xsection);
560     // construct a poor man average trials 
561     Float_t nEntries = (Float_t)tree->GetTree()->GetEntries();
562     if(ftrials>=nEntries && nEntries>0.)fAvgTrials = ftrials/nEntries;
563   }  
564   return kTRUE;
565 }
566
567 //________________________________________________________________________
568 AliGenPythiaEventHeader*  AliPWG4HighPtSpectra::GetPythiaEventHeader(AliMCEvent *mcEvent){
569   
570   if(!mcEvent)return 0;
571   AliGenEventHeader* genHeader = mcEvent->GenEventHeader();
572   AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);
573   if(!pythiaGenHeader){
574     // cocktail ??
575     AliGenCocktailEventHeader* genCocktailHeader = dynamic_cast<AliGenCocktailEventHeader*>(genHeader);
576     
577     if (!genCocktailHeader) {
578       //      AliWarningGeneral(Form(" %s:%d",(char*)__FILE__,__LINE__),"Unknown header type (not Pythia or Cocktail)");
579       //      AliWarning(Form("%s %d: Unknown header type (not Pythia or Cocktail)",(char*)__FILE__,__LINE__));
580       return 0;
581     }
582     TList* headerList = genCocktailHeader->GetHeaders();
583     for (Int_t i=0; i<headerList->GetEntries(); i++) {
584       pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(headerList->At(i));
585       if (pythiaGenHeader)
586         break;
587     }
588     if(!pythiaGenHeader){
589       AliWarningGeneral(Form(" %s:%d",(char*)__FILE__,__LINE__),"Pythia event header not found");
590       return 0;
591     }
592   }
593   return pythiaGenHeader;
594
595 }
596
597
598 //___________________________________________________________________________
599 void AliPWG4HighPtSpectra::Terminate(Option_t*)
600 {
601   // The Terminate() function is the last function to be called during
602   // a query. It always runs on the client, it can be used to present
603   // the results graphically or save the results to file.
604
605 }
606
607 //___________________________________________________________________________
608 void AliPWG4HighPtSpectra::CreateOutputObjects() {
609   //HERE ONE CAN CREATE OUTPUT OBJECTS, IN PARTICULAR IF THE OBJECT PARAMETERS DON'T NEED
610   //TO BE SET BEFORE THE EXECUTION OF THE TASK
611   //
612   AliDebug(2,Form("CreateOutputObjects CreateOutputObjects of task %s", GetName()));
613
614   Bool_t oldStatus = TH1::AddDirectoryStatus();
615   TH1::AddDirectory(kFALSE); 
616
617   //slot #1
618   OpenFile(0);
619   fHistList = new TList();
620   fHistList->SetOwner(kTRUE);
621   fNEventAll = new TH1F("fNEventAll","NEventAll",1,-0.5,0.5);
622   fHistList->Add(fNEventAll);
623   fNEventSel = new TH1F("fNEventSel","NEvent Selected for analysis",1,-0.5,0.5);
624   fHistList->Add(fNEventSel);
625
626   fNEventReject = new TH1F("fNEventReject","Reason events are rejectected for analysis",20,0,20);
627   //Set labels
628   fNEventReject->Fill("noESD",0);
629   fNEventReject->Fill("Trigger",0);
630   fNEventReject->Fill("NTracks<2",0);
631   fNEventReject->Fill("noVTX",0);
632   fNEventReject->Fill("VtxStatus",0);
633   fNEventReject->Fill("NCont<2",0);
634   fNEventReject->Fill("ZVTX>10",0);
635   fNEventReject->Fill("cent",0);
636   fNEventReject->Fill("cent>90",0);
637   fHistList->Add(fNEventReject);
638
639   fh1Centrality = new TH1F("fh1Centrality","fh1Centrality; Centrality %",100,0,100);
640   fHistList->Add(fh1Centrality);
641
642   fh1Xsec = new TProfile("fh1Xsec","xsec from pyxsec.root",1,0,1);
643   fh1Xsec->GetXaxis()->SetBinLabel(1,"<#sigma>");
644   fHistList->Add(fh1Xsec);
645
646   fh1Trials = new TH1F("fh1Trials","trials root file",1,0,1);
647   fh1Trials->GetXaxis()->SetBinLabel(1,"#sum{ntrials}");
648   fHistList->Add(fh1Trials);
649
650   fh1PtHard       = new TH1F("fh1PtHard","PYTHIA Pt hard;p_{T,hard}",350,-.5,349.5);
651   fHistList->Add(fh1PtHard);
652   fh1PtHardTrials = new TH1F("fh1PtHardTrials","PYTHIA Pt hard weight with trials;p_{T,hard}",350,-.5,349.5);
653   fHistList->Add(fh1PtHardTrials);
654
655   TH1::AddDirectory(oldStatus);   
656
657   PostData(0,fHistList);
658   PostData(1,fCFManagerPos->GetParticleContainer());
659   PostData(2,fCFManagerNeg->GetParticleContainer());
660
661 }
662
663 #endif