AliPhysics  c6e65cb (c6e65cb)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddTaskClusterShape.C
Go to the documentation of this file.
1 
10 // Set includes for compilation
11 
12 #if !defined(__CINT__) || defined(__MAKECINT__)
13 
14 #include <TString.h>
15 #include <TROOT.h>
16 
17 #include "AliLog.h"
19 #include "AliCaloTrackESDReader.h"
20 #include "AliCaloTrackAODReader.h"
21 #include "AliCalorimeterUtils.h"
23 #include "AliHistogramRanges.h"
24 #include "AliAnaCalorimeterQA.h"
27 #include "AliAnalysisManager.h"
28 #include "AliInputEventHandler.h"
29 #include "AliVTrack.h"
31 #include "AliESDtrackCuts.h"
32 #include "CreateTrackCutsPWGJE.C"
35 
36 #endif
37 
38  // Declare methods for compilation
39 
41 (TString col, Bool_t simulation,
42  TString clustersArray, Bool_t tender,
43  TString calorimeter, Bool_t nonLinOn,
44  TString trigger, Bool_t rejectEMCTrig,
45  Int_t minCen, Int_t maxCen,
46  Bool_t printSettings, Int_t debug );
47 
49 (TString col, Bool_t simulation,
50  Bool_t tender,
51  Bool_t nonLinOn, Int_t year,
52  Bool_t printSettings, Int_t debug );
53 
55 (Bool_t tmPtDep, TString col , Bool_t simulation,
56  TString calorimeter, Int_t year, Bool_t printSettings, Int_t debug);
57 
59 (TString col, Bool_t simulation,
61  Bool_t printSettings, Int_t debug );
62 
65  TString calorimeter , Int_t year,
66  TString col , Bool_t simulation,
67  Bool_t printSettings, Int_t debug);
68 
69 
72 
73 //
75 //const char* kPeriod = "LHC16t"; // gSystem->Getenv("ALIEN_JDL_LPMPRODUCTIONTAG");
76 //const char* kColType = "PbPb"; // gSystem->Getenv("ALIEN_JDL_LPMINTERACTIONTYPE"); //either "pp", "pPb" or "PbPb"
77 //const char* kProdType = "MC"; // gSystem->Getenv("ALIEN_JDL_LPMPRODUCTIONTYPE");
78 //Bool_t kMC = kFALSE;
79 
101 (
102  TString calorimeter = "EMCAL",
103  Bool_t simulation = kFALSE,
104  TString collision = "pp",
105  TString period = "",
106  Int_t rejectEMCTrig = 0,
107  TString clustersArray = "",
108  Bool_t tender = kFALSE,
109  Bool_t nonLinOn = kFALSE,
110  Bool_t tmDep = kTRUE,
111  Bool_t qaAn = kFALSE,
112  TString outputfile = "",
113  Bool_t printSettings = kFALSE,
114  Int_t debug = 0, // Debug level
115  const char *trigSuffix = "EMC7"
116 )
117 {
118  // Check the global variables, and reset the provided ones if empty.
119  //
120  TString trigger = trigSuffix;
121 
122  if(collision=="")
123  {
124  if (!strcmp(kColType, "PbPb")) collision = "PbPb";
125  else if (!strcmp(kColType, "AA" )) collision = "PbPb";
126  else if (!strcmp(kColType, "pA" )) collision = "pPb";
127  else if (!strcmp(kColType, "Ap" )) collision = "pPb";
128  else if (!strcmp(kColType, "pPb" )) collision = "pPb";
129  else if (!strcmp(kColType, "Pbp" )) collision = "pPb";
130  else if (!strcmp(kColType, "pp" )) collision = "pp" ;
131 
132  simulation = kMC;
133  period = kPeriod;
134 
135  // print check on global settings once
136  if(trigger.Contains("default") ||trigger.Contains("INT") || trigger.Contains("MB") )
137  printf("AddTaskClusterShape() - Get the data features from global parameters: collision <%s>, period <%s>, mc <%d> \n",
138  kColType,kPeriod,kMC);
139  }
140 
141  Int_t year = 2017;
142  if ( period!="" )
143  {
144  if (period.Contains("16")) year = 2016;
145  else if(period.Contains("15")) year = 2015;
146  else if(period.Contains("13")) year = 2013;
147  else if(period.Contains("12")) year = 2012;
148  else if(period.Contains("11")) year = 2011;
149  else if(period.Contains("10")) year = 2010;
150  }
151 
152  // Get the pointer to the existing analysis manager via the static access method.
153  //
154  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
155  if (!mgr)
156  {
157  ::Error("AddTaskClusterShape", "No analysis manager to connect to.");
158  return NULL;
159  }
160 
161  // Check the analysis type using the event handlers connected to the analysis manager.
162 
163  if (!mgr->GetInputEventHandler())
164  {
165  ::Error("AddTaskClusterShape", "This task requires an input event handler");
166  return NULL;
167  }
168 
169  //
170  // Create task
171  //
172 
173  // Name for containers
174  kAnaClusterShape = Form("ShapeAna%s_%s",trigger.Data(),clustersArray.Data());
175 
176  Int_t minCen = -1, maxCen = -1;
177 
178  if(collision=="PbPb" && maxCen>=0) kAnaClusterShape+=Form("Cen%d_%d",minCen,maxCen);
179 
180  // Create task
181 
182  AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation (Form("%s",kAnaClusterShape.Data()));
183 
184  task->SetDebugLevel(debug);
185 
186  // task->SetFirstEvent(1800);
187  // task->SetLastEvent (2000);
188 
190 
191  task->SetAnalysisMaker(maker);
192 
193  mgr->AddTask(task);
194 
195  //
196  // Create containers
197 
198  if(outputfile.Length()==0) outputfile = AliAnalysisManager::GetCommonFileName();
199 
200  TString containerName = Form("Shape_%s",calorimeter.Data());
201  if(clustersArray.Length()>0) containerName = Form("%s_%s",containerName.Data(),clustersArray.Data());
202 
203  TString subcontainerName = Form("%s",trigger.Data());
204  if(clustersArray.Length()>0) subcontainerName = Form("%s_%s",subcontainerName.Data(),clustersArray.Data());
205 
206  AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(subcontainerName, TList::Class(),
207  AliAnalysisManager::kOutputContainer,
208  Form("%s:%s",outputfile.Data(),containerName.Data()));
209 
210  AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("Param_%s",subcontainerName.Data()), TList::Class(),
211  AliAnalysisManager::kParamContainer,
212  Form("%s_Parameters.root",containerName.Data()));
213 
214 
215  // Create ONLY the output containers for the data produced by the task.
216  // Get and connect other common input/output containers via the manager as below
217  mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
218  mgr->ConnectOutput (task, 1, cout_pc);
219  mgr->ConnectOutput (task, 2, cout_cuts);
220  //==============================================================================
221 
222  // Do not configure the wagon for certain analysis combinations
223  // But create the task so that the sub-wagon train can run
224  //
225  gROOT->LoadMacro("$ALICE_PHYSICS/PWGGA/CaloTrackCorrelations/macros/CheckActiveEMCalTriggerPerPeriod.C");
226  Bool_t doAnalysis = CheckActiveEMCalTriggerPerPeriod(simulation,trigger,period,year);
227  if(!doAnalysis)
228  {
229  maker->SwitchOffProcessEvent();
230  return task;
231  }
232 
233  // #### Start analysis configuration ####
234  //
235  TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
236 
237  // Make sure the B field is enabled for track selection, some cuts need it
238  //
239  ((AliInputEventHandler*)mgr->GetInputEventHandler())->SetNeedField(kTRUE);
240 
241  // Print settings to check all is as expected
242  //
243  printf("AddTaskClusterShape() - Task NAME: %s; Passed settings\n",kAnaClusterShape.Data());
244 
245  printf("\t calorimeter <%s>, simulation <%d>, year <%d>, collision <%s>, trigger <%s>, reject EMC <%d>,\n"
246  "\t clustersArray <%s>, tender <%d>, non linearity <%d>, TM dep <%d>, QA on <%d>,\n"
247  "\t outputfile <%s>, printSettings <%d>, debug <%d>\n",
248  calorimeter.Data(),simulation,year,collision.Data(),trigger.Data(), rejectEMCTrig,
249  clustersArray.Data(),tender, nonLinOn, tmDep, qaAn, outputfile.Data(),printSettings,debug);
250 
251 
252  // General frame setting and configuration
253  maker->SetReader ( ConfigureReader (collision,simulation,clustersArray,tender,calorimeter,nonLinOn,trigger,rejectEMCTrig,minCen,maxCen,printSettings,debug) );
254  maker->SetCaloUtils( ConfigureCaloUtils(collision,simulation,tender,nonLinOn,year,printSettings,debug) );
255 
256  // Analysis tasks setting and configuration
257  Int_t n = 0;//Analysis number, order is important
258 
259  // SHAPE
260  maker->AddAnalysis(ConfigureClusterShape(tmDep, collision,simulation,calorimeter,year,printSettings,debug) , n++);
261 
262  // Detector QA
263  if (qaAn) maker->AddAnalysis(ConfigureQAAnalysis(collision,simulation,calorimeter,year,printSettings,debug) , n++);
264 
265 
266  maker->SetAnaDebug(debug) ;
267 
268  maker->SwitchOnHistogramsMaker() ;
269  maker->SwitchOnAODsMaker() ;
270 
271  //if( simulation || !trigger.Contains("EMC") )
273 
274  if(simulation)
275  {
276  // Calculate the cross section weights, apply them to all histograms
277  // and fill xsec and trial histo. Sumw2 must be activated.
278  //maker->GetReader()->GetWeightUtils()->SwitchOnMCCrossSectionCalculation();
279  //maker->SwitchOnSumw2Histograms();
280 
281  // Just fill cross section and trials histograms.
283 
284  // For recent productions where the cross sections and trials are not stored in separate file
285  TString prodName = gSystem->Getenv("ALIEN_JDL_LPMPRODUCTIONTAG");
286  printf("AddTaskClusterShape() - MC production name: %s\n",prodName.Data());
287  if ( prodName.Contains("LHC16c") ) // add here any other affected periods, for the moment jet-jet 8 TeV
288  {
289  printf("\t use the cross section from EventHeader per Event\n");
291  }
292 
293  // Add control histogram with pT hard to control aplication of weights
294  maker->SwitchOnPtHardHistogram();
295  }
296 
297  if(printSettings) maker->Print("");
298 
299  printf("AddTaskClusterShape() - << End Configuration of %d analysis for calorimeter %s >>\n",n, calorimeter.Data());
300 
301 
302  //
303  // Select events trigger depending on trigger
304  //
305  if(!simulation)
306  {
307  gROOT->LoadMacro("$ALICE_PHYSICS/PWGGA/CaloTrackCorrelations/macros/ConfigureAndGetEventTriggerMaskAndCaloTriggerString.C");
308  TString caloTriggerString = "";
309  UInt_t mask = ConfigureAndGetEventTriggerMaskAndCaloTriggerString(trigger, year, caloTriggerString);
310 
311  maker->GetReader()->SetFiredTriggerClassName(caloTriggerString);
312 
313  task ->SelectCollisionCandidates( mask );
314  }
315 
316  return task;
317 }
318 
323  TString clustersArray, Bool_t tender,
324  TString calorimeter, Bool_t nonLinOn,
325  TString trigger, Bool_t rejectEMCTrig,
326  Int_t minCen, Int_t maxCen,
327  Bool_t printSettings, Int_t debug )
328 {
329  // Get the data type ESD or AOD
330  AliAnalysisManager * mgr = AliAnalysisManager::GetAnalysisManager();
331  TString inputDataType = mgr->GetInputEventHandler()->GetDataType();
332 
333  AliCaloTrackReader * reader = 0;
334  if (inputDataType == "AOD") reader = new AliCaloTrackAODReader();
335  else if(inputDataType == "ESD") reader = new AliCaloTrackESDReader();
336  else printf("AddTaskClusterShape::ConfigureReader() - Data not known InputData=%s\n",inputDataType.Data());
337 
338  reader->SetDebug(debug);//10 for lots of messages
339 
340  //
341  // MC settings
342  //
343  // Check if kine stack is available, independent of request of simulation
344 // Bool_t useKinematics = kFALSE;
345 // useKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
346 //
347 // if(simulation)
348 // {
349 // if (!useKinematics && inputDataType=="AOD") useKinematics = kTRUE; //AOD primary should be available ...
350 // }
351 
352  // In case of Pythia pt Hard bin simulations (jet-jet, gamma-jet)
353  // reject some special events that bother the cross section
354  if(simulation)
355  {
356  // Event rejection cuts for jet-jet simulations, do not use in other
357  reader->SetPtHardAndJetPtComparison(kTRUE);
358  reader->SetPtHardAndJetPtFactor(2);
359 
360  reader->SetPtHardAndClusterPtComparison(kTRUE);
361  reader->SetPtHardAndClusterPtFactor(1.5);
362  }
363 
364  //------------------------
365  // Detector input filling
366  //------------------------
367 
368  //Min cluster/track E
369  reader->SetEMCALEMin(0.3);
370  reader->SetEMCALEMax(1000);
371  reader->SetPHOSEMin(0.3);
372  reader->SetPHOSEMax(1000);
373  reader->SetCTSPtMin(0.2);
374  reader->SetCTSPtMax(1000);
375 
376  reader->SetEMCALBadChannelMinDist(5);
377  reader->SetEMCALNCellsCut(2);
378 
381 
382  // Shower shape smearing
383  // Set it in the train configuration page not here for the moment
384  // if(simulation)
385  // {
386  // reader->SwitchOffShowerShapeSmearing(); // Active only on MC, off by default
387  // reader->SetShowerShapeSmearWidth(0.005);
388  // }
390 
391  //
392  // Tracks
393  //
394  reader->SwitchOffCTS();
395 
396  reader->SwitchOffUseTrackTimeCut();
397  reader->SetTrackTimeCut(0,50);
398 
399  reader->SwitchOnFiducialCut();
400  reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
401 
402  reader->SwitchOffUseTrackDCACut();
403  //reader->SetTrackDCACut(0,0.0105);
404  //reader->SetTrackDCACut(1,0.035);
405  //reader->SetTrackDCACut(2,1.1);
406 
407  if(inputDataType=="ESD")
408  {
409  gROOT->LoadMacro("$ALICE_PHYSICS/PWGJE/macros/CreateTrackCutsPWGJE.C");
410 
411  //AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10041004);
412  //reader->SetTrackCuts(esdTrackCuts);
413 
414  AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001008);
415  reader->SetTrackCuts(esdTrackCuts);
416  AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10011008);
417  reader->SetTrackComplementaryCuts(esdTrackCuts2);
418 
420  }
421  else if(inputDataType=="AOD")
422  {
423  reader->SwitchOnAODHybridTrackSelection(); // Check that the AODs have Hybrids!!!!
425  reader->SetTrackStatus(AliVTrack::kITSrefit);
426 
427  //reader->SwitchOnAODPrimaryTrackSelection(); // Used in preliminary results of QM from Nicolas and Xiangrong?
428  //reader->SwitchOnTrackHitSPDSelection(); // Check that the track has at least a hit on the SPD, not much sense to use for hybrid or TPC only tracks
429  //reader->SetTrackFilterMask(128); // Filter bit, not mask, use if off hybrid, TPC only
430  }
431 
432  //
433  // Calorimeter
434  //
435  if(clustersArray == "" && !tender)
436  {
437  printf("AddTaskClusterShape::ConfigureReader() - **************** Standard EMCAL clusters branch analysis **************** \n");
439  // Check in ConfigureCaloUtils that the recalibration and bad map are ON
440  }
441  else
442  {
443  printf("AddTaskClusterShape::ConfigureReader() - **************** Input for analysis is Clusterizer %s **************** \n", clustersArray.Data());
444  reader->SetEMCALClusterListName(clustersArray);
446  }
447 
448  // Time cuts
450  if(simulation)
451  {
452  reader->SwitchOffUseEMCALTimeCut();
453  reader->SetEMCALTimeCut(-1e10,1e10); // Open time cut
454  }
455  else
456  {
457  reader->SwitchOnUseEMCALTimeCut();
458  reader->SetEMCALTimeCut(-25,20);
459  }
460 
461  // CAREFUL
462  if(nonLinOn) reader->SwitchOnClusterELinearityCorrection();
464 
465  if(calorimeter == "EMCAL")
466  {
467  reader->SwitchOnEMCALCells();
468  reader->SwitchOnEMCAL();
469  }
470 
471  if(calorimeter == "PHOS")
472  { // Should be on if QA is activated with correlation on
473  reader->SwitchOnPHOSCells();
474  reader->SwitchOnPHOS();
475  }
476 
477  //-----------------
478  // Event selection
479  //-----------------
480 
481  //if(!simulation) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma
482 
483  // Event triggered by EMCal selection settings
486 
487  if( rejectEMCTrig > 0 && !simulation && (trigger.Contains("EMC") || trigger.Contains("L")))
488  {
489  printf("AddTaskClusterShape::ConfigureReader() === Remove bad triggers === \n");
492 
493  // reader->SetTriggerPatchTimeWindow(8,9); // default values
494  // if (kRunNumber < 146861) reader->SetEventTriggerL0Threshold(3.);
495  // else if(kRunNumber < 154000) reader->SetEventTriggerL0Threshold(4.);
496  // else if(kRunNumber < 165000) reader->SetEventTriggerL0Threshold(5.5);
497  // //redefine for other periods, triggers
498  //
499  // if(kRunNumber < 172000)
500  // {
501  // reader->SetEventTriggerL1Bit(4,5); // current LHC11 data
502  // printf("\t Old L1 Trigger data format!\n");
503  // }
504  // else
505  // {
506  // reader->SetEventTriggerL1Bit(6,8); // LHC12-13 data
507  // printf("\t Current L1 Trigger data format!\n");
508  // }
509 
510  if(clustersArray != "" || tender)
511  {
512  printf("AddTaskClusterShape::ConfigureReader() - Trigger cluster calibration OFF\n");
514  }
515 
516  }
517 
518  //reader->RejectFastClusterEvents() ;
519 
520  // For mixing with AliAnaParticleHadronCorrelation switch it off
521  reader->SwitchOnEventTriggerAtSE(); // on is default case
522 
523  reader->SetZvertexCut(10.); // Open cut
524  reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
525 
526  reader->SwitchOnRejectNoTrackEvents();
527  reader->SetTrackMultiplicityEtaCut(0.8);
528 
529  reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
530  reader->SwitchOnPileUpEventRejection(); // remove pileup by default off, apply it only for MB not for trigger
531 
532  if(col=="PbPb")
533  {
534  // Centrality
535  reader->SetCentralityClass("V0M");
536  reader->SetCentralityOpt(100); // 10 (c= 0-10, 10-20 ...), 20 (c= 0-5, 5-10 ...) or 100 (c= 1, 2, 3 ..)
537  reader->SetCentralityBin(minCen,maxCen); // Accept all events, if not select range
538  // Event plane (only used in Maker and mixing for AliAnaPi0/AliAnaHadronCorrelation for the moment)
539  reader->SetEventPlaneMethod("V0");
540  }
541 
542  if(printSettings) reader->Print("");
543 
544  return reader;
545 }
546 
551  Bool_t tender,
552  Bool_t nonLinOn, Int_t year,
553  Bool_t printSettings, Int_t debug)
554 {
556 
557  cu->SetDebug(debug);
558 
559  // Remove clusters close to borders, at least max energy cell is 1 cell away
562 
564 
565  if (year == 2010) cu->SetNumberOfSuperModulesUsed(4);
566  else if(year <= 2013) cu->SetNumberOfSuperModulesUsed(10);
567  else if(year > 2013) cu->SetNumberOfSuperModulesUsed(20);
568  else cu->SetNumberOfSuperModulesUsed(10);
569 
570  printf("AddTaskClusterShape::ConfigureCaloUtils() xxx Number of SM set to <%d> xxx\n",
572 
573  // Search of local maxima in cluster
574  if(col=="pp")
575  {
576  cu->SetLocalMaximaCutE(0.1);
577  cu->SetLocalMaximaCutEDiff(0.03);
578  }
579  else
580  {
581  cu->SetLocalMaximaCutE(0.2);
582  cu->SetLocalMaximaCutEDiff(0.03);
583  }
584 
586 
588 
589  // EMCAL settings
590 
591  if(!simulation)
593 
594  AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
595 
596  // calibrations
597  Bool_t calibEner = kFALSE;
598  Bool_t calibTime = kFALSE;
601 
602  if( !tender )
603  {
604  cu->SwitchOnRecalibration(); // Check the reader if it is taken into account during filtering
606 
607  calibEner = kTRUE;
608  calibTime = kTRUE;
609  }
610 
611  if( simulation )
612  {
613  calibEner = kFALSE;
614  calibTime = kFALSE;
615 
616  cu->SwitchOffRecalibration(); // Check the reader if it is taken into account during filtering
618  }
619 
620  gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/EMCAL/macros/ConfigureEMCALRecoUtils.C");
622  simulation,
623  kTRUE, // exotic
624  nonLinOn, // Non linearity
625  calibEner, // E calib
626  kTRUE, // bad map
627  calibTime); // time calib
628 
629  //if( calibTime ) recou->SetExoticCellDiffTimeCut(1e6);
630 
631  if( nonLinOn ) cu->SwitchOnCorrectClusterLinearity();
632 
633  printf("AddTaskClusterShape::ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
634  printf("AddTaskClusterShape::ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn());
635 
636  // PHOS
638 
639  if(printSettings) cu->Print("");
640 
641  return cu;
642 }
643 
648 (Bool_t tmPtDep, TString col , Bool_t simulation,
649  TString calorimeter, Int_t year, Bool_t printSettings, Int_t debug)
650 {
652 
653  ana->SetM02Min(-1);
654  ana->SetNCellsPerClusterMin(-1);
655 
656  ana->SetCalorimeter(calorimeter);
657 
658  if(simulation) ana->SetConstantTimeShift(615);
659 
660  ana->SwitchOffFiducialCut();
661 
663 
665 
666  ana->SwitchOffStudyWeight();
667 
669  ana->SwitchOffStudyExotic();
670 
671  // PID cuts (Track-matching)
672  ana->SwitchOnCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian
673  AliCaloPID* caloPID = ana->GetCaloPID();
674 
675  if(tmPtDep)
676  {
677  // track pT dependent cut
679 
680  // Begining of histograms name
681  ana->AddToHistogramsName("Shape_TMDep_");
682  }
683  else
684  {
685  // Fix
687  caloPID->SetEMCALDEtaCut(0.025);
688  caloPID->SetEMCALDPhiCut(0.030);
689 
690  // Begining of histograms name
691  ana->AddToHistogramsName("Shape_TMFix_");
692  }
693 
694  SetAnalysisCommonParameters(ana,calorimeter,year,col,simulation,printSettings,debug); // see method below
695 
696  return ana;
697 }
698 
703  TString calorimeter, Int_t year,
704  Bool_t printSettings, Int_t debug )
705 {
707 
708  ana->SetEMCALM02Min(-1);
710  ana->SetEMCALCellAmpMin(0.1);
711 
712  ana->SetCalorimeter(calorimeter);
713 
714  ana->SetTimeCut(-1e10,1e10); // Open time cut
715  if(simulation) ana->SetConstantTimeShift(615);
716 
717  ana->SwitchOffCorrelation(); // make sure you switch in the reader PHOS and EMCAL cells and clusters if option is ON
718 
720 
721  ana->SwitchOffFiducialCut();
726  // ana->SwitchOffStudyClustersAsymmetry();
727  // ana->SwitchOffStudyWeight();
728  // ana->SwitchOnStudyTCardCorrelation() ;
729  // ana->SwitchOffStudyM02Dependence() ;
731  // ana->SwitchOnStudyExotic();
732 
734 
736 
737  ana->AddToHistogramsName("QA_"); // Begining of histograms name
738 
739  SetAnalysisCommonParameters(ana,calorimeter,year,col,simulation,printSettings,debug); // see method below
740 
741  return ana;
742 }
743 
744 
752  TString calorimeter, Int_t year,
753  TString col, Bool_t simulation,
754  Bool_t printSettings, Int_t debug)
755 {
756  //
757  // Histograms ranges
758  //
759  AliHistogramRanges* histoRanges = ana->GetHistogramRanges();
760 
761  histoRanges->SetHistoPtRangeAndNBins(0, 75, 150) ; // Energy and pt histograms
762 
763  if(calorimeter=="EMCAL")
764  {
765  if ( year == 2010 )
766  {
767  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 122*TMath::DegToRad(), 78) ;
768  histoRanges->SetHistoXRangeAndNBins(-230,90,120); // QA
769  histoRanges->SetHistoYRangeAndNBins(370,450,40); // QA
770  }
771  else if ( year < 2014 )
772  {
773  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
774  histoRanges->SetHistoXRangeAndNBins(-460,90,200); // QA
775  histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
776  }
777  else // Run2
778  {
779  histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 329*TMath::DegToRad(), 250) ;
780  histoRanges->SetHistoXRangeAndNBins(-460,460,230); // QA
781  histoRanges->SetHistoYRangeAndNBins(-450,450,225); // QA
782  }
783 
784  histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
785  }
786  else if(calorimeter=="PHOS")
787  {
788  histoRanges->SetHistoPhiRangeAndNBins(250*TMath::DegToRad(), 320*TMath::DegToRad(), 70) ;
789  histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
790  }
791  else if(calorimeter=="CTS")
792  {
793  ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
794  ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
795  }
796 
797  histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 2.9, 300);
798 
799  // Invariant mass histo
800  histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
801  histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
802 
803  // check if time calibration is on
804  //histoRanges->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
805  histoRanges->SetHistoTimeRangeAndNBins(-400.,400,400);
806  histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
807 
808  // track-cluster residuals
809  histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.06,0.06,120);
810  histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.06,0.06,120);
811  histoRanges->SetHistodRRangeAndNBins(0.,0.06,60);//QA
812 
813  // QA, electron, charged
814  histoRanges->SetHistoPOverERangeAndNBins(0,1.5,150);
815  histoRanges->SetHistodEdxRangeAndNBins(0.,200.,200);
816 
817  // QA
818  histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
819  histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
820  histoRanges->SetHistoZRangeAndNBins(-350,350,175);
821  histoRanges->SetHistoRRangeAndNBins(430,460,30);
822  histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
823  histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
824 
825  // QA, correlation
826  if(col=="PbPb")
827  {
828  histoRanges->SetHistoNClusterCellRangeAndNBins(0,100,100);
829  histoRanges->SetHistoNClustersRangeAndNBins(0,500,50);
830  histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,2000,200);
831  }
832  else
833  {
834  histoRanges->SetHistoNClusterCellRangeAndNBins(0,50,50);
835  histoRanges->SetHistoNClustersRangeAndNBins(0,50,50);
836  histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,150,150);
837  }
838 
839  // xE, zT
840  histoRanges->SetHistoRatioRangeAndNBins(0.,2.,200);
841  histoRanges->SetHistoHBPRangeAndNBins (0.,10.,200);
842 
843  // Isolation
844  histoRanges->SetHistoPtInConeRangeAndNBins(0, 50 , 100);
845  histoRanges->SetHistoPtSumRangeAndNBins (0, 100, 100);
846 
847  //
848  // TRD SM
849  //
850  if (year == 2011) ana->SetFirstSMCoveredByTRD( 6);
851  else if(year == 2012 ||
852  year == 2013) ana->SetFirstSMCoveredByTRD( 4);
853  else ana->SetFirstSMCoveredByTRD(-1);
854 
855  //
856  // MC histograms?
857  //
858  if(simulation) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
859  else ana->SwitchOffDataMC() ;
860 
861  //Set here generator name, default pythia
862  //ana->GetMCAnalysisUtils()->SetMCGenerator("");
863 
864  //
865  // Debug
866  //
867  if(printSettings) ana->Print("");
868 
869  ana->SetDebug(debug); // 10 for lots of messages
870 }
871 
void SetEMCALNCellsPerClusterMin(Int_t n)
virtual void SwitchOnAODTrackSharedClusterSelection()
void SetHistoTrackMultiplicityRangeAndNBins(Int_t min, Int_t max, Int_t n)
virtual void SetDebug(Int_t d)
void SetNumberOfCellsFromPHOSBorder(Int_t n)
void SetTimeCut(Double_t min, Double_t max)
void ana(Int_t mode=mGRID)
Definition: ana.C:87
void SetSimpleCTSFiducialCut(Float_t abseta, Float_t phimin, Float_t phimax)
Configuration of AliEMCALRecoUtils.
void SetHistoMassRangeAndNBins(Float_t min, Float_t max, Int_t n)
virtual void AddToHistogramsName(TString add)
void SwitchOnFillAllTrackMatchingHistogram()
virtual void SwitchOnFiducialCut()
const int debug
Definition: scanAll.C:15
void SetHistoXRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SwitchOnLoadOwnEMCALGeometryMatrices()
void SetEMCALM02Min(Float_t m02)
virtual void SwitchOnAODHybridTrackSelection()
AliAnaClusterShapeCorrelStudies * ConfigureClusterShape(Bool_t tmPtDep, TString col, Bool_t simulation, TString calorimeter, Int_t year, Bool_t printSettings, Int_t debug)
virtual void SetCentralityBin(Int_t min, Int_t max)
AliEMCALRecoUtils * GetEMCALRecoUtils() const
void SwitchOffClusterELinearityCorrection()
void SetCTSPtMax(Float_t pt)
void SetHistoPtRangeAndNBins(Float_t min, Float_t max, Int_t n)
virtual void SetCalorimeter(TString &calo)
Set the calorimeter for the analysis. A string.
virtual void SetTrackComplementaryCuts(AliESDtrackCuts *)
TSystem * gSystem
void SetEMCALEMin(Float_t en)
void AddAnalysis(TObject *ana, Int_t n)
Add analysis depending on AliAnaCaloTrackCorrBaseClass to list.
AliCaloTrackReader * ConfigureReader(TString col, Bool_t simulation, TString clustersArray, Bool_t tender, TString calorimeter, Bool_t nonLinOn, TString trigger, Bool_t rejectEMCTrig, Int_t minCen, Int_t maxCen, Bool_t printSettings, Int_t debug)
Class for the Calorimeter QA analysis.
void SetHistodRRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetLocalMaximaCutEDiff(Float_t c)
void SwitchOnMCCrossSectionHistoFill()
Definition: AliAnaWeights.h:88
void SetNumberOfCellsFromEMCALBorder(Int_t n)
Bool_t CheckActiveEMCalTriggerPerPeriod(Bool_t simulation, TString trigger, TString period, Int_t year)
const TString calorimeter
Definition: anaM.C:36
virtual void SetPtHardAndJetPtComparison(Bool_t compare)
Bool_t IsRecalibrationOn() const
void SetHistoTrackResidualEtaRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SwitchOnMCCrossSectionFromEventHeader()
Definition: AliAnaWeights.h:90
virtual void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
void SetAnalysisCommonParameters(AliAnaCaloTrackCorrBaseClass *ana, TString calorimeter, Int_t year, TString col, Bool_t simulation, Bool_t printSettings, Int_t debug)
Class for event, clusters and tracks filtering and preparation for the AOD analysis.
AliAnaCalorimeterQA * ConfigureQAAnalysis(TString col, Bool_t simulation, TString calorimeter, Int_t year, Bool_t printSettings, Int_t debug)
void SetCTSPtMin(Float_t pt)
void SetEMCALDPhiCut(Float_t dcut)
Definition: AliCaloPID.h:221
void SwitchOffRecalculateClusterTrackMatching()
Bool_t kMC
Definition: ana.C:63
void SwitchOffVertexBCEventSelection()
AliAnalysisTaskCaloTrackCorrelation * AddTaskClusterShape(TString calorimeter="EMCAL", Bool_t simulation=kFALSE, TString collision="pp", TString period="", Int_t rejectEMCTrig=0, TString clustersArray="", Bool_t tender=kFALSE, Bool_t nonLinOn=kFALSE, Bool_t tmDep=kTRUE, Bool_t qaAn=kFALSE, TString outputfile="", Bool_t printSettings=kFALSE, Int_t debug=0, const char *trigSuffix="EMC7")
virtual void SetPtHardAndClusterPtFactor(Float_t factor)
Base class for CaloTrackCorr analysis algorithms.
void SetHistoPtInConeRangeAndNBins(Float_t min, Float_t max, Int_t n)
Check EMCal trigger availability in period.
virtual void SetDebug(Int_t d)
void SetHistoPOverERangeAndNBins(Float_t min, Float_t max, Int_t n)
virtual AliFiducialCut * GetFiducialCut()
virtual void SetCentralityOpt(Int_t opt)
void SetHistoPhiRangeAndNBins(Float_t min, Float_t max, Int_t n)
int Int_t
Definition: External.C:63
virtual AliHistogramRanges * GetHistogramRanges()
unsigned int UInt_t
Definition: External.C:33
void SwitchOnDataControlHistograms(Int_t lev=1)
TString kAnaClusterShape
Global name to be composed of the settings, used to set the AOD branch name.
void SetHistoPtSumRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetTrackStatus(ULong_t bit)
Bool_t IsBadChannelsRemovalSwitchedOn() const
void SetHistoTrackResidualPhiRangeAndNBins(Float_t min, Float_t max, Int_t n)
Class for cluster shape, cell T-Card correlation and exoticity.
void SetEMCALBadChannelMinDist(Float_t di)
void SetEMCALNCellsCut(Int_t nc)
virtual void SetPtHardAndClusterPtComparison(Bool_t compare)
void SwitchOffTriggerClusterTimeRecal()
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 SwitchOffBadTriggerEventsRemoval()
void SetEMCALClusterListName(TString &name)
Int_t GetNumberOfSuperModulesUsed() const
void SetAnalysisMaker(AliAnaCaloTrackCorrMaker *const maker)
void SetTrackMultiplicityEtaCut(Float_t eta)
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.
void SetConstantTimeShift(Float_t shift)
virtual void SetZvertexCut(Float_t zcut=10.)
void SetNumberOfSuperModulesUsed(Int_t nSM)
UInt_t ConfigureAndGetEventTriggerMaskAndCaloTriggerString(TString trigger, Int_t year, TString &triggerString)
Class containing more common histogram axis types.
virtual void SetPtHardAndJetPtFactor(Float_t factor)
Class for event, clusters and tracks filtering and preparation for the ESD analysis.
virtual void SetEventPlaneMethod(TString m)
void SetPHOSEMin(Float_t en)
void SetReader(AliCaloTrackReader *re)
void SetHistoNClustersRangeAndNBins(Int_t min, Int_t max, Int_t n)
void ConfigureEMCALRecoUtils(AliEMCALRecoUtils *reco, Bool_t bMC=kFALSE, Bool_t bExotic=kTRUE, Bool_t bNonLin=kFALSE, Bool_t bRecalE=kTRUE, Bool_t bBad=kTRUE, Bool_t bRecalT=kTRUE, Int_t debug=-1)
virtual void SetTrackCuts(AliESDtrackCuts *)
void SetEMCALCellAmpMin(Float_t amp)
virtual void SetCentralityClass(TString name)
void SwitchOnBadTriggerEventsRemoval()
AliCalorimeterUtils * ConfigureCaloUtils(TString col, Bool_t simulation, Bool_t tender, Bool_t nonLinOn, Int_t year, Bool_t printSettings, Int_t debug)
void SetHistoEtaRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SwitchOnClusterELinearityCorrection()
void SetTrackTimeCut(Double_t a, Double_t b)
void SetEMCALTimeCut(Double_t a, Double_t b)
Configuration of the event trigger.
void SetHistoAsymmetryRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetHistoV0MultiplicityRangeAndNBins(Int_t min, Int_t max, Int_t n)
void SwitchOnEMCTrackPtDepResMatching()
Definition: AliCaloPID.h:228
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 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)
Class for PID selection with calorimeters.
Definition: AliCaloPID.h:53
void SetFiredTriggerClassName(TString name)
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.
void SwitchOffEMCTrackPtDepResMatching()
Definition: AliCaloPID.h:229
AliCaloTrackReader * GetReader()
virtual void SwitchOnConstrainTrackToVertex()
AliAnaWeights * GetWeightUtils()
void SetHistoHBPRangeAndNBins(Float_t min, Float_t max, Int_t n)
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 SetEMCALDEtaCut(Float_t dcut)
Definition: AliCaloPID.h:218
void SwitchOffUseParametrizedTimeCut()
void SetLocalMaximaCutE(Float_t cut)
void SetHistoRatioRangeAndNBins(Float_t min, Float_t max, Int_t n)
void SetCaloUtils(AliCalorimeterUtils *cu)
Steering class of package CaloTrackCorrelartions.