LCOV - code coverage report
Current view: top level - STEER/AOD - AliAODHeader.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 62 139 44.6 %
Date: 2016-06-14 17:26:59 Functions: 43 110 39.1 %

          Line data    Source code
       1             : #ifndef ALIAODHEADER_H
       2             : #define ALIAODHEADER_H
       3             : /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
       4             :  * See cxx source for full Copyright notice                               */
       5             : 
       6             : /* $Id$ */
       7             : 
       8             : //-------------------------------------------------------------------------
       9             : //     AOD event header class
      10             : //     Author: Markus Oldenburg, CERN
      11             : //-------------------------------------------------------------------------
      12             : 
      13             : #include <TVector2.h>
      14             : 
      15             : #include "AliVHeader.h"
      16             : #include "AliVAODHeader.h"
      17             : #include "AliAODVertex.h"
      18             : #include <TString.h>
      19             : #include <TBits.h>
      20             : #include "AliCentrality.h"
      21             : #include "AliEventplane.h"
      22             : 
      23             : class TGeoHMatrix;
      24             : class TString;
      25             : 
      26             : 
      27             : class AliAODHeader : public AliVAODHeader {
      28             : 
      29             :  public :
      30             :   AliAODHeader();
      31             :  
      32             :   AliAODHeader(Int_t nRun, UShort_t nBunchX, UInt_t nOrbit, UInt_t nPeriod, const Char_t *title="");
      33             :   AliAODHeader(Int_t nRun, 
      34             :                UShort_t nBunchX,
      35             :                UInt_t nOrbit,
      36             :                UInt_t nPeriod,
      37             :                Int_t refMult,
      38             :                Int_t refMultPos,
      39             :                Int_t refMultNeg,
      40             :                Int_t refMultComb05,
      41             :                Int_t refMultComb08,
      42             :                Int_t refMultComb10,
      43             :                Double_t magField,
      44             :                Double_t muonMagFieldScale,
      45             :                Double_t cent,
      46             :                Double_t eventplane,
      47             :                Double_t n1Energy,
      48             :                Double_t p1Energy,
      49             :                Double_t n2Energy,
      50             :                Double_t p2Energy,
      51             :                Double_t *emEnergy,
      52             :                ULong64_t triggerMask,ULong64_t triggerMaskNext50,
      53             :                UChar_t   triggerCluster,
      54             :                UInt_t    fEventType,
      55             :                const Float_t *vzeroEqFactors,
      56             :                const Char_t *title="",
      57             :                Int_t nMuons=0,
      58             :                Int_t nDimuons=0,
      59             :                Int_t nGlobalMuons=0,             // AU
      60             :                Int_t nGlobalDimuons=0,          // AU
      61             :                UInt_t daqAttrib=0);
      62             : 
      63             :   virtual ~AliAODHeader();
      64             :   AliAODHeader(const AliAODHeader& evt); 
      65             :   AliAODHeader& operator=(const AliAODHeader& evt);
      66             :   Bool_t    InitMagneticField() const;
      67             : 
      68           0 :   Int_t     GetRunNumber()          const { return fRunNumber;}
      69           0 :   Int_t     GetEventNumberESDFile() const { return fEventNumberESDFile;}
      70           0 :   Int_t     GetNumberOfESDTracks()    const { return fNumberESDTracks;}
      71           0 :   UShort_t  GetBunchCrossNumber()   const { return fBunchCrossNumber; }
      72           0 :   UInt_t    GetOrbitNumber()        const { return fOrbitNumber; }
      73           0 :   UInt_t    GetPeriodNumber()       const { return fPeriodNumber; }
      74           0 :   ULong64_t GetTriggerMask()        const { return fTriggerMask; }
      75           0 :   ULong64_t GetTriggerMaskNext50()  const { return fTriggerMaskNext50; }
      76           0 :   UChar_t   GetTriggerCluster()     const { return fTriggerCluster; }
      77           0 :   TString   GetFiredTriggerClasses()const { return fFiredTriggers;}
      78           0 :   UInt_t    GetEventType()          const { return fEventType; }
      79           0 :   Double_t  GetMagneticField()      const { return fMagneticField; }
      80           0 :   Double_t  GetMuonMagFieldScale()  const { return fMuonMagFieldScale; }
      81             :   
      82           0 :   Double_t  GetCentrality()         const { return fCentrality; }
      83           0 :   Double_t  GetEventplane()         const { return fEventplane; }
      84           0 :   Double_t  GetEventplaneMag()      const { return fEventplaneMag; }
      85           0 :   Double_t  GetEventplaneQx()       const { return fEventplaneQx; }
      86           0 :   Double_t  GetEventplaneQy()       const { return fEventplaneQy; }
      87           0 :   Double_t  GetZDCN1Energy()        const { return fZDCN1Energy; }
      88           0 :   Double_t  GetZDCP1Energy()        const { return fZDCP1Energy; }
      89           0 :   Double_t  GetZDCN2Energy()        const { return fZDCN2Energy; }
      90           0 :   Double_t  GetZDCP2Energy()        const { return fZDCP2Energy; }
      91           0 :   Double_t  GetZDCEMEnergy(Int_t i) const { return fZDCEMEnergy[i]; }
      92          16 :   Int_t     GetRefMultiplicity()    const { return fRefMult; }
      93           0 :   Int_t     GetRefMultiplicityPos() const { return fRefMultPos; }
      94           0 :   Int_t     GetRefMultiplicityNeg() const { return fRefMultNeg; }
      95           0 :   Int_t     GetNumberOfMuons()      const { return fNMuons; }
      96           0 :   Int_t     GetNumberOfDimuons()    const { return fNDimuons; }
      97           0 :   Int_t     GetNumberOfGlobalMuons()   const { return fNGlobalMuons; }      // AU
      98           0 :   Int_t     GetNumberOfGlobalDimuons() const { return fNGlobalDimuons; }    // AU
      99           0 :   Int_t     GetRefMultiplicityComb05() const { return fRefMultComb05; }
     100           0 :   Int_t     GetRefMultiplicityComb08() const { return fRefMultComb08; }
     101           0 :   Int_t     GetRefMultiplicityComb10() const { return fRefMultComb10; }
     102             : 
     103           0 :   UInt_t    GetDAQAttributes()         const {return fDAQAttributes;}
     104          16 :   void      SetDAQAttributes(UInt_t v)       {fDAQAttributes = v;}
     105             : 
     106             :   Double_t  GetQTheta(UInt_t i) const;
     107           0 :   UInt_t    GetNQTheta() const { return (UInt_t)fNQTheta; }
     108             : 
     109           0 :   Double_t GetDiamondX() const {return fDiamondXY[0];}
     110           0 :   Double_t GetDiamondY() const {return fDiamondXY[1];}
     111           0 :   Double_t GetDiamondZ() const {return fDiamondZ;}
     112           0 :   Double_t GetSigma2DiamondX() const {return fDiamondCovXY[0];}
     113           0 :   Double_t GetSigma2DiamondY() const {return fDiamondCovXY[2];}
     114           0 :   Double_t GetSigma2DiamondZ() const {return fDiamondSig2Z;}
     115             :   void GetDiamondCovXY(Float_t cov[3]) const {
     116           0 :     for(Int_t i=0;i<3;i++) cov[i]=fDiamondCovXY[i]; return;
     117             :   }
     118           0 :   UInt_t   GetL0TriggerInputs() const {return fL0TriggerInputs;}  
     119           0 :   UInt_t   GetL1TriggerInputs() const {return fL1TriggerInputs;} 
     120           0 :   UShort_t GetL2TriggerInputs() const {return fL2TriggerInputs;} 
     121           0 :   AliCentrality* GetCentralityP()  const { return fCentralityP; }
     122           0 :   AliEventplane* GetEventplaneP()  const { return fEventplaneP; }
     123             : 
     124             :   
     125          16 :   void SetRunNumber(Int_t nRun)                { fRunNumber = nRun; }
     126          16 :   void SetEventNumberESDFile(Int_t n)          { fEventNumberESDFile=n; }
     127          16 :   void SetNumberOfESDTracks(Int_t n)           { fNumberESDTracks=n; }
     128          16 :   void SetBunchCrossNumber(UShort_t nBx)       { fBunchCrossNumber = nBx; }
     129          16 :   void SetOrbitNumber(UInt_t nOr)              { fOrbitNumber = nOr; }
     130          16 :   void SetPeriodNumber(UInt_t nPer)            { fPeriodNumber = nPer; }
     131          16 :   void SetTriggerMask(ULong64_t trigMsk)       { fTriggerMask = trigMsk; }
     132          16 :   void SetTriggerMaskNext50(ULong64_t trigMsk) { fTriggerMaskNext50 = trigMsk; }
     133          16 :   void SetFiredTriggerClasses(TString trig)    { fFiredTriggers = trig;}
     134          16 :   void SetTriggerCluster(UChar_t trigClus)     { fTriggerCluster = trigClus; }
     135          16 :   void SetEventType(UInt_t evttype)            { fEventType = evttype; }
     136          16 :   void SetMagneticField(Double_t magFld)       { fMagneticField = magFld; }
     137          16 :   void SetMuonMagFieldScale(Double_t magFldScl){ fMuonMagFieldScale = magFldScl; }
     138             :   void SetCentrality(const AliCentrality* cent);
     139             :   void SetEventplane(AliEventplane* eventplane);
     140          16 :   void SetZDCN1Energy(Double_t n1Energy)       { fZDCN1Energy = n1Energy; }
     141          16 :   void SetZDCP1Energy(Double_t p1Energy)       { fZDCP1Energy = p1Energy; }
     142          16 :   void SetZDCN2Energy(Double_t n2Energy)       { fZDCN2Energy = n2Energy; }
     143          16 :   void SetZDCP2Energy(Double_t p2Energy)       { fZDCP2Energy = p2Energy; }
     144             :   void SetZDCEMEnergy(Double_t emEnergy1, Double_t emEnergy2)      
     145          16 :         { fZDCEMEnergy[0] = emEnergy1; fZDCEMEnergy[1] = emEnergy2;}
     146          16 :   void SetRefMultiplicity(Int_t refMult)       { fRefMult = refMult; }
     147          16 :   void SetRefMultiplicityPos(Int_t refMultPos) { fRefMultPos = refMultPos; }
     148          16 :   void SetRefMultiplicityNeg(Int_t refMultNeg) { fRefMultNeg = refMultNeg; }
     149           0 :   void SetNumberOfMuons(Int_t nMuons) { fNMuons = nMuons; }
     150           0 :   void SetNumberOfDimuons(Int_t nDimuons) { fNDimuons = nDimuons; }
     151           0 :   void SetNumberOfGlobalMuons(Int_t nGlobalMuons) { fNGlobalMuons = nGlobalMuons; }            // AU
     152           0 :   void SetNumberOfGlobalDimuons(Int_t nGlobalDimuons) { fNGlobalDimuons = nGlobalDimuons; }    // AU
     153          16 :   void SetRefMultiplicityComb05(Int_t refMult)   { fRefMultComb05 = refMult; }
     154          16 :   void SetRefMultiplicityComb08(Int_t refMult)   { fRefMultComb08 = refMult; }  
     155          16 :   void SetRefMultiplicityComb10(Int_t refMult)   { fRefMultComb10 = refMult; }  
     156             : 
     157             :   void SetQTheta(Double_t *QTheta, UInt_t size = 5);  
     158             :   void RemoveQTheta();
     159             : 
     160             :   void ResetEventplanePointer();
     161             :   
     162             :   void SetDiamond(Float_t xy[2],Float_t cov[3]) { 
     163          72 :     for(Int_t i=0;i<3;i++) {fDiamondCovXY[i] = cov[i];}
     164          48 :     for(Int_t i=0;i<2;i++) {fDiamondXY[i]    = xy[i] ;}
     165           8 :   }
     166             :   void SetDiamondZ(Float_t z, Float_t sig2z){
     167          16 :     fDiamondZ=z; fDiamondSig2Z=sig2z;
     168           8 :   }
     169          16 :   void SetL0TriggerInputs(UInt_t n)   {fL0TriggerInputs=n;}
     170          16 :   void SetL1TriggerInputs(UInt_t n)   {fL1TriggerInputs=n;}
     171          16 :   void SetL2TriggerInputs(UShort_t n) {fL2TriggerInputs=n;}
     172          16 :   void SetESDFileName(TString name)   {fESDFileName = name;}
     173             :   void Print(Option_t* option = "") const;
     174             : 
     175             :   void    SetPHOSMatrix(TGeoHMatrix*matrix, Int_t i) {
     176           0 :       if ((i >= 0) && (i < kNPHOSMatrix)) fPHOSMatrix[i] = matrix;
     177           0 :   }
     178             :   const TGeoHMatrix* GetPHOSMatrix(Int_t i) const {
     179           0 :       return ((i >= 0) && (i < kNPHOSMatrix)) ? fPHOSMatrix[i] : NULL;
     180             :   }
     181             :   
     182             :   void    SetEMCALMatrix(TGeoHMatrix*matrix, Int_t i) {
     183           0 :       if ((i >= 0) && (i < kNEMCALMatrix)) fEMCALMatrix[i] = matrix;
     184           0 :   }
     185             :   const TGeoHMatrix* GetEMCALMatrix(Int_t i) const {
     186           0 :       return ((i >= 0) && (i < kNEMCALMatrix)) ? fEMCALMatrix[i] : NULL;
     187             :   }
     188             :   
     189           0 :   UInt_t GetOfflineTrigger() { return fOfflineTrigger; }
     190          16 :   void   SetOfflineTrigger(UInt_t trigger) { fOfflineTrigger = trigger; }
     191           0 :   UInt_t GetNumberOfITSClusters(Int_t ilay) const {return fITSClusters[ilay];}
     192             :   void   SetITSClusters(Int_t ilay, UInt_t nclus);
     193           0 :   Int_t  GetTPConlyRefMultiplicity() const {return fTPConlyRefMult;}
     194          16 :   void   SetTPConlyRefMultiplicity(Int_t mult) {fTPConlyRefMult = mult;} 
     195             :   
     196           0 :   TString GetESDFileName() const  {return fESDFileName;}
     197             :   void Clear(Option_t* = "");
     198             :   enum {kNPHOSMatrix = 5};
     199             :   enum {kNEMCALMatrix = 22}; 
     200             :   enum {kT0SpreadSize = 4};
     201             : 
     202             :   void           SetVZEROEqFactors(const Float_t* factors) {
     203          16 :     if (factors)
     204        1056 :       for (Int_t i = 0; i < 64; ++i) fVZEROEqFactors[i] = factors[i];}
     205           0 :   const Float_t* GetVZEROEqFactors() const {return fVZEROEqFactors;}
     206           0 :   Float_t        GetVZEROEqFactors(Int_t i) const {return fVZEROEqFactors[i];}
     207             :   Float_t    GetT0spread(Int_t i) const {
     208           0 :     return ((i >= 0)  && (i<kT0SpreadSize)) ? fT0spread[i] : 0;}
     209             :   void       SetT0spread(Int_t i, Float_t t) {
     210         128 :     if ((i>=0)&&(i<kT0SpreadSize)) fT0spread[i]=t;}
     211             : 
     212             :   Int_t  FindIRIntInteractionsBXMap(Int_t difference) const;
     213          16 :   void   SetIRInt2InteractionMap(TBits bits) { fIRInt2InteractionsMap = bits; }
     214          16 :   void   SetIRInt1InteractionMap(TBits bits) { fIRInt1InteractionsMap = bits; }
     215           0 :   TBits  GetIRInt2InteractionMap() const { return fIRInt2InteractionsMap; }
     216           0 :   TBits  GetIRInt1InteractionMap() const { return fIRInt1InteractionsMap; }
     217             :   Int_t  GetIRInt2ClosestInteractionMap() const;
     218             :   Int_t  GetIRInt1ClosestInteractionMap(Int_t gap = 3) const;
     219             :   Int_t  GetIRInt2LastInteractionMap() const;
     220             :   
     221             :  private :
     222             :   
     223             :   Double32_t  fMagneticField;       // Solenoid Magnetic Field in kG
     224             :   Double32_t  fMuonMagFieldScale;   // magnetic field scale of muon arm magnet
     225             :   Double32_t  fCentrality;          // Centrality
     226             :   Double32_t  fEventplane;          // Event plane angle
     227             :   Double32_t  fEventplaneMag;       // Length of Q vector from TPC event plance
     228             :   Double32_t  fEventplaneQx;        // Q vector component x from TPC event plance
     229             :   Double32_t  fEventplaneQy;        // Q vector component y from TPC event plance
     230             :   Double32_t  fZDCN1Energy;         // reconstructed energy in the neutron1 ZDC
     231             :   Double32_t  fZDCP1Energy;         // reconstructed energy in the proton1 ZDC
     232             :   Double32_t  fZDCN2Energy;         // reconstructed energy in the neutron2 ZDC
     233             :   Double32_t  fZDCP2Energy;         // reconstructed energy in the proton2 ZDC
     234             :   Double32_t  fZDCEMEnergy[2];      // reconstructed energy in the electromagnetic ZDCs
     235             :   Int_t       fNQTheta;             // number of QTheta elements
     236             :   Double32_t *fQTheta;              // [fNQTheta] values to store Lee-Yang-Zeros
     237             :   ULong64_t   fTriggerMask;         // Trigger Type (mask)
     238             :   ULong64_t   fTriggerMaskNext50;   // Trigger Type (mask) for upper 50 slots
     239             :   TString     fFiredTriggers;       // String with fired triggers
     240             :   Int_t       fRunNumber;           // Run Number
     241             :   Int_t       fRefMult;             // reference multiplicity
     242             :   Int_t       fRefMultPos;          // reference multiplicity of positive particles
     243             :   Int_t       fRefMultNeg;          // reference multiplicity of negative particles
     244             :   Int_t       fNMuons;              // number of muons in the forward spectrometer
     245             :   Int_t       fNDimuons;            // number of dimuons in the forward spectrometer
     246             :   Int_t       fNGlobalMuons;        // number of muons in the forward spectrometer + MFT       // AU
     247             :   Int_t       fNGlobalDimuons;      // number of dimuons in the forward spectrometer + MFT     // AU
     248             :   UInt_t      fDAQAttributes;       // DAQ attibutes
     249             :   UInt_t      fEventType;           // Type of Event
     250             :   UInt_t      fOrbitNumber;         // Orbit Number
     251             :   UInt_t      fPeriodNumber;        // Period Number
     252             :   UShort_t    fBunchCrossNumber;    // BunchCrossingNumber
     253             :   Short_t     fRefMultComb05;       // combined reference multiplicity (tracklets + ITSTPC) in |eta|<0.5
     254             :   Short_t     fRefMultComb08;       // combined reference multiplicity (tracklets + ITSTPC) in |eta|<0.8
     255             :   Short_t     fRefMultComb10;       // combined reference multiplicity (tracklets + ITSTPC) in |eta|<1.0
     256             :   UChar_t     fTriggerCluster;      // Trigger cluster (mask)
     257             :   Double32_t      fDiamondXY[2];    // Interaction diamond (x,y) in RUN
     258             :   Double32_t      fDiamondCovXY[3]; // Interaction diamond covariance (x,y) in RUN
     259             :   Double32_t      fDiamondZ;        // Interaction diamond (z) in RUN
     260             :   Double32_t      fDiamondSig2Z;    // Interaction diamond sigma^2 (z) in RUN
     261             :   TGeoHMatrix*    fPHOSMatrix[kNPHOSMatrix];   //PHOS module position and orientation matrices
     262             :   TGeoHMatrix*    fEMCALMatrix[kNEMCALMatrix]; //EMCAL supermodule position and orientation matrices
     263             :   UInt_t      fOfflineTrigger;      // fired offline triggers for this event
     264             :   TString     fESDFileName;         // ESD file name to which this event belongs
     265             :   Int_t       fEventNumberESDFile;  // Event number in ESD file
     266             :   Int_t       fNumberESDTracks;     // Number of tracks in origingal ESD event
     267             :   UInt_t      fL0TriggerInputs;     // L0 Trigger Inputs (mask)
     268             :   UInt_t      fL1TriggerInputs;     // L1 Trigger Inputs (mask)
     269             :   UShort_t    fL2TriggerInputs;     // L2 Trigger Inputs (mask)
     270             :   UInt_t      fITSClusters[6];      // Number of ITS cluster per layer
     271             :   Int_t       fTPConlyRefMult;      // Reference multiplicty for standard TPC only tracks
     272             :   AliCentrality* fCentralityP;      // Pointer to full centrality information
     273             :   AliEventplane* fEventplaneP;      // Pointer to full event plane information
     274             :   Float_t     fVZEROEqFactors[64];  // V0 channel equalization factors for event-plane reconstruction
     275             :   Float_t     fT0spread[kT0SpreadSize]; // spread of time distributions: (TOA+T0C/2), T0A, T0C, (T0A-T0C)/2
     276             :   TBits   fIRInt2InteractionsMap;  // map of the Int2 events (normally 0TVX) near the event, that's Int2Id-EventId in a -90 to 90 window
     277             :   TBits   fIRInt1InteractionsMap;  // map of the Int1 events (normally V0A&V0C) near the event, that's Int1Id-EventId in a -90 to 90 window
     278         222 :   ClassDef(AliAODHeader, 28);
     279             : };
     280             : inline
     281             : void AliAODHeader::SetCentrality(const AliCentrality* cent)      { 
     282          16 :     if(cent){
     283          14 :         if(fCentralityP)*fCentralityP = *cent;
     284           4 :         else fCentralityP = new AliCentrality(*cent);
     285           8 :         fCentrality = cent->GetCentralityPercentile("V0M");
     286           8 :     }
     287             :     else{
     288           0 :         fCentrality = -999;
     289             :     }
     290           8 : }
     291             : inline
     292             : void AliAODHeader::SetEventplane(AliEventplane* eventplane)      { 
     293          16 :     if(eventplane){
     294          14 :         if(fEventplaneP)*fEventplaneP = *eventplane;
     295           4 :         else fEventplaneP = new AliEventplane(*eventplane);
     296           8 :         fEventplane = eventplane->GetEventplane("Q");
     297           8 :         const TVector2* qvect=eventplane->GetQVector();
     298           8 :         fEventplaneMag = -999;
     299           8 :         fEventplaneQx = -999;
     300           8 :         fEventplaneQy = -999;
     301           8 :         if (qvect) {
     302           0 :           fEventplaneMag=qvect->Mod();
     303           0 :           fEventplaneQx=qvect->X();
     304           0 :           fEventplaneQy=qvect->Y();
     305           0 :         }
     306           8 :     }
     307             :     else{
     308           0 :         fEventplane = -999;
     309           0 :         fEventplaneMag = -999;
     310           0 :         fEventplaneQx = -999;
     311           0 :         fEventplaneQy = -999;
     312             :     }
     313           8 : }
     314             : inline
     315             : void AliAODHeader::ResetEventplanePointer()      {
     316           0 :   delete fEventplaneP;
     317           0 :   fEventplaneP = 0x0;
     318           0 : }
     319             : 
     320             : inline
     321             : void AliAODHeader::SetITSClusters(Int_t ilay, UInt_t nclus)
     322             : {
     323         144 :     if (ilay >= 0 && ilay < 6) fITSClusters[ilay] = nclus;
     324          48 : }
     325             : 
     326             : 
     327             : #endif

Generated by: LCOV version 1.11