AliPhysics  64a5cfc (64a5cfc)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalCorrectionTask.cxx
Go to the documentation of this file.
1 // AliEmcalCorrectionTask
2 //
3 // Runs the cell and cluster level corrections for the EMCal
4 //
5 
8 
9 #include <vector>
10 #include <set>
11 #include <fstream>
12 #include <sstream>
13 #include <iostream>
14 
15 #include <TChain.h>
16 #include <TSystem.h>
17 #include <TGrid.h>
18 #include <TFile.h>
19 
20 #include "AliVEventHandler.h"
21 #include "AliEMCALGeometry.h"
22 #include "AliVCaloCells.h"
23 #include "AliVCluster.h"
24 #include "AliLog.h"
25 #include "AliMultSelection.h"
26 #include "AliCentrality.h"
27 #include "AliESDEvent.h"
28 #include "AliAnalysisManager.h"
29 
33 
37 
43  AliAnalysisTaskSE("AliEmcalCorrectionTask"),
44  fUserConfiguration(),
45  fUserConfigurationFilename(""),
46  fUserConfigurationString(""),
47  fDefaultConfiguration(),
48  fDefaultConfigurationFilename(""),
49  fDefaultConfigurationString(""),
50  fCorrectionComponents(),
51  fIsEsd(false),
52  fForceBeamType(kNA),
53  fRunPeriod(""),
54  fConfigurationInitialized(false),
55 
56  fEventInitialized(false),
57  fCent(0),
58  fCentBin(-1),
59  fMinCent(-999),
60  fMaxCent(-999),
61  fNcentBins(4),
62  fCentEst("V0M"),
63  fUseNewCentralityEstimation(kFALSE),
64  fNVertCont(0),
65  fBeamType(kNA),
66  fNeedEmcalGeom(kTRUE),
67  fGeom(0),
68  fParticleCollArray(),
69  fClusterCollArray(),
70  fCellCollArray(),
71  fOutput(0)
72 {
73  // Default constructor
74  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
75 
76  fVertex[0] = 0;
77  fVertex[1] = 0;
78  fVertex[2] = 0;
79 
80  fParticleCollArray.SetOwner(kTRUE);
81  fClusterCollArray.SetOwner(kTRUE);
82 }
83 
89  AliAnalysisTaskSE(name),
90  fUserConfiguration(),
91  fUserConfigurationFilename(""),
92  fUserConfigurationString(""),
93  fDefaultConfiguration(),
94  fDefaultConfigurationFilename(""),
95  fDefaultConfigurationString(""),
96  fCorrectionComponents(),
97  fIsEsd(false),
98  fForceBeamType(kNA),
99  fRunPeriod(""),
100  fConfigurationInitialized(false),
101 
102  fEventInitialized(false),
103  fCent(0),
104  fCentBin(-1),
105  fMinCent(-999),
106  fMaxCent(-999),
107  fNcentBins(4),
108  fCentEst("V0M"),
109  fUseNewCentralityEstimation(kFALSE),
110  fNVertCont(0),
111  fBeamType(kNA),
112  fNeedEmcalGeom(kTRUE),
113  fGeom(0),
114  fParticleCollArray(),
115  fClusterCollArray(),
116  fCellCollArray(),
117  fOutput(0)
118 {
119  // Standard constructor
120  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
121 
122  fVertex[0] = 0;
123  fVertex[1] = 0;
124  fVertex[2] = 0;
125 
126  fParticleCollArray.SetOwner(kTRUE);
127  fClusterCollArray.SetOwner(kTRUE);
128 
129  DefineInput(0, TChain::Class());
130  DefineOutput(1, TList::Class());
131 }
132 
140 inline bool AliEmcalCorrectionTask::DoesFileExist(const std::string & filename)
141 {
142  std::ifstream inFile(filename);
143  return inFile.good();
144 }
145 
151 {
152  if (filename != "")
153  {
154  // Handle if in AliPhysics
155  // Check for and replace $ALICE_PHYSICS with the actual path if needed
156  std::size_t alicePhysicsPathLocation = filename.find("$ALICE_PHYSICS");
157  if (alicePhysicsPathLocation != std::string::npos)
158  {
159  TString alicePhysicsPath = gSystem->Getenv("ALICE_PHYSICS");
160  // "$ALICE_PHYSICS "is 14 characters
161  filename.replace(alicePhysicsPathLocation, alicePhysicsPathLocation + 14, alicePhysicsPath.Data());
162  }
163 
164  // Handle grid
165  if(filename.find("alien://") != std::string::npos)
166  {
167  AliDebug(2, TString::Format("Opening file \"%s\" on the grid!", filename.c_str()));
168  // Init alien connection if needed
169  if (!gGrid) {
170  TGrid::Connect("alien://");
171  }
172 
173  // Determine the loca filename and copy file to local directory
174  std::string localFilename = gSystem->BaseName(filename.c_str());
175  // Ensures that the default and user files do not conflict if both are taken from the grid and have the same filename
176  if (userFile == true) {
177  localFilename = "user" + localFilename;
178  }
179  TFile::Cp(filename.c_str(), localFilename.c_str());
180 
181  // yaml-cpp should only open the local file
182  filename = localFilename;
183  }
184  }
185 }
186 
187 
193 {
194  // Determine file path
196  {
197  // Use the default if nothing is set
198  fDefaultConfigurationFilename = "$ALICE_PHYSICS/PWG/EMCAL/config/AliEmcalCorrectionConfiguration.yaml";
199  }
200 
201  // Setup the YAML files
202  // Default
204 
206  {
207  AliInfo(TString::Format("Using default EMCal corrections configuration located at %s", fDefaultConfigurationFilename.c_str()));
208 
210  // Check for valid file
211  if (fDefaultConfiguration.IsNull() == true)
212  {
213  AliFatal(TString::Format("Could not open the default configuration file \"%s\"!", fDefaultConfigurationFilename.c_str()));
214  }
215  }
216  else
217  {
218  AliFatal(TString::Format("Default file located at \"%s\" does not exist!", fDefaultConfigurationFilename.c_str()));
219  }
220 
221  // User
223 
225  {
226  AliInfo(TString::Format("Using user EMCal corrections configuration located at %s", fUserConfigurationFilename.c_str()));
227 
229  }
230  else
231  {
232  AliInfo(TString::Format("User file at \"%s\" does not exist! All settings will be from the default file!", fUserConfigurationFilename.c_str()));
233  }
234 
235  // Ensure that there is a run period
236  if (fRunPeriod == "")
237  {
238  AliFatal("Must pass a run period to the correction task!");
239  }
240  // Check the user provided run period
241  TString userRunPeriod = "kNoUserFile";
242  // Test if the period exists in the user file
243  if (fUserConfiguration.IsNull() != true)
244  {
245  if (fUserConfiguration["period"])
246  {
247  userRunPeriod = fUserConfiguration["period"].as<std::string>();
248  }
249  else
250  {
251  AliFatal("User must specify a period. Leave the period as an empty string to apply to all periods.");
252  }
253  }
254 
255  AliDebug(3, TString::Format("userRunPeriod: %s", userRunPeriod.Data()));
256  // Normalize the user run period to lower case to ensure that we don't miss any matches
257  userRunPeriod.ToLower();
258  // "" means the user wants their settings to apply to all periods
259  if (userRunPeriod != "" && userRunPeriod != "knouserfile" && userRunPeriod != fRunPeriod)
260  {
261  AliFatal(TString::Format("User run period \"%s\" does not match the run period of \"%s\" passed to the correction task!", userRunPeriod.Data(), fRunPeriod.Data()));
262  }
263 
264  // Ensure that the user is aware
265  if (userRunPeriod == "")
266  {
267  AliWarning("User run period is an empty string. Settings apply to all run periods!");
268  }
269 
270  // Save configuration into strings so that they can be streamed
271  // Need the stringstream because yaml implements streamers
272  std::stringstream tempConfiguration;
273  tempConfiguration << fUserConfiguration;
274  fUserConfigurationString = tempConfiguration.str();
275  tempConfiguration.str("");
276  tempConfiguration << fDefaultConfiguration;
277  fDefaultConfigurationString = tempConfiguration.str();
278 
279  //AliInfo(TString::Format("User configuration: %s", fUserConfigurationString.c_str()));
280  //AliInfo(TString::Format("Default configuration: %s", fDefaultConfigurationString.c_str()));
281 
282  // Note that it is initialized properly so that the analysis can proceed
284 }
285 
294 {
295  bool returnValue = false;
296  if (filename != "")
297  {
298  if (fConfigurationInitialized == true)
299  {
300  std::ofstream outFile(filename);
301  std::string stringToWrite = userConfig ? fUserConfigurationString : fDefaultConfigurationString;
302  if (stringToWrite == "") {
303  AliWarning(TString::Format("%s configuration is empty!", userConfig ? "User" : "Default"));
304  }
305  outFile << stringToWrite;
306  outFile.close();
307 
308  returnValue = true;
309  }
310  else
311  {
312  AliWarning(TString::Format("Configuration not properly initialized! Cnanot print %s configuration!", userConfig ? "user" : "default"));
313  }
314 
315  }
316  else
317  {
318  AliWarning("Please pass a valid filename instead of empty qutoes!");
319  }
320  return returnValue;
321 }
322 
328 {
329  // Determine file type
330  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
331  if (mgr) {
332  AliVEventHandler *evhand = mgr->GetInputEventHandler();
333  if (evhand) {
334  if (evhand->InheritsFrom("AliESDInputHandler")) {
335  fIsEsd = true;
336  }
337  else {
338  fIsEsd = false;
339  }
340  }
341  else {
342  AliError("Event handler not found!");
343  }
344  }
345  else {
346  AliError("Analysis manager not found!");
347  }
348 
349  // Initialize YAML configuration
351  // Check that the configuration is initialized
352  if (fConfigurationInitialized != true)
353  {
354  AliFatal("YAML configuration must be initialized before running (ie. the AddTask, run macro or wagon)!");
355  }
356 
357  // Setup input objects
358  // Setup Cells
359  // Cannot do this entirely yet because we need input objects
361  // TEMP PRINT
362  AliDebugStream(2) << "Cell info: " << std::endl;
363  for (auto cellInfo : fCellCollArray) {
364  AliDebugStream(2) << "\tName: " << cellInfo->GetName() << "\tBranch: " << cellInfo->GetBranchName() << "\tIsEmbedding:" << cellInfo->GetIsEmbedding() << std::endl;
365  }
366  // END TEMP PRINT
367  // Create cluster input objects
369  // TEMP PRINT
370  fClusterCollArray.Print();
371  // END TEMP PRINT
372  // Create track input objects
374  // TEMP PRINT
375  fParticleCollArray.Print();
376  // END TEMP PRINT
377 
378  // Initialize components
380 }
381 
386 void AliEmcalCorrectionTask::RetrieveExecutionOrder(std::vector <std::string> & executionOrder)
387 {
389  // Need to append "AliEmcalCorrection" to allow the tasks to be found!
390  AliDebug(2, "Creating EMCal Correction Components: ");
391  for (auto & component : executionOrder)
392  {
393  component = "AliEmcalCorrection" + component;
394  AliDebug(2, TString::Format("%s", component.c_str()) );
395  }
396 }
397 
403 {
404  // Create a function to handle creation and configuration of the all of the created module
405  std::vector<std::string> executionOrder;
406  RetrieveExecutionOrder(executionOrder);
407 
408  // Iterate over the list
409  AliEmcalCorrectionComponent * component = 0;
410  bool componentEnabled = false;
411  for (auto componentName : executionOrder)
412  {
413  componentEnabled = false;
414  AliEmcalCorrectionComponent::GetProperty("enabled", componentEnabled, fUserConfiguration, fDefaultConfiguration, true, componentName);
415  if (componentEnabled == false)
416  {
417  AliInfo(TString::Format("Component %s is disabled and will not be run!", componentName.c_str()));
418  continue;
419  }
420 
421  //Printf("Attempting to add task: %s", tempString->GetString().Data());
422  component = AliEmcalCorrectionComponentFactory::createInstance(componentName);
423  if (!component)
424  {
425  AliFatal(TString::Format("Failed to create requested component %s!", componentName.c_str()));
426  }
427 
428  // For setting names of tasks to differentiate between tasks of the same class
429  component->SetName(componentName.c_str());
430  component->SetTitle(componentName.c_str());
431 
432  // Initialize the YAML configurations in each component
435 
436  // configure needed fields for components to properly initialize
437  component->SetIsESD(fIsEsd);
438 
439  // Add the require containers to the component
440  // Cells must be set during UserExec() because we need to add them as a pointer
442  AddContainersToComponent(component, kTrack);
443 
444  // Initialize each component
445  component->Initialize();
446 
447  if (component)
448  {
449  AliInfo(TString::Format("Successfully added correction task: %s", componentName.c_str()));
450  fCorrectionComponents.push_back(component);
451  }
452  }
453 }
454 
460 {
461  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
462 
463  // Check that the configuration is initialized
464  if (fConfigurationInitialized != true)
465  {
466  AliFatal("YAML configuration must be initialized before running (ie. the AddTask, run macro or wagon)!");
467  }
468 
469  // Show the configurations info this is available
470  AliDebugStream(4) << "User configuration string: " << fUserConfigurationString << std::endl;
471  AliDebugStream(4) << "User configuration: " << fUserConfiguration << std::endl;
472  AliDebugStream(4) << "Default configuration string: " << fDefaultConfigurationString << std::endl;
473  AliDebugStream(4) << "Default configuration: " << fDefaultConfiguration << std::endl;
474 
475  // YAML Objects cannot be streamed, so we need to reinitialize them here.
476  // They need reinitialize if they are null
477  if (fUserConfiguration.IsNull() == true && fUserConfigurationString != "")
478  {
479  AliInfo("Reinitializing user configuration from string. Expected if running on grid!");
481  }
482  if (fDefaultConfiguration.IsNull() == true)
483  {
484  AliInfo("Reinitializing default configuration from string. Expected if running on grid!");
486  }
487 
488  // Debug to check that the configuration has been (re)initiailzied has been completed correctly
489  AliDebugStream(4) << "(Re)initialized user configuration: " << fUserConfigurationString << std::endl;
490  AliDebugStream(4) << "(Re)initialized user configuration: " << fUserConfiguration << std::endl;
491  AliDebugStream(4) << "(Re)initialized default configuration: " << fDefaultConfigurationString << std::endl;
492  AliDebugStream(4) << "(Re)initialized default configuration: " << fDefaultConfiguration << std::endl;
493 
494  if (fForceBeamType == kpp)
495  fNcentBins = 1;
496 
497  // Allow for output files
498  OpenFile(1);
499  fOutput = new TList();
500  fOutput->SetOwner();
501 
503 
504  PostData(1, fOutput);
505 }
506 
512 {
513  // Run the initialization for all derived classes.
514  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
515  for (auto component : fCorrectionComponents)
516  {
517  // Set cent bins (usually used for hist creation)
518  // It cannot be set until now because it can be changed after initialization
519  // For instance, by SetForceBeamType()
520  component->SetNcentralityBins(fNcentBins);
521 
522  component->UserCreateOutputObjects();
523 
524  if (component->GetOutputList() != 0)
525  {
526  // Adds a list to the list -- this doesn't work for some unknown reason
527  //fOutput->Add(component->GetOutputList());
528 
529  // iterate through lists for each component, and fill in output
530  TList* t = new TList();
531  t->SetName(component->GetName());
532  fOutput->AddLast(t);
533  t = (TList*)fOutput->Last();
534  TIter next(component->GetOutputList());
535  while (TObject *obj = next()){
536  t->Add(obj);
537  }
538 
539  AliDebug(1, TString::Format("Added output list from task %s to output.", component->GetName()));
540  }
541  }
542 }
543 
549 {
550  // Get container node
551  std::string inputObjectName = "";
552  if (inputObjectType == kCluster) {
553  inputObjectName = "clusterContainers";
554  }
555  else if (inputObjectType == kTrack) {
556  inputObjectName = "trackContainers";
557  }
558  else if (inputObjectType == kCaloCells) {
559  inputObjectName = "cells";
560  }
561  else {
562  AliFatal(TString::Format("Unrecognized input object type %d", inputObjectType));
563  }
564 
565  return inputObjectName;
566 }
567 
572 void AliEmcalCorrectionTask::GetNodeForInputObjects(YAML::Node & inputNode, YAML::Node & nodeToRetrieveFrom, std::string & inputObjectName, bool requiredProperty)
573 {
574  // Get the user input node
575  AliEmcalCorrectionComponent::GetProperty(inputObjectName.c_str(), inputNode, YAML::Node(), nodeToRetrieveFrom, requiredProperty, "inputObjects");
576 
577  // Get the user shared node and add it back to the user node so that shared parameters are available
578  if (nodeToRetrieveFrom["sharedParameters"]) {
579  inputNode["sharedParameters"] = nodeToRetrieveFrom["sharedParameters"];
580  }
581 }
582 
587 void AliEmcalCorrectionTask::SetupContainersFromInputNodes(InputObject_t inputObjectType, YAML::Node & userInputObjectNode, YAML::Node & defaultInputObjectNode, std::set <std::string> & requestedContainers)
588 {
589  // Our node contains all of the objects that we will want to create.
590  for(auto & containerName : requestedContainers)
591  {
592  // The section is the container name
593  //std::string containerName = it->first.as<std::string>();
594  // Skip over the sharedParamters node
595  // Also skip if the particle or cluster container already exists
596  if (containerName == "sharedParameters" || GetParticleContainer(containerName.c_str()) || GetClusterContainer(containerName.c_str())) {
597  continue;
598  }
599 
600  AliDebug(2, TString::Format("Processing container %s of inputType %d", containerName.c_str(), inputObjectType));
601  //std::cout << "Container: " << containerName << std::endl << userInputObjectNode << std::endl << defaultInputObjectNode;
602  if (inputObjectType == kCluster || inputObjectType == kTrack) {
603  SetupContainer(inputObjectType, containerName, userInputObjectNode, defaultInputObjectNode);
604  }
605  else if (inputObjectType == kCaloCells) {
606  SetupCellsInfo(containerName, userInputObjectNode, defaultInputObjectNode);
607  }
608  }
609 }
610 
615 void AliEmcalCorrectionTask::SetupCellsInfo(std::string containerName, YAML::Node & userNode, YAML::Node & defaultNode)
616 {
617  // Define cell info
619 
620  AliDebugStream(2) << "User: " << std::endl << userNode << std::endl << "default: " << std::endl << defaultNode << std::endl;
621 
622  // Set properties
623  // Cells (object) name
624  cellObj->SetName(containerName);
625  // Branch name
626  std::string tempString = "";
627  AliEmcalCorrectionComponent::GetProperty("branchName", tempString, userNode, defaultNode, true, containerName);
628  if (tempString == "usedefault") {
630  }
631  cellObj->SetBranchName(tempString);
632  // Where to copy the branch from
633  /*AliEmcalCorrectionComponent::GetProperty("branchToCopy", tempString, userNode, defaultNode, false, containerName);
634  cellObj->SetBranchToCopyName(tempString);*/
635 
636  // IsEmbedding
637  bool tempBool = false;
638  AliEmcalCorrectionComponent::GetProperty("embedded", tempString, userNode, defaultNode, false, containerName);
639  cellObj->SetIsEmbedding(tempBool);
640 
641  // Add to the array to keep track of it
642  fCellCollArray.push_back(cellObj);
643 }
644 
650 {
651  // Get container node
652  std::string inputObjectName = GetInputFieldNameFromInputObjectType(inputObjectType);
653 
654  // Get the user and default input nodes for the object type
655  YAML::Node userInputObjectNode;
656  YAML::Node defaultInputObjectNode;
657  GetNodeForInputObjects(userInputObjectNode, fUserConfiguration, inputObjectName, false);
658  GetNodeForInputObjects(defaultInputObjectNode, fDefaultConfiguration, inputObjectName, true);
659 
660  AliDebugStream(2) << "userInputObjectNode: " << userInputObjectNode << std::endl;
661  AliDebugStream(2) << "defaultInputObjectNode: " << defaultInputObjectNode << std::endl;
662 
663  // Determine which containers we need based on which are requested by correction tasks
664  std::set <std::string> requestedContainers;
665  std::vector <std::string> executionOrder;
666  std::vector <std::string> componentRequest;
667  RetrieveExecutionOrder(executionOrder);
668  for ( auto & componentName : executionOrder )
669  {
670  bool componentEnabled = false;
671  AliEmcalCorrectionComponent::GetProperty("enabled", componentEnabled, fUserConfiguration, fDefaultConfiguration, true, componentName);
672  if (componentEnabled)
673  {
674  componentRequest.clear();
675  // Not required because not all components will have all kinds of containers
676  AliEmcalCorrectionComponent::GetProperty(inputObjectName + "Names", componentRequest, fUserConfiguration, fDefaultConfiguration, false, componentName);
677  for ( auto & req : componentRequest )
678  {
679  //std::cout << "Component " << componentName << " requested container name " << req << std::endl;
680  requestedContainers.insert(req);
681  }
682  }
683  }
684 
685  AliInfoStream() << inputObjectName << " Containers requested by components: " << std::endl;
686  for (auto & str : requestedContainers) {
687  AliInfoStream() << "\t" << str << std::endl;;
688  }
689 
690  // Create all requested containers
691  AliDebug(2, TString::Format("Setting up requested containers!"));
692  SetupContainersFromInputNodes(inputObjectType, userInputObjectNode, defaultInputObjectNode, requestedContainers);
693 }
694 
699 void AliEmcalCorrectionTask::SetupContainer(InputObject_t inputObjectType, std::string containerName, YAML::Node & userNode, YAML::Node & defaultNode)
700 {
701  // Create container
702  AliDebugStream(2) << "Adding container" << std::endl;
703  AliEmcalContainer * cont = AddContainer(inputObjectType, containerName, userNode, defaultNode);
704  AliDebugStream(2) << "Added container" << std::endl;
705 
706  // Set the container properties
707  //
708  // TODO: Consider if this can be converted to a map to function pointers. There are a number of details which can make it a bit complicated.
709  // Those details include inheritance, pointing to member functions, etc. It should all be possible, but may not be worth all of the extra
710  // work and code.
711  // Example ccode:
712  // SetValueInContainer("minPt", &cont::SetMinPt, tempDouble, userNode, defaultNode);
713  // SetValueInContainer("minE", &cont::SetMinE, tempDouble, userNode, defaultNode);
714 
715  // Temporary variables to store requested properties
716  std::string tempString = "";
717  Double_t tempDouble = 0;
718  bool tempBool = false;
719 
720  // AliEmcalContainer properties
721  // Min Pt
722  bool result = AliEmcalCorrectionComponent::GetProperty("minPt", tempDouble, userNode, defaultNode, false, containerName);
723  if (result) {
724  AliDebugStream(2) << cont->GetName() << ": Setting minPt of " << tempDouble << std::endl;
725  cont->SetMinPt(tempDouble);
726  }
727  // Min E
728  result = AliEmcalCorrectionComponent::GetProperty("minE", tempDouble, userNode, defaultNode, false, containerName);
729  if (result) {
730  AliDebugStream(2) << cont->GetName() << ": Setting minE of " << tempDouble << std::endl;
731  cont->SetMinE(tempDouble);
732  }
733  // Eta min, max
734  result = AliEmcalCorrectionComponent::GetProperty("minEta", tempDouble, userNode, defaultNode, false, containerName);
735  if (result) {
736  // Only continue checking if the min is there, since we must set both together
737  Double_t tempDouble2 = 0;
738  result = AliEmcalCorrectionComponent::GetProperty("maxEta", tempDouble, userNode, defaultNode, false, containerName);
739  if (result) {
740  AliDebugStream(2) << cont->GetName() << ": Setting eta limits of " << tempDouble << " to " << tempDouble2 << std::endl;
741  cont->SetEtaLimits(tempDouble, tempDouble2);
742  }
743  }
744  // Phi min, max
745  result = AliEmcalCorrectionComponent::GetProperty("minPhi", tempDouble, userNode, defaultNode, false, containerName);
746  if (result) {
747  // Only continue checking if the min is there, since we must set both together
748  Double_t tempDouble2 = 0;
749  result = AliEmcalCorrectionComponent::GetProperty("maxPhi", tempDouble, userNode, defaultNode, false, containerName);
750  if (result) {
751  AliDebugStream(2) << cont->GetName() << ": Setting phi limits of " << tempDouble << " to " << tempDouble2 << std::endl;
752  cont->SetPhiLimits(tempDouble, tempDouble2);
753  }
754  }
755  // Embedded
756  // TODO: Enable embedded when that branch is committed!
757  /*result = AliEmcalCorrectionComponent::GetProperty("IsEmbedded", tempBool, userNode, defaultNode, false, containerName);
758  if (result) {
759  AliDebugStream(2) << cont->GetName() << ": Setting embedding to " << (tempBool ? "enabled" : "disabled") << std::endl;
760  cont->SetIsEmbedding(tempBool);
761  }*/
762 
763  // Cluster specific properties
764  AliClusterContainer * clusterContainer = dynamic_cast<AliClusterContainer *>(cont);
765  if (clusterContainer) {
766  // Default energy
767  // Probably not needed for the corrections
768  /*result = AliEmcalCorrectionComponent::GetProperty("defaultClusterEnergy", tempString, userNode, defaultNode, false, containerName);
769  if (result) {
770  // Need to get the enumeration
771  AliVCluster::VCluUserDefEnergy_t clusterEnergyType = clusterEnergyTypeMap.at(tempString);
772  AliDebugStream(2) << clusterContainer->GetName() << ": Setting cluster energy type to " << clusterEnergyType << std::endl;
773  clusterContainer->SetDefaultClusterEnergy(clusterEnergyType);
774  }*/
775 
776  // NonLinCorrEnergyCut
777  result = AliEmcalCorrectionComponent::GetProperty("clusNonLinCorrEnergyCut", tempDouble, userNode, defaultNode, false, containerName);
778  if (result) {
779  AliDebugStream(2) << clusterContainer->GetName() << ": Setting clusNonLinCorrEnergyCut of " << tempDouble << std::endl;
780  clusterContainer->SetClusNonLinCorrEnergyCut(tempDouble);
781  }
782 
783  // HadCorrEnergyCut
784  result = AliEmcalCorrectionComponent::GetProperty("clusHadCorrEnergyCut", tempDouble, userNode, defaultNode, false, containerName);
785  if (result) {
786  AliDebugStream(2) << clusterContainer->GetName() << ": Setting clusHadCorrEnergyCut of " << tempDouble << std::endl;
787  clusterContainer->SetClusHadCorrEnergyCut(tempDouble);
788  }
789  }
790 
791  // Track specific
792  AliTrackContainer * trackContainer = dynamic_cast<AliTrackContainer *>(cont);
793  if (trackContainer) {
794  // Track selection
795  // AOD Filter bits as a sequence
796  std::vector <UInt_t> filterBitsVector;
797  result = AliEmcalCorrectionComponent::GetProperty("aodFilterBits", filterBitsVector, userNode, defaultNode, false, containerName);
798  if (result){
799  UInt_t filterBits = 0;
800  for (int filterBit : filterBitsVector) {
801  filterBits += filterBit;
802  }
803  AliDebugStream(2) << trackContainer->GetName() << ": Setting filterBits of " << filterBits << std::endl;
804  trackContainer->SetAODFilterBits(filterBits);
805  }
806 
807  // SetTrackFilterType enum
808  result = AliEmcalCorrectionComponent::GetProperty("trackFilterType", tempString, userNode, defaultNode, false, containerName);
809  if (result) {
810  // Need to get the enumeration
811  AliEmcalTrackSelection::ETrackFilterType_t trackFilterType = trackFilterTypeMap.at(tempString);
812  AliDebugStream(2) << trackContainer->GetName() << ": Setting trackFilterType of " << trackFilterType << std::endl;
813  trackContainer->SetTrackFilterType(trackFilterType);
814  }
815  }
816 }
817 
823 std::string AliEmcalCorrectionTask::DetermineUseDefaultName(InputObject_t objType, bool esdMode, bool returnObjectType)
824 {
825  std::string returnValue = "";
826  if (objType == kCluster) {
827  if (esdMode == true) {
828  if (returnObjectType == true) {
829  returnValue = "AliESDCaloCluster";
830  }
831  else {
832  returnValue = "CaloClusters";
833  }
834  }
835  else {
836  if (returnObjectType == true) {
837  returnValue = "AliAODCaloCluster";
838  }
839  else {
840  returnValue = "caloClusters";
841  }
842  }
843  }
844  else if (objType == kTrack) {
845  if (esdMode == true) {
846  if (returnObjectType == true) {
847  returnValue = "AliESDtrack";
848  }
849  else {
850  returnValue = "Tracks";
851  }
852  }
853  else {
854  if (returnObjectType == true) {
855  returnValue = "AliAODTrack";
856  }
857  else {
858  returnValue = "tracks";
859  }
860  }
861  }
862  else if (objType == kCaloCells) {
863  if (esdMode == true) {
864  if (returnObjectType == true) {
865  returnValue = "AliESDCaloCells";
866  }
867  else {
868  returnValue = "EMCALCells";
869  }
870  }
871  else {
872  if (returnObjectType == true) {
873  returnValue = "AliAODCaloCells";
874  }
875  else {
876  returnValue = "emcalCells";
877  }
878  }
879  }
880  else {
881  // Default to empty if we are given an unrecognized type with "usedefault"
882  returnValue = "";
883  }
884 
885  return returnValue;
886 }
887 
901 AliEmcalContainer * AliEmcalCorrectionTask::AddContainer(InputObject_t contType, std::string & containerName, YAML::Node & userNode, YAML::Node & defaultNode)
902 {
903  // Determine the type of branch to request
904  std::string containerBranch = "";
905  if (contType != kCluster && contType != kTrack){
906  AliFatal("Must specify type of container when requesting branch.");
907  }
908 
909  // Retrieve branch name
910  // YAML::Node() is just an empty node
911  AliDebugStream(2) << "User Node: " << userNode << std::endl;
912  AliDebugStream(2) << "Default Node: " << defaultNode << std::endl;
913  AliEmcalCorrectionComponent::GetProperty("branchName", containerBranch, userNode, defaultNode, true, containerName);
914  // Should be unnecessary, since the user can only do this if done explicitly.
915  /*if (containerBranch == "")
916  {
917  AliFatal(TString::Format("Request %i container, but the container branch is empty!", contType));
918  }*/
919 
920  // Determine proper name if using "usedefault" pattern
921  if (containerBranch == "usedefault") {
922  containerBranch = DetermineUseDefaultName(contType, fIsEsd);
923  }
924 
925  // Create containers and set them to the name of the component
926  AliEmcalContainer * cont = 0;
927  if (contType == kCluster)
928  {
929  cont = new AliClusterContainer(containerBranch.c_str());
930  AdoptClusterContainer(dynamic_cast<AliClusterContainer *>(cont));
931  }
932  else if (contType == kTrack)
933  {
934  if (containerBranch == "mcparticles") {
935  cont = new AliMCParticleContainer(containerBranch.c_str());
936  }
937  else {
938  cont = new AliTrackContainer(containerBranch.c_str());
939  }
940  AdoptParticleContainer(dynamic_cast<AliParticleContainer *>(cont));
941  }
942  cont->SetName(containerName.c_str());
943 
944  return cont;
945 }
946 
952 {
953  std::string inputObjectName = GetInputFieldNameFromInputObjectType(inputObjectType);
954  // Need to be of the form "clusterContainersNames"
955  inputObjectName = inputObjectName + "Names";
956 
957  //std::cout << "inputObjectName: " << inputObjectName << std::endl;
958  std::vector <std::string> inputObjects;
959  // Not required, because not all components need Clusters or Tracks
960  AliEmcalCorrectionComponent::GetProperty(inputObjectName.c_str(), inputObjects, fUserConfiguration, fDefaultConfiguration, false, component->GetName());
961 
962  //std::cout << "inputObjects.size(): " << inputObjects.size() << std::endl;
963 
964  // If it is not found, then there will be nothing to iterate over, so we don't need to check the return value
965  for (auto const & str : inputObjects)
966  {
967  // TODO: Generalize to arrays for clusters and tracks...
968  // NOTE: The contianers operate differently than the cells. The containers should be executed during initialization while the cells should be executed during run time!
969  if (inputObjectType == kCluster) {
970  AliEmcalContainer * cont = GetClusterContainer(str.c_str());
971  AliDebugStream(2) << "Adding cluster container " << str << " of array " << cont->GetArrayName() << " to component " << component->GetName() << std::endl;
972  component->SetClusterContainer(GetClusterContainer(str.c_str()));
973  }
974  else if (inputObjectType == kTrack) {
975  AliEmcalContainer * cont = GetParticleContainer(str.c_str());
976  AliDebugStream(2) << "Adding particle container " << str << " of array " << cont->GetArrayName() << " to component " << component->GetName() << std::endl;
977  component->SetParticleContainer(GetParticleContainer(str.c_str()));
978  }
979  else if (inputObjectType == kCaloCells) {
980  // NOTE: This operates different than the others. This should be executed during run time rather than during initialization!
981  if (inputObjects.size() > 1) {
982  AliFatal(TString::Format("Component %s requested more than one cell branch, but this is not supported! Check the configuration!", component->GetName()));
983  }
984  // If we've made it here, this must be at least one entry
985  AliDebugStream(2) << "Adding calo cells " << GetCellContainer(str)->GetName() << " of branch name " << GetCellContainer(str)->GetBranchName() << "to component " << component->GetName() << std::endl;
986  component->SetCaloCells(GetCellContainer(str)->GetCells());
987  AliDebugStream(3) << "component GetNumberOfCells: " << component->GetCaloCells()->GetNumberOfCells() << std::endl;
988  }
989  }
990 }
991 
996 AliEmcalCorrectionCellContainer * AliEmcalCorrectionTask::GetCellContainer(const std::string & cellsContainerName) const
997 {
998  for (auto cellContainer : fCellCollArray)
999  {
1000  if (cellContainer->GetName() == cellsContainerName) {
1001  return cellContainer;
1002  }
1003  }
1004 
1005  return 0;
1006 }
1007 
1013 {
1014  AliDebugStream(2) << "Retrieving cells object " << cellContainer->GetName() << std::endl;
1015  // Check for embedding and return object
1016  AliVEvent * event = GetEvent(InputEvent(), cellContainer->GetIsEmbedding());
1017 
1018  cellContainer->SetCells(dynamic_cast<AliVCaloCells *>(event->FindListObject(cellContainer->GetBranchName().c_str())));
1019 }
1020 
1026 {
1027  // Run the initialization for all derived classes.
1028  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
1029  for (auto component : fCorrectionComponents)
1030  {
1031  // Setup geomertry
1032  component->SetEMCALGeometry(fGeom);
1033 
1034  // Add the requested cells to the component
1035  AliDebugStream(3) << "Adding CaloCells" << std::endl;
1037  AliDebugStream(3) << "Added CaloCells" << std::endl;
1038 
1039  // Component ExecOnce()
1040  component->ExecOnce();
1041  }
1042 }
1043 
1044 
1045 
1051 {
1052  fVertex[0] = 0;
1053  fVertex[1] = 0;
1054  fVertex[2] = 0;
1055  fNVertCont = 0;
1056 
1057  const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
1058  if (vert) {
1059  vert->GetXYZ(fVertex);
1060  fNVertCont = vert->GetNContributors();
1061  }
1062 
1063  fBeamType = GetBeamType();
1064 
1065  if (fBeamType == kAA || fBeamType == kpA ) {
1067  AliMultSelection *MultSelection = static_cast<AliMultSelection*>(InputEvent()->FindListObject("MultSelection"));
1068  if (MultSelection) {
1069  fCent = MultSelection->GetMultiplicityPercentile(fCentEst.Data());
1070  }
1071  else {
1072  AliWarning("Could not retrieve centrality information! Assuming 99");
1073  }
1074  }
1075  else { // old centrality estimation < 2015
1076  AliCentrality *aliCent = InputEvent()->GetCentrality();
1077  if (aliCent) {
1078  fCent = aliCent->GetCentralityPercentile(fCentEst.Data());
1079  }
1080  else {
1081  AliWarning("Could not retrieve centrality information! Assuming 99");
1082  }
1083  }
1084 
1085  if (fNcentBins==4) {
1086  if (fCent >= 0 && fCent < 10) fCentBin = 0;
1087  else if (fCent >= 10 && fCent < 30) fCentBin = 1;
1088  else if (fCent >= 30 && fCent < 50) fCentBin = 2;
1089  else if (fCent >= 50 && fCent <= 100) fCentBin = 3;
1090  else {
1091  AliWarning(Form("Negative centrality: %f. Assuming 99", fCent));
1092  fCentBin = fNcentBins-1;
1093  }
1094  }
1095  else if (fNcentBins==5) { // for PbPb 2015
1096  if (fCent >= 0 && fCent < 10) fCentBin = 0;
1097  else if (fCent >= 10 && fCent < 30) fCentBin = 1;
1098  else if (fCent >= 30 && fCent < 50) fCentBin = 2;
1099  else if (fCent >= 50 && fCent <= 90) fCentBin = 3;
1100  else if (fCent > 90) {
1101  fCent = 99;
1102  fCentBin = 4;
1103  }
1104  else {
1105  AliWarning(Form("Negative centrality: %f. Assuming 99", fCent));
1106  fCentBin = fNcentBins-1;
1107  }
1108  }
1109  else {
1110  Double_t centWidth = (fMaxCent-fMinCent)/(Double_t)fNcentBins;
1111  if(centWidth>0.) {
1112  fCentBin = TMath::FloorNint(fCent/centWidth);
1113  }
1114  else {
1115  fCentBin = 0;
1116  }
1117  if (fCentBin>=fNcentBins) {
1118  AliWarning(Form("fCentBin too large: cent = %f fCentBin = %d. Assuming 99", fCent, fCentBin));
1119  fCentBin = fNcentBins-1;
1120  }
1121  }
1122  }
1123  else {
1124  fCent = 99;
1125  fCentBin = 0;
1126  }
1127 
1128  AliEmcalContainer* cont = 0;
1129 
1130  TIter nextPartColl(&fParticleCollArray);
1131  while ((cont = static_cast<AliEmcalContainer*>(nextPartColl()))) cont->NextEvent();
1132 
1133  TIter nextClusColl(&fClusterCollArray);
1134  while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) cont->NextEvent();
1135 
1136  return kTRUE;
1137 }
1138 
1139 
1151 {
1152  if (!InputEvent()) {
1153  AliError("Could not retrieve event! Returning!");
1154  return;
1155  }
1156 
1157  if (fNeedEmcalGeom) {
1158  fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(InputEvent()->GetRunNumber());
1159  if (!fGeom) {
1160  AliFatal("Can not get EMCal geometry instance. If you do not need the EMCal geometry, disable it by setting task->SetNeedEmcalGeometry(kFALSE).");
1161  return;
1162  }
1163  }
1164 
1165  // Load all requested track branches - each container knows name already
1166  for (Int_t i =0; i<fParticleCollArray.GetEntriesFast(); i++) {
1167  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.At(i));
1169  cont->SetArray(InputEvent());
1170  }
1171 
1172  // Load all requested cluster branches - each container knows name already
1173  for (Int_t i =0; i<fClusterCollArray.GetEntriesFast(); i++) {
1174  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.At(i));
1176  cont->SetArray(InputEvent());
1177  }
1178 
1179  // Determine the proper pointer for each cell object and save them to the cell contianer
1180  // At this point, they should all be created
1181  for (auto cellObj : fCellCollArray)
1182  {
1184  }
1185 
1186  fEventInitialized = kTRUE;
1187 
1189 }
1190 
1195 AliVEvent * AliEmcalCorrectionTask::GetEvent(AliVEvent * inputEvent, bool isEmbedding)
1196 {
1197  AliVEvent * event = 0;
1198  if (isEmbedding) {
1199  // TODO: Enable embedded when that branch is committed!
1200  /*const AliAnalysisTaskEmcalEmbeddingHelper* embedding = AliAnalysisTaskEmcalEmbeddingHelper::GetInstance();
1201  if (!embedding) return 0;
1202 
1203  event = embedding->GetExternalEvent();*/
1204  }
1205  else {
1206  event = inputEvent;
1207  }
1208 
1209  return event;
1210 }
1211 
1216 void AliEmcalCorrectionTask::CheckForContainerArray(AliEmcalContainer * cont, InputObject_t objectType)
1217 {
1218  // TODO: Enable embedded when that branch is committed!
1219  //AliVEvent * event = GetEvent(InputEvent(), cont->GetIsEmbedding());
1220  AliVEvent * event = GetEvent(InputEvent());
1221 
1222  TClonesArray * array = dynamic_cast<TClonesArray *>(event->FindListObject(cont->GetArrayName()));
1223  if (!array) {
1224  AliWarning(TString::Format("Container %s requested branch %s, but it does not exist! Creating it for you! Please check that this the proper action!", cont->GetName(), cont->GetArrayName().Data()));
1225  array = new TClonesArray(DetermineUseDefaultName(objectType, fIsEsd, true).c_str());
1226  array->SetName(cont->GetArrayName());
1227  event->AddObject(array);
1228  }
1229 }
1230 
1239 {
1240  if (TString(n).IsNull()) return 0;
1241 
1243 
1244  fParticleCollArray.Add(cont);
1245 
1246  return cont;
1247 }
1248 
1257 {
1258  if (TString(n).IsNull()) return 0;
1259 
1260  AliTrackContainer* cont = new AliTrackContainer(n);
1261 
1262  fParticleCollArray.Add(cont);
1263 
1264  return cont;
1265 }
1266 
1275 {
1276  if (TString(n).IsNull()) return 0;
1277 
1279 
1280  fParticleCollArray.Add(cont);
1281 
1282  return cont;
1283 }
1284 
1293 {
1294  if (TString(n).IsNull()) return 0;
1295 
1297 
1298  fClusterCollArray.Add(cont);
1299 
1300  return cont;
1301 }
1302 
1309 {
1310  if (i<0 || i>fParticleCollArray.GetEntriesFast()) return 0;
1311  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.At(i));
1312  return cont;
1313 }
1314 
1321 {
1322  if (i<0 || i>fClusterCollArray.GetEntriesFast()) return 0;
1323  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.At(i));
1324  return cont;
1325 }
1326 
1333 {
1334  AliParticleContainer *cont = static_cast<AliParticleContainer*>(fParticleCollArray.FindObject(name));
1335  return cont;
1336 }
1337 
1344 {
1345  AliClusterContainer *cont = static_cast<AliClusterContainer*>(fClusterCollArray.FindObject(name));
1346  return cont;
1347 }
1348 
1349 
1355 {
1356  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
1357 
1358  // Initialize the event if not intialized
1359  if (!fEventInitialized)
1360  ExecOnce();
1361 
1362  // Only continue if we are initialized successfully
1363  if (!fEventInitialized)
1364  return;
1365 
1366  // Get the objects for each event
1367  if (!RetrieveEventObjects())
1368  return;
1369 
1370  // TODO: Consider adding IsEventSelected()??
1371 
1372  // Call run for each correction
1373  if (!Run())
1374  return;
1375 }
1376 
1382 {
1383  // Run the initialization for all derived classes.
1384  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
1385  for (auto component : fCorrectionComponents)
1386  {
1387  component->SetEvent(InputEvent());
1388  component->SetMCEvent(MCEvent());
1389  component->SetCentralityBin(fCentBin);
1390  component->SetCentrality(fCent);
1391 
1392  component->Run();
1393  }
1394 
1395  PostData(1, fOutput);
1396 
1397  // Need something more sophisticated here
1398  return kTRUE;
1399 }
1400 
1406 {
1407  // Run the initialization for all derived classes.
1408  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
1409  for (auto component : fCorrectionComponents)
1410  {
1411  component->UserNotify();
1412  }
1413 
1414  // Need something more sophisticated here
1415  return kTRUE;
1416 }
1417 
1423 {
1424  // Destructor
1425 }
1426 
1433 {
1434  if (fForceBeamType != kNA)
1435  return fForceBeamType;
1436 
1437  AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());
1438  if (esd) {
1439  const AliESDRun *run = esd->GetESDRun();
1440  TString beamType = run->GetBeamType();
1441  if (beamType == "p-p")
1442  return kpp;
1443  else if (beamType == "A-A")
1444  return kAA;
1445  else if (beamType == "p-A")
1446  return kpA;
1447  else
1448  return kNA;
1449  } else {
1450  Int_t runNumber = InputEvent()->GetRunNumber();
1451  if ((runNumber >= 136851 && runNumber <= 139517) || // LHC10h
1452  (runNumber >= 166529 && runNumber <= 170593)) { // LHC11h
1453  return kAA;
1454  } else if ((runNumber>=188365 && runNumber <= 188366) || // LHC12g
1455  (runNumber >= 195344 && runNumber <= 196608)) { // LHC13b-f
1456  return kpA;
1457  } else {
1458  return kpp;
1459  }
1460  }
1461 }
Int_t fNcentBins
how many centrality bins
void SetBranchName(std::string branchName)
Steering task for the EMCal correction frameworkThis class is the steering class for the cell and clu...
AliEMCALGeometry * fGeom
!emcal geometry
const char * filename
Definition: TestFCM.C:1
return jsonbuilder str().c_str()
static bool DoesFileExist(const std::string &filename)
double Double_t
Definition: External.C:58
AliTrackContainer * AddTrackContainer(const char *n)
void SetClusterContainer(AliClusterContainer *cont)
std::string GetInputFieldNameFromInputObjectType(InputObject_t inputObjectType)
AliClusterContainer * GetClusterContainer(Int_t i=0) const
std::vector< AliEmcalCorrectionComponent * > fCorrectionComponents
Contains the correction components.
Container with name, TClonesArray and cuts for particles.
void RetrieveExecutionOrder(std::vector< std::string > &componentsToAdd)
TSystem * gSystem
void AdoptClusterContainer(AliClusterContainer *cont)
void SetupConfigurationFilePath(std::string &filename, bool userFile=false)
void UserExec(Option_t *option)
Double_t fMaxCent
max centrality for event selection
Double_t fVertex[3]
!event vertex
TList * fOutput
! Output for histograms
bool fConfigurationInitialized
True if the YAML files are initialized.
Container for particles within the EMCAL framework.
AliEmcalContainer * AddContainer(InputObject_t contType, std::string &containerName, YAML::Node &userNode, YAML::Node &defaultNode)
void SetUserConfiguration(YAML::Node &node)
Make copy to ensure that the nodes do not point to each other (?)
void AddContainersToComponent(AliEmcalCorrectionComponent *component, InputObject_t inputObjectType)
void SetParticleContainer(AliParticleContainer *cont)
bool fEventInitialized
If the event is initialized properly.
void Load()
Definition: UnfoldingHF.C:238
TString fCentEst
name of V0 centrality estimator
void SetAODFilterBits(UInt_t bits)
int Int_t
Definition: External.C:63
std::string fUserConfigurationFilename
! User YAML configruation filename
unsigned int UInt_t
Definition: External.C:33
std::string fDefaultConfigurationString
Store the default YAML configuration as a string so that it can be streamed.
void SetClusNonLinCorrEnergyCut(Double_t cut)
TString fRunPeriod
Run period (passed by user)
void SetCells(AliVCaloCells *cells)
Double_t fCent
! Event centrality
Base class for correction components in the EMCal correction framework.
BeamType
Switch for the beam type.
AliMCParticleContainer * AddMCParticleContainer(const char *n)
std::map< std::string, AliEmcalTrackSelection::ETrackFilterType_t > trackFilterTypeMap
void SetupContainersFromInputNodes(InputObject_t inputObjectType, YAML::Node &userInputObjectNode, YAML::Node &defaultInputObjectNode, std::set< std::string > &requestedContainers)
static std::string DetermineUseDefaultName(InputObject_t contType, bool esdMode, bool returnObjectType=false)
void SetupContainer(InputObject_t inputObjectType, std::string containerName, YAML::Node &userNode, YAML::Node &defaultNode)
bool WriteConfigurationFile(std::string filename, bool userConfig=false)
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
void SetCellsObjectInCellContainerBasedOnProperties(AliEmcalCorrectionCellContainer *cellContainer)
Bool_t fUseNewCentralityEstimation
Use new centrality estimation (for 2015 data)
void CheckForContainerArray(AliEmcalContainer *cont, InputObject_t objectType)
AliEmcalCorrectionCellContainer * GetCellContainer(const std::string &cellsContainerName) const
std::string fDefaultConfigurationFilename
! Default YAML configuration filename
void GetNodeForInputObjects(YAML::Node &inputNode, YAML::Node &nodeToRetrieveFrom, std::string &inputObjectName, bool requiredProperty)
TObjArray fParticleCollArray
particle/track collection array
TObjArray fClusterCollArray
cluster collection array
static AliVEvent * GetEvent(AliVEvent *inputEvent, bool isEmbedding=false)
void SetDefaultConfiguration(YAML::Node &node)
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
AliParticleContainer * GetParticleContainer(Int_t i=0) const
void AdoptParticleContainer(AliParticleContainer *cont)
void SetCaloCells(AliVCaloCells *cells)
BeamType fBeamType
!event beam type
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
void SetTrackFilterType(ETrackFilterType_t f)
const char Option_t
Definition: External.C:48
YAML::Node fDefaultConfiguration
User YAML Configuration.
void SetupCellsInfo(std::string containerName, YAML::Node &userNode, YAML::Node &defaultNode)
Int_t fNVertCont
!event vertex number of contributors
static AliEmcalCorrectionComponent * createInstance(std::string const &s)
bool Bool_t
Definition: External.C:53
Int_t fCentBin
! Event centrality bin
Double_t fMinCent
min centrality for event selection
AliClusterContainer * AddClusterContainer(const char *n)
std::vector< AliEmcalCorrectionCellContainer * > fCellCollArray
Cells collection array.
AliParticleContainer * AddParticleContainer(const char *n)
Container structure for EMCAL clusters.
Container for MC-true particles within the EMCAL framework.
std::string fUserConfigurationString
Default YAML Configuration.
InputObject_t
Type of input object to be created.
TList * OpenFile(const char *fname)
Definition: DrawAnaELoss.C:65
void SetClusHadCorrEnergyCut(Double_t cut)
bool GetProperty(std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
Retrieve property.
BeamType fForceBeamType
forced beam type
void CreateInputObjects(InputObject_t inputObjectType)