AliPhysics  648edd6 (648edd6)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalTriggerEmulation.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 #include "AliClusterContainer.h"
16 #include "AliEmcalContainer.h"
18 
22 
23 namespace EMCalTriggerPtAnalysis {
24 
25 AliEmcalTriggerEmulation::AliEmcalTriggerEmulation():
26  TObject(),
27  fThresholdEngine()
28 {
29  /*
30  * See header file for details
31  */
32  fThresholdEngine.SetParameter(0, 1);
33  fThresholdEngine.SetParameter(1, 0);
34  fThresholdEngine.SetParameter(2, 0.5);
35 }
36 
38  TObject(),
39  fThresholdEngine()
40 {
41  /*
42  * See header file for details
43  */
44  fThresholdEngine.SetParameter(0, 1);
45  fThresholdEngine.SetParameter(1, energy);
46  fThresholdEngine.SetParameter(2, resolution);
47 }
48 
49 bool AliEmcalTriggerEmulation::SelectEvent(const AliEmcalContainer * const cont) const {
50  /*
51  * See header file for details
52  */
53  TF1 randomengine = fThresholdEngine; // could be done in a more efficient way
54  double threshold = randomengine.GetRandom();
55 
56  const AliClusterContainer *clustcont = nullptr;
57  if((clustcont = dynamic_cast<const AliClusterContainer *>(cont))){
58  bool found = false;
59  AliVCluster *clust = nullptr;
60  for(auto clusten : clustcont->accepted()){
61  clust = static_cast<AliVCluster *>(clusten);
62  if(clust->E() > threshold){
63  found = true;
64  break;
65  }
66  }
67  return found;
68  }
69  return true;
70 }
71 
72 
73 } /* namespace EMCalTriggerPtAnalysis */
energy
Definition: HFPtSpectrum.C:44
const AliClusterIterableContainer accepted() const
ClassImp(AliAnalysisTaskDeltaPt) AliAnalysisTaskDeltaPt
bool SelectEvent(const AliEmcalContainer *const cont) const
TF1 fThresholdEngine
Engine for energy threshold calculation.
Container structure for EMCAL clusters.