AliPhysics  914d8ff (914d8ff)
 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  reader->SwitchOnStack();
118  reader->SwitchOffAODMCParticles();
119 
120  //------------------------
121  // Detector input filling
122  //------------------------
123 
124  //Min cluster/track E
125  reader->SetEMCALEMin(0.3);
126  reader->SetEMCALEMax(1000);
127  reader->SetPHOSEMin(0.3);
128  reader->SetPHOSEMax(1000);
129  reader->SetCTSPtMin(0.2);
130  reader->SetCTSPtMax(1000);
131 
132  reader->SwitchOnFiducialCut();
133  //reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
134 
135  reader->SwitchOffCTS();
136  reader->SwitchOffEMCALCells();
137  reader->SwitchOffEMCAL();
138  reader->SwitchOffPHOSCells();
139  reader->SwitchOffPHOS();
140 
141  reader->SetZvertexCut(10.); // Open cut
142  reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
143 
144  reader->SwitchOffPileUpEventRejection(); // remove pileup by default
145  reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
146 
147  if(kPrint)reader->Print("");
148 
149  return reader;
150 
151 }
152 
153 
159 {
160 
162  cu->SetDebug(kDebug);
163 
164 
165  cu->SwitchOffClusterPlot();
166 
167  cu->SwitchOffRecalculateClusterTrackMatching(); // Done in clusterization
168 
170 
172 
173  AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
174 
175  cu->SwitchOffRecalibration();
179  cu->SwitchOffEMCALOADB() ;
180 
181  // PHOS
183 
184  if(kPrint) cu->Print("");
185 
186  return cu;
187 
188 }
189 
190 
195 {
197  ana->SetDebug(kDebug); //10 for lots of messages
198 
199  // cluster selection cuts
200 
201  ana->SwitchOffFiducialCut();
202 
203 
204  ana->AddToHistogramsName("AnaGenKine_");
205  SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
206 
207  if(kPrint)ana->Print("");
208 
209  return ana;
210 }
211 
216 {
217  histoRanges->SetHistoPtRangeAndNBins(0, 200, 400) ; // Energy and pt histograms
218 
219  if(kCalorimeter=="EMCAL")
220  {
221  if(kYears==2010)
222  {
223  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 122*TMath::DegToRad(), 78) ;
224  histoRanges->SetHistoXRangeAndNBins(-230,90,120); // QA
225  histoRanges->SetHistoYRangeAndNBins(370,450,40); // QA
226  }
227  else if ( year < 2014 )
228  {
229  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
230  histoRanges->SetHistoXRangeAndNBins(-460,90,200); // QA
231  histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
232  }
233  else // Run2
234  {
235  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 329*TMath::DegToRad(), 250) ;
236  histoRanges->SetHistoXRangeAndNBins(-460,460,230); // QA
237  histoRanges->SetHistoYRangeAndNBins(-450,450,225); // QA
238  }
239 
240  histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
241  }
242  else
243  {
244  histoRanges->SetHistoPhiRangeAndNBins(250*TMath::DegToRad(), 320*TMath::DegToRad(), 70) ;
245  histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
246  }
247 
248  histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500);
249 
250  // Invariant mass histoRangeslysis
251  histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
252  histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
253 
254  // check if time calibration is on
255  histoRanges->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
256  histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
257 
258  // track-cluster residuals
259  histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.15,0.15,300);
260  histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.15,0.15,300);
261  histoRanges->SetHistodRRangeAndNBins(0.,0.15,150);//QA
262 
263  // QA, electron, charged
264  histoRanges->SetHistoPOverERangeAndNBins(0,10.,100);
265  histoRanges->SetHistodEdxRangeAndNBins(0.,200.,200);
266 
267  // QA
268  histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
269  histoRanges->SetHistoRatioRangeAndNBins(0.,2.,100);
270  histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
271  histoRanges->SetHistoNClusterCellRangeAndNBins(0,500,500);
272  histoRanges->SetHistoZRangeAndNBins(-350,350,175);
273  histoRanges->SetHistoRRangeAndNBins(430,460,30);
274  histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
275  histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
276  histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,5000,500);
277 }
278 
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.