AliPhysics  32e057f (32e057f)
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 
66 };
67 
80 };
81 
90  fastjet::JetAlgorithm fRecluserAlgo;
91 };
92 
96 };
97 
101 };
102 
103 struct Triggerinfo {
104  std::string fTriggerClass;
105  std::string fBunchCrossing;
107  std::string fTriggerCluster;
108 
109  std::string ExpandClassName() const;
110  bool IsTriggerClass(const std::string &triggerclass) const;
111 };
112 
120 public:
121  class ReclusterizerException : public std::exception {
122  public:
123  ReclusterizerException() : std::exception() {}
124  virtual ~ReclusterizerException() throw() {}
125 
126  virtual const char *what() const throw() { return "Error in reclusterizing in fastjet"; }
127  };
128  class SubstructureException : public std::exception {
129  public:
130  SubstructureException() : std::exception() {}
131  virtual ~SubstructureException() throw() {}
132 
133  virtual const char *what() const throw() { return "Error in builing substructure observable"; }
134  };
135  class SoftDropException : public std::exception {
136  public:
137  SoftDropException() : std::exception() {}
138  virtual ~SoftDropException() throw() {}
139 
140  virtual const char *what() const throw() { return "No associated softdrop structure found for jet - softdrop algorithm failing"; }
141  };
143  kCAAlgo = 0,
144  kKTAlgo = 1,
145  kAKTAlgo = 2
146  };
148  kTRadius = 0,
149  kTWeight = 1,
150  kTPtJetRec = 2,
151  kTPtJetSim = 3,
152  kTEJetRec = 4,
153  kTEJetSim = 5,
154  kTEtaRec = 6,
155  kTEtaSim = 7,
156  kTPhiRec = 8,
157  kTPhiSim = 9,
158  kTRhoPtRec = 10,
159  kTRhoPtSim = 11,
160  kTRhoMassRec = 12,
161  kTRhoMassSim = 13,
162  kTAreaRec = 14,
163  kTAreaSim = 15,
164  kTNEFRec = 16,
165  kTNEFSim = 17,
166  kTMassRec = 18,
167  kTMassSim = 19,
168  kTZgMeasured = 20,
169  kTZgTrue = 21,
170  kTRgMeasured = 22,
171  kTRgTrue = 23,
172  kTMgMeasured = 24,
173  kTMgTrue = 25,
174  kTPtgMeasured = 26,
175  kTPtgTrue = 27,
176  kTMugMeasured = 28,
177  kTMugTrue = 29,
178  kTOneNSubjettinessMeasured = 30,
179  kTOneNSubjettinessTrue = 31,
180  kTTwoNSubjettinessMeasured = 32,
181  kTTwoNSubjettinessTrue = 33,
182  kTAngularityMeasured = 34,
183  kTAngularityTrue = 35,
184  kTPtDMeasured = 36,
185  kTPtDTrue = 37,
186  kTNCharged = 38,
187  kTNNeutral = 39,
188  kTNConstTrue = 40,
189  kTNDroppedMeasured = 41,
190  kTNDroppedTrue = 42,
191  kTNVar = 43
192  };
193 
195  AliAnalysisTaskEmcalJetSubstructureTree(const char *name);
197 
198  void SetTriggerBits(UInt_t triggersel) { fTriggerSelectionBits = triggersel; }
199  void SetTriggerString(TString triggerstring) { fTriggerSelectionString = triggerstring; }
200  void SetUseDownscaleWeight(Bool_t usedownscale) { fUseDownscaleWeight = usedownscale; }
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 SetFillAcceptance(Bool_t doFill) { fFillAcceptance = doFill; }
210  void SetFillRhoBranches(Bool_t doFill) { fFillRho = doFill; }
211  void SetFillMassBranches(Bool_t doFill) { fFillMass = doFill; }
212  void SetFillSoftdropBranches(Bool_t doFill) { fFillSoftDrop = doFill; }
213  void SetFillNSubjettinessBranches(Bool_t doFill) { fFillNSub = doFill; }
214  void SetFillSubstructureBranches(Bool_t doFill) { fFillStructGlob = doFill; }
215 
216  static AliAnalysisTaskEmcalJetSubstructureTree *AddEmcalJetSubstructureTreeMaker(Bool_t isMC, Bool_t isData, Double_t jetradius, AliJetContainer::EJetType_t jettype, AliJetContainer::ERecoScheme_t recombinationScheme, const char *name);
217 
218 protected:
219  virtual void UserCreateOutputObjects();
220  virtual bool Run();
221  virtual void RunChanged(Int_t newrun);
222  virtual void UserExecOnce();
223 
224  AliJetSubstructureData MakeJetSubstructure(const AliEmcalJet &jet, double jetradius, const AliParticleContainer *tracks, const AliClusterContainer *clusters, const AliJetSubstructureSettings &settings) const;
225 
226  AliSoftDropParameters MakeSoftDropParameters(const fastjet::PseudoJet &jet, const AliSoftdropDefinition &cut) const;
227 
228  AliNSubjettinessParameters MakeNsubjettinessParameters(const fastjet::PseudoJet &jet, const AliNSubjettinessDefinition &cut) const;
229 
230  Double_t MakeAngularity(const AliEmcalJet &jet, const AliParticleContainer *tracks, const AliClusterContainer *clusters) const;
231 
232  Double_t MakePtD(const AliEmcalJet &jet, const AliParticleContainer *const particles, const AliClusterContainer *const clusters) const;
233 
234  void FillTree(double r, double weight, const AliEmcalJet *datajet, const AliEmcalJet *mcjet, AliSoftDropParameters *dataSoftdrop, AliSoftDropParameters *mcsoftdrop, AliNSubjettinessParameters *dataSubjettiness, AliNSubjettinessParameters *mcSubjettiness, Double_t *angularity, Double_t *ptd, Double_t *rhoparameters);
235 
236  void FillLuminosity();
237 
238  void DoConstituentQA(const AliEmcalJet *jet, const AliParticleContainer *tracks, const AliClusterContainer *clusters);
239 
240  void LinkOutputBranch(const std::string &branchname, Double_t *datalocation);
241 
242  std::vector<Triggerinfo> DecodeTriggerString(const std::string &triggerstring) const;
243  std::string MatchTrigger(const std::string &triggerclass) const;
244  bool IsSelectEmcalTriggers(const std::string &triggerstring) const;
245 
246  bool IsPartBranch(const std::string &branchname) const;
247  bool IsAcceptanceBranch(const std::string &branchname) const;
248  bool IsRhoBranch(const std::string &branchname) const;
249  bool IsMassBranch(const std::string &branchname) const;
250  bool IsSoftdropBranch(const std::string &branchname) const;
251  bool IsNSubjettinessBranch(const std::string &branchname) const;
252  bool IsStructbranch(const std::string &branchname) const;
253 
254 private:
256  Double_t fJetTreeData[kTNVar];
259 
263 
267 
268  // Fill levels for tree (save disk space when information is not needed)
276 
280 };
281 
282 } /* namespace EmcalTriggerJets */
283 
284 #endif /* ALIANALYSISTASKEMCALJETSUBSTRUCTURETREE_H */
double Double_t
Definition: External.C:58
void SetSoftdropDefiniion(Double_t zcut, Double_t betacut, Reclusterizer_t reclusterizer)
Container with name, TClonesArray and cuts for particles.
Structure for results from the soft drop algorithm.
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
Definition for the algorithm obtaining the softdrop parameters.
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
bool Bool_t
Definition: External.C:53
Container structure for EMCAL clusters.
Definition: External.C:196
void FillTree(TTree *tree, TList &parList)
Definition: MakeTrend.C:331