AliPhysics  8630145 (8630145)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  // Calculate the cross section weights, apply them to all histograms
52  // and fill xsec and trial histo. Sumw2 must be activated.
53  //maker->GetReader()->GetWeightUtils()->SwitchOnMCCrossSectionCalculation();
54  //maker->SwitchOnSumw2Histograms();
55 
56  // For recent productions where the cross sections and trials are not stored in separate file
57  //maker->GetReader()->GetWeightUtils()->SwitchOnMCCrossSectionFromEventHeader() ;
58 
59  // Just fill cross section and trials histograms.
61 
62 
63 
64  if(kPrint) maker->Print("");
65 
66  // Create task
67 
68  AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation ("GeneratorKineAnalysis");
69  task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
70  task->SetDebugLevel(kDebug);
71  task->SetBranches("ESD:AliESDRun.,AliESDHeader");
72  task->SetAnalysisMaker(maker);
73  mgr->AddTask(task);
74 
75  //Create containers
76 
77  if(outputfile.Length()==0) outputfile = AliAnalysisManager::GetCommonFileName();
78 
79  AliAnalysisDataContainer *cout_pc = mgr->CreateContainer("GenKine", TList::Class(),
80  AliAnalysisManager::kOutputContainer,
81  Form("%s",outputfile.Data()));
82 
83  AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer("Param_GemKine", TList::Class(),
84  AliAnalysisManager::kParamContainer,
85  "AnalysisParameters.root");
86 
87  // Create ONLY the output containers for the data produced by the task.
88  // Get and connect other common input/output containers via the manager as below
89  //==============================================================================
90  mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
91  // AOD output slot will be used in a different way in future
92  mgr->ConnectOutput (task, 1, cout_pc);
93  mgr->ConnectOutput (task, 2, cout_cuts);
94 
95  return task;
96 }
97 
103 {
104  AliCaloTrackReader * reader = new AliCaloTrackMCReader();
105 
106  reader->SetDebug(kDebug);//10 for lots of messages
107 
108 // reader->SetPtHardAndJetPtComparison(kTRUE);
109 // reader->SetPtHardAndJetPtFactor(4);
110 //
111 // reader->SetPtHardAndClusterPtComparison(kTRUE);
112 // reader->SetPtHardAndClusterPtFactor(1.);
113 
114  reader->SwitchOffWriteDeltaAOD() ;
115 
116  reader->SwitchOnStack();
117  reader->SwitchOffAODMCParticles();
118 
119  //------------------------
120  // Detector input filling
121  //------------------------
122 
123  //Min cluster/track E
124  reader->SetEMCALEMin(0.3);
125  reader->SetEMCALEMax(1000);
126  reader->SetPHOSEMin(0.3);
127  reader->SetPHOSEMax(1000);
128  reader->SetCTSPtMin(0.2);
129  reader->SetCTSPtMax(1000);
130 
131  reader->SwitchOnFiducialCut();
132  //reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
133 
134  reader->SwitchOffCTS();
135  reader->SwitchOffEMCALCells();
136  reader->SwitchOffEMCAL();
137  reader->SwitchOffPHOSCells();
138  reader->SwitchOffPHOS();
139 
140  reader->SetZvertexCut(10.); // Open cut
141  reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
142 
143  reader->SwitchOffPileUpEventRejection(); // remove pileup by default
144  reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
145 
146  if(kPrint)reader->Print("");
147 
148  return reader;
149 
150 }
151 
152 
158 {
159 
161  cu->SetDebug(kDebug);
162 
163 
164  cu->SwitchOffClusterPlot();
165 
166  cu->SwitchOffRecalculateClusterTrackMatching(); // Done in clusterization
167 
169 
171 
172  AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
173 
174  cu->SwitchOffRecalibration();
178  cu->SwitchOffEMCALOADB() ;
179 
180  // PHOS
182 
183  if(kPrint) cu->Print("");
184 
185  return cu;
186 
187 }
188 
189 
194 {
196  ana->SetDebug(kDebug); //10 for lots of messages
197 
198  // cluster selection cuts
199 
200  ana->SwitchOffFiducialCut();
201 
202 
203  ana->AddToHistogramsName("AnaGenKine_");
204  SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
205 
206  if(kPrint)ana->Print("");
207 
208  return ana;
209 }
210 
215 {
216  histoRanges->SetHistoPtRangeAndNBins(0, 200, 400) ; // Energy and pt histograms
217 
218  if(kCalorimeter=="EMCAL")
219  {
220  if(kYears==2010)
221  {
222  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 122*TMath::DegToRad(), 78) ;
223  histoRanges->SetHistoXRangeAndNBins(-230,90,120); // QA
224  histoRanges->SetHistoYRangeAndNBins(370,450,40); // QA
225  }
226  else if ( year < 2014 )
227  {
228  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
229  histoRanges->SetHistoXRangeAndNBins(-460,90,200); // QA
230  histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
231  }
232  else // Run2
233  {
234  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 329*TMath::DegToRad(), 250) ;
235  histoRanges->SetHistoXRangeAndNBins(-460,460,230); // QA
236  histoRanges->SetHistoYRangeAndNBins(-450,450,225); // QA
237  }
238 
239  histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
240  }
241  else
242  {
243  histoRanges->SetHistoPhiRangeAndNBins(250*TMath::DegToRad(), 320*TMath::DegToRad(), 70) ;
244  histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
245  }
246 
247  histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500);
248 
249  // Invariant mass histoRangeslysis
250  histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
251  histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
252 
253  // check if time calibration is on
254  histoRanges->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
255  histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
256 
257  // track-cluster residuals
258  histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.15,0.15,300);
259  histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.15,0.15,300);
260  histoRanges->SetHistodRRangeAndNBins(0.,0.15,150);//QA
261 
262  // QA, electron, charged
263  histoRanges->SetHistoPOverERangeAndNBins(0,10.,100);
264  histoRanges->SetHistodEdxRangeAndNBins(0.,200.,200);
265 
266  // QA
267  histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
268  histoRanges->SetHistoRatioRangeAndNBins(0.,2.,100);
269  histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
270  histoRanges->SetHistoNClusterCellRangeAndNBins(0,500,500);
271  histoRanges->SetHistoZRangeAndNBins(-350,350,175);
272  histoRanges->SetHistoRRangeAndNBins(430,460,30);
273  histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
274  histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
275  histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,5000,500);
276 }
277 
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
double Double_t
Definition: External.C:58
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 SetEMCALEMin(Float_t en)
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)
void SwitchOnMCCrossSectionHistoFill()
Definition: AliAnaWeights.h:77
Get trigger particles/partons/jets and correlations at generator level.
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)
int Int_t
Definition: External.C:63
virtual AliHistogramRanges * GetHistogramRanges()
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.
void SetPHOSEMin(Float_t en)
void SetReader(AliCaloTrackReader *re)
Int_t kDebug
year configuration for geometry setting.
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 SetEMCALEMax(Float_t en)
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.
bool Bool_t
Definition: External.C:53
void SetPHOSEMax(Float_t en)
void SetHistodEdxRangeAndNBins(Float_t min, Float_t max, Int_t n)
Class with utils specific to calorimeter clusters/cells.
AliCaloTrackReader * GetReader()
AliAnaWeights * GetWeightUtils()
void SetHistoRRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoVertexDistRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoDiffTimeRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoRatioRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetCaloUtils(AliCalorimeterUtils *cu)
Steering class of package CaloTrackCorrelartions.