AliPhysics  master (3d17d9d)
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 
32 #include <exception>
33 #include <vector>
34 #include <string>
35 #include <TString.h>
36 #include <fastjet/PseudoJet.hh>
37 #include <fastjet/JetDefinition.hh>
38 
39 class TH1;
40 class THistManager;
41 class TTree;
43 class AliEmcalJet;
45 class AliTrackContainer;
46 
47 #define EXPERIMENTAL_JETCONSTITUENTS
48 
49 namespace PWGJE {
50 
51 namespace EMCALJetTasks {
52 
61 
62  void LinkJetTreeBranches(TTree *jettree, const char *tag);
63 };
64 
73 };
74 
88 
89  void LinkJetTreeBranches(TTree *jettree, const char *tag);
90 };
91 
100  fastjet::JetAlgorithm fRecluserAlgo;
101 };
102 
106 };
107 
111 };
112 
131 
132  void LinkJetTreeBranches(TTree *jettree, const char *tag);
133 };
134 
143 
144  void LinkJetTreeBranches(TTree *jettree, const char *tag);
145 };
146 
151  Double_t fRhoParamters[4];
152 
153  void LinkJetTreeBranches(TTree *jettree, bool fillRho);
154 };
155 
163 public:
164  class ReclusterizerException : public std::exception {
165  public:
166  ReclusterizerException() : std::exception() {}
167  virtual ~ReclusterizerException() throw() {}
168 
169  virtual const char *what() const throw() { return "Error in reclusterizing in fastjet"; }
170  };
171  class SubstructureException : public std::exception {
172  public:
173  SubstructureException() : std::exception() {}
174  virtual ~SubstructureException() throw() {}
175 
176  virtual const char *what() const throw() { return "Error in builing substructure observable"; }
177  };
178  class SoftDropException : public std::exception {
179  public:
180  SoftDropException() : std::exception() {}
181  virtual ~SoftDropException() throw() {}
182 
183  virtual const char *what() const throw() { return "No associated softdrop structure found for jet - softdrop algorithm failing"; }
184  };
186  kCAAlgo = 0,
187  kKTAlgo = 1,
188  kAKTAlgo = 2
189  };
190 
192  kDetLevel = 0,
193  kPartLevel = 1
194  };
195 
197  AliAnalysisTaskEmcalJetSubstructureTree(const char *name);
199 
200  void SetTriggerBits(UInt_t triggersel) { fTriggerSelectionBits = triggersel; }
201  void SetTriggerString(TString triggerstring) { fTriggerSelectionString = triggerstring; }
202  void SetUseDownscaleWeight(Bool_t usedownscale) { fUseDownscaleWeight = usedownscale; }
203  void SetGlobalTriggerDecisionContainerName(const char *name) { fNameTriggerDecisionContainer = name; }
204  void SetUseTriggerSelectionOnData(bool doUse) { fUseTriggerSelectionForData = doUse; }
205 
206  void SetSoftdropDefiniion(Double_t zcut, Double_t betacut, Reclusterizer_t reclusterizer) {
207  fSDZCut = zcut;
208  fSDBetaCut = betacut;
209  fReclusterizer = reclusterizer;
210  }
211 
212  void SetFillPartLevelBranches(Bool_t doFill) { fFillPart = doFill; }
213  void SetFillRhoBranches(Bool_t doFill) { fFillRho = doFill; }
214  void SetFillSoftdropBranches(Bool_t doFill) { fFillSoftDrop = doFill; }
215  void SetFillNSubjettinessBranches(Bool_t doFill) { fFillNSub = doFill; }
216  void SetFillSubstructureBranches(Bool_t doFill) { fFillStructGlob = doFill; }
217 
218  void SetUseChargedConstituents(Bool_t doUse) { fUseChargedConstituents = doUse; }
219  void SetUseNeutralConstituents(Bool_t doUse) { fUseNeutralConstituents = doUse; }
220 
221  void SetHasRecEvent(Bool_t hasrec) { fHasRecEvent = hasrec; }
222  void SetHasTrueEvent(Bool_t hastrue) { fHasTrueEvent = hastrue; }
223 
224  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);
225 
226 protected:
227  virtual void UserCreateOutputObjects();
228  virtual bool Run();
229  virtual void RunChanged(Int_t newrun);
230  virtual void UserExecOnce();
231  virtual Bool_t IsTriggerSelected();
232 
233  AliJetSubstructureData MakeJetSubstructure(const AliEmcalJet &jet, double jetradius, const AliParticleContainer *tracks, const AliClusterContainer *clusters, const AliJetSubstructureSettings &settings) const;
234 
235  AliSoftDropParameters MakeSoftDropParameters(const fastjet::PseudoJet &jet, const AliSoftdropDefinition &cut) const;
236 
237  AliNSubjettinessParameters MakeNsubjettinessParameters(const fastjet::PseudoJet &jet, const AliNSubjettinessDefinition &cut) const;
238 
239  AliJetKineParameters MakeJetKineParameters(const AliEmcalJet &jet, JetRecType_t rectype, const AliParticleContainer *const particles, const AliClusterContainer *const clusters) const;
240 
241  Double_t MakeAngularity(const AliEmcalJet &jet, const AliParticleContainer *tracks, const AliClusterContainer *clusters) const;
242 
243  Double_t MakePtD(const AliEmcalJet &jet, const AliParticleContainer *const particles, const AliClusterContainer *const clusters) const;
244 
245  void FillLuminosity();
246 
247  void DoConstituentQA(const AliEmcalJet *jet, const AliParticleContainer *tracks, const AliClusterContainer *clusters);
248 
249  bool SelectJet(const AliEmcalJet &jet, const AliParticleContainer *particles) const;
250 
251 private:
264 
268 
278 
279  // Fill levels for tree (save disk space when information is not needed)
285 
287 };
288 
297 void LinkBranch(TTree *jettree, void *data, const char *branchname, const char *type);
298 
299 } /* namespace EMCALJetTasks */
300 
301 } /* namespace PWGJE */
302 
303 #endif /* ALIANALYSISTASKEMCALJETSUBSTRUCTURETREE_H */
AliJetStructureParameters * fJetStructureTrue
! True jet substructure paramteres
Double_t fZLeadingNeutral
z of the leading neutral constituent
AliNSubjettinessParameters * fNSubMeasured
! Data field for measured n-subjettiness parameters in jet tree
double Double_t
Definition: External.C:58
void LinkBranch(TTree *jettree, void *data, const char *branchname, const char *type)
Helper function linking struct members to branches in the jet substructure tree.
Double_t fDeltaR
Delta_r of the branches at the last splitting.
Container with name, TClonesArray and cuts for particles.
Definition for the algorithm obtaining the softdrop parameters.
fastjet::JetAlgorithm fRecluserAlgo
Reclusterization algorithm.
AliJetStructureParameters * fJetStructureMeasured
! Measured jet substructure parameters
AliSoftDropParameters * fSoftDropTrue
! Data field for true soft drop parameters in jet tree
Bool_t fUseTriggerSelectionForData
Use trigger selection on data (require trigger patch in addition to trigger selection string) ...
Double_t fZLeadingCharged
z of the leading charged constituent
Int_t fTriggerClusterIndex
Index of the trigger cluster (0 - CENT, 1 - CENTNOTRD)
Container for particles within the EMCAL framework.
Structure for results from the soft drop algorithm.
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
AliSoftDropParameters * fSoftDropMeasured
! Data field for measured soft drop parameters in jet tree
Bool_t isMC
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
void SetSoftdropDefiniion(Double_t zcut, Double_t betacut, Reclusterizer_t reclusterizer)
bool Bool_t
Definition: External.C:53
Container structure for EMCAL clusters.
AliNSubjettinessParameters * fNSubTrue
! Data field for true n-subjettiness parameters in jet tree
Definition: External.C:196
AliJetTreeGlobalParameters * fGlobalTreeParams
! Global jet tree parameters (same for all jets in event)