AliPhysics  a4b41ad (a4b41ad)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskCounter.cxx
Go to the documentation of this file.
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 #include <TSystem.h>
17 #include <TFile.h>
18 #include <TKey.h>
19 #include <TH2F.h>
20 #include <TProfile.h>
21 #include <TProfile2D.h>
22 #include <TList.h>
23 #include <TClonesArray.h>
24 #include <TGeoGlobalMagField.h>
25 #include "AliAODHeader.h"
26 //#include "AliTriggerAnalysis.h"
27 #include "AliESDEvent.h"
28 #include "AliAODEvent.h"
29 #include "AliESDtrackCuts.h"
30 #include "AliAnalysisManager.h"
31 #include "AliInputEventHandler.h"
32 #include "AliMultSelection.h"
33 #include "AliGenPythiaEventHeader.h"
34 #include "AliMCEvent.h"
35 #include "AliAODMCHeader.h"
36 
37 #include "AliAnalysisTaskCounter.h"
38 
42 
43 //______________________________________________________________
45 //______________________________________________________________
47 : AliAnalysisTaskSE(name),
48  fAcceptFastCluster(kTRUE),
49  fZVertexCut(10.),
50  fTrackMultEtaCut(0.8),
51  fAvgTrials(-1),
52  fOutputContainer(0x0),
53  fESDtrackCuts(AliESDtrackCuts::GetStandardITSTPCTrackCuts2010()),
54  //fTriggerAnalysis (new AliTriggerAnalysis),
55  fCurrFileName(0), fCheckMCCrossSection(kFALSE),
56  fUseAliCentrality(kFALSE), fCentralityClass("V0M"),
57  fhNEvents(0),
58  fhXVertex(0), fhYVertex(0), fhZVertex(0),
59  fhXGoodVertex(0),fhYGoodVertex(0),fhZGoodVertex(0),
60  fhCentrality(0), fhEventPlaneAngle(0),
61  fh1Xsec(0), fh1Trials(0)
62 {
63  DefineOutput(1, TList::Class());
64 }
65 
66 //______________________________________________
68 //_______________________________________________
70  : AliAnalysisTaskSE("DefaultAnalysis_AliAnalysisTaskCounter"),
71  fAcceptFastCluster(kTRUE),
72  fZVertexCut(10.),
73  fTrackMultEtaCut(0.8),
74  fAvgTrials(-1),
75  fOutputContainer(0x0),
76  fESDtrackCuts(AliESDtrackCuts::GetStandardITSTPCTrackCuts2010()),
77  //fTriggerAnalysis (new AliTriggerAnalysis),
78  fCurrFileName(0), fCheckMCCrossSection(kFALSE),
79  fUseAliCentrality(kFALSE), fCentralityClass("V0M"),
80  fhNEvents(0),
81  fhXVertex(0), fhYVertex(0), fhZVertex(0),
82  fhXGoodVertex(0),fhYGoodVertex(0),fhZGoodVertex(0),
83  fhCentrality(0), fhEventPlaneAngle(0),
84  fh1Xsec(0), fh1Trials(0)
85 {
86 }
87 
88 //_______________________________________________
90 //_______________________________________________
92 {
93  if (AliAnalysisManager::GetAnalysisManager()->IsProofMode()) return;
94 
96  {
97  fOutputContainer->Delete() ;
98  delete fOutputContainer ;
99  }
100 
101  if(fESDtrackCuts) delete fESDtrackCuts;
102  //if(fTriggerAnalysis) delete fTriggerAnalysis;
103 
104 }
105 
106 
107 //____________________________________________________
109 //____________________________________________________
111 {
112  fOutputContainer = new TList();
113 
115  {
116  fh1Xsec = new TH1F("hXsec","xsec from pyxsec.root",1,0,1);
117  fh1Xsec->GetXaxis()->SetBinLabel(1,"<#sigma>");
119 
120  fh1Trials = new TH1F("hTrials","trials root file",1,0,1);
121  fh1Trials->GetXaxis()->SetBinLabel(1,"#sum{ntrials}");
123  }
124 
125  fhZVertex = new TH1F("hZVertex", " Z vertex distribution" , 200 , -50 , 50 ) ;
126  fhZVertex->SetXTitle("v_{z} (cm)");
128 
129  fhZGoodVertex = new TH1F("hZGoodVertex", " Good Z vertex distribution" , 200 , -50 , 50 ) ;
130  fhZGoodVertex->SetXTitle("v_{z} (cm)");
132 
133  fhXVertex = new TH1F("hXVertex", " X vertex distribution" , 200 , -2 , 2 ) ;
134  fhXVertex->SetXTitle("v_{x} (cm)");
136 
137  fhXGoodVertex = new TH1F("hXGoodVertex", " Good X vertex distribution" , 200 , -2 , 2 ) ;
138  fhXGoodVertex->SetXTitle("v_{x} (cm)");
140 
141  fhYVertex = new TH1F("hYVertex", " Y vertex distribution" , 200 , -2 , 2 ) ;
142  fhYVertex->SetXTitle("v_{y} (cm)");
144 
145  fhYGoodVertex = new TH1F("hYGoodVertex", " Good Y vertex distribution" , 200 , -2 , 2 ) ;
146  fhYGoodVertex->SetXTitle("v_{y} (cm)");
148 
149  fhCentrality = new TH1F("hCentrality","Number of events in centrality bin, |vz|<10 cm, method <V0M> ",100,0.,100.) ;
150  fhCentrality->SetXTitle("Centrality bin");
152 
153  fhEventPlaneAngle=new TH1F("hEventPlaneAngle","Number of events in event plane, |vz|<10 cm, method <V0> ",100,0.,TMath::Pi()) ;
154  fhEventPlaneAngle->SetXTitle("EP angle (rad)");
156 
157  fhNEvents = new TH1I("hNEvents", "Number of analyzed events", 21, 0, 21) ;
158  //fhNEvents->SetXTitle("Selection");
159  fhNEvents->SetYTitle("# events");
160  fhNEvents->GetXaxis()->SetBinLabel(1 ,"1 = PS");
161  fhNEvents->GetXaxis()->SetBinLabel(2 ,"2 = 1 & ESD");
162  fhNEvents->GetXaxis()->SetBinLabel(3 ,"3 = 2 & |Z|<10");
163  fhNEvents->GetXaxis()->SetBinLabel(4 ,"4 = 2 & !track?");
164  fhNEvents->GetXaxis()->SetBinLabel(5 ,"5 = 3 & 4");
165  fhNEvents->GetXaxis()->SetBinLabel(6 ,"6 = 2 & V0AND");
166  fhNEvents->GetXaxis()->SetBinLabel(7 ,"7 = 3 & 6");
167  fhNEvents->GetXaxis()->SetBinLabel(8 ,"8 = 4 & 6");
168  fhNEvents->GetXaxis()->SetBinLabel(9 ,"9 = 5 & 6");
169  fhNEvents->GetXaxis()->SetBinLabel(10,"10 = 2 & not pileup");
170  fhNEvents->GetXaxis()->SetBinLabel(11,"11 = 2 & good vertex");
171  fhNEvents->GetXaxis()->SetBinLabel(12,"12 = 3 & 11");
172  fhNEvents->GetXaxis()->SetBinLabel(13,"13 = 4 & 11");
173  fhNEvents->GetXaxis()->SetBinLabel(14,"14 = 6 & 11");
174  fhNEvents->GetXaxis()->SetBinLabel(15,"15 = 9 & 11");
175  fhNEvents->GetXaxis()->SetBinLabel(16,"16 = 10 & 11");
176  fhNEvents->GetXaxis()->SetBinLabel(17,"17 = 6 & 10");
177  fhNEvents->GetXaxis()->SetBinLabel(18,"18 = Reject EMCAL 1");
178  fhNEvents->GetXaxis()->SetBinLabel(19,"19 = 18 & 3");
179  fhNEvents->GetXaxis()->SetBinLabel(20,"20 = Reject EMCAL 2");
180  fhNEvents->GetXaxis()->SetBinLabel(21,"21 = 20 & 3");
181 
183 
184  fOutputContainer->SetOwner(kTRUE);
185 
186  PostData(1,fOutputContainer);
187 
188 }
189 
190 //_______________________________________________
195 //_______________________________________________
197 {
198  //printf("___ Event __ %d __\n",(Int_t)Entry());
199 
200  Notify();
201 
202  fhNEvents->Fill(0.5);
203 
204  AliVEvent * event = InputEvent();
205  AliESDEvent * esdevent = dynamic_cast<AliESDEvent*> (event);
206  AliAODEvent * aodevent = dynamic_cast<AliAODEvent*> (event);
207 
208  // Init mag field for tracks in case of ESDs, needed, not clear why
209  if (!TGeoGlobalMagField::Instance()->GetField() && esdevent) esdevent->InitMagneticField();
210 
211  TString triggerclasses = event->GetFiredTriggerClasses();
212 
213  //printf("Trigger class fired: %s \n",event->GetFiredTriggerClasses().Data());
214 
215  if (triggerclasses.Contains("FAST") && !triggerclasses.Contains("ALL") && !fAcceptFastCluster)
216  {
217  //printf("Do not count events from fast cluster, trigger name %s\n",triggerclasses.Data());
218  return;
219  }
220 
221  fhNEvents->Fill(1.5);
222 
223  //Initialize bools
224  Bool_t bSelectVZ = kFALSE;
225  Bool_t bV0AND = kFALSE;
226  Bool_t bPileup = kFALSE;
227  Bool_t bGoodV = kFALSE;
228  Bool_t bSelectTrack = kFALSE;
229  Int_t trackMult = 0;
230 
231  //---------------------------------
232  //Get the primary vertex, cut on Z
233  //---------------------------------
234  Double_t v[3];
235  event->GetPrimaryVertex()->GetXYZ(v) ;
236  fhXVertex->Fill(v[0]);
237  fhYVertex->Fill(v[1]);
238  fhZVertex->Fill(v[2]);
239 
240  if(TMath::Abs(v[2]) < fZVertexCut)
241  {
242  bSelectVZ=kTRUE;
243  fhNEvents->Fill(2.5);
244  }
245  //else printf("Vertex out %f \n",v[2]);
246 
247  //--------------------------------------------------
248  //Count tracks, cut on number of tracks in eta < 0.8
249  //--------------------------------------------------
250  Int_t nTracks = event->GetNumberOfTracks() ;
251  for (Int_t itrack = 0; itrack < nTracks; itrack++)
252  {
253  AliVTrack * track = (AliVTrack*)event->GetTrack(itrack) ; // retrieve track from esd
254 
255  //ESDs
256  if(esdevent && !fESDtrackCuts->AcceptTrack((AliESDtrack*)track)) continue;
257 
258  //AODs
259  if(aodevent && !((AliAODTrack*)track)->IsHybridGlobalConstrainedGlobal()) continue ;
260 
261  //Do not count tracks out of acceptance cut
262  if(TMath::Abs(track->Eta())< fTrackMultEtaCut) trackMult++;
263  }
264 
265  //printf("AliAnalysisTaskCounter::UserExec() - Track Mult %d \n",trackMult);
266 
267  //--------------------------------------------------
268  // At least one track
269  //--------------------------------------------------
270  if (trackMult > 0)
271  {
272  bSelectTrack = kTRUE;
273  fhNEvents->Fill(3.5);
274  if(bSelectVZ) fhNEvents->Fill(4.5);
275  }
276 
277  //---------------------------------
278  // V0AND
279  //---------------------------------
280 
281  //if(esdevent) bV0AND = fTriggerAnalysis->IsOfflineTriggerFired(esdevent, AliTriggerAnalysis::kV0AND);
282  AliVVZERO* v0 = fInputEvent->GetVZEROData();
283  bV0AND = ((v0->GetV0ADecision()==1) && (v0->GetV0CDecision()==1));
284 
285  if(bV0AND)
286  {
287  fhNEvents->Fill(5.5);
288  if (bSelectVZ) fhNEvents->Fill(6.5);
289  if (bSelectTrack) fhNEvents->Fill(7.5);
290  if (bSelectVZ && bSelectTrack) fhNEvents->Fill(8.5);
291  }
292 
293  //---------------------------------
294  // Pileup
295  //---------------------------------
296  bPileup = event->IsPileupFromSPD(3, 0.8, 3., 2., 5.); //Default values, if not it does not compile
297  //bPileup = event->IsPileupFromSPD();
298 
299  if (!bPileup)
300  {
301  fhNEvents->Fill(9.5);
302  if(bV0AND) fhNEvents->Fill(16.5);
303  }
304 
305  //---------------------------------
306  // Good vertex
307  //---------------------------------
308  bGoodV = CheckForPrimaryVertex();
309 
310  //Remove events with vertex (0,0,0), bad vertex reconstruction
311  if(TMath::Abs(v[0]) < 1.e-6 &&
312  TMath::Abs(v[1]) < 1.e-6 &&
313  TMath::Abs(v[2]) < 1.e-6) bGoodV = kFALSE;
314 
315  if(bGoodV)
316  {
317  fhXGoodVertex->Fill(v[0]);
318  fhYGoodVertex->Fill(v[1]);
319  fhZGoodVertex->Fill(v[2]);
320 
321  fhNEvents->Fill(10.5);
322  if(bSelectVZ) fhNEvents->Fill(11.5);
323  if(bSelectTrack) fhNEvents->Fill(12.5);
324  if(bV0AND) fhNEvents->Fill(13.5);
325  if(bSelectVZ && bSelectTrack && bV0AND)
326  fhNEvents->Fill(14.5);
327  if(!bPileup) fhNEvents->Fill(15.5);
328 
329  if(TMath::Abs(v[2]) < 10.)
330  {
332  {
333  if(InputEvent()->GetCentrality() && fUseAliCentrality)
334  fhCentrality->Fill(InputEvent()->GetCentrality()->GetCentralityPercentile(fCentralityClass)) ;
335  }
336  else
337  {
338  AliMultSelection* multSelection = (AliMultSelection * ) fInputEvent->FindListObject("MultSelection") ;
339  if(multSelection) fhCentrality->Fill(multSelection->GetMultiplicityPercentile(fCentralityClass, kTRUE));
340  }
341 
342  if(InputEvent()->GetEventplane())
343  {
344  Float_t ep = InputEvent()->GetEventplane()->GetEventplane("V0", InputEvent());
345 
346  ep+=TMath::Pi()/2.; // put same range as for <Q> method, [0,pi]
347 
348  fhEventPlaneAngle->Fill(ep);
349  }
350  }
351 
352  }
353 
354  //printf("AliAnalysisTaskCounter::UserExec() : z vertex %d, good vertex %d, v0and %d, pile up %d, track mult %d\n ", bSelectVZ, bGoodV, bV0AND, bPileup, trackMult);
355 
356  // Events that could be rejected in EMCAL
357  // LHC11a, SM4 and some SM3 events cut with this
358  Bool_t bEMCALRejected = kFALSE;
359  for (Int_t i = 0; i < InputEvent()->GetNumberOfCaloClusters(); i++)
360  {
361  AliVCluster *clus = InputEvent()->GetCaloCluster(i);
362  if(clus->IsEMCAL())
363  {
364  if ((clus->E() > 500 && clus->GetNCells() > 200 ) || clus->GetNCells() > 200)
365  {
366 
367  //printf("Counter: Reject event with cluster: E %f, ncells %d\n",clus->E(),clus->GetNCells());
368 
369  fhNEvents->Fill(17.5);
370  if(bSelectVZ) fhNEvents->Fill(18.5);
371  bEMCALRejected = kTRUE;
372  break;
373  }
374  }
375  }
376 
377  //LHC11a, 3 last runs, cut with this
378  if(!bEMCALRejected)
379  {
380  // Count number of cells in SM3 with energy larger than 0.1, cut on this number
381  Int_t ncellsSM3 = 0;
382  Int_t ncellsSM4 = 0;
383  for(Int_t icell = 0; icell < event->GetEMCALCells()->GetNumberOfCells(); icell++)
384  {
385  if(event->GetEMCALCells()->GetAmplitude(icell) > 0.1 && event->GetEMCALCells()->GetCellNumber(icell)/(24*48)==3) ncellsSM3++;
386  if(event->GetEMCALCells()->GetAmplitude(icell) > 0.1 && event->GetEMCALCells()->GetCellNumber(icell)/(24*48)==4) ncellsSM4++;
387  }
388 
389  Int_t ncellcut = 21;
390  if(triggerclasses.Contains("EMC")) ncellcut = 35;
391 
392  if( ncellsSM3 >= ncellcut || ncellsSM4 >= 100 )
393  {
394  //printf("Counter: reject event with ncells in SM3: ncells %d\n",ncells);
395 
396  fhNEvents->Fill(19.5);
397  if(bSelectVZ) fhNEvents->Fill(20.5);
398  }
399 
400  }
401 
402  PostData(1,fOutputContainer);
403 
404 }
405 
406 //____________________________________________________
409 //____________________________________________________
411 {
412 
413  AliESDEvent * esdevent = dynamic_cast<AliESDEvent*> (InputEvent());
414  AliAODEvent * aodevent = dynamic_cast<AliAODEvent*> (InputEvent());
415 
416  if(esdevent)
417  {
418  if(esdevent->GetPrimaryVertex()->GetNContributors() > 0)
419  {
420  return kTRUE;
421  }
422 
423  if(esdevent->GetPrimaryVertex()->GetNContributors() < 1)
424  {
425  // SPD vertex
426  if(esdevent->GetPrimaryVertexSPD()->GetNContributors() > 0)
427  {
428  return kTRUE;
429 
430  }
431  if(esdevent->GetPrimaryVertexSPD()->GetNContributors() < 1)
432  {
433  return kFALSE;
434  }
435  }
436  }
437  else if(aodevent)
438  {
439  if (aodevent->GetPrimaryVertex() != NULL)
440  {
441  if(aodevent->GetPrimaryVertex()->GetNContributors() > 0)
442  {
443  return kTRUE;
444  }
445  }
446 
447  if(aodevent->GetPrimaryVertexSPD() != NULL)
448  {
449  if(aodevent->GetPrimaryVertexSPD()->GetNContributors() > 0)
450  {
451  return kTRUE;
452  }
453  else
454  {
455  AliWarning(Form("Number of contributors from bad vertex type:: %s",aodevent->GetPrimaryVertex()->GetName()));
456  return kFALSE;
457  }
458  }
459  }
460  else return kTRUE;
461 
462  return kFALSE;
463 
464 }
465 
466 //_____________________________________________
468 //_____________________________________________
470 {
471  AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
472  AliInputEventHandler *inputH = dynamic_cast<AliInputEventHandler*>(am->GetInputEventHandler());
473  if (!inputH) return;
474  TH2F *histStat = dynamic_cast<TH2F*>(inputH->GetStatistics());
475  TH2F *histBin0 = dynamic_cast<TH2F*>(inputH->GetStatistics("BIN0"));
476 
477  if(histStat)
478  fOutputContainer->Add(histStat);
479  else AliInfo("Stat histogram not available check, \n if ESDs, that AliPhysicsSelection was on, \n if AODs, if EventStat_temp.root exists");
480 
481  if(histBin0)
482  fOutputContainer->Add(histBin0);
483 
484 }
485 
486 //_____________________________________
490 //_____________________________________
492 {
493  if(!fCheckMCCrossSection) return kTRUE;
494 
495  // Fetch the aod also from the input in,
496  // have todo it in notify
497 
498  Float_t xsection = 0;
499  Float_t trials = 1;
500  fAvgTrials = -1;
501 
502  TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
503  if(!tree) return kFALSE;
504 
505  TFile *curfile = tree->GetCurrentFile();
506 
507  if(!curfile) return kFALSE;
508 
509  if(fCurrFileName == curfile->GetName()) return kFALSE;
510 
511  fCurrFileName = TString(curfile->GetName());
512 
513  if(!fh1Xsec||!fh1Trials)
514  {
515  AliInfo(Form("%s%d No Histogram fh1Xsec",(char*)__FILE__,__LINE__));
516  return kFALSE;
517  }
518 
519 
520  Bool_t ok = PythiaInfoFromFile(fCurrFileName,xsection,trials);
521 
522 
523  if(!ok || xsection==0){
524 
525  // Try to get the information for the header (AOD) if the pysec histo are not filled
526  AliGenPythiaEventHeader *fPythiaHeader=0;
527 
528  AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
529 
530  if (aodMCH) {
531  for (UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++) {
532  fPythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
533  if (fPythiaHeader) break;
534  }
535  }
536 
537  if(!fPythiaHeader){
538  AliError(Form("No pythia header found"));
539  return kFALSE;
540 }
541 
542  Float_t pthard=0;
543 
544  pthard = fPythiaHeader->GetPtHard();
545  xsection = fPythiaHeader->GetXsection();
546  trials = fPythiaHeader->Trials();
547 
548  fh1Xsec->Fill("<#sigma>",xsection);
549  fh1Trials->Fill("#sum{ntrials}",trials);
550 
551  AliInfo(Form("xs %f, trial %f, pt hard %f\n",xsection,trials, pthard));
552 
553  return kTRUE;
554  }
555 
556 
557 
558  fh1Xsec->Fill("<#sigma>",xsection);
559 
560  // average trials per event
561  Float_t nEntries = (Float_t)tree->GetTree()->GetEntries();
562 
563  if(trials >= nEntries && nEntries > 0.) fAvgTrials = trials/nEntries;
564 
565  fh1Trials->Fill("#sum{ntrials}",trials);
566 
567  AliInfo(Form("xs %f, trial %f, avg trials %f\n",xsection,trials, fAvgTrials));
568 
569  AliDebug(1,Form("Reading File %s",fInputHandler->GetTree()->GetCurrentFile()->GetName()));
570 
571 
572  return kTRUE;
573 
574 }
575 
576 //_____________________________________________________________________________________________
583 //_____________________________________________________________________________________________
585 {
586  xsec = 0;
587  trials = 1;
588 
589  if(file.Contains("root_archive.zip#"))
590  {
591  Ssiz_t pos1 = file.Index("root_archive",12,0,TString::kExact);
592  Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
593  Ssiz_t pos2 = file.Index(".root",5,TString::kExact);
594  file.Replace(pos+1,pos2-pos1,"");
595  }
596  else
597  {
598  // not an archive take the basename....
599  file.ReplaceAll(gSystem->BaseName(file.Data()),"");
600  }
601 
602  //Printf("%s",file.Data());
603 
604  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
605  if(!fxsec)
606  {
607  // next trial fetch the histgram file
608  fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root"));
609  if(!fxsec)
610  {
611  // not a severe condition but inciate that we have no information
612  return kFALSE;
613  }
614  else
615  {
616  // find the tlist we want to be independtent of the name so use the Tkey
617  TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
618  if(!key)
619  {
620  fxsec->Close();
621  return kFALSE;
622  }
623 
624  TList *list = dynamic_cast<TList*>(key->ReadObj());
625  if(!list)
626  {
627  fxsec->Close();
628  return kFALSE;
629  }
630 
631  xsec = ((TProfile*)list->FindObject("h1Xsec")) ->GetBinContent(1);
632  trials = ((TH1F*) list->FindObject("h1Trials"))->GetBinContent(1);
633  fxsec->Close();
634  }
635  } // no tree pyxsec.root
636  else
637  {
638  TTree *xtree = (TTree*)fxsec->Get("Xsection");
639  if(!xtree)
640  {
641  fxsec->Close();
642  return kFALSE;
643  }
644 
645  UInt_t ntrials = 0;
646  Double_t xsection = 0;
647  xtree->SetBranchAddress("xsection",&xsection);
648  xtree->SetBranchAddress("ntrials",&ntrials);
649  xtree->GetEntry(0);
650  trials = ntrials;
651  xsec = xsection;
652  fxsec->Close();
653  }
654 
655  return kTRUE;
656 }
657 
virtual void UserExec(Option_t *option)
double Double_t
Definition: External.C:58
Definition: External.C:236
Count events with different selection criteria.
virtual void UserCreateOutputObjects()
Init histogram pointers and add them to container.
TH1F * fhXGoodVertex
! X Vertex distribution, after event selection.
TSystem * gSystem
TList * list
virtual void FinishTaskOutput()
Put in the output some event summary histograms.
static Bool_t PythiaInfoFromFile(TString currFile, Float_t &xsec, Float_t &trials)
TH1F * fhZVertex
! Z Vertex distribution.
TString fCurrFileName
Current file path name.
TH1F * fhCentrality
! Centrality.
Bool_t fAcceptFastCluster
Accept events from fast cluster, exclude these events for LHC11a.
Float_t fZVertexCut
Z vertex cut.
int Int_t
Definition: External.C:63
Definition: External.C:204
unsigned int UInt_t
Definition: External.C:33
Float_t fTrackMultEtaCut
Track multiplicity eta cut.
float Float_t
Definition: External.C:68
TString fCentralityClass
Multiplicity percentile/centrality estimator, for ex. V0M.
TH1F * fhZGoodVertex
! Z Vertex distribution, after event selection.
AliESDtrackCuts * fESDtrackCuts
Track cut.
AliAnalysisTaskCounter()
Default Constructor.
virtual ~AliAnalysisTaskCounter()
Destructor.
Bool_t fCheckMCCrossSection
Retrieve from the pyxsec.root file only if requested.
TH1F * fh1Xsec
! Cross section in PYTHIA.
TH1F * fhYVertex
! Y Vertex distribution.
TH1I * fhNEvents
! Events that delivers the analysis frame after different assumptions.
TList * fOutputContainer
! Histogram container.
TH1F * fhYGoodVertex
! Y Vertex distribution, after event selection.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
TFile * file
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53
Bool_t fUseAliCentrality
Use the centrality estimator from AliCentrality or AliMultSelection.
TH1F * fhXVertex
! X Vertex distribution.
TH1F * fh1Trials
! Number of event trials in PYTHIA.
TH1F * fhEventPlaneAngle
! Event plane angle.
Float_t fAvgTrials
Average number of event trials.