AliPhysics  9df6235 (9df6235)
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 
157 public:
158  class ReclusterizerException : public std::exception {
159  public:
160  ReclusterizerException() : std::exception() {}
161  virtual ~ReclusterizerException() throw() {}
162 
163  virtual const char *what() const throw() { return "Error in reclusterizing in fastjet"; }
164  };
165  class SubstructureException : public std::exception {
166  public:
167  SubstructureException() : std::exception() {}
168  virtual ~SubstructureException() throw() {}
169 
170  virtual const char *what() const throw() { return "Error in builing substructure observable"; }
171  };
172  class SoftDropException : public std::exception {
173  public:
174  SoftDropException() : std::exception() {}
175  virtual ~SoftDropException() throw() {}
176 
177  virtual const char *what() const throw() { return "No associated softdrop structure found for jet - softdrop algorithm failing"; }
178  };
180  kCAAlgo = 0,
181  kKTAlgo = 1,
182  kAKTAlgo = 2
183  };
184 
186  AliAnalysisTaskEmcalJetSubstructureTree(const char *name);
188 
189  void SetTriggerBits(UInt_t triggersel) { fTriggerSelectionBits = triggersel; }
190  void SetTriggerString(TString triggerstring) { fTriggerSelectionString = triggerstring; }
191  void SetUseDownscaleWeight(Bool_t usedownscale) { fUseDownscaleWeight = usedownscale; }
192  void SetGlobalTriggerDecisionContainerName(const char *name) { fNameTriggerDecisionContainer = name; }
193  void SetUseTriggerSelectionOnData(bool doUse) { fUseTriggerSelectionForData = doUse; }
194 
195  void SetSoftdropDefiniion(Double_t zcut, Double_t betacut, Reclusterizer_t reclusterizer) {
196  fSDZCut = zcut;
197  fSDBetaCut = betacut;
198  fReclusterizer = reclusterizer;
199  }
200 
201  void SetFillPartLevelBranches(Bool_t doFill) { fFillPart = doFill; }
202  void SetFillRhoBranches(Bool_t doFill) { fFillRho = doFill; }
203  void SetFillSoftdropBranches(Bool_t doFill) { fFillSoftDrop = doFill; }
204  void SetFillNSubjettinessBranches(Bool_t doFill) { fFillNSub = doFill; }
205  void SetFillSubstructureBranches(Bool_t doFill) { fFillStructGlob = doFill; }
206 
207  void SetUseChargedConstituents(Bool_t doUse) { fUseChargedConstituents = doUse; }
208  void SetUseNeutralConstituents(Bool_t doUse) { fUseNeutralConstituents = doUse; }
209 
210  static AliAnalysisTaskEmcalJetSubstructureTree *AddEmcalJetSubstructureTreeMaker(Bool_t isMC, Bool_t isData, Double_t jetradius, AliJetContainer::EJetType_t jettype, AliJetContainer::ERecoScheme_t recombinationScheme, Bool_t useDCAL, const char *name);
211 
212 protected:
213  virtual void UserCreateOutputObjects();
214  virtual bool Run();
215  virtual void RunChanged(Int_t newrun);
216  virtual void UserExecOnce();
217 
218  AliJetSubstructureData MakeJetSubstructure(const AliEmcalJet &jet, double jetradius, const AliParticleContainer *tracks, const AliClusterContainer *clusters, const AliJetSubstructureSettings &settings) const;
219 
220  AliSoftDropParameters MakeSoftDropParameters(const fastjet::PseudoJet &jet, const AliSoftdropDefinition &cut) const;
221 
222  AliNSubjettinessParameters MakeNsubjettinessParameters(const fastjet::PseudoJet &jet, const AliNSubjettinessDefinition &cut) const;
223 
224  AliJetKineParameters MakeJetKineParameters(const AliEmcalJet &jet) const;
225 
226  Double_t MakeAngularity(const AliEmcalJet &jet, const AliParticleContainer *tracks, const AliClusterContainer *clusters) const;
227 
228  Double_t MakePtD(const AliEmcalJet &jet, const AliParticleContainer *const particles, const AliClusterContainer *const clusters) const;
229 
230  void FillLuminosity();
231 
232  void DoConstituentQA(const AliEmcalJet *jet, const AliParticleContainer *tracks, const AliClusterContainer *clusters);
233 
234  std::string MatchTrigger(const std::string &triggerclass) const;
235  bool IsSelectEmcalTriggers(const std::string &triggerstring) const;
236 
237  bool SelectJet(const AliEmcalJet &jet, const AliParticleContainer *particles) const;
238 
239 private:
252 
256 
264 
265  // Fill levels for tree (save disk space when information is not needed)
271 
275 };
276 
285 void LinkBranch(TTree *jettree, void *data, const char *branchname, const char *type);
286 
287 } /* namespace EmcalTriggerJets */
288 
289 #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) ...