AliPhysics  9b6b435 (9b6b435)
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 
128 
129  void LinkJetTreeBranches(TTree *jettree, const char *tag);
130 };
131 
140 
141  void LinkJetTreeBranches(TTree *jettree, const char *tag);
142 };
143 
148  Double_t fRhoParamters[4];
149 
150  void LinkJetTreeBranches(TTree *jettree, bool fillRho);
151 };
152 
160 public:
161  class ReclusterizerException : public std::exception {
162  public:
163  ReclusterizerException() : std::exception() {}
164  virtual ~ReclusterizerException() throw() {}
165 
166  virtual const char *what() const throw() { return "Error in reclusterizing in fastjet"; }
167  };
168  class SubstructureException : public std::exception {
169  public:
170  SubstructureException() : std::exception() {}
171  virtual ~SubstructureException() throw() {}
172 
173  virtual const char *what() const throw() { return "Error in builing substructure observable"; }
174  };
175  class SoftDropException : public std::exception {
176  public:
177  SoftDropException() : std::exception() {}
178  virtual ~SoftDropException() throw() {}
179 
180  virtual const char *what() const throw() { return "No associated softdrop structure found for jet - softdrop algorithm failing"; }
181  };
183  kCAAlgo = 0,
184  kKTAlgo = 1,
185  kAKTAlgo = 2
186  };
187 
189  kDetLevel = 0,
190  kPartLevel = 1
191  };
192 
194  AliAnalysisTaskEmcalJetSubstructureTree(const char *name);
196 
197  void SetTriggerBits(UInt_t triggersel) { fTriggerSelectionBits = triggersel; }
198  void SetTriggerString(TString triggerstring) { fTriggerSelectionString = triggerstring; }
199  void SetUseDownscaleWeight(Bool_t usedownscale) { fUseDownscaleWeight = usedownscale; }
200  void SetGlobalTriggerDecisionContainerName(const char *name) { fNameTriggerDecisionContainer = name; }
201  void SetUseTriggerSelectionOnData(bool doUse) { fUseTriggerSelectionForData = doUse; }
202 
203  void SetSoftdropDefiniion(Double_t zcut, Double_t betacut, Reclusterizer_t reclusterizer) {
204  fSDZCut = zcut;
205  fSDBetaCut = betacut;
206  fReclusterizer = reclusterizer;
207  }
208 
209  void SetFillPartLevelBranches(Bool_t doFill) { fFillPart = doFill; }
210  void SetFillRhoBranches(Bool_t doFill) { fFillRho = doFill; }
211  void SetFillSoftdropBranches(Bool_t doFill) { fFillSoftDrop = doFill; }
212  void SetFillNSubjettinessBranches(Bool_t doFill) { fFillNSub = doFill; }
213  void SetFillSubstructureBranches(Bool_t doFill) { fFillStructGlob = doFill; }
214 
215  void SetUseChargedConstituents(Bool_t doUse) { fUseChargedConstituents = doUse; }
216  void SetUseNeutralConstituents(Bool_t doUse) { fUseNeutralConstituents = doUse; }
217 
218  void SetHasRecEvent(Bool_t hasrec) { fHasRecEvent = hasrec; }
219  void SetHasTrueEvent(Bool_t hastrue) { fHasTrueEvent = hastrue; }
220 
221  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);
222 
223 protected:
224  virtual void UserCreateOutputObjects();
225  virtual bool Run();
226  virtual void RunChanged(Int_t newrun);
227  virtual void UserExecOnce();
228  virtual Bool_t IsTriggerSelected();
229 
230  AliJetSubstructureData MakeJetSubstructure(const AliEmcalJet &jet, double jetradius, const AliParticleContainer *tracks, const AliClusterContainer *clusters, const AliJetSubstructureSettings &settings) const;
231 
232  AliSoftDropParameters MakeSoftDropParameters(const fastjet::PseudoJet &jet, const AliSoftdropDefinition &cut) const;
233 
234  AliNSubjettinessParameters MakeNsubjettinessParameters(const fastjet::PseudoJet &jet, const AliNSubjettinessDefinition &cut) const;
235 
236  AliJetKineParameters MakeJetKineParameters(const AliEmcalJet &jet, JetRecType_t rectype, const AliParticleContainer *const particles, const AliClusterContainer *const clusters) const;
237 
238  Double_t MakeAngularity(const AliEmcalJet &jet, const AliParticleContainer *tracks, const AliClusterContainer *clusters) const;
239 
240  Double_t MakePtD(const AliEmcalJet &jet, const AliParticleContainer *const particles, const AliClusterContainer *const clusters) const;
241 
242  void FillLuminosity();
243 
244  void DoConstituentQA(const AliEmcalJet *jet, const AliParticleContainer *tracks, const AliClusterContainer *clusters);
245 
246  std::string MatchTrigger(const std::string &triggerclass) const;
247  bool IsSelectEmcalTriggers(const std::string &triggerstring) const;
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 
289 };
290 
299 void LinkBranch(TTree *jettree, void *data, const char *branchname, const char *type);
300 
301 } /* namespace EmcalTriggerJets */
302 
303 #endif /* ALIANALYSISTASKEMCALJETSUBSTRUCTURETREE_H */
Double_t fZLeadingNeutral
z of the leading neutral constituent
double Double_t
Definition: External.C:58
Bool_t fHasRecEvent
Has reconstructed event (for trigger selection)
Double_t fZLeadingCharged
z of the leading charged constituent
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.
Bool_t fHasTrueEvent
Has Monte-Carlo truth (for trigger selection)
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) ...