]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSTrackSegmentMakerv1.h
New class to generate fake gain runs (Laurent)
[u/mrichter/AliRoot.git] / PHOS / AliPHOSTrackSegmentMakerv1.h
1 #ifndef ALIPHOSTRACKSEGMENTMAKERV1_H
2 #define ALIPHOSTRACKSEGMENTMAKERV1_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7 /* History of cvs commits:
8  *
9  * $Log$
10  * Revision 1.50  2007/03/06 06:54:48  kharlov
11  * DP:Calculation of cluster properties dep. on vertex added
12  *
13  * Revision 1.49  2007/02/01 13:59:11  hristov
14  * Forward declaration
15  *
16  * Revision 1.48  2006/08/28 10:01:56  kharlov
17  * Effective C++ warnings fixed (Timur Pocheptsov)
18  *
19  * Revision 1.47  2005/11/17 12:35:27  hristov
20  * Use references instead of objects. Avoid to create objects when they are not really needed
21  *
22  * Revision 1.46  2005/05/28 14:19:05  schutz
23  * Compilation warnings fixed by T.P.
24  *
25  */
26
27 //_________________________________________________________________________
28 // Implementation version 1 of algorithm class to construct PHOS track segments
29 // Associates EMC and CPV lusters
30 // Unfolds the EMC cluster   
31 //                  
32 //*-- Author: Dmitri Peressounko (RRC Ki & SUBATECH)
33
34 // --- ROOT system ---
35 #include <TVector3.h>
36
37 // --- Standard library ---
38
39 // --- AliRoot header files ---
40 #include "AliPHOSTrackSegmentMaker.h"
41
42 class AliPHOSEmcRecPoint ;
43 class AliPHOSCpvRecPoint ;
44 class TClonesArray;
45
46 class  AliPHOSTrackSegmentMakerv1 : public AliPHOSTrackSegmentMaker {
47
48 public:
49
50   AliPHOSTrackSegmentMakerv1() ;                     
51   AliPHOSTrackSegmentMakerv1(const TString & alirunFileNameFile, const TString & eventFolderName = AliConfig::GetDefaultEventFolderName());
52   AliPHOSTrackSegmentMakerv1(const AliPHOSTrackSegmentMakerv1 & tsm);
53
54   virtual ~ AliPHOSTrackSegmentMakerv1() ; // dtor
55   
56   //  virtual char*  GetRecPointsBranch    (void)const{return (char*)fRecPointsBranchTitle.Data() ;}
57   //  virtual char*  GetTrackSegmentsBranch(void)const{return (char*)fTrackSegmentsBranchTitle.Data() ;}
58   virtual Int_t GetTrackSegmentsInRun()const {return fTrackSegmentsInRun ;}  
59
60   virtual void   Exec(Option_t *option); // Does the job
61           void   FillOneModule() ;       // Finds range in which RecPoints belonging current PHOS module are
62
63           void   MakeLinks() const;      //Evaluates distances(links) between EMC and CPV
64           void   MakePairs() ;           //Finds pairs(triplets) with smallest link
65   virtual void   Print(const Option_t * = "") const ;
66   //Switch to "on flyght" mode, without writing to TreeR and file  
67   void SetWriting(Bool_t toWrite = kFALSE){fWrite = toWrite;} 
68   virtual void   SetMaxEmcCPVDistance(Float_t r){ fRcpv = r ;} //Maximal distance (in PHOS plane) 
69                                                                //between EMCrp and CPVrp
70   virtual void   SetMaxCPVTPCDistance(Float_t r){ fRtpc = r ;} //Maximal distance 
71                                                                //between EMCrp and extrapolation of TPC track
72   //  virtual void   SetRecPointsBranch(const char * title) { fRecPointsBranchTitle = title ;} 
73   //  virtual void   SetTrackSegmentsBranch(const char * title){ fTrackSegmentsBranchTitle = title ; }
74   virtual const char * Version() const { return "tsm-v1" ; }  
75
76   AliPHOSTrackSegmentMakerv1 & operator = (const AliPHOSTrackSegmentMakerv1 & )  {
77     // assignement operator requested by coding convention but not needed
78     Fatal("operator =", "not implemented") ;
79     return *this ; 
80   }
81   void Unload() ;
82
83 private:
84
85   const TString BranchName() const ; 
86   void  GetDistanceInPHOSPlane(AliPHOSEmcRecPoint * EmcClu , AliPHOSCpvRecPoint * Cpv, 
87                                Int_t & track, Float_t &dx, Float_t &dz ) const ; // see R0
88   void    Init() ;
89   void    InitParameters() ;
90   void    PrintTrackSegments(Option_t *option) ;
91   virtual void   WriteTrackSegments() ;
92
93 private:  
94
95   Bool_t  fDefaultInit;               //! Says if the task was created by defaut ctor (only parameters are initialized)
96   Bool_t  fWrite ;                   // Write Tracks to TreeT  
97  
98   Int_t fNTrackSegments ; // number of track segments found 
99
100   Float_t fRcpv ;        // Maximum distance between a EMC RecPoint and a CPV RecPoint   
101   Float_t fRtpc ;        // Maximum distance between a EMC RecPoint and extrapolation of a TPC track   
102   
103   TVector3 fVtx ;        //! Vertex in current position
104
105   TClonesArray * fLinkUpArray  ;  //!
106   Int_t fEmcFirst;     //! Index of first EMC RecPoint belonging to currect PHOS module
107   Int_t fEmcLast ;     //!
108   Int_t fCpvFirst;     //! Cpv upper layer     
109   Int_t fCpvLast;      //! 
110   Int_t fModule ;      //! number of module being processed
111   Int_t fTrackSegmentsInRun ; //! Total number of track segments in one run
112
113   ClassDef( AliPHOSTrackSegmentMakerv1,3)  // Implementation version 1 of algorithm class to make PHOS track segments 
114
115  };
116
117 #endif // AliPHOSTRACKSEGMENTMAKERV1_H