AliPhysics  master (3d17d9d)
AddTaskCaloTrackCorrBase.C
Go to the documentation of this file.
1 
12 // Set includes for compilation
13 
14 #if !defined(__CINT__) || defined(__MAKECINT__)
15 
16 // ROOT
17 #include <TString.h>
18 #include <TSystem.h>
19 #include <TROOT.h>
20 
21 // AliPhysics
22 #include "AliAnalysisManager.h"
23 #include "AliInputEventHandler.h"
24 #include "AliVTrack.h"
25 #include "AliAODTrack.h"
26 #include "AliESDtrack.h"
27 #include "AliESDtrackCuts.h"
28 
29 // CaloTrackCorrelations frame
30 #include "AliCaloTrackESDReader.h"
31 #include "AliCaloTrackAODReader.h"
32 #include "AliCalorimeterUtils.h"
35 
36 // Macros
37 R__ADD_INCLUDE_PATH($ALICE_PHYSICS)
38 #include "PWGGA/CaloTrackCorrelations/macros/ConfigureAndGetEventTriggerMaskAndCaloTriggerString.C"
39 #include "PWGJE/macros/CreateTrackCutsPWGJE.C"
41 
42 #endif
43 
58  TString col , Int_t year, Bool_t simulation,
59  Bool_t rejectEMCTrig, TString trigger,
60  Int_t minCen , Int_t maxCen )
61 {
62  //
63  // Vertex criteria
64  //
65  reader->SetZvertexCut(10.);
66  reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex is found
67  reader->SwitchOffRejectNoTrackEvents(); // careful if on and productions with no TPC (muon_calo)
68 
71 
72  reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
73  //reader->RejectFastClusterEvents() ;
74 
75  //
76  // Pile-up
77  //
78  if ( cutsString.Contains("SPDPileUp") )
79  {
80  printf("AddTaskCaloTrackCorrBase::ConfigureReader() - Switch on Pile-up event rejection by SPD\n");
81  reader->SwitchOnPileUpEventRejection(); // remove pileup by default off, apply it only for MB not for trigger
82  if ( year > 2013 ) reader->SetPileUpParamForSPD(0,5);
83  }
84 
85  //
86  // Centrality
87  //
88  if ( col == "PbPb" )
89  {
90  reader->SetCentralityClass("V0M");
91  reader->SetCentralityOpt(100); // 10 (c= 0-10, 10-20 ...), 20 (c= 0-5, 5-10 ...) or 100 (c= 1, 2, 3 ..)
92  reader->SetCentralityBin(minCen,maxCen); // Accept all events, if not select range
93 
94  //reader->SwitchOnAcceptOnlyHIJINGLabels();
95 
96  // Event plane (only used in Maker and mixing for AliAnaPi0/AliAnaHadronCorrelation for the moment)
97  reader->SetEventPlaneMethod("V0");
98  }
99 
100  //
101  // In case of Pythia pt Hard bin simulations (jet-jet, gamma-jet)
102  // reject some special events that bother the cross section
103  //
104  if ( simulation && cutsString.Contains("PtHardCut"))
105  {
106  // Event rejection cuts for jet-jet simulations, do not use in other
107  if ( cutsString.Contains("JetJet") )
108  {
109  reader->SetPtHardAndJetPtComparison(kTRUE);
110  reader->SetPtHardAndJetPtFactor(2);
111  }
112 
113  // Event rejection more suitable for gamma-jet simulations, do not use in other
114  if ( cutsString.Contains("GamJet") )
115  {
116  reader->SetPtHardAndClusterPtComparison(kTRUE);
117  reader->SetPtHardAndClusterPtFactor(1.5);
118  }
119 
120  // Set here generator name, default pythia
121  //reader->GetMCAnalysisUtils()->SetMCGenerator("");
122  }
123 
124  // Reject LED events in Physics events
125  reader->SwitchOffLEDEventsRemoval();
126  if ( cutsString.Contains("RemoveLEDEvents1") ) reader->SwitchOnLEDEventsRemoval(1); // LHC11a
127  if ( cutsString.Contains("RemoveLEDEvents2") ) reader->SwitchOnLEDEventsRemoval(2); // Run2 pp 13 TeV
128  if ( cutsString.Contains("RemoveLEDEvents") && cutsString.Contains("Strip") )
130  //
131  // Calorimeter Trigger Selection
132  //
133 
134  //if(!simulation) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma
135 
136  // Event triggered by EMCal selection settings
137  // very old ways, not up to date
140 
141  if ( rejectEMCTrig > 0 && !simulation && (trigger.Contains("EMC") || trigger.Contains("L")) )
142  {
143  printf("AddTaskCaloTrackCorrBase::ConfigureReader() === Remove bad triggers === \n");
146 
147  // reader->SetTriggerPatchTimeWindow(8,9); // default values
148  // if (kRunNumber < 146861) reader->SetEventTriggerL0Threshold(3.);
149  // else if(kRunNumber < 154000) reader->SetEventTriggerL0Threshold(4.);
150  // else if(kRunNumber < 165000) reader->SetEventTriggerL0Threshold(5.5);
151  // //redefine for other periods, triggers
152  //
153  // if(kRunNumber < 172000)
154  // {
155  // reader->SetEventTriggerL1Bit(4,5); // current LHC11 data
156  // printf("\t Old L1 Trigger data format!\n");
157  // }
158  // else
159  // {
160  // reader->SetEventTriggerL1Bit(6,8); // LHC12-13 data
161  // printf("\t Current L1 Trigger data format!\n");
162  // }
163 
164  //reader->SwitchOffTriggerClusterTimeRecal() ;
165  }
166 }
167 
179  TString calorimeter, TString cutsString, TString clustersArray,
180  Int_t year, Bool_t simulation )
181 {
182  reader->SetEMCALEMin(0.3);
183  reader->SetEMCALEMax(1000);
184 
185  if ( calorimeter == "EMCAL" )
186  {
187  if ( year > 2014 ) reader->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.67, 81.2, 185.8) ; //12 SM
188  else if ( year > 2010 ) reader->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.67, 81.2, 178.8) ; //10 SM
189  else reader->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.67, 81.2, 118.8) ; // 4 SM
190  }
191  else if ( calorimeter == "DCAL" ) reader->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.67, 261.2, 325.8) ;
192 
193  if ( cutsString.Contains("FullCalo") )
194  reader->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.67, 81.2, 325.8) ;
195 
196  // Use other cluster array than default:
197  reader->SetEMCALClusterListName(clustersArray);
198 
199  // Time cuts
201  reader->SwitchOffUseEMCALTimeCut();
202  reader->SetEMCALTimeCut(-1e10,1e10); // Open time cut
203 
204  // For data, check what is the range needed depending on the sample
205  if ( !simulation )
206  {
207  printf("AddTaskCaloTrackCorrBase::ConfigureReader() - Apply time cut:");
208  reader->SwitchOnUseEMCALTimeCut();
209  reader->SetEMCALTimeCut(-30,30); // rather open, until high pT calibration is improved
210  printf(" -30 ns < t < 30 ns\n");
211  }
212 
213  if ( calorimeter == "EMCAL" || calorimeter == "DCAL" )
214  {
215  reader->SwitchOnEMCALCells();
216  reader->SwitchOnEMCAL();
217  }
218 
219  // EMCal shower shape smearing
220  // Set it in the train configuration page not here for the moment
221  if ( simulation && cutsString.Contains("Smearing"))
222  {
223  reader->SwitchOnShowerShapeSmearing(); // Active only on MC, off by default
224 
226  reader->SetShowerShapeSmearWidth(0.005);
227 
228  //reader->SetSmearingFunction(AliCaloTrackReader::kSmearingLandauShift);
229  //reader->SetShowerShapeSmearWidth(0.035);
230  }
231 
232  // Energy scale factor for 100 MeV clusterization threshold in MC
233  // and TRD vs no TRD SMs
234  // Factors reported in https://alice-notes.web.cern.ch/node/837
235  if ( cutsString.Contains("MCEnScale") && simulation )
236  {
237  printf("AddTaskCaloTrackCorrBase::ConfigureEMCALClusterCuts() - Set global energy scale!\n");
239 
240  if ( year == 2011 )
241  {
242  for(Int_t ism = 0; ism < 6; ism++)
243  reader->SetScaleFactorPerSM(ism, 1./1.012);
244  for(Int_t ism = 6; ism < 10; ism++)
245  reader->SetScaleFactorPerSM(ism, 1./0.998);
246  }
247  else if( year == 2012 )
248  {
249  for(Int_t ism = 0; ism < 4; ism++)
250  reader->SetScaleFactorPerSM(ism, 1./1.001);
251  for(Int_t ism = 4; ism < 10; ism++)
252  reader->SetScaleFactorPerSM(ism, 1./0.995);
253  }
254  else if( year == 2013 ) // Needs to be revised
255  {
256  for(Int_t ism = 0; ism < 4; ism++)
257  reader->SetScaleFactorPerSM(ism, 1./0.997);
258  for(Int_t ism = 4; ism < 10; ism++)
259  reader->SetScaleFactorPerSM(ism, 1./0.993);
260  }
261  else
262  printf("AddTaskCaloTrackCorrBase::ConfigureEMCALClusterCuts() - Global scale not defined for such case\n");
263  }
264 }
265 
274  TString calorimeter, Int_t year )
275 {
276  reader->SetPHOSEMin(0.3);
277  reader->SetPHOSEMax(1000);
278 
279  if ( year > 2014 ) reader->GetFiducialCut()->SetSimplePHOSFiducialCut (0.125, 250.5, 319.5) ;
280  else reader->GetFiducialCut()->SetSimplePHOSFiducialCut (0.125, 260.5, 319.5) ;
281 
282  if ( calorimeter == "PHOS" )
283  { // Should be on if QA is activated with correlation on
284  reader->SwitchOnPHOSCells();
285  reader->SwitchOnPHOS();
286  }
287 }
288 
297  TString inputDataType, TString cutsString)
298 {
299  reader->SwitchOnCTS();
300 
301  reader->SetCTSPtMin(0.2);
302  reader->SetCTSPtMax(1000);
303 
304  reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.9, 0, 360) ;
305 
306  reader->SwitchOffUseTrackTimeCut();
307  reader->SetTrackTimeCut(0,50);
308 
309  reader->SwitchOffUseTrackDCACut();
310  //reader->SetTrackDCACut(0,0.0105);
311  //reader->SetTrackDCACut(1,0.035);
312  //reader->SetTrackDCACut(2,1.1);
313 
314  if ( inputDataType == "ESD" )
315  {
316 #if defined(__CINT__)
317  gROOT->LoadMacro("$ALICE_PHYSICS/PWGJE/macros/CreateTrackCutsPWGJE.C");
318 #endif
319 
320  //AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10041004);
321  //reader->SetTrackCuts(esdTrackCuts);
322 
323  if ( cutsString.Contains("ITSonly") )
324  {
325  reader->SetTrackStatus(AliESDtrack::kITSpureSA);
326  }
327  // Hybrid TPC+ITS
328  else
329  {
330  AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001008);
331  reader->SetTrackCuts(esdTrackCuts);
332  AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10011008);
333  reader->SetTrackComplementaryCuts(esdTrackCuts2);
334 
336  }
337  }
338  else if ( inputDataType == "AOD" )
339  {
340  if ( cutsString.Contains("ITSonly") )
341  {
342  reader->SetTrackStatus(AliAODTrack::kTrkITSsa);
343  }
344  else
345  {
346  reader->SwitchOnAODHybridTrackSelection(); // Check that the AODs have Hybrids!!!!
348  reader->SetTrackStatus(AliVTrack::kITSrefit);
349  }
350 
351  //reader->SwitchOnAODPrimaryTrackSelection(); // Used in preliminary results of QM from Nicolas and Xiangrong?
352  //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
353  //reader->SetTrackFilterMask(128); // Filter bit, not mask, use if off hybrid, TPC only
354  }
355 }
356 
377  TString clustersArray, TString calorimeter,
378  TString cutsString,
379  Bool_t nonLinOn, Bool_t calibrate,
380  Int_t year,
381  TString trigger, Bool_t rejectEMCTrig,
382  Int_t minCen, Int_t maxCen,
383  Bool_t printSettings, Int_t debug )
384 {
385  // Get the data type ESD or AOD
386  AliAnalysisManager * mgr = AliAnalysisManager::GetAnalysisManager();
387  TString inputDataType = mgr->GetInputEventHandler()->GetDataType();
388 
389  AliCaloTrackReader * reader = 0;
390  if (inputDataType == "AOD") reader = new AliCaloTrackAODReader();
391  else if(inputDataType == "ESD") reader = new AliCaloTrackESDReader();
392  else printf("AddTaskCaloTrackCorrBase::ConfigureReader() - Data not known InputData=%s\n",inputDataType.Data());
393 
394  reader->SetDebug(debug);//10 for lots of messages
395 
396  //------------------------
397  // Event selection cuts
398  //------------------------
399  ConfigureEventSelection(reader, cutsString, col, year, simulation,
400  rejectEMCTrig, trigger, minCen, maxCen);
401 
402  //------------------------
403  // Detector input filtering
404  //------------------------
405 
406  // Fiducial cuts active, see acceptance in detector methods
407  reader->SwitchOnFiducialCut();
408 
409  if ( cutsString.Contains("NoTracks") )
410  reader->SwitchOffCTS();
411  else
412  ConfigureTrackCuts (reader, inputDataType, cutsString);
413 
414  ConfigurePHOSClusterCuts (reader, calorimeter, year);
415 
416  ConfigureEMCALClusterCuts(reader, calorimeter, cutsString, clustersArray, year, simulation);
417 
418  // Extra calorimeter stuff:
419  //
420  // In case no external calibrated cluster/cell list or EMCal correction framework applied before
421  if ( calibrate ) reader->SwitchOnClusterRecalculation();
422  else reader->SwitchOffClusterRecalculation();
423 
424  // CAREFUL, make sure not done previously in the tender/clusterizer/EM correction framework
425  if ( nonLinOn ) reader->SwitchOnClusterELinearityCorrection();
427 
428  if(printSettings) reader->Print("");
429 
430  return reader;
431 }
432 
447  TString calorimeter, TString cutsString, Bool_t nonLinOn,
448  Bool_t calibrate, Int_t year,
449  Bool_t printSettings, Int_t debug)
450 {
452 
453  cu->SetDebug(debug);
454 
455  // Remove clusters close to borders, at least max energy cell is 1 cell away
456  cu->SetNumberOfCellsFromEMCALBorder(0); // temporary! set it back to 1.
458 
460 
461  if ( calorimeter == "PHOS" )
462  {
463  if(year < 2014) cu->SetNumberOfSuperModulesUsed(3);
464  else cu->SetNumberOfSuperModulesUsed(4);
465  }
466  else
467  {
468  Int_t nSM = 20;
469  Int_t lastEMC = 11;
470  if (year == 2010) { nSM = 4; lastEMC = 3; }// EMCAL first year
471  else if (year < 2014) { nSM = 10; lastEMC = 9; }// EMCAL active 2011-2013
472 
474 
475  if (calorimeter.Contains("EMCAL"))
476  {
477  cu->SetFirstSuperModuleUsed( 0);
478  cu->SetLastSuperModuleUsed (lastEMC);
479  }
480  else if (calorimeter.Contains("DCAL"))
481  {
482  cu->SetFirstSuperModuleUsed(12);
483  cu->SetLastSuperModuleUsed (19);
484  }
485 
486  if ( cutsString.Contains("FullCalo") )
487  {
490  }
491 
492  printf("AddTaskCaloTrackCorrBase::CalorimeterUtils() - nSM %d, first %d, last %d\n",
494  }
495 
496  // Search of local maxima in cluster
497  if ( col == "pp" )
498  {
499  cu->SetLocalMaximaCutE(0.1);
500  cu->SetLocalMaximaCutEDiff(0.03);
501  }
502  else
503  {
504  cu->SetLocalMaximaCutE(0.2);
505  cu->SetLocalMaximaCutEDiff(0.03);
506  }
507 
509 
511 
512  // EMCAL settings
513 
514  if ( !simulation )
516 
517  AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
518 
519  // Calibrations, do nothing by default
520  Bool_t calibEner = kFALSE;
521  Bool_t calibTime = kFALSE;
524 
525  if ( calibrate )
526  {
527  cu->SwitchOnRecalibration();
529 
530  calibEner = kTRUE;
531  calibTime = kTRUE;
532  }
533 
534  cu->ConfigureEMCALRecoUtils(simulation,
535  kTRUE, // exotic
536  nonLinOn, // Non linearity
537  calibEner, // E calib
538  kTRUE, // bad map
539  calibTime); // time calib
540 
541  //if( calibTime ) recou->SetExoticCellDiffTimeCut(50);
542 
543  //if( nonLinOn ) cu->SwitchOnCorrectClusterLinearity(); // Done in Configure method
544 
545  if ( printSettings )
546  {
547  printf("AddTaskCaloTrackCorrBase::ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",
548  recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
549  printf("AddTaskCaloTrackCorrBase::ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",
551  }
552 
553  // PHOS
555 
556  if(printSettings) cu->Print("");
557 
558  return cu;
559 }
560 
561 
601 (
602  TString calorimeter = "EMCAL", // "DCAL", "PHOS"
603  Bool_t simulation = kFALSE,
604  Int_t year = -1, // 2011,
605  TString col = "", // pp
606  TString period = "", // LHC11d
607  Int_t rejectEMCTrig = 0,
608  TString clustersArray = "",
609  TString cutsString = "",
610  Bool_t calibrate = kFALSE,
611  Bool_t nonLinOn = kFALSE,
612  Int_t minCen = -1,
613  Int_t maxCen = -1,
614  Bool_t mixOn = kTRUE,
615  TString outputfile = "",
616  Bool_t printSettings = kFALSE,
617  Int_t debug = 0,
618  const char *trigSuffix = "EMC7"
619 )
620 {
621  // Check the global variables, and reset the provided ones if empty.
622  //
623  TString trigger = trigSuffix;
624 
625  // Get the pointer to the existing analysis manager via the static access method.
626  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
627  if (!mgr)
628  {
629  ::Error("AddTask", "No analysis manager to connect to.");
630  return NULL;
631  }
632 
633  // Check the analysis type using the event handlers connected to the analysis manager.
634 
635  if (!mgr->GetInputEventHandler())
636  {
637  ::Error("AddTask", "This task requires an input event handler");
638  return NULL;
639  }
640 
641  // Name for containers
642 
643  TString anaCaloTrackCorrBase = Form("CTC_%s_Trig_%s",calorimeter.Data(),trigger.Data());
644 
645  if ( col=="PbPb" &&
646  maxCen>=0 ) anaCaloTrackCorrBase+=Form("_Cen%d_%d",minCen,maxCen);
647  if ( clustersArray!="" ) anaCaloTrackCorrBase+=Form("_Cl%s",clustersArray.Data());
648  if ( mixOn ) anaCaloTrackCorrBase+="_MixOn";
649  if ( cutsString!="" ) anaCaloTrackCorrBase+="_"+cutsString;
650 
651  printf("AddTaskCaloTrackCorrBase::Main() <<<< Folder name: %s >>>>>\n",
652  anaCaloTrackCorrBase.Data());
653 
654  //
655  // Create task, pass the maker and add it to the manager
656  //
657  AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation (Form("%s",anaCaloTrackCorrBase.Data()));
658 
659  // task->SetFirstEvent(1800);
660  // task->SetLastEvent (2000);
661 
662  task->SetDebugLevel(debug);
663 
664  //task->SetBranches("ESD:AliESDRun.,AliESDHeader");
665  //task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
666 
668 
669  maker->SetAnaDebug(debug) ;
670 
671  task->SetAnalysisMaker(maker);
672 
673  mgr->AddTask(task);
674 
675  //
676  // Create containers
677  //
678  if ( outputfile.Length() == 0 )
679  outputfile = AliAnalysisManager::GetCommonFileName();
680 
681  AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(anaCaloTrackCorrBase, TList::Class(),
682  AliAnalysisManager::kOutputContainer,
683  Form("%s",outputfile.Data()));
684 
685  AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("Param_%s",anaCaloTrackCorrBase.Data()), TList::Class(),
686  AliAnalysisManager::kParamContainer,
687  "AnalysisParameters.root");
688 
689  // Create ONLY the output containers for the data produced by the task.
690  // Get and connect other common input/output containers via the manager as below
691  //==============================================================================
692  mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
693  //if(!kData.Contains("delta") && outputAOD) mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer());
694  mgr->ConnectOutput (task, 1, cout_pc);
695  mgr->ConnectOutput (task, 2, cout_cuts);
696  //==============================================================================
697 
698  // Do not configure the wagon for certain analysis combinations
699  // But create the task so that the sub-wagon train can run
700  //
701 #if defined(__CINT__)
702  gROOT->LoadMacro("$ALICE_PHYSICS/PWGGA/CaloTrackCorrelations/macros/CheckActiveEMCalTriggerPerPeriod.C");
703 #endif
704 
705  Bool_t doAnalysis = CheckActiveEMCalTriggerPerPeriod(simulation,trigger,period,year);
706 
707  if ( doAnalysis && calorimeter == "DCAL" && year < 2015 ) doAnalysis = kFALSE;
708 
709  if ( !doAnalysis )
710  {
711  maker->SwitchOffProcessEvent();
712  return task;
713  }
714 
715  // #### Start analysis configuration ####
716  // Print settings
717  //
718  printf("AddTaskCaloTrackCorrBase::Main() << settings:"
719  "\n calorimeter <%s>, simulation <%d>, year <%d>, col <%s>, "
720  "\n trigger <%s>, reject EMC <%d>, clustersArray <%s>, cuts <%s>"
721  "\n calibrate <%d>, non linearity <%d>, minCen <%d>, maxCen <%d>, "
722  "\n mixOn <%d>, outputfile <%s>, printSettings <%d>, debug <%d> >>\n",
723  calorimeter.Data(), simulation, year, col.Data(),
724  trigger.Data(), rejectEMCTrig, clustersArray.Data(), cutsString.Data(),
725  calibrate, nonLinOn, minCen, maxCen,
726  mixOn, outputfile.Data(), printSettings, debug);
727 
728  // Make sure the B field is enabled for track selection, some cuts need it
729  ((AliInputEventHandler*)mgr->GetInputEventHandler())->SetNeedField(kTRUE);
730 
731  //
732  // General frame setting and configuration
733  //
734  maker->SetReader ( ConfigureReader (col,simulation,clustersArray,calorimeter,cutsString,
735  nonLinOn,calibrate,year,trigger,rejectEMCTrig,
736  minCen,maxCen,printSettings,debug) );
737 
738  maker->SetCaloUtils( ConfigureCaloUtils(col,simulation,calorimeter,cutsString,nonLinOn,calibrate,year,
739  printSettings,debug) );
740 
741  maker->SwitchOnHistogramsMaker() ;
742  maker->SwitchOnAODsMaker() ;
743 
744  if ( simulation || !trigger.Contains("EMC") )
746 
747  if ( simulation )
748  {
749  // Calculate the cross section weights, apply them to all histograms
750  // and fill xsec and trial histo. Sumw2 must be activated.
751  if ( cutsString.Contains("MCWeight") )
752  {
754  maker->SwitchOnSumw2Histograms();
755  }
756  else
757  {
758  // Just fill cross section and trials histograms.
760  }
761 
762  // For recent productions where the cross sections and trials are not stored in separate file
763  if ( cutsString.Contains("MCEvtHeadW") )
765 
766  // For productions where the cross sections and trials are not stored in separate file
767  TString prodType = gSystem->Getenv("ALIEN_JDL_LPMPRODUCTIONTYPE");
768  printf("AddTaskCaloTrackCorrBase() - MC production name: %s\n",prodType.Data());
769  if ( prodType.Contains("LHC16c") ) // add here any other affected periods, for the moment jet-jet 8 TeV
770  {
771  printf("\t use the cross section from EventHeader per Event\n");
773  }
774 
775  // Add control histogram with pT hard to control aplication of weights
776  maker->SwitchOnPtHardHistogram();
777 
778  // Apply particle pT weights
779  //maker->SwitchOnMCParticlePtWeights();
780  }
781 
782  if ( printSettings ) maker->Print("");
783 
784  // Set the list name for later recovery in macros
785  maker->GetListOfAnalysisContainers()->SetName(anaCaloTrackCorrBase);
786 
787  // Select events trigger depending on trigger
788  //
789  maker->GetReader()->SwitchOnEventTriggerAtSE(); // on is default case
790  if ( !simulation )
791  {
792 #if defined(__CINT__)
793  gROOT->LoadMacro("$ALICE_PHYSICS/PWGGA/CaloTrackCorrelations/macros/ConfigureAndGetEventTriggerMaskAndCaloTriggerString.C");
794 #endif
795 
796  TString caloTriggerString = "";
797  UInt_t mask = ConfigureAndGetEventTriggerMaskAndCaloTriggerString(trigger, year, caloTriggerString);
798 
799  maker->GetReader()->SetFiredTriggerClassName(caloTriggerString);
800 
801  // For mixing with AliAnaParticleHadronCorrelation switch it off
802  if ( mixOn )
803  {
805  maker->GetReader()->SetEventTriggerMask(mask);
806  // what to do with caloTriggerString?
807 
808  // Careful, not all productions work with kMB, try kINT7, kINT1, kAnyINT
809  //reader->SetMixEventTriggerMask(AliVEvent::kMB);
810  maker->GetReader()->SetMixEventTriggerMask(AliVEvent::kINT7);
811 
812  printf("AddTaskCaloTrackCorrBase::Main() << Trigger selection done in AliCaloTrackReader!!! >>> \n");
813  }
814  else
815  {
816  task ->SelectCollisionCandidates( mask );
817  }
818  }
819 
820  printf("AddTaskCaloTrackCorrBase::Main() << End Base Task Configuration for %s >>\n",
821  anaCaloTrackCorrBase.Data());
822 
823  return task;
824 }
825 
826 
void SwitchOnLEDEventsRemoval(Int_t opt=1)
virtual void SwitchOnAODTrackSharedClusterSelection()
virtual void SetDebug(Int_t d)
void SetNumberOfCellsFromPHOSBorder(Int_t n)
void SetShowerShapeSmearWidth(Float_t w)
void SetSimpleCTSFiducialCut(Float_t abseta, Float_t phimin, Float_t phimax)
void SetFirstSuperModuleUsed(Int_t first)
virtual void SwitchOnFiducialCut()
void SwitchOnLoadOwnEMCALGeometryMatrices()
virtual void SwitchOnAODHybridTrackSelection()
virtual void SetCentralityBin(Int_t min, Int_t max)
Int_t GetLastSuperModuleUsed() const
AliEMCALRecoUtils * GetEMCALRecoUtils() const
void SetLastSuperModuleUsed(Int_t last)
void SwitchOffClusterELinearityCorrection()
void SetCTSPtMax(Float_t pt)
void SetSmearingFunction(Int_t smfu)
virtual void SetTrackComplementaryCuts(AliESDtrackCuts *)
AliCaloTrackReader * ConfigureReader(TString col, Bool_t simulation, TString clustersArray, TString calorimeter, TString cutsString, Bool_t nonLinOn, Bool_t calibrate, Int_t year, TString trigger, Bool_t rejectEMCTrig, Int_t minCen, Int_t maxCen, Bool_t printSettings, Int_t debug)
TSystem * gSystem
void SetEMCALEMin(Float_t en)
void SetSimpleEMCALFiducialCut(Float_t abseta, Float_t phimin, Float_t phimax)
void ConfigurePHOSClusterCuts(AliCaloTrackReader *reader, TString calorimeter, Int_t year)
void SwitchOnClusterEScalePerSMCorrection()
void SetLocalMaximaCutEDiff(Float_t c)
void SwitchOnMCCrossSectionHistoFill()
Definition: AliAnaWeights.h:88
void SetNumberOfCellsFromEMCALBorder(Int_t n)
Bool_t IsBadChannelsRemovalSwitchedOn() const
void SetSimplePHOSFiducialCut(Float_t abseta, Float_t phimin, Float_t phimax)
const TString calorimeter
Definition: anaM.C:36
void ConfigureEMCALClusterCuts(AliCaloTrackReader *reader, TString calorimeter, TString cutsString, TString clustersArray, Int_t year, Bool_t simulation)
virtual void SetPtHardAndJetPtComparison(Bool_t compare)
Bool_t IsRecalibrationOn() const
Bool_t IsRecalibrationOn() const
Some utilities for cluster and cell treatment.
void SwitchOnMCCrossSectionFromEventHeader()
Definition: AliAnaWeights.h:90
virtual void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
Class for event, clusters and tracks filtering and preparation for the AOD analysis.
void SetCTSPtMin(Float_t pt)
void SwitchOffRecalculateClusterTrackMatching()
void SetEventTriggerMask(UInt_t evtTrig=AliVEvent::kAny)
void SwitchOffVertexBCEventSelection()
virtual void SetPtHardAndClusterPtFactor(Float_t factor)
void SetScaleFactorPerSM(Int_t ism, Float_t factor)
Check EMCal trigger availability in period.
virtual void SetDebug(Int_t d)
virtual AliFiducialCut * GetFiducialCut()
virtual void SetCentralityOpt(Int_t opt)
int Int_t
Definition: External.C:63
void SwitchOnMCCrossSectionCalculation()
Definition: AliAnaWeights.h:85
unsigned int UInt_t
Definition: External.C:33
void SetTrackStatus(ULong_t bit)
Bool_t IsBadChannelsRemovalSwitchedOn() const
virtual void SetPtHardAndClusterPtComparison(Bool_t compare)
void SetEMCALClusterListName(TString name)
Base class for event, clusters and tracks filtering and preparation for the analysis.
void SwitchOffBadTriggerEventsRemoval()
Int_t GetNumberOfSuperModulesUsed() const
virtual void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
virtual void SetZvertexCut(Float_t zcut=10.)
void SetNumberOfSuperModulesUsed(Int_t nSM)
UInt_t ConfigureAndGetEventTriggerMaskAndCaloTriggerString(TString trigger, Int_t year, TString &triggerString)
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)
virtual void SetTrackCuts(AliESDtrackCuts *)
void SetPileUpParamForSPD(Int_t i, Double_t param)
virtual void SetCentralityClass(TString name)
void SwitchOnBadTriggerEventsRemoval()
void SwitchOnClusterELinearityCorrection()
void SetTrackTimeCut(Double_t a, Double_t b)
void SetEMCALTimeCut(Double_t a, Double_t b)
Main class conecting the CaloTrackCorrelations package and Analysis Frame.
void ConfigureEventSelection(AliCaloTrackReader *reader, TString cutsString, TString col, Int_t year, Bool_t simulation, Bool_t rejectEMCTrig, TString trigger, Int_t minCen, Int_t maxCen)
void SwitchOffLoadOwnPHOSGeometryMatrices()
void SetEMCALEMax(Float_t en)
void ConfigureEMCALRecoUtils(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)
void SetFiredTriggerClassName(TString name)
AliAnalysisTaskCaloTrackCorrelation * AddTaskCaloTrackCorrBase(TString calorimeter="EMCAL", Bool_t simulation=kFALSE, Int_t year=-1, TString col="", TString period="", Int_t rejectEMCTrig=0, TString clustersArray="", TString cutsString="", Bool_t calibrate=kFALSE, Bool_t nonLinOn=kFALSE, Int_t minCen=-1, Int_t maxCen=-1, Bool_t mixOn=kTRUE, TString outputfile="", Bool_t printSettings=kFALSE, Int_t debug=0, const char *trigSuffix="EMC7")
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)
Class with utils specific to calorimeter clusters/cells.
AliCaloTrackReader * GetReader()
virtual void SwitchOnConstrainTrackToVertex()
Int_t GetFirstSuperModuleUsed() const
void SetMixEventTriggerMask(UInt_t evtTrig=AliVEvent::kAnyINT)
AliAnaWeights * GetWeightUtils()
void ConfigureTrackCuts(AliCaloTrackReader *reader, TString inputDataType, TString cutsString)
void SwitchOffUseParametrizedTimeCut()
void SetLocalMaximaCutE(Float_t cut)
Bool_t CheckActiveEMCalTriggerPerPeriod(Bool_t simulation, TString &trigger, TString period, Int_t year)
AliCalorimeterUtils * ConfigureCaloUtils(TString col, Bool_t simulation, TString calorimeter, TString cutsString, Bool_t nonLinOn, Bool_t calibrate, Int_t year, Bool_t printSettings, Int_t debug)
void SetCaloUtils(AliCalorimeterUtils *cu)
Steering class of package CaloTrackCorrelartions.