]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/EMCALJetTasks/AliJetResponseMaker.h
8974e1413a6cb1e57231d3cf4c594bbf79e97eaa
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / AliJetResponseMaker.h
1 #ifndef ALIJETRESPONSEMAKER_H
2 #define ALIJETRESPONSEMAKER_H
3
4 // $Id$
5
6 class AliGenPythiaEventHeader;
7 class TClonesArray;
8 class TH1;
9 class TH2;
10 class TH3;
11
12 #include "AliEmcalJet.h"
13 #include "AliAnalysisTaskEmcalJet.h"
14
15 class AliJetResponseMaker : public AliAnalysisTaskEmcalJet {
16  public:
17   AliJetResponseMaker();
18   AliJetResponseMaker(const char *name);
19   virtual ~AliJetResponseMaker();
20
21   enum MatchingType{
22     kNoMatching = 0,
23     kGeometrical = 1,
24     kMCLabel = 2,
25     kSameCollections = 3
26   };
27
28   void                        UserCreateOutputObjects();
29
30   void                        SetJets2Name(const char *n)                                     { fJets2Name         = n         ; }
31   void                        SetTracks2Name(const char *n)                                   { fTracks2Name       = n         ; }
32   void                        SetClus2Name(const char *n)                                     { fCalo2Name         = n         ; }
33   void                        SetJet2EtaLimits(Float_t min=-999, Float_t max=-999)            { fJet2MinEta = min, fJet2MaxEta = max ; }
34   void                        SetJet2PhiLimits(Float_t min=-999, Float_t max=-999)            { fJet2MinPhi = min, fJet2MaxPhi = max ; }
35   void                        SetRho2Name(const char *n)                                      { fRho2Name          = n         ; }
36   void                        SetPtBiasJet2Clus(Float_t b)                                    { fPtBiasJet2Clus    = b         ; }
37   void                        SetPtBiasJet2Track(Float_t b)                                   { fPtBiasJet2Track   = b         ; }
38   void                        SetMatching(MatchingType t, Double_t p1=1, Double_t p2=1)       { fMatching = t; fMatchingPar1 = p1; fMatchingPar2 = p2; }
39   void                        SetPtHardBin(Int_t b)                                           { fSelectPtHardBin   = b         ; }
40   void                        SetAreMCCollections(Bool_t f1, Bool_t f2)                       { fAreCollections1MC = f1; fAreCollections2MC = f2; }
41
42  protected:
43   Bool_t                      IsEventSelected();
44   Bool_t                      AcceptJet(AliEmcalJet* jet) const;
45   Bool_t                      AcceptBiasJet2(AliEmcalJet *jet) const;
46   void                        ExecOnce();
47   void                        DoJetLoop(Bool_t order);
48   Bool_t                      FillHistograms();
49   Bool_t                      RetrieveEventObjects();
50   Bool_t                      Run();
51   Bool_t                      DoJetMatching();
52   void                        SetMatchingLevel(AliEmcalJet *jet1, AliEmcalJet *jet2, MatchingType matching);
53   void                        GetGeometricalMatchingLevel(AliEmcalJet *jet1, AliEmcalJet *jet2, Double_t &d) const;
54   void                        GetMCLabelMatchingLevel(AliEmcalJet *jet1, AliEmcalJet *jet2, Double_t &d1, Double_t &d2) const;
55   void                        GetSameCollectionsMatchingLevel(AliEmcalJet *jet1, AliEmcalJet *jet2, Double_t &d1, Double_t &d2) const;
56
57   TString                     fTracks2Name;                   // name of second track collection
58   TString                     fCalo2Name;                     // name of second cluster collection
59   TString                     fJets2Name;                     // name of second jet collection
60   TString                     fRho2Name;                      // name of second jet collection
61   Float_t                     fPtBiasJet2Track;               // select jets 2 with a minimum pt track
62   Float_t                     fPtBiasJet2Clus;                // select jets 2 with a minimum pt cluster
63   Bool_t                      fAreCollections1MC;             // collections 1 MC
64   Bool_t                      fAreCollections2MC;             // collections 1 MC
65   MatchingType                fMatching;                      // matching type
66   Double_t                    fMatchingPar1;                  // matching parameter for generated-reconstructed matching
67   Double_t                    fMatchingPar2;                  // matching parameter for reconstructed-generated matching
68   Float_t                     fJet2MinEta;                    // minimum eta jet 2 acceptance
69   Float_t                     fJet2MaxEta;                    // maximum eta jet 2 acceptance
70   Float_t                     fJet2MinPhi;                    // minimum phi jet 2 acceptance
71   Float_t                     fJet2MaxPhi;                    // maximum phi jet 2 acceptance  
72   Int_t                       fSelectPtHardBin;               // select one pt hard bin for analysis
73
74   AliGenPythiaEventHeader    *fPythiaHeader;                  //!event Pythia header
75   Int_t                       fPtHardBin;                     //!event pt hard bin
76   Int_t                       fNTrials;                       //!event trials
77   TClonesArray               *fTracks2;                       //!Tracks 2
78   TClonesArray               *fCaloClusters2;                 //!Clusters 2
79   TClonesArray               *fJets2;                         //!Jets 2
80   AliRhoParameter            *fRho2;                          //!Event rho 2
81   Double_t                    fRho2Val;                       //!Event rho 2 value 
82   TH1                        *fTracks2Map;                    //!MC particle map
83   // General histograms
84   TH1                        *fHistNTrials;                   //!total number of trials per pt hard bin
85   TH1                        *fHistEvents;                    //!total number of events per pt hard bin
86   // Jets 1
87   TH2                        *fHistJets1PhiEta;               //!phi-eta distribution of jets 1
88   TH2                        *fHistJets1PtArea;               //!inclusive jet pt vs area histogram 1
89   TH2                        *fHistJets1CorrPtArea;           //!inclusive jet pt vs. area histogram 1
90   // Jets 2
91   TH2                        *fHistJets2PhiEta;               //!phi-eta distribution of jets 2
92   TH2                        *fHistJets2PtArea;               //!inclusive jet pt vs. area histogram 2
93   TH2                        *fHistJets2CorrPtArea;           //!inclusive jet pt vs. area histogram 2
94   TH2                        *fHistJets2PhiEtaAcceptance;     //!phi-eta distribution of jets 2 using jet 1 cuts (acceptance, leading hadron bias, ...)
95   TH2                        *fHistJets2PtAreaAcceptance;     //!inclusive jet pt vs. area histogram 2 using jet 1 cuts (acceptance, leading hadron bias, ...)
96   TH2                        *fHistJets2CorrPtAreaAcceptance; //!inclusive jet pt vs. area histogram 2 using jet 1 cuts (acceptance, leading hadron bias, ...)
97   // Jet1-Jet2 matching
98   TH2                        *fHistMatchingLevelvsJet2Pt;              //!matching level vs jet 2 pt
99   TH2                        *fHistDistancevsCommonEnergy1;            //!distance vs common energy 1 (%)
100   TH2                        *fHistDistancevsCommonEnergy2;            //!distance vs common energy 2 (%)
101   TH3                        *fHistDeltaEtaPhivsJet2Pt;                //!delta eta-phi between matched jets vs jet 2 pt
102   TH2                        *fHistDeltaPtvsJet2Pt;                    //!delta pt between matched jets vs jet 2 pt
103   TH2                        *fHistDeltaPtvsMatchingLevel;             //!delta pt between matched jets vs matching level
104   TH2                        *fHistDeltaCorrPtvsJet2Pt;                //!delta pt corr between matched jets vs jet 2 pt
105   TH2                        *fHistDeltaCorrPtvsMatchingLevel;         //!delta pt corr between matched jets vs matching level
106   TH2                        *fHistNonMatchedJets1PtArea;              //!non-matched jet 1 pt distribution
107   TH2                        *fHistNonMatchedJets2PtArea;              //!non-matched jet 2 pt distribution
108   TH2                        *fHistNonMatchedJets1CorrPtArea;          //!non-matched jet pt distribution
109   TH2                        *fHistNonMatchedJets2CorrPtArea;          //!non-matched jet pt distribution
110   TH2                        *fHistJet1PtvsJet2Pt;                     //!correlation jet 1 pt vs jet 2 pt
111   TH2                        *fHistJet1CorrPtvsJet2CorrPt;             //!correlation jet 1 corr pt vs jet 2 corr pt
112   TH2                        *fHistMissedJets2PtArea;                  //!jets 2 not found in jet 1 collection
113
114  private:
115   AliJetResponseMaker(const AliJetResponseMaker&);            // not implemented
116   AliJetResponseMaker &operator=(const AliJetResponseMaker&); // not implemented
117
118   ClassDef(AliJetResponseMaker, 11) // Jet response matrix producing task
119 };
120 #endif