AliPhysics  251aa1e (251aa1e)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskCounter.C
Go to the documentation of this file.
1 
10 
16  Bool_t xsOn = kFALSE)
17 {
18 
19  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
20 
21  AliAnalysisTaskCounter * counter = new AliAnalysisTaskCounter(Form("Counter%s",trigger.Data()));
22  //if(kRun > 140000 && kRun < 146900) counter ->RejectFastCluster();
23  //if (kCollision=="pp" ) counter->SetZVertexCut(10.); //Open cut
24  //else if(kCollision=="PbPb") counter->SetZVertexCut(10.); //Centrality defined in this range.
25 
26  if(xsOn) counter->SwitchOnMCCrossSectionCalculation();
27  else counter->SwitchOffMCCrossSectionCalculation();
28 
29  if(trigger=="EMC8")
30  {
31  printf("counter trigger EMC8\n");
32  counter->SelectCollisionCandidates(AliVEvent::kEMC8);
33  }
34  else if(trigger=="EMC7")
35  {
36  printf("counter trigger EMC7\n");
37  counter->SelectCollisionCandidates(AliVEvent::kEMC7);
38  }
39  else if (trigger=="INT7")
40  {
41  printf("counter trigger INT7\n");
42  counter->SelectCollisionCandidates(AliVEvent::kINT7);
43  }
44  if(trigger=="EMC1")
45  {
46  printf("counter trigger EMC1\n");
47  counter->SelectCollisionCandidates(AliVEvent::kEMC1);
48  }
49  else if(trigger=="MB")
50  {
51  printf("counter trigger MB\n");
52  counter->SelectCollisionCandidates(AliVEvent::kMB);
53  }
54  else if(trigger=="PHOS")
55  {
56  printf("counter trigger PHOS\n");
57  counter->SelectCollisionCandidates(AliVEvent::kPHI7);
58  }
59  else if(trigger=="PHOSPb")
60  {
61  printf("counter trigger PHOSPb\n");
62  counter->SelectCollisionCandidates(AliVEvent::kPHOSPb);
63  }
64  else if(trigger=="AnyINT")
65  {
66  printf("counter trigger AnyINT\n");
67  counter->SelectCollisionCandidates(AliVEvent::kAnyINT);
68  }
69  else if(trigger=="INT")
70  {
71  printf("counter trigger AnyINT\n");
72  counter->SelectCollisionCandidates(AliVEvent::kAny);
73  }
74  else if(trigger=="EMCEGA")
75  {
76  printf("counter trigger EMC Gamma\n");
77  counter->SelectCollisionCandidates(AliVEvent::kEMCEGA);
78  }
79  else if(trigger=="EMCEJE")
80  {
81  printf("counter trigger EMC Jet\n");
82  counter->SelectCollisionCandidates(AliVEvent::kEMCEJE);
83  }
84  else if(trigger=="Central")
85  {
86  printf("counter trigger Central\n");
87  counter->SelectCollisionCandidates(AliVEvent::kCentral);
88  }
89  else if(trigger=="SemiCentral")
90  {
91  printf("counter trigger SemiCentral\n");
92  counter->SelectCollisionCandidates(AliVEvent::kSemiCentral);
93  }
94  else if(trigger=="SemiOrCentral")
95  {
96  printf("counter trigger SemiCentral Or Central\n");
97  counter->SelectCollisionCandidates(AliVEvent::kSemiCentral | AliVEvent::kCentral);
98  }
99 
100  TString outputFile = AliAnalysisManager::GetCommonFileName();
101  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
102 
103  AliAnalysisDataContainer *coutput =
104  mgr->CreateContainer(Form("Counter%s",trigger.Data()), TList::Class(), AliAnalysisManager::kOutputContainer, outputFile.Data());
105  mgr->AddTask(counter);
106  mgr->ConnectInput (counter, 0, cinput1);
107  mgr->ConnectOutput (counter, 1, coutput);
108 
109  return counter;
110 
111 }
112 
Count events with different selection criteria.
AliAnalysisTaskCounter * AddTaskCounter(const TString trigger="", Bool_t xsOn=kFALSE)
bool Bool_t
Definition: External.C:53