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