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

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : 
      17             : #include "AliAODPWG4Particle.h"
      18             : 
      19             : /// \cond CLASSIMP
      20         170 : ClassImp(AliAODPWG4Particle)
      21             : /// \endcond
      22             : 
      23             : 
      24             : //______________________________________________________________________________
      25             : ///
      26             : /// Constructor.
      27             : ///
      28             : AliAODPWG4Particle::AliAODPWG4Particle() :
      29           0 : AliVParticle(),
      30           0 : fMomentum(0),fPdg(-1), fTag(0), fLabel(-1),
      31           0 : fCaloLabel(), fTrackLabel(), fDetectorTag(-1),
      32           0 : fBadDist(0), fNLM(0), fM02(0), fM20(0),
      33           0 : fTime(0),fNCells(0),fSuperModule(0),
      34           0 : fDecayTag(0),fIsolated(0), fLeadingParticle(0),
      35           0 : fIsoConePtLead(), fIsoConeSumPt(),
      36           0 : fDisp(0), fTof(0), fCharged(0),
      37           0 : fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(0)
      38           0 : {
      39           0 :   fCaloLabel [0] = -1;
      40           0 :   fCaloLabel [1] = -1;
      41           0 :   fTrackLabel[0] = -1;
      42           0 :   fTrackLabel[1] = -1;
      43           0 :   fTrackLabel[2] = -1;
      44           0 :   fTrackLabel[3] = -1;
      45             :   
      46           0 :   fIsoConePtLead[0] = 0.;
      47           0 :   fIsoConeSumPt [0] = 0.;
      48           0 :   fIsoConePtLead[1] = 0.;
      49           0 :   fIsoConeSumPt [1] = 0.;
      50           0 : }
      51             : 
      52             : //______________________________________________________________________________
      53             : ///
      54             : /// Constructor.
      55             : ///
      56             : /// \param px particle momentum in x
      57             : /// \param py particle momentum in y
      58             : /// \param pz particle momentum in z
      59             : /// \param e particle energy
      60             : ///
      61             : /// particle: cluster or track
      62             : ///
      63             : AliAODPWG4Particle::AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e):
      64           0 :   AliVParticle(),
      65           0 :   fMomentum(0),fPdg(-1), fTag(0), fLabel(-1),
      66           0 :   fCaloLabel(), fTrackLabel(), fDetectorTag(-1),
      67           0 :   fBadDist(0), fNLM(0), fM02(0), fM20(0),
      68           0 :   fTime(0),fNCells(0),fSuperModule(0),
      69           0 :   fDecayTag(0),fIsolated(0), fLeadingParticle(0),
      70           0 :   fIsoConePtLead(), fIsoConeSumPt(),
      71           0 :   fDisp(0), fTof(0), fCharged(0),
      72           0 :   fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(0)
      73           0 : {
      74           0 :   fMomentum = new TLorentzVector(px, py, pz, e);
      75             :   
      76           0 :   fCaloLabel [0] = -1;
      77           0 :   fCaloLabel [1] = -1;
      78           0 :   fTrackLabel[0] = -1;
      79           0 :   fTrackLabel[1] = -1;  
      80           0 :   fTrackLabel[2] = -1;
      81           0 :   fTrackLabel[3] = -1;  
      82             :   
      83           0 :   fIsoConePtLead[0] = 0.;
      84           0 :   fIsoConeSumPt [0] = 0.;
      85           0 :   fIsoConePtLead[1] = 0.;
      86           0 :   fIsoConeSumPt [1] = 0.;
      87           0 : }
      88             : 
      89             : //______________________________________________________________________________
      90             : ///
      91             : /// Constructor.
      92             : ///
      93             : /// \param p: TLorentzVector of particle kinematics.
      94             : ///
      95             : /// particle: cluster or track
      96             : ///
      97             : AliAODPWG4Particle::AliAODPWG4Particle(TLorentzVector & p):
      98           0 :   AliVParticle(),
      99           0 :   fMomentum(0),fPdg(-1), fTag(0), fLabel(-1),
     100           0 :   fCaloLabel(), fTrackLabel(),fDetectorTag(-1),
     101           0 :   fBadDist(0), fNLM(0), fM02(0), fM20(0),
     102           0 :   fTime(0),fNCells(0),fSuperModule(0),
     103           0 :   fDecayTag(0),fIsolated(0), fLeadingParticle(0),
     104           0 :   fIsoConePtLead(), fIsoConeSumPt(),
     105           0 :   fDisp(0), fTof(0), fCharged(0),
     106           0 :   fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(0)
     107           0 : {
     108           0 :   fMomentum = new TLorentzVector(p);
     109             :   
     110           0 :   fCaloLabel [0] = -1;
     111           0 :   fCaloLabel [1] = -1;
     112           0 :   fTrackLabel[0] = -1;
     113           0 :   fTrackLabel[1] = -1;
     114           0 :   fTrackLabel[2] = -1;
     115           0 :   fTrackLabel[3] = -1;
     116             :   
     117           0 :   fIsoConePtLead[0] = 0.;
     118           0 :   fIsoConeSumPt [0] = 0.;
     119           0 :   fIsoConePtLead[1] = 0.;
     120           0 :   fIsoConeSumPt [1] = 0.;  
     121           0 : }
     122             : 
     123             : //______________________________________________________________________________
     124             : ///
     125             : /// Destructor.
     126             : ///
     127             : AliAODPWG4Particle::~AliAODPWG4Particle() 
     128           0 : {
     129           0 :     delete fMomentum;
     130           0 : }
     131             : 
     132             : //______________________________________________________________________________
     133             : ///
     134             : /// Clear pointers.
     135             : ///
     136             : void AliAODPWG4Particle::Clear(const Option_t* /*opt*/) 
     137             : {
     138           0 :   delete fMomentum;
     139           0 : }
     140             : 
     141             : //______________________________________________________________________________
     142             : ///
     143             : ///  Copy constructor.
     144             : ///
     145             : AliAODPWG4Particle::AliAODPWG4Particle(const AliAODPWG4Particle& part) :
     146           0 :   AliVParticle(part),
     147           0 :   fMomentum(0), fPdg(part.fPdg), fTag(part.fTag), fLabel(part.fLabel),
     148           0 :   fCaloLabel(), fTrackLabel(), fDetectorTag(part.fDetectorTag),
     149           0 :   fBadDist(part.fBadDist),fNLM(part.fNLM), fM02(part.fM02), fM20(part.fM20),
     150           0 :   fTime(part.fTime),fNCells(part.fNCells),fSuperModule(part.fSuperModule),
     151           0 :   fDecayTag(part.fDecayTag),fIsolated(part.fIsolated), fLeadingParticle(part.fLeadingParticle),
     152           0 :   fDisp(part.fDisp), fTof(part.fTof), fCharged(part.fCharged),
     153           0 :   fTagged(part.fTagged), fFidArea(part.fFidArea), fInputFileIndex(part.fInputFileIndex),fBtag(part.fBtag)
     154           0 : {
     155           0 :   fMomentum = new TLorentzVector(*part.fMomentum);
     156             :   
     157           0 :   fCaloLabel [0] = part.fCaloLabel[0];
     158           0 :   fCaloLabel [1] = part.fCaloLabel[1];
     159           0 :   fTrackLabel[0] = part.fTrackLabel[0];
     160           0 :   fTrackLabel[1] = part.fTrackLabel[1];
     161           0 :   fTrackLabel[2] = part.fTrackLabel[2];
     162           0 :   fTrackLabel[3] = part.fTrackLabel[3];
     163             :   
     164           0 :   fIsoConePtLead[0] = part.fIsoConePtLead[0];
     165           0 :   fIsoConeSumPt [0] = part.fIsoConeSumPt [0];
     166           0 :   fIsoConePtLead[1] = part.fIsoConePtLead[1];
     167           0 :   fIsoConeSumPt [1] = part.fIsoConeSumPt [1];
     168           0 : }
     169             : 
     170             : //________________________________________________________________________________
     171             : ///
     172             : /// Assignment operator.
     173             : ///
     174             : AliAODPWG4Particle& AliAODPWG4Particle::operator=(const AliAODPWG4Particle & part)
     175             : {
     176           0 :   if(this!=&part)
     177             :   {
     178           0 :     fPdg   = part.fPdg;
     179           0 :     fTag   = part.fTag;
     180           0 :     fLabel = part.fLabel;
     181             :     
     182           0 :     fCaloLabel [0] = part.fCaloLabel[0];
     183           0 :     fCaloLabel [1] = part.fCaloLabel[1];
     184           0 :     fTrackLabel[0] = part.fTrackLabel[0];
     185           0 :     fTrackLabel[1] = part.fTrackLabel[1];
     186             :     
     187           0 :     fIsoConePtLead[0] = part.fIsoConePtLead[0];
     188           0 :     fIsoConeSumPt [0] = part.fIsoConeSumPt [0];
     189           0 :     fIsoConePtLead[1] = part.fIsoConePtLead[1];
     190           0 :     fIsoConeSumPt [1] = part.fIsoConeSumPt [1];
     191             :     
     192           0 :     fDetectorTag = part.fDetectorTag;
     193           0 :     fDisp     = part.fDisp;
     194           0 :     fTof      = part.fTof;
     195           0 :     fCharged  = part.fCharged;
     196           0 :     fBadDist  = part.fBadDist;
     197           0 :     fDecayTag = part.fDecayTag;
     198             :     
     199           0 :     fNLM      = part.fNLM;
     200           0 :     fM02      = part.fM02;
     201           0 :     fM20      = part.fM20;
     202           0 :     fIsolated = part.fIsolated;
     203           0 :     fLeadingParticle =part.fLeadingParticle;
     204             : 
     205           0 :     fBtag     = part.fBtag;
     206           0 :     fFidArea  = part.fFidArea;
     207           0 :     fTagged   = part.fTagged;
     208           0 :     fInputFileIndex =  part.fInputFileIndex;
     209             : 
     210           0 :     if (fMomentum ) delete fMomentum;
     211           0 :     fMomentum = new TLorentzVector(*part.fMomentum);
     212           0 :   }
     213             :   
     214           0 :   return *this;
     215           0 : }
     216             : 
     217             : //_______________________________________________________________
     218             : ///
     219             : /// \return true if particle satisfies given PID criterium
     220             : ///
     221             : Bool_t AliAODPWG4Particle::IsPIDOK(Int_t ipid, Int_t pdgwanted) const
     222             : {
     223           0 :         switch(ipid)
     224             :   {
     225           0 :     case 0: return kTRUE ; //No PID at all
     226             :     case 1:
     227             :           {
     228           0 :             if (fPdg == pdgwanted) return kTRUE;
     229           0 :             else return kFALSE; //Overall PID calculated with bayesian methods.
     230             :           }
     231           0 :     case 2: return fDisp ;   //only dispersion cut
     232           0 :     case 3: return fTof ;    //Only TOF cut
     233           0 :     case 4: return fCharged ;    //Only Charged cut
     234           0 :     case 5: return fDisp && fTof ;  //Dispersion and TOF
     235           0 :     case 6: return fDisp && fCharged ;  //Dispersion and Charged
     236           0 :     case 7: return fTof  && fCharged ;  //TOF and Charged
     237           0 :     case 8: return fDisp && fTof && fCharged ; // all 3 cuts
     238           0 :     default: return kFALSE ; //Not known combination
     239             :         }
     240           0 : }
     241             : 
     242             : //_________________________________________________________
     243             : ///
     244             : /// Print information of all data members.
     245             : ///
     246             : void AliAODPWG4Particle::Print(Option_t* /*option*/) const 
     247             : {  
     248           0 :   printf("Particle 4-vector:\n");
     249           0 :   printf("     E  = %13.3f", E() );
     250           0 :   printf("     Px = %13.3f", Px());
     251           0 :   printf("     Py = %13.3f", Py());
     252           0 :   printf("     Pz = %13.3f\n", Pz());
     253           0 :   printf("Id PDG     : %d\n",fPdg);
     254           0 :   printf("MC Tag     : %d\n",fTag);
     255           0 :   printf("Dist. to bad channel : %d\n",fBadDist);
     256             : 
     257           0 :   printf("Detector  : %d, Labels:\n",fDetectorTag);
     258           0 :   printf("      Calo: %d, %d \n",fCaloLabel[0],fCaloLabel[1]);
     259           0 :   printf("      Track: %d, %d, %d, %d \n",fTrackLabel[0],fTrackLabel[1],fTrackLabel[2],fTrackLabel[3]);
     260             :   
     261           0 :   if(fDetectorTag!=2) // Avoid tracks, AliFiducialCut::kCTS
     262             :   {
     263           0 :     printf("Calo param: \n");
     264           0 :     printf("      M02: %2.2f\n",fM02);
     265           0 :     printf("      M20: %2.2f\n",fM20);
     266           0 :     printf("      NCell: %d\n",fNCells);
     267           0 :     printf("      Time: %2.3f\n",fTime);
     268           0 :     printf("      SModule: %d\n",fSuperModule);
     269           0 :   }
     270             :   
     271           0 :   printf("Tags: \n");
     272             : //  printf("Btag      : %d\n",fBtag);
     273           0 :   printf("     Pi0 Tag   : %d\n",fDecayTag);
     274           0 :   if(fIsolated)        printf("      Isolated! \n");
     275           0 :   if(fLeadingParticle) printf("      Leading! \n");
     276             :   
     277           0 :   printf("Isolation cone: \n");
     278           0 :   printf("\t charged: pT Max %2.2f, Sum pT %2.2f",fIsoConePtLead[0],fIsoConeSumPt[0]);
     279           0 :   printf("\t neutral: pT Max %2.2f, Sum pT %2.2f",fIsoConePtLead[1],fIsoConeSumPt[1]);
     280             :   
     281           0 :   printf("PID bits :\n");
     282           0 :   printf("     TOF        : %d",fTof);
     283           0 :   printf("     Charged    : %d",fCharged);
     284           0 :   printf("     Dispersion : %d\n",fDisp);
     285             : 
     286             :   //  printf("Fid Area  : %d\n",fFidArea);
     287             :   //  printf("Input File Index : %d\n",fInputFileIndex);
     288           0 : }

Generated by: LCOV version 1.11