AliPhysics  648edd6 (648edd6)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskGenKine.C
Go to the documentation of this file.
1 
13 TString kCalorimeter = "EMCAL";
14 Int_t kYears = 2011;
15 Int_t kDebug = -1;
16 Bool_t kPrint = kFALSE;
17 
23  const Double_t scaleFactor = -1)
24 {
25  // Get the pointer to the existing analysis manager via the static access method.
26 
27  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
28  if (!mgr)
29  {
30  ::Error("AddTask", "No analysis manager to connect to.");
31  return NULL;
32  }
33 
34  // #### Configure analysis ####
35 
37  printf("SCALE FACTOR %e\n",scaleFactor);
38  maker->SetScaleFactor(scaleFactor); // for MC, negative (not scaled) by default
39 
40  // General frame setting and configuration
41  maker->SetReader (ConfigureReader() );
43 
44  // Analysis tasks setting and configuration
45  Int_t n = 0;//Analysis number, order is important
46  maker->AddAnalysis(ConfigureGenKine(), n++); // Photon cluster selection
47 
48  maker->SetAnaDebug(kDebug) ;
49  maker->SwitchOnHistogramsMaker() ;
50  maker->SwitchOffAODsMaker() ;
51 
52  // Calculate the cross section weights, apply them to all histograms
53  // and fill xsec and trial histo. Sumw2 must be activated.
54  //maker->GetReader()->GetWeightUtils()->SwitchOnMCCrossSectionCalculation();
55  //maker->SwitchOnSumw2Histograms();
56 
57  // For recent productions where the cross sections and trials are not stored in separate file
58  //maker->GetReader()->GetWeightUtils()->SwitchOnMCCrossSectionFromEventHeader() ;
59 
60  // Just fill cross section and trials histograms.
62 
63 
64 
65  if(kPrint) maker->Print("");
66 
67  // Create task
68 
69  AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation ("GeneratorKineAnalysis");
70  task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
71  task->SetDebugLevel(kDebug);
72  task->SetBranches("ESD:AliESDRun.,AliESDHeader");
73  task->SetAnalysisMaker(maker);
74  mgr->AddTask(task);
75 
76  //Create containers
77 
78  if(outputfile.Length()==0) outputfile = AliAnalysisManager::GetCommonFileName();
79 
80  AliAnalysisDataContainer *cout_pc = mgr->CreateContainer("GenKine", TList::Class(),
81  AliAnalysisManager::kOutputContainer,
82  Form("%s",outputfile.Data()));
83 
84  AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer("Param_GemKine", TList::Class(),
85  AliAnalysisManager::kParamContainer,
86  "AnalysisParameters.root");
87 
88  // Create ONLY the output containers for the data produced by the task.
89  // Get and connect other common input/output containers via the manager as below
90  //==============================================================================
91  mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
92  // AOD output slot will be used in a different way in future
93  mgr->ConnectOutput (task, 1, cout_pc);
94  mgr->ConnectOutput (task, 2, cout_cuts);
95 
96  return task;
97 }
98 
104 {
105  AliCaloTrackReader * reader = new AliCaloTrackMCReader();
106 
107  reader->SetDebug(kDebug);//10 for lots of messages
108 
109 // reader->SetPtHardAndJetPtComparison(kTRUE);
110 // reader->SetPtHardAndJetPtFactor(4);
111 //
112 // reader->SetPtHardAndClusterPtComparison(kTRUE);
113 // reader->SetPtHardAndClusterPtFactor(1.);
114 
115  reader->SwitchOffWriteDeltaAOD() ;
116 
117  //------------------------
118  // Detector input filling
119  //------------------------
120 
121  //Min cluster/track E
122  reader->SetEMCALEMin(0.3);
123  reader->SetEMCALEMax(1000);
124  reader->SetPHOSEMin(0.3);
125  reader->SetPHOSEMax(1000);
126  reader->SetCTSPtMin(0.2);
127  reader->SetCTSPtMax(1000);
128 
129  reader->SwitchOnFiducialCut();
130  //reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
131 
132  reader->SwitchOffCTS();
133  reader->SwitchOffEMCALCells();
134  reader->SwitchOffEMCAL();
135  reader->SwitchOffPHOSCells();
136  reader->SwitchOffPHOS();
137 
138  reader->SetZvertexCut(10.); // Open cut
139  reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
140 
141  reader->SwitchOffPileUpEventRejection(); // remove pileup by default
142  reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
143 
144  if(kPrint)reader->Print("");
145 
146  return reader;
147 
148 }
149 
150 
156 {
157 
159  cu->SetDebug(kDebug);
160 
161 
162  cu->SwitchOffClusterPlot();
163 
164  cu->SwitchOffRecalculateClusterTrackMatching(); // Done in clusterization
165 
167 
169 
170  AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
171 
172  cu->SwitchOffRecalibration();
176  cu->SwitchOffEMCALOADB() ;
177 
178  // PHOS
180 
181  if(kPrint) cu->Print("");
182 
183  return cu;
184 
185 }
186 
187 
192 {
194  ana->SetDebug(kDebug); //10 for lots of messages
195 
196  // cluster selection cuts
197 
198  ana->SwitchOffFiducialCut();
199 
200 
201  ana->AddToHistogramsName("AnaGenKine_");
202  SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
203 
204  if(kPrint)ana->Print("");
205 
206  return ana;
207 }
208 
213 {
214  histoRanges->SetHistoPtRangeAndNBins(0, 200, 400) ; // Energy and pt histograms
215 
216  if(kCalorimeter=="EMCAL")
217  {
218  if(kYears==2010)
219  {
220  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 122*TMath::DegToRad(), 78) ;
221  histoRanges->SetHistoXRangeAndNBins(-230,90,120); // QA
222  histoRanges->SetHistoYRangeAndNBins(370,450,40); // QA
223  }
224  else if ( year < 2014 )
225  {
226  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
227  histoRanges->SetHistoXRangeAndNBins(-460,90,200); // QA
228  histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
229  }
230  else // Run2
231  {
232  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 329*TMath::DegToRad(), 250) ;
233  histoRanges->SetHistoXRangeAndNBins(-460,460,230); // QA
234  histoRanges->SetHistoYRangeAndNBins(-450,450,225); // QA
235  }
236 
237  histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
238  }
239  else
240  {
241  histoRanges->SetHistoPhiRangeAndNBins(250*TMath::DegToRad(), 320*TMath::DegToRad(), 70) ;
242  histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
243  }
244 
245  histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500);
246 
247  // Invariant mass histoRangeslysis
248  histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
249  histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
250 
251  // check if time calibration is on
252  histoRanges->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
253  histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
254 
255  // track-cluster residuals
256  histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.15,0.15,300);
257  histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.15,0.15,300);
258  histoRanges->SetHistodRRangeAndNBins(0.,0.15,150);//QA
259 
260  // QA, electron, charged
261  histoRanges->SetHistoPOverERangeAndNBins(0,10.,100);
262  histoRanges->SetHistodEdxRangeAndNBins(0.,200.,200);
263 
264  // QA
265  histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
266  histoRanges->SetHistoRatioRangeAndNBins(0.,2.,100);
267  histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
268  histoRanges->SetHistoNClusterCellRangeAndNBins(0,500,500);
269  histoRanges->SetHistoZRangeAndNBins(-350,350,175);
270  histoRanges->SetHistoRRangeAndNBins(430,460,30);
271  histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
272  histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
273  histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,5000,500);
274 }
275 
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:87
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:88
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.