LCOV - code coverage report
Current view: top level - STEER/AOD - AliAODPWG4Particle.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 85 1.2 %
Date: 2016-06-14 17:26:59 Functions: 1 85 1.2 %

          Line data    Source code
       1             : #ifndef ALIAODPWG4PARTICLE_H
       2             : #define ALIAODPWG4PARTICLE_H
       3             : /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
       4             :  * See cxx source for full Copyright notice                               */
       5             : 
       6             : //_________________________________________________________________________
       7             : /// \class AliAODPWG4Particle
       8             : /// \brief Container for input particle information on CaloTrackCorr package
       9             : ///
      10             : ///  AOD objects class in use in the CaloTrackCorrelations
      11             : ///  analysis pacackge ($ALICE_PHYSICS/PWGGA/CaloTrackCorrelations)
      12             : ///  Common format for selected tracks or calorimeter clusters to give as input
      13             : ///  for different analysis. Basically it contains the particle kinematics
      14             : ///  and some detailed parameters of the calorimeter cluster and of the intermediate
      15             : ///  steps of the analysis.
      16             : ///
      17             : ///  More information can be found in this [twiki](https://twiki.cern.ch/twiki/bin/viewauth/ALICE/PhotonHadronCorrelations).
      18             : ///
      19             : ///  \author Gustavo Conesa Balbastre <Gustavo.Conesa.Balbastre@cern.ch>, LPSC-IN2P3-CNRS
      20             : //-------------------------------------------------------------------------
      21             : 
      22             : //-- ROOT system --
      23             : #include <TLorentzVector.h>
      24             : class TString;
      25             : 
      26             : //-- Analysis system
      27             : #include "AliVParticle.h"
      28             : 
      29             : class AliAODPWG4Particle : public AliVParticle {
      30             :   
      31             :  public:
      32             :   
      33             :   AliAODPWG4Particle();
      34             :   AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e);
      35             :   AliAODPWG4Particle(TLorentzVector & p);
      36             :   
      37             :   virtual ~AliAODPWG4Particle();
      38             :   virtual void Clear(const Option_t* /*opt*/);
      39             : 
      40             :   AliAODPWG4Particle (           const AliAODPWG4Particle& photon);
      41             :   AliAODPWG4Particle & operator=(const AliAODPWG4Particle& photon);
      42             : 
      43             :   // Main methods to recover kinematics or PID
      44           0 :   TLorentzVector * Momentum() const                  { return fMomentum ; }
      45           0 :   virtual void     SetMomentum(TLorentzVector *lv)   { fMomentum = lv   ; }
      46             :   
      47             :   Bool_t IsPIDOK(Int_t ipid, Int_t pdgwanted)  const;
      48           0 :   Double_t GetPairMass(AliAODPWG4Particle * p) const { return (*(p->fMomentum)+*fMomentum).M() ; }
      49             :   
      50             :   // AliVParticle methods
      51           0 :   virtual Double_t Px()         const { return fMomentum->Px();      }
      52           0 :   virtual Double_t Py()         const { return fMomentum->Py();      }
      53           0 :   virtual Double_t Pz()         const { return fMomentum->Pz();      }
      54           0 :   virtual Double_t Pt()         const { return fMomentum->Pt();      }
      55           0 :   virtual Double_t P()          const { return fMomentum->P();       }
      56           0 :   virtual Bool_t   PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; }
      57           0 :   virtual Double_t OneOverPt()  const { return 1. / fMomentum->Pt(); }
      58             :   virtual Double_t Phi()        const;
      59           0 :   virtual Double_t Theta()      const { return fMomentum->Theta();   }
      60           0 :   virtual Double_t E()          const { return fMomentum->E();       }
      61           0 :   virtual Double_t M()          const { return fMomentum->M();       }
      62           0 :   virtual Double_t Eta()        const { return fMomentum->Eta();     }
      63           0 :   virtual Double_t Y()          const { return fMomentum->Rapidity();}
      64           0 :   virtual Double_t Xv()         const { return -999.;} // put reasonable values here
      65           0 :   virtual Double_t Yv()         const { return -999.;} //
      66           0 :   virtual Double_t Zv()         const { return -999.;} //
      67           0 :   virtual Bool_t   XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; }  
      68             :   virtual void     Print(Option_t* /*option*/) const;
      69             :   
      70             :   //
      71             :   //Dummy
      72           0 :   virtual Short_t Charge()      const { return 0    ; }
      73           0 :   virtual const Double_t* PID() const { return NULL ; }
      74           0 :   Int_t   PdgCode()             const { return 0    ; }
      75             :   //
      76             : 
      77             :   //
      78             :   // Specific getters
      79           0 :   virtual Int_t   GetIdentifiedParticleType() const { return fPdg     ; }
      80             : 
      81           0 :   virtual Int_t   GetLabel()             const { return fLabel        ; }
      82           0 :   virtual Int_t   GetCaloLabel (Int_t i) const { return fCaloLabel[i] ; }
      83           0 :   virtual Int_t   GetTrackLabel(Int_t i) const { return fTrackLabel[i]; }
      84           0 :   virtual UInt_t  GetDetectorTag()       const { return fDetectorTag  ; }
      85           0 :   virtual Bool_t  GetDispBit()           const { return fDisp         ; }
      86           0 :   virtual Bool_t  GetTOFBit()            const { return fTof          ; }
      87           0 :   virtual Bool_t  GetChargedBit()        const { return fCharged      ; }
      88           0 :   virtual Int_t   DistToBad()            const { return fBadDist      ; }
      89           0 :   virtual Int_t   GetInputFileIndex()    const { return fInputFileIndex ; }
      90           0 :   virtual Int_t   GetFiducialArea()      const { return fFidArea      ; }
      91             : 
      92             :   // Tags
      93           0 :   virtual Int_t   GetTag()               const { return fTag          ; }
      94           0 :   virtual Bool_t  IsTagged()             const { return fTagged       ; }
      95           0 :   virtual Int_t   DecayTag()             const { return fDecayTag     ; }
      96           0 :   virtual Bool_t  IsIsolated()           const { return fIsolated     ; }
      97           0 :   virtual Bool_t  IsLeadingParticle()    const { return fLeadingParticle ; }
      98             : 
      99             :   // Calorimeter specific param
     100           0 :   virtual Int_t   GetNLM()               const { return fNLM          ; }
     101           0 :   virtual Float_t GetM02()               const { return fM02          ; }
     102           0 :   virtual Float_t GetM20()               const { return fM20          ; }
     103           0 :   virtual Float_t GetTime()              const { return fTime         ; }
     104           0 :   virtual Int_t   GetNCells()            const { return fNCells       ; }
     105           0 :   virtual Int_t   GetSModNumber()        const { return fSuperModule  ; }
     106             : 
     107             :   // Isolation cone background info
     108           0 :   virtual Float_t GetChargedLeadPtInCone() const { return fIsoConePtLead[0] ; } 
     109           0 :   virtual Float_t GetNeutralLeadPtInCone() const { return fIsoConePtLead[1] ; }   
     110             :   
     111           0 :   virtual Float_t GetChargedPtSumInCone () const { return fIsoConeSumPt[0]  ; } 
     112           0 :   virtual Float_t GetNeutralPtSumInCone () const { return fIsoConeSumPt[1]  ; }   
     113             :   
     114             :   //
     115             :   // Specific setters
     116           0 :   virtual void SetIdentifiedParticleType(Int_t pdg) { fPdg = pdg ; }
     117             : 
     118           0 :   virtual void SetLabel(Int_t l)         { fLabel = l ; }
     119           0 :   virtual void SetCaloLabel (Int_t a, Int_t b) { fCaloLabel [0] = a; fCaloLabel [1] = b  ; }
     120           0 :   virtual void SetTrackLabel(Int_t a, Int_t b) { fTrackLabel[0] = a; fTrackLabel[1] = b  ; }
     121             :   virtual void SetTrackLabel(Int_t a, Int_t b, Int_t c, Int_t d) 
     122           0 :   { fTrackLabel[0] = a; fTrackLabel[1] = b  ; fTrackLabel[2] = c; fTrackLabel[3] = d; }
     123             :   
     124           0 :   virtual void SetDetectorTag(UInt_t d)  { fDetectorTag = d    ; }
     125           0 :   virtual void SetDispBit(Bool_t disp)   { fDisp        = disp ; }
     126           0 :   virtual void SetTOFBit(Bool_t tof)     { fTof         = tof  ; }
     127           0 :   virtual void SetChargedBit(Bool_t ch)  { fCharged     = ch   ; }
     128           0 :   virtual void SetDistToBad(Int_t dist)  { fBadDist     = dist ; }
     129           0 :   virtual void SetInputFileIndex(Int_t i){ fInputFileIndex = i ; }
     130           0 :   virtual void SetFiducialArea(Int_t a)  { fFidArea     = a    ; }
     131             : 
     132             :   // Tags
     133           0 :   virtual void SetTag(Int_t tag)         { fTag         = tag  ; }
     134           0 :   virtual void SetTagged(Bool_t tag)     { fTagged      = tag  ; }
     135           0 :   virtual void SetDecayTag(Int_t tag)    { fDecayTag    = tag  ; }
     136           0 :   virtual void SetIsolated(Bool_t iso)   { fIsolated    = iso  ; }
     137           0 :   virtual void SetLeadingParticle(Bool_t l) { fLeadingParticle = l ; }
     138             :   
     139             :   // Calorimeter specific param
     140           0 :   virtual void SetNLM   (Int_t   nlm)    { fNLM         = nlm  ; }
     141           0 :   virtual void SetM02   (Float_t m02)    { fM02         = m02  ; }
     142           0 :   virtual void SetM20   (Float_t m20)    { fM20         = m20  ; }
     143           0 :   virtual void SetTime  (Float_t tim)    { fTime        = tim  ; }
     144           0 :   virtual void SetNCells(Int_t   nce)    { fNCells      = nce  ; }
     145           0 :   virtual void SetSModNumber(Int_t sm)   { fSuperModule = sm   ; }
     146             :   
     147             :   // Isolation cone background info
     148           0 :   virtual void SetChargedLeadPtInCone(Float_t ptl) { fIsoConePtLead[0] = ptl ; } 
     149           0 :   virtual void SetNeutralLeadPtInCone(Float_t ptl) { fIsoConePtLead[1] = ptl ; }   
     150             : 
     151           0 :   virtual void SetChargedPtSumInCone (Float_t pts) { fIsoConeSumPt[0]  = pts ; } 
     152           0 :   virtual void SetNeutralPtSumInCone (Float_t pts) { fIsoConeSumPt[1]  = pts ; }   
     153             :   
     154             :   //
     155             :   /// BTagging (not in use)
     156             :   /// enumerated type for various b-tags of electrons
     157             :   enum btagTypes {kDVMTag0, kDVMTag1, kDVMTag2, kTransverseIPTag, kUnknownTag};
     158             :   
     159           0 :   virtual void  SetBtag(Int_t tag)      { fBtag        = tag  ; }
     160           0 :   virtual Int_t GetBtag()         const { return fBtag        ; }
     161             : 
     162             :   /// Set bit of type set (btagTypes) in tag
     163           0 :   void SetBTagBit(Int_t &tag, UInt_t set) const { tag |= (1<<set) ; }
     164             :   
     165             :   /// Check if in fBtag the bit test (btagTypes) is set (not in use).
     166             :   Bool_t CheckBTagBit(Int_t tag, UInt_t test) const 
     167             :   {
     168           0 :     if (tag & (1<<test) ) return  kTRUE ;
     169           0 :     else                  return kFALSE ;
     170           0 :   }
     171             :   
     172             :  private:
     173             :   
     174             :   TLorentzVector* fMomentum;    ///< Photon 4-momentum vector
     175             :   Int_t      fPdg ;             ///< type of identified particle, same code as PDG, but this is not a MonteCarlo particle 
     176             :   Int_t      fTag ;             ///< tag of particle (decay, fragment, prompt photon), MC
     177             :   Int_t      fLabel ;           ///< MC label
     178             :   Int_t      fCaloLabel[2];     ///< CaloCluster index, 1 for photons, 2 for pi0.
     179             :   Int_t      fTrackLabel[4];    ///< Track lable, 1 for pions, 2 for conversion photons 
     180             :   UInt_t     fDetectorTag ;     ///< Detector where particle was measured, integer
     181             :   
     182             :   // Calo specific
     183             :   Int_t      fBadDist ;         ///< Distance to calorimeter bad cell in cell units
     184             :   UInt_t     fNLM ;             ///< Store the number of local maxima in calorimeter cluster
     185             :   Float_t    fM02 ;             ///< Store the main axis of the calorimeter shower shape
     186             :   Float_t    fM20 ;             ///< Store the second axis of the calorimeter shower shape
     187             :   Float_t    fTime;             ///< Store the time of calorimeter cluster or track, nano seconds
     188             :   Int_t      fNCells;           ///< Store the number of cells in calorimeter cluster
     189             :   Int_t      fSuperModule;      ///< Store the super-module number of calorimeter cluster
     190             :   
     191             :   // Tags
     192             :   Int_t      fDecayTag;         ///< Tag the photon as decay from, pi0, eta, pi0 side band, eta side band
     193             :   Bool_t     fIsolated ;        ///< Particle is isolated or not
     194             :   Bool_t     fLeadingParticle ; ///< Particle is leading or not
     195             : 
     196             :   Float_t    fIsoConePtLead[2]; ///< Pt of track [0] and calo cluster [1] with highest energy in the isolation cone
     197             :   Float_t    fIsoConeSumPt [2]; ///< Sum of Pt of tracks [0] and calo clusters [1] in the isolation cone
     198             :   
     199             :   // PID bits
     200             :   Bool_t     fDisp ;            ///< Dispersion bit
     201             :   Bool_t     fTof ;             ///< TOF bit
     202             :   Bool_t     fCharged ;         ///< Charged bit
     203             : 
     204             :   // Not in use currently ...
     205             :   Bool_t     fTagged ;          ///< If photon tagged (pi0 decay), not used anymore, replace by fDecayTag
     206             :   Int_t      fFidArea ;         ///< Type of fiducial area hit by this photon
     207             :   Int_t      fInputFileIndex;   ///< 0, standard input, 1 first input added. Only possible one for now, not really used.
     208             :   Int_t      fBtag;             ///< tag particle from B.
     209             : 
     210             :   /// \cond CLASSIMP
     211         170 :   ClassDef(AliAODPWG4Particle, 8);
     212             :   /// \endcond
     213             : 
     214             : };
     215             : 
     216             : ///
     217             : /// \return azimuth angle, shift 2pi in case the TLorentzVector::Phi() is negative
     218             : ///
     219             : inline Double_t AliAODPWG4Particle::Phi() const
     220             : {
     221           0 :   Double_t phi = fMomentum->Phi();
     222           0 :   if (phi < 0.) phi += TMath::TwoPi();
     223           0 :   return phi;
     224             : }
     225             : 
     226             : #endif //ALIAODPWG4PARTICLE_H

Generated by: LCOV version 1.11