AliPhysics  5364b50 (5364b50)
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 namespace EmcalTriggerJets {
47 
56 
57  void LinkJetTreeBranches(TTree *jettree, const char *tag);
58 };
59 
68 };
69 
83 
84  void LinkJetTreeBranches(TTree *jettree, const char *tag);
85 };
86 
95  fastjet::JetAlgorithm fRecluserAlgo;
96 };
97 
101 };
102 
106 };
107 
123 
124  void LinkJetTreeBranches(TTree *jettree, const char *tag);
125 };
126 
135 
136  void LinkJetTreeBranches(TTree *jettree, const char *tag);
137 };
138 
142  Double_t fRhoParamters[4];
143 
144  void LinkJetTreeBranches(TTree *jettree, bool fillRho);
145 };
146 
147 struct Triggerinfo {
148  std::string fTriggerClass;
149  std::string fBunchCrossing;
151  std::string fTriggerCluster;
152 
153  std::string ExpandClassName() const;
154  bool IsTriggerClass(const std::string &triggerclass) const;
155 };
156 
164 public:
165  class ReclusterizerException : public std::exception {
166  public:
167  ReclusterizerException() : std::exception() {}
168  virtual ~ReclusterizerException() throw() {}
169 
170  virtual const char *what() const throw() { return "Error in reclusterizing in fastjet"; }
171  };
172  class SubstructureException : public std::exception {
173  public:
174  SubstructureException() : std::exception() {}
175  virtual ~SubstructureException() throw() {}
176 
177  virtual const char *what() const throw() { return "Error in builing substructure observable"; }
178  };
179  class SoftDropException : public std::exception {
180  public:
181  SoftDropException() : std::exception() {}
182  virtual ~SoftDropException() throw() {}
183 
184  virtual const char *what() const throw() { return "No associated softdrop structure found for jet - softdrop algorithm failing"; }
185  };
187  kCAAlgo = 0,
188  kKTAlgo = 1,
189  kAKTAlgo = 2
190  };
191 
193  AliAnalysisTaskEmcalJetSubstructureTree(const char *name);
195 
196  void SetTriggerBits(UInt_t triggersel) { fTriggerSelectionBits = triggersel; }
197  void SetTriggerString(TString triggerstring) { fTriggerSelectionString = triggerstring; }
198  void SetUseDownscaleWeight(Bool_t usedownscale) { fUseDownscaleWeight = usedownscale; }
199  void SetGlobalTriggerDecisionContainerName(const char *name) { fNameTriggerDecisionContainer = name; }
200  void SetUseTriggerSelectionOnData(bool doUse) { fUseTriggerSelectionForData = doUse; }
201 
202  void SetSoftdropDefiniion(Double_t zcut, Double_t betacut, Reclusterizer_t reclusterizer) {
203  fSDZCut = zcut;
204  fSDBetaCut = betacut;
205  fReclusterizer = reclusterizer;
206  }
207 
208  void SetFillPartLevelBranches(Bool_t doFill) { fFillPart = doFill; }
209  void SetFillRhoBranches(Bool_t doFill) { fFillRho = doFill; }
210  void SetFillSoftdropBranches(Bool_t doFill) { fFillSoftDrop = doFill; }
211  void SetFillNSubjettinessBranches(Bool_t doFill) { fFillNSub = doFill; }
212  void SetFillSubstructureBranches(Bool_t doFill) { fFillStructGlob = doFill; }
213 
214  void SetUseChargedConstituents(Bool_t doUse) { fUseChargedConstituents = doUse; }
215  void SetUseNeutralConstituents(Bool_t doUse) { fUseNeutralConstituents = doUse; }
216 
217  static AliAnalysisTaskEmcalJetSubstructureTree *AddEmcalJetSubstructureTreeMaker(Bool_t isMC, Bool_t isData, Double_t jetradius, AliJetContainer::EJetType_t jettype, AliJetContainer::ERecoScheme_t recombinationScheme, const char *name);
218 
219 protected:
220  virtual void UserCreateOutputObjects();
221  virtual bool Run();
222  virtual void RunChanged(Int_t newrun);
223  virtual void UserExecOnce();
224 
225  AliJetSubstructureData MakeJetSubstructure(const AliEmcalJet &jet, double jetradius, const AliParticleContainer *tracks, const AliClusterContainer *clusters, const AliJetSubstructureSettings &settings) const;
226 
227  AliSoftDropParameters MakeSoftDropParameters(const fastjet::PseudoJet &jet, const AliSoftdropDefinition &cut) const;
228 
229  AliNSubjettinessParameters MakeNsubjettinessParameters(const fastjet::PseudoJet &jet, const AliNSubjettinessDefinition &cut) const;
230 
231  AliJetKineParameters MakeJetKineParameters(const AliEmcalJet &jet) const;
232 
233  Double_t MakeAngularity(const AliEmcalJet &jet, const AliParticleContainer *tracks, const AliClusterContainer *clusters) const;
234 
235  Double_t MakePtD(const AliEmcalJet &jet, const AliParticleContainer *const particles, const AliClusterContainer *const clusters) const;
236 
237  void FillLuminosity();
238 
239  void DoConstituentQA(const AliEmcalJet *jet, const AliParticleContainer *tracks, const AliClusterContainer *clusters);
240 
241  std::vector<Triggerinfo> DecodeTriggerString(const std::string &triggerstring) const;
242  std::string MatchTrigger(const std::string &triggerclass) const;
243  bool IsSelectEmcalTriggers(const std::string &triggerstring) const;
244 
245  bool SelectJet(const AliEmcalJet &jet, const AliParticleContainer *particles) const;
246 
247 private:
260 
264 
272 
273  // Fill levels for tree (save disk space when information is not needed)
279 
283 };
284 
293 void LinkBranch(TTree *jettree, void *data, const char *branchname, const char *type);
294 
295 } /* namespace EmcalTriggerJets */
296 
297 #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
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) ...