AliPhysics  d565ceb (d565ceb)
AliAnalysisTaskEmcalJetSubstructureTree.h
Go to the documentation of this file.
1 /************************************************************************************
2  * Copyright (C) 2017, Copyright Holders of the ALICE Collaboration *
3  * All rights reserved. *
4  * *
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions are met: *
7  * * Redistributions of source code must retain the above copyright *
8  * notice, this list of conditions and the following disclaimer. *
9  * * Redistributions in binary form must reproduce the above copyright *
10  * notice, this list of conditions and the following disclaimer in the *
11  * documentation and/or other materials provided with the distribution. *
12  * * Neither the name of the <organization> nor the *
13  * names of its contributors may be used to endorse or promote products *
14  * derived from this software without specific prior written permission. *
15  * *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
19  * DISCLAIMED. IN NO EVENT SHALL ALICE COLLABORATION BE LIABLE FOR ANY *
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
26  ************************************************************************************/
27 #ifndef ALIANALYSISTASKEMCALJETSUBSTRUCTURETREE_H
28 #define ALIANALYSISTASKEMCALJETSUBSTRUCTURETREE_H
29 
31 #include <exception>
32 #include <vector>
33 #include <string>
34 #include <TString.h>
35 #include <fastjet/PseudoJet.hh>
36 #include <fastjet/JetDefinition.hh>
37 
38 class TH1;
39 class THistManager;
40 class TTree;
42 class AliEmcalJet;
44 class AliTrackContainer;
45 
46 #define EXPERIMENTAL_JETCONSTITUENTS
47 
48 namespace EmcalTriggerJets {
49 
58 
59  void LinkJetTreeBranches(TTree *jettree, const char *tag);
60 };
61 
70 };
71 
85 
86  void LinkJetTreeBranches(TTree *jettree, const char *tag);
87 };
88 
97  fastjet::JetAlgorithm fRecluserAlgo;
98 };
99 
103 };
104 
108 };
109 
125 
126  void LinkJetTreeBranches(TTree *jettree, const char *tag);
127 };
128 
137 
138  void LinkJetTreeBranches(TTree *jettree, const char *tag);
139 };
140 
145  Double_t fRhoParamters[4];
146 
147  void LinkJetTreeBranches(TTree *jettree, bool fillRho);
148 };
149 
150 struct Triggerinfo {
151  std::string fTriggerClass;
152  std::string fBunchCrossing;
154  std::string fTriggerCluster;
155 
156  std::string ExpandClassName() const;
157  bool IsTriggerClass(const std::string &triggerclass) const;
158 };
159 
167 public:
168  class ReclusterizerException : public std::exception {
169  public:
170  ReclusterizerException() : std::exception() {}
171  virtual ~ReclusterizerException() throw() {}
172 
173  virtual const char *what() const throw() { return "Error in reclusterizing in fastjet"; }
174  };
175  class SubstructureException : public std::exception {
176  public:
177  SubstructureException() : std::exception() {}
178  virtual ~SubstructureException() throw() {}
179 
180  virtual const char *what() const throw() { return "Error in builing substructure observable"; }
181  };
182  class SoftDropException : public std::exception {
183  public:
184  SoftDropException() : std::exception() {}
185  virtual ~SoftDropException() throw() {}
186 
187  virtual const char *what() const throw() { return "No associated softdrop structure found for jet - softdrop algorithm failing"; }
188  };
190  kCAAlgo = 0,
191  kKTAlgo = 1,
192  kAKTAlgo = 2
193  };
194 
196  AliAnalysisTaskEmcalJetSubstructureTree(const char *name);
198 
199  void SetTriggerBits(UInt_t triggersel) { fTriggerSelectionBits = triggersel; }
200  void SetTriggerString(TString triggerstring) { fTriggerSelectionString = triggerstring; }
201  void SetUseDownscaleWeight(Bool_t usedownscale) { fUseDownscaleWeight = usedownscale; }
202  void SetGlobalTriggerDecisionContainerName(const char *name) { fNameTriggerDecisionContainer = name; }
203  void SetUseTriggerSelectionOnData(bool doUse) { fUseTriggerSelectionForData = doUse; }
204 
205  void SetSoftdropDefiniion(Double_t zcut, Double_t betacut, Reclusterizer_t reclusterizer) {
206  fSDZCut = zcut;
207  fSDBetaCut = betacut;
208  fReclusterizer = reclusterizer;
209  }
210 
211  void SetFillPartLevelBranches(Bool_t doFill) { fFillPart = doFill; }
212  void SetFillRhoBranches(Bool_t doFill) { fFillRho = doFill; }
213  void SetFillSoftdropBranches(Bool_t doFill) { fFillSoftDrop = doFill; }
214  void SetFillNSubjettinessBranches(Bool_t doFill) { fFillNSub = doFill; }
215  void SetFillSubstructureBranches(Bool_t doFill) { fFillStructGlob = doFill; }
216 
217  void SetUseChargedConstituents(Bool_t doUse) { fUseChargedConstituents = doUse; }
218  void SetUseNeutralConstituents(Bool_t doUse) { fUseNeutralConstituents = doUse; }
219 
220  static AliAnalysisTaskEmcalJetSubstructureTree *AddEmcalJetSubstructureTreeMaker(Bool_t isMC, Bool_t isData, Double_t jetradius, AliJetContainer::EJetType_t jettype, AliJetContainer::ERecoScheme_t recombinationScheme, const char *name);
221 
222 protected:
223  virtual void UserCreateOutputObjects();
224  virtual bool Run();
225  virtual void RunChanged(Int_t newrun);
226  virtual void UserExecOnce();
227 
228  AliJetSubstructureData MakeJetSubstructure(const AliEmcalJet &jet, double jetradius, const AliParticleContainer *tracks, const AliClusterContainer *clusters, const AliJetSubstructureSettings &settings) const;
229 
230  AliSoftDropParameters MakeSoftDropParameters(const fastjet::PseudoJet &jet, const AliSoftdropDefinition &cut) const;
231 
232  AliNSubjettinessParameters MakeNsubjettinessParameters(const fastjet::PseudoJet &jet, const AliNSubjettinessDefinition &cut) const;
233 
234  AliJetKineParameters MakeJetKineParameters(const AliEmcalJet &jet) const;
235 
236  Double_t MakeAngularity(const AliEmcalJet &jet, const AliParticleContainer *tracks, const AliClusterContainer *clusters) const;
237 
238  Double_t MakePtD(const AliEmcalJet &jet, const AliParticleContainer *const particles, const AliClusterContainer *const clusters) const;
239 
240  void FillLuminosity();
241 
242  void DoConstituentQA(const AliEmcalJet *jet, const AliParticleContainer *tracks, const AliClusterContainer *clusters);
243 
244  std::vector<Triggerinfo> DecodeTriggerString(const std::string &triggerstring) const;
245  std::string MatchTrigger(const std::string &triggerclass) const;
246  bool IsSelectEmcalTriggers(const std::string &triggerstring) const;
247 
248  bool SelectJet(const AliEmcalJet &jet, const AliParticleContainer *particles) const;
249 
250 private:
263 
267 
275 
276  // Fill levels for tree (save disk space when information is not needed)
282 
286 };
287 
296 void LinkBranch(TTree *jettree, void *data, const char *branchname, const char *type);
297 
298 } /* namespace EmcalTriggerJets */
299 
300 #endif /* ALIANALYSISTASKEMCALJETSUBSTRUCTURETREE_H */
double Double_t
Definition: External.C:58
Double_t fDeltaR
Delta_r of the branches at the last splitting.
void SetSoftdropDefiniion(Double_t zcut, Double_t betacut, Reclusterizer_t reclusterizer)
AliNSubjettinessParameters * fNSubTrue
! Data field for true n-subjettiness parameters in jet tree
Container with name, TClonesArray and cuts for particles.
AliSoftDropParameters * fSoftDropMeasured
! Data field for measured soft drop parameters in jet tree
Int_t fTriggerClusterIndex
Index of the trigger cluster (0 - CENT, 1 - CENTNOTRD)
Structure for results from the soft drop algorithm.
AliNSubjettinessParameters * fNSubMeasured
! Data field for measured n-subjettiness parameters in jet tree
fastjet::JetAlgorithm fRecluserAlgo
Reclusterization algorithm.
Container for particles within the EMCAL framework.
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
void LinkBranch(TTree *jettree, void *data, const char *branchname, const char *type)
Helper function linking struct members to branches in the jet substructure tree.
AliJetStructureParameters * fJetStructureTrue
! True jet substructure paramteres
Definition for the algorithm obtaining the softdrop parameters.
AliJetStructureParameters * fJetStructureMeasured
! Measured jet substructure parameters
Bool_t isMC
AliJetKineParameters * fKineRec
! Detector level jet kinematics
AliJetKineParameters * fKineSim
! Particle level jet kinematics
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
Container class for histograms.
Definition: THistManager.h:99
AliJetTreeGlobalParameters * fGlobalTreeParams
! Global jet tree parameters (same for all jets in event)
bool Bool_t
Definition: External.C:53
AliSoftDropParameters * fSoftDropTrue
! Data field for true soft drop parameters in jet tree
Container structure for EMCAL clusters.
Definition: External.C:196
Bool_t fUseTriggerSelectionForData
Use trigger selection on data (require trigger patch in addition to trigger selection string) ...