AliPhysics  v5-06-40-01 (42bb456)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AddTaskGenKine.C
Go to the documentation of this file.
1 
12 TString kCalorimeter = "EMCAL";
13 Int_t kYears = 2011;
14 Int_t kDebug = -1;
15 Bool_t kPrint = kFALSE;
16 
22  const Double_t scaleFactor = -1)
23 {
24  // Get the pointer to the existing analysis manager via the static access method.
25 
26  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
27  if (!mgr)
28  {
29  ::Error("AddTask", "No analysis manager to connect to.");
30  return NULL;
31  }
32 
33  // #### Configure analysis ####
34 
36  printf("SCALE FACTOR %e\n",scaleFactor);
37  maker->SetScaleFactor(scaleFactor); // for MC, negative (not scaled) by default
38 
39  // General frame setting and configuration
40  maker->SetReader (ConfigureReader() );
42 
43  // Analysis tasks setting and configuration
44  Int_t n = 0;//Analysis number, order is important
45  maker->AddAnalysis(ConfigureGenKine(), n++); // Photon cluster selection
46 
47  maker->SetAnaDebug(kDebug) ;
48  maker->SwitchOnHistogramsMaker() ;
49  maker->SwitchOffAODsMaker() ;
50 
51  if(kPrint) maker->Print("");
52 
53  // Create task
54 
55  AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation ("GeneratorKineAnalysis");
56  task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
57  task->SetDebugLevel(kDebug);
58  task->SetBranches("ESD:AliESDRun.,AliESDHeader");
59  task->SetAnalysisMaker(maker);
60  mgr->AddTask(task);
61 
62  //Create containers
63 
64  if(outputfile.Length()==0) outputfile = AliAnalysisManager::GetCommonFileName();
65 
66  AliAnalysisDataContainer *cout_pc = mgr->CreateContainer("GenKine", TList::Class(),
67  AliAnalysisManager::kOutputContainer,
68  Form("%s",outputfile.Data()));
69 
70  AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer("Param_GemKine", TList::Class(),
71  AliAnalysisManager::kParamContainer,
72  "AnalysisParameters.root");
73 
74  // Create ONLY the output containers for the data produced by the task.
75  // Get and connect other common input/output containers via the manager as below
76  //==============================================================================
77  mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
78  // AOD output slot will be used in a different way in future
79  mgr->ConnectOutput (task, 1, cout_pc);
80  mgr->ConnectOutput (task, 2, cout_cuts);
81 
82  return task;
83 }
84 
90 {
92 
93  reader->SetDebug(kDebug);//10 for lots of messages
94 
95 // reader->SetPtHardAndJetPtComparison(kTRUE);
96 // reader->SetPtHardAndJetPtFactor(4);
97 //
98 // reader->SetPtHardAndClusterPtComparison(kTRUE);
99 // reader->SetPtHardAndClusterPtFactor(1.);
100 
101  reader->SwitchOffWriteDeltaAOD() ;
102 
103  reader->SwitchOnStack();
104  reader->SwitchOffAODMCParticles();
105 
106  //------------------------
107  // Detector input filling
108  //------------------------
109 
110  //Min cluster/track E
111  reader->SetEMCALEMin(0.3);
112  reader->SetEMCALEMax(1000);
113  reader->SetPHOSEMin(0.3);
114  reader->SetPHOSEMax(1000);
115  reader->SetCTSPtMin(0.2);
116  reader->SetCTSPtMax(1000);
117 
118  reader->SwitchOnFiducialCut();
119  //reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
120 
121  reader->SwitchOffCTS();
122  reader->SwitchOffEMCALCells();
123  reader->SwitchOffEMCAL();
124  reader->SwitchOffPHOSCells();
125  reader->SwitchOffPHOS();
126 
127  reader->SetZvertexCut(10.); // Open cut
128  reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
129 
130  reader->SwitchOffPileUpEventRejection(); // remove pileup by default
131  reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
132 
133  if(kPrint)reader->Print("");
134 
135  return reader;
136 
137 }
138 
139 
145 {
146 
148  cu->SetDebug(kDebug);
149 
150 
151  cu->SwitchOffClusterPlot();
152 
153  cu->SwitchOffRecalculateClusterTrackMatching(); // Done in clusterization
154 
156 
158 
159  AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
160 
161  cu->SwitchOffRecalibration();
165  cu->SwitchOffEMCALOADB() ;
166 
167  // PHOS
169 
170  if(kPrint) cu->Print("");
171 
172  return cu;
173 
174 }
175 
176 
181 {
183  ana->SetDebug(kDebug); //10 for lots of messages
184 
185  // cluster selection cuts
186 
187  ana->SwitchOffFiducialCut();
188 
189 
190  ana->AddToHistogramsName("AnaGenKine_");
191  SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
192 
193  if(kPrint)ana->Print("");
194 
195  return ana;
196 }
197 
202 {
203  histoRanges->SetHistoPtRangeAndNBins(0, 200, 400) ; // Energy and pt histograms
204 
205  if(kCalorimeter=="EMCAL")
206  {
207  if(kYears==2010)
208  {
209  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 122*TMath::DegToRad(), 78) ;
210  histoRanges->SetHistoXRangeAndNBins(-230,90,120); // QA
211  histoRanges->SetHistoYRangeAndNBins(370,450,40); // QA
212  }
213  else if ( year < 2014 )
214  {
215  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
216  histoRanges->SetHistoXRangeAndNBins(-460,90,200); // QA
217  histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
218  }
219  else // Run2
220  {
221  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 329*TMath::DegToRad(), 250) ;
222  histoRanges->SetHistoXRangeAndNBins(-460,460,230); // QA
223  histoRanges->SetHistoYRangeAndNBins(-450,450,225); // QA
224  }
225 
226  histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
227  }
228  else
229  {
230  histoRanges->SetHistoPhiRangeAndNBins(250*TMath::DegToRad(), 320*TMath::DegToRad(), 70) ;
231  histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
232  }
233 
234  histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500);
235 
236  // Invariant mass histoRangeslysis
237  histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
238  histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
239 
240  // check if time calibration is on
241  histoRanges->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
242  histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
243 
244  // track-cluster residuals
245  histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.15,0.15,300);
246  histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.15,0.15,300);
247  histoRanges->SetHistodRRangeAndNBins(0.,0.15,150);//QA
248 
249  // QA, electron, charged
250  histoRanges->SetHistoPOverERangeAndNBins(0,10.,100);
251  histoRanges->SetHistodEdxRangeAndNBins(0.,200.,200);
252 
253  // QA
254  histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
255  histoRanges->SetHistoRatioRangeAndNBins(0.,2.,100);
256  histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
257  histoRanges->SetHistoNClusterCellRangeAndNBins(0,500,500);
258  histoRanges->SetHistoZRangeAndNBins(-350,350,175);
259  histoRanges->SetHistoRRangeAndNBins(430,460,30);
260  histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
261  histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
262  histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,5000,500);
263 }
264 
void SetHistoTrackMultiplicityRangeAndNBins(Int_t min, Int_t max, Int_t n)
virtual void SetDebug(Int_t d)
TString kCalorimeter
Global variables to be accessed by the different methods.
void ana(Int_t mode=mGRID)
Definition: ana.C:86
void SetHistoMassRangeAndNBins(Float_t min, Float_t max, Int_t n)
virtual void AddToHistogramsName(TString add)
virtual void SwitchOnFiducialCut()
void SetHistoXRangeAndNBins(Float_t min, Float_t max, Int_t n)
AliEMCALRecoUtils * GetEMCALRecoUtils() const
void SetCTSPtMax(Float_t pt)
void SetHistoPtRangeAndNBins(Float_t min, Float_t max, Int_t n)
void AddAnalysis(TObject *ana, Int_t n)
Add analysis depending on AliAnaCaloTrackCorrBaseClass to list.
void SetHistodRRangeAndNBins(Float_t min, Float_t max, Int_t n)
Get trigger particles/partons/jets and correlations at generator level.
void SetPHOSEMax(Float_t e)
void SetEMCALEMin(Float_t e)
AliAnalysisTaskCaloTrackCorrelation * AddTaskGenKine(TString outputfile, const Double_t scaleFactor=-1)
print configuration settings.
AliAnaGeneratorKine * ConfigureGenKine()
void SetHistoTrackResidualEtaRangeAndNBins(Float_t min, Float_t max, Int_t n)
virtual void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
void SetCTSPtMin(Float_t pt)
Int_t kYears
detector acceptance of trigger particle.
void SwitchOffRecalculateClusterTrackMatching()
void SetScaleFactor(Double_t scale)
virtual void SetDebug(Int_t d)
void SetHistoPOverERangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoPhiRangeAndNBins(Float_t min, Float_t max, Int_t n)
virtual AliHistogramRanges * GetHistogramRanges()
void SetReader(AliCaloTrackReader *reader)
AliCalorimeterUtils * ConfigureCaloUtils()
void SetHistoTrackResidualPhiRangeAndNBins(Float_t min, Float_t max, Int_t n)
AliCaloTrackReader * ConfigureReader()
Class for filtering generated MC particles and prepare them as input for the analysis.
Base class for event, clusters and tracks filtering and preparation for the analysis.
void SetHistoNClusterCellRangeAndNBins(Int_t min, Int_t max, Int_t n)
void SetAnalysisMaker(AliAnaCaloTrackCorrMaker *const maker)
void SetHistoYRangeAndNBins(Float_t min, Float_t max, Int_t n)
virtual void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
virtual void SetZvertexCut(Float_t zcut=10.)
Class containing more common histogram axis types.
Int_t kDebug
year configuration for geometry setting.
void SetCaloUtils(AliCalorimeterUtils *caloutils)
void SetHistoEtaRangeAndNBins(Float_t min, Float_t max, Int_t n)
Bool_t kPrint
debug level.
void SetHistoRangeAndNBins(AliHistogramRanges *histoRanges)
void SetHistoAsymmetryRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoV0MultiplicityRangeAndNBins(Int_t min, Int_t max, Int_t n)
Main class conecting the CaloTrackCorrelations package and Analysis Frame.
void SwitchOffLoadOwnPHOSGeometryMatrices()
void SetHistoZRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoV0SignalRangeAndNBins(Int_t min, Int_t max, Int_t n)
virtual void Print(const Option_t *) const
Print some relevant parameters set for the analysis.
void SwitchOffLoadOwnEMCALGeometryMatrices()
void SetHistoTimeRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoFinePtRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetPHOSEMin(Float_t e)
void SetHistoShowerShapeRangeAndNBins(Float_t min, Float_t max, Int_t n)
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
void SetHistodEdxRangeAndNBins(Float_t min, Float_t max, Int_t n)
Class with utils specific to calorimeter clusters/cells.
void SetHistoRRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoVertexDistRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetEMCALEMax(Float_t e)
void SetHistoDiffTimeRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoRatioRangeAndNBins(Float_t min, Float_t max, Int_t n)
Steering class of package CaloTrackCorrelartions.