]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/PHOSTasks/ClusterSelection/AliPHOSTriggerUtils.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGGA / PHOSTasks / ClusterSelection / AliPHOSTriggerUtils.h
1 #ifndef ALIPHOSTRIGGERUTILS_H
2 #define ALIPHOSTRIGGERUTILS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 //_________________________________________________________________________
7 // class to test trigger information of PHOS trigger
8 // and to model it in MC simulations
9 // 
10 //*-- Author: Dmitri Peressounko (RRC "KI")
11
12 // --- ROOT system ---
13 #include "TNamed.h"
14 class TF1 ;
15 class TH2I;
16
17 // --- AliRoot header files ---
18 class AliVCluster ;
19 class AliVEvent ;
20 class AliPHOSGeoUtils;
21
22 class AliPHOSTriggerUtils : public TNamed {
23
24 public: 
25
26   AliPHOSTriggerUtils() ;
27   AliPHOSTriggerUtils(const Text_t* name, const Text_t* title="") ;
28   AliPHOSTriggerUtils(const AliPHOSTriggerUtils & utils) ;
29   
30   virtual ~AliPHOSTriggerUtils(void){} ; 
31   AliPHOSTriggerUtils & operator = (const AliPHOSTriggerUtils  & rvalue) ;
32
33   void SetEvent(AliVEvent * event); //sets ref. to current event; inits class for new run if necessary
34   
35   Bool_t IsFiredTrigger(AliVCluster * clu) ; //Returns true if this cluster fired PHOS trigger in event
36   
37   Bool_t IsFiredTriggerMC(AliVCluster * clu) ;  //For MC simulations without detailed PHOS trigger
38                                                     //Returns true if this cluster should fire PHOS trigger
39                                                     //according to parameterization of turn-on curve and trigger bad map
40                                                     
41   void ReadTriggerParams(const char * filename); //Read trigger info (bad map, parameterizations) from specific file, ignore OADB        
42   
43   void SetTileOffset(Int_t left=-1, Int_t right=3){fbdrL=left;fbdrR=right ;}
44   
45 protected:
46   
47   void InitForRun(Int_t run) ; //read trigger bad map for this run from OADB. Should be called once per run
48   Bool_t TestBadMap(Int_t mod, Int_t ix,Int_t iz) ; //Check if trigger is in good/active region
49   Int_t FindBranch(Int_t nX, Int_t nZ) ; //Calculate number of PHOS branch
50   
51   
52 private:
53   Int_t fbdrL ;  //Offset between cell and trigger 4x4 tile
54   Int_t fbdrR ;  //in left/right (top/bottom) directions              
55   
56   Int_t fRun ;         //current run number (-1 not set yet, -2 use input file set with ReadTriggerParams)  
57   AliVEvent * fEvent ; //! Ref to current ESD/AOD event
58   
59   //Trigger bad map for 5 modules
60   TH2I * fPHOSBadMap[5] ;
61   AliPHOSGeoUtils* fGeom ;  //! PHOS geometry
62   
63   //Parameterization of turn-on curves
64   TF1 * fTOC[5][8];     //parameterization of turn-on curves for 5 modules and 8 branches/module
65   
66   Int_t fNtrg4x4 ;       //! Number of triggers in current event
67   Int_t fTrMod4x4[1000]; //! trigger modules
68   Int_t fTrX4x4[1000] ;  //! trigger X coordinates
69   Int_t fTrZ4x4[1000] ;  //! trigger Z coordinates
70   
71   
72   ClassDef(AliPHOSTriggerUtils,1)       // PHOS trigger analysis class 
73
74 } ;
75
76 #endif // AliPHOSTRIGERUTILS_H
77